gear-second 3.0.0 → 3.0.1
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/index.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
* @vue/runtime-dom v3.5.24
|
|
18
18
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
19
|
* @license MIT
|
|
20
|
-
**/let Vi;const nl=typeof window<"u"&&window.trustedTypes;if(nl)try{Vi=nl.createPolicy("vue",{createHTML:e=>e})}catch{}const ol=Vi?e=>Vi.createHTML(e):e=>e,Fu="http://www.w3.org/2000/svg",Wu="http://www.w3.org/1998/Math/MathML",qt=typeof document<"u"?document:null,il=qt&&qt.createElement("template"),qu={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const i=t==="svg"?qt.createElementNS(Fu,e):t==="mathml"?qt.createElementNS(Wu,e):n?qt.createElement(e,{is:n}):qt.createElement(e);return e==="select"&&o&&o.multiple!=null&&i.setAttribute("multiple",o.multiple),i},createText:e=>qt.createTextNode(e),createComment:e=>qt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>qt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,i,r){const s=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{il.innerHTML=ol(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=il.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Jt="transition",Kn="animation",Zn=Symbol("_vtc"),rl={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Uu=Ie({},as,rl),Vo=(e=>(e.displayName="Transition",e.props=Uu,e))((e,{slots:t})=>tl(Rc,Ku(e),t)),dn=(e,t=[])=>{ie(e)?e.forEach(n=>n(...t)):e&&e(...t)},sl=e=>e?ie(e)?e.some(t=>t.length>1):e.length>1:!1;function Ku(e){const t={};for(const T in e)T in rl||(t[T]=e[T]);if(e.css===!1)return t;const{name:n="v",type:o,duration:i,enterFromClass:r=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=r,appearActiveClass:u=s,appearToClass:c=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,x=Zu(i),_=x&&x[0],D=x&&x[1],{onBeforeEnter:b,onEnter:P,onEnterCancelled:A,onLeave:w,onLeaveCancelled:g,onBeforeAppear:I=b,onAppear:q=P,onAppearCancelled:K=A}=t,R=(T,Y,S,J)=>{T._enterCancelled=J,fn(T,Y?c:l),fn(T,Y?u:s),S&&S()},Q=(T,Y)=>{T._isLeaving=!1,fn(T,d),fn(T,p),fn(T,f),Y&&Y()},H=T=>(Y,S)=>{const J=T?q:P,F=()=>R(Y,T,S);dn(J,[Y,F]),ll(()=>{fn(Y,T?a:r),Ut(Y,T?c:l),sl(J)||al(Y,o,_,F)})};return Ie(t,{onBeforeEnter(T){dn(b,[T]),Ut(T,r),Ut(T,s)},onBeforeAppear(T){dn(I,[T]),Ut(T,a),Ut(T,u)},onEnter:H(!1),onAppear:H(!0),onLeave(T,Y){T._isLeaving=!0;const S=()=>Q(T,Y);Ut(T,d),T._enterCancelled?(Ut(T,f),dl(T)):(dl(T),Ut(T,f)),ll(()=>{T._isLeaving&&(fn(T,d),Ut(T,p),sl(w)||al(T,o,D,S))}),dn(w,[T,S])},onEnterCancelled(T){R(T,!1,void 0,!0),dn(A,[T])},onAppearCancelled(T){R(T,!0,void 0,!0),dn(K,[T])},onLeaveCancelled(T){Q(T),dn(g,[T])}})}function Zu(e){if(e==null)return null;if(Ce(e))return[Ni(e.enter),Ni(e.leave)];{const t=Ni(e);return[t,t]}}function Ni(e){return ci(e)}function Ut(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Zn]||(e[Zn]=new Set)).add(t)}function fn(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Zn];n&&(n.delete(t),n.size||(e[Zn]=void 0))}function ll(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Yu=0;function al(e,t,n,o){const i=e._endId=++Yu,r=()=>{i===e._endId&&o()};if(n!=null)return setTimeout(r,n);const{type:s,timeout:l,propCount:a}=Xu(e,t);if(!s)return o();const u=s+"end";let c=0;const d=()=>{e.removeEventListener(u,f),r()},f=p=>{p.target===e&&++c>=a&&d()};setTimeout(()=>{c<a&&d()},l+1),e.addEventListener(u,f)}function Xu(e,t){const n=window.getComputedStyle(e),o=x=>(n[x]||"").split(", "),i=o(`${Jt}Delay`),r=o(`${Jt}Duration`),s=cl(i,r),l=o(`${Kn}Delay`),a=o(`${Kn}Duration`),u=cl(l,a);let c=null,d=0,f=0;t===Jt?s>0&&(c=Jt,d=s,f=r.length):t===Kn?u>0&&(c=Kn,d=u,f=a.length):(d=Math.max(s,u),c=d>0?s>u?Jt:Kn:null,f=c?c===Jt?r.length:a.length:0);const p=c===Jt&&/\b(?:transform|all)(?:,|$)/.test(o(`${Jt}Property`).toString());return{type:c,timeout:d,propCount:f,hasTransform:p}}function cl(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>ul(n)+ul(e[o])))}function ul(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function dl(e){return(e?e.ownerDocument:document).body.offsetHeight}function Gu(e,t,n){const o=e[Zn];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const No=Symbol("_vod"),fl=Symbol("_vsh"),pl={name:"show",beforeMount(e,{value:t},{transition:n}){e[No]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Yn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Yn(e,!0),o.enter(e)):o.leave(e,()=>{Yn(e,!1)}):Yn(e,t))},beforeUnmount(e,{value:t}){Yn(e,t)}};function Yn(e,t){e.style.display=t?e[No]:"none",e[fl]=!t}const Ju=Symbol(""),Qu=/(?:^|;)\s*display\s*:/;function ed(e,t,n){const o=e.style,i=Oe(n);let r=!1;if(n&&!i){if(t)if(Oe(t))for(const s of t.split(";")){const l=s.slice(0,s.indexOf(":")).trim();n[l]==null&&Ro(o,l,"")}else for(const s in t)n[s]==null&&Ro(o,s,"");for(const s in n)s==="display"&&(r=!0),Ro(o,s,n[s])}else if(i){if(t!==n){const s=o[Ju];s&&(n+=";"+s),o.cssText=n,r=Qu.test(n)}}else t&&e.removeAttribute("style");No in e&&(e[No]=r?o.display:"",e[fl]&&(o.display="none"))}const hl=/\s*!important$/;function Ro(e,t,n){if(ie(n))n.forEach(o=>Ro(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=td(e,t);hl.test(n)?e.setProperty(et(o),n.replace(hl,""),"important"):e[o]=n}}const gl=["Webkit","Moz","ms"],Ri={};function td(e,t){const n=Ri[t];if(n)return n;let o=Re(t);if(o!=="filter"&&o in e)return Ri[t]=o;o=so(o);for(let i=0;i<gl.length;i++){const r=gl[i]+o;if(r in e)return Ri[t]=r}return t}const ml="http://www.w3.org/1999/xlink";function vl(e,t,n,o,i,r=Ya(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ml,t.slice(6,t.length)):e.setAttributeNS(ml,t,n):n==null||r&&!Er(n)?e.removeAttribute(t):e.setAttribute(t,r?"":yt(n)?String(n):n)}function bl(e,t,n,o,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ol(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let s=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Er(n):n==null&&l==="string"?(n="",s=!0):l==="number"&&(n=0,s=!0)}try{e[t]=n}catch{}s&&e.removeAttribute(i||t)}function pn(e,t,n,o){e.addEventListener(t,n,o)}function nd(e,t,n,o){e.removeEventListener(t,n,o)}const yl=Symbol("_vei");function od(e,t,n,o,i=null){const r=e[yl]||(e[yl]={}),s=r[t];if(o&&s)s.value=o;else{const[l,a]=id(t);if(o){const u=r[t]=ld(o,i);pn(e,l,u,a)}else s&&(nd(e,l,s,a),r[t]=void 0)}}const wl=/(?:Once|Passive|Capture)$/;function id(e){let t;if(wl.test(e)){t={};let o;for(;o=e.match(wl);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):et(e.slice(2)),t]}let Hi=0;const rd=Promise.resolve(),sd=()=>Hi||(rd.then(()=>Hi=0),Hi=Date.now());function ld(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;xt(ad(o,n.value),t,5,[o])};return n.value=e,n.attached=sd(),n}function ad(e,t){if(ie(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(o=>i=>!i._stopped&&o&&o(i))}else return t}const xl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,cd=(e,t,n,o,i,r)=>{const s=i==="svg";t==="class"?Gu(e,o,s):t==="style"?ed(e,n,o):no(t)?ii(t)||od(e,t,n,o,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ud(e,t,o,s))?(bl(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&vl(e,t,o,s,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Oe(o))?bl(e,Re(t),o,r,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),vl(e,t,o,s))};function ud(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&xl(t)&&de(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return xl(t)&&Oe(n)?!1:t in e}const _l={};function dd(e,t,n){let o=pe(e,t);io(o)&&(o=Ie({},o,t));class i extends Fi{constructor(s){super(o,s,n)}}return i.def=o,i}const fd=typeof HTMLElement<"u"?HTMLElement:class{};class Fi extends fd{constructor(t,n={},o=El){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&o!==El?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Ie({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof Fi){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,gt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,i=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:r,styles:s}=o;let l;if(r&&!ie(r))for(const a in r){const u=r[a];(u===Number||u&&u.type===Number)&&(a in this._props&&(this._props[a]=ci(this._props[a])),(l||(l=Object.create(null)))[Re(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(s),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)_e(this,o)||Object.defineProperty(this,o,{get:()=>Z(n[o])})}_resolveProps(t){const{props:n}=t,o=ie(n)?n:Object.keys(n||{});for(const i of Object.keys(this))i[0]!=="_"&&o.includes(i)&&this._setProp(i,this[i]);for(const i of o.map(Re))Object.defineProperty(this,i,{get(){return this._getProp(i)},set(r){this._setProp(i,r,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):_l;const i=Re(t);n&&this._numberProps&&this._numberProps[i]&&(o=ci(o)),this._setProp(i,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,i=!1){if(n!==this._props[t]&&(this._dirty=!0,n===_l?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),i&&this._instance&&this._update(),o)){const r=this._ob;r&&(this._processMutations(r.takeRecords()),r.disconnect()),n===!0?this.setAttribute(et(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(et(t),n+""):n||this.removeAttribute(et(t)),r&&r.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),xd(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=B(this._def,Ie(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const i=(r,s)=>{this.dispatchEvent(new CustomEvent(r,io(s[0])?Ie({detail:s},s[0]):{detail:s}))};o.emit=(r,...s)=>{i(r,s),et(r)!==r&&i(et(r),s)},this._setParent()}),n}_applyStyles(t,n){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce;for(let i=t.length-1;i>=0;i--){const r=document.createElement("style");o&&r.setAttribute("nonce",o),r.textContent=t[i],this.shadowRoot.prepend(r)}}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const i=t[o],r=i.getAttribute("name")||"default",s=this._slots[r],l=i.parentNode;if(s)for(const a of s){if(n&&a.nodeType===1){const u=n+"-s",c=document.createTreeWalker(a,1);a.setAttribute(u,"");let d;for(;d=c.nextNode();)d.setAttribute(u,"")}l.insertBefore(a,i)}else for(;i.firstChild;)l.insertBefore(i.firstChild,i);l.removeChild(i)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const i=o.querySelectorAll("slot");for(let r=0;r<i.length;r++)n.add(i[r])}return Array.from(n)}_injectChildStyle(t){this._applyStyles(t.styles,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_removeChildStyle(t){}}const Ho=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ie(t)?n=>lo(t,n):t};function pd(e){e.target.composing=!0}function Sl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const kn=Symbol("_assign");function kl(e,t,n){return t&&(e=e.trim()),n&&(e=ai(e)),e}const hd={created(e,{modifiers:{lazy:t,trim:n,number:o}},i){e[kn]=Ho(i);const r=o||i.props&&i.props.type==="number";pn(e,t?"change":"input",s=>{s.target.composing||e[kn](kl(e.value,n,r))}),(n||r)&&pn(e,"change",()=>{e.value=kl(e.value,n,r)}),t||(pn(e,"compositionstart",pd),pn(e,"compositionend",Sl),pn(e,"change",Sl))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:i,number:r}},s){if(e[kn]=Ho(s),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?ai(e.value):e.value,a=t??"";l!==a&&(document.activeElement===e&&e.type!=="range"&&(o&&t===n||i&&e.value.trim()===a)||(e.value=a))}},gd={deep:!0,created(e,t,n){e[kn]=Ho(n),pn(e,"change",()=>{const o=e._modelValue,i=md(e),r=e.checked,s=e[kn];if(ie(o)){const l=Ir(o,i),a=l!==-1;if(r&&!a)s(o.concat(i));else if(!r&&a){const u=[...o];u.splice(l,1),s(u)}}else if(oo(o)){const l=new Set(o);r?l.add(i):l.delete(i),s(l)}else s(Tl(e,r))})},mounted:Cl,beforeUpdate(e,t,n){e[kn]=Ho(n),Cl(e,t,n)}};function Cl(e,{value:t,oldValue:n},o){e._modelValue=t;let i;if(ie(t))i=Ir(t,o.props.value)>-1;else if(oo(t))i=t.has(o.props.value);else{if(t===n)return;i=co(t,Tl(e,!0))}e.checked!==i&&(e.checked=i)}function md(e){return"_value"in e?e._value:e.value}function Tl(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const vd=["ctrl","shift","alt","meta"],bd={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>vd.some(n=>e[`${n}Key`]&&!t.includes(n))},Le=(e,t)=>{const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(i,...r)=>{for(let s=0;s<t.length;s++){const l=bd[t[s]];if(l&&l(i,t))return}return e(i,...r)})},yd={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Fo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=i=>{if(!("key"in i))return;const r=et(i.key);if(t.some(s=>s===r||yd[s]===r))return e(i)})},wd=Ie({patchProp:cd},qu);let Pl;function Ml(){return Pl||(Pl=pu(wd))}const xd=(...e)=>{Ml().render(...e)},El=(...e)=>{const t=Ml().createApp(...e),{mount:n}=t;return t.mount=o=>{const i=Sd(o);if(!i)return;const r=t._component;!de(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const s=n(i,!1,_d(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t};function _d(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Sd(e){return Oe(e)?document.querySelector(e):e}function Wi(e,t){return di()?(Ja(e,t),!0):!1}const qi=new WeakMap,kd=(...e)=>{var t;const n=e[0],o=(t=un())===null||t===void 0?void 0:t.proxy,i=o??di();if(i==null&&!Ps())throw new Error("injectLocal must be called in setup");return i&&qi.has(i)&&n in qi.get(i)?qi.get(i)[n]:Ft(...e)},Il=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Cd=e=>e!=null,Td=Object.prototype.toString,Pd=e=>Td.call(e)==="[object Object]",Cn=()=>{};function Md(...e){if(e.length!==1)return Cc(...e);const t=e[0];return typeof t=="function"?Dn(Qr(()=>({get:t,set:Cn}))):ee(t)}function Ol(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}const $l=e=>e();function Ed(e,t={}){let n,o,i=Cn;const r=a=>{clearTimeout(a),i(),i=Cn};let s;return a=>{const u=ht(e),c=ht(t.maxWait);return n&&r(n),u<=0||c!==void 0&&c<=0?(o&&(r(o),o=void 0),Promise.resolve(a())):new Promise((d,f)=>{i=t.rejectOnCancel?f:d,s=a,c&&!o&&(o=setTimeout(()=>{n&&r(n),o=void 0,d(s())},c)),n=setTimeout(()=>{o&&r(o),o=void 0,d(a())},u)})}}function Id(e=$l,t={}){const{initialState:n="active"}=t,o=Md(n==="active");function i(){o.value=!1}function r(){o.value=!0}const s=(...l)=>{o.value&&e(...l)};return{isActive:Dn(o),pause:i,resume:r,eventFilter:s}}function zl(e){return e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e)}function Xn(e){return Array.isArray(e)?e:[e]}function Od(e){return un()}function ct(e,t=200,n={}){return Ol(Ed(t,n),e)}function $d(e,t,n={}){const{eventFilter:o=$l,...i}=n;return ue(e,Ol(o,t),i)}function zd(e,t,n={}){const{eventFilter:o,initialState:i="active",...r}=n,{eventFilter:s,pause:l,resume:a,isActive:u}=Id(o,{initialState:i});return{stop:$d(e,t,{...r,eventFilter:s}),pause:l,resume:a,isActive:u}}const Dd=zd;function Ui(e,t=!0,n){Od()?je(e,n):t?e():gt(e)}function Ad(e,t,n){return ue(e,t,{...n,immediate:!0})}const _t=Il?window:void 0,jd=Il?window.document:void 0;function Ot(e){var t;const n=ht(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function St(...e){const t=[],n=()=>{t.forEach(l=>l()),t.length=0},o=(l,a,u,c)=>(l.addEventListener(a,u,c),()=>l.removeEventListener(a,u,c)),i=G(()=>{const l=Xn(ht(e[0])).filter(a=>a!=null);return l.every(a=>typeof a!="string")?l:void 0}),r=Ad(()=>{var l,a;return[(l=(a=i.value)===null||a===void 0?void 0:a.map(u=>Ot(u)))!==null&&l!==void 0?l:[_t].filter(u=>u!=null),Xn(ht(i.value?e[1]:e[0])),Xn(Z(i.value?e[2]:e[1])),ht(i.value?e[3]:e[2])]},([l,a,u,c])=>{if(n(),!(l!=null&&l.length)||!(a!=null&&a.length)||!(u!=null&&u.length))return;const d=Pd(c)?{...c}:c;t.push(...l.flatMap(f=>a.flatMap(p=>u.map(x=>o(f,p,x,d)))))},{flush:"post"}),s=()=>{r(),n()};return Wi(n),s}function Ld(){const e=pt(!1),t=un();return t&&je(()=>{e.value=!0},t),e}function Ki(e){const t=Ld();return G(()=>(t.value,!!e()))}const Bd=Symbol("vueuse-ssr-width");function Vd(){const e=Ps()?kd(Bd,null):null;return typeof e=="number"?e:void 0}function Nd(e,t={}){const{window:n=_t,ssrWidth:o=Vd()}=t,i=Ki(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),r=pt(typeof o=="number"),s=pt(),l=pt(!1),a=u=>{l.value=u.matches};return Ns(()=>{if(r.value){r.value=!i.value,l.value=ht(e).split(",").some(u=>{const c=u.includes("not all"),d=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),f=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(d||f);return d&&p&&(p=o>=zl(d[1])),f&&p&&(p=o<=zl(f[1])),c?!p:p});return}i.value&&(s.value=n.matchMedia(ht(e)),l.value=s.value.matches)}),St(s,"change",a,{passive:!0}),G(()=>l.value)}const Wo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},qo="__vueuse_ssr_handlers__",Rd=Hd();function Hd(){return qo in Wo||(Wo[qo]=Wo[qo]||{}),Wo[qo]}function Fd(e,t){return Rd[e]||t}function Wd(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const qd={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Dl="vueuse-storage";function Ud(e,t,n,o={}){var i;const{flush:r="pre",deep:s=!0,listenToStorageChanges:l=!0,writeDefaults:a=!0,mergeDefaults:u=!1,shallow:c,window:d=_t,eventFilter:f,onError:p=S=>{console.error(S)},initOnMounted:x}=o,_=(c?pt:ee)(typeof t=="function"?t():t),D=G(()=>ht(e));if(!n)try{n=Fd("getDefaultStorage",()=>_t==null?void 0:_t.localStorage)()}catch(S){p(S)}if(!n)return _;const b=ht(t),P=Wd(b),A=(i=o.serializer)!==null&&i!==void 0?i:qd[P],{pause:w,resume:g}=Dd(_,S=>Q(S),{flush:r,deep:s,eventFilter:f});ue(D,()=>T(),{flush:r});let I=!1;const q=S=>{x&&!I||T(S)},K=S=>{x&&!I||Y(S)};d&&l&&(n instanceof Storage?St(d,"storage",q,{passive:!0}):St(d,Dl,K)),x?Ui(()=>{I=!0,T()}):T();function R(S,J){if(d){const F={key:D.value,oldValue:S,newValue:J,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",F):new CustomEvent(Dl,{detail:F}))}}function Q(S){try{const J=n.getItem(D.value);if(S==null)R(J,null),n.removeItem(D.value);else{const F=A.write(S);J!==F&&(n.setItem(D.value,F),R(J,F))}}catch(J){p(J)}}function H(S){const J=S?S.newValue:n.getItem(D.value);if(J==null)return a&&b!=null&&n.setItem(D.value,A.write(b)),b;if(!S&&u){const F=A.read(J);return typeof u=="function"?u(F,b):P==="object"&&!Array.isArray(F)?{...b,...F}:F}else return typeof J!="string"?J:A.read(J)}function T(S){if(!(S&&S.storageArea!==n)){if(S&&S.key==null){_.value=b;return}if(!(S&&S.key!==D.value)){w();try{const J=A.write(_.value);(S===void 0||(S==null?void 0:S.newValue)!==J)&&(_.value=H(S))}catch(J){p(J)}finally{S?gt(g):g()}}}}function Y(S){T(S.detail)}return _}function Zi(e={}){const{document:t=jd}=e;if(!t)return pt("visible");const n=pt(t.visibilityState);return St(t,"visibilitychange",()=>{n.value=t.visibilityState},{passive:!0}),n}function Kd(e,t,n={}){const{window:o=_t,...i}=n;let r;const s=Ki(()=>o&&"ResizeObserver"in o),l=()=>{r&&(r.disconnect(),r=void 0)},a=ue(G(()=>{const c=ht(e);return Array.isArray(c)?c.map(d=>Ot(d)):[Ot(c)]}),c=>{if(l(),s.value&&o){r=new ResizeObserver(t);for(const d of c)d&&r.observe(d,i)}},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return Wi(u),{isSupported:s,stop:u}}function Al(e,t={width:0,height:0},n={}){const{window:o=_t,box:i="content-box"}=n,r=G(()=>{var d;return(d=Ot(e))===null||d===void 0||(d=d.namespaceURI)===null||d===void 0?void 0:d.includes("svg")}),s=pt(t.width),l=pt(t.height),{stop:a}=Kd(e,([d])=>{const f=i==="border-box"?d.borderBoxSize:i==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(o&&r.value){const p=Ot(e);if(p){const x=p.getBoundingClientRect();s.value=x.width,l.value=x.height}}else if(f){const p=Xn(f);s.value=p.reduce((x,{inlineSize:_})=>x+_,0),l.value=p.reduce((x,{blockSize:_})=>x+_,0)}else s.value=d.contentRect.width,l.value=d.contentRect.height},n);Ui(()=>{const d=Ot(e);d&&(s.value="offsetWidth"in d?d.offsetWidth:t.width,l.value="offsetHeight"in d?d.offsetHeight:t.height)});const u=ue(()=>Ot(e),d=>{s.value=d?t.width:0,l.value=d?t.height:0});function c(){a(),u()}return{width:s,height:l,stop:c}}function jl(e,t,n={}){const{root:o,rootMargin:i="0px",threshold:r=0,window:s=_t,immediate:l=!0}=n,a=Ki(()=>s&&"IntersectionObserver"in s),u=G(()=>Xn(ht(e)).map(Ot).filter(Cd));let c=Cn;const d=pt(l),f=a.value?ue(()=>[u.value,Ot(o),d.value],([x,_])=>{if(c(),!d.value||!x.length)return;const D=new IntersectionObserver(t,{root:Ot(_),rootMargin:i,threshold:r});x.forEach(b=>b&&D.observe(b)),c=()=>{D.disconnect(),c=Cn}},{immediate:l,flush:"post"}):Cn,p=()=>{c(),f(),d.value=!1};return Wi(p),{isSupported:a,isActive:d,pause(){c(),d.value=!1},resume(){d.value=!0},stop:p}}function Zd(e,t,n={}){const{window:o=_t}=n;return Ud(e,t,o==null?void 0:o.localStorage,n)}function hn(e={}){const{window:t=_t,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:o=Number.POSITIVE_INFINITY,listenOrientation:i=!0,includeScrollbar:r=!0,type:s="inner"}=e,l=pt(n),a=pt(o),u=()=>{if(t)if(s==="outer")l.value=t.outerWidth,a.value=t.outerHeight;else if(s==="visual"&&t.visualViewport){const{width:d,height:f,scale:p}=t.visualViewport;l.value=Math.round(d*p),a.value=Math.round(f*p)}else r?(l.value=t.innerWidth,a.value=t.innerHeight):(l.value=t.document.documentElement.clientWidth,a.value=t.document.documentElement.clientHeight)};u(),Ui(u);const c={passive:!0};return St("resize",u,c),t&&s==="visual"&&t.visualViewport&&St(t.visualViewport,"resize",u,c),i&&ue(Nd("(orientation: portrait)"),()=>u()),{width:l,height:a}}class Gn{static register(t){this.handlers.push(t)}static unregister(t){const n=this.handlers.indexOf(t);n!==-1&&this.handlers.splice(n,1)}static trigger(){for(const t of this.handlers)if(t())return!0;return!1}static clear(){this.handlers=[]}}ke(Gn,"handlers",[]);function Yi(e){je(()=>Gn.register(e)),Mt(()=>Gn.unregister(e))}const Ll=pe({__name:"HelpScreen",props:{touchDevice:{type:Boolean}},emits:["hide"],setup(e,{emit:t}){const n=e,o=t,i=ee(null),r=ee([]);Yi(()=>(o("hide"),!0)),je(async()=>{const u=Al(i),c=ct(()=>{s({width:u.width.value,height:u.height.value})},50);c(),ue(u.width,c),ue(u.height,c)});function s(u){var f;const c=(f=i.value)==null?void 0:f.parentElement;if(!c)return;const d=Array.from(c.querySelectorAll("#controls [title], #top-controls [title], #bottom-controls [title]"));d.length&&(r.value=l(d,u))}function l(u,c){const d=[],f=[];let p=0,x=0;const _=50,D=25;u.forEach(g=>{var Q;const I=(Q=g.getAttribute("title"))==null?void 0:Q.trim(),q=g.getBoundingClientRect();if(!I||!q.height||!q.width)return;const K=Math.ceil((q.top-10)/_),R=Math.ceil((q.left-10)/_);f.push({isTour:!1,title:I,rect:q,fromX:R,toX:Math.max(R+1,Math.ceil((q.right+10)/_)),fromY:K,toY:Math.max(K+1,Math.ceil((q.bottom+10)/_))})}),f.forEach(g=>{for(let I=g.fromY;I<g.toY;I++){d[I]??(d[I]=[]);for(let q=g.fromX;q<g.toX;q++)d[I][q]=g;g.toY>p+1&&(p=g.toY-1),g.toX>x+1&&(x=g.toX-1)}});let b=x/2;f.forEach(g=>{g.isAlignRight=g.fromX>b});const P=(g,I)=>{d[I]??(d[I]=[]);const q=I>=g.toY;if(g.isTour)for(let K=g.fromX;K<g.toX;K++)delete d[g.fromY][K],g.fromY=I,g.toY=I+(q?1:-1),d[I][K]=g;else{const K=g.isAlignRight?g.fromX-3:g.fromX,R=K+3;g.helpItem={fromX:K,toX:R,fromY:I,toY:I+1,isTour:!0,isAlignRight:g.isAlignRight};for(let Q=K;Q<R;Q++)d[I][Q]=g.helpItem}},A=(g,I)=>{if(I>p||I<0)return!1;const q=I>=g.toY,K=d[I];if(!K)return P(g,I),!0;const R=K[g.fromX];if(R&&!R.isTour)return!1;if(R&&R.isTour)return A(R,q?I+1:I-1)?(P(g,I),!0):!1;if(!R){const Q=g.isAlignRight?-1:1;return K[g.fromX+Q]||K[g.fromX+Q*2]?A(g,q?I+1:I-1):(P(g,I),!0)}return!1};f.forEach(g=>{if(!A(g,g.toY)){if(g.isAlignRight){const I=d[g.fromY]??[];if(!I.slice(g.fromX-3,g.fromX).filter(Boolean).length){const K=g.fromX-3,R=g.fromX;g.helpItem={isTour:!0,isAlignRight:!0,fromX:K,toX:R,fromY:g.fromY,toY:g.toY};for(let Q=g.fromX-3;Q<g.fromX;Q++)I[Q]=g.helpItem;return}}A(g,g.fromY-1)}});const w=[];return f.forEach(g=>{const{title:I,helpItem:q,rect:K,isAlignRight:R,fromX:Q,fromY:H,toY:T}=g;if(!I||!q||!K)return;const Y=q.fromY>=T,S=q.toY<=H;w.push({title:a(I),style:{top:Y?`${K.bottom+(q.fromY-T)*_+D}px`:S?void 0:`${K.top+8}px`,bottom:S?`${c.height-K.top+(q.toY-H)*_+D}px`:void 0,left:R?void 0:`${K.left}px`,right:R?Y?`${c.width-K.right}px`:`${c.width-K.right+K.width+D}px`:void 0},arrowStyle:{width:S||Y?"2px":`${Math.abs(q.toX-Q)*_+D-5}px`,height:S||Y?`${(Y?q.fromY-T:H-q.toY)*_+D}px`:"2px",top:Y?`${K.bottom}px`:S?void 0:`${K.top+20}px`,bottom:S?`${c.height-K.top}px`:void 0,left:R?void 0:`${K.left+K.width/2}px`,right:R?Y?`${c.width-K.right+K.width/2}px`:`${c.width-K.right+K.width}px`:void 0}})}),w}function a(u){return n.touchDevice?u.split("(")[0].trim():u}return(u,c)=>(v(),z(be,null,[c[1]||(c[1]=U("div",{class:"fixed inset-0 bg-black bg-opacity-90"},null,-1)),U("div",{ref_key:"root",ref:i,class:"fixed inset-0 z-20 overscroll-contain select-none",onClick:c[0]||(c[0]=Le(d=>o("hide"),["stop"]))},[(v(!0),z(be,null,Yt(r.value,d=>(v(),z(be,{key:d.title},[U("div",{class:"absolute",style:Pe(d.style)},He(d.title),5),U("div",{class:"absolute bg-stone-300 rounded-lg",style:Pe(d.arrowStyle)},null,4)],64))),128))],512)],64))}}),Yd=Object.freeze(Object.defineProperty({__proto__:null,default:Ll},Symbol.toStringTag,{value:"Module"}));function Uo(e,t){let n=null;return(...o)=>{n===null&&(n=setTimeout(()=>{n=null,e(...o)},t))}}const Xd=pe({__name:"ReaderTour",emits:["hide"],setup(e,{emit:t}){const n=t,o=ee(null),i=ee(0),r=ee([]),s=G(()=>r.value[i.value]),l=Uo(a,500);je(()=>{const d=Al(o),f=ct(()=>u({width:d.width.value,height:d.height.value}),50);f(),ue(d.width,f),ue(d.height,f)});function a(){i.value>=r.value.length-1?n("hide"):i.value++}function u(d){const f=c();r.value=f.map(({rect:p,text:x})=>{const _=p.top<d.height-p.bottom,D=p.left<d.width-p.right;return{text:x,style:{left:`${p.left}px`,top:`${p.top}px`,width:`${p.width}px`,height:`${p.height}px`},textStyle:{left:D?`${p.left-12}px`:void 0,right:D?void 0:`${d.width-p.left}px`,top:_?`${p.bottom+12}px`:`${p.top+20}px`,textAlign:_?void 0:"right",transform:_?void 0:"translateY(-50%)"}}}),i.value>=r.value.length&&(i.value=r.value.length-1)}function c(){var p;const d=(p=o.value)==null?void 0:p.parentElement;if(!d)return[];const f=[];return d.querySelectorAll("[data-tour]").forEach(x=>{var b;const _=(b=x.getAttribute("data-tour"))==null?void 0:b.trim();if(!(_!=null&&_.length))return;const D=x.getBoundingClientRect();f.push({rect:D,text:_})}),f}return(d,f)=>{var p,x;return v(),z(be,null,[U("div",{class:fe(["fixed inset-0 bg-black bg-opacity-50 duration-500",{"opacity-0":!s.value,"opacity-100":!!s.value}])},null,2),U("div",{ref_key:"root",ref:o,class:"tour",onClick:f[0]||(f[0]=Le((..._)=>Z(l)&&Z(l)(..._),["stop"]))},[s.value?(v(),z("div",{key:i.value,class:"tour__target",style:Pe(s.value.style)},null,4)):se("",!0),(v(),z("div",{key:i.value,class:"tour__text",style:Pe((p=s.value)==null?void 0:p.textStyle)},He(((x=s.value)==null?void 0:x.text)??""),5))],512)],64)}}}),Gd=".tour{height:100%;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:20}.tour__target{border-radius:9999px;border-width:2px;--tw-border-opacity:1;animation:tour-target-anim .5s forwards;border-color:rgb(120 113 108/var(--tw-border-opacity,1));box-shadow:0 0 0 99999px #000000e6}.tour__target,.tour__text{position:absolute}.tour__text{animation:tour-text-anim 1s forwards,tour-text-bounce .75s ease-in-out infinite alternate;max-width:320px;padding-left:12px;padding-right:12px;transition-duration:1s}@keyframes tour-target-anim{0%{transform:scale(3);--tw-border-opacity:0;opacity:0}to{transform:scale(1);--tw-border-opacity:1;opacity:.9}}@keyframes tour-text-anim{0%{opacity:0}to{opacity:1}}@keyframes tour-text-bounce{0%{margin-top:0}to{margin-top:.625}}",ve=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},Bl=ve(Xd,[["styles",[Gd]]]),Jd=Object.freeze(Object.defineProperty({__proto__:null,default:Bl},Symbol.toStringTag,{value:"Module"}));function Qd({touchDevice:e}){const t=ee(!1);let n=0;return Rn("busy:touchDevice",e),Rn("setBusyState",o=>{n+=o?1:-1;const i=n>0;t.value!=i&&(t.value=i)}),G(()=>t.value)}function Ko(){const e=Ft("busy:touchDevice"),t=Ft("setBusyState");let n=!1;return Mt(()=>{n&&(t==null||t(!1))}),(o,{desktopOnly:i=!1}={})=>{i&&e||(n=o,t==null||t(o))}}function ef(e){Rn("hapticFeedback",e)}function Zo(){return Ft("hapticFeedback")}class tf{constructor(){ke(this,"listeners");this.listeners=[],this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.init()}init(){window.addEventListener("keydown",this.onKeyDown,{capture:!0}),window.addEventListener("keyup",this.onKeyUp,{capture:!0}),window.addEventListener("keypress",this.onKeyPress,{capture:!0})}dispose(){window.removeEventListener("keydown",this.onKeyDown,{capture:!0}),window.removeEventListener("keyup",this.onKeyUp,{capture:!0}),window.removeEventListener("keypress",this.onKeyPress,{capture:!0})}onKeyPress(t){t.stopImmediatePropagation(),t.stopPropagation()}onKeyDown(t){var n,o;t.stopImmediatePropagation(),t.stopPropagation();for(let i=0;i<this.listeners.length&&((o=(n=this.listeners[i]).onKeyDown)==null?void 0:o.call(n,t))!==!0;i++);}onKeyUp(t){var n,o;t.stopImmediatePropagation(),t.stopPropagation();for(let i=0;i<this.listeners.length&&((o=(n=this.listeners[i]).onKeyUp)==null?void 0:o.call(n,t))!==!0;i++);}addListener(t){this.listeners.push(t)}removeListener(t){const n=this.listeners.indexOf(t);n!==-1&&this.listeners.splice(n,1)}}function nf(){const e=new tf;return Mt(()=>e.dispose()),Rn("keyController",e),e}function $t(e){const t=Ft("keyController");je(()=>t.addListener(e)),Mt(()=>t.removeListener(e))}function of(e,t){const n=sessionStorage.getItem("tk:page:path");n!==location.pathname&&(sessionStorage.setItem("tk:page:path",location.pathname),n&&sessionStorage.removeItem("tk:page"));const o=ee(t&&e>0?Math.max(0,e):+(sessionStorage.getItem("tk:page")??"0")||e);return G({get:()=>o.value,set:i=>{o.value=i,sessionStorage.setItem("tk:page",i+"")}})}function rf(){sessionStorage.removeItem("tk:page"),sessionStorage.removeItem("tk:page:path")}const sf=(e,t)=>{const n=+(e.getAttribute("data-ripple")??0);if(!n)return;const o=document.createElement("span");let i=1,r=.65;const s=setInterval(a,20);l();function l(){o.style.position="absolute",o.style.height="5px",o.style.width="5px",o.style.borderRadius="100%",o.style.backgroundColor="#f2f2f2",o.style.left=`${t.currentTarget.clientWidth/2}px`,o.style.top=`${t.currentTarget.clientHeight/2}px`,t.currentTarget.appendChild(o)}function a(){const u=+n||50;i<=u?(i++,r-=.65/u,o.style.transform=`scale(${i})`,o.style.opacity=`${r}`):(o.remove(),clearInterval(s))}},zt={mounted:(e,t)=>{e.style.position="relative",e.style.overflow="hidden",e.setAttribute("data-ripple",t.value),e.addEventListener("click",n=>sf(e,n))},updated:(e,t)=>{e.setAttribute("data-ripple",t.value)}},lf={class:"group-hover:bg-stone-100 group-hover:bg-opacity-20 transition-bg duration-200 rounđe-full p-2 w-full h-full inline-flex justify-center items-center gap-2 text-base"},Xi=pe({inheritAttrs:!1,__name:"BaseButton",props:{disabled:{type:Boolean},href:{type:String},transparent:{type:Boolean},title:{type:String},enableHapticFeedback:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=e,o=t,i=Ko(),r=Zo();let s=!1;function l(){s||(s=!0,i(!0,{desktopOnly:!0}))}function a(){s&&(s=!1,i(!1,{desktopOnly:!0}))}function u(c){n.disabled?c.preventDefault():(o("click",c),n.enableHapticFeedback&&r())}return(c,d)=>Ne((v(),oe(Pi(e.href?"a":"button"),cn({href:e.href,title:e.title},{class:["h-10 max-w-full max-h-full rounded-full flex-shrink-0 focus:outline-none outline-none",{"cursor-default opacity-60":e.disabled,"hover:text-stone-100 group duration-200":!e.disabled,"bg-black bg-opacity-50":!e.transparent,[`${c.$attrs.class??""}`]:!0}],onClick:Le(u,["stop"]),onMouseenter:l,onMouseleave:a}),{default:ne(()=>[U("div",lf,[xe(c.$slots,"default")])]),_:3},16,["class"])),[[Z(zt),e.disabled?0:15]])}}),af=Object.freeze(Object.defineProperty({__proto__:null,default:Xi},Symbol.toStringTag,{value:"Module"})),cf={},uf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function df(e,t){return v(),z("svg",uf,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M19 12.998h-6v6h-2v-6H5v-2h6v-6h2v6h6z"},null,-1)])])}const Vl=ve(cf,[["render",df]]),ff=Object.freeze(Object.defineProperty({__proto__:null,default:Vl},Symbol.toStringTag,{value:"Module"})),pf={class:"inline-flex p-6 gap-6 text-base text-stone-300 select-none"},hf={key:0,class:"inline-block rounded-full relative w-28 h-12 overflow-hidden"},gf={key:0,class:"absolute bottom-0 left-0 right-0 flex justify-center pb-7 md:pb-6 lg:pb-4"},mf={class:"flex justify-center items-center gap-1 pl-1 pr-2 h-full"},Gi=ve(pe({__name:"AutoNext",props:{hasNext:{type:Boolean},offlineMode:{type:Boolean},seconds:{type:Number},showAddButton:{type:Boolean}},emits:["next","hide","add-to-library","visibility-changed"],setup(e,{emit:t}){const n=e,o=t,i=ee(null),r=ee(null),s=ee(!1),l=ee(!1),a=ee(n.seconds),u=ee(n.seconds<=0),c=ee(n.seconds),d=Zo();je(()=>{let x;jl(r,_=>{const D=_.some(b=>b.isIntersecting);D!==l.value&&(l.value=D,o("visibility-changed",D),u.value=n.seconds<=0,a.value=n.seconds,c.value=n.seconds,x&&(clearInterval(x),x=void 0),!(!l.value||u.value)&&(x=setInterval(()=>{a.value-=1,a.value<=0&&(clearInterval(x),x=void 0,o("next"))},1e3)))}),jl(i,_=>{s.value=_.some(D=>D.isIntersecting)}),Mt(()=>x&&clearInterval(x))});function f(){o("next"),d()}function p(){o("hide")}return(x,_)=>(v(),z("div",{ref_key:"root",ref:i,class:"h-full w-full flex justify-center items-center relative"},[Ne(U("div",pf,[e.hasNext?(v(),z("div",hf,[l.value?(v(),z("div",{key:0,class:"absolute left-0 top-0 bottom-0 h-full bg-stone-600 bg-opacity-50",style:Pe(u.value?{}:{animation:`auto-next ${c.value}s linear forwards`})},null,4)):se("",!0),Ne((v(),z("button",{ref_key:"nextButton",ref:r,class:"bg-transparent rounded-full h-full w-full border-solid border-stone-600 border-2 hover:bg-stone-300 hover:bg-opacity-10 totalDuration-200",onClick:Le(f,["stop"])},[Wt(He(u.value?"Next":`Next in ${a.value}`),1)])),[[Z(zt)]])])):se("",!0),Ne((v(),z("button",{class:"rounded-full px-6 h-12 bg-transparent border-solid border-stone-600 border-2 hover:bg-stone-300 hover:bg-opacity-10 totalDuration-200",onClick:Le(p,["stop"])},[Wt(He(e.offlineMode?"Close":"Hide"),1)])),[[Z(zt)]])],512),[[pl,s.value||!e.hasNext]]),e.showAddButton?(v(),z("div",gf,[B(Xi,{class:"bg-primary w-min !h-9 !bg-opacity-100",onClick:_[0]||(_[0]=()=>o("add-to-library"))},{default:ne(()=>[U("div",mf,[B(Vl,{class:"flex-shrink-0 w-auto"}),_[1]||(_[1]=U("span",{class:"text-sm text-stone-50"},"Add to library",-1))])]),_:1})])):se("",!0)],512))}}),[["styles",[".animate-auto-next{animation:auto-next 5s linear forwards}@keyframes auto-next{0%{width:0}to{width:100%}}"]]]),vf=Object.freeze(Object.defineProperty({__proto__:null,default:Gi},Symbol.toStringTag,{value:"Module"})),Ge=pe({inheritAttrs:!1,__name:"ButtonIcon",props:{disabled:{type:Boolean},href:{type:String},title:{type:String},transparent:{type:Boolean},enableHapticFeedback:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t;return(o,i)=>(v(),oe(Xi,{class:fe(["w-10",o.$attrs.class]),disabled:e.disabled,href:e.href,title:e.title,transparent:e.transparent,"enable-haptic-feedback":e.enableHapticFeedback,onClick:i[0]||(i[0]=r=>n("click",r))},{default:ne(()=>[xe(o.$slots,"default")]),_:3},8,["class","disabled","href","title","transparent","enable-haptic-feedback"]))}}),bf=Object.freeze(Object.defineProperty({__proto__:null,default:Ge},Symbol.toStringTag,{value:"Module"})),yf={},wf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function xf(e,t){return v(),z("svg",wf,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"m10.875 19.3l-6.6-6.6q-.15-.15-.213-.325T4 12q0-.2.063-.375t.212-.325l6.6-6.6q.275-.275.688-.287t.712.287q.3.275.313.688T12.3 6.1L7.4 11h11.175q.425 0 .713.288t.287.712q0 .425-.287.713t-.713.287H7.4l4.9 4.9q.275.275.288.7t-.288.7q-.275.3-.7.3t-.725-.3Z"},null,-1)])])}const Nl=ve(yf,[["render",xf]]),_f=Object.freeze(Object.defineProperty({__proto__:null,default:Nl},Symbol.toStringTag,{value:"Module"}));var Qt=(e=>(e[e.manga=1]="manga",e[e.novel=2]="novel",e[e.anime=3]="anime",e))(Qt||{});const Ji=pe({__name:"ButtonBack",props:{offlineMode:{type:Boolean},raw:{type:null},transparent:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=e,o=t;function i(r){n.offlineMode&&(r.preventDefault(),o("click"))}return(r,s)=>{var l;return v(),oe(Ge,{href:e.offlineMode||!e.raw?"#":e.raw.title.url,title:`Back to ${((l=e.raw)==null?void 0:l.contentType)===Z(Qt).novel?"novel":"manga"}`,transparent:e.transparent,"enable-haptic-feedback":"",onClick:i},{default:ne(()=>[B(Nl)]),_:1},8,["href","title","transparent"])}}}),Sf=Object.freeze(Object.defineProperty({__proto__:null,default:Ji},Symbol.toStringTag,{value:"Module"})),kf={},Cf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Tf(e,t){return v(),z("svg",Cf,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M17.825 8.575q-.2 0-.375-.062t-.325-.213L15.7 6.875q-.3-.3-.3-.712t.3-.688q.275-.3.7-.3t.7.275l.725.725l2.825-2.85q.3-.3.7-.3t.725.3q.275.3.275.725t-.275.7l-3.55 3.55q-.15.15-.325.213t-.375.062ZM6.4 20.4q-.5.2-.95-.087T5 19.475V5q0-.825.588-1.413T7 3h7q-.5.75-.75 1.438T13 6q0 1.8 1.137 3.175T17 10.9q.575.075 1 .075t1-.075v8.575q0 .55-.45.838t-.95.087L12 18l-5.6 2.4Z"},null,-1)])])}const Rl=ve(kf,[["render",Tf]]),Pf=Object.freeze(Object.defineProperty({__proto__:null,default:Rl},Symbol.toStringTag,{value:"Module"})),Mf={},Ef={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function If(e,t){return v(),z("svg",Ef,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M6.4 20.4q-.5.2-.95-.087T5 19.475V5q0-.825.588-1.413T7 3h6v2H7v12.95l5-2.15l5 2.15V11h2v8.475q0 .55-.45.838t-.95.087L12 18l-5.6 2.4ZM7 5h6h-6Zm11 4q-.425 0-.713-.287T17 8V7h-1q-.425 0-.713-.288T15 6q0-.425.288-.713T16 5h1V4q0-.425.288-.713T18 3q.425 0 .713.288T19 4v1h1q.425 0 .713.288T21 6q0 .425-.288.713T20 7h-1v1q0 .425-.288.713T18 9Z"},null,-1)])])}const Hl=ve(Mf,[["render",If]]),Of=Object.freeze(Object.defineProperty({__proto__:null,default:Hl},Symbol.toStringTag,{value:"Module"})),Qi=pe({__name:"ButtonEntry",props:{entryId:{type:null},transparent:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t;$t({onKeyUp:i=>{i.key==="t"&&!i.metaKey&&!i.ctrlKey&&n("click")}});function o(){n("click")}return(i,r)=>(v(),oe(Ge,{transparent:e.transparent,title:e.entryId?"View entry (T)":"Add to library (T)","data-tour":"Prress here to add to your library",onClick:o},{default:ne(()=>[e.entryId?(v(),oe(Rl,{key:0})):(v(),oe(Hl,{key:1}))]),_:1},8,["transparent","title"]))}}),$f=Object.freeze(Object.defineProperty({__proto__:null,default:Qi},Symbol.toStringTag,{value:"Module"})),zf={},Df={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Af(e,t){return v(),z("svg",Df,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M16.5 16V8l-4 4l4 4ZM5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.588 1.413T19 21H5Zm3-2V5H5v14h3Zm2 0h9V5h-9v14Zm-2 0H5h3Z"},null,-1)])])}const Fl=ve(zf,[["render",Af]]),jf=Object.freeze(Object.defineProperty({__proto__:null,default:Fl},Symbol.toStringTag,{value:"Module"})),Yo=pe({inheritAttrs:!1,__name:"ButtonHide",props:{transparent:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t;return(o,i)=>(v(),oe(Ge,{title:"Hide reader","data-tour":"You have entered reader mode, press here to return to the original page",class:fe(o.$attrs.class),transparent:e.transparent,onClick:i[0]||(i[0]=()=>n("click"))},{default:ne(()=>[B(Fl)]),_:1},8,["class","transparent"]))}}),Lf=Object.freeze(Object.defineProperty({__proto__:null,default:Yo},Symbol.toStringTag,{value:"Module"})),Bf={},Vf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function Nf(e,t){return v(),z("svg",Vf,[...t[0]||(t[0]=[U("path",{d:"M199.9 416h-63.8c-4.5 0-8.1-3.6-8.1-8V104c0-4.4 3.6-8 8.1-8h63.8c4.5 0 8.1 3.6 8.1 8v304c0 4.4-3.6 8-8.1 8z",fill:"currentColor"},null,-1),U("path",{d:"M375.9 416h-63.8c-4.5 0-8.1-3.6-8.1-8V104c0-4.4 3.6-8 8.1-8h63.8c4.5 0 8.1 3.6 8.1 8v304c0 4.4-3.6 8-8.1 8z",fill:"currentColor"},null,-1)])])}const er=ve(Bf,[["render",Nf]]),Rf=Object.freeze(Object.defineProperty({__proto__:null,default:er},Symbol.toStringTag,{value:"Module"})),Hf={},Ff={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function Wf(e,t){return v(),z("svg",Ff,[...t[0]||(t[0]=[U("path",{d:"M128 104.3v303.4c0 6.4 6.5 10.4 11.7 7.2l240.5-151.7c5.1-3.2 5.1-11.1 0-14.3L139.7 97.2c-5.2-3.3-11.7.7-11.7 7.1z",fill:"currentColor"},null,-1)])])}const tr=ve(Hf,[["render",Wf]]),qf=Object.freeze(Object.defineProperty({__proto__:null,default:tr},Symbol.toStringTag,{value:"Module"})),nr=pe({inheritAttrs:!1,__name:"ButtonPlay",props:{tourMessage:{type:String},playing:{type:Boolean},disabled:{type:Boolean},transparent:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=e,o=t;return $t({onKeyDown(i){!n.disabled&&i.key===" "&&(i.preventDefault(),o("click"))}}),(i,r)=>(v(),oe(Ge,{transparent:e.transparent,class:fe(i.$attrs.class),"data-tour":e.tourMessage,title:`${e.playing?"Pause":"Play"} (Space)`,disabled:e.disabled,onClick:r[0]||(r[0]=()=>o("click"))},{default:ne(()=>[e.playing?(v(),oe(er,{key:0})):(v(),oe(tr,{key:1}))]),_:1},8,["transparent","class","data-tour","title","disabled"]))}}),Uf=Object.freeze(Object.defineProperty({__proto__:null,default:nr},Symbol.toStringTag,{value:"Module"})),Kf={},Zf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"};function Yf(e,t){return v(),z("svg",Zf,[...t[0]||(t[0]=[U("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[U("circle",{cx:"14",cy:"14",r:"12"}),U("path",{d:"m23 23l7 7M9 12V9h3m4 0h3v3M9 16v3h3m7-3v3h-3"})],-1)])])}const Wl=ve(Kf,[["render",Yf]]),Xf=Object.freeze(Object.defineProperty({__proto__:null,default:Wl},Symbol.toStringTag,{value:"Module"})),Gf={class:"block w-4 h-4"},Jf={class:"w-12"},ql=pe({__name:"ButtonResetZoom",props:{zoom:{type:Number}},emits:["click"],setup(e,{emit:t}){const n=t;function o(i){n("click",i)}return(i,r)=>(v(),z("button",{class:"h-9 rounded-full inline-flex justify-between items-center bg-black bg-opacity-50 gap-1 py-2 px-3 pointer-events-auto hover:bg-stone-900 hover:bg-opacity-50 duration-200",title:"Reset zoom",onClick:Le(o,["stop"])},[U("div",Gf,[B(Wl)]),U("div",Jf,He(Math.ceil(e.zoom*100))+"%",1)]))}}),Qf=Object.freeze(Object.defineProperty({__proto__:null,default:ql},Symbol.toStringTag,{value:"Module"})),ep={},tp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 36 36"};function np(e,t){return v(),z("svg",tp,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"m32.57 15.72l-3.35-1a11.65 11.65 0 0 0-.95-2.33l1.64-3.07a.61.61 0 0 0-.11-.72l-2.39-2.4a.61.61 0 0 0-.72-.11l-3.05 1.63a11.62 11.62 0 0 0-2.36-1l-1-3.31a.61.61 0 0 0-.59-.41h-3.38a.61.61 0 0 0-.58.43l-1 3.3a11.63 11.63 0 0 0-2.38 1l-3-1.62a.61.61 0 0 0-.72.11L6.2 8.59a.61.61 0 0 0-.11.72l1.62 3a11.63 11.63 0 0 0-1 2.37l-3.31 1a.61.61 0 0 0-.43.58v3.38a.61.61 0 0 0 .43.58l3.33 1a11.62 11.62 0 0 0 1 2.33l-1.64 3.14a.61.61 0 0 0 .11.72l2.39 2.39a.61.61 0 0 0 .72.11l3.09-1.65a11.65 11.65 0 0 0 2.3.94l1 3.37a.61.61 0 0 0 .58.43h3.38a.61.61 0 0 0 .58-.43l1-3.38a11.63 11.63 0 0 0 2.28-.94l3.11 1.66a.61.61 0 0 0 .72-.11l2.39-2.39a.61.61 0 0 0 .11-.72l-1.66-3.1a11.63 11.63 0 0 0 .95-2.29l3.37-1a.61.61 0 0 0 .43-.58v-3.41a.61.61 0 0 0-.37-.59ZM18 23.5a5.5 5.5 0 1 1 5.5-5.5a5.5 5.5 0 0 1-5.5 5.5Z",class:"clr-i-solid clr-i-solid-path-1"},null,-1),U("path",{fill:"none",d:"M0 0h36v36H0z"},null,-1)])])}const Ul=ve(ep,[["render",np]]),op=Object.freeze(Object.defineProperty({__proto__:null,default:Ul},Symbol.toStringTag,{value:"Module"})),or=pe({__name:"ButtonSettings",props:{disabled:{type:Boolean},transparent:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t;return $t({onKeyUp:o=>{o.key==="s"&&!o.metaKey&&!o.ctrlKey&&n("click")}}),(o,i)=>(v(),oe(Ge,{transparent:e.transparent,title:"Reader preferences (S)",disabled:e.disabled,onClick:i[0]||(i[0]=()=>n("click"))},{default:ne(()=>[B(Ul)]),_:1},8,["transparent","disabled"]))}}),ip=Object.freeze(Object.defineProperty({__proto__:null,default:or},Symbol.toStringTag,{value:"Module"})),rp={},sp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function lp(e,t){return v(),z("svg",sp,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M4 4h6v2H6v4H4V4Zm10 0h6v6h-2V6h-4V4ZM6 14v4h4v2H4v-6h2Zm14 0v6h-6v-2h4v-4h2Z"},null,-1)])])}const Kl=ve(rp,[["render",lp]]),ap=Object.freeze(Object.defineProperty({__proto__:null,default:Kl},Symbol.toStringTag,{value:"Module"})),cp={},up={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function dp(e,t){return v(),z("svg",up,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M14 20v-6h6v2h-4v4h-2Zm-6 0v-4H4v-2h6v6H8Zm12-10h-6V4h2v4h4v2Zm-10 0H4V8h4V4h2v6Z"},null,-1)])])}const Zl=ve(cp,[["render",dp]]),fp=Object.freeze(Object.defineProperty({__proto__:null,default:Zl},Symbol.toStringTag,{value:"Module"})),ir=pe({__name:"ButtonWebFullScreen",props:{transparent:{type:Boolean}},emits:["request-full-screen"],setup(e,{emit:t}){const n=t,o=ee(!1);$t({onKeyUp:r=>{r.key==="f"&&!r.metaKey&&!r.ctrlKey&&i()}}),St("fullscreenchange",()=>{o.value=!!document.fullscreenElement});function i(){document.fullscreenElement?document.exitFullscreen():n("request-full-screen")}return(r,s)=>(v(),oe(Ge,{transparent:e.transparent,title:`${o.value?"Exit":"Enter"} fullscreen (F)`,onClick:i},{default:ne(()=>[o.value?(v(),oe(Zl,{key:0})):(v(),oe(Kl,{key:1}))]),_:1},8,["transparent","title"]))}}),pp=Object.freeze(Object.defineProperty({__proto__:null,default:ir},Symbol.toStringTag,{value:"Module"}));async function gn(e,t,n){const o=await n(()=>{e=0});if(o!==void 0)return o;if(!(e<=0))return await new Promise(i=>{setTimeout(async()=>{const r=await gn(e-1,t,n);i(r)},t)})}const hp=["aria-hidden"],gp=["onClick"],Yl=pe({__name:"DropdownMenu",props:Ye({items:{type:Array},enableHapticFeedback:{type:Boolean}},{modelValue:{type:Number,required:!1},modelModifiers:{}}),emits:Ye(["select"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=lt(e,"modelValue"),r=ee(null),s=ee(!1),l=ee(!1),a=ee(!1),u=ee(!1),c={mounted:w=>{var g;i.value&&((g=w.children[i.value])==null||g.scrollIntoView({behavior:"auto",block:"center",inline:"center"}))}};$t({onKeyDown:D}),Yi(()=>{const w=s.value;return w&&(s.value=!1),w});const d=Ko(),f=Zo();async function p(w){s.value=w??!s.value,d(s.value),s.value?(x(),P(r.value)):setTimeout(A,250)}function x(){const w=r.value;if(w){const g=w.getBoundingClientRect(),I=g.x+g.width/2;l.value=g.y>window.innerHeight/2,a.value=I<window.innerWidth/3,u.value=I>window.innerWidth/3*2}}function _(w,g){p(),w!=i.value&&(i.value=w,o("select",w,g),n.enableHapticFeedback&&f())}function D(w){s.value&&w.key==="Escape"&&(p(),w.preventDefault())}let b=[];function P(w){const g=window.getComputedStyle(w).zIndex,I=w.style.zIndex;(!g||!(+g>0))&&((!w.parentElement||w.parentElement.childElementCount>1)&&(w.style.zIndex="1",b.push({el:w,zIndex:I})),w.parentElement&&P(w.parentElement))}function A(){b.forEach(({el:w,zIndex:g})=>{w.style.zIndex=g??""}),b=[]}return(w,g)=>(v(),z("div",{ref_key:"root",ref:r,class:"select-none relative inline-flex"},[s.value?(v(),z("div",{key:0,class:"fixed inset-0 bg-transparent",onClick:g[0]||(g[0]=()=>p())})):se("",!0),e.items.length?(v(),oe(Vo,{key:1,name:"slide-fade","enter-from-class":"scale-y-90 opacity-0 pointer-events-none","leave-to-class":"scale-y-90 opacity-0 pointer-events-none"},{default:ne(()=>[s.value?Ne((v(),z("ul",{key:0,ref:"list","aria-hidden":!s.value,class:fe(["scrollbar-sm duration-150 delay-50 absolute w-40 max-h-[70vh] list-none bg-stone-800 bg-opacity-80 backdrop-blur-md rounded-lg overflow-auto",{"origin-bottom bottom-full -translate-y-1.5":l.value,"origin-top top-full translate-y-1.5":!l.value,"left-1/2 -ml-20 text-center":!a.value&&!u.value,"right-0 text-right":u.value}]),onWheelPassive:g[1]||(g[1]=Le(()=>{},["stop"])),onTouchmove:g[2]||(g[2]=Le(()=>{},["stop"]))},[(v(!0),z(be,null,Yt(e.items,(I,q)=>Ne((v(),z("li",{key:q,tabindex:"-1",class:fe(["h-10 px-4 last:border-b-transparent cursor-pointer hover:bg-stone-100 hover:bg-opacity-10 duration-100",{"text-textPrimary":q===i.value}]),onClick:K=>_(q,K)},[U("div",{class:fe(["h-full py-2",{"border-t-[1px] border-solid border-stone-400 border-opacity-30":q>0}])},[xe(w.$slots,"item",{item:I},()=>[Wt(He(I),1)])],2)],10,gp)),[[Z(zt),30]])),128))],42,hp)),[[c]]):se("",!0)]),_:3})):se("",!0),xe(w.$slots,"default",{toggle:p,isOpen:s.value,isAlignTop:l.value})],512))}}),mp=Object.freeze(Object.defineProperty({__proto__:null,default:Yl},Symbol.toStringTag,{value:"Module"})),vp={},bp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function yp(e,t){return v(),z("svg",bp,[...t[0]||(t[0]=[Ou('<circle cx="18" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".67" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".33" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="6" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin="0" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle>',3)])])}const Xl=ve(vp,[["render",yp]]),wp=Object.freeze(Object.defineProperty({__proto__:null,default:Xl},Symbol.toStringTag,{value:"Module"})),xp={},_p={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Sp(e,t){return v(),z("svg",_p,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"m7 10l5 5l5-5z"},null,-1)])])}const Gl=ve(xp,[["render",Sp]]),kp=Object.freeze(Object.defineProperty({__proto__:null,default:Gl},Symbol.toStringTag,{value:"Module"})),Cp=["onClick"],Tp={class:"inline-flex items-center justify-center w-full h-full px-4 rounded-full group-hover:bg-stone-100 group-hover:bg-opacity-20 duration-200"},Pp={class:"whitespace-nowrap"},rr=pe({__name:"ButtonDropdown",props:Ye({label:{type:String},title:{type:String},items:{type:Array},disabled:{type:Boolean},canLoadItems:{type:Boolean},loadItems:{type:Function},enableHapticFeedback:{type:Boolean},transparent:{type:Boolean}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:Ye(["select"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=lt(e,"modelValue"),r=ee(!1),s=Ko();async function l(f,p){if(!n.items.length&&(f||await a(),!n.items.length)){p(!1);return}p()}async function a(){r.value||n.items.length||!n.canLoadItems||!n.loadItems||(r.value=!0,await n.loadItems(),r.value=!1)}let u=!1;function c(){u||(u=!0,s(!0,{desktopOnly:!0}))}function d(){u&&(u=!1,s(!1,{desktopOnly:!0}))}return(f,p)=>(v(),oe(Yl,{modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=x=>i.value=x),items:e.items,"enable-haptic-feedback":e.enableHapticFeedback,onSelect:p[1]||(p[1]=(x,_)=>o("select",x,_))},Mi({default:ne(({toggle:x,isOpen:_,isAlignTop:D})=>[Ne((v(),z("button",cn({type:"button",tabindex:"-1",class:["w-full h-10 max-h-full rounded-full group duration-100 transition-bg",{"pointer-events-none opacity-60":e.disabled||r.value,"bg-black bg-opacity-50":!e.transparent,"bg-transparent":e.transparent}]},e.title?{title:e.title}:{},{onClick:Le(()=>l(_,x),["stop"]),onMouseenter:c,onMouseleave:d}),[U("div",Tp,[U("span",Pp,He(e.label),1),e.items.length||e.canLoadItems?(v(),z("span",{key:0,class:fe(["w-4 h-4 flex ml-1 -mr-3 flex-shrink-0",{"rotate-180":D}]),"aria-hidden":"true"},[r.value?(v(),oe(Xl,{key:0})):(v(),oe(Gl,{key:1}))],2)):se("",!0)])],16,Cp)),[[Z(zt),30]])]),_:2},[f.$slots.item?{name:"item",fn:ne(({item:x})=>[xe(f.$slots,"item",{item:x})]),key:"0"}:void 0]),1032,["modelValue","items","enable-haptic-feedback"]))}}),Mp=Object.freeze(Object.defineProperty({__proto__:null,default:rr},Symbol.toStringTag,{value:"Module"})),Ep={},Ip={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Op(e,t){return v(),z("svg",Ip,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z"},null,-1)])])}const Jl=ve(Ep,[["render",Op]]),$p=Object.freeze(Object.defineProperty({__proto__:null,default:Jl},Symbol.toStringTag,{value:"Module"})),zp={},Dp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Ap(e,t){return v(),z("svg",Dp,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z"},null,-1)])])}const Ql=ve(zp,[["render",Ap]]),jp=Object.freeze(Object.defineProperty({__proto__:null,default:Ql},Symbol.toStringTag,{value:"Module"})),Lp={key:0,class:"ml-auto inline-flex gap-[1px] scale-95 origin-right"},sr=pe({__name:"ChapterNav",props:{data:{type:Object},chapterSpec:{type:Object},touchDevice:{type:Boolean},rtl:{type:Boolean},transparent:{type:Boolean}},emits:["getHiddenChapters","prev","next"],setup(e,{emit:t}){const n=e,o=t;async function i(){const c=n.chapterSpec;if(!c)return;const{trigger:d,sel:f,label:p}=c;if(d&&(!f||!p)){await r(d);return}o("getHiddenChapters"),await gn(50,50,()=>n.data.chapters.length?!0:void 0)}async function r(c){const d=document.querySelector(c);d&&(d instanceof HTMLDialogElement?d.showModal():d.click())}function s(c,d){var f,p,x;(x=(p=(f=n.data)==null?void 0:f.chapters)==null?void 0:p[c])==null||x.select(u(d))}function l(c){n.rtl?o("next",u(c)):o("prev",u(c))}function a(c){n.rtl?o("prev",u(c)):o("next",u(c))}function u(c){return!n.touchDevice&&(c.ctrlKey||c.metaKey)}return(c,d)=>{var f;return v(),z(be,null,[B(rr,{modelValue:e.data.activeIndex,label:e.data.activeLabel,title:"Select chapter",transparent:e.transparent,items:e.data.chapters,"can-load-items":!!((f=e.chapterSpec)!=null&&f.trigger),"load-items":i,"enable-haptic-feedback":"",onSelect:s},{item:ne(({item:p})=>[Wt(He(p.label),1)]),_:1},8,["modelValue","label","transparent","items","can-load-items"]),e.data.next||e.data.prev?(v(),z("div",Lp,[B(Ge,{title:`${e.rtl?"Next":"Prev"} chapter (←)`,disabled:e.rtl?!e.data.next:!e.data.prev,transparent:e.transparent,class:"!rounded-r-none","enable-haptic-feedback":"",onClick:l},{default:ne(()=>[B(Jl)]),_:1},8,["title","disabled","transparent"]),B(Ge,{title:`${e.rtl?"Prev":"Next"} chapter (→)`,disabled:e.rtl?!e.data.prev:!e.data.next,transparent:e.transparent,class:"!rounded-l-none","enable-haptic-feedback":"",onClick:a},{default:ne(()=>[B(Ql)]),_:1},8,["title","disabled","transparent"])])):se("",!0)],64)}}}),Bp=Object.freeze(Object.defineProperty({__proto__:null,default:sr},Symbol.toStringTag,{value:"Module"})),Vp=["min","max","step"],Np={class:"flex-shrink-0 w-12 inline-block text-right"},en=ve(pe({__name:"InputPercentage",props:Ye({min:{type:Number},max:{type:Number},step:{type:Number},format:{type:Function}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=lt(e,"modelValue"),n=G({get(){return t.value},set(o){t.value=+o}});return(o,i)=>{var r;return v(),z("div",{class:"flex items-center gap-3 pl-1",style:Pe({"--percentage":`${(n.value-e.min)/(e.max-e.min)*100}%`})},[Ne(U("input",{"onUpdate:modelValue":i[0]||(i[0]=s=>n.value=s),type:"range",min:e.min,max:e.max,step:e.step??1,class:"flex-grow",onTouchmove:i[1]||(i[1]=Le(()=>{},["stop"]))},null,40,Vp),[[hd,n.value]]),U("span",Np,He(((r=e.format)==null?void 0:r.call(e,t.value))??t.value),1)],4)}}}),[["styles",["input[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(to right,#fb8252 var(--percentage),#5a5552 var(--percentage));border-radius:9999px;border-style:none;cursor:pointer;height:4px;opacity:.9;pointer-events:none;--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1));outline:2px solid transparent;outline-offset:2px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none!important;border-radius:9999px;border-style:solid;border-width:2px;cursor:pointer;height:20px;pointer-events:auto;width:20px;--tw-border-opacity:1;border-color:rgb(251 130 82/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1));transition-duration:.2s}input[type=range]:hover{opacity:1}"]]]),Rp=Object.freeze(Object.defineProperty({__proto__:null,default:en},Symbol.toStringTag,{value:"Module"})),Hp={ref:"root",class:"flex text-sm flex-wrap gap-2 leading-none"},Fp=["onClick","onKeyup"],vt=pe({__name:"InputSelect",props:Ye({items:{type:Array}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=lt(e,"modelValue");function o(i){i!==n.value&&(n.value=i)}return(i,r)=>(v(),z("div",Hp,[(v(!0),z(be,null,Yt(t.items,(s,l)=>Ne((v(),z("div",{key:l,tabindex:"0",class:fe(["inline-flex justify-center items-center rounded-full px-3 py-1.5 cursor-pointer z-10 whitespace-nowrap flex-shrink-0 focus:outline-primary hover:bg-opacity-80 duration-200",{"bg-primary":l==n.value,"bg-stone-600 bg-opacity-50":l!=n.value}]),onClick:()=>o(l),onKeyup:[Fo(()=>o(l),["enter"]),Fo(()=>o(l),["space"])]},[Wt(He(s),1)],42,Fp)),[[Z(zt),30]])),128))],512))}}),Wp=Object.freeze(Object.defineProperty({__proto__:null,default:vt},Symbol.toStringTag,{value:"Module"})),qp={class:"flex w-full items-center justify-between cursor-pointer mb-5 last:mb-0"},Up={class:"text-sm py-1"},Kp={class:"switcher p-1"},lr=ve(pe({__name:"InputSwitcher",props:Ye({label:{type:String}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=lt(e,"modelValue");return(n,o)=>(v(),z("label",qp,[U("span",Up,He(e.label),1),U("div",Kp,[Ne(U("input",{"onUpdate:modelValue":o[0]||(o[0]=i=>t.value=i),type:"checkbox"},null,512),[[gd,t.value]]),o[1]||(o[1]=U("span",null,null,-1))])]))}}),[["styles",['.switcher{height:24px;position:relative;width:40px}.switcher input{height:0;opacity:0;width:0}.switcher input:checked+span{border-width:1px;--tw-border-opacity:1;border-color:rgb(184 92 56/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(184 92 56/var(--tw-bg-opacity,1))}.switcher input:checked+span:before{bottom:2px;height:18px;left:17.2px;width:18px}.switcher span{border-radius:9999px;border-width:2px;top:0;right:0;bottom:0;left:0;--tw-border-opacity:1;background-color:transparent;border-color:rgb(231 229 228/var(--tw-border-opacity,1))}.switcher span,.switcher span:before{position:absolute;transition-duration:.3s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.switcher span:before{border-radius:9999px;bottom:4px;content:"";height:12px;left:4px;width:12px;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}']]]),Zp=Object.freeze(Object.defineProperty({__proto__:null,default:lr},Symbol.toStringTag,{value:"Module"})),Yp={class:"flex-grow mb-5 last:mb-0"},Ae=pe({__name:"TableField",props:{label:{type:String},disabled:{type:Boolean}},setup(e){return(t,n)=>(v(),z(be,null,[U("div",{class:fe(["flex-shrink-0 mb-2 whitespace-nowrap text-sm",{"opacity-50":e.disabled}])},He(e.label),3),U("div",Yp,[xe(t.$slots,"default")])],64))}}),Xp=Object.freeze(Object.defineProperty({__proto__:null,default:Ae},Symbol.toStringTag,{value:"Module"})),ea=pe({__name:"FieldContrast",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=lt(e,"modelValue"),n=G({get(){return Math.round(t.value*100)},set(o){t.value=Math.round(o)/100}});return(o,i)=>(v(),oe(Ae,{label:"Contrast"},{default:ne(()=>[B(en,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),min:20,max:100,format:r=>`${r}%`},null,8,["modelValue","format"])]),_:1}))}}),Gp=Object.freeze(Object.defineProperty({__proto__:null,default:ea},Symbol.toStringTag,{value:"Module"})),Jp={},Qp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function eh(e,t){return v(),z("svg",Qp,[...t[0]||(t[0]=[U("path",{d:"M480 358.856V153.143C480 130.512 461.674 112 439.272 112H72.728C50.326 112 32 130.512 32 153.143v205.713C32 381.488 50.326 400 72.728 400h366.545C461.674 400 480 381.488 480 358.856zM112 364V148h288v216H112z",fill:"currentColor"},null,-1)])])}const ta=ve(Jp,[["render",eh]]),th=Object.freeze(Object.defineProperty({__proto__:null,default:ta},Symbol.toStringTag,{value:"Module"})),nh={},oh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function ih(e,t){return v(),z("svg",oh,[...t[0]||(t[0]=[U("path",{d:"M358.856 32H153.143C130.512 32 112 50.326 112 72.728v366.545C112 461.674 130.512 480 153.143 480h205.713C381.488 480 400 461.674 400 439.272V72.728C400 50.326 381.488 32 358.856 32zM364 400H148V112h216v288z",fill:"currentColor"},null,-1)])])}const na=ve(nh,[["render",ih]]),rh=Object.freeze(Object.defineProperty({__proto__:null,default:na},Symbol.toStringTag,{value:"Module"})),ar=pe({inheritAttrs:!1,__name:"ButtonOutline",emits:["click"],setup(e,{emit:t}){const n=t,o=Zo();function i(){o(),n("click")}return(r,s)=>Ne((v(),z("button",{class:fe([r.$attrs.class??"","flex focus:outline-none outline-none rounded-full h-10 justify-center items-center border border-solid border-stone-600 text-stone-200 hover:bg-stone-500 hover:bg-opacity-10 duration-200"]),onClick:i},[xe(r.$slots,"default")],2)),[[Z(zt),24]])}}),sh=Object.freeze(Object.defineProperty({__proto__:null,default:ar},Symbol.toStringTag,{value:"Module"}));var tn=(e=>(e[e.never=0]="never",e[e.move=1]="move",e[e.firstMove=2]="firstMove",e[e.onLoad=3]="onLoad",e))(tn||{}),nt=(e=>(e[e.vertical=0]="vertical",e[e.ltr=1]="ltr",e[e.rtl=2]="rtl",e))(nt||{});const cr=[{name:"System",value:"system-ui, sans-serif"},{name:"Charter",value:'Charter, "Times New Roman", serif'},{name:"Georgia",value:"Georgia, serif"}],oa=pe({__name:"FieldFontFamily",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=lt(e,"modelValue"),n=G({get(){const o=cr.findIndex(i=>i.value===t.value);return o===-1?0:o},set(o){t.value=cr[o].value}});return(o,i)=>(v(),oe(Ae,{label:"Font family"},{default:ne(()=>[B(vt,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),items:Z(cr).map(r=>r.name)},null,8,["modelValue","items"])]),_:1}))}}),lh=Object.freeze(Object.defineProperty({__proto__:null,default:oa},Symbol.toStringTag,{value:"Module"}));function ah(e){if(e)try{return JSON.parse(e)}catch{return}}function ch(){const{width:e,height:t}=hn();return G(()=>e.value>t.value)}function ia(e){return String(e).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").trim().toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}var Dt=(e=>(e[e.longStrip=0]="longStrip",e[e.single=1]="single",e[e.double=2]="double",e))(Dt||{});const Xo=.25,Go=5,ur=.25,Jo=.2,Qo=5,uh=.05,dh=0,fh=5;function ph(e){var g,I,q,K,R,Q;const n=e.touchDevice&&(window.innerHeight<=600||window.innerWidth<=600)?ch():void 0,{titleName:o,isWebtoon:i}=e,r=o?ia(o):location.hostname,s=ee(hh(`tkr:${r}`)),l=H=>{s.value=H;const T=`tkr:${r}`;!H||!Object.keys(H).length?localStorage.removeItem(T):localStorage.setItem(T,JSON.stringify(H))},a=H=>{if(!s.value){l(H);return}const T={...s.value};Object.entries(H).forEach(([Y,S])=>{S===void 0?delete T[Y]:T[Y]=S}),l(T)},u=ee((g=s.value)==null?void 0:g.style),c=ee((I=s.value)==null?void 0:I.direction),d=ee((q=s.value)==null?void 0:q.gap),f=ee((K=s.value)==null?void 0:K.speed),p=ee((R=s.value)==null?void 0:R.zoom),x=ee(((Q=s.value)==null?void 0:Q.breakFirst)??!1),_=G({get(){if(i.value)return Dt.longStrip;if(u.value!==void 0)return u.value;const{landscapeStyle:H,readerStyle:T}=e.defaultPreferences.value;return n!=null&&n.value?H??T:T},set:H=>{if(u.value===H)return;const T=_.value===Dt.longStrip,Y=H===Dt.longStrip;u.value=H,a({style:H}),T!==Y&&(D.value=Y?nt.vertical:nt.rtl)}}),D=G({get(){if(i.value)return nt.vertical;if(c.value!==void 0)return c.value;const{direction:H,landscapeDirection:T}=e.defaultPreferences.value;return n!=null&&n.value?T??H:H},set:H=>{c.value=H,a({direction:H})}}),b=G({get:()=>d.value??e.defaultPreferences.value.gap,set(H){d.value=H,a({gap:H})}}),P=G({get:()=>f.value??e.defaultPreferences.value.speed,set(H){f.value=H,a({speed:H===1?void 0:H})}}),A=G({get:()=>p.value??1,set(H){p.value=H,a({zoom:H===1?void 0:H})}}),w=G({get:()=>x.value,set(H){x.value=H,a({breakFirst:H?!0:void 0})}});return{direction:D,style:_,gap:b,speed:P,zoom:A,isLongStrip:G(()=>_.value===Dt.longStrip),isDouble:G(()=>_.value===Dt.double),isRTL:G(()=>D.value===nt.rtl),isVertical:G(()=>D.value===nt.vertical),breakFirst:w}}function hh(e){const t=localStorage.getItem(e),n=ah(t||void 0),o={};return n?(n.style!==void 0&&Object.values(Dt).includes(n.style)&&(o.style=n.style),n.direction!==void 0&&Object.values(nt).includes(n.direction)&&(o.direction=n.direction),n.gap!==void 0&&n.gap>=dh&&n.gap<=fh&&(o.gap=n.gap),n.speed!==void 0&&n.speed>=Xo&&n.speed<=Go&&(o.speed=n.speed),n.zoom!==void 0&&n.zoom>=Jo&&n.zoom<=Qo&&(o.zoom=n.zoom),n.breakFirst===!0&&(o.breakFirst=!0),Object.keys(o).length?o:void 0):o}const dr=pe({__name:"NovelPreferencesForm",props:Ye({enableReset:{type:Boolean},defaultPreferences:{type:Object}},{modelValue:{required:!0},modelModifiers:{}}),emits:Ye(["reset"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=lt(e,"modelValue"),r=G(()=>Object.keys(i.value).some(l=>{var a;return i.value[l]!==((a=n.defaultPreferences)==null?void 0:a[l])}));function s(l){i.value={...i.value,...l}}return(l,a)=>(v(),z(be,null,[B(oa,{"model-value":i.value.fontFamily,"onUpdate:modelValue":a[0]||(a[0]=u=>s({fontFamily:u}))},null,8,["model-value"]),B(Ae,{label:"Text size"},{default:ne(()=>[B(en,{"model-value":i.value.fontSize,min:10,max:48,"onUpdate:modelValue":a[1]||(a[1]=u=>s({fontSize:u,lineHeight:Math.max(i.value.lineHeight,u)}))},null,8,["model-value"])]),_:1}),B(Ae,{label:"Line height"},{default:ne(()=>[B(en,{"model-value":i.value.lineHeight,min:10,max:96,step:1,"onUpdate:modelValue":a[2]||(a[2]=u=>s({lineHeight:u,fontSize:Math.min(i.value.fontSize,u)}))},null,8,["model-value"])]),_:1}),B(Ae,{label:"Play speed"},{default:ne(()=>[B(en,{"model-value":i.value.speed,min:Z(Xo),max:Z(Go),step:Z(ur),format:u=>`${u.toFixed(2)}x`,"onUpdate:modelValue":a[3]||(a[3]=u=>s({speed:u}))},null,8,["model-value","min","max","step","format"])]),_:1}),e.enableReset?(v(),z("div",{key:0,class:fe(["w-full flex justify-center pt-1 duration-200",{"pointer-events-none opacity-0":!r.value,"opacity-90":r.value}])},[B(ar,{class:"w-2/3",onClick:a[4]||(a[4]=()=>o("reset"))},{default:ne(()=>[...a[5]||(a[5]=[Wt(" Reset to default ",-1)])]),_:1})],2)):se("",!0)],64))}}),gh=Object.freeze(Object.defineProperty({__proto__:null,default:dr},Symbol.toStringTag,{value:"Module"})),mh={key:1,class:"mb-3 border-stone-500 border-opacity-70"},vh={key:2,class:"flex justify-end"},bh={class:"h-6 border border-stone-500 rounded-md cursor-pointer flex items-center"},yh={key:3,class:"mt-5 mb-3 border-stone-500 border-opacity-70"},fr=pe({__name:"DefaultPreferencesForm",props:Ye({touchDevice:{type:Boolean},isNovel:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=lt(e,"modelValue"),o=ee(!1),i=ee(!1);je(()=>{o.value=t.touchDevice&&(window.innerHeight<=600||window.innerWidth<=600)});function r(l){const a=i.value,c=(a?n.value.landscapeStyle??n.value.readerStyle:n.value.readerStyle)!==Dt.longStrip,d=l!==Dt.longStrip;if(c===d)s(a?{landscapeStyle:l}:{readerStyle:l});else{const f=d?nt.rtl:nt.vertical;s(a?{landscapeStyle:l,landscapeDirection:f}:{readerStyle:l,direction:f})}}function s(l){n.value={...n.value,...l}}return(l,a)=>(v(),z(be,null,[e.isNovel?(v(),z(be,{key:0},[B(dr,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=u=>n.value=u)},null,8,["modelValue"]),B(ea,{"model-value":n.value.contrast,"onUpdate:modelValue":a[1]||(a[1]=u=>s({contrast:u}))},null,8,["model-value"])],64)):(v(),z(be,{key:1},[B(lr,{"model-value":n.value.autoPlay===!0,label:"Auto play in long strip","onUpdate:modelValue":a[2]||(a[2]=u=>s({autoPlay:u}))},null,8,["model-value"]),e.touchDevice?(v(),oe(lr,{key:0,"model-value":n.value.pinchToZoom!==!1,label:"Pinch to zoom","onUpdate:modelValue":a[3]||(a[3]=u=>s({pinchToZoom:u}))},null,8,["model-value"])):se("",!0),o.value?(v(),z("hr",mh)):se("",!0),o.value?(v(),z("div",vh,[U("div",bh,[Ne((v(),z("button",{class:fe(["focus:outline-none outline-none h-full flex justify-center items-center px-3 py-0.5 rounded-l-sm",{"bg-stone-500 text-stone-50":!i.value,"text-stone-400":i.value}]),onClick:a[4]||(a[4]=()=>i.value=!1)},[B(na)],2)),[[Z(zt),24]]),Ne((v(),z("button",{class:fe(["focus:outline-none outline-none h-full flex justify-center items-center px-3 py-0.5 rounded-r-sm",{"bg-stone-500 text-stone-50":i.value,"text-stone-400":!i.value}]),onClick:a[5]||(a[5]=()=>i.value=!0)},[B(ta)],2)),[[Z(zt),24]])])])):se("",!0),B(Ae,{label:"Style"},{default:ne(()=>[B(vt,{"model-value":i.value?n.value.landscapeStyle??n.value.readerStyle:n.value.readerStyle,items:["Long strip","Single page","Double page"],"onUpdate:modelValue":r},null,8,["model-value"])]),_:1}),B(Ae,{label:"Direction"},{default:ne(()=>[B(vt,{"model-value":i.value?n.value.landscapeDirection??n.value.direction:n.value.direction,items:["Vertical","Left to right","Right to left"],"onUpdate:modelValue":a[6]||(a[6]=u=>s(i.value?{landscapeDirection:u}:{direction:u}))},null,8,["model-value"])]),_:1}),o.value?(v(),z("hr",yh)):se("",!0),B(Ae,{label:"Gap size"},{default:ne(()=>[B(vt,{"model-value":n.value.gap,items:["None","1px","2px","3px","4px","5px"],"onUpdate:modelValue":a[7]||(a[7]=u=>s({gap:u}))},null,8,["model-value"])]),_:1})],64)),B(Ae,{label:"Progress size"},{default:ne(()=>[B(vt,{"model-value":n.value.progressSize/2,items:["None","2px","4px","6px","8px","10px"],"onUpdate:modelValue":a[8]||(a[8]=u=>s({progressSize:u*2}))},null,8,["model-value"])]),_:1}),B(Ae,{label:"Auto next"},{default:ne(()=>[B(vt,{"model-value":n.value.autoNextSeconds,items:["None","1 sec","2 sec","3 sec","4 sec","5 sec"],"onUpdate:modelValue":a[9]||(a[9]=u=>s({autoNextSeconds:u}))},null,8,["model-value"])]),_:1}),B(Ae,{label:"Hide controls"},{default:ne(()=>[B(vt,{"model-value":n.value.hideControlsEvent,items:["Never","On move","On first move","On load"],"onUpdate:modelValue":a[10]||(a[10]=u=>s({hideControlsEvent:u}))},null,8,["model-value"])]),_:1}),e.isNovel?se("",!0):(v(),z(be,{key:2},[B(Ae,{label:"Play speed"},{default:ne(()=>[B(en,{"model-value":n.value.speed,min:Z(Xo),max:Z(Go),step:Z(ur),format:u=>`${u.toFixed(2)}x`,"onUpdate:modelValue":a[11]||(a[11]=u=>s({speed:u}))},null,8,["model-value","min","max","step","format"])]),_:1}),B(Ae,{label:e.touchDevice?"Tap zones":"Click zones"},{default:ne(()=>[B(vt,{"model-value":(n.value.tapZone??-1)+1,items:["Default","None","L shaped","Kindle-ish","Edge","Right and left"],"onUpdate:modelValue":a[12]||(a[12]=u=>s({tapZone:u===0?void 0:u-1}))},null,8,["model-value"])]),_:1},8,["label"])],64))],64))}}),wh=Object.freeze(Object.defineProperty({__proto__:null,default:fr},Symbol.toStringTag,{value:"Module"})),xh={},_h={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Sh(e,t){return v(),z("svg",_h,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M11.3 19.3q-.275-.275-.288-.7t.263-.7l4.9-4.9H5q-.425 0-.713-.288T4 12q0-.425.288-.713T5 11h11.175l-4.9-4.9q-.275-.275-.263-.7t.288-.7q.275-.275.7-.275t.7.275l6.6 6.6q.15.125.213.313t.062.387q0 .2-.062.375t-.213.325l-6.6 6.6q-.275.275-.7.275t-.7-.275Z"},null,-1)])])}const Jn=ve(xh,[["render",Sh]]),kh=Object.freeze(Object.defineProperty({__proto__:null,default:Jn},Symbol.toStringTag,{value:"Module"}));var pr=(e=>(e[e.none=0]="none",e[e.lShape=1]="lShape",e[e.kindleIsh=2]="kindleIsh",e[e.edge=3]="edge",e[e.rightAndLeft=4]="rightAndLeft",e))(pr||{});const ra={0:{prevZones:[],nextZones:[]},1:{prevZones:[0,1,2,3],nextZones:[8,7,6,5]},2:{prevZones:[6,3],nextZones:[8,7,5,4]},3:{prevZones:[7],nextZones:[5,0,2,3,6,8]},4:{prevZones:[3,0,6],nextZones:[5,2,8]}},sa=pe({__name:"TapZonePreview",props:{tapZone:{type:Number},direction:{type:Number}},setup(e){const t=e,{width:n,height:o}=hn(),i=G(()=>Math.min(1.25,Math.max(.75,Math.round(n.value/o.value*100)/100))),r=G(()=>i.value>=1),s=G(()=>t.direction===nt.vertical),l=G(()=>t.direction===nt.rtl),a=G(()=>{if(!t.tapZone)return;const{prevZones:u,nextZones:c}=ra[t.tapZone];return Array.from({length:9},(d,f)=>{const p=u.includes(f),x=!p&&c.includes(f);return{isPrev:p,isNext:x,hasArrow:f===u[0]||f===c[0]}})});return(u,c)=>(v(),z("div",{class:fe(["p-2 bg-black bg-opacity-40 rounded-2xl",{"w-28":r.value,"h-28":!r.value}]),style:Pe({"aspect-ratio":i.value})},[e.tapZone===Z(pr).none?(v(),z("div",{key:0,class:fe(["inline-block absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-14 h-14",{"rotate-90":e.direction===Z(nt).vertical,"rotate-180":e.direction===Z(nt).rtl}])},[B(Jn)],2)):a.value?(v(),z("div",{key:2,class:fe(["w-full h-full overflow-hidden rounded-xl flex flex-wrap",{"flex-row-reverse":l.value}])},[(v(!0),z(be,null,Yt(a.value,(d,f)=>(v(),z("div",{key:`zone-${f}`,class:fe(["w-1/3 h-1/3 flex justify-center items-center p-0.5",{"bg-stone-100":d.isPrev||d.isNext,"bg-opacity-50":d.isPrev}])},[d.hasArrow?(v(),z("span",{key:0,class:"w-5 h-5 max-w-full max-h-full inline-block transform text-stone-800",style:Pe({transform:`rotate(${s.value?d.isNext?90:-90:(l.value?d.isPrev:d.isNext)?0:180}deg)`})},[B(Jn)],4)):se("",!0)],2))),128))],2)):(v(),z("div",{key:1,class:fe(["w-full h-full overflow-hidden rounded-xl flex flex-nowrap",{"flex-col":s.value}])},[U("div",{class:fe(["flex-grow w-full h-full flex justify-center items-center bg-stone-100",{"bg-opacity-50":!l.value}])},[U("span",{class:fe(["w-5 h-5 inline-block transform text-stone-800",{"-rotate-90":s.value,"rotate-180":!s.value}])},[B(Jn)],2)],2),c[0]||(c[0]=U("div",{class:"flex-grow w-full h-full"},null,-1)),c[1]||(c[1]=U("div",{class:"flex-grow w-full h-full"},null,-1)),U("div",{class:fe(["flex-grow w-full h-full flex justify-center items-center bg-stone-100",{"bg-opacity-50":l.value}])},[U("span",{class:fe(["w-5 h-5 inline-block text-stone-800",{"transform rotate-90":s.value}])},[B(Jn)],2)],2)],2))],6))}}),Ch=Object.freeze(Object.defineProperty({__proto__:null,default:sa},Symbol.toStringTag,{value:"Module"})),Th={key:0,class:"inline-block fixed z-50 left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none"},la=pe({__name:"DirectionToast",props:{direction:{type:Number},tapZone:{type:Number}},setup(e){const t=e,n=sessionStorage.getItem("tk:dir"),o=ee(typeof n!="string"||+n!==t.direction),i=ct(()=>o.value=!1,1500);ue(()=>[t.direction,t.tapZone],()=>{r(),o.value=!0,i()}),je(()=>{r(),i();let s;ue(Zi(),a=>{a!=="visible"?s=Date.now():Date.now()-s>7e3&&(o.value=!0,i())})});function r(){sessionStorage.setItem("tk:dir",t.direction+"")}return(s,l)=>(v(),oe(Vo,{name:"slow-fade","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:ne(()=>[o.value?(v(),z("div",Th,[B(sa,{direction:e.direction,"tap-zone":e.tapZone},null,8,["direction","tap-zone"])])):se("",!0)]),_:1}))}}),Ph=Object.freeze(Object.defineProperty({__proto__:null,default:la},Symbol.toStringTag,{value:"Module"})),Mh={class:"flex justify-between items-end"},Eh={class:"fixed pointer-events-none left-0 right-0 bottom-0"},aa=pe({__name:"GearControlsLayout",props:{visible:{type:Boolean},spaceTop:{type:null}},setup(e){return(t,n)=>(v(),z("div",{id:"controls",class:fe(["fixed pointer-events-none cursor-auto left-0 top-0 w-full h-full flex flex-col justify-between p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3 z-20",{"opacity-100 z-20":e.visible,"opacity-0 -z-10":!e.visible}])},[xe(t.$slots,"default"),U("div",{class:fe(["flex gap-1 items-center relative z-30 flex-shrink-0 2xs:gap-3",{"children-pointer-events-auto":e.visible}]),style:Pe({paddingTop:`${e.spaceTop||0}px`})},[xe(t.$slots,"top")],6),U("div",Mh,[U("div",{class:fe(["inline-block",{"children-pointer-events-auto":e.visible}])},[xe(t.$slots,"bottom-left")],2),U("div",{class:fe(["inline-flex flex-col items-end gap-4",{"children-pointer-events-auto":e.visible}])},[xe(t.$slots,"bottom-right")],2)]),U("div",Eh,[xe(t.$slots,"progress")])],2))}}),Ih=Object.freeze(Object.defineProperty({__proto__:null,default:aa},Symbol.toStringTag,{value:"Module"})),Oh='.loading-indicator{display:inline-block;height:80px;position:relative;width:80px}.loading-indicator:after,.loading-indicator:before{border-radius:9999px;border-style:solid;border-width:4px;box-sizing:border-box;display:block;position:absolute;--tw-border-opacity:1;animation:lds-ripple 1s cubic-bezier(0,.2,.8,1) infinite;border-color:rgb(184 92 56/var(--tw-border-opacity,1));content:"";opacity:1}.loading-indicator:after{animation-delay:-.5s}@keyframes lds-ripple{0%{height:0;left:40px;opacity:0;top:40px;width:0}4.9%{height:8px;left:36px;opacity:0;top:36px;width:8px}5%{height:8px;left:36px;opacity:1;top:36px;width:8px}to{height:80px;left:0;opacity:0;top:0;width:80px}}',$h={},zh={class:"loading-indicator"};function Dh(e,t){return v(),z("div",zh)}const ei=ve($h,[["render",Dh],["styles",[Oh]]]),Ah=Object.freeze(Object.defineProperty({__proto__:null,default:ei},Symbol.toStringTag,{value:"Module"})),jh={class:"max-h-none max-w-none h-full w-full m-0 p-0 border-none outline-none"},Lh={key:0,class:"fixed inset-0 h-[101%] flex justify-center items-center z-10 bg-black"},hr=ve(pe({inheritAttrs:!1,__name:"GearLayout",props:{loading:{type:Boolean},immediate:{type:Boolean},idle:{type:Boolean},style:{type:Object}},setup(e,{expose:t}){const n={mounted:i=>i.isConnected&&!i.open&&i.showModal(),beforeUnmount:i=>i.isConnected&&i.open&&i.close()},o=ee(null);return t({rootEl:o}),(i,r)=>Ne((v(),z("dialog",jh,[U("div",{ref_key:"rootEl",ref:o,id:"gear-layout",class:fe({"cursor-none":e.idle,"cursor-default":!e.idle,"bg-black":e.immediate||!e.loading,"opacity-0":!e.immediate&&e.loading,"duration-200 transition-colors":!e.immediate,[`${i.$attrs.class??""}`]:!0}),style:Pe(e.style??{})},[e.loading&&e.immediate?(v(),z("div",Lh,[B(ei)])):se("",!0),xe(i.$slots,"default")],6)])),[[n]])}}),[["styles",["#gear-layout{direction:ltr;font-family:Helvetica,sans-serif;font-size:16px;font-weight:400;height:100%;line-height:24px;overflow:hidden;overscroll-behavior:contain;pointer-events:auto;text-align:left;width:100%}"]]]),Bh=Object.freeze(Object.defineProperty({__proto__:null,default:hr},Symbol.toStringTag,{value:"Module"})),Vh={},Nh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 56"};function Rh(e,t){return v(),z("svg",Nh,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M29.84 49.574h12.398c4.899 0 7.336-2.437 7.336-7.265V13.69c0-4.828-2.437-7.265-7.336-7.265H29.84Zm-16.055 0h12.398V6.426H13.785c-4.875 0-7.36 2.414-7.36 7.265V42.31c0 4.851 2.485 7.265 7.36 7.265"},null,-1)])])}const ca=ve(Vh,[["render",Rh]]),Hh=Object.freeze(Object.defineProperty({__proto__:null,default:ca},Symbol.toStringTag,{value:"Module"})),Fh={},Wh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function qh(e,t){return v(),z("svg",Wh,[...t[0]||(t[0]=[U("g",{fill:"none"},[U("path",{d:"M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022m-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),U("path",{fill:"currentColor",d:"M8 3v18H5a2 2 0 0 1-1.995-1.85L3 19V5a2 2 0 0 1 1.85-1.995L5 3zm11 0a2 2 0 0 1 1.995 1.85L21 5v14a2 2 0 0 1-1.85 1.995L19 21h-9V3z"})],-1)])])}const ua=ve(Fh,[["render",qh]]),Uh=Object.freeze(Object.defineProperty({__proto__:null,default:ua},Symbol.toStringTag,{value:"Module"})),da=pe({__name:"MangaPreferencesForm",props:{direction:{type:Number},readerStyle:{type:Number},gap:{type:Number},speed:{type:Number},zoom:{type:Number},webtoon:{type:Boolean},defaultPreferences:{type:Object},enableReset:{type:Boolean}},emits:["update:reader-style","update:direction","update:gap","update:speed","update:zoom"],setup(e,{emit:t}){const n=e,o=t,i=G(()=>["Long strip",n.webtoon?void 0:"Single page",n.webtoon?void 0:"Double page"].filter(Boolean)),r=G(()=>{const a=n.defaultPreferences;return!n.webtoon&&n.readerStyle!==a.readerStyle||!n.webtoon&&n.direction!==a.direction||n.gap!==a.gap||n.speed!==a.speed});function s(a){o("update:zoom",Math.round(a)/100)}function l(){o("update:reader-style",void 0),o("update:direction",void 0),o("update:gap",void 0),o("update:speed",void 0)}return(a,u)=>(v(),z(be,null,[B(Ae,{label:"Style"},{default:ne(()=>[B(vt,{"model-value":e.readerStyle,items:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>o("update:reader-style",c))},null,8,["model-value","items"])]),_:1}),B(Ae,{label:"Direction"},{default:ne(()=>[B(vt,{"model-value":e.direction,items:e.webtoon?["Vertical"]:["Vertical","Left to right","Right to left"],"onUpdate:modelValue":u[1]||(u[1]=c=>o("update:direction",c))},null,8,["model-value","items"])]),_:1}),B(Ae,{label:"Gap size"},{default:ne(()=>[B(vt,{"model-value":e.gap,items:["None","1px","2px","3px","4px","5px"],"onUpdate:modelValue":u[2]||(u[2]=c=>o("update:gap",c))},null,8,["model-value"])]),_:1}),B(Ae,{label:"Play speed"},{default:ne(()=>[B(en,{"model-value":e.speed,min:Z(Xo),max:Z(Go),step:Z(ur),format:c=>`${c.toFixed(2)}x`,"onUpdate:modelValue":u[3]||(u[3]=c=>o("update:speed",c))},null,8,["model-value","min","max","step","format"])]),_:1}),B(Ae,{label:"Zoom"},{default:ne(()=>[B(en,{"model-value":Math.ceil(e.zoom*100),min:Z(Jo)*100,max:Z(Qo)*100,step:Z(uh)*100,format:c=>`${Math.ceil(c)}%`,"onUpdate:modelValue":s},null,8,["model-value","min","max","step","format"])]),_:1}),e.enableReset?(v(),z("div",{key:0,class:fe(["w-full flex justify-center pt-1 duration-200",{"pointer-events-none opacity-0":!r.value,"opacity-90":r.value}])},[B(ar,{class:"w-2/3",onClick:l},{default:ne(()=>[...u[4]||(u[4]=[Wt(" Reset to default ",-1)])]),_:1})],2)):se("",!0)],64))}}),Kh=Object.freeze(Object.defineProperty({__proto__:null,default:da},Symbol.toStringTag,{value:"Module"})),fa=pe({__name:"PageNav",props:Ye({disabled:{type:Boolean},pages:{type:Array},totalImgs:{type:Number}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=lt(e,"modelValue"),o=G(()=>t.pages.map(a=>a.map(({index:u})=>`${u+1}`).join("-"))),i=G(()=>{const a=n.value,u=t.pages.findIndex(c=>c.some(({index:d})=>d===a));return u===-1?t.pages.length-1:u}),r=G(()=>t.pages.length?`${o.value[i.value]}/${t.totalImgs}`:"--");function s(a){const u=t.pages[a][0].index;l(u)}function l(a){n.value=a}return(a,u)=>(v(),oe(rr,{"model-value":i.value,label:r.value,title:"Current page",items:o.value,disabled:e.disabled,"onUpdate:modelValue":s},null,8,["model-value","label","items","disabled"]))}}),Zh=Object.freeze(Object.defineProperty({__proto__:null,default:fa},Symbol.toStringTag,{value:"Module"})),gr=ve(pe({__name:"PauseToast",props:{playing:{type:Boolean}},setup(e){const t=e,n=ee(0);return ue(()=>t.playing,()=>{n.value=Date.now()}),(o,i)=>n.value?(v(),z("div",{key:n.value,class:"animate-pause-fade fixed left-1/2 top-1/2 -mx-12 -my-12 pointer-events-none w-24 h-24 p-4 bg-black bg-opacity-40 rounded-full duration-500"},[e.playing?(v(),oe(tr,{key:0})):(v(),oe(er,{key:1}))])):se("",!0)}}),[["styles",[".animate-pause-fade{animation:pause-fade .4s linear forwards;transform-origin:center}@keyframes pause-fade{0%{opacity:0;transform:scale(.3)}10%{opacity:1;transform:scale(.35)}55%{opacity:1;transform:scale(.65)}to{opacity:0;transform:scale(1)}}"]]]),Yh=Object.freeze(Object.defineProperty({__proto__:null,default:gr},Symbol.toStringTag,{value:"Module"})),Xh=30,mr=ve(pe({__name:"ProgressBar",props:{value:{type:Number},total:{type:Number},longStrip:{type:Boolean},height:{type:Number},rtl:{type:Boolean},opacity:{type:Number}},setup(e){const t=e,n=G(()=>Math.floor(t.value)+1),o=G(()=>`${Math.max(2,Math.min(10,t.height))}px`),i=hn().width,r=G(()=>t.total!==void 0&&i.value/t.total>=Xh);return(s,l)=>(v(),z("div",{class:fe(["rprog",{"rprog--rtl":e.rtl}]),style:Pe({height:o.value,opacity:e.opacity??.8})},[r.value?(v(!0),z(be,{key:0},Yt(e.total,a=>(v(),z("span",{key:a,class:fe(["rprog__item",{"rprog__item--active":n.value===a}]),style:Pe(!e.longStrip||n.value!==a?{}:{"--portion":`${e.value%1*100}%`})},null,6))),128)):(v(),z("div",{key:1,style:Pe({width:`${e.value/(e.total??1)*100}%`}),class:"h-full bg-textPrimary"},null,4))],6))}}),[["styles",['.rprog{--portion:100%;display:flex;width:100%}.rprog--rtl,.rprog--rtl .rprog__item{flex-direction:row-reverse}.rprog__item{display:inline-flex;flex-grow:1;flex-shrink:0;height:100%}.rprog__item:first-child:before{display:none}.rprog__item--active:before,.rprog__item:has(~.rprog__item--active):before{background-color:rgb(0 0 0/var(--tw-bg-opacity,1));content:"";display:block;flex-shrink:0;height:100%;width:1px;--tw-bg-opacity:.25}.rprog__item--active:after,.rprog__item:has(~.rprog__item--active):after{content:"";display:block;height:100%;--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1));width:var(--portion)}']]]),Gh=Object.freeze(Object.defineProperty({__proto__:null,default:mr},Symbol.toStringTag,{value:"Module"})),pa=pe({__name:"GesturesContainer",props:{spaceTop:{type:Number},controlsVisible:{type:Boolean},zoom:{type:Number},zooming:{type:Boolean},pinchToZoome:{type:Boolean},tapZone:{type:Number},pageIndex:{type:Number},playController:{type:Object},rtl:{type:Boolean},horizontal:{type:Boolean},longStrip:{type:Boolean},touchDevice:{type:Boolean},busy:{type:Boolean}},emits:["update:zoom","update:zooming","dragEnd","click","prev","next"],setup(e,{expose:t,emit:n}){const o=e,i=n,r=ee(null),s=ee(Math.min(Qo,Math.max(Jo,o.zoom))),l=ee(!1),a=ee(!1),u={isZoomIn:!1,isZoomOut:!1,initial:void 0};t({rootEl:r}),ue(()=>o.zoom,k=>F(k)),je(()=>{o.touchDevice?St(r,"touchstart",b):(St(r,"mousedown",p),St(window,"wheel",q))}),$t({onKeyDown:k=>{var y;if(!o.busy&&((y=r.value)==null||y.focus(),!(k.key==="Meta"||k.key==="Control")&&(k.ctrlKey||k.metaKey)))switch(k.key){case"0":F(1);break;case"-":F(s.value-.2),k.preventDefault();break;case"=":case"+":F(s.value+.2),k.preventDefault();break}},onKeyUp:k=>{o.zooming&&!(k.ctrlKey||k.metaKey)&&Y()}});function c(k){a.value!==k&&(a.value=k,k?o.playController.pause():(i("dragEnd"),o.playController.resume()))}let d={x:0,y:0},f={x:0,y:0};function p(k){if(k.button!==0)return;const y=r.value;y&&(d={x:k.clientX,y:k.clientY},f={x:y.scrollLeft,y:y.scrollTop},window.addEventListener("mousemove",x),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",x),setTimeout(()=>c(!1))},{once:!0}),k.preventDefault(),k.stopPropagation())}function x(k){const y=k.clientX-d.x,O=k.clientY-d.y;if(!a.value&&Math.abs(y)<.5&&Math.abs(O)<.5)return;c(!0);const $=r.value;$&&($.scrollLeft=f.x-y,$.scrollTop=f.y-O)}let _={distance:0,zoom:s.value,x:0,y:0},D=!1;function b(k){o.busy||(D=o.pinchToZoome&&k.touches.length===2,D&&(i("update:zooming",!0),c(!0),k.stopPropagation(),k.preventDefault(),_={distance:K(k),zoom:s.value,x:(k.touches[0].clientX+k.touches[1].clientX)/2,y:(k.touches[0].clientY+k.touches[1].clientY)/2}),(D||o.longStrip&&o.playController.isPlaying.value)&&window.addEventListener("touchend",P,{once:!0}))}function P(){var $;if(D=!1,o.zooming){c(!1),Y();return}if(!a.value)return;const k=ct(()=>{var le;c(!1),(le=r.value)==null||le.removeEventListener("scroll",O)},200),y=setTimeout(k,200);($=r.value)==null||$.addEventListener("scroll",O);function O(){clearTimeout(y),k()}}function A(k){if(!D&&!(o.longStrip&&o.playController.isPlaying.value)||(c(!0),!o.zooming)||(k.stopPropagation(),k.preventDefault(),k.touches.length<2))return;const O=K(k)/_.distance;J(Math.ceil(O*_.zoom*100)/100,_)}const w=ct(()=>l.value=!1,100);let g=!1;const I=ct(()=>{g=!1},30);function q(k){if(o.busy)return;let y=o.zooming;if(g||(g=!0,y=k.ctrlKey||k.metaKey,y&&i("update:zooming",!0)),I(),y){k.stopPropagation(),k.preventDefault();const O=Math.ceil((s.value+k.deltaY*-.01)*100)/100;J(O,{x:k.clientX,y:k.clientY});return}o.horizontal&&(l.value||(l.value=!0),w(),k.deltaY&&(r.value&&(r.value.scrollLeft+=k.deltaY*(o.rtl?-1:1)),k.stopPropagation()))}function K(k){return Math.hypot(k.touches[0].clientX-k.touches[1].clientX,k.touches[0].clientY-k.touches[1].clientY)}const R={x:0,y:0,ts:0};function Q(k){if(a.value||o.zooming)return;const y=r.value;if(!y||H(y,k)||(i("click"),o.playController.isPlaying.value))return;const{clientX:O,clientY:$}=k,{x:le,y:ae,ts:me}=R;R.x=O,R.y=$,R.ts=new Date().getTime();const ge=R.ts-me;ge>250||ge<10||Math.abs(le-O)>40||Math.abs(ae-$)>40||(R.ts=0,R.x=0,R.y=0,T(O,$))}function H(k,y){if(o.playController.isPlaying.value)return!1;const O=o.tapZone;if(O===pr.none)return!1;const $=o.controlsVisible?o.spaceTop:0,le=k.clientHeight-$,ae=Math.max(0,y.clientY-$),me=o.horizontal?k.clientWidth:le;let ge=!1,Se=!1;if(O){const{prevZones:De,nextZones:Ke}=ra[o.tapZone],ut=Math.floor(ae/le*3);let Qe=Math.floor(y.clientX/k.clientWidth*3);o.rtl&&(Qe=2-Qe);const ze=ut*3+Qe;ge=De.includes(ze),Se=!ge&&Ke.includes(ze)}else{const Ke=(o.horizontal?o.rtl?me-y.clientX:y.clientX:ae)/me,ut=o.horizontal?.2:.15;ge=Ke<=ut&&o.pageIndex>0,Se=!ge&&Ke>=1-ut}if(!ge&&!Se)return!1;if(o.longStrip){const De=(ge?-1:1)*.75*me;o.horizontal?k.scrollLeft=k.scrollLeft+(o.rtl?-1:1)*De:k.scrollTop=Math.max(0,k.scrollTop+De)}else ge?i("prev"):Se&&i("next");return!0}async function T(k,y){const O=s.value===1?2:1;await F(O,{x:k,y}),Y()}function Y(){i("update:zooming",!1),u.initial=void 0,u.isZoomIn=!1,u.isZoomOut=!1}function S(){if(u.initial)return;const k=r.value;if(!k)return;const y=k.querySelector(`[data-index="${o.pageIndex}"],[data-index2="${o.pageIndex}"]`)??void 0;y&&(u.initial={el:y,rect:y.getBoundingClientRect()})}function J(k,y){if(u.isZoomIn=u.isZoomIn||!u.isZoomOut&&k>1,u.isZoomIn&&k<1){F(1,y);return}if(u.isZoomOut=u.isZoomOut||!u.isZoomIn&&k<1,u.isZoomOut&&k>1){F(1,y);return}F(k,y)}async function F(k,y){const O=r.value,$=Math.min(Qo,Math.max(Jo,k));if(!O||s.value===$)return;S();const{initial:le}=u;if(!le)return;const ae=(y==null?void 0:y.x)??O.clientWidth/2,me=(y==null?void 0:y.y)??O.clientHeight/2;s.value=$,i("update:zoom",$),await gt();const{el:ge,rect:Se}=le,De=ge.offsetWidth/Se.width,Ke=ge.offsetHeight/Se.height;O.scrollLeft=ge.offsetLeft-Se.left*De+ae*(De-1),O.scrollTop=ge.offsetTop-Se.top*Ke+me*(Ke-1)}return(k,y)=>(v(),z("div",{ref_key:"rootEl",ref:r,tabindex:"0",class:fe(["w-full h-full overflow-auto scrollbar-none overscroll-contain scrollbar-none focus:outline-none touch-pan-x touch-pan-y",{"!snap-none":!e.longStrip&&(a.value||l.value||e.zooming),"cursor-grabbing":!e.touchDevice&&a.value,"overflow-hidden":e.zooming}]),style:Pe({"font-size":`${s.value}px`}),onClick:Le(Q,["stop"]),onTouchmoveCapture:Le(A,["stop"])},[xe(k.$slots,"default")],38))}}),Jh=Object.freeze(Object.defineProperty({__proto__:null,default:pa},Symbol.toStringTag,{value:"Module"}));function vr(e,t){return(e==null?void 0:e.querySelector(`[data-index="${t}"],[data-index2="${t}"]`))??void 0}const Qh=["data-index"],eg={key:0,class:"img img--loading"},tg=["src"],ng=["data-index"],ha=ve(pe({__name:"ReaderBody",props:{page:{type:Number},pageIndex:{type:Number},direction:{type:Number},isLongStrip:{type:Boolean},isVertical:{type:Boolean},isDouble:{type:Boolean},isRTL:{type:Boolean},pages:{type:Array},totalImgs:{type:Number},gap:{type:Number},zoom:{type:Number},zooming:{type:Boolean},pinchToZoome:{type:Boolean},tapZone:{type:Number},spaceTop:{type:Number},touchDevice:{type:Boolean},playController:{type:Object},busy:{type:Boolean},controlsVisible:{type:Boolean}},emits:["ready","update:zoom","update:zooming","update:playing","dragEnd","click","end","prev","next"],setup(e,{expose:t,emit:n}){const o=e,i=n,r=ee(null),s=G(()=>{var A;return(A=r.value)==null?void 0:A.rootEl});t({rootEl:s});const l=hn(),a=G(()=>{const{width:A,height:w}=l,g=o.isLongStrip?o.isVertical?A.value:w.value:Math.min(A.value,w.value);return Math.min(4,Math.max(1,Math.ceil(g/400-1)))*o.gap}),u=ee(o.isLongStrip?{min:o.pageIndex-1,max:o.pageIndex}:_()),c=G(()=>{const{min:A,max:w}=u.value,g={};for(let I=A;I<=w;I++)g[I]=!0;return g}),d=ee(p()),f=P(()=>{d.value=p()},100);ue(l.width,f),ue(l.height,f),ue(()=>o.pages,f),ue(()=>o.isLongStrip,f),ue(()=>o.isVertical,f);function p(){const A=l.width.value,w=l.height.value,{pages:g,isLongStrip:I,isVertical:q}=o;return g.map(K=>{var k;const R=K.some(y=>{var O;return(O=y.img)==null?void 0:O.isLoading}),Q=K.map(y=>y.index),H={isLoading:R,indexes:Q,visible:!1};if(R)return H;const T=K.map(({img:y})=>y).filter(Boolean);if(!T.length||(H.srcs=T.map(({src:y})=>y),T.every(y=>y.hasError)))return H;const S=(k=T.find(y=>!y.hasError))==null?void 0:k.size;if(!S)return H;const J=T.reduce((y,O)=>{var $;return y+((($=O.size)==null?void 0:$.width)??S.width)},0),F=T.reduce((y,O)=>{var $;return y+((($=O.size)==null?void 0:$.height)??S.height)},0)/T.length;return I&&q||!I&&A/J<w/F?(H.width=Math.min(A,J),H.height=F*(H.width/J)):(H.height=Math.min(w,F),H.width=J*(H.height/F)),H})}const x=G(()=>{const A=o.isVertical?"width":"height";return d.value.map(w=>w[A]).filter(Boolean).sort((w,g)=>g-w)[0]});je(()=>{const A=vr(s.value,o.pageIndex);A==null||A.scrollIntoView({behavior:"instant",block:"start"});let w,g=!1;Ns(()=>{w!==o.pageIndex&&(w=o.pageIndex,I(),g||(g=!0,gt(()=>i("ready"))))});async function I(){if(!o.isLongStrip){u.value=_();return}const q=Math.floor(o.page),K=vr(s.value,q);if(!K)return;const R=+D(K).getAttribute("data-index"),Q=+b(K).getAttribute("data-index");(R!==u.value.min||Q!==u.value.max)&&(u.value={min:R,max:Q})}});function _(){const{pageIndex:A}=o;return{min:A-(o.isDouble?5:3),max:A+(o.isDouble?6:3)}}function D(A,w=0){const g=A.previousElementSibling;if(!g)return A;const I=w+(o.isVertical?g.clientHeight:g.clientWidth);return(o.isVertical?I>l.height.value*1.5:o.isRTL?I>l.width.value*2.5:I>l.width.value*1.5)?g:D(g,I)}function b(A,w=0){const g=A.nextElementSibling;if(!g)return A;const I=w+(o.isVertical?g.clientHeight:g.clientWidth);return(o.isVertical?I>l.height.value*3.5:o.isRTL?I>l.width.value*1.5:I>l.width.value*2.5)?g:b(g,I)}function P(A,w){let g;return()=>{g||(g??(g=setTimeout(()=>{g=void 0,A()},w)))}}return(A,w)=>(v(),oe(pa,{ref_key:"gestureContainer",ref:r,"space-top":e.spaceTop,"controls-visible":e.controlsVisible,zoom:e.zoom,zooming:e.zooming,"pinch-to-zoome":e.pinchToZoome,"tap-zone":e.tapZone,"page-index":e.pageIndex,class:fe(["rbod",{"rbod--long-strip":e.isLongStrip,"rbod--paging":!e.isLongStrip,"rbod--vertical":e.isVertical,"rbod--rtl":e.isRTL,"rbod--1page":d.value.length===1}]),"play-controller":e.playController,horizontal:!e.isVertical,rtl:e.isRTL,"touch-device":e.touchDevice,busy:e.busy,"long-strip":e.isLongStrip,style:Pe({"--gap":`${a.value}em`,"--space-top":`${e.spaceTop}px`,"--screen-width-em":Z(l).width.value+"em","--screen-height-em":Z(l).height.value+"em",...e.isLongStrip?{"--max-size-em":x.value+"em"}:{}}),"onUpdate:zoom":w[0]||(w[0]=g=>i("update:zoom",g)),"onUpdate:zooming":w[1]||(w[1]=g=>i("update:zooming",g)),onDragEnd:w[2]||(w[2]=()=>i("dragEnd")),onClick:w[3]||(w[3]=()=>i("click")),onPrev:w[4]||(w[4]=()=>i("prev")),onNext:w[5]||(w[5]=()=>i("next"))},{default:ne(()=>[(v(!0),z(be,null,Yt(d.value,g=>{var I;return v(),z("div",cn({key:e.direction+"_"+g.indexes[0],"data-index":g.indexes[0]},{ref_for:!0},g.indexes.length>1?{"data-index2":g.indexes[1]}:{}),[!((I=g.srcs)!=null&&I.length)||g.isLoading?(v(),z("div",eg,[c.value[g.indexes[0]]?(v(),oe(ei,{key:0})):se("",!0)])):g.srcs.length==1?(v(),oe(Pi(c.value[g.indexes[0]]?"img":"div"),cn({key:1,class:"img"},{ref_for:!0},c.value[g.indexes[0]]?{src:g.srcs[0]}:{},{style:{width:g.width!==void 0?g.width+"em":"",height:g.height!==void 0?g.height+"em":""}}),null,16,["style"])):(v(),z("div",{key:2,class:fe(["img img--double",{"flex-row-reverse":e.isRTL}]),style:Pe({width:g.width!==void 0?g.width+a.value+"em":"",height:g.height!==void 0?g.height+"em":""})},[g.indexes.some(q=>c.value[q])?(v(!0),z(be,{key:0},Yt(g.srcs,q=>(v(),z("div",{key:q},[U("img",{src:q},null,8,tg)]))),128)):se("",!0)],6))],16,Qh)}),128)),U("div",{class:"last","data-index":e.totalImgs},[xe(A.$slots,"end")],8,ng)]),_:3},8,["space-top","controls-visible","zoom","zooming","pinch-to-zoome","tap-zone","page-index","play-controller","horizontal","rtl","touch-device","busy","long-strip","class","style"]))}}),[["styles",[".rbod{--tw-translate-y:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width:1024px){.rbod{transform:none}}.rbod--rtl{flex-direction:row-reverse}.rbod.rbod--vertical>div{padding:calc(var(--gap)/2) 0}.rbod:not(.rbod--vertical){align-items:center;display:flex;height:100%;justify-content:flex-start}.rbod:not(.rbod--vertical)>div{padding:0 calc(var(--gap)/2)}.rbod--long-strip.rbod--vertical.rbod--1page>div:first-child{min-height:100vh}.rbod--long-strip.rbod--vertical>div:first-child{margin-top:var(--space-top);padding-top:0}.rbod--long-strip.rbod--vertical>div:last-child{padding-bottom:0}.rbod--long-strip.rbod--vertical>div{width:var(--max-size-em)}.rbod--long-strip.rbod--vertical .img--loading{height:75vh;width:100%}.rbod--long-strip.rbod--vertical .last{height:100vh}.rbod--long-strip:not(.rbod--vertical).rbod--1page>div:first-child{min-width:100vw}.rbod--long-strip:not(.rbod--vertical)>div{align-items:center;display:flex;height:var(--max-size-em)}.rbod--long-strip:not(.rbod--vertical) .img--loading{height:100%;max-width:100vw;width:680px}.rbod--long-strip:not(.rbod--vertical) .last{width:100vw}.rbod--long-strip>div>img{flex-shrink:0;margin:auto}.rbod--paging>div{align-items:center;display:grid;justify-content:center;min-height:100vh;min-width:100vw;scroll-snap-align:center;scroll-snap-stop:always}.rbod--paging.rbod--vertical{scroll-snap-type:y var(--tw-scroll-snap-strictness);--tw-scroll-snap-strictness:mandatory}.rbod--paging.rbod--vertical>div{width:var(--screen-width-em)}.rbod--paging:not(.rbod--vertical){scroll-snap-type:x var(--tw-scroll-snap-strictness);--tw-scroll-snap-strictness:mandatory}.rbod--paging:not(.rbod--vertical)>div{height:var(--screen-height-em)}.rbod--paging .img--loading{height:100%;width:100%}.rbod--paging .img.img--double{align-items:center;background-color:transparent;display:flex;gap:var(--gap);justify-content:center}.rbod--paging .img.img--double div{display:flex;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rbod--paging .img.img--double div img{flex-shrink:0;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.rbod>div{flex-shrink:0}.rbod .img,.rbod>div{margin:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rbod .img{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));-o-object-fit:contain;object-fit:contain}.rbod .img--loading{align-items:center;background-color:transparent;display:flex;justify-content:center}"]]]),og=Object.freeze(Object.defineProperty({__proto__:null,default:ha},Symbol.toStringTag,{value:"Module"})),ig={},rg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function sg(e,t){return v(),z("svg",rg,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"},null,-1)])])}const ga=ve(ig,[["render",sg]]),lg=Object.freeze(Object.defineProperty({__proto__:null,default:ga},Symbol.toStringTag,{value:"Module"})),ag={class:"flex w-full flex-shrink-0 justify-between items-center h-16 px-3"},ma=pe({__name:"BottomSheet",props:Ye({spaceTop:{type:Number}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=lt(e,"modelValue"),n=ee(null),o=ee(!1),i=ee(0);$t({onKeyDown:s});const r=Ko();ue(t,c=>r(c)),Yi(()=>{const c=t.value;return c&&(t.value=!1),c});function s(c){t.value&&c.key==="Escape"&&(t.value=!1,c.preventDefault())}const l={y:-1};function a(c){const d=n.value;if(!d)return;if(d.scrollTop>0){l.y=-1;return}if(l.y===-1){l.y=Math.max(0,c.touches[0].clientY);return}const p=c.touches[0].clientY-l.y,x=p>0?p:0;x!=i.value&&(i.value=x);const _=x>0;_!==o.value&&(o.value=_)}async function u(){o.value=!1,l.y=-1,await gt();const c=n.value;c&&c.offsetHeight-i.value<window.innerHeight/2&&i.value>c.offsetHeight*.3&&(t.value=!1),i.value=0}return(c,d)=>(v(),z("div",{class:fe(["fixed inset-0 flex flex-col items-center justify-end select-none z-40 text-stone-100",{"!pointer-events-none":!t.value}]),style:Pe({"padding-top":(e.spaceTop??0)+60+"px"}),onClick:d[3]||(d[3]=()=>t.value=!1)},[B(Vo,{name:"slide","enter-from-class":"!translate-y-full","leave-to-class":"!translate-y-full"},{default:ne(()=>[t.value?(v(),z("div",{key:0,class:fe(["w-full sm:w-[31rem] bg-stone-900 bg-opacity-90 backdrop-blur-md rounded-t-xl max-w-full overflow-hidden shadow-lg shadow-neutral-950",{"duration-0":o.value,"duration-200":!o.value}]),style:Pe(i.value?{transform:`translateY(${i.value}px)`}:{}),onClick:d[1]||(d[1]=Le(()=>{},["stop"])),onWheelPassive:d[2]||(d[2]=Le(()=>{},["stop"])),onTouchmove:Le(a,["stop"]),onTouchend:u},[U("div",ag,[B(Ge,{transparent:"",onClick:d[0]||(d[0]=()=>t.value=!1)},{default:ne(()=>[B(ga)]),_:1}),xe(c.$slots,"name"),xe(c.$slots,"actions")]),U("div",{ref_key:"scrollEl",ref:n,class:"overflow-auto px-6 md:px-8 lg:px-10 xl:px-12 pt-1.5 pb-8 md:pb-6 flex-grow scrollbar-sm",style:{"max-height":"calc(100% - 4rem)"}},[xe(c.$slots,"default")],512)],38)):se("",!0)]),_:3})],6))}}),cg=Object.freeze(Object.defineProperty({__proto__:null,default:ma},Symbol.toStringTag,{value:"Module"})),ug=["onClick","onKeyup"],va=ve(pe({__name:"TabBar",props:Ye({items:{type:Array}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=lt(e,"modelValue"),o=ee(null),i=ee({width:"",left:""}),r=ee(!1);je(()=>{const l=Date.now();ue(n,async a=>{var c;await gt();const u=(c=o.value)==null?void 0:c.children[a+1];u&&(i.value={width:u.offsetWidth+"px",left:u.offsetLeft+"px"},!r.value&&Date.now()-l>500&&(r.value=!0),u.scrollIntoView({behavior:r.value?"smooth":"auto",block:"center",inline:"center"}))},{immediate:!0})});function s(l){n.value=l}return(l,a)=>(v(),z("div",{ref_key:"root",ref:o,class:"relative h-8 rounded-[2.5rem] inline-flex bg-black bg-opacity-50 p-1 font-medium max-w-full leading-none overflow-auto scrollbar-none",style:{}},[U("div",{class:fe(["bg-stone-300 h-6 rounded-2xl absolute top-1 pointer-events-none",{"duration-200":r.value}]),style:Pe(i.value)},null,6),(v(!0),z(be,null,Yt(t.items,(u,c)=>Ne((v(),z("div",{key:c,tabindex:"0",class:fe(["text-sm inline-flex justify-center items-center h-6 rounded-2xl px-4 cursor-pointer relative z-10 whitespace-nowrap flex-shrink-0 focus:outline-primary hover:bg-stone-50 hover:bg-opacity-10 duration-200",{"text-stone-900":c==n.value,"text-stone-400":c!=n.value}]),onClick:Le(()=>s(c),["stop"]),onKeyup:[Fo(()=>s(c),["enter"]),Fo(()=>s(c),["space"])]},[Wt(He(u),1)],42,ug)),[[Z(zt),30]])),128))],512))}}),[["styles",[".scrollbar-none{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}"]]]),dg=Object.freeze(Object.defineProperty({__proto__:null,default:va},Symbol.toStringTag,{value:"Module"})),fg={},pg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function hg(e,t){return v(),z("svg",pg,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5c0-2.21-1.79-4-4-4z"},null,-1)])])}const ba=ve(fg,[["render",hg]]),gg=Object.freeze(Object.defineProperty({__proto__:null,default:ba},Symbol.toStringTag,{value:"Module"})),mg={},vg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"};function bg(e,t){return v(),z("svg",vg,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M14 8.25a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5m0 8a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5M11.75 22a2.25 2.25 0 1 0 4.5 0a2.25 2.25 0 0 0-4.5 0"},null,-1)])])}const ya=ve(mg,[["render",bg]]),yg=Object.freeze(Object.defineProperty({__proto__:null,default:ya},Symbol.toStringTag,{value:"Module"})),wg={key:1,class:"w-full text-center text-xl whitespace-nowrap text-ellipsis flex-shrink overflow-hidden px-5 select-text"},xg={class:"opacity-90"},_g={key:0,class:"w-full text-center text-sm text-stone-400 whitespace-nowrap text-ellipsis flex-shrink overflow-hidden mb-3 -mt-2 select-text"},br=pe({__name:"SettingsBottomSheet",props:Ye({name:{type:String},spaceTop:{type:Number},enableHelp:{type:Boolean},enableDefaultPreferences:{type:Boolean}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:Ye(["help","more"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=lt(e,"modelValue"),r=ee(0),s=G(()=>n.name??location.hostname);$t({onKeyUp:a=>{a.key==="s"&&!a.metaKey&&!a.ctrlKey&&(i.value=!0)}}),je(()=>{ue(i,a=>{a||setTimeout(()=>{r.value!==0&&(r.value=0)},300)})});function l(){o("help"),i.value=!1}return(a,u)=>(v(),oe(ma,{modelValue:i.value,"onUpdate:modelValue":u[2]||(u[2]=c=>i.value=c),"space-top":e.spaceTop},{name:ne(()=>[e.enableDefaultPreferences?(v(),oe(va,{key:0,modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=c=>r.value=c),items:["Preferences","Default"]},null,8,["modelValue"])):(v(),z("h3",wg,He(s.value),1))]),actions:ne(()=>[e.enableDefaultPreferences?(v(),oe(Ge,{key:0,transparent:"",class:fe(e.enableHelp?"":"opacity-0 pointer-events-none"),onClick:l},{default:ne(()=>[U("span",xg,[B(ba)])]),_:1},8,["class"])):(v(),oe(Ge,{key:1,transparent:"",onClick:u[1]||(u[1]=()=>o("more"))},{default:ne(()=>[B(ya)]),_:1}))]),default:ne(()=>[r.value===0?(v(),z(be,{key:0},[e.enableDefaultPreferences?(v(),z("h3",_g,He(s.value),1)):se("",!0),xe(a.$slots,"tab-preferences")],64)):(v(),z(be,{key:1},[xe(a.$slots,"tab-default"),u[3]||(u[3]=U("div",{class:"h-6"},null,-1))],64))]),_:3},8,["modelValue","space-top"]))}}),Sg=Object.freeze(Object.defineProperty({__proto__:null,default:br},Symbol.toStringTag,{value:"Module"}));function Qn(e=0){return new Promise(t=>setTimeout(t,e))}function wa(e){const t=async(n,o)=>{var i;if(!n.toBlob){if(o)return;const r=n.cloneNode(),s=(i=r.getContext)==null?void 0:i.call(r,"2d");if(!s)return;try{s.drawImage(e,0,0)}catch{return}return t(r,!0)}return await new Promise(r=>{const s=l=>{if(!l)return r(void 0);const a=URL.createObjectURL(l);r(a)};try{n.toBlob(s,"image/jpeg",1)}catch{r(void 0)}})};return t(e,!1)}let ti;async function kg(e,t){if(ti||!t.startsWith("blob:"))return t;if(ti===void 0){try{if((await fetch(t)).ok)return ti=!0,t}catch{}ti=!1}e.complete||await new Promise(a=>{let u=0;const c=setInterval(()=>{e.complete?(a(),clearInterval(c)):++u>=30&&a()},100)});const o=e.naturalWidth,i=e.naturalHeight;if(!o||!i)return;const r=document.createElement("canvas"),s=r.getContext("2d");return r.width=o,r.height=i,s==null||s.drawImage(e,0,0,o,i),await wa(r)}function Cg(e){const t=new Set,n=e.getAttributeNames(),o=n.indexOf("src"),i=o!==-1;i&&(n.splice(o,1),n.push("src"));for(const r of n){if(r==="srcset"||i&&r===":src"||r!=="data-url"&&r!=="data-original"&&!r.includes("src"))continue;const s=e.getAttribute(r);s&&(r==="src"&&e.naturalWidth&&e.naturalWidth<200||t.add(s.replace(/(\n|\t)/g," ").trim()))}return Array.from(t)}function ni(e,t){return e>=75&&t>=50&&(e>=200||t>=200)}class Tg{constructor({onChanged:t}){ke(this,"isMounted",!0);ke(this,"elsDisposeCallbacksMap",new Map);ke(this,"onChanged");this.onChanged=t}dispose(){this.isMounted=!1,this.elsDisposeCallbacksMap.forEach(t=>t()),this.elsDisposeCallbacksMap=new Map,this.onChanged=()=>{}}async download(t){if(!this.isMounted)return;const n=t.el,o=!!n&&n instanceof HTMLImageElement,i=n?o?Cg(n):[await wa(n)].filter(Boolean):[t.src].filter(Boolean);if(!(!n&&!i.length||!this.isMounted)){if(n&&!this.elsDisposeCallbacksMap.has(n))if(o){let r=i.slice(-1)[0];const s=new MutationObserver(l=>{l.some(u=>{if(u.attributeName!=="src")return!1;const c=r;return r=n.getAttribute("src"),!!r&&c!==r})&&this.download(t)});s.observe(n,{attributes:!0}),this.elsDisposeCallbacksMap.set(n,()=>s.disconnect())}else{const r=n.getContext("2d");if(r){const s=r.drawImage.bind(r),l=r.putImageData.bind(r),a=(u,c,d)=>(setTimeout(()=>this.download(t),100),u.apply(c,d));try{r.drawImage=new Proxy(s,{apply:a}),r.putImageData=new Proxy(l,{apply:a})}catch{}this.elsDisposeCallbacksMap.set(n,()=>{try{r.drawImage=s,r.putImageData=l}catch{}})}}i.length&&(this.onChanged(t,{src:i[0],isLoading:!0,hasError:!1}),await this.downloadRawImage(t,i))}}async downloadRawImage(t,n){const o=t.el instanceof HTMLImageElement?t.el:void 0;for(let i=0;i<n.length;i++){const r=n[i],s=o?await kg(o,r):r;if(!s||!this.isMounted)return;const l=await Pg(s,o,a=>{this.isMounted&&this.onChanged(t,{src:s,size:a,isLoading:!1,hasError:!1})});if(l.ok||!this.isMounted)return;i===n.length-1&&this.onChanged(t,{src:s,isLoading:!1,hasError:!!l.error,invalid:!!l.invalid,size:l.size})}}}async function Pg(e,t,n){return(t==null?void 0:t.src)===e&&t.naturalWidth&&t.naturalHeight?(n({width:t.naturalWidth,height:t.naturalHeight}),t.complete?{ok:!0}:new Promise(o=>{t.addEventListener("load",()=>o({ok:!0}),{once:!0})})):await new Promise(o=>{const i=new Image,r=setInterval(()=>{const{naturalWidth:s,naturalHeight:l}=i;if(l&&s){const a={width:s,height:l};ni(s,l)?n(a):o({invalid:!0,size:a}),clearInterval(r)}},20);i.onerror=()=>{o({error:!0}),clearInterval(r)},i.onload=()=>setTimeout(()=>o({ok:!0}),25),i.src=e})}const Mg=3;class Eg{constructor(t){ke(this,"download");ke(this,"threads");ke(this,"completedItems");ke(this,"promisesMap",new Map);this.download=t.download}dispose(){var t;(t=this.threads)==null||t.dispose(),this.threads=void 0,this.completedItems=void 0}run({activeIndex:t,items:n}){var r;if(this.completedItems===n)return;this.completedItems=void 0,(r=this.threads)==null||r.dispose();let o=Math.max(0,t-1),i=!0;this.threads=new Ig(Mg,()=>{const s=n[o];if(!s){this.completedItems=n;return}i&&o===n.length-1?(i=!1,o=t-2):i?o++:o--;const l=s.src??s.el;if(l){const u=this.promisesMap.get(l);if(u)return u}const a=this.download(s);return l&&this.promisesMap.set(l,a),a}),this.threads.exec()}}class Ig{constructor(t,n){ke(this,"isDisposed",!1);this.limit=t,this.getNext=n}dispose(){this.isDisposed=!0}exec(){for(let t=0;t<this.limit;t++)this.next()}async next(){if(this.isDisposed)return;const t=this.getNext();t&&(await t,await Qn(20),this.next())}}class xa{constructor(){ke(this,"elsPool",new Map)}check(t){if(!t||t===document.body)return!0;const n=this.elsPool.get(t);if(n!==void 0)return n;const o=getComputedStyle(t);if(!(o.display!=="none"&&+(o.opacity??"1")>.1))return this.elsPool.set(t,!1),!1;const r=this.check(t.parentElement);return this.elsPool.set(t,r),r}}function Og(e,t){let n=[t??document.documentElement];const o=e.split("->");for(let i=0;i<o.length;i++){const r=o[i];n=n.map(s=>Array.from((s.shadowRoot??s).querySelectorAll(r))).flat()}return n}function eo(e,t){if(e instanceof HTMLOptionElement){const n=e.parentElement instanceof HTMLOptGroupElement?e.parentElement.parentElement:e.parentElement;if(!n||!(n instanceof HTMLSelectElement))return;const o=e.getAttribute("value")||"";if(n.value===o)return;n.value=o,n.dispatchEvent(new Event("change"));return}e instanceof HTMLAnchorElement&&(t==null?void 0:t.preventDefault)!==!1&&e.addEventListener("click",n=>n.preventDefault(),{once:!0}),e.click(),e.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse",button:0})),e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0}))}async function $g(e){const{lstrip:t,lstripBtn:n}=e||{};if(!t||!n||!!document.querySelector(t))return!1;const i=n.split(";");for(const r of i)if(!await zg(r.trim()))return!1;return!0}async function zg(e){const t=await gn(50,30,()=>document.querySelector(e));return t?(eo(t),await Qn(),!0):!1}class Dg{constructor({spec:t,onChanged:n}){ke(this,"spec");ke(this,"onChanged");ke(this,"rawImages",[]);ke(this,"isMounted",!0);ke(this,"loadRawImagesTs");ke(this,"imgListenersMap",new Map);ke(this,"disconnectObservers");ke(this,"contentEl");ke(this,"reloadRawImages",ct(()=>{this.contentEl&&this.loadRawImages(this.contentEl)},100));this.spec=t,this.onChanged=n,this.init()}dispose(){var t;this.isMounted=!1,(t=this.disconnectObservers)==null||t.call(this),this.disconnectObservers=void 0,this.onChanged=()=>{}}init(){var i;const t=new MutationObserver(this.reloadRawImages),n=(i=this.spec)!=null&&i.imgDivs?void 0:(()=>{let r=window.innerWidth;return new ResizeObserver(ct(()=>{const s=window.innerWidth;if(s!==r){r=s;return}this.reloadRawImages()},50))})();this.disconnectObservers=async()=>{t.disconnect(),n==null||n.disconnect()};let o=!1;this.loadContentEl(r=>{this.contentEl!==r&&(this.contentEl=r,t.disconnect(),n==null||n.disconnect(),t.observe(this.contentEl,{childList:!0,subtree:!0}),n==null||n.observe(this.contentEl),o?this.reloadRawImages():(o=!0,this.loadRawImages(this.contentEl)))})}setRawImages(t){let n=!1;const o=t.map((i,r)=>{const s=this.rawImages[r];return s&&s.el===i.el&&s.parentEl===i.parentEl&&s.src===i.src?s:(n=!0,i)});(n||!o.length)&&(this.rawImages=o,this.onChanged(t))}async loadContentEl(t){var l;const n=await $g(this.spec),o=(l=this.spec)==null?void 0:l.content;if(!o){t(document.body);return}let i=await gn(n?100:1,10,()=>{for(const a of o.split(",")){const u=document.querySelector(a);if(u)return u}});if(!i)return;t(i);let r=0;const s=async()=>{if(this.isMounted&&!(i!=null&&i.isConnected)){if(r=0,i=await gn(50,20,()=>{const a=document.querySelector(o);return a!=null&&a.isConnected&&a!==i?a:void 0}),!i)return;t(i)}!this.isMounted||++r>=10||setTimeout(s,200)};setTimeout(s,200)}async loadRawImages(t){var r;if(!this.isMounted||!t.isConnected)return;const n=Date.now();this.loadRawImagesTs=n;const o=(r=this.spec)==null?void 0:r.imgDivs,i=o?await this.loadFromImgDivs(t,o):this.loadFromContentEl(t);this.loadRawImagesTs!==n||!t.isConnected||!this.isMounted||this.setRawImages(i)}async loadFromImgDivs(t,n){const o=Og(n,t);if(!o.length)return this.loadFromContentEl(t);const i=new xa;return o.map(s=>{const l=Array.from(s.querySelectorAll("img,canvas"));for(const a of l){if(!i.check(a)){this.observeInvalidImgEl(a);continue}if(a instanceof HTMLCanvasElement){if(_a(a))return{el:a,parentEl:s}}else if(a instanceof HTMLImageElement){if(Sa(a))return{el:a,parentEl:s};this.observeInvalidImgEl(a)}}return{parentEl:s}})}loadFromContentEl(t){const n=[],o={},i=new xa;return Array.from(t.querySelectorAll("img,canvas")).forEach(s=>{if(!i.check(s)){this.observeInvalidImgEl(s);return}if(s instanceof HTMLCanvasElement)_a(s)&&n.push({el:s});else if(s instanceof HTMLImageElement)if(Sa(s)){const l=s.getAttribute("src");if(l){const a=o[l];if(a!==void 0&&a!==-1){n.splice(a,1);return}o[l]=n.length}n.push({el:s})}else this.observeInvalidImgEl(s)}),n}observeInvalidImgEl(t){if(!(t instanceof HTMLImageElement)||this.imgListenersMap.has(t))return;const n=()=>{t.removeEventListener("load",n),this.imgListenersMap.delete(t),this.reloadRawImages()};this.imgListenersMap.set(t,n),t.addEventListener("load",n)}}function _a(e){return e.isConnected&&ni(e.width,e.height)}function Sa(e){if(!e.isConnected)return!1;const t=e.getBoundingClientRect();return!t.width||!t.height||ni(t.width,t.height)}const oi="mp-scroll-container";class yr{constructor(){ke(this,"scrollEl")}dispose(){var t;(t=this.scrollEl)==null||t.classList.remove(oi)}scrollTo({rawImages:t,page:n,skipIfVisible:o,isScrollDown:i,isScrollExact:r,fallbackScrollEl:s}){var D;const l=Math.floor(n),a=t[Math.min(t.length-1,l)];if(!a)return;const u=a.el??a.parentEl??(a.src?document.querySelector(`img[src^="${a.src}"]`):void 0);if(!u)return;const c=u.getBoundingClientRect();if(o&&c.top<=0&&c.top+c.height>0)return;const d=yr.getScrollable(u,s);if(!d)return;const{el:f,top:p}=d;s!==document.documentElement&&!f.classList.contains(oi)&&(f!==this.scrollEl&&((D=this.scrollEl)==null||D.classList.remove(oi),this.scrollEl=f),f.classList.add(oi));const x=n>=t.length?c.height:r?n%1*c.height:i?Math.max(0,c.height-window.innerHeight/2):-window.innerHeight/2,_={top:p+x,behavior:"instant"};f.scrollTo(_),f!==document.documentElement&&document.documentElement.scrollTo(_)}static getScrollable(t,n){const o=(i,r)=>{if(!i)return;const{offsetTop:s,offsetParent:l}=i;if(l&&s&&r.set(l,Math.max(r.get(l)??0,s)),!(i===n||i.scrollHeight-i.clientHeight>=10&&window.getComputedStyle(i).overflow!=="visible"))return o(i.parentElement,r);let u=0;return r.forEach((c,d)=>{u+=d===l?c-s:c}),{el:i,top:u}};return o(t,new Map)}}function ka(e){var t,n;for(let o=0;o<e.length;o++){const i=((t=e[o])==null?void 0:t.el)??((n=e[o])==null?void 0:n.parentEl),r=i==null?void 0:i.getBoundingClientRect();if(!r||r.bottom<=0)continue;const s=r.top;return o+(s>=0?0:-s/r.height)}return 0}function Ag(e){if(document.documentElement.scrollTop<700)return 0;const n=Array.from(document.querySelectorAll("img[src]")).filter(o=>e.includes(o.src)).map(o=>({el:o}));return ka(n)}function jg(e){var R,Q,H;const t=(R=e.raw.value)==null?void 0:R.isWebtoon,n=ee(t===!1),o=ee(t);let i=!1;const r=e.touchDevice&&!navigator.userAgent.toLowerCase().includes("android"),s=((H=(Q=e.raw.value)==null?void 0:Q.imgs)==null?void 0:H.filter(Boolean))??[];let l=e.isAutoShow!==!1?e.page.value:s.length?Ag(s):void 0,a=s.map(T=>({src:T})),u,c;const d=new Map,f=({src:T,el:Y})=>{const S=Y??T;return S?d.get(S):void 0},p=ee(s.map(T=>({src:T,isLoading:!0,hasError:!1}))),x=()=>{const T=[];a.forEach(Y=>{const{src:S,el:J}=Y,F=J??S,k=F?d.get(F):void 0;(F&&!(k!=null&&k.invalid)||Y.parentEl)&&T.push(k)}),p.value=T};let _=setTimeout(e.onTimeout,2e4);const D=()=>{_&&(clearTimeout(_),_=void 0)};let b=0,P=0;const A=4,w=new Tg({onChanged(T,Y){const S=T.el??T.src;if(!S||(d.set(S,Y),x(),Y.isLoading))return;if(Y.hasError){if(c||o.value!==void 0)return;c=setTimeout(()=>{c=void 0,o.value===void 0&&e.onError("Failed to load images")},3e3);return}const{size:J,invalid:F}=Y;if(!(!J||F)){if(!o.value&&P<A){const k=i?a:a.filter(({el:me,src:ge})=>ge||!(me&&me instanceof HTMLImageElement&&!d.has(me)));let y=k.indexOf(T);if(i&&y>4||y===-1&&(T.el&&(y=k.findIndex(me=>me.el===T.el)),y===-1))return;const O=y>Math.min(1,k.length-3)&&y<Math.max(k.length-2,3),$=J.width/J.height;$>2&&b++;const le=$<.5||b>=A,ae=!le&&.65<$&&$<.75;ae&&P++,o.value!==le&&(O||le)&&(o.value=le),O&&n.value!=ae&&(n.value=!0),o.value===void 0&&ae&&P===A&&(o.value=!1)}K()}}}),g=new Eg({download:async T=>{!(T.el&&d.has(T.el))&&!(T.src&&d.has(T.src))&&await w.download(T)}}),I=()=>{g.run({items:a,activeIndex:Math.min(a.length-1,Math.floor(e.page.value))})},q=new yr;if(s.length)I();else{let T=!1;u=new Dg({spec:e.spec,async onChanged(Y){var S;if(a=Y,x(),!e.raw.value&&!Y.length){e.onError("no_img");return}(S=e.spec)!=null&&S.imgDivs&&!T&&e.isAutoShow!==!1&&e.page.value&&(T=!0,q.scrollTo({rawImages:Y,page:e.page.value,skipIfVisible:!0,fallbackScrollEl:r?document.body:document.documentElement,isScrollDown:!0}),await Qn(1)),l===void 0&&e.isAutoShow===!1&&(l=ka(Y)),I()}})}Ti(()=>{w.dispose(),g.dispose(),u==null||u.dispose(),c&&clearTimeout(c),q.dispose(),i&&q.scrollTo({rawImages:a,page:e.page.value,fallbackScrollEl:document.documentElement,isScrollExact:!0})});function K(){if(i||o.value===void 0||l===void 0)return;const T=Math.max(0,Math.min(l,a.length)),Y=Math.min(Math.floor(T),a.length-1);if(Y>=1){const J=a[Y];if(!J||!f(J)){e.isAutoShow&&q.scrollTo({rawImages:a,page:Y,fallbackScrollEl:r?document.body:document.documentElement,isScrollDown:!0});return}for(let F=Y;F<a.length;F++){const k=f(a[F]);if(!k)return;if(!k.invalid){if(!k.size&&!k.hasError)return;break}}for(let F=Y-1;F>=0;F--){const{src:k,el:y}=a[F],O=y??k;if(!O)break;const $=d.get(O);if(!$)return;if(!$.invalid){if(!$.size&&!$.hasError)return;break}}}if(i)return;i=!0,D(),e.onReady(T);let S=!0;ue(()=>Math.floor(e.page.value),(J,F)=>{J===F&&!S||(q.scrollTo({rawImages:a,page:J,isScrollDown:F===void 0||J>F||a.length===1,skipIfVisible:S&&a.length>1,fallbackScrollEl:r?document.body:document.documentElement}),S=!1,F??(F=-1),I())},{immediate:!0})}return{asyncImgs:G(()=>p.value),isWebtoon:G(()=>o.value??!1),isManga:G(()=>n.value)}}function Ca({touchDevice:e,isBusy:t,isPlaying:n,isIdle:o,hideControlsEvent:i,scrollEl:r,moveThreshold:s}){const l=ee(!0);let a=!1,u=!1;const c={x:0,y:0};let d;function f(b){if(i.value===tn.never||t.value&&l.value)return;const P=typeof b=="boolean"?b:!l.value;P!==l.value&&(l.value=P,!a&&!P&&(a=!0))}function p(){r.value&&(c.x=r.value.scrollLeft,c.y=r.value.scrollTop)}function x(){const b=i.value===tn.firstMove,P=r.value;if(!P)return;const A=Uo(()=>{if(!l.value){Lg(P)&&f(!0);return}if(b&&a)return;const w=Math.abs(P.scrollTop-c.y)||Math.abs(P.scrollLeft-c.x),g=s??(b?c.y===0?300:200:150);w>g&&f(!1)},100);P.addEventListener("scroll",A),d=()=>{P.removeEventListener("scroll",A)}}function _(){switch(d==null||d(),d=void 0,i.value){case tn.onLoad:a||f(!1);break;case tn.firstMove:x();break;case tn.move:x();break;case tn.never:l.value||(l.value=!0);break}}function D(){u||(u=!0,p(),_(),e&&ue(Zi(),P=>{P==="hidden"&&!n.value&&!l.value&&f(!0)}),ue(t,b=>{b&&!l.value&&f()}),ue(n,b=>{b||f(!0)}),ue(o,b=>{n.value&&f(!b)}),ue(l,b=>{b&&p()}),ue(i,()=>_()),ue(r,()=>_()),Mt(()=>{d==null||d(),d=void 0}))}return{visible:G(()=>l.value),toggle:f,activate:D}}function Lg(e){const t=Math.max(0,e.scrollTop),n=Math.abs(e.scrollLeft);if(n<10&&t<10)return!0;const{scrollHeight:o,clientHeight:i}=e;if(o>i)return t>o-i-10;const{scrollWidth:s,clientWidth:l}=e;return s>l&&n>s-l-10}function Bg(e,t,n){return G(()=>t.value?Ta(e.value,n.value):e.value.map((o,i)=>[{img:o,index:i}]))}function Ta(e,t,n=0){if(e.length===0)return[];const o=e.slice(0,2),i=o.some(s=>(s==null?void 0:s.size)&&s.size.width>s.size.height),r=i||t?[o[0]]:o;return[r.map((s,l)=>({img:s,index:n+l})),...Ta(e.slice(r.length),t&&i,n+r.length)]}const wr=40;function Vg({page:e,totalImgs:t,direction:n,style:o,isLongStrip:i,isVertical:r,isRTL:s,spaceTop:l,scrollEl:a,isWebtoon:u,interferePlayer:c,onChangedPage:d,onFinished:f}){let p=!1,x=!1,_,D=!1,b;const P=ct(Q,300),A=Uo(()=>{Q(),P()},300),w=y=>(q(y),ct(q,50)(y));function g(){const y=new Promise(O=>{_=()=>{_=void 0,O()}});return K(e.value,{smooth:!1,ensureLastImgVisibility:!0}),y}function I(){var y;x=!0,_==null||_(),H(),(y=a.value)==null||y.addEventListener("scroll",A),setTimeout(()=>{const{width:O,height:$}=hn();ue(O,()=>{r.value&&w(e.value)}),ue($,()=>{r.value||w(e.value)}),ue(o,()=>w(e.value)),ue(n,()=>w(e.value)),/iPad|iPhone|iPod/.test(navigator.userAgent)&&ue(t,()=>{s.value&&w(e.value)})},300)}async function q(y){if(!(!x||p)){if(p=!0,await gt(),Y()===y){p=!1;return}K(y)}}function K(y,{smooth:O,ensureLastImgVisibility:$=!1}={smooth:!1}){const le=a.value;if(!le)return;p=!0;const ae=async()=>{await gt(),p=!1,x||I()},me=Math.floor(y),ge=vr(le,me);if(!ge){ae();return}c(async()=>{await R(le,!i.value&&O,async()=>{await k(le,ge,{smooth:O,page:y,ensureLastImgVisibility:$})}),await ae()})}async function R(y,O,$){O&&y.style.setProperty("scroll-snap-type","none"),await $(),O&&y.style.removeProperty("scroll-snap-type")}function Q(){if(p)return;const y=Y();y!==void 0&&y!==e.value&&d(y),H()}function H(){D||!D&&T()&&(D=!0,f())}function T(){const y=a.value;if(!y)return!1;const O=i.value?u.value?3:!r.value&&y.clientWidth>y.clientHeight?2.25:2.5:2;return r.value?y.scrollHeight-y.scrollTop<y.clientHeight*O:y.scrollWidth-(s.value?-y.scrollLeft:y.scrollLeft)<y.clientWidth*O}function Y(){const y=S();return y?(+y.getAttribute("data-index")||0)+(i.value?J(y):0):void 0}function S(){var O;if(b??(b=a.value.getRootNode()),!b)return;const y=(O=b.elementsFromPoint)==null?void 0:O.call(b,r.value||!i.value?window.innerWidth/2:s.value?window.innerWidth-wr:wr,r.value&&i.value?l.value||wr:window.innerHeight/2);if(y)for(let $=0;$<y.length;$++){const le=y[$];if(le.hasAttribute("data-index"))return le;if(le===a.value)break}}function J(y){const O=y.getBoundingClientRect();return r.value?Math.abs(O.top-l.value)/O.height:s.value?Math.max(0,O.right-a.value.clientWidth)/O.width:Math.abs(O.left)/O.width}let F=!1;async function k(y,O,$){if(F)return;const le=O.getBoundingClientRect();if(!i.value){if(r.value){if(le.top<=0&&le.bottom>=y.clientHeight)return}else if(le.left<=0&&le.right>=y.clientWidth)return}F=!0;const ae=r.value?y.scrollTop:y.scrollLeft,me=$.page,ge=i.value?me%1:0,Se=await gn(30,10,async()=>{await Qn();let ze;if(!(O.offsetHeight<10))return i.value?r.value?ze=O.offsetTop+ge*O.offsetHeight-l.value:s.value?ze=O.offsetLeft-y.clientWidth+O.offsetWidth-ge*O.offsetWidth:ze=O.offsetLeft+ge*O.offsetWidth:r.value?ze=O.offsetTop+(le.top>0?0:le.height-y.clientHeight):ze=O.offsetLeft+(le.left>0?0:le.width-y.clientWidth),me>.5&&Math.abs(ze)<100?void 0:ze})??0,De=$.ensureLastImgVisibility?r.value?Math.min(Se,y.scrollHeight-y.clientHeight*2):s.value?Math.max(Se,-(y.scrollWidth-y.clientWidth*2)):Math.min(Se,y.scrollWidth-y.clientWidth*2):Se;if(!$.smooth){r.value?y.scrollTop=De:y.scrollLeft=De,F=!1;return}const Ke=De-ae,ut=30;let Qe=0;return new Promise(ze=>{(function Tn(){const h=Ng(Qe,ae,Ke,ut);r.value?y.scrollTop=h:y.scrollLeft=h,Qe++,Qe<=ut?requestAnimationFrame(Tn):(ze(),F=!1)})()})}return{init:g,goToPage:K}}function Ng(e,t,n,o){return n*(Math.pow(e/o-1,3)+1)+t}class Rg{constructor(t){ke(this,"player");ke(this,"debounceStartPlayer");ke(this,"isPlaying");ke(this,"isIdle",ee(!1));ke(this,"onIdle");this.player=t.player,this.debounceStartPlayer=ct(()=>this.player.start(),100);const n=ee(t.autoPlay||sessionStorage.getItem("mp:playing")==="true");this.isPlaying=G({get:()=>n.value,set:o=>{n.value=o,sessionStorage.setItem("mp:playing",o?"true":"false")}}),this.onIdle=ct(()=>{this.isIdle.value=!0},t.touchDevice?2e3:1e3),this.awake(),t.touchDevice||St(window,"mousemove",()=>this.awake()),je(()=>{t.touchDevice||ue(Zi(),i=>{this.isPlaying.value&&(i==="visible"?this.player.start():this.player.stop())}),ue(t.speed,()=>this.interfere()),ue(t.isBusy,o=>{!o&&this.isIdle.value&&this.awake()})}),Mt(()=>this.stop())}activate(){this.isPlaying.value&&this.player.start()}toggle(){this.isPlaying.value?this.stop():this.start()}async interfere(t){this.isPlaying.value&&this.player.stop(),t&&(await gt(),await t()),this.isPlaying.value&&this.debounceStartPlayer()}stop(){this.isPlaying.value&&(this.isPlaying.value=!1,this.player.stop(),this.awake())}start(){this.isPlaying.value||(this.isPlaying.value=!0,this.player.start(),this.awake())}pause(){this.player.stop()}resume(){this.player.start()}awake(){setTimeout(()=>{this.isIdle.value=!1,this.onIdle()},30)}}class Pa extends Rg{getMaxOffset(t){return t.scrollHeight-t.clientHeight}getScrollOffset(t){return t.scrollTop}setScrollOffset(t,n){t.scrollTop+=n}constructor(t){let n,o;const{scrollEl:i,speed:r}=t;super({...t,player:{stop:()=>o==null?void 0:o(),start:()=>{const s=i.value;if(!this.isPlaying.value||!s)return;const l=this.getMaxOffset(s),a=this.getScrollOffset(s);if(l<=a){this.stop();return}o=()=>{n=Date.now(),o=void 0};const u=Date.now();n=u;const c=.1*r.value;let d=Date.now(),f=0;const p=()=>{if(n!==u)return;const x=Date.now(),_=x-d;d=x;const D=c*_+f;D>=1?(f=D%1,this.setScrollOffset(s,D-f)):f=D,setTimeout(p,1)};p()}}})}}class Hg extends Pa{constructor(n){super(n);ke(this,"isLongStrip");ke(this,"isVertical");ke(this,"isRTL");const{isLongStrip:o,isVertical:i,isRTL:r}=n;this.isLongStrip=o,this.isVertical=i,this.isRTL=r,o!==void 0&&je(()=>{ue(o,s=>{s||stop()})})}getMaxOffset(n){return this.isVertical.value?n.scrollHeight-n.clientHeight:n.scrollWidth-n.clientWidth}getScrollOffset(n){return this.isVertical.value?n.scrollTop:this.isRTL.value?-n.scrollLeft:n.scrollLeft}setScrollOffset(n,o){n[this.isVertical.value?"scrollTop":"scrollLeft"]+=o*(this.isRTL.value?-1:1)}start(){var n;((n=this.isLongStrip)==null?void 0:n.value)!==!1&&super.start()}}function Fg(e){return new Hg(e)}function Wg({speed:e,fontSize:t,lineHeight:n,...o}){const i=hn().width;return new Pa({...o,speed:G(()=>{const r=900/Math.min(900,i.value)/3.5,s=t.value/48*1.75,l=n.value/96*1.75,a=r*s*l;return e.value*a})})}const qg={key:3,class:"fixed inline-block left-1/2 -translate-x-1/2 bottom-0 p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3"},Ma=pe({inheritAttrs:!1,__name:"GearSecond",props:{chapterNavData:{type:Object},busy:{type:Boolean},defaultPreferences:{type:Object},immediate:{type:Boolean},appVersion:{type:String},raw:{type:Object},spec:{type:Object},siteMeta:{type:null},page:{type:Number},spaceTop:{type:Number},touchDevice:{type:Boolean},entryId:{type:String},isAutoShow:{type:Boolean},tourEnabled:{type:Boolean},offlineMode:{type:Boolean}},emits:["clickEntryButton","hideReader","openHelpScreen","error","crash","ready","pageChanged","playingChanged","tourEnabledChanged","dispose","openEntry","addEntry","finished","getHiddenChapters","hapticFeedback","pressedBack","selectChapter","timeout","openDefaultPreferences","defaultPreferencesChanged","controlsVisibilityChanged"],setup(e,{emit:t}){var V,N;const n=e,o=t,i=ee(!1),r=ee(!1),s=G(()=>n.busy),l=G(()=>n.page),a=G(()=>n.immediate||i.value?n.spaceTop??0:0),u=G(()=>!n.touchDevice&&S.isIdle.value&&!n.busy&&!I.value),{asyncImgs:c,isWebtoon:d}=jg({raw:G(()=>n.raw),spec:n.spec,page:l,touchDevice:n.touchDevice,isAutoShow:n.isAutoShow,async onReady(E){me(E),i.value=!0},onError:()=>o("error"),onTimeout:()=>o("timeout")}),{direction:f,style:p,isRTL:x,isDouble:_,isVertical:D,isLongStrip:b,gap:P,speed:A,zoom:w,breakFirst:g}=ph({touchDevice:n.touchDevice,isWebtoon:d,titleName:(V=n.raw)==null?void 0:V.title.name,defaultPreferences:G(()=>n.defaultPreferences)}),I=ee(!1),q=Bg(c,_,g),K=G(()=>c.value.length),R=G(()=>l.value>=K.value),Q=ee(null),H=ee(null),T=G(()=>{var E;return(E=H.value)==null?void 0:E.rootEl}),Y=ee(!1),S=Fg({autoPlay:!n.tourEnabled&&(((N=n.defaultPreferences)==null?void 0:N.autoPlay)??!1),touchDevice:n.touchDevice,scrollEl:T,speed:A,isRTL:x,isVertical:D,isLongStrip:b,isBusy:s}),J=G({get(){return w.value},set(E){S.interfere(()=>{w.value=E})}}),F=Ca({touchDevice:n.touchDevice,isBusy:s,isPlaying:G(()=>S.isPlaying.value),isIdle:G(()=>S.isIdle.value),hideControlsEvent:G(()=>n.defaultPreferences.hideControlsEvent),scrollEl:T}),k=F.visible,y=Vg({page:l,totalImgs:K,style:p,direction:f,isLongStrip:b,isVertical:D,isRTL:x,spaceTop:a,isWebtoon:d,scrollEl:G(()=>{var E;return(E=H.value)==null?void 0:E.rootEl}),interferePlayer:E=>S.interfere(E),onChangedPage:me,onFinished:()=>o("finished")}),O=G(()=>Math.floor(l.value)),$=G(()=>b.value?l.value:_.value?Tn():Math.floor(l.value)),le=()=>S.interfere(()=>Qn(100));$t({onKeyDown:E=>{if(n.tourEnabled)return!0;const C=b.value&&D.value,L=b.value&&!D.value,j=!b.value&&D.value,re=!b.value&&!D.value;switch(E.key){case" ":E.preventDefault(),b.value||h();break;case"ArrowUp":case"PageUp":C?le():j&&O.value!==0&&(E.preventDefault(),Qe());break;case"ArrowDown":case"PageDown":C?le():j&&!R.value&&(E.preventDefault(),ze());break;case"ArrowLeft":L?le():re?(E.preventDefault(),Ke()):D.value&&De();break;case"ArrowRight":L?le():re?(E.preventDefault(),ut()):D.value&&Se();break;case"Escape":E.preventDefault();break}},onKeyUp:E=>{switch(E.key){case"b":g.value=!g.value;break}}}),ue(S.isPlaying,E=>{o("playingChanged",E)}),ue(k,E=>{o("controlsVisibilityChanged",E)});async function ae(){await y.init(),o("ready"),r.value=!0,F.activate(),S.activate()}function me(E){if(l.value===E)return;const C=c.value.length;if(E<0||E>=C+1)return;const L=Math.floor(E*100)/100;if(L===l.value)return;const j=l.value;if(o("pageChanged",L),E<.01&&j>E){S.awake();return}}function ge(){!n.touchDevice&&!b.value&&y.goToPage(O.value,{smooth:!0})}function Se(E=!1){var C,L;(L=(C=n.chapterNavData)==null?void 0:C.next)==null||L.call(C,E)}function De(E=!1){var C,L;(L=(C=n.chapterNavData)==null?void 0:C.prev)==null||L.call(C,E)}function Ke(){x.value?ze():Qe()}function ut(){x.value?Qe():ze()}function Qe(){var L;const E=q.value,C=R.value?E[E.length-1][0].index:(L=E[Tn()-1])==null?void 0:L[0].index;C!==void 0?y.goToPage(C):De()}function ze(){var E,C;if(R.value)Se();else{const L=((C=(E=q.value[Tn()+1])==null?void 0:E[0])==null?void 0:C.index)??c.value.length;y.goToPage(L)}}function Tn(){const E=O.value,C=q.value.findIndex(L=>L.some(({index:j})=>j===E));return C===-1?q.value.length-1:C}function h(E){F.toggle(E)}function m(){if(S.isPlaying.value){k.value||!n.touchDevice?S.stop():(S.awake(),F.toggle(!0));return}F.toggle()}function M(){S.stop(),o("clickEntryButton")}function W(){F.toggle(!1),S.isPlaying.value&&S.stop(),o("openHelpScreen")}return(E,C)=>e.immediate||i.value?(v(),oe(hr,{key:0,ref_key:"gearLayout",ref:Q,loading:!r.value,immediate:!!e.immediate,idle:u.value,class:"text-stone-100",onClick:C[20]||(C[20]=Le(()=>{},["stop"]))},{default:ne(()=>{var L,j,re,te;return[i.value?(v(),oe(ha,{key:0,ref_key:"body",ref:H,zoom:J.value,"onUpdate:zoom":C[1]||(C[1]=X=>J.value=X),zooming:I.value,"onUpdate:zooming":C[2]||(C[2]=X=>I.value=X),page:l.value,"page-index":O.value,pages:Z(q),"total-imgs":Z(c).length,direction:Z(f),gap:Z(P),"is-long-strip":Z(b),isRTL:Z(x),"is-double":Z(_),"is-vertical":Z(D),"space-top":a.value||0,busy:s.value,"play-controller":Z(S),"touch-device":e.touchDevice,"pinch-to-zoome":((L=e.defaultPreferences)==null?void 0:L.pinchToZoom)??!0,"tap-zone":(j=e.defaultPreferences)==null?void 0:j.tapZone,"controls-visible":Z(k),onReady:ae,onPrev:Qe,onNext:ze,onClick:m,onDragEnd:ge,onWheelPassive:C[3]||(C[3]=()=>Z(S).interfere())},Mi({_:2},[i.value&&Z(c).length?{name:"end",fn:ne(()=>{var X,ce;return[B(Gi,{"has-next":!!((X=e.chapterNavData)!=null&&X.next),"offline-mode":!!e.offlineMode,seconds:((ce=e.defaultPreferences)==null?void 0:ce.autoNextSeconds)??5,"show-add-button":Z(w)===1&&!e.entryId&&!!e.raw&&!e.offlineMode,onNext:Se,onAddToLibrary:M,onHide:C[0]||(C[0]=()=>o("hideReader"))},null,8,["has-next","offline-mode","seconds","show-add-button"])]}),key:"0"}:void 0]),1032,["zoom","zooming","page","page-index","pages","total-imgs","direction","gap","is-long-strip","isRTL","is-double","is-vertical","space-top","busy","play-controller","touch-device","pinch-to-zoome","tap-zone","controls-visible"])):se("",!0),B(br,{modelValue:Y.value,"onUpdate:modelValue":C[10]||(C[10]=X=>Y.value=X),"enable-help":"",name:(re=e.raw)==null?void 0:re.title.name,"space-top":a.value,"enable-default-preferences":!e.touchDevice||!!e.appVersion,onHelp:W,onMore:C[11]||(C[11]=()=>o("openDefaultPreferences"))},{"tab-preferences":ne(()=>[B(da,{"enable-reset":!e.touchDevice||!!e.appVersion,webtoon:Z(d),"reader-style":Z(p),"onUpdate:readerStyle":C[4]||(C[4]=X=>$e(p)?p.value=X:null),direction:Z(f),"onUpdate:direction":C[5]||(C[5]=X=>$e(f)?f.value=X:null),gap:Z(P),"onUpdate:gap":C[6]||(C[6]=X=>$e(P)?P.value=X:null),speed:Z(A),"onUpdate:speed":C[7]||(C[7]=X=>$e(A)?A.value=X:null),zoom:J.value,"onUpdate:zoom":C[8]||(C[8]=X=>J.value=X),"default-preferences":e.defaultPreferences},null,8,["enable-reset","webtoon","reader-style","direction","gap","speed","zoom","default-preferences"])]),"tab-default":ne(()=>[B(fr,{"model-value":e.defaultPreferences,"onUpdate:modelValue":C[9]||(C[9]=X=>o("defaultPreferencesChanged",X))},null,8,["model-value"])]),_:1},8,["modelValue","name","space-top","enable-default-preferences"]),r.value&&!R.value&&!e.tourEnabled?(v(),oe(la,{key:1,direction:Z(f),"tap-zone":(te=e.defaultPreferences)==null?void 0:te.tapZone},null,8,["direction","tap-zone"])):se("",!0),r.value&&!R.value?(v(),oe(gr,{key:2,playing:Z(S).isPlaying.value},null,8,["playing"])):se("",!0),B(aa,{visible:Z(k),"space-top":a.value},Mi({top:ne(()=>{var X;return[e.raw||e.offlineMode?(v(),oe(Ji,{key:0,"offline-mode":e.offlineMode,raw:e.raw,onClick:C[12]||(C[12]=()=>o("pressedBack"))},null,8,["offline-mode","raw"])):se("",!0),!e.touchDevice&&!e.offlineMode?(v(),oe(Yo,{key:1,onClick:C[13]||(C[13]=()=>o("hideReader"))})):se("",!0),e.chapterNavData?(v(),oe(sr,{key:2,"touch-device":e.touchDevice,"chapter-spec":(X=e.spec)==null?void 0:X.chapter,data:e.chapterNavData,rtl:Z(x),onGetHiddenChapters:C[14]||(C[14]=()=>o("getHiddenChapters")),onPrev:De,onNext:Se},null,8,["touch-device","chapter-spec","data","rtl"])):se("",!0)]}),"bottom-right":ne(()=>[!e.offlineMode&&e.raw?(v(),oe(Qi,{key:0,"entry-id":e.entryId,onClick:M},null,8,["entry-id"])):se("",!0),B(or,{disabled:!i.value,onClick:C[15]||(C[15]=()=>Y.value=!0)},null,8,["disabled"]),e.touchDevice?se("",!0):(v(),oe(ir,{key:1,onRequestFullScreen:C[16]||(C[16]=()=>{var X,ce;return(ce=(X=Q.value)==null?void 0:X.rootEl)==null?void 0:ce.requestFullscreen()})})),Z(b)?(v(),oe(nr,{key:2,"tour-message":"Press here to play like a video",playing:Z(S).isPlaying.value,disabled:!r.value,onClick:C[17]||(C[17]=()=>Z(S).toggle())},null,8,["playing","disabled"])):se("",!0),Z(_)?(v(),oe(Ge,{key:3,title:"Break 1st page (B)","data-tour":"Press here to separate the first page from double-page mode",disabled:!r.value,onClick:C[18]||(C[18]=()=>g.value=!Z(g))},{default:ne(()=>[Z(g)?(v(),oe(ua,{key:0})):(v(),oe(ca,{key:1}))]),_:1},8,["disabled"])):se("",!0)]),progress:ne(()=>{var X,ce;return[((X=e.defaultPreferences)==null?void 0:X.progressSize)!==0&&!R.value?(v(),oe(mr,{key:0,value:$.value,total:Z(q).length,"long-strip":Z(b),height:((ce=e.defaultPreferences)==null?void 0:ce.progressSize)??2,rtl:Z(x)},null,8,["value","total","long-strip","height","rtl"])):se("",!0)]}),default:ne(()=>[e.appVersion&&a.value&&!e.offlineMode?(v(),z("div",{key:0,class:"fixed top-0 left-0 right-0 bg-black bg-opacity-70 pointer-events-auto",style:Pe({height:`${a.value}px`})},null,4)):se("",!0)]),_:2},[Z(q).length?{name:"bottom-left",fn:ne(()=>[B(fa,{"model-value":O.value,disabled:!r.value,pages:Z(q),"total-imgs":Z(c).length,"onUpdate:modelValue":Z(y).goToPage},null,8,["model-value","disabled","pages","total-imgs","onUpdate:modelValue"])]),key:"0"}:void 0]),1032,["visible","space-top"]),Z(k)||I.value?(v(),z("div",qg,[B(Vo,{name:"fade","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:ne(()=>[I.value||Z(w)!==1?(v(),oe(ql,{key:0,zoom:J.value,onClick:C[19]||(C[19]=Le(()=>J.value=1,["stop"])),class:"duration-200"},null,8,["zoom"])):se("",!0)]),_:1})])):se("",!0),xe(E.$slots,"default")]}),_:3},8,["loading","immediate","idle"])):se("",!0)}}),Ug=Object.freeze(Object.defineProperty({__proto__:null,default:Ma},Symbol.toStringTag,{value:"Module"}));function Kg({sel:e,heading:t}){const o="h1, h2, h3, h4, h5, h6, p, blockquote, pre, code, strong, b, em, i, small, sub, sup, mark, time, abbr, br, hr".split(",").map(d=>d.trim()),i=["br","hr"],r=["button","figure","img","script","select","input","form","iframe","nav","footer","aside","table"],s=Zg(e),l=Yg(s),a=u(s);if(!a)return;if(t){const d=document.createElement("h1");d.innerText=t,a.prepend(d)}return{el:a,isRTL:l};function u(d){let f=0,p=!1,x=0,_=!1;const D=b(d);if(!D)return;Xg(D),c(D);function b(P,A=!1){var Y;if(_)return;if(P.nodeType===Node.TEXT_NODE)return A||(Y=P.textContent)!=null&&Y.trim()?P.cloneNode():void 0;if(P.nodeType!==Node.ELEMENT_NODE)return;const g=P.tagName.toLocaleLowerCase();if(r.includes(g)||g==="a"&&!A||P.getAttribute("aria-hidden")==="true")return;const I=window.getComputedStyle(P);if(!(I.display!=="none"&&+(I.opacity??"1")>.1&&I.position!=="fixed"))return;const K=Array.from(P.childNodes);if(!K.length)return i.includes(g)?document.createElement(P.tagName):void 0;const R=A||o.includes(g),Q=[];if(K.forEach(S=>{if(_)return;const J=b(S,R);J?(Q.push(J),p?x=0:++f>30&&(p=!0)):p&&++x>30&&(_=!0)}),!Q.length)return;const H=document.createElement(g==="body"?"div":g==="a"?"span":g),T=P.getAttribute("dir");return T&&T!=="auto"&&H.setAttribute("dir",T),Q.forEach(S=>H.appendChild(S)),H}return D}function c(d){Ea(d,f=>{if(f===d||o.includes(f.tagName.toLowerCase()))return;const p=f.parentElement;if((p==null?void 0:p.childNodes.length)===1){Array.from(f.childNodes).forEach(D=>{p.appendChild(D)}),p.removeChild(f);return}f.childNodes.length===1&&f.replaceWith(f.childNodes[0])})}}function Zg(e){const t=(e??"main,article").split(",").filter(Boolean);for(const o of t){const i=document.querySelector(o);if(i)return i}const n=document.querySelector("p:has(+ p), h1, h2");if(n){let o=n;for(;o!==document.body;)o=o.parentElement;return o}return document.body}function Yg(e){if(e.getAttribute("dir")==="rtl")return!0;const t=e.querySelector("p")||e.querySelector("div:not(:empty)")||e;return t.getAttribute("dir")==="rtl"?!0:window.getComputedStyle(t).direction==="rtl"}function Xg(e){xr(e,t=>Array.from(t.children),t=>!t.textContent.trim()),xr(e,t=>Array.from(t.children).reverse(),t=>{if(!t.textContent.trim())return!0;const n=t.tagName;return n.length===2&&n.startsWith("H")})}function Ea(e,t){Array.from(e.children).forEach(o=>{Ea(o,t)}),t(e)}function xr(e,t,n){const o=t(e);for(let i=0;i<o.length;i++){const r=o[i];if(!xr(r,t,n))return!1;Gg(r)}return n(e)}function Gg(e){var t;(t=e.parentNode)==null||t.removeChild(e)}const Jg={key:1,class:"h-14 sm:h-16 px-2 2xs:px-3 flex gap-1 2xs:gap-3 items-center"},Qg={class:"md:fixed left-0 right-0 bottom-0"},em={class:"p-2 2xs:px-3 sm:py-3 pb-6 md:pb-5 lg:pb-3 flex md:flex-col gap-4 justify-between items-center"},Ia=pe({__name:"GearThirdControlsLayout",props:{visible:{type:Boolean},hideTopControls:{type:Boolean},spaceTop:{type:null}},setup(e){return(t,n)=>(v(),z(be,null,[U("div",{class:fe(["fixed left-0 right-0 top-0 bg-inherit z-30",{"opacity-0 pointer-events-none":!e.visible}])},[e.spaceTop?(v(),z("div",{key:0,style:Pe({height:`${e.spaceTop}px`}),class:"bg-gradient-to-b from-black to-transparent"},null,4)):se("",!0),e.hideTopControls?se("",!0):(v(),z("div",Jg,[xe(t.$slots,"top-controls")]))],2),U("div",{class:fe(["fixed left-0 right-0 bottom-0 md:left-auto z-30 bg-inherit md:bg-transparent",{"opacity-0 pointer-events-none":!e.visible}])},[U("div",Qg,[xe(t.$slots,"progress")]),U("div",em,[xe(t.$slots,"bottom-controls")])],2),xe(t.$slots,"default")],64))}}),tm=Object.freeze(Object.defineProperty({__proto__:null,default:Ia},Symbol.toStringTag,{value:"Module"})),nm={},om={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function im(e,t){return v(),z("svg",om,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M16 13q-.425 0-.712-.288T15 12t.288-.712T16 11h6q.425 0 .713.288T23 12t-.288.713T22 13zM4.675 15.425l-1.025 2.85q-.125.35-.4.538T2.625 19q-.575 0-.913-.487t-.137-1.038l4.4-11.725Q6.1 5.4 6.4 5.2t.65-.2h.9q.375 0 .663.2t.412.55L13.45 17.5q.2.55-.137 1.025T12.4 19q-.35 0-.65-.2t-.425-.55l-1-2.825zM5.4 13.4h4.2L7.55 7.6h-.1z"},null,-1)])])}const Oa=ve(nm,[["render",im]]),rm=Object.freeze(Object.defineProperty({__proto__:null,default:Oa},Symbol.toStringTag,{value:"Module"})),sm={},lm={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function am(e,t){return v(),z("svg",lm,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"m4.675 15.425l-1.025 2.85q-.125.35-.4.538T2.625 19q-.575 0-.913-.487t-.137-1.038l4.4-11.725Q6.1 5.4 6.4 5.2t.65-.2h.9q.375 0 .663.2t.412.55L13.45 17.5q.2.55-.137 1.025T12.4 19q-.35 0-.65-.2t-.425-.55l-1-2.825zM5.4 13.4h4.2L7.55 7.6h-.1zM18 13h-2q-.425 0-.712-.288T15 12t.288-.712T16 11h2V9q0-.425.288-.712T19 8t.713.288T20 9v2h2q.425 0 .713.288T23 12t-.288.713T22 13h-2v2q0 .425-.288.713T19 16t-.712-.288T18 15z"},null,-1)])])}const $a=ve(sm,[["render",am]]),cm=Object.freeze(Object.defineProperty({__proto__:null,default:$a},Symbol.toStringTag,{value:"Module"})),za=ve(pe({__name:"NovelBody",props:{hideTopControls:{type:Boolean},progress:{type:Number},touchDevice:{type:Boolean},busy:{type:Boolean},spaceTop:{type:null},content:{type:null},rtl:{type:Boolean},titlePreferences:{type:Object},defaultPreferences:{type:Object}},emits:["ready","click","progressChanged","finished"],setup(e,{expose:t,emit:n}){const o=e,i=n,r=ee(!1),s=ee(),l=ee(),a=Uo(()=>{const c=s.value;if(!c)return;const{clientHeight:d,scrollHeight:f,scrollTop:p}=c,x=f-2*d,_=p/x;i("progressChanged",Math.min(1,Math.round(_*100)/100))},30);t({scrollEl:s}),$t({onKeyDown(){var c;o.busy||(c=s.value)==null||c.focus()}}),je(()=>{ue(()=>o.content,d=>{const f=l.value;f&&(Array.from(f.children).forEach(p=>{f.removeChild(p)}),f.appendChild(d),setTimeout(()=>{const p=s.value;if(p){f.offsetHeight<=p.clientHeight&&i("finished");const{progress:x}=o;x&&u(x)}r.value=!0,i("ready")}))},{immediate:!0});const c=hn();ue(()=>{const{fontFamily:d,fontSize:f,lineHeight:p}=o.titlePreferences;return`${d}-${f}-${p}-${c.width.value}`},async()=>{const d=o.progress;await gt(),u(d)})});function u(c){const d=s.value;d&&(d.scrollTop=c*(d.scrollHeight-2*d.clientHeight))}return(c,d)=>(v(),z("div",{ref_key:"scrollContainer",ref:s,tabindex:"0",class:fe(["novel-body",{"scrollbar-sm":!e.touchDevice,"scrollbar-none":e.touchDevice,"opacity-0":!r.value,"pt-16 sm:pt-18 md:pt-20":!e.hideTopControls,"pt-5 sm:pt-9 md:pt-12":e.hideTopControls}]),style:Pe({fontFamily:e.titlePreferences.fontFamily,"--font-size":`${e.titlePreferences.fontSize}px`,"--line-height":`${e.titlePreferences.lineHeight}px`,"--space-top":e.spaceTop?`${e.spaceTop}px`:void 0}),onClick:d[0]||(d[0]=()=>i("click")),onScroll:d[1]||(d[1]=(...f)=>Z(a)&&Z(a)(...f))},[U("div",cn({ref_key:"contentContainer",ref:l,class:"novel-body__content"},e.rtl?{dir:"rtl"}:{}),null,16),xe(c.$slots,"end")],38))}}),[["styles",['.novel-body{top:0;right:0;bottom:0;left:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding-left:32px;padding-right:32px;position:fixed}.novel-body:focus{outline:2px solid transparent;outline-offset:2px}@media (min-width:640px){.novel-body{padding-left:48px;padding-right:48px}}@media (min-width:768px){.novel-body{padding-left:56px;padding-right:56px}}@media (min-width:1024px){.novel-body{padding-left:64px;padding-right:64px}}@media (min-width:1280px){.novel-body{padding-left:80px;padding-right:80px}}.novel-body{font-size:var(--font-size);letter-spacing:.01em;line-height:var(--line-height)}.novel-body:before{content:"";display:block;height:var(--space-top,0)}.novel-body__content{margin-left:auto;margin-right:auto;max-width:1040px;min-height:100%}.novel-body hr{--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity,1));margin:calc(var(--line-height)*.5) 0}.novel-body h1,.novel-body h2,.novel-body h3,.novel-body h4,.novel-body h5,.novel-body h6{font-weight:500}.novel-body h1{font-size:calc(var(--font-size)*1.5);line-height:calc(var(--font-size)*.5 + var(--line-height))}.novel-body h2{font-size:calc(var(--font-size)*1.25);line-height:calc(var(--font-size)*.25 + var(--line-height))}.novel-body h3{font-size:calc(var(--font-size)*1.125);line-height:calc(var(--font-size)*.125 + var(--line-height))}.novel-body h5,.novel-body h6,.novel-body p{font-size:inherit;line-height:inherit}.novel-body blockquote,.novel-body figure,.novel-body h1,.novel-body h2,.novel-body h3,.novel-body h4,.novel-body h5,.novel-body h6,.novel-body img,.novel-body ol,.novel-body p,.novel-body ul{margin-bottom:calc(var(--line-height)*.5)}.novel-body pre{background-color:transparent;border-style:none;display:block;font-family:inherit;margin:0;padding:0;white-space:normal}']]]),um=Object.freeze(Object.defineProperty({__proto__:null,default:za},Symbol.toStringTag,{value:"Module"})),Da=pe({inheritAttrs:!1,__name:"GearThird",props:{chapterNavData:{type:Object},busy:{type:Boolean},defaultPreferences:{type:Object},immediate:{type:Boolean},appVersion:{type:String},raw:{type:Object},spec:{type:Object},siteMeta:{type:null},page:{type:Number},spaceTop:{type:Number},touchDevice:{type:Boolean},entryId:{type:String},isAutoShow:{type:Boolean},tourEnabled:{type:Boolean},offlineMode:{type:Boolean}},emits:["clickEntryButton","hideReader","openHelpScreen","error","crash","ready","pageChanged","playingChanged","tourEnabledChanged","dispose","openEntry","addEntry","finished","getHiddenChapters","hapticFeedback","pressedBack","selectChapter","timeout","openDefaultPreferences","defaultPreferencesChanged","controlsVisibilityChanged"],setup(e,{emit:t}){var Y,S,J,F,k,y;const n=e,o=t,i=ee(null),r=((Y=n.raw)==null?void 0:Y.novel)??Kg({sel:(S=n.spec)==null?void 0:S.content,heading:(J=n.raw)==null?void 0:J.name});r===void 0&&o("error");const s=ee(r==null?void 0:r.el),l=ee(!!(r!=null&&r.isRTL)),a=ee(!1),u=ee(!1),c=G(()=>n.page),d=G(()=>n.busy),f=ee(null),p=G(()=>{var O;return(O=f.value)==null?void 0:O.scrollEl}),x=(k=(F=n.raw)==null?void 0:F.title)==null?void 0:k.name,_=x?ia(x):location.hostname,D=Zd(`mpr:${_}`,{}),b=G({get(){var ae,me;const O=n.defaultPreferences,$=((ae=D.value)==null?void 0:ae.fontSize)??O.fontSize,le=Math.max($,((me=D.value)==null?void 0:me.lineHeight)??O.lineHeight);return{fontFamily:O.fontFamily,speed:O.speed,...D.value,contrast:O.contrast,fontSize:$,lineHeight:le}},set(O){const $={...O},le=n.defaultPreferences;Object.keys($).forEach(ae=>{$[ae]===le[ae]&&delete $[ae]}),D.value=$}}),P=Wg({isBusy:d,speed:G(()=>b.value.speed),fontSize:G(()=>b.value.fontSize),lineHeight:G(()=>b.value.lineHeight),autoPlay:!!((y=n.defaultPreferences)!=null&&y.autoPlay),touchDevice:n.touchDevice,scrollEl:p}),A=G(()=>!n.touchDevice&&P.isIdle.value&&!d.value),w=Ca({touchDevice:n.touchDevice,moveThreshold:50,isBusy:d,isPlaying:G(()=>P.isPlaying.value),isIdle:G(()=>P.isIdle.value),hideControlsEvent:G(()=>n.defaultPreferences.hideControlsEvent),scrollEl:p}),g=w.visible;ue(P.isPlaying,O=>{o("playingChanged",O)}),ue(g,O=>{o("controlsVisibilityChanged",O)}),I(document.documentElement),I(document.body);function I(O){const $=O.style.getPropertyValue("overflow");$!=="hidden"&&(O.style.setProperty("overflow","hidden","important"),Mt(()=>{$?O.style.setProperty("overflow",$):O.style.removeProperty("overflow")}))}function q(){o("ready"),w.activate(),P.activate()}function K(){P.stop(),o("clickEntryButton")}function R(O){u.value=O}function Q(){if(P.isPlaying.value){g.value||!n.touchDevice?P.stop():(P.awake(),w.toggle(!0));return}w.toggle()}function H(O){O!==n.page&&(o("pageChanged",Math.min(1,O)),O===1&&o("finished"))}function T(O){const $=b.value.fontSize+O;$>48||$<10||(b.value={...b.value,fontSize:$,lineHeight:Math.max(10,Math.min(96,Math.round(b.value.lineHeight/b.value.fontSize*$)))})}return(O,$)=>s.value?(v(),oe(hr,{key:0,ref_key:"gearLayout",ref:i,immediate:"",idle:A.value,class:"bg-stone-900",style:Pe({color:`rgba(255, 255, 255, ${e.defaultPreferences.contrast})`})},{default:ne(()=>{var le;return[B(za,{ref_key:"body",ref:f,progress:c.value,"touch-device":e.touchDevice,busy:d.value,"space-top":e.spaceTop,content:s.value,rtl:l.value,"title-preferences":b.value,"default-preferences":e.defaultPreferences,"hide-top-controls":!e.raw,onClick:Q,onProgressChanged:H,onReady:q},{end:ne(()=>{var ae,me;return[B(Gi,{"has-next":!!((ae=e.chapterNavData)!=null&&ae.next),"offline-mode":!!e.offlineMode,seconds:((me=e.defaultPreferences)==null?void 0:me.autoNextSeconds)??5,onNext:$[0]||($[0]=()=>{var ge,Se;return(Se=(ge=e.chapterNavData)==null?void 0:ge.next)==null?void 0:Se.call(ge,!1)}),onVisibilityChanged:R,onHide:$[1]||($[1]=()=>o("hideReader")),onFinished:$[2]||($[2]=()=>o("finished"))},null,8,["has-next","offline-mode","seconds"])]}),_:1},8,["progress","touch-device","busy","space-top","content","rtl","title-preferences","default-preferences","hide-top-controls"]),!e.touchDevice&&!e.raw&&!e.offlineMode?Ne((v(),oe(Yo,{key:0,class:"hidden md:inline-block fixed left-3 top-2",transparent:"",onClick:$[3]||($[3]=()=>o("hideReader"))},null,512)),[[pl,Z(g)]]):se("",!0),B(Ia,{visible:Z(g),"hide-top-controls":!e.raw,"space-top":e.spaceTop},{"top-controls":ne(()=>{var ae;return[e.raw||e.offlineMode?(v(),oe(Ji,{key:0,"offline-mode":e.offlineMode,raw:e.raw,transparent:"",onClick:$[4]||($[4]=()=>o("pressedBack"))},null,8,["offline-mode","raw"])):se("",!0),e.raw&&!e.touchDevice&&!e.offlineMode?(v(),oe(Yo,{key:1,transparent:"",onClick:$[5]||($[5]=()=>o("hideReader"))})):se("",!0),e.chapterNavData?(v(),oe(sr,{key:2,transparent:"","touch-device":e.touchDevice,"chapter-spec":(ae=e.spec)==null?void 0:ae.chapter,data:e.chapterNavData,rtl:l.value,onGetHiddenChapters:$[6]||($[6]=()=>o("getHiddenChapters")),onPrev:$[7]||($[7]=me=>{var ge,Se;return(Se=(ge=e.chapterNavData)==null?void 0:ge.prev)==null?void 0:Se.call(ge,me)}),onNext:$[8]||($[8]=me=>{var ge,Se;return(Se=(ge=e.chapterNavData)==null?void 0:ge.next)==null?void 0:Se.call(ge,me)})},null,8,["touch-device","chapter-spec","data","rtl"])):se("",!0)]}),"bottom-controls":ne(()=>[!e.offlineMode&&e.raw?(v(),z(be,{key:0},[B(Qi,{"entry-id":e.entryId,transparent:"",onClick:K},null,8,["entry-id"]),$[19]||($[19]=U("div",{class:"hidden 2xs:inline-block md:hidden flex-grow"},null,-1))],64)):se("",!0),B(Ge,{transparent:"",onClick:$[9]||($[9]=()=>T(-1))},{default:ne(()=>[B(Oa)]),_:1}),B(Ge,{transparent:"",onClick:$[10]||($[10]=()=>T(1))},{default:ne(()=>[B($a)]),_:1}),B(or,{transparent:"",onClick:$[11]||($[11]=()=>a.value=!0)}),e.touchDevice?se("",!0):(v(),oe(ir,{key:1,transparent:"",onRequestFullScreen:$[12]||($[12]=()=>{var ae,me;return(me=(ae=i.value)==null?void 0:ae.rootEl)==null?void 0:me.requestFullscreen()})})),B(nr,{transparent:"","tour-message":"Press here to start listening",playing:Z(P).isPlaying.value,class:"order-2 md:order-4",onClick:$[13]||($[13]=()=>Z(P).toggle())},null,8,["playing"])]),progress:ne(()=>{var ae,me;return[((ae=e.defaultPreferences)==null?void 0:ae.progressSize)!==0?(v(),oe(mr,{key:0,value:c.value,height:((me=e.defaultPreferences)==null?void 0:me.progressSize)??2,rtl:l.value,opacity:e.defaultPreferences.contrast},null,8,["value","height","rtl","opacity"])):se("",!0)]}),_:1},8,["visible","hide-top-controls","space-top"]),u.value?se("",!0):(v(),oe(gr,{key:1,playing:Z(P).isPlaying.value},null,8,["playing"])),B(br,{modelValue:a.value,"onUpdate:modelValue":$[17]||($[17]=ae=>a.value=ae),name:(le=e.raw)==null?void 0:le.title.name,"space-top":(e.spaceTop??0)+80,"enable-default-preferences":!e.touchDevice||!!e.appVersion,onMore:$[18]||($[18]=()=>o("openDefaultPreferences"))},{"tab-preferences":ne(()=>[B(dr,{modelValue:b.value,"onUpdate:modelValue":$[14]||($[14]=ae=>b.value=ae),"default-preferences":e.defaultPreferences,"enable-reset":!e.touchDevice||!!e.appVersion,onReset:$[15]||($[15]=()=>D.value=null)},null,8,["modelValue","default-preferences","enable-reset"])]),"tab-default":ne(()=>[B(fr,{"is-novel":"","model-value":e.defaultPreferences,"onUpdate:modelValue":$[16]||($[16]=ae=>o("defaultPreferencesChanged",ae))},null,8,["model-value"])]),_:1},8,["modelValue","name","space-top","enable-default-preferences"]),xe(O.$slots,"default")]}),_:3},8,["idle","style"])):se("",!0)}}),dm=Object.freeze(Object.defineProperty({__proto__:null,default:Da},Symbol.toStringTag,{value:"Module"}));async function fm({siteMeta:e,spec:t}){var l;const n=e==null?void 0:e.contentTypes,o=!e||(n==null?void 0:n.includes(Qt.novel)),i=!n||n.includes(Qt.manga);if(!i&&!o)return;const r=(t==null?void 0:t.content)??"main,article,body",s=i?((l=t==null?void 0:t.content)==null?void 0:l.split(",").map(a=>a.trim()).filter(Boolean).map(a=>`${a} img:not(figure > img), ${a} canvas`).join(","))??r:void 0;return await gn(200,50,async()=>{const a=document.querySelector(r);if(a){if(o){const u=Array.from(a.querySelectorAll("p"));if(u.length){let c=!1,d=0;for(let f=0;f<u.length;f++)if(u[f].textContent.split(" ").length>20&&(d+=1,d===2)){c=!0;break}if(c)return Qt.novel}}if(s&&Array.from(a.querySelectorAll(s)).some(d=>pm(d)))return Qt.manga}})}function pm(e){const t=e.getBoundingClientRect();return ni(t.width,t.height)}function hm({raw:e,spec:t,siteMeta:n,offlineMode:o,onSelect:i}){var H,T,Y;const{vol:r,inferVol:s,chap:l,title:a,slug:u,basePath:c}=e,d=t==null?void 0:t.chapter;let f=-1;async function p(S,J){if(o){i({...S});return}if(S.slug){x(S.slug,J);return}if(S.elIndex===void 0||!(d!=null&&d.sel))return;let F=null;document.querySelector(d.sel)||(d!=null&&d.trigger&&(F=document.querySelector(d.trigger)),F&&(eo(F),await new Promise(y=>setTimeout(()=>y(),50))));const k=d&&d.sel&&!d.url?document.querySelectorAll(d.sel):void 0;k!=null&&k[S.elIndex]&&(eo(k[S.elIndex]),F&&document.querySelector(d.sel)&&eo(F))}function x(S,J){const F=gm(c,S,(n==null?void 0:n.trailing)??!0);J?window.open(F,"_blank","noopener"):location.href=F}function _(S){const J=w[S];return J?F=>p(J,F):void 0}function D(S,J,F){if(J)x(J,F);else if(S){const k=document.querySelector(S);k&&eo(k,{preventDefault:!1})}}const b=r??s,P=d==null?void 0:d.url,A=((H=a.chapters)==null?void 0:H.filter(S=>S.slug||!P&&S.elIndex!==void 0))??[],w=A.length>1?A:[],g=(T=e.prev)==null?void 0:T.slug,I=(Y=e.next)==null?void 0:Y.slug,q=t!=null&&t.prev&&typeof t.prev!="string"?t.prev.sel??t.prevBtn:t==null?void 0:t.prevBtn,K=t!=null&&t.next&&typeof t.next!="string"?t.next.sel??t.nextBtn:t==null?void 0:t.nextBtn;let R=g||q&&!w.length&&document.body.querySelector(q)?S=>D(q,g,S):void 0,Q=I||K&&!w.length&&document.body.querySelector(K)?S=>D(K,I,S):void 0;if(w.length){if(P&&(f=w.findIndex(S=>S.slug===e.slug)),f===-1&&(f=w.findIndex(S=>(S.vol??S.inferVol)===b&&S.chap===l)),P&&f===-1&&(f=w.findIndex(S=>S.slug&&u.startsWith(`${S.slug}-`)&&u.length-S.slug.length>3)),f!==-1)R??(R=_(f+1)),Q??(Q=_(f-1));else if(!g&&!I){const S=w.findIndex(J=>{const F=J.vol??J.inferVol;return b===void 0||F===void 0||b===F?J.chap<l:F<b});S!==-1?(R=_(S),Q=_(S-1)):Q=_(w.length-1)}}return{activeIndex:f,activeLabel:Aa({vol:r,chap:l}),prev:R,next:Q,chapters:w.map(S=>({label:Aa(S),select:J=>p(S,J)}))}}function Aa({vol:e,chap:t}){return e==null?`Ch.${t}`:`Vol.${e} ch.${t}`}function gm(e,t,n){const o=!t||t.includes("//")||t.startsWith("/")?t:"/"+[...e.split("/"),...t.split("/")].filter(Boolean).join("/"),[i,r]=(o.includes("//")?o:location.origin+o).split("?");return[i.endsWith("/")===n?i:n?i+"/":i.substring(0,-1),r].filter(Boolean).join("?")}function mm(e){return e instanceof Error?JSON.stringify(e,Object.getOwnPropertyNames(e)):e}const ja=ve(pe({inheritAttrs:!1,__name:"App",props:{immediate:{type:Boolean},appVersion:{type:String},raw:{type:Object},spec:{type:Object},siteMeta:{type:null},page:{type:Number},spaceTop:{type:Number},touchDevice:{type:Boolean},entryId:{type:String},defaultPreferences:{type:Object},isAutoShow:{type:Boolean},tourEnabled:{type:Boolean},offlineMode:{type:Boolean}},emits:["error","crash","ready","pageChanged","playingChanged","tourEnabledChanged","dispose","openEntry","addEntry","finished","getHiddenChapters","hapticFeedback","pressedBack","selectChapter","timeout","openDefaultPreferences","defaultPreferencesChanged","controlsVisibilityChanged"],setup(e,{emit:t}){const n=e,o=t;let i=!1;vs((b,P,A)=>{if(!i){i=!0;const g=`(3.0.0) ${(P==null?void 0:P.$options.name)??(P==null?void 0:P.$options.__name)??(P==null?void 0:P.$options.__file)}.${A}: ${mm(b)}`;o("crash",g)}return!1});const r=ee(n.raw?n.raw.contentType??Qt.manga:void 0);r.value===void 0&&fm({siteMeta:n.siteMeta,spec:n.spec}).then(b=>{b?r.value=b:o("error")});const s=ee(!1),l=Qd({touchDevice:n.touchDevice}),a=of(n.page,n.isAutoShow),u=G(()=>n.raw?hm({raw:n.raw,spec:n.spec,siteMeta:n.siteMeta,offlineMode:n.offlineMode,onSelect:b=>o("selectChapter",b)}):void 0);nf().addListener({onKeyUp:b=>{switch(b.key){case"h":_();break}}}),ef(()=>o("hapticFeedback"));const d=G(()=>{var w,g;const b=n.defaultPreferences,P=((w=n.defaultPreferences)==null?void 0:w.fontSize)??16,A=Math.max(P,((g=n.defaultPreferences)==null?void 0:g.lineHeight)??28);return{...b,speed:(b==null?void 0:b.speed)??1,progressSize:(b==null?void 0:b.progressSize)??2,autoNextSeconds:(b==null?void 0:b.autoNextSeconds)??5,hideControlsEvent:(b==null?void 0:b.hideControlsEvent)??tn.firstMove,autoPlay:(b==null?void 0:b.autoPlay)??!1,pinchToZoom:(b==null?void 0:b.pinchToZoom)??!0,readerStyle:(b==null?void 0:b.readerStyle)??Dt.longStrip,direction:(b==null?void 0:b.direction)??nt.vertical,gap:(b==null?void 0:b.gap)??0,fontFamily:"system-ui, sans-serif",contrast:.8,...n.defaultPreferences,fontSize:P,lineHeight:A}});function f(){if(n.offlineMode){o("pressedBack");return}rf(),o("dispose")}function p(b){a.value=b,o("pageChanged",b)}function x(){n.entryId?o("openEntry",n.entryId):o("addEntry")}function _(b){s.value!==b&&(s.value=b??!s.value)}function D(){o("error"),f()}return(b,P)=>r.value!==void 0?(v(),oe(Pi(r.value===Z(Qt).novel?Da:Ma),cn({key:0,ref:"root"},n,{page:Z(a),busy:Z(l),"chapter-nav-data":u.value,"default-preferences":d.value,onOpenDefaultPreferences:P[1]||(P[1]=()=>o("openDefaultPreferences")),onDefaultPreferencesChanged:P[2]||(P[2]=A=>o("defaultPreferencesChanged",A)),onTimeout:P[3]||(P[3]=()=>o("timeout")),onReady:P[4]||(P[4]=()=>o("ready")),onFinished:P[5]||(P[5]=()=>o("finished")),onPlayingChanged:P[6]||(P[6]=A=>o("playingChanged",A)),onControlsVisibilityChanged:P[7]||(P[7]=A=>o("controlsVisibilityChanged",A)),onPressedBack:P[8]||(P[8]=()=>o("pressedBack")),onGetHiddenChapters:P[9]||(P[9]=()=>o("getHiddenChapters")),onError:D,onHideReader:f,onPageChanged:p,onClickEntryButton:x,onOpenHelpScreen:P[10]||(P[10]=()=>_(!0))}),{default:ne(()=>[s.value?(v(),oe(Ll,{key:0,"touch-device":e.touchDevice,onHide:_},null,8,["touch-device"])):se("",!0),e.tourEnabled?(v(),oe(Bl,{key:1,onHide:P[0]||(P[0]=()=>o("tourEnabledChanged",!1))})):se("",!0)]),_:1},16,["page","busy","chapter-nav-data","default-preferences"])):se("",!0)}}),[["styles",['*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:Helvetica,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}*{-webkit-tap-highlight-color:rgba(0,0,0,0)!important}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:none;border-style:none;cursor:pointer;outline:2px solid transparent;outline-offset:2px;white-space:nowrap}button[disabled]{cursor:default!important}svg{height:100%}.container,svg{width:100%}@media (min-width:300px){.container{max-width:300px}}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.scrollbar-none{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}.scrollbar-sm{scrollbar-color:#777 transparent;scrollbar-width:thin}.scrollbar-sm::-webkit-scrollbar{background-color:transparent;height:4px;width:4px}.scrollbar-sm::-webkit-scrollbar-track{background:transparent}.scrollbar-sm::-webkit-scrollbar-thumb{background-color:#777;border-radius:2px}.\\!pointer-events-none{pointer-events:none!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.\\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-1{bottom:4px}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:4px}.left-1\\/2{left:50%}.left-10{left:40px}.left-3{left:12px}.left-9{left:36px}.right-0{right:0}.top-0{top:0}.top-1{top:4px}.top-1\\/2{top:50%}.top-10{top:40px}.top-2{top:8px}.top-9{top:36px}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.order-2{order:2}.m-0{margin:0}.m-auto{margin:auto}.-mx-12{margin-left:-48px;margin-right:-48px}.-my-12{margin-bottom:-48px;margin-top:-48px}.-ml-20{margin-left:-80px}.-mr-3{margin-right:-12px}.-mt-2{margin-top:-8px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-5{margin-bottom:20px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.mt-5{margin-top:20px}.box-border{box-sizing:border-box}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.\\!h-9{height:36px!important}.h-0{height:0}.h-1{height:4px}.h-1\\/3{height:33.333333%}.h-10{height:40px}.h-12{height:48px}.h-14{height:56px}.h-16{height:64px}.h-2{height:8px}.h-20{height:80px}.h-24{height:96px}.h-28{height:112px}.h-3{height:12px}.h-4{height:16px}.h-5{height:20px}.h-6{height:24px}.h-8{height:32px}.h-9{height:36px}.h-\\[101\\%\\]{height:101%}.h-full{height:100%}.max-h-\\[70vh\\]{max-height:70vh}.max-h-full{max-height:100%}.max-h-none{max-height:none}.min-h-full{min-height:100%}.w-0{width:0}.w-1{width:4px}.w-1\\/3{width:33.333333%}.w-10{width:40px}.w-12{width:48px}.w-14{width:56px}.w-2{width:8px}.w-2\\/3{width:66.666667%}.w-20{width:80px}.w-24{width:96px}.w-28{width:112px}.w-3{width:12px}.w-4{width:16px}.w-40{width:160px}.w-5{width:20px}.w-auto{width:auto}.w-full{width:100%}.w-min{width:-moz-min-content;width:min-content}.max-w-full{max-width:100%}.max-w-none{max-width:none}.max-w-xs{max-width:320px}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.origin-bottom{transform-origin:bottom}.origin-right{transform-origin:right}.origin-top{transform-origin:top}.\\!translate-y-full{--tw-translate-y:100%!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1\\.5{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\.5{--tw-translate-y:-6px}.-translate-y-1\\/2{--tw-translate-y:-50%}.-translate-y-1\\/2,.translate-y-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y:0px}.translate-y-1\\.5{--tw-translate-y:6px}.-rotate-90,.translate-y-1\\.5{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate:-90deg}.rotate-180{--tw-rotate:180deg}.rotate-180,.rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate:90deg}.scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.scale-95,.scale-y-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-y-90{--tw-scale-y:.9}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-auto{cursor:auto}.cursor-default{cursor:default}.cursor-grabbing{cursor:grabbing}.cursor-none{cursor:none}.cursor-pointer{cursor:pointer}.touch-pan-x{--tw-pan-x:pan-x}.touch-pan-x,.touch-pan-y{touch-action:var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)}.touch-pan-y{--tw-pan-y:pan-y}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.resize{resize:both}.\\!snap-none{scroll-snap-type:none!important}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-y{scroll-snap-type:y var(--tw-scroll-snap-strictness)}.snap-center{scroll-snap-align:center}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-6{gap:24px}.gap-\\[1px\\]{gap:1px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overscroll-contain{overscroll-behavior:contain}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:4px}.rounded-2xl{border-radius:16px}.rounded-\\[2\\.5rem\\]{border-radius:40px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:6px}.rounded-xl{border-radius:12px}.\\!rounded-l-none{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.\\!rounded-r-none{border-bottom-right-radius:0!important;border-top-right-radius:0!important}.rounded-l-sm{border-bottom-left-radius:2px;border-top-left-radius:2px}.rounded-r-sm{border-bottom-right-radius:2px;border-top-right-radius:2px}.rounded-t-xl{border-top-left-radius:12px;border-top-right-radius:12px}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-t-\\[1px\\]{border-top-width:1px}.border-solid{border-style:solid}.border-none{border-style:none}.border-primary{--tw-border-opacity:1;border-color:rgb(184 92 56/var(--tw-border-opacity,1))}.border-stone-200{--tw-border-opacity:1;border-color:rgb(231 229 228/var(--tw-border-opacity,1))}.border-stone-400{--tw-border-opacity:1;border-color:rgb(168 162 158/var(--tw-border-opacity,1))}.border-stone-500{--tw-border-opacity:1;border-color:rgb(120 113 108/var(--tw-border-opacity,1))}.border-stone-600{--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity,1))}.border-textPrimary{--tw-border-opacity:1;border-color:rgb(251 130 82/var(--tw-border-opacity,1))}.border-opacity-30{--tw-border-opacity:.3}.border-opacity-70{--tw-border-opacity:.7}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.bg-inherit{background-color:inherit}.bg-primary{--tw-bg-opacity:1;background-color:rgb(184 92 56/var(--tw-bg-opacity,1))}.bg-stone-100{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity,1))}.bg-stone-300{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity,1))}.bg-stone-500{--tw-bg-opacity:1;background-color:rgb(120 113 108/var(--tw-bg-opacity,1))}.bg-stone-600{--tw-bg-opacity:1;background-color:rgb(87 83 78/var(--tw-bg-opacity,1))}.bg-stone-800{--tw-bg-opacity:1;background-color:rgb(41 37 36/var(--tw-bg-opacity,1))}.bg-stone-900{--tw-bg-opacity:1;background-color:rgb(28 25 23/var(--tw-bg-opacity,1))}.bg-textPrimary{--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.\\!bg-opacity-100{--tw-bg-opacity:1!important}.bg-opacity-40{--tw-bg-opacity:.4}.bg-opacity-50{--tw-bg-opacity:.5}.bg-opacity-70{--tw-bg-opacity:.7}.bg-opacity-80{--tw-bg-opacity:.8}.bg-opacity-90{--tw-bg-opacity:.9}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-none{background-image:none}.from-black{--tw-gradient-from:#000 var(--tw-gradient-from-position);--tw-gradient-to:transparent var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-transparent{--tw-gradient-to:transparent var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-2{padding:8px}.p-4{padding:16px}.p-6{padding:24px}.px-2{padding-left:8px;padding-right:8px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-5{padding-left:20px;padding-right:20px}.px-6{padding-left:24px;padding-right:24px}.px-8{padding-left:32px;padding-right:32px}.py-0\\.5{padding-bottom:2px;padding-top:2px}.py-1{padding-bottom:4px;padding-top:4px}.py-1\\.5{padding-bottom:6px;padding-top:6px}.py-2{padding-bottom:8px;padding-top:8px}.pb-6{padding-bottom:24px}.pb-7{padding-bottom:28px}.pb-8{padding-bottom:32px}.pl-1{padding-left:4px}.pr-2{padding-right:8px}.pt-1{padding-top:4px}.pt-1\\.5{padding-top:6px}.pt-12{padding-top:48px}.pt-16{padding-top:64px}.pt-20{padding-top:80px}.pt-5{padding-top:20px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-sans{font-family:Helvetica,sans-serif}.text-base{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.font-medium{font-weight:500}.font-normal{font-weight:400}.lowercase{text-transform:lowercase}.leading-none{line-height:1}.text-stone-100{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}.text-stone-200{--tw-text-opacity:1;color:rgb(231 229 228/var(--tw-text-opacity,1))}.text-stone-300{--tw-text-opacity:1;color:rgb(214 211 209/var(--tw-text-opacity,1))}.text-stone-400{--tw-text-opacity:1;color:rgb(168 162 158/var(--tw-text-opacity,1))}.text-stone-50{--tw-text-opacity:1;color:rgb(250 250 249/var(--tw-text-opacity,1))}.text-stone-800{--tw-text-opacity:1;color:rgb(41 37 36/var(--tw-text-opacity,1))}.text-stone-900{--tw-text-opacity:1;color:rgb(28 25 23/var(--tw-text-opacity,1))}.text-textPrimary{--tw-text-opacity:1;color:rgb(251 130 82/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-neutral-950{--tw-shadow-color:#0a0a0a;--tw-shadow:var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur:blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-bg{transition-duration:.15s;transition-property:background-color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-0{transition-duration:0s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.children-pointer-events-auto>*{pointer-events:auto}.last\\:mb-0:last-child{margin-bottom:0}.last\\:border-b-transparent:last-child{border-bottom-color:transparent}@media (hover:hover) and (pointer:fine){.hover\\:bg-stone-100:hover{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity,1))}.hover\\:bg-stone-300:hover{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity,1))}.hover\\:bg-stone-50:hover{--tw-bg-opacity:1;background-color:rgb(250 250 249/var(--tw-bg-opacity,1))}.hover\\:bg-stone-500:hover{--tw-bg-opacity:1;background-color:rgb(120 113 108/var(--tw-bg-opacity,1))}.hover\\:bg-stone-900:hover{--tw-bg-opacity:1;background-color:rgb(28 25 23/var(--tw-bg-opacity,1))}.hover\\:bg-opacity-10:hover{--tw-bg-opacity:.1}.hover\\:bg-opacity-50:hover{--tw-bg-opacity:.5}.hover\\:bg-opacity-80:hover{--tw-bg-opacity:.8}.hover\\:text-stone-100:hover{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:outline-primary:focus{outline-color:#b85c38}@media (hover:hover) and (pointer:fine){.group:hover .group-hover\\:bg-stone-100{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity,1))}.group:hover .group-hover\\:bg-opacity-20{--tw-bg-opacity:.2}}@media (min-width:300px){.\\32xs\\:inline-block{display:inline-block}.\\32xs\\:gap-3{gap:12px}.\\32xs\\:px-3{padding-left:12px;padding-right:12px}}@media (min-width:640px){.sm\\:h-16{height:64px}.sm\\:w-\\[31rem\\]{width:496px}.sm\\:p-3{padding:12px}.sm\\:px-12{padding-left:48px;padding-right:48px}.sm\\:py-3{padding-bottom:12px;padding-top:12px}.sm\\:pt-18{padding-top:72px}.sm\\:pt-9{padding-top:36px}}@media (min-width:768px){.md\\:fixed{position:fixed}.md\\:left-auto{left:auto}.md\\:order-4{order:4}.md\\:inline-block{display:inline-block}.md\\:hidden{display:none}.md\\:flex-col{flex-direction:column}.md\\:bg-transparent{background-color:transparent}.md\\:px-14{padding-left:56px;padding-right:56px}.md\\:px-8{padding-left:32px;padding-right:32px}.md\\:pb-5{padding-bottom:20px}.md\\:pb-6{padding-bottom:24px}.md\\:pt-12{padding-top:48px}.md\\:pt-20{padding-top:80px}}@media (min-width:1024px){.lg\\:px-10{padding-left:40px;padding-right:40px}.lg\\:px-16{padding-left:64px;padding-right:64px}.lg\\:pb-3{padding-bottom:12px}.lg\\:pb-4{padding-bottom:16px}}@media (min-width:1280px){.xl\\:px-12{padding-left:48px;padding-right:48px}}']]]),vm=Object.freeze(Object.defineProperty({__proto__:null,default:ja},Symbol.toStringTag,{value:"Module"})),bm={class:"max-h-none max-w-none h-full w-full m-0 p-0 border-none outline-none"},ym={key:0,class:"fixed inset-0 h-[101%] flex justify-center items-center z-10 bg-black"},wm={class:"flex justify-between items-end"},xm={class:"inline-block children-pointer-events-auto"},_m={class:"inline-flex flex-col items-end gap-4 children-pointer-events-auto"},Sm={class:"fixed pointer-events-none left-0 right-0 bottom-0"},km={key:1,class:"fixed inline-block left-1/2 -translate-x-1/2 bottom-0 p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3"},Cm=Object.freeze(Object.defineProperty({__proto__:null,default:ve(pe({__name:"ReaderLayout",props:{loading:{type:Boolean},immediate:{type:Boolean},idle:{type:Boolean},controlsVisible:{type:Boolean},zooming:{type:Boolean},spaceTop:{type:null}},setup(e,{expose:t}){const n={mounted:i=>i.showModal(),beforeUnmount:i=>i.close()},o=ee(null);return t({rootEl:o}),(i,r)=>Ne((v(),z("dialog",bm,[U("div",{ref_key:"rootEl",ref:o,id:"reader-layout",class:fe({"cursor-none":e.idle,"cursor-default":!e.idle,"bg-black":e.immediate||!e.loading,"opacity-0":!e.immediate&&e.loading,"duration-200 transition-colors":!e.immediate})},[e.loading&&e.immediate?(v(),z("div",ym,[B(ei)])):se("",!0),xe(i.$slots,"default"),U("div",{id:"controls",class:fe(["fixed pointer-events-none cursor-auto left-0 top-0 w-full h-full flex flex-col justify-between p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3",{"opacity-100 z-20":e.controlsVisible,"opacity-0 -z-10":!e.controlsVisible}])},[U("div",{class:"flex gap-1 items-center children-pointer-events-auto relative z-30 flex-shrink-0 2xs:gap-3",style:Pe({paddingTop:`${e.spaceTop||0}px`})},[xe(i.$slots,"top-controls")],4),U("div",wm,[U("div",xm,[xe(i.$slots,"bottom-left-controls")]),U("div",_m,[xe(i.$slots,"bottom-right-controls")])]),U("div",Sm,[xe(i.$slots,"progress")])],2),e.controlsVisible||e.zooming?(v(),z("div",km,[xe(i.$slots,"reset-zoom")])):se("",!0)],2)])),[[n]])}}),[["styles",["#reader-layout{direction:ltr;font-family:Helvetica,sans-serif;font-size:16px;font-weight:400;height:100%;line-height:24px;overflow:hidden;overscroll-behavior:contain;pointer-events:auto;text-align:left;width:100%;--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}"]]])},Symbol.toStringTag,{value:"Module"})),Tm={},Pm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function Mm(e,t){return v(),z("svg",Pm,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46s46-20.595 46-46s-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1)])])}const Em=Object.freeze(Object.defineProperty({__proto__:null,default:ve(Tm,[["render",Mm]])},Symbol.toStringTag,{value:"Module"})),Im="gear-second{height:0!important;opacity:0!important;pointer-events:none!important;width:0!important;z-index:-10!important}html.gear-second,html.gear-second *{scroll-behavior:auto!important;scrollbar-width:none!important}html.gear-second ::-webkit-scrollbar,html.gear-second::-webkit-scrollbar{display:none!important}html.gear-second body{touch-action:pan-x pan-y!important}html.gear-second body .m-content #progress-bar{display:none!important}html.gear-second body>:not(dialog[open]),html.gear-second>body~*{visibility:hidden!important}html.gear-second>body~*{display:none!important;height:0!important;left:100%!important;max-height:0!important;max-width:0!important;opacity:0!important;pointer-events:none!important;top:100%!important;width:0!important}.mp-scroll-container{max-height:100vh!important;overflow:hidden!important}html:has(body.mp-scroll-container){overflow:auto!important}",mn="gear-second",_r={appVersion:void 0,immediate:void 0,raw:void 0,spec:void 0,siteMeta:void 0,page:0,spaceTop:void 0,touchDevice:void 0,entryId:void 0,isAutoShow:void 0,tourEnabled:void 0,offlineMode:void 0,defaultPreferences:void 0,onError:void 0,onCrash:void 0,onDispose:void 0,onFullScreenChanged:void 0,onControlsVisibilityChanged:void 0,onPageChanged:void 0,onOpenEntry:void 0,onAddEntry:void 0,onFinished:void 0,onHapticFeedback:void 0,onPressedBack:void 0,onSelectChapter:void 0,onTimeout:void 0,onDefaultPreferencesChanged:void 0,onOpenDefaultPreferences:void 0},Je={promise:void 0,data:vo({..._r})};async function Om(e){return Je.promise?(Je.data.raw=e.raw,await Je.promise):(Je.promise=new Promise(t=>{let n=!1,o=!1,i,r,s=0;const l=!!e.spaceTop||!!e.isAutoShow&&!!e.page,a=()=>{n||(n=!0,clearInterval(i),i=void 0,r!=null&&r.isConnected&&document.body.removeChild(r),document.documentElement.classList.remove(mn),Je.data.touchDevice||Object.assign(Je.data,_r),Je.promise=void 0,Gn.clear())},u=ct(f=>{var p;return!n&&((p=e.onPageChanged)==null?void 0:p.call(e,f))},300);Object.assign(Je.data,_r,e.appVersion?e:La(e),{immediate:l,onReady(){l||(c(),document.documentElement.classList.add(mn))},onError(){var f,p;a(),o?((f=e.onDispose)==null||f.call(e),(p=e.onError)==null||p.call(e)):d()},onDispose:()=>{var f;a(),(f=e==null?void 0:e.onDispose)==null||f.call(e)},onControlsVisibilityChanged(f){var p,x;(p=e.onFullScreenChanged)==null||p.call(e,!f),(x=e.onControlsVisibilityChanged)==null||x.call(e,f)},onPageChanged:f=>{Je.data.page=f,!(s>=f)&&(s=f,u(f))},onTourEnabledChanged:f=>{Je.data.tourEnabled=f},onDefaultPreferencesChanged:f=>{var p;Je.data.defaultPreferences=f,(p=e.onDefaultPreferencesChanged)==null||p.call(e,f)}}),$m().then(()=>{if(n){d();return}r=document.createElement(mn),l?(document.documentElement.classList.add(mn),document.body.appendChild(r),setTimeout(c)):document.body.appendChild(r);let f=0;i=setInterval(()=>{if(++f===30||n){clearInterval(i),i=void 0;return}r.isConnected||(document.documentElement.classList.add(mn),document.body.appendChild(r))},100)});function c(){o||(o=!0,t({updateArgs(f){Object.assign(Je.data,Je.data.appVersion?f:La(f))},dispose:a,back:()=>Gn.trigger()}))}function d(){o||t(void 0)}}),await Je.promise)}function La(e){if(!["autoPlay","readerStyle","direction","autoNextSeconds","defaultSpeed","defaultGap","hideControlsEvent","progressSize","pinchToZoom","tapZone"].some(p=>p in e))return e;const{autoPlay:n,readerStyle:o,direction:i,autoNextSeconds:r,defaultSpeed:s,defaultGap:l,hideControlsEvent:a,progressSize:u,pinchToZoom:c,tapZone:d,...f}=e;return{...f,defaultPreferences:{autoPlay:n,readerStyle:o,direction:i,autoNextSeconds:r,speed:s,gap:l,hideControlsEvent:a,progressSize:u,pinchToZoom:c,tapZone:d}}}async function $m(){if(window.customElements.get(mn))return;const e=document.createElement("style"),t=Im;e.appendChild(document.createTextNode(t)),document.head.appendChild(e);const n=dd({styles:[await zm()],data:()=>({readerData:Je.data}),render(){return tl(ja,this.readerData)}});window.customElements.define(mn,n)}async function zm(){const e=Object.assign({"./App.vue":vm,"./GearSecond.vue":Ug,"./GearThird.vue":dm,"./components/AutoNext.vue":vf,"./components/ButtonWebFullScreen.vue":pp,"./components/ChapterNav.vue":Bp,"./components/DefaultPreferencesForm.vue":wh,"./components/DirectionToast.vue":Ph,"./components/GearControlsLayout.vue":Ih,"./components/GearLayout.vue":Bh,"./components/GearThirdControlsLayout.vue":tm,"./components/GesturesContainer.vue":Jh,"./components/HelpScreen.vue":Yd,"./components/MangaPreferencesForm.vue":Kh,"./components/NovelBody.vue":um,"./components/NovelPreferencesForm.vue":gh,"./components/PageNav.vue":Zh,"./components/PauseToast.vue":Yh,"./components/ProgressBar.vue":Gh,"./components/ReaderBody.vue":og,"./components/ReaderLayout.vue":Cm,"./components/ReaderTour.vue":Jd,"./components/SettingsBottomSheet.vue":Sg,"./components/TapZonePreview.vue":Ch,"./components/base/BaseButton.vue":af,"./components/base/BottomSheet.vue":cg,"./components/base/ButtonDropdown.vue":Mp,"./components/base/ButtonIcon.vue":bf,"./components/base/ButtonOutline.vue":sh,"./components/base/DropdownMenu.vue":mp,"./components/base/InputPercentage.vue":Rp,"./components/base/InputSelect.vue":Wp,"./components/base/InputSwitcher.vue":Zp,"./components/base/LoadingIndicator.vue":Ah,"./components/base/TabBar.vue":dg,"./components/base/TableField.vue":Xp,"./components/buttons/ButtonBack.vue":Sf,"./components/buttons/ButtonEntry.vue":$f,"./components/buttons/ButtonHide.vue":Lf,"./components/buttons/ButtonPlay.vue":Uf,"./components/buttons/ButtonResetZoom.vue":Qf,"./components/buttons/ButtonSettings.vue":ip,"./components/fields/FieldContrast.vue":Gp,"./components/fields/FieldFontFamily.vue":lh,"./components/icons/IconBack.vue":_f,"./components/icons/IconBookmarkNew.vue":Of,"./components/icons/IconBookmarked.vue":Pf,"./components/icons/IconChevronLeft.vue":$p,"./components/icons/IconChevronRight.vue":jp,"./components/icons/IconClose.vue":lg,"./components/icons/IconDouble.vue":Hh,"./components/icons/IconDoubleSkip.vue":Uh,"./components/icons/IconExclamationCircle.vue":Em,"./components/icons/IconFullscreen.vue":ap,"./components/icons/IconFullscreenExit.vue":fp,"./components/icons/IconHelp.vue":gg,"./components/icons/IconLandscape.vue":th,"./components/icons/IconLoading.vue":wp,"./components/icons/IconMoreVert.vue":yg,"./components/icons/IconNext.vue":kh,"./components/icons/IconPause.vue":Rf,"./components/icons/IconPlay.vue":qf,"./components/icons/IconPlus.vue":ff,"./components/icons/IconPortrait.vue":rh,"./components/icons/IconReaderExit.vue":jf,"./components/icons/IconSettings.vue":op,"./components/icons/IconTextDecre.vue":rm,"./components/icons/IconTextIncre.vue":cm,"./components/icons/IconTriangle.vue":kp,"./components/icons/IconZoom.vue":Xf}),t=[];for(const n in e){const o=e[n];t.push(o.default.styles)}return t.join("")}return Om});
|
|
20
|
+
**/let Vi;const nl=typeof window<"u"&&window.trustedTypes;if(nl)try{Vi=nl.createPolicy("vue",{createHTML:e=>e})}catch{}const ol=Vi?e=>Vi.createHTML(e):e=>e,Fu="http://www.w3.org/2000/svg",Wu="http://www.w3.org/1998/Math/MathML",qt=typeof document<"u"?document:null,il=qt&&qt.createElement("template"),qu={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const i=t==="svg"?qt.createElementNS(Fu,e):t==="mathml"?qt.createElementNS(Wu,e):n?qt.createElement(e,{is:n}):qt.createElement(e);return e==="select"&&o&&o.multiple!=null&&i.setAttribute("multiple",o.multiple),i},createText:e=>qt.createTextNode(e),createComment:e=>qt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>qt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,i,r){const s=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{il.innerHTML=ol(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=il.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Jt="transition",Kn="animation",Zn=Symbol("_vtc"),rl={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Uu=Ie({},as,rl),Vo=(e=>(e.displayName="Transition",e.props=Uu,e))((e,{slots:t})=>tl(Rc,Ku(e),t)),dn=(e,t=[])=>{ie(e)?e.forEach(n=>n(...t)):e&&e(...t)},sl=e=>e?ie(e)?e.some(t=>t.length>1):e.length>1:!1;function Ku(e){const t={};for(const T in e)T in rl||(t[T]=e[T]);if(e.css===!1)return t;const{name:n="v",type:o,duration:i,enterFromClass:r=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=r,appearActiveClass:u=s,appearToClass:c=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,x=Zu(i),_=x&&x[0],D=x&&x[1],{onBeforeEnter:b,onEnter:P,onEnterCancelled:A,onLeave:w,onLeaveCancelled:g,onBeforeAppear:I=b,onAppear:q=P,onAppearCancelled:K=A}=t,R=(T,Y,S,J)=>{T._enterCancelled=J,fn(T,Y?c:l),fn(T,Y?u:s),S&&S()},Q=(T,Y)=>{T._isLeaving=!1,fn(T,d),fn(T,p),fn(T,f),Y&&Y()},H=T=>(Y,S)=>{const J=T?q:P,F=()=>R(Y,T,S);dn(J,[Y,F]),ll(()=>{fn(Y,T?a:r),Ut(Y,T?c:l),sl(J)||al(Y,o,_,F)})};return Ie(t,{onBeforeEnter(T){dn(b,[T]),Ut(T,r),Ut(T,s)},onBeforeAppear(T){dn(I,[T]),Ut(T,a),Ut(T,u)},onEnter:H(!1),onAppear:H(!0),onLeave(T,Y){T._isLeaving=!0;const S=()=>Q(T,Y);Ut(T,d),T._enterCancelled?(Ut(T,f),dl(T)):(dl(T),Ut(T,f)),ll(()=>{T._isLeaving&&(fn(T,d),Ut(T,p),sl(w)||al(T,o,D,S))}),dn(w,[T,S])},onEnterCancelled(T){R(T,!1,void 0,!0),dn(A,[T])},onAppearCancelled(T){R(T,!0,void 0,!0),dn(K,[T])},onLeaveCancelled(T){Q(T),dn(g,[T])}})}function Zu(e){if(e==null)return null;if(Ce(e))return[Ni(e.enter),Ni(e.leave)];{const t=Ni(e);return[t,t]}}function Ni(e){return ci(e)}function Ut(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Zn]||(e[Zn]=new Set)).add(t)}function fn(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Zn];n&&(n.delete(t),n.size||(e[Zn]=void 0))}function ll(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Yu=0;function al(e,t,n,o){const i=e._endId=++Yu,r=()=>{i===e._endId&&o()};if(n!=null)return setTimeout(r,n);const{type:s,timeout:l,propCount:a}=Xu(e,t);if(!s)return o();const u=s+"end";let c=0;const d=()=>{e.removeEventListener(u,f),r()},f=p=>{p.target===e&&++c>=a&&d()};setTimeout(()=>{c<a&&d()},l+1),e.addEventListener(u,f)}function Xu(e,t){const n=window.getComputedStyle(e),o=x=>(n[x]||"").split(", "),i=o(`${Jt}Delay`),r=o(`${Jt}Duration`),s=cl(i,r),l=o(`${Kn}Delay`),a=o(`${Kn}Duration`),u=cl(l,a);let c=null,d=0,f=0;t===Jt?s>0&&(c=Jt,d=s,f=r.length):t===Kn?u>0&&(c=Kn,d=u,f=a.length):(d=Math.max(s,u),c=d>0?s>u?Jt:Kn:null,f=c?c===Jt?r.length:a.length:0);const p=c===Jt&&/\b(?:transform|all)(?:,|$)/.test(o(`${Jt}Property`).toString());return{type:c,timeout:d,propCount:f,hasTransform:p}}function cl(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>ul(n)+ul(e[o])))}function ul(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function dl(e){return(e?e.ownerDocument:document).body.offsetHeight}function Gu(e,t,n){const o=e[Zn];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const No=Symbol("_vod"),fl=Symbol("_vsh"),pl={name:"show",beforeMount(e,{value:t},{transition:n}){e[No]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Yn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Yn(e,!0),o.enter(e)):o.leave(e,()=>{Yn(e,!1)}):Yn(e,t))},beforeUnmount(e,{value:t}){Yn(e,t)}};function Yn(e,t){e.style.display=t?e[No]:"none",e[fl]=!t}const Ju=Symbol(""),Qu=/(?:^|;)\s*display\s*:/;function ed(e,t,n){const o=e.style,i=Oe(n);let r=!1;if(n&&!i){if(t)if(Oe(t))for(const s of t.split(";")){const l=s.slice(0,s.indexOf(":")).trim();n[l]==null&&Ro(o,l,"")}else for(const s in t)n[s]==null&&Ro(o,s,"");for(const s in n)s==="display"&&(r=!0),Ro(o,s,n[s])}else if(i){if(t!==n){const s=o[Ju];s&&(n+=";"+s),o.cssText=n,r=Qu.test(n)}}else t&&e.removeAttribute("style");No in e&&(e[No]=r?o.display:"",e[fl]&&(o.display="none"))}const hl=/\s*!important$/;function Ro(e,t,n){if(ie(n))n.forEach(o=>Ro(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=td(e,t);hl.test(n)?e.setProperty(et(o),n.replace(hl,""),"important"):e[o]=n}}const gl=["Webkit","Moz","ms"],Ri={};function td(e,t){const n=Ri[t];if(n)return n;let o=Re(t);if(o!=="filter"&&o in e)return Ri[t]=o;o=so(o);for(let i=0;i<gl.length;i++){const r=gl[i]+o;if(r in e)return Ri[t]=r}return t}const ml="http://www.w3.org/1999/xlink";function vl(e,t,n,o,i,r=Ya(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ml,t.slice(6,t.length)):e.setAttributeNS(ml,t,n):n==null||r&&!Er(n)?e.removeAttribute(t):e.setAttribute(t,r?"":yt(n)?String(n):n)}function bl(e,t,n,o,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ol(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let s=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Er(n):n==null&&l==="string"?(n="",s=!0):l==="number"&&(n=0,s=!0)}try{e[t]=n}catch{}s&&e.removeAttribute(i||t)}function pn(e,t,n,o){e.addEventListener(t,n,o)}function nd(e,t,n,o){e.removeEventListener(t,n,o)}const yl=Symbol("_vei");function od(e,t,n,o,i=null){const r=e[yl]||(e[yl]={}),s=r[t];if(o&&s)s.value=o;else{const[l,a]=id(t);if(o){const u=r[t]=ld(o,i);pn(e,l,u,a)}else s&&(nd(e,l,s,a),r[t]=void 0)}}const wl=/(?:Once|Passive|Capture)$/;function id(e){let t;if(wl.test(e)){t={};let o;for(;o=e.match(wl);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):et(e.slice(2)),t]}let Hi=0;const rd=Promise.resolve(),sd=()=>Hi||(rd.then(()=>Hi=0),Hi=Date.now());function ld(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;xt(ad(o,n.value),t,5,[o])};return n.value=e,n.attached=sd(),n}function ad(e,t){if(ie(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(o=>i=>!i._stopped&&o&&o(i))}else return t}const xl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,cd=(e,t,n,o,i,r)=>{const s=i==="svg";t==="class"?Gu(e,o,s):t==="style"?ed(e,n,o):no(t)?ii(t)||od(e,t,n,o,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ud(e,t,o,s))?(bl(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&vl(e,t,o,s,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Oe(o))?bl(e,Re(t),o,r,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),vl(e,t,o,s))};function ud(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&xl(t)&&de(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return xl(t)&&Oe(n)?!1:t in e}const _l={};function dd(e,t,n){let o=pe(e,t);io(o)&&(o=Ie({},o,t));class i extends Fi{constructor(s){super(o,s,n)}}return i.def=o,i}const fd=typeof HTMLElement<"u"?HTMLElement:class{};class Fi extends fd{constructor(t,n={},o=El){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&o!==El?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Ie({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.parentNode||t.host);)if(t instanceof Fi){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,gt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,i=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:r,styles:s}=o;let l;if(r&&!ie(r))for(const a in r){const u=r[a];(u===Number||u&&u.type===Number)&&(a in this._props&&(this._props[a]=ci(this._props[a])),(l||(l=Object.create(null)))[Re(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(s),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)_e(this,o)||Object.defineProperty(this,o,{get:()=>Z(n[o])})}_resolveProps(t){const{props:n}=t,o=ie(n)?n:Object.keys(n||{});for(const i of Object.keys(this))i[0]!=="_"&&o.includes(i)&&this._setProp(i,this[i]);for(const i of o.map(Re))Object.defineProperty(this,i,{get(){return this._getProp(i)},set(r){this._setProp(i,r,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):_l;const i=Re(t);n&&this._numberProps&&this._numberProps[i]&&(o=ci(o)),this._setProp(i,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,i=!1){if(n!==this._props[t]&&(this._dirty=!0,n===_l?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),i&&this._instance&&this._update(),o)){const r=this._ob;r&&(this._processMutations(r.takeRecords()),r.disconnect()),n===!0?this.setAttribute(et(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(et(t),n+""):n||this.removeAttribute(et(t)),r&&r.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),xd(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=B(this._def,Ie(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const i=(r,s)=>{this.dispatchEvent(new CustomEvent(r,io(s[0])?Ie({detail:s},s[0]):{detail:s}))};o.emit=(r,...s)=>{i(r,s),et(r)!==r&&i(et(r),s)},this._setParent()}),n}_applyStyles(t,n){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce;for(let i=t.length-1;i>=0;i--){const r=document.createElement("style");o&&r.setAttribute("nonce",o),r.textContent=t[i],this.shadowRoot.prepend(r)}}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const i=t[o],r=i.getAttribute("name")||"default",s=this._slots[r],l=i.parentNode;if(s)for(const a of s){if(n&&a.nodeType===1){const u=n+"-s",c=document.createTreeWalker(a,1);a.setAttribute(u,"");let d;for(;d=c.nextNode();)d.setAttribute(u,"")}l.insertBefore(a,i)}else for(;i.firstChild;)l.insertBefore(i.firstChild,i);l.removeChild(i)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const i=o.querySelectorAll("slot");for(let r=0;r<i.length;r++)n.add(i[r])}return Array.from(n)}_injectChildStyle(t){this._applyStyles(t.styles,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_removeChildStyle(t){}}const Ho=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ie(t)?n=>lo(t,n):t};function pd(e){e.target.composing=!0}function Sl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const kn=Symbol("_assign");function kl(e,t,n){return t&&(e=e.trim()),n&&(e=ai(e)),e}const hd={created(e,{modifiers:{lazy:t,trim:n,number:o}},i){e[kn]=Ho(i);const r=o||i.props&&i.props.type==="number";pn(e,t?"change":"input",s=>{s.target.composing||e[kn](kl(e.value,n,r))}),(n||r)&&pn(e,"change",()=>{e.value=kl(e.value,n,r)}),t||(pn(e,"compositionstart",pd),pn(e,"compositionend",Sl),pn(e,"change",Sl))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:i,number:r}},s){if(e[kn]=Ho(s),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?ai(e.value):e.value,a=t??"";l!==a&&(document.activeElement===e&&e.type!=="range"&&(o&&t===n||i&&e.value.trim()===a)||(e.value=a))}},gd={deep:!0,created(e,t,n){e[kn]=Ho(n),pn(e,"change",()=>{const o=e._modelValue,i=md(e),r=e.checked,s=e[kn];if(ie(o)){const l=Ir(o,i),a=l!==-1;if(r&&!a)s(o.concat(i));else if(!r&&a){const u=[...o];u.splice(l,1),s(u)}}else if(oo(o)){const l=new Set(o);r?l.add(i):l.delete(i),s(l)}else s(Tl(e,r))})},mounted:Cl,beforeUpdate(e,t,n){e[kn]=Ho(n),Cl(e,t,n)}};function Cl(e,{value:t,oldValue:n},o){e._modelValue=t;let i;if(ie(t))i=Ir(t,o.props.value)>-1;else if(oo(t))i=t.has(o.props.value);else{if(t===n)return;i=co(t,Tl(e,!0))}e.checked!==i&&(e.checked=i)}function md(e){return"_value"in e?e._value:e.value}function Tl(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const vd=["ctrl","shift","alt","meta"],bd={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>vd.some(n=>e[`${n}Key`]&&!t.includes(n))},Le=(e,t)=>{const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(i,...r)=>{for(let s=0;s<t.length;s++){const l=bd[t[s]];if(l&&l(i,t))return}return e(i,...r)})},yd={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Fo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=i=>{if(!("key"in i))return;const r=et(i.key);if(t.some(s=>s===r||yd[s]===r))return e(i)})},wd=Ie({patchProp:cd},qu);let Pl;function Ml(){return Pl||(Pl=pu(wd))}const xd=(...e)=>{Ml().render(...e)},El=(...e)=>{const t=Ml().createApp(...e),{mount:n}=t;return t.mount=o=>{const i=Sd(o);if(!i)return;const r=t._component;!de(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const s=n(i,!1,_d(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t};function _d(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Sd(e){return Oe(e)?document.querySelector(e):e}function Wi(e,t){return di()?(Ja(e,t),!0):!1}const qi=new WeakMap,kd=(...e)=>{var t;const n=e[0],o=(t=un())===null||t===void 0?void 0:t.proxy,i=o??di();if(i==null&&!Ps())throw new Error("injectLocal must be called in setup");return i&&qi.has(i)&&n in qi.get(i)?qi.get(i)[n]:Ft(...e)},Il=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Cd=e=>e!=null,Td=Object.prototype.toString,Pd=e=>Td.call(e)==="[object Object]",Cn=()=>{};function Md(...e){if(e.length!==1)return Cc(...e);const t=e[0];return typeof t=="function"?Dn(Qr(()=>({get:t,set:Cn}))):ee(t)}function Ol(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}const $l=e=>e();function Ed(e,t={}){let n,o,i=Cn;const r=a=>{clearTimeout(a),i(),i=Cn};let s;return a=>{const u=ht(e),c=ht(t.maxWait);return n&&r(n),u<=0||c!==void 0&&c<=0?(o&&(r(o),o=void 0),Promise.resolve(a())):new Promise((d,f)=>{i=t.rejectOnCancel?f:d,s=a,c&&!o&&(o=setTimeout(()=>{n&&r(n),o=void 0,d(s())},c)),n=setTimeout(()=>{o&&r(o),o=void 0,d(a())},u)})}}function Id(e=$l,t={}){const{initialState:n="active"}=t,o=Md(n==="active");function i(){o.value=!1}function r(){o.value=!0}const s=(...l)=>{o.value&&e(...l)};return{isActive:Dn(o),pause:i,resume:r,eventFilter:s}}function zl(e){return e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e)}function Xn(e){return Array.isArray(e)?e:[e]}function Od(e){return un()}function ct(e,t=200,n={}){return Ol(Ed(t,n),e)}function $d(e,t,n={}){const{eventFilter:o=$l,...i}=n;return ue(e,Ol(o,t),i)}function zd(e,t,n={}){const{eventFilter:o,initialState:i="active",...r}=n,{eventFilter:s,pause:l,resume:a,isActive:u}=Id(o,{initialState:i});return{stop:$d(e,t,{...r,eventFilter:s}),pause:l,resume:a,isActive:u}}const Dd=zd;function Ui(e,t=!0,n){Od()?je(e,n):t?e():gt(e)}function Ad(e,t,n){return ue(e,t,{...n,immediate:!0})}const _t=Il?window:void 0,jd=Il?window.document:void 0;function Ot(e){var t;const n=ht(e);return(t=n==null?void 0:n.$el)!==null&&t!==void 0?t:n}function St(...e){const t=[],n=()=>{t.forEach(l=>l()),t.length=0},o=(l,a,u,c)=>(l.addEventListener(a,u,c),()=>l.removeEventListener(a,u,c)),i=G(()=>{const l=Xn(ht(e[0])).filter(a=>a!=null);return l.every(a=>typeof a!="string")?l:void 0}),r=Ad(()=>{var l,a;return[(l=(a=i.value)===null||a===void 0?void 0:a.map(u=>Ot(u)))!==null&&l!==void 0?l:[_t].filter(u=>u!=null),Xn(ht(i.value?e[1]:e[0])),Xn(Z(i.value?e[2]:e[1])),ht(i.value?e[3]:e[2])]},([l,a,u,c])=>{if(n(),!(l!=null&&l.length)||!(a!=null&&a.length)||!(u!=null&&u.length))return;const d=Pd(c)?{...c}:c;t.push(...l.flatMap(f=>a.flatMap(p=>u.map(x=>o(f,p,x,d)))))},{flush:"post"}),s=()=>{r(),n()};return Wi(n),s}function Ld(){const e=pt(!1),t=un();return t&&je(()=>{e.value=!0},t),e}function Ki(e){const t=Ld();return G(()=>(t.value,!!e()))}const Bd=Symbol("vueuse-ssr-width");function Vd(){const e=Ps()?kd(Bd,null):null;return typeof e=="number"?e:void 0}function Nd(e,t={}){const{window:n=_t,ssrWidth:o=Vd()}=t,i=Ki(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),r=pt(typeof o=="number"),s=pt(),l=pt(!1),a=u=>{l.value=u.matches};return Ns(()=>{if(r.value){r.value=!i.value,l.value=ht(e).split(",").some(u=>{const c=u.includes("not all"),d=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),f=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(d||f);return d&&p&&(p=o>=zl(d[1])),f&&p&&(p=o<=zl(f[1])),c?!p:p});return}i.value&&(s.value=n.matchMedia(ht(e)),l.value=s.value.matches)}),St(s,"change",a,{passive:!0}),G(()=>l.value)}const Wo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},qo="__vueuse_ssr_handlers__",Rd=Hd();function Hd(){return qo in Wo||(Wo[qo]=Wo[qo]||{}),Wo[qo]}function Fd(e,t){return Rd[e]||t}function Wd(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const qd={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Dl="vueuse-storage";function Ud(e,t,n,o={}){var i;const{flush:r="pre",deep:s=!0,listenToStorageChanges:l=!0,writeDefaults:a=!0,mergeDefaults:u=!1,shallow:c,window:d=_t,eventFilter:f,onError:p=S=>{console.error(S)},initOnMounted:x}=o,_=(c?pt:ee)(typeof t=="function"?t():t),D=G(()=>ht(e));if(!n)try{n=Fd("getDefaultStorage",()=>_t==null?void 0:_t.localStorage)()}catch(S){p(S)}if(!n)return _;const b=ht(t),P=Wd(b),A=(i=o.serializer)!==null&&i!==void 0?i:qd[P],{pause:w,resume:g}=Dd(_,S=>Q(S),{flush:r,deep:s,eventFilter:f});ue(D,()=>T(),{flush:r});let I=!1;const q=S=>{x&&!I||T(S)},K=S=>{x&&!I||Y(S)};d&&l&&(n instanceof Storage?St(d,"storage",q,{passive:!0}):St(d,Dl,K)),x?Ui(()=>{I=!0,T()}):T();function R(S,J){if(d){const F={key:D.value,oldValue:S,newValue:J,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",F):new CustomEvent(Dl,{detail:F}))}}function Q(S){try{const J=n.getItem(D.value);if(S==null)R(J,null),n.removeItem(D.value);else{const F=A.write(S);J!==F&&(n.setItem(D.value,F),R(J,F))}}catch(J){p(J)}}function H(S){const J=S?S.newValue:n.getItem(D.value);if(J==null)return a&&b!=null&&n.setItem(D.value,A.write(b)),b;if(!S&&u){const F=A.read(J);return typeof u=="function"?u(F,b):P==="object"&&!Array.isArray(F)?{...b,...F}:F}else return typeof J!="string"?J:A.read(J)}function T(S){if(!(S&&S.storageArea!==n)){if(S&&S.key==null){_.value=b;return}if(!(S&&S.key!==D.value)){w();try{const J=A.write(_.value);(S===void 0||(S==null?void 0:S.newValue)!==J)&&(_.value=H(S))}catch(J){p(J)}finally{S?gt(g):g()}}}}function Y(S){T(S.detail)}return _}function Zi(e={}){const{document:t=jd}=e;if(!t)return pt("visible");const n=pt(t.visibilityState);return St(t,"visibilitychange",()=>{n.value=t.visibilityState},{passive:!0}),n}function Kd(e,t,n={}){const{window:o=_t,...i}=n;let r;const s=Ki(()=>o&&"ResizeObserver"in o),l=()=>{r&&(r.disconnect(),r=void 0)},a=ue(G(()=>{const c=ht(e);return Array.isArray(c)?c.map(d=>Ot(d)):[Ot(c)]}),c=>{if(l(),s.value&&o){r=new ResizeObserver(t);for(const d of c)d&&r.observe(d,i)}},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return Wi(u),{isSupported:s,stop:u}}function Al(e,t={width:0,height:0},n={}){const{window:o=_t,box:i="content-box"}=n,r=G(()=>{var d;return(d=Ot(e))===null||d===void 0||(d=d.namespaceURI)===null||d===void 0?void 0:d.includes("svg")}),s=pt(t.width),l=pt(t.height),{stop:a}=Kd(e,([d])=>{const f=i==="border-box"?d.borderBoxSize:i==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(o&&r.value){const p=Ot(e);if(p){const x=p.getBoundingClientRect();s.value=x.width,l.value=x.height}}else if(f){const p=Xn(f);s.value=p.reduce((x,{inlineSize:_})=>x+_,0),l.value=p.reduce((x,{blockSize:_})=>x+_,0)}else s.value=d.contentRect.width,l.value=d.contentRect.height},n);Ui(()=>{const d=Ot(e);d&&(s.value="offsetWidth"in d?d.offsetWidth:t.width,l.value="offsetHeight"in d?d.offsetHeight:t.height)});const u=ue(()=>Ot(e),d=>{s.value=d?t.width:0,l.value=d?t.height:0});function c(){a(),u()}return{width:s,height:l,stop:c}}function jl(e,t,n={}){const{root:o,rootMargin:i="0px",threshold:r=0,window:s=_t,immediate:l=!0}=n,a=Ki(()=>s&&"IntersectionObserver"in s),u=G(()=>Xn(ht(e)).map(Ot).filter(Cd));let c=Cn;const d=pt(l),f=a.value?ue(()=>[u.value,Ot(o),d.value],([x,_])=>{if(c(),!d.value||!x.length)return;const D=new IntersectionObserver(t,{root:Ot(_),rootMargin:i,threshold:r});x.forEach(b=>b&&D.observe(b)),c=()=>{D.disconnect(),c=Cn}},{immediate:l,flush:"post"}):Cn,p=()=>{c(),f(),d.value=!1};return Wi(p),{isSupported:a,isActive:d,pause(){c(),d.value=!1},resume(){d.value=!0},stop:p}}function Zd(e,t,n={}){const{window:o=_t}=n;return Ud(e,t,o==null?void 0:o.localStorage,n)}function hn(e={}){const{window:t=_t,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:o=Number.POSITIVE_INFINITY,listenOrientation:i=!0,includeScrollbar:r=!0,type:s="inner"}=e,l=pt(n),a=pt(o),u=()=>{if(t)if(s==="outer")l.value=t.outerWidth,a.value=t.outerHeight;else if(s==="visual"&&t.visualViewport){const{width:d,height:f,scale:p}=t.visualViewport;l.value=Math.round(d*p),a.value=Math.round(f*p)}else r?(l.value=t.innerWidth,a.value=t.innerHeight):(l.value=t.document.documentElement.clientWidth,a.value=t.document.documentElement.clientHeight)};u(),Ui(u);const c={passive:!0};return St("resize",u,c),t&&s==="visual"&&t.visualViewport&&St(t.visualViewport,"resize",u,c),i&&ue(Nd("(orientation: portrait)"),()=>u()),{width:l,height:a}}class Gn{static register(t){this.handlers.push(t)}static unregister(t){const n=this.handlers.indexOf(t);n!==-1&&this.handlers.splice(n,1)}static trigger(){for(const t of this.handlers)if(t())return!0;return!1}static clear(){this.handlers=[]}}ke(Gn,"handlers",[]);function Yi(e){je(()=>Gn.register(e)),Mt(()=>Gn.unregister(e))}const Ll=pe({__name:"HelpScreen",props:{touchDevice:{type:Boolean}},emits:["hide"],setup(e,{emit:t}){const n=e,o=t,i=ee(null),r=ee([]);Yi(()=>(o("hide"),!0)),je(async()=>{const u=Al(i),c=ct(()=>{s({width:u.width.value,height:u.height.value})},50);c(),ue(u.width,c),ue(u.height,c)});function s(u){var f;const c=(f=i.value)==null?void 0:f.parentElement;if(!c)return;const d=Array.from(c.querySelectorAll("#controls [title], #top-controls [title], #bottom-controls [title]"));d.length&&(r.value=l(d,u))}function l(u,c){const d=[],f=[];let p=0,x=0;const _=50,D=25;u.forEach(g=>{var Q;const I=(Q=g.getAttribute("title"))==null?void 0:Q.trim(),q=g.getBoundingClientRect();if(!I||!q.height||!q.width)return;const K=Math.ceil((q.top-10)/_),R=Math.ceil((q.left-10)/_);f.push({isTour:!1,title:I,rect:q,fromX:R,toX:Math.max(R+1,Math.ceil((q.right+10)/_)),fromY:K,toY:Math.max(K+1,Math.ceil((q.bottom+10)/_))})}),f.forEach(g=>{for(let I=g.fromY;I<g.toY;I++){d[I]??(d[I]=[]);for(let q=g.fromX;q<g.toX;q++)d[I][q]=g;g.toY>p+1&&(p=g.toY-1),g.toX>x+1&&(x=g.toX-1)}});let b=x/2;f.forEach(g=>{g.isAlignRight=g.fromX>b});const P=(g,I)=>{d[I]??(d[I]=[]);const q=I>=g.toY;if(g.isTour)for(let K=g.fromX;K<g.toX;K++)delete d[g.fromY][K],g.fromY=I,g.toY=I+(q?1:-1),d[I][K]=g;else{const K=g.isAlignRight?g.fromX-3:g.fromX,R=K+3;g.helpItem={fromX:K,toX:R,fromY:I,toY:I+1,isTour:!0,isAlignRight:g.isAlignRight};for(let Q=K;Q<R;Q++)d[I][Q]=g.helpItem}},A=(g,I)=>{if(I>p||I<0)return!1;const q=I>=g.toY,K=d[I];if(!K)return P(g,I),!0;const R=K[g.fromX];if(R&&!R.isTour)return!1;if(R&&R.isTour)return A(R,q?I+1:I-1)?(P(g,I),!0):!1;if(!R){const Q=g.isAlignRight?-1:1;return K[g.fromX+Q]||K[g.fromX+Q*2]?A(g,q?I+1:I-1):(P(g,I),!0)}return!1};f.forEach(g=>{if(!A(g,g.toY)){if(g.isAlignRight){const I=d[g.fromY]??[];if(!I.slice(g.fromX-3,g.fromX).filter(Boolean).length){const K=g.fromX-3,R=g.fromX;g.helpItem={isTour:!0,isAlignRight:!0,fromX:K,toX:R,fromY:g.fromY,toY:g.toY};for(let Q=g.fromX-3;Q<g.fromX;Q++)I[Q]=g.helpItem;return}}A(g,g.fromY-1)}});const w=[];return f.forEach(g=>{const{title:I,helpItem:q,rect:K,isAlignRight:R,fromX:Q,fromY:H,toY:T}=g;if(!I||!q||!K)return;const Y=q.fromY>=T,S=q.toY<=H;w.push({title:a(I),style:{top:Y?`${K.bottom+(q.fromY-T)*_+D}px`:S?void 0:`${K.top+8}px`,bottom:S?`${c.height-K.top+(q.toY-H)*_+D}px`:void 0,left:R?void 0:`${K.left}px`,right:R?Y?`${c.width-K.right}px`:`${c.width-K.right+K.width+D}px`:void 0},arrowStyle:{width:S||Y?"2px":`${Math.abs(q.toX-Q)*_+D-5}px`,height:S||Y?`${(Y?q.fromY-T:H-q.toY)*_+D}px`:"2px",top:Y?`${K.bottom}px`:S?void 0:`${K.top+20}px`,bottom:S?`${c.height-K.top}px`:void 0,left:R?void 0:`${K.left+K.width/2}px`,right:R?Y?`${c.width-K.right+K.width/2}px`:`${c.width-K.right+K.width}px`:void 0}})}),w}function a(u){return n.touchDevice?u.split("(")[0].trim():u}return(u,c)=>(v(),z(be,null,[c[1]||(c[1]=U("div",{class:"fixed inset-0 bg-black bg-opacity-90"},null,-1)),U("div",{ref_key:"root",ref:i,class:"fixed inset-0 z-20 overscroll-contain select-none",onClick:c[0]||(c[0]=Le(d=>o("hide"),["stop"]))},[(v(!0),z(be,null,Yt(r.value,d=>(v(),z(be,{key:d.title},[U("div",{class:"absolute",style:Pe(d.style)},He(d.title),5),U("div",{class:"absolute bg-stone-300 rounded-lg",style:Pe(d.arrowStyle)},null,4)],64))),128))],512)],64))}}),Yd=Object.freeze(Object.defineProperty({__proto__:null,default:Ll},Symbol.toStringTag,{value:"Module"}));function Uo(e,t){let n=null;return(...o)=>{n===null&&(n=setTimeout(()=>{n=null,e(...o)},t))}}const Xd=pe({__name:"ReaderTour",emits:["hide"],setup(e,{emit:t}){const n=t,o=ee(null),i=ee(0),r=ee([]),s=G(()=>r.value[i.value]),l=Uo(a,500);je(()=>{const d=Al(o),f=ct(()=>u({width:d.width.value,height:d.height.value}),50);f(),ue(d.width,f),ue(d.height,f)});function a(){i.value>=r.value.length-1?n("hide"):i.value++}function u(d){const f=c();r.value=f.map(({rect:p,text:x})=>{const _=p.top<d.height-p.bottom,D=p.left<d.width-p.right;return{text:x,style:{left:`${p.left}px`,top:`${p.top}px`,width:`${p.width}px`,height:`${p.height}px`},textStyle:{left:D?`${p.left-12}px`:void 0,right:D?void 0:`${d.width-p.left}px`,top:_?`${p.bottom+12}px`:`${p.top+20}px`,textAlign:_?void 0:"right",transform:_?void 0:"translateY(-50%)"}}}),i.value>=r.value.length&&(i.value=r.value.length-1)}function c(){var p;const d=(p=o.value)==null?void 0:p.parentElement;if(!d)return[];const f=[];return d.querySelectorAll("[data-tour]").forEach(x=>{var b;const _=(b=x.getAttribute("data-tour"))==null?void 0:b.trim();if(!(_!=null&&_.length))return;const D=x.getBoundingClientRect();f.push({rect:D,text:_})}),f}return(d,f)=>{var p,x;return v(),z(be,null,[U("div",{class:fe(["fixed inset-0 bg-black bg-opacity-50 duration-500",{"opacity-0":!s.value,"opacity-100":!!s.value}])},null,2),U("div",{ref_key:"root",ref:o,class:"tour",onClick:f[0]||(f[0]=Le((..._)=>Z(l)&&Z(l)(..._),["stop"]))},[s.value?(v(),z("div",{key:i.value,class:"tour__target",style:Pe(s.value.style)},null,4)):se("",!0),(v(),z("div",{key:i.value,class:"tour__text",style:Pe((p=s.value)==null?void 0:p.textStyle)},He(((x=s.value)==null?void 0:x.text)??""),5))],512)],64)}}}),Gd=".tour{height:100%;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:20}.tour__target{border-radius:9999px;border-width:2px;--tw-border-opacity:1;animation:tour-target-anim .5s forwards;border-color:rgb(120 113 108/var(--tw-border-opacity,1));box-shadow:0 0 0 99999px #000000e6}.tour__target,.tour__text{position:absolute}.tour__text{animation:tour-text-anim 1s forwards,tour-text-bounce .75s ease-in-out infinite alternate;max-width:320px;padding-left:12px;padding-right:12px;transition-duration:1s}@keyframes tour-target-anim{0%{transform:scale(3);--tw-border-opacity:0;opacity:0}to{transform:scale(1);--tw-border-opacity:1;opacity:.9}}@keyframes tour-text-anim{0%{opacity:0}to{opacity:1}}@keyframes tour-text-bounce{0%{margin-top:0}to{margin-top:.625}}",ve=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},Bl=ve(Xd,[["styles",[Gd]]]),Jd=Object.freeze(Object.defineProperty({__proto__:null,default:Bl},Symbol.toStringTag,{value:"Module"}));function Qd({touchDevice:e}){const t=ee(!1);let n=0;return Rn("busy:touchDevice",e),Rn("setBusyState",o=>{n+=o?1:-1;const i=n>0;t.value!=i&&(t.value=i)}),G(()=>t.value)}function Ko(){const e=Ft("busy:touchDevice"),t=Ft("setBusyState");let n=!1;return Mt(()=>{n&&(t==null||t(!1))}),(o,{desktopOnly:i=!1}={})=>{i&&e||(n=o,t==null||t(o))}}function ef(e){Rn("hapticFeedback",e)}function Zo(){return Ft("hapticFeedback")}class tf{constructor(){ke(this,"listeners");this.listeners=[],this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.init()}init(){window.addEventListener("keydown",this.onKeyDown,{capture:!0}),window.addEventListener("keyup",this.onKeyUp,{capture:!0}),window.addEventListener("keypress",this.onKeyPress,{capture:!0})}dispose(){window.removeEventListener("keydown",this.onKeyDown,{capture:!0}),window.removeEventListener("keyup",this.onKeyUp,{capture:!0}),window.removeEventListener("keypress",this.onKeyPress,{capture:!0})}onKeyPress(t){t.stopImmediatePropagation(),t.stopPropagation()}onKeyDown(t){var n,o;t.stopImmediatePropagation(),t.stopPropagation();for(let i=0;i<this.listeners.length&&((o=(n=this.listeners[i]).onKeyDown)==null?void 0:o.call(n,t))!==!0;i++);}onKeyUp(t){var n,o;t.stopImmediatePropagation(),t.stopPropagation();for(let i=0;i<this.listeners.length&&((o=(n=this.listeners[i]).onKeyUp)==null?void 0:o.call(n,t))!==!0;i++);}addListener(t){this.listeners.push(t)}removeListener(t){const n=this.listeners.indexOf(t);n!==-1&&this.listeners.splice(n,1)}}function nf(){const e=new tf;return Mt(()=>e.dispose()),Rn("keyController",e),e}function $t(e){const t=Ft("keyController");je(()=>t.addListener(e)),Mt(()=>t.removeListener(e))}function of(e,t){const n=sessionStorage.getItem("tk:page:path");n!==location.pathname&&(sessionStorage.setItem("tk:page:path",location.pathname),n&&sessionStorage.removeItem("tk:page"));const o=ee(t&&e>0?Math.max(0,e):+(sessionStorage.getItem("tk:page")??"0")||e);return G({get:()=>o.value,set:i=>{o.value=i,sessionStorage.setItem("tk:page",i+"")}})}function rf(){sessionStorage.removeItem("tk:page"),sessionStorage.removeItem("tk:page:path")}const sf=(e,t)=>{const n=+(e.getAttribute("data-ripple")??0);if(!n)return;const o=document.createElement("span");let i=1,r=.65;const s=setInterval(a,20);l();function l(){o.style.position="absolute",o.style.height="5px",o.style.width="5px",o.style.borderRadius="100%",o.style.backgroundColor="#f2f2f2",o.style.left=`${t.currentTarget.clientWidth/2}px`,o.style.top=`${t.currentTarget.clientHeight/2}px`,t.currentTarget.appendChild(o)}function a(){const u=+n||50;i<=u?(i++,r-=.65/u,o.style.transform=`scale(${i})`,o.style.opacity=`${r}`):(o.remove(),clearInterval(s))}},zt={mounted:(e,t)=>{e.style.position="relative",e.style.overflow="hidden",e.setAttribute("data-ripple",t.value),e.addEventListener("click",n=>sf(e,n))},updated:(e,t)=>{e.setAttribute("data-ripple",t.value)}},lf={class:"group-hover:bg-stone-100 group-hover:bg-opacity-20 transition-bg duration-200 rounđe-full p-2 w-full h-full inline-flex justify-center items-center gap-2 text-base"},Xi=pe({inheritAttrs:!1,__name:"BaseButton",props:{disabled:{type:Boolean},href:{type:String},transparent:{type:Boolean},title:{type:String},enableHapticFeedback:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=e,o=t,i=Ko(),r=Zo();let s=!1;function l(){s||(s=!0,i(!0,{desktopOnly:!0}))}function a(){s&&(s=!1,i(!1,{desktopOnly:!0}))}function u(c){n.disabled?c.preventDefault():(o("click",c),n.enableHapticFeedback&&r())}return(c,d)=>Ne((v(),oe(Pi(e.href?"a":"button"),cn({href:e.href,title:e.title},{class:["h-10 max-w-full max-h-full rounded-full flex-shrink-0 focus:outline-none outline-none",{"cursor-default opacity-60":e.disabled,"hover:text-stone-100 group duration-200":!e.disabled,"bg-black bg-opacity-50":!e.transparent,[`${c.$attrs.class??""}`]:!0}],onClick:Le(u,["stop"]),onMouseenter:l,onMouseleave:a}),{default:ne(()=>[U("div",lf,[xe(c.$slots,"default")])]),_:3},16,["class"])),[[Z(zt),e.disabled?0:15]])}}),af=Object.freeze(Object.defineProperty({__proto__:null,default:Xi},Symbol.toStringTag,{value:"Module"})),cf={},uf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function df(e,t){return v(),z("svg",uf,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M19 12.998h-6v6h-2v-6H5v-2h6v-6h2v6h6z"},null,-1)])])}const Vl=ve(cf,[["render",df]]),ff=Object.freeze(Object.defineProperty({__proto__:null,default:Vl},Symbol.toStringTag,{value:"Module"})),pf={class:"inline-flex p-6 gap-6 text-base text-stone-300 select-none"},hf={key:0,class:"inline-block rounded-full relative w-28 h-12 overflow-hidden"},gf={key:0,class:"absolute bottom-0 left-0 right-0 flex justify-center pb-7 md:pb-6 lg:pb-4"},mf={class:"flex justify-center items-center gap-1 pl-1 pr-2 h-full"},Gi=ve(pe({__name:"AutoNext",props:{hasNext:{type:Boolean},offlineMode:{type:Boolean},seconds:{type:Number},showAddButton:{type:Boolean}},emits:["next","hide","add-to-library","visibility-changed"],setup(e,{emit:t}){const n=e,o=t,i=ee(null),r=ee(null),s=ee(!1),l=ee(!1),a=ee(n.seconds),u=ee(n.seconds<=0),c=ee(n.seconds),d=Zo();je(()=>{let x;jl(r,_=>{const D=_.some(b=>b.isIntersecting);D!==l.value&&(l.value=D,o("visibility-changed",D),u.value=n.seconds<=0,a.value=n.seconds,c.value=n.seconds,x&&(clearInterval(x),x=void 0),!(!l.value||u.value)&&(x=setInterval(()=>{a.value-=1,a.value<=0&&(clearInterval(x),x=void 0,o("next"))},1e3)))}),jl(i,_=>{s.value=_.some(D=>D.isIntersecting)}),Mt(()=>x&&clearInterval(x))});function f(){o("next"),d()}function p(){o("hide")}return(x,_)=>(v(),z("div",{ref_key:"root",ref:i,class:"h-full w-full flex justify-center items-center relative"},[Ne(U("div",pf,[e.hasNext?(v(),z("div",hf,[l.value?(v(),z("div",{key:0,class:"absolute left-0 top-0 bottom-0 h-full bg-stone-600 bg-opacity-50",style:Pe(u.value?{}:{animation:`auto-next ${c.value}s linear forwards`})},null,4)):se("",!0),Ne((v(),z("button",{ref_key:"nextButton",ref:r,class:"bg-transparent rounded-full h-full w-full border-solid border-stone-600 border-2 hover:bg-stone-300 hover:bg-opacity-10 totalDuration-200",onClick:Le(f,["stop"])},[Wt(He(u.value?"Next":`Next in ${a.value}`),1)])),[[Z(zt)]])])):se("",!0),Ne((v(),z("button",{class:"rounded-full px-6 h-12 bg-transparent border-solid border-stone-600 border-2 hover:bg-stone-300 hover:bg-opacity-10 totalDuration-200",onClick:Le(p,["stop"])},[Wt(He(e.offlineMode?"Close":"Hide"),1)])),[[Z(zt)]])],512),[[pl,s.value||!e.hasNext]]),e.showAddButton?(v(),z("div",gf,[B(Xi,{class:"bg-primary w-min !h-9 !bg-opacity-100",onClick:_[0]||(_[0]=()=>o("add-to-library"))},{default:ne(()=>[U("div",mf,[B(Vl,{class:"flex-shrink-0 w-auto"}),_[1]||(_[1]=U("span",{class:"text-sm text-stone-50"},"Add to library",-1))])]),_:1})])):se("",!0)],512))}}),[["styles",[".animate-auto-next{animation:auto-next 5s linear forwards}@keyframes auto-next{0%{width:0}to{width:100%}}"]]]),vf=Object.freeze(Object.defineProperty({__proto__:null,default:Gi},Symbol.toStringTag,{value:"Module"})),Ge=pe({inheritAttrs:!1,__name:"ButtonIcon",props:{disabled:{type:Boolean},href:{type:String},title:{type:String},transparent:{type:Boolean},enableHapticFeedback:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t;return(o,i)=>(v(),oe(Xi,{class:fe(["w-10",o.$attrs.class]),disabled:e.disabled,href:e.href,title:e.title,transparent:e.transparent,"enable-haptic-feedback":e.enableHapticFeedback,onClick:i[0]||(i[0]=r=>n("click",r))},{default:ne(()=>[xe(o.$slots,"default")]),_:3},8,["class","disabled","href","title","transparent","enable-haptic-feedback"]))}}),bf=Object.freeze(Object.defineProperty({__proto__:null,default:Ge},Symbol.toStringTag,{value:"Module"})),yf={},wf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function xf(e,t){return v(),z("svg",wf,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"m10.875 19.3l-6.6-6.6q-.15-.15-.213-.325T4 12q0-.2.063-.375t.212-.325l6.6-6.6q.275-.275.688-.287t.712.287q.3.275.313.688T12.3 6.1L7.4 11h11.175q.425 0 .713.288t.287.712q0 .425-.287.713t-.713.287H7.4l4.9 4.9q.275.275.288.7t-.288.7q-.275.3-.7.3t-.725-.3Z"},null,-1)])])}const Nl=ve(yf,[["render",xf]]),_f=Object.freeze(Object.defineProperty({__proto__:null,default:Nl},Symbol.toStringTag,{value:"Module"}));var Qt=(e=>(e[e.manga=1]="manga",e[e.novel=2]="novel",e[e.anime=3]="anime",e))(Qt||{});const Ji=pe({__name:"ButtonBack",props:{offlineMode:{type:Boolean},raw:{type:null},transparent:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=e,o=t;function i(r){n.offlineMode&&(r.preventDefault(),o("click"))}return(r,s)=>{var l;return v(),oe(Ge,{href:e.offlineMode||!e.raw?"#":e.raw.title.url,title:`Back to ${((l=e.raw)==null?void 0:l.contentType)===Z(Qt).novel?"novel":"manga"}`,transparent:e.transparent,"enable-haptic-feedback":"",onClick:i},{default:ne(()=>[B(Nl)]),_:1},8,["href","title","transparent"])}}}),Sf=Object.freeze(Object.defineProperty({__proto__:null,default:Ji},Symbol.toStringTag,{value:"Module"})),kf={},Cf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Tf(e,t){return v(),z("svg",Cf,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M17.825 8.575q-.2 0-.375-.062t-.325-.213L15.7 6.875q-.3-.3-.3-.712t.3-.688q.275-.3.7-.3t.7.275l.725.725l2.825-2.85q.3-.3.7-.3t.725.3q.275.3.275.725t-.275.7l-3.55 3.55q-.15.15-.325.213t-.375.062ZM6.4 20.4q-.5.2-.95-.087T5 19.475V5q0-.825.588-1.413T7 3h7q-.5.75-.75 1.438T13 6q0 1.8 1.137 3.175T17 10.9q.575.075 1 .075t1-.075v8.575q0 .55-.45.838t-.95.087L12 18l-5.6 2.4Z"},null,-1)])])}const Rl=ve(kf,[["render",Tf]]),Pf=Object.freeze(Object.defineProperty({__proto__:null,default:Rl},Symbol.toStringTag,{value:"Module"})),Mf={},Ef={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function If(e,t){return v(),z("svg",Ef,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M6.4 20.4q-.5.2-.95-.087T5 19.475V5q0-.825.588-1.413T7 3h6v2H7v12.95l5-2.15l5 2.15V11h2v8.475q0 .55-.45.838t-.95.087L12 18l-5.6 2.4ZM7 5h6h-6Zm11 4q-.425 0-.713-.287T17 8V7h-1q-.425 0-.713-.288T15 6q0-.425.288-.713T16 5h1V4q0-.425.288-.713T18 3q.425 0 .713.288T19 4v1h1q.425 0 .713.288T21 6q0 .425-.288.713T20 7h-1v1q0 .425-.288.713T18 9Z"},null,-1)])])}const Hl=ve(Mf,[["render",If]]),Of=Object.freeze(Object.defineProperty({__proto__:null,default:Hl},Symbol.toStringTag,{value:"Module"})),Qi=pe({__name:"ButtonEntry",props:{entryId:{type:null},transparent:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t;$t({onKeyUp:i=>{i.key==="t"&&!i.metaKey&&!i.ctrlKey&&n("click")}});function o(){n("click")}return(i,r)=>(v(),oe(Ge,{transparent:e.transparent,title:e.entryId?"View entry (T)":"Add to library (T)","data-tour":"Prress here to add to your library",onClick:o},{default:ne(()=>[e.entryId?(v(),oe(Rl,{key:0})):(v(),oe(Hl,{key:1}))]),_:1},8,["transparent","title"]))}}),$f=Object.freeze(Object.defineProperty({__proto__:null,default:Qi},Symbol.toStringTag,{value:"Module"})),zf={},Df={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Af(e,t){return v(),z("svg",Df,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M16.5 16V8l-4 4l4 4ZM5 21q-.825 0-1.413-.588T3 19V5q0-.825.588-1.413T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.588 1.413T19 21H5Zm3-2V5H5v14h3Zm2 0h9V5h-9v14Zm-2 0H5h3Z"},null,-1)])])}const Fl=ve(zf,[["render",Af]]),jf=Object.freeze(Object.defineProperty({__proto__:null,default:Fl},Symbol.toStringTag,{value:"Module"})),Yo=pe({inheritAttrs:!1,__name:"ButtonHide",props:{transparent:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t;return(o,i)=>(v(),oe(Ge,{title:"Hide reader","data-tour":"You have entered reader mode, press here to return to the original page",class:fe(o.$attrs.class),transparent:e.transparent,onClick:i[0]||(i[0]=()=>n("click"))},{default:ne(()=>[B(Fl)]),_:1},8,["class","transparent"]))}}),Lf=Object.freeze(Object.defineProperty({__proto__:null,default:Yo},Symbol.toStringTag,{value:"Module"})),Bf={},Vf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function Nf(e,t){return v(),z("svg",Vf,[...t[0]||(t[0]=[U("path",{d:"M199.9 416h-63.8c-4.5 0-8.1-3.6-8.1-8V104c0-4.4 3.6-8 8.1-8h63.8c4.5 0 8.1 3.6 8.1 8v304c0 4.4-3.6 8-8.1 8z",fill:"currentColor"},null,-1),U("path",{d:"M375.9 416h-63.8c-4.5 0-8.1-3.6-8.1-8V104c0-4.4 3.6-8 8.1-8h63.8c4.5 0 8.1 3.6 8.1 8v304c0 4.4-3.6 8-8.1 8z",fill:"currentColor"},null,-1)])])}const er=ve(Bf,[["render",Nf]]),Rf=Object.freeze(Object.defineProperty({__proto__:null,default:er},Symbol.toStringTag,{value:"Module"})),Hf={},Ff={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function Wf(e,t){return v(),z("svg",Ff,[...t[0]||(t[0]=[U("path",{d:"M128 104.3v303.4c0 6.4 6.5 10.4 11.7 7.2l240.5-151.7c5.1-3.2 5.1-11.1 0-14.3L139.7 97.2c-5.2-3.3-11.7.7-11.7 7.1z",fill:"currentColor"},null,-1)])])}const tr=ve(Hf,[["render",Wf]]),qf=Object.freeze(Object.defineProperty({__proto__:null,default:tr},Symbol.toStringTag,{value:"Module"})),nr=pe({inheritAttrs:!1,__name:"ButtonPlay",props:{tourMessage:{type:String},playing:{type:Boolean},disabled:{type:Boolean},transparent:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=e,o=t;return $t({onKeyDown(i){!n.disabled&&i.key===" "&&(i.preventDefault(),o("click"))}}),(i,r)=>(v(),oe(Ge,{transparent:e.transparent,class:fe(i.$attrs.class),"data-tour":e.tourMessage,title:`${e.playing?"Pause":"Play"} (Space)`,disabled:e.disabled,onClick:r[0]||(r[0]=()=>o("click"))},{default:ne(()=>[e.playing?(v(),oe(er,{key:0})):(v(),oe(tr,{key:1}))]),_:1},8,["transparent","class","data-tour","title","disabled"]))}}),Uf=Object.freeze(Object.defineProperty({__proto__:null,default:nr},Symbol.toStringTag,{value:"Module"})),Kf={},Zf={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"};function Yf(e,t){return v(),z("svg",Zf,[...t[0]||(t[0]=[U("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[U("circle",{cx:"14",cy:"14",r:"12"}),U("path",{d:"m23 23l7 7M9 12V9h3m4 0h3v3M9 16v3h3m7-3v3h-3"})],-1)])])}const Wl=ve(Kf,[["render",Yf]]),Xf=Object.freeze(Object.defineProperty({__proto__:null,default:Wl},Symbol.toStringTag,{value:"Module"})),Gf={class:"block w-4 h-4"},Jf={class:"w-12"},ql=pe({__name:"ButtonResetZoom",props:{zoom:{type:Number}},emits:["click"],setup(e,{emit:t}){const n=t;function o(i){n("click",i)}return(i,r)=>(v(),z("button",{class:"h-9 rounded-full inline-flex justify-between items-center bg-black bg-opacity-50 gap-1 py-2 px-3 pointer-events-auto hover:bg-stone-900 hover:bg-opacity-50 duration-200",title:"Reset zoom",onClick:Le(o,["stop"])},[U("div",Gf,[B(Wl)]),U("div",Jf,He(Math.ceil(e.zoom*100))+"%",1)]))}}),Qf=Object.freeze(Object.defineProperty({__proto__:null,default:ql},Symbol.toStringTag,{value:"Module"})),ep={},tp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 36 36"};function np(e,t){return v(),z("svg",tp,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"m32.57 15.72l-3.35-1a11.65 11.65 0 0 0-.95-2.33l1.64-3.07a.61.61 0 0 0-.11-.72l-2.39-2.4a.61.61 0 0 0-.72-.11l-3.05 1.63a11.62 11.62 0 0 0-2.36-1l-1-3.31a.61.61 0 0 0-.59-.41h-3.38a.61.61 0 0 0-.58.43l-1 3.3a11.63 11.63 0 0 0-2.38 1l-3-1.62a.61.61 0 0 0-.72.11L6.2 8.59a.61.61 0 0 0-.11.72l1.62 3a11.63 11.63 0 0 0-1 2.37l-3.31 1a.61.61 0 0 0-.43.58v3.38a.61.61 0 0 0 .43.58l3.33 1a11.62 11.62 0 0 0 1 2.33l-1.64 3.14a.61.61 0 0 0 .11.72l2.39 2.39a.61.61 0 0 0 .72.11l3.09-1.65a11.65 11.65 0 0 0 2.3.94l1 3.37a.61.61 0 0 0 .58.43h3.38a.61.61 0 0 0 .58-.43l1-3.38a11.63 11.63 0 0 0 2.28-.94l3.11 1.66a.61.61 0 0 0 .72-.11l2.39-2.39a.61.61 0 0 0 .11-.72l-1.66-3.1a11.63 11.63 0 0 0 .95-2.29l3.37-1a.61.61 0 0 0 .43-.58v-3.41a.61.61 0 0 0-.37-.59ZM18 23.5a5.5 5.5 0 1 1 5.5-5.5a5.5 5.5 0 0 1-5.5 5.5Z",class:"clr-i-solid clr-i-solid-path-1"},null,-1),U("path",{fill:"none",d:"M0 0h36v36H0z"},null,-1)])])}const Ul=ve(ep,[["render",np]]),op=Object.freeze(Object.defineProperty({__proto__:null,default:Ul},Symbol.toStringTag,{value:"Module"})),or=pe({__name:"ButtonSettings",props:{disabled:{type:Boolean},transparent:{type:Boolean}},emits:["click"],setup(e,{emit:t}){const n=t;return $t({onKeyUp:o=>{o.key==="s"&&!o.metaKey&&!o.ctrlKey&&n("click")}}),(o,i)=>(v(),oe(Ge,{transparent:e.transparent,title:"Reader preferences (S)",disabled:e.disabled,onClick:i[0]||(i[0]=()=>n("click"))},{default:ne(()=>[B(Ul)]),_:1},8,["transparent","disabled"]))}}),ip=Object.freeze(Object.defineProperty({__proto__:null,default:or},Symbol.toStringTag,{value:"Module"})),rp={},sp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function lp(e,t){return v(),z("svg",sp,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M4 4h6v2H6v4H4V4Zm10 0h6v6h-2V6h-4V4ZM6 14v4h4v2H4v-6h2Zm14 0v6h-6v-2h4v-4h2Z"},null,-1)])])}const Kl=ve(rp,[["render",lp]]),ap=Object.freeze(Object.defineProperty({__proto__:null,default:Kl},Symbol.toStringTag,{value:"Module"})),cp={},up={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function dp(e,t){return v(),z("svg",up,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M14 20v-6h6v2h-4v4h-2Zm-6 0v-4H4v-2h6v6H8Zm12-10h-6V4h2v4h4v2Zm-10 0H4V8h4V4h2v6Z"},null,-1)])])}const Zl=ve(cp,[["render",dp]]),fp=Object.freeze(Object.defineProperty({__proto__:null,default:Zl},Symbol.toStringTag,{value:"Module"})),ir=pe({__name:"ButtonWebFullScreen",props:{transparent:{type:Boolean}},emits:["request-full-screen"],setup(e,{emit:t}){const n=t,o=ee(!1);$t({onKeyUp:r=>{r.key==="f"&&!r.metaKey&&!r.ctrlKey&&i()}}),St("fullscreenchange",()=>{o.value=!!document.fullscreenElement});function i(){document.fullscreenElement?document.exitFullscreen():n("request-full-screen")}return(r,s)=>(v(),oe(Ge,{transparent:e.transparent,title:`${o.value?"Exit":"Enter"} fullscreen (F)`,onClick:i},{default:ne(()=>[o.value?(v(),oe(Zl,{key:0})):(v(),oe(Kl,{key:1}))]),_:1},8,["transparent","title"]))}}),pp=Object.freeze(Object.defineProperty({__proto__:null,default:ir},Symbol.toStringTag,{value:"Module"}));async function gn(e,t,n){const o=await n(()=>{e=0});if(o!==void 0)return o;if(!(e<=0))return await new Promise(i=>{setTimeout(async()=>{const r=await gn(e-1,t,n);i(r)},t)})}const hp=["aria-hidden"],gp=["onClick"],Yl=pe({__name:"DropdownMenu",props:Ye({items:{type:Array},enableHapticFeedback:{type:Boolean}},{modelValue:{type:Number,required:!1},modelModifiers:{}}),emits:Ye(["select"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=lt(e,"modelValue"),r=ee(null),s=ee(!1),l=ee(!1),a=ee(!1),u=ee(!1),c={mounted:w=>{var g;i.value&&((g=w.children[i.value])==null||g.scrollIntoView({behavior:"auto",block:"center",inline:"center"}))}};$t({onKeyDown:D}),Yi(()=>{const w=s.value;return w&&(s.value=!1),w});const d=Ko(),f=Zo();async function p(w){s.value=w??!s.value,d(s.value),s.value?(x(),P(r.value)):setTimeout(A,250)}function x(){const w=r.value;if(w){const g=w.getBoundingClientRect(),I=g.x+g.width/2;l.value=g.y>window.innerHeight/2,a.value=I<window.innerWidth/3,u.value=I>window.innerWidth/3*2}}function _(w,g){p(),w!=i.value&&(i.value=w,o("select",w,g),n.enableHapticFeedback&&f())}function D(w){s.value&&w.key==="Escape"&&(p(),w.preventDefault())}let b=[];function P(w){const g=window.getComputedStyle(w).zIndex,I=w.style.zIndex;(!g||!(+g>0))&&((!w.parentElement||w.parentElement.childElementCount>1)&&(w.style.zIndex="1",b.push({el:w,zIndex:I})),w.parentElement&&P(w.parentElement))}function A(){b.forEach(({el:w,zIndex:g})=>{w.style.zIndex=g??""}),b=[]}return(w,g)=>(v(),z("div",{ref_key:"root",ref:r,class:"select-none relative inline-flex"},[s.value?(v(),z("div",{key:0,class:"fixed inset-0 bg-transparent",onClick:g[0]||(g[0]=()=>p())})):se("",!0),e.items.length?(v(),oe(Vo,{key:1,name:"slide-fade","enter-from-class":"scale-y-90 opacity-0 pointer-events-none","leave-to-class":"scale-y-90 opacity-0 pointer-events-none"},{default:ne(()=>[s.value?Ne((v(),z("ul",{key:0,ref:"list","aria-hidden":!s.value,class:fe(["scrollbar-sm duration-150 delay-50 absolute w-40 max-h-[70vh] list-none bg-stone-800 bg-opacity-80 backdrop-blur-md rounded-lg overflow-auto",{"origin-bottom bottom-full -translate-y-1.5":l.value,"origin-top top-full translate-y-1.5":!l.value,"left-1/2 -ml-20 text-center":!a.value&&!u.value,"right-0 text-right":u.value}]),onWheelPassive:g[1]||(g[1]=Le(()=>{},["stop"])),onTouchmove:g[2]||(g[2]=Le(()=>{},["stop"]))},[(v(!0),z(be,null,Yt(e.items,(I,q)=>Ne((v(),z("li",{key:q,tabindex:"-1",class:fe(["h-10 px-4 last:border-b-transparent cursor-pointer hover:bg-stone-100 hover:bg-opacity-10 duration-100",{"text-textPrimary":q===i.value}]),onClick:K=>_(q,K)},[U("div",{class:fe(["h-full py-2",{"border-t-[1px] border-solid border-stone-400 border-opacity-30":q>0}])},[xe(w.$slots,"item",{item:I},()=>[Wt(He(I),1)])],2)],10,gp)),[[Z(zt),30]])),128))],42,hp)),[[c]]):se("",!0)]),_:3})):se("",!0),xe(w.$slots,"default",{toggle:p,isOpen:s.value,isAlignTop:l.value})],512))}}),mp=Object.freeze(Object.defineProperty({__proto__:null,default:Yl},Symbol.toStringTag,{value:"Module"})),vp={},bp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function yp(e,t){return v(),z("svg",bp,[...t[0]||(t[0]=[Ou('<circle cx="18" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".67" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="12" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin=".33" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle><circle cx="6" cy="12" r="0" fill="currentColor"><animate attributeName="r" begin="0" calcMode="spline" dur="1.5s" keySplines="0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8" repeatCount="indefinite" values="0;2;0;0"></animate></circle>',3)])])}const Xl=ve(vp,[["render",yp]]),wp=Object.freeze(Object.defineProperty({__proto__:null,default:Xl},Symbol.toStringTag,{value:"Module"})),xp={},_p={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Sp(e,t){return v(),z("svg",_p,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"m7 10l5 5l5-5z"},null,-1)])])}const Gl=ve(xp,[["render",Sp]]),kp=Object.freeze(Object.defineProperty({__proto__:null,default:Gl},Symbol.toStringTag,{value:"Module"})),Cp=["onClick"],Tp={class:"inline-flex items-center justify-center w-full h-full px-4 rounded-full group-hover:bg-stone-100 group-hover:bg-opacity-20 duration-200"},Pp={class:"whitespace-nowrap"},rr=pe({__name:"ButtonDropdown",props:Ye({label:{type:String},title:{type:String},items:{type:Array},disabled:{type:Boolean},canLoadItems:{type:Boolean},loadItems:{type:Function},enableHapticFeedback:{type:Boolean},transparent:{type:Boolean}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:Ye(["select"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=lt(e,"modelValue"),r=ee(!1),s=Ko();async function l(f,p){if(!n.items.length&&(f||await a(),!n.items.length)){p(!1);return}p()}async function a(){r.value||n.items.length||!n.canLoadItems||!n.loadItems||(r.value=!0,await n.loadItems(),r.value=!1)}let u=!1;function c(){u||(u=!0,s(!0,{desktopOnly:!0}))}function d(){u&&(u=!1,s(!1,{desktopOnly:!0}))}return(f,p)=>(v(),oe(Yl,{modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=x=>i.value=x),items:e.items,"enable-haptic-feedback":e.enableHapticFeedback,onSelect:p[1]||(p[1]=(x,_)=>o("select",x,_))},Mi({default:ne(({toggle:x,isOpen:_,isAlignTop:D})=>[Ne((v(),z("button",cn({type:"button",tabindex:"-1",class:["w-full h-10 max-h-full rounded-full group duration-100 transition-bg",{"pointer-events-none opacity-60":e.disabled||r.value,"bg-black bg-opacity-50":!e.transparent,"bg-transparent":e.transparent}]},e.title?{title:e.title}:{},{onClick:Le(()=>l(_,x),["stop"]),onMouseenter:c,onMouseleave:d}),[U("div",Tp,[U("span",Pp,He(e.label),1),e.items.length||e.canLoadItems?(v(),z("span",{key:0,class:fe(["w-4 h-4 flex ml-1 -mr-3 flex-shrink-0",{"rotate-180":D}]),"aria-hidden":"true"},[r.value?(v(),oe(Xl,{key:0})):(v(),oe(Gl,{key:1}))],2)):se("",!0)])],16,Cp)),[[Z(zt),30]])]),_:2},[f.$slots.item?{name:"item",fn:ne(({item:x})=>[xe(f.$slots,"item",{item:x})]),key:"0"}:void 0]),1032,["modelValue","items","enable-haptic-feedback"]))}}),Mp=Object.freeze(Object.defineProperty({__proto__:null,default:rr},Symbol.toStringTag,{value:"Module"})),Ep={},Ip={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Op(e,t){return v(),z("svg",Ip,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M15.41 7.41L14 6l-6 6l6 6l1.41-1.41L10.83 12z"},null,-1)])])}const Jl=ve(Ep,[["render",Op]]),$p=Object.freeze(Object.defineProperty({__proto__:null,default:Jl},Symbol.toStringTag,{value:"Module"})),zp={},Dp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Ap(e,t){return v(),z("svg",Dp,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M10 6L8.59 7.41L13.17 12l-4.58 4.59L10 18l6-6z"},null,-1)])])}const Ql=ve(zp,[["render",Ap]]),jp=Object.freeze(Object.defineProperty({__proto__:null,default:Ql},Symbol.toStringTag,{value:"Module"})),Lp={key:0,class:"ml-auto inline-flex gap-[1px] scale-95 origin-right"},sr=pe({__name:"ChapterNav",props:{data:{type:Object},chapterSpec:{type:Object},touchDevice:{type:Boolean},rtl:{type:Boolean},transparent:{type:Boolean}},emits:["getHiddenChapters","prev","next"],setup(e,{emit:t}){const n=e,o=t;async function i(){const c=n.chapterSpec;if(!c)return;const{trigger:d,sel:f,label:p}=c;if(d&&(!f||!p)){await r(d);return}o("getHiddenChapters"),await gn(50,50,()=>n.data.chapters.length?!0:void 0)}async function r(c){const d=document.querySelector(c);d&&(d instanceof HTMLDialogElement?d.showModal():d.click())}function s(c,d){var f,p,x;(x=(p=(f=n.data)==null?void 0:f.chapters)==null?void 0:p[c])==null||x.select(u(d))}function l(c){n.rtl?o("next",u(c)):o("prev",u(c))}function a(c){n.rtl?o("prev",u(c)):o("next",u(c))}function u(c){return!n.touchDevice&&(c.ctrlKey||c.metaKey)}return(c,d)=>{var f;return v(),z(be,null,[B(rr,{modelValue:e.data.activeIndex,label:e.data.activeLabel,title:"Select chapter",transparent:e.transparent,items:e.data.chapters,"can-load-items":!!((f=e.chapterSpec)!=null&&f.trigger),"load-items":i,"enable-haptic-feedback":"",onSelect:s},{item:ne(({item:p})=>[Wt(He(p.label),1)]),_:1},8,["modelValue","label","transparent","items","can-load-items"]),e.data.next||e.data.prev?(v(),z("div",Lp,[B(Ge,{title:`${e.rtl?"Next":"Prev"} chapter (←)`,disabled:e.rtl?!e.data.next:!e.data.prev,transparent:e.transparent,class:"!rounded-r-none","enable-haptic-feedback":"",onClick:l},{default:ne(()=>[B(Jl)]),_:1},8,["title","disabled","transparent"]),B(Ge,{title:`${e.rtl?"Prev":"Next"} chapter (→)`,disabled:e.rtl?!e.data.prev:!e.data.next,transparent:e.transparent,class:"!rounded-l-none","enable-haptic-feedback":"",onClick:a},{default:ne(()=>[B(Ql)]),_:1},8,["title","disabled","transparent"])])):se("",!0)],64)}}}),Bp=Object.freeze(Object.defineProperty({__proto__:null,default:sr},Symbol.toStringTag,{value:"Module"})),Vp=["min","max","step"],Np={class:"flex-shrink-0 w-12 inline-block text-right"},en=ve(pe({__name:"InputPercentage",props:Ye({min:{type:Number},max:{type:Number},step:{type:Number},format:{type:Function}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=lt(e,"modelValue"),n=G({get(){return t.value},set(o){t.value=+o}});return(o,i)=>{var r;return v(),z("div",{class:"flex items-center gap-3 pl-1",style:Pe({"--percentage":`${(n.value-e.min)/(e.max-e.min)*100}%`})},[Ne(U("input",{"onUpdate:modelValue":i[0]||(i[0]=s=>n.value=s),type:"range",min:e.min,max:e.max,step:e.step??1,class:"flex-grow",onTouchmove:i[1]||(i[1]=Le(()=>{},["stop"]))},null,40,Vp),[[hd,n.value]]),U("span",Np,He(((r=e.format)==null?void 0:r.call(e,t.value))??t.value),1)],4)}}}),[["styles",["input[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(to right,#fb8252 var(--percentage),#5a5552 var(--percentage));border-radius:9999px;border-style:none;cursor:pointer;height:4px;opacity:.9;pointer-events:none;--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1));outline:2px solid transparent;outline-offset:2px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none!important;border-radius:9999px;border-style:solid;border-width:2px;cursor:pointer;height:24px;pointer-events:auto;width:24px;--tw-border-opacity:1;border-color:rgb(251 130 82/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1));transition-duration:.2s}input[type=range]:hover{opacity:1}"]]]),Rp=Object.freeze(Object.defineProperty({__proto__:null,default:en},Symbol.toStringTag,{value:"Module"})),Hp={ref:"root",class:"flex text-sm flex-wrap gap-2 leading-none"},Fp=["onClick","onKeyup"],vt=pe({__name:"InputSelect",props:Ye({items:{type:Array}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=lt(e,"modelValue");function o(i){i!==n.value&&(n.value=i)}return(i,r)=>(v(),z("div",Hp,[(v(!0),z(be,null,Yt(t.items,(s,l)=>Ne((v(),z("div",{key:l,tabindex:"0",class:fe(["inline-flex justify-center items-center rounded-full px-3 py-1.5 cursor-pointer z-10 whitespace-nowrap flex-shrink-0 focus:outline-primary hover:bg-opacity-80 duration-200",{"bg-primary":l==n.value,"bg-stone-600 bg-opacity-50":l!=n.value}]),onClick:()=>o(l),onKeyup:[Fo(()=>o(l),["enter"]),Fo(()=>o(l),["space"])]},[Wt(He(s),1)],42,Fp)),[[Z(zt),30]])),128))],512))}}),Wp=Object.freeze(Object.defineProperty({__proto__:null,default:vt},Symbol.toStringTag,{value:"Module"})),qp={class:"flex w-full items-center justify-between cursor-pointer mb-5 last:mb-0"},Up={class:"text-sm py-1"},Kp={class:"switcher p-1"},lr=ve(pe({__name:"InputSwitcher",props:Ye({label:{type:String}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=lt(e,"modelValue");return(n,o)=>(v(),z("label",qp,[U("span",Up,He(e.label),1),U("div",Kp,[Ne(U("input",{"onUpdate:modelValue":o[0]||(o[0]=i=>t.value=i),type:"checkbox"},null,512),[[gd,t.value]]),o[1]||(o[1]=U("span",null,null,-1))])]))}}),[["styles",['.switcher{height:24px;position:relative;width:40px}.switcher input{height:0;opacity:0;width:0}.switcher input:checked+span{border-width:1px;--tw-border-opacity:1;border-color:rgb(184 92 56/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(184 92 56/var(--tw-bg-opacity,1))}.switcher input:checked+span:before{bottom:2px;height:18px;left:17.2px;width:18px}.switcher span{border-radius:9999px;border-width:2px;top:0;right:0;bottom:0;left:0;--tw-border-opacity:1;background-color:transparent;border-color:rgb(231 229 228/var(--tw-border-opacity,1))}.switcher span,.switcher span:before{position:absolute;transition-duration:.3s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.switcher span:before{border-radius:9999px;bottom:4px;content:"";height:12px;left:4px;width:12px;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}']]]),Zp=Object.freeze(Object.defineProperty({__proto__:null,default:lr},Symbol.toStringTag,{value:"Module"})),Yp={class:"flex-grow mb-5 last:mb-0"},Ae=pe({__name:"TableField",props:{label:{type:String},disabled:{type:Boolean}},setup(e){return(t,n)=>(v(),z(be,null,[U("div",{class:fe(["flex-shrink-0 mb-2 whitespace-nowrap text-sm",{"opacity-50":e.disabled}])},He(e.label),3),U("div",Yp,[xe(t.$slots,"default")])],64))}}),Xp=Object.freeze(Object.defineProperty({__proto__:null,default:Ae},Symbol.toStringTag,{value:"Module"})),ea=pe({__name:"FieldContrast",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=lt(e,"modelValue"),n=G({get(){return Math.round(t.value*100)},set(o){t.value=Math.round(o)/100}});return(o,i)=>(v(),oe(Ae,{label:"Contrast"},{default:ne(()=>[B(en,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),min:20,max:100,format:r=>`${r}%`},null,8,["modelValue","format"])]),_:1}))}}),Gp=Object.freeze(Object.defineProperty({__proto__:null,default:ea},Symbol.toStringTag,{value:"Module"})),Jp={},Qp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function eh(e,t){return v(),z("svg",Qp,[...t[0]||(t[0]=[U("path",{d:"M480 358.856V153.143C480 130.512 461.674 112 439.272 112H72.728C50.326 112 32 130.512 32 153.143v205.713C32 381.488 50.326 400 72.728 400h366.545C461.674 400 480 381.488 480 358.856zM112 364V148h288v216H112z",fill:"currentColor"},null,-1)])])}const ta=ve(Jp,[["render",eh]]),th=Object.freeze(Object.defineProperty({__proto__:null,default:ta},Symbol.toStringTag,{value:"Module"})),nh={},oh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function ih(e,t){return v(),z("svg",oh,[...t[0]||(t[0]=[U("path",{d:"M358.856 32H153.143C130.512 32 112 50.326 112 72.728v366.545C112 461.674 130.512 480 153.143 480h205.713C381.488 480 400 461.674 400 439.272V72.728C400 50.326 381.488 32 358.856 32zM364 400H148V112h216v288z",fill:"currentColor"},null,-1)])])}const na=ve(nh,[["render",ih]]),rh=Object.freeze(Object.defineProperty({__proto__:null,default:na},Symbol.toStringTag,{value:"Module"})),ar=pe({inheritAttrs:!1,__name:"ButtonOutline",emits:["click"],setup(e,{emit:t}){const n=t,o=Zo();function i(){o(),n("click")}return(r,s)=>Ne((v(),z("button",{class:fe([r.$attrs.class??"","flex focus:outline-none outline-none rounded-full h-10 justify-center items-center border border-solid border-stone-600 text-stone-200 hover:bg-stone-500 hover:bg-opacity-10 duration-200"]),onClick:i},[xe(r.$slots,"default")],2)),[[Z(zt),24]])}}),sh=Object.freeze(Object.defineProperty({__proto__:null,default:ar},Symbol.toStringTag,{value:"Module"}));var tn=(e=>(e[e.never=0]="never",e[e.move=1]="move",e[e.firstMove=2]="firstMove",e[e.onLoad=3]="onLoad",e))(tn||{}),nt=(e=>(e[e.vertical=0]="vertical",e[e.ltr=1]="ltr",e[e.rtl=2]="rtl",e))(nt||{});const cr=[{name:"System",value:"system-ui, sans-serif"},{name:"Charter",value:'Charter, "Times New Roman", serif'},{name:"Georgia",value:"Georgia, serif"}],oa=pe({__name:"FieldFontFamily",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=lt(e,"modelValue"),n=G({get(){const o=cr.findIndex(i=>i.value===t.value);return o===-1?0:o},set(o){t.value=cr[o].value}});return(o,i)=>(v(),oe(Ae,{label:"Font family"},{default:ne(()=>[B(vt,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r),items:Z(cr).map(r=>r.name)},null,8,["modelValue","items"])]),_:1}))}}),lh=Object.freeze(Object.defineProperty({__proto__:null,default:oa},Symbol.toStringTag,{value:"Module"}));function ah(e){if(e)try{return JSON.parse(e)}catch{return}}function ch(){const{width:e,height:t}=hn();return G(()=>e.value>t.value)}function ia(e){return String(e).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").trim().toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}var Dt=(e=>(e[e.longStrip=0]="longStrip",e[e.single=1]="single",e[e.double=2]="double",e))(Dt||{});const Xo=.25,Go=5,ur=.25,Jo=.2,Qo=5,uh=.05,dh=0,fh=5;function ph(e){var g,I,q,K,R,Q;const n=e.touchDevice&&(window.innerHeight<=600||window.innerWidth<=600)?ch():void 0,{titleName:o,isWebtoon:i}=e,r=o?ia(o):location.hostname,s=ee(hh(`tkr:${r}`)),l=H=>{s.value=H;const T=`tkr:${r}`;!H||!Object.keys(H).length?localStorage.removeItem(T):localStorage.setItem(T,JSON.stringify(H))},a=H=>{if(!s.value){l(H);return}const T={...s.value};Object.entries(H).forEach(([Y,S])=>{S===void 0?delete T[Y]:T[Y]=S}),l(T)},u=ee((g=s.value)==null?void 0:g.style),c=ee((I=s.value)==null?void 0:I.direction),d=ee((q=s.value)==null?void 0:q.gap),f=ee((K=s.value)==null?void 0:K.speed),p=ee((R=s.value)==null?void 0:R.zoom),x=ee(((Q=s.value)==null?void 0:Q.breakFirst)??!1),_=G({get(){if(i.value)return Dt.longStrip;if(u.value!==void 0)return u.value;const{landscapeStyle:H,readerStyle:T}=e.defaultPreferences.value;return n!=null&&n.value?H??T:T},set:H=>{if(u.value===H)return;const T=_.value===Dt.longStrip,Y=H===Dt.longStrip;u.value=H,a({style:H}),T!==Y&&(D.value=Y?nt.vertical:nt.rtl)}}),D=G({get(){if(i.value)return nt.vertical;if(c.value!==void 0)return c.value;const{direction:H,landscapeDirection:T}=e.defaultPreferences.value;return n!=null&&n.value?T??H:H},set:H=>{c.value=H,a({direction:H})}}),b=G({get:()=>d.value??e.defaultPreferences.value.gap,set(H){d.value=H,a({gap:H})}}),P=G({get:()=>f.value??e.defaultPreferences.value.speed,set(H){f.value=H,a({speed:H===1?void 0:H})}}),A=G({get:()=>p.value??1,set(H){p.value=H,a({zoom:H===1?void 0:H})}}),w=G({get:()=>x.value,set(H){x.value=H,a({breakFirst:H?!0:void 0})}});return{direction:D,style:_,gap:b,speed:P,zoom:A,isLongStrip:G(()=>_.value===Dt.longStrip),isDouble:G(()=>_.value===Dt.double),isRTL:G(()=>D.value===nt.rtl),isVertical:G(()=>D.value===nt.vertical),breakFirst:w}}function hh(e){const t=localStorage.getItem(e),n=ah(t||void 0),o={};return n?(n.style!==void 0&&Object.values(Dt).includes(n.style)&&(o.style=n.style),n.direction!==void 0&&Object.values(nt).includes(n.direction)&&(o.direction=n.direction),n.gap!==void 0&&n.gap>=dh&&n.gap<=fh&&(o.gap=n.gap),n.speed!==void 0&&n.speed>=Xo&&n.speed<=Go&&(o.speed=n.speed),n.zoom!==void 0&&n.zoom>=Jo&&n.zoom<=Qo&&(o.zoom=n.zoom),n.breakFirst===!0&&(o.breakFirst=!0),Object.keys(o).length?o:void 0):o}const dr=pe({__name:"NovelPreferencesForm",props:Ye({enableReset:{type:Boolean},defaultPreferences:{type:Object}},{modelValue:{required:!0},modelModifiers:{}}),emits:Ye(["reset"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=lt(e,"modelValue"),r=G(()=>Object.keys(i.value).some(l=>{var a;return i.value[l]!==((a=n.defaultPreferences)==null?void 0:a[l])}));function s(l){i.value={...i.value,...l}}return(l,a)=>(v(),z(be,null,[B(oa,{"model-value":i.value.fontFamily,"onUpdate:modelValue":a[0]||(a[0]=u=>s({fontFamily:u}))},null,8,["model-value"]),B(Ae,{label:"Text size"},{default:ne(()=>[B(en,{"model-value":i.value.fontSize,min:10,max:48,"onUpdate:modelValue":a[1]||(a[1]=u=>s({fontSize:u,lineHeight:Math.max(i.value.lineHeight,u)}))},null,8,["model-value"])]),_:1}),B(Ae,{label:"Line height"},{default:ne(()=>[B(en,{"model-value":i.value.lineHeight,min:10,max:96,step:1,"onUpdate:modelValue":a[2]||(a[2]=u=>s({lineHeight:u,fontSize:Math.min(i.value.fontSize,u)}))},null,8,["model-value"])]),_:1}),B(Ae,{label:"Play speed"},{default:ne(()=>[B(en,{"model-value":i.value.speed,min:Z(Xo),max:Z(Go),step:Z(ur),format:u=>`${u.toFixed(2)}x`,"onUpdate:modelValue":a[3]||(a[3]=u=>s({speed:u}))},null,8,["model-value","min","max","step","format"])]),_:1}),e.enableReset?(v(),z("div",{key:0,class:fe(["w-full flex justify-center pt-1 duration-200",{"pointer-events-none opacity-0":!r.value,"opacity-90":r.value}])},[B(ar,{class:"w-2/3",onClick:a[4]||(a[4]=()=>o("reset"))},{default:ne(()=>[...a[5]||(a[5]=[Wt(" Reset to default ",-1)])]),_:1})],2)):se("",!0)],64))}}),gh=Object.freeze(Object.defineProperty({__proto__:null,default:dr},Symbol.toStringTag,{value:"Module"})),mh={key:1,class:"mb-3 border-stone-500 border-opacity-70"},vh={key:2,class:"flex justify-end"},bh={class:"h-6 border border-stone-500 rounded-md cursor-pointer flex items-center"},yh={key:3,class:"mt-5 mb-3 border-stone-500 border-opacity-70"},fr=pe({__name:"DefaultPreferencesForm",props:Ye({touchDevice:{type:Boolean},isNovel:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=lt(e,"modelValue"),o=ee(!1),i=ee(!1);je(()=>{o.value=t.touchDevice&&(window.innerHeight<=600||window.innerWidth<=600)});function r(l){const a=i.value,c=(a?n.value.landscapeStyle??n.value.readerStyle:n.value.readerStyle)!==Dt.longStrip,d=l!==Dt.longStrip;if(c===d)s(a?{landscapeStyle:l}:{readerStyle:l});else{const f=d?nt.rtl:nt.vertical;s(a?{landscapeStyle:l,landscapeDirection:f}:{readerStyle:l,direction:f})}}function s(l){n.value={...n.value,...l}}return(l,a)=>(v(),z(be,null,[e.isNovel?(v(),z(be,{key:0},[B(dr,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=u=>n.value=u)},null,8,["modelValue"]),B(ea,{"model-value":n.value.contrast,"onUpdate:modelValue":a[1]||(a[1]=u=>s({contrast:u}))},null,8,["model-value"])],64)):(v(),z(be,{key:1},[B(lr,{"model-value":n.value.autoPlay===!0,label:"Auto play in long strip","onUpdate:modelValue":a[2]||(a[2]=u=>s({autoPlay:u}))},null,8,["model-value"]),e.touchDevice?(v(),oe(lr,{key:0,"model-value":n.value.pinchToZoom!==!1,label:"Pinch to zoom","onUpdate:modelValue":a[3]||(a[3]=u=>s({pinchToZoom:u}))},null,8,["model-value"])):se("",!0),o.value?(v(),z("hr",mh)):se("",!0),o.value?(v(),z("div",vh,[U("div",bh,[Ne((v(),z("button",{class:fe(["focus:outline-none outline-none h-full flex justify-center items-center px-3 py-0.5 rounded-l-sm",{"bg-stone-500 text-stone-50":!i.value,"text-stone-400":i.value}]),onClick:a[4]||(a[4]=()=>i.value=!1)},[B(na)],2)),[[Z(zt),24]]),Ne((v(),z("button",{class:fe(["focus:outline-none outline-none h-full flex justify-center items-center px-3 py-0.5 rounded-r-sm",{"bg-stone-500 text-stone-50":i.value,"text-stone-400":!i.value}]),onClick:a[5]||(a[5]=()=>i.value=!0)},[B(ta)],2)),[[Z(zt),24]])])])):se("",!0),B(Ae,{label:"Style"},{default:ne(()=>[B(vt,{"model-value":i.value?n.value.landscapeStyle??n.value.readerStyle:n.value.readerStyle,items:["Long strip","Single page","Double page"],"onUpdate:modelValue":r},null,8,["model-value"])]),_:1}),B(Ae,{label:"Direction"},{default:ne(()=>[B(vt,{"model-value":i.value?n.value.landscapeDirection??n.value.direction:n.value.direction,items:["Vertical","Left to right","Right to left"],"onUpdate:modelValue":a[6]||(a[6]=u=>s(i.value?{landscapeDirection:u}:{direction:u}))},null,8,["model-value"])]),_:1}),o.value?(v(),z("hr",yh)):se("",!0),B(Ae,{label:"Gap size"},{default:ne(()=>[B(vt,{"model-value":n.value.gap,items:["None","1px","2px","3px","4px","5px"],"onUpdate:modelValue":a[7]||(a[7]=u=>s({gap:u}))},null,8,["model-value"])]),_:1})],64)),B(Ae,{label:"Progress size"},{default:ne(()=>[B(vt,{"model-value":n.value.progressSize/2,items:["None","2px","4px","6px","8px","10px"],"onUpdate:modelValue":a[8]||(a[8]=u=>s({progressSize:u*2}))},null,8,["model-value"])]),_:1}),B(Ae,{label:"Auto next"},{default:ne(()=>[B(vt,{"model-value":n.value.autoNextSeconds,items:["None","1 sec","2 sec","3 sec","4 sec","5 sec"],"onUpdate:modelValue":a[9]||(a[9]=u=>s({autoNextSeconds:u}))},null,8,["model-value"])]),_:1}),B(Ae,{label:"Hide controls"},{default:ne(()=>[B(vt,{"model-value":n.value.hideControlsEvent,items:["Never","On move","On first move","On load"],"onUpdate:modelValue":a[10]||(a[10]=u=>s({hideControlsEvent:u}))},null,8,["model-value"])]),_:1}),e.isNovel?se("",!0):(v(),z(be,{key:2},[B(Ae,{label:"Play speed"},{default:ne(()=>[B(en,{"model-value":n.value.speed,min:Z(Xo),max:Z(Go),step:Z(ur),format:u=>`${u.toFixed(2)}x`,"onUpdate:modelValue":a[11]||(a[11]=u=>s({speed:u}))},null,8,["model-value","min","max","step","format"])]),_:1}),B(Ae,{label:e.touchDevice?"Tap zones":"Click zones"},{default:ne(()=>[B(vt,{"model-value":(n.value.tapZone??-1)+1,items:["Default","None","L shaped","Kindle-ish","Edge","Right and left"],"onUpdate:modelValue":a[12]||(a[12]=u=>s({tapZone:u===0?void 0:u-1}))},null,8,["model-value"])]),_:1},8,["label"])],64))],64))}}),wh=Object.freeze(Object.defineProperty({__proto__:null,default:fr},Symbol.toStringTag,{value:"Module"})),xh={},_h={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Sh(e,t){return v(),z("svg",_h,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M11.3 19.3q-.275-.275-.288-.7t.263-.7l4.9-4.9H5q-.425 0-.713-.288T4 12q0-.425.288-.713T5 11h11.175l-4.9-4.9q-.275-.275-.263-.7t.288-.7q.275-.275.7-.275t.7.275l6.6 6.6q.15.125.213.313t.062.387q0 .2-.062.375t-.213.325l-6.6 6.6q-.275.275-.7.275t-.7-.275Z"},null,-1)])])}const Jn=ve(xh,[["render",Sh]]),kh=Object.freeze(Object.defineProperty({__proto__:null,default:Jn},Symbol.toStringTag,{value:"Module"}));var pr=(e=>(e[e.none=0]="none",e[e.lShape=1]="lShape",e[e.kindleIsh=2]="kindleIsh",e[e.edge=3]="edge",e[e.rightAndLeft=4]="rightAndLeft",e))(pr||{});const ra={0:{prevZones:[],nextZones:[]},1:{prevZones:[0,1,2,3],nextZones:[8,7,6,5]},2:{prevZones:[6,3],nextZones:[8,7,5,4]},3:{prevZones:[7],nextZones:[5,0,2,3,6,8]},4:{prevZones:[3,0,6],nextZones:[5,2,8]}},sa=pe({__name:"TapZonePreview",props:{tapZone:{type:Number},direction:{type:Number}},setup(e){const t=e,{width:n,height:o}=hn(),i=G(()=>Math.min(1.25,Math.max(.75,Math.round(n.value/o.value*100)/100))),r=G(()=>i.value>=1),s=G(()=>t.direction===nt.vertical),l=G(()=>t.direction===nt.rtl),a=G(()=>{if(!t.tapZone)return;const{prevZones:u,nextZones:c}=ra[t.tapZone];return Array.from({length:9},(d,f)=>{const p=u.includes(f),x=!p&&c.includes(f);return{isPrev:p,isNext:x,hasArrow:f===u[0]||f===c[0]}})});return(u,c)=>(v(),z("div",{class:fe(["p-2 bg-black bg-opacity-40 rounded-2xl",{"w-28":r.value,"h-28":!r.value}]),style:Pe({"aspect-ratio":i.value})},[e.tapZone===Z(pr).none?(v(),z("div",{key:0,class:fe(["inline-block absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-14 h-14",{"rotate-90":e.direction===Z(nt).vertical,"rotate-180":e.direction===Z(nt).rtl}])},[B(Jn)],2)):a.value?(v(),z("div",{key:2,class:fe(["w-full h-full overflow-hidden rounded-xl flex flex-wrap",{"flex-row-reverse":l.value}])},[(v(!0),z(be,null,Yt(a.value,(d,f)=>(v(),z("div",{key:`zone-${f}`,class:fe(["w-1/3 h-1/3 flex justify-center items-center p-0.5",{"bg-stone-100":d.isPrev||d.isNext,"bg-opacity-50":d.isPrev}])},[d.hasArrow?(v(),z("span",{key:0,class:"w-5 h-5 max-w-full max-h-full inline-block transform text-stone-800",style:Pe({transform:`rotate(${s.value?d.isNext?90:-90:(l.value?d.isPrev:d.isNext)?0:180}deg)`})},[B(Jn)],4)):se("",!0)],2))),128))],2)):(v(),z("div",{key:1,class:fe(["w-full h-full overflow-hidden rounded-xl flex flex-nowrap",{"flex-col":s.value}])},[U("div",{class:fe(["flex-grow w-full h-full flex justify-center items-center bg-stone-100",{"bg-opacity-50":!l.value}])},[U("span",{class:fe(["w-5 h-5 inline-block transform text-stone-800",{"-rotate-90":s.value,"rotate-180":!s.value}])},[B(Jn)],2)],2),c[0]||(c[0]=U("div",{class:"flex-grow w-full h-full"},null,-1)),c[1]||(c[1]=U("div",{class:"flex-grow w-full h-full"},null,-1)),U("div",{class:fe(["flex-grow w-full h-full flex justify-center items-center bg-stone-100",{"bg-opacity-50":l.value}])},[U("span",{class:fe(["w-5 h-5 inline-block text-stone-800",{"transform rotate-90":s.value}])},[B(Jn)],2)],2)],2))],6))}}),Ch=Object.freeze(Object.defineProperty({__proto__:null,default:sa},Symbol.toStringTag,{value:"Module"})),Th={key:0,class:"inline-block fixed z-50 left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none"},la=pe({__name:"DirectionToast",props:{direction:{type:Number},tapZone:{type:Number}},setup(e){const t=e,n=sessionStorage.getItem("tk:dir"),o=ee(typeof n!="string"||+n!==t.direction),i=ct(()=>o.value=!1,1500);ue(()=>[t.direction,t.tapZone],()=>{r(),o.value=!0,i()}),je(()=>{r(),i();let s;ue(Zi(),a=>{a!=="visible"?s=Date.now():Date.now()-s>7e3&&(o.value=!0,i())})});function r(){sessionStorage.setItem("tk:dir",t.direction+"")}return(s,l)=>(v(),oe(Vo,{name:"slow-fade","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:ne(()=>[o.value?(v(),z("div",Th,[B(sa,{direction:e.direction,"tap-zone":e.tapZone},null,8,["direction","tap-zone"])])):se("",!0)]),_:1}))}}),Ph=Object.freeze(Object.defineProperty({__proto__:null,default:la},Symbol.toStringTag,{value:"Module"})),Mh={class:"flex justify-between items-end"},Eh={class:"fixed pointer-events-none left-0 right-0 bottom-0"},aa=pe({__name:"GearControlsLayout",props:{visible:{type:Boolean},spaceTop:{type:null}},setup(e){return(t,n)=>(v(),z("div",{id:"controls",class:fe(["fixed pointer-events-none cursor-auto left-0 top-0 w-full h-full flex flex-col justify-between p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3 z-20",{"opacity-100 z-20":e.visible,"opacity-0 -z-10":!e.visible}])},[xe(t.$slots,"default"),U("div",{class:fe(["flex gap-1 items-center relative z-30 flex-shrink-0 2xs:gap-3",{"children-pointer-events-auto":e.visible}]),style:Pe({paddingTop:`${e.spaceTop||0}px`})},[xe(t.$slots,"top")],6),U("div",Mh,[U("div",{class:fe(["inline-block",{"children-pointer-events-auto":e.visible}])},[xe(t.$slots,"bottom-left")],2),U("div",{class:fe(["inline-flex flex-col items-end gap-4",{"children-pointer-events-auto":e.visible}])},[xe(t.$slots,"bottom-right")],2)]),U("div",Eh,[xe(t.$slots,"progress")])],2))}}),Ih=Object.freeze(Object.defineProperty({__proto__:null,default:aa},Symbol.toStringTag,{value:"Module"})),Oh='.loading-indicator{display:inline-block;height:80px;position:relative;width:80px}.loading-indicator:after,.loading-indicator:before{border-radius:9999px;border-style:solid;border-width:4px;box-sizing:border-box;display:block;position:absolute;--tw-border-opacity:1;animation:lds-ripple 1s cubic-bezier(0,.2,.8,1) infinite;border-color:rgb(184 92 56/var(--tw-border-opacity,1));content:"";opacity:1}.loading-indicator:after{animation-delay:-.5s}@keyframes lds-ripple{0%{height:0;left:40px;opacity:0;top:40px;width:0}4.9%{height:8px;left:36px;opacity:0;top:36px;width:8px}5%{height:8px;left:36px;opacity:1;top:36px;width:8px}to{height:80px;left:0;opacity:0;top:0;width:80px}}',$h={},zh={class:"loading-indicator"};function Dh(e,t){return v(),z("div",zh)}const ei=ve($h,[["render",Dh],["styles",[Oh]]]),Ah=Object.freeze(Object.defineProperty({__proto__:null,default:ei},Symbol.toStringTag,{value:"Module"})),jh={class:"max-h-none max-w-none h-full w-full m-0 p-0 border-none outline-none"},Lh={key:0,class:"fixed inset-0 h-[101%] flex justify-center items-center z-10 bg-black"},hr=ve(pe({inheritAttrs:!1,__name:"GearLayout",props:{loading:{type:Boolean},immediate:{type:Boolean},idle:{type:Boolean},style:{type:Object}},setup(e,{expose:t}){const n={mounted:i=>i.isConnected&&!i.open&&i.showModal(),beforeUnmount:i=>i.isConnected&&i.open&&i.close()},o=ee(null);return t({rootEl:o}),(i,r)=>Ne((v(),z("dialog",jh,[U("div",{ref_key:"rootEl",ref:o,id:"gear-layout",class:fe({"cursor-none":e.idle,"cursor-default":!e.idle,"bg-black":e.immediate||!e.loading,"opacity-0":!e.immediate&&e.loading,"duration-200 transition-colors":!e.immediate,[`${i.$attrs.class??""}`]:!0}),style:Pe(e.style??{})},[e.loading&&e.immediate?(v(),z("div",Lh,[B(ei)])):se("",!0),xe(i.$slots,"default")],6)])),[[n]])}}),[["styles",["#gear-layout{direction:ltr;font-family:Helvetica,sans-serif;font-size:16px;font-weight:400;height:100%;line-height:24px;overflow:hidden;overscroll-behavior:contain;pointer-events:auto;text-align:left;width:100%}"]]]),Bh=Object.freeze(Object.defineProperty({__proto__:null,default:hr},Symbol.toStringTag,{value:"Module"})),Vh={},Nh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 56"};function Rh(e,t){return v(),z("svg",Nh,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M29.84 49.574h12.398c4.899 0 7.336-2.437 7.336-7.265V13.69c0-4.828-2.437-7.265-7.336-7.265H29.84Zm-16.055 0h12.398V6.426H13.785c-4.875 0-7.36 2.414-7.36 7.265V42.31c0 4.851 2.485 7.265 7.36 7.265"},null,-1)])])}const ca=ve(Vh,[["render",Rh]]),Hh=Object.freeze(Object.defineProperty({__proto__:null,default:ca},Symbol.toStringTag,{value:"Module"})),Fh={},Wh={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function qh(e,t){return v(),z("svg",Wh,[...t[0]||(t[0]=[U("g",{fill:"none"},[U("path",{d:"M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427c-.002-.01-.009-.017-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093c.012.004.023 0 .029-.008l.004-.014l-.034-.614c-.003-.012-.01-.02-.02-.022m-.715.002a.023.023 0 0 0-.027.006l-.006.014l-.034.614c0 .012.007.02.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),U("path",{fill:"currentColor",d:"M8 3v18H5a2 2 0 0 1-1.995-1.85L3 19V5a2 2 0 0 1 1.85-1.995L5 3zm11 0a2 2 0 0 1 1.995 1.85L21 5v14a2 2 0 0 1-1.85 1.995L19 21h-9V3z"})],-1)])])}const ua=ve(Fh,[["render",qh]]),Uh=Object.freeze(Object.defineProperty({__proto__:null,default:ua},Symbol.toStringTag,{value:"Module"})),da=pe({__name:"MangaPreferencesForm",props:{direction:{type:Number},readerStyle:{type:Number},gap:{type:Number},speed:{type:Number},zoom:{type:Number},webtoon:{type:Boolean},defaultPreferences:{type:Object},enableReset:{type:Boolean}},emits:["update:reader-style","update:direction","update:gap","update:speed","update:zoom"],setup(e,{emit:t}){const n=e,o=t,i=G(()=>["Long strip",n.webtoon?void 0:"Single page",n.webtoon?void 0:"Double page"].filter(Boolean)),r=G(()=>{const a=n.defaultPreferences;return!n.webtoon&&n.readerStyle!==a.readerStyle||!n.webtoon&&n.direction!==a.direction||n.gap!==a.gap||n.speed!==a.speed});function s(a){o("update:zoom",Math.round(a)/100)}function l(){o("update:reader-style",void 0),o("update:direction",void 0),o("update:gap",void 0),o("update:speed",void 0)}return(a,u)=>(v(),z(be,null,[B(Ae,{label:"Style"},{default:ne(()=>[B(vt,{"model-value":e.readerStyle,items:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>o("update:reader-style",c))},null,8,["model-value","items"])]),_:1}),B(Ae,{label:"Direction"},{default:ne(()=>[B(vt,{"model-value":e.direction,items:e.webtoon?["Vertical"]:["Vertical","Left to right","Right to left"],"onUpdate:modelValue":u[1]||(u[1]=c=>o("update:direction",c))},null,8,["model-value","items"])]),_:1}),B(Ae,{label:"Gap size"},{default:ne(()=>[B(vt,{"model-value":e.gap,items:["None","1px","2px","3px","4px","5px"],"onUpdate:modelValue":u[2]||(u[2]=c=>o("update:gap",c))},null,8,["model-value"])]),_:1}),B(Ae,{label:"Play speed"},{default:ne(()=>[B(en,{"model-value":e.speed,min:Z(Xo),max:Z(Go),step:Z(ur),format:c=>`${c.toFixed(2)}x`,"onUpdate:modelValue":u[3]||(u[3]=c=>o("update:speed",c))},null,8,["model-value","min","max","step","format"])]),_:1}),B(Ae,{label:"Zoom"},{default:ne(()=>[B(en,{"model-value":Math.ceil(e.zoom*100),min:Z(Jo)*100,max:Z(Qo)*100,step:Z(uh)*100,format:c=>`${Math.ceil(c)}%`,"onUpdate:modelValue":s},null,8,["model-value","min","max","step","format"])]),_:1}),e.enableReset?(v(),z("div",{key:0,class:fe(["w-full flex justify-center pt-1 duration-200",{"pointer-events-none opacity-0":!r.value,"opacity-90":r.value}])},[B(ar,{class:"w-2/3",onClick:l},{default:ne(()=>[...u[4]||(u[4]=[Wt(" Reset to default ",-1)])]),_:1})],2)):se("",!0)],64))}}),Kh=Object.freeze(Object.defineProperty({__proto__:null,default:da},Symbol.toStringTag,{value:"Module"})),fa=pe({__name:"PageNav",props:Ye({disabled:{type:Boolean},pages:{type:Array},totalImgs:{type:Number}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=lt(e,"modelValue"),o=G(()=>t.pages.map(a=>a.map(({index:u})=>`${u+1}`).join("-"))),i=G(()=>{const a=n.value,u=t.pages.findIndex(c=>c.some(({index:d})=>d===a));return u===-1?t.pages.length-1:u}),r=G(()=>t.pages.length?`${o.value[i.value]}/${t.totalImgs}`:"--");function s(a){const u=t.pages[a][0].index;l(u)}function l(a){n.value=a}return(a,u)=>(v(),oe(rr,{"model-value":i.value,label:r.value,title:"Current page",items:o.value,disabled:e.disabled,"onUpdate:modelValue":s},null,8,["model-value","label","items","disabled"]))}}),Zh=Object.freeze(Object.defineProperty({__proto__:null,default:fa},Symbol.toStringTag,{value:"Module"})),gr=ve(pe({__name:"PauseToast",props:{playing:{type:Boolean}},setup(e){const t=e,n=ee(0);return ue(()=>t.playing,()=>{n.value=Date.now()}),(o,i)=>n.value?(v(),z("div",{key:n.value,class:"animate-pause-fade fixed left-1/2 top-1/2 -mx-12 -my-12 pointer-events-none w-24 h-24 p-4 bg-black bg-opacity-40 rounded-full duration-500"},[e.playing?(v(),oe(tr,{key:0})):(v(),oe(er,{key:1}))])):se("",!0)}}),[["styles",[".animate-pause-fade{animation:pause-fade .4s linear forwards;transform-origin:center}@keyframes pause-fade{0%{opacity:0;transform:scale(.3)}10%{opacity:1;transform:scale(.35)}55%{opacity:1;transform:scale(.65)}to{opacity:0;transform:scale(1)}}"]]]),Yh=Object.freeze(Object.defineProperty({__proto__:null,default:gr},Symbol.toStringTag,{value:"Module"})),Xh=30,mr=ve(pe({__name:"ProgressBar",props:{value:{type:Number},total:{type:Number},longStrip:{type:Boolean},height:{type:Number},rtl:{type:Boolean},opacity:{type:Number}},setup(e){const t=e,n=G(()=>Math.floor(t.value)+1),o=G(()=>`${Math.max(2,Math.min(10,t.height))}px`),i=hn().width,r=G(()=>t.total!==void 0&&i.value/t.total>=Xh);return(s,l)=>(v(),z("div",{class:fe(["rprog",{"rprog--rtl":e.rtl}]),style:Pe({height:o.value,opacity:e.opacity??.8})},[r.value?(v(!0),z(be,{key:0},Yt(e.total,a=>(v(),z("span",{key:a,class:fe(["rprog__item",{"rprog__item--active":n.value===a}]),style:Pe(!e.longStrip||n.value!==a?{}:{"--portion":`${e.value%1*100}%`})},null,6))),128)):(v(),z("div",{key:1,style:Pe({width:`${e.value/(e.total??1)*100}%`}),class:"h-full bg-textPrimary"},null,4))],6))}}),[["styles",['.rprog{--portion:100%;display:flex;width:100%}.rprog--rtl,.rprog--rtl .rprog__item{flex-direction:row-reverse}.rprog__item{display:inline-flex;flex-grow:1;flex-shrink:0;height:100%}.rprog__item:first-child:before{display:none}.rprog__item--active:before,.rprog__item:has(~.rprog__item--active):before{background-color:rgb(0 0 0/var(--tw-bg-opacity,1));content:"";display:block;flex-shrink:0;height:100%;width:1px;--tw-bg-opacity:.25}.rprog__item--active:after,.rprog__item:has(~.rprog__item--active):after{content:"";display:block;height:100%;--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1));width:var(--portion)}']]]),Gh=Object.freeze(Object.defineProperty({__proto__:null,default:mr},Symbol.toStringTag,{value:"Module"})),pa=pe({__name:"GesturesContainer",props:{spaceTop:{type:Number},controlsVisible:{type:Boolean},zoom:{type:Number},zooming:{type:Boolean},pinchToZoome:{type:Boolean},tapZone:{type:Number},pageIndex:{type:Number},playController:{type:Object},rtl:{type:Boolean},horizontal:{type:Boolean},longStrip:{type:Boolean},touchDevice:{type:Boolean},busy:{type:Boolean}},emits:["update:zoom","update:zooming","dragEnd","click","prev","next"],setup(e,{expose:t,emit:n}){const o=e,i=n,r=ee(null),s=ee(Math.min(Qo,Math.max(Jo,o.zoom))),l=ee(!1),a=ee(!1),u={isZoomIn:!1,isZoomOut:!1,initial:void 0};t({rootEl:r}),ue(()=>o.zoom,k=>F(k)),je(()=>{o.touchDevice?St(r,"touchstart",b):(St(r,"mousedown",p),St(window,"wheel",q))}),$t({onKeyDown:k=>{var y;if(!o.busy&&((y=r.value)==null||y.focus(),!(k.key==="Meta"||k.key==="Control")&&(k.ctrlKey||k.metaKey)))switch(k.key){case"0":F(1);break;case"-":F(s.value-.2),k.preventDefault();break;case"=":case"+":F(s.value+.2),k.preventDefault();break}},onKeyUp:k=>{o.zooming&&!(k.ctrlKey||k.metaKey)&&Y()}});function c(k){a.value!==k&&(a.value=k,k?o.playController.pause():(i("dragEnd"),o.playController.resume()))}let d={x:0,y:0},f={x:0,y:0};function p(k){if(k.button!==0)return;const y=r.value;y&&(d={x:k.clientX,y:k.clientY},f={x:y.scrollLeft,y:y.scrollTop},window.addEventListener("mousemove",x),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",x),setTimeout(()=>c(!1))},{once:!0}),k.preventDefault(),k.stopPropagation())}function x(k){const y=k.clientX-d.x,O=k.clientY-d.y;if(!a.value&&Math.abs(y)<.5&&Math.abs(O)<.5)return;c(!0);const $=r.value;$&&($.scrollLeft=f.x-y,$.scrollTop=f.y-O)}let _={distance:0,zoom:s.value,x:0,y:0},D=!1;function b(k){o.busy||(D=o.pinchToZoome&&k.touches.length===2,D&&(i("update:zooming",!0),c(!0),k.stopPropagation(),k.preventDefault(),_={distance:K(k),zoom:s.value,x:(k.touches[0].clientX+k.touches[1].clientX)/2,y:(k.touches[0].clientY+k.touches[1].clientY)/2}),(D||o.longStrip&&o.playController.isPlaying.value)&&window.addEventListener("touchend",P,{once:!0}))}function P(){var $;if(D=!1,o.zooming){c(!1),Y();return}if(!a.value)return;const k=ct(()=>{var le;c(!1),(le=r.value)==null||le.removeEventListener("scroll",O)},200),y=setTimeout(k,200);($=r.value)==null||$.addEventListener("scroll",O);function O(){clearTimeout(y),k()}}function A(k){if(!D&&!(o.longStrip&&o.playController.isPlaying.value)||(c(!0),!o.zooming)||(k.stopPropagation(),k.preventDefault(),k.touches.length<2))return;const O=K(k)/_.distance;J(Math.ceil(O*_.zoom*100)/100,_)}const w=ct(()=>l.value=!1,100);let g=!1;const I=ct(()=>{g=!1},30);function q(k){if(o.busy)return;let y=o.zooming;if(g||(g=!0,y=k.ctrlKey||k.metaKey,y&&i("update:zooming",!0)),I(),y){k.stopPropagation(),k.preventDefault();const O=Math.ceil((s.value+k.deltaY*-.01)*100)/100;J(O,{x:k.clientX,y:k.clientY});return}o.horizontal&&(l.value||(l.value=!0),w(),k.deltaY&&(r.value&&(r.value.scrollLeft+=k.deltaY*(o.rtl?-1:1)),k.stopPropagation()))}function K(k){return Math.hypot(k.touches[0].clientX-k.touches[1].clientX,k.touches[0].clientY-k.touches[1].clientY)}const R={x:0,y:0,ts:0};function Q(k){if(a.value||o.zooming)return;const y=r.value;if(!y||H(y,k)||(i("click"),o.playController.isPlaying.value))return;const{clientX:O,clientY:$}=k,{x:le,y:ae,ts:me}=R;R.x=O,R.y=$,R.ts=new Date().getTime();const ge=R.ts-me;ge>250||ge<10||Math.abs(le-O)>40||Math.abs(ae-$)>40||(R.ts=0,R.x=0,R.y=0,T(O,$))}function H(k,y){if(o.playController.isPlaying.value)return!1;const O=o.tapZone;if(O===pr.none)return!1;const $=o.controlsVisible?o.spaceTop:0,le=k.clientHeight-$,ae=Math.max(0,y.clientY-$),me=o.horizontal?k.clientWidth:le;let ge=!1,Se=!1;if(O){const{prevZones:De,nextZones:Ke}=ra[o.tapZone],ut=Math.floor(ae/le*3);let Qe=Math.floor(y.clientX/k.clientWidth*3);o.rtl&&(Qe=2-Qe);const ze=ut*3+Qe;ge=De.includes(ze),Se=!ge&&Ke.includes(ze)}else{const Ke=(o.horizontal?o.rtl?me-y.clientX:y.clientX:ae)/me,ut=o.horizontal?.2:.15;ge=Ke<=ut&&o.pageIndex>0,Se=!ge&&Ke>=1-ut}if(!ge&&!Se)return!1;if(o.longStrip){const De=(ge?-1:1)*.75*me;o.horizontal?k.scrollLeft=k.scrollLeft+(o.rtl?-1:1)*De:k.scrollTop=Math.max(0,k.scrollTop+De)}else ge?i("prev"):Se&&i("next");return!0}async function T(k,y){const O=s.value===1?2:1;await F(O,{x:k,y}),Y()}function Y(){i("update:zooming",!1),u.initial=void 0,u.isZoomIn=!1,u.isZoomOut=!1}function S(){if(u.initial)return;const k=r.value;if(!k)return;const y=k.querySelector(`[data-index="${o.pageIndex}"],[data-index2="${o.pageIndex}"]`)??void 0;y&&(u.initial={el:y,rect:y.getBoundingClientRect()})}function J(k,y){if(u.isZoomIn=u.isZoomIn||!u.isZoomOut&&k>1,u.isZoomIn&&k<1){F(1,y);return}if(u.isZoomOut=u.isZoomOut||!u.isZoomIn&&k<1,u.isZoomOut&&k>1){F(1,y);return}F(k,y)}async function F(k,y){const O=r.value,$=Math.min(Qo,Math.max(Jo,k));if(!O||s.value===$)return;S();const{initial:le}=u;if(!le)return;const ae=(y==null?void 0:y.x)??O.clientWidth/2,me=(y==null?void 0:y.y)??O.clientHeight/2;s.value=$,i("update:zoom",$),await gt();const{el:ge,rect:Se}=le,De=ge.offsetWidth/Se.width,Ke=ge.offsetHeight/Se.height;O.scrollLeft=ge.offsetLeft-Se.left*De+ae*(De-1),O.scrollTop=ge.offsetTop-Se.top*Ke+me*(Ke-1)}return(k,y)=>(v(),z("div",{ref_key:"rootEl",ref:r,tabindex:"0",class:fe(["w-full h-full overflow-auto scrollbar-none overscroll-contain scrollbar-none focus:outline-none touch-pan-x touch-pan-y",{"!snap-none":!e.longStrip&&(a.value||l.value||e.zooming),"cursor-grabbing":!e.touchDevice&&a.value,"overflow-hidden":e.zooming}]),style:Pe({"font-size":`${s.value}px`}),onClick:Le(Q,["stop"]),onTouchmoveCapture:Le(A,["stop"])},[xe(k.$slots,"default")],38))}}),Jh=Object.freeze(Object.defineProperty({__proto__:null,default:pa},Symbol.toStringTag,{value:"Module"}));function vr(e,t){return(e==null?void 0:e.querySelector(`[data-index="${t}"],[data-index2="${t}"]`))??void 0}const Qh=["data-index"],eg={key:0,class:"img img--loading"},tg=["src"],ng=["data-index"],ha=ve(pe({__name:"ReaderBody",props:{page:{type:Number},pageIndex:{type:Number},direction:{type:Number},isLongStrip:{type:Boolean},isVertical:{type:Boolean},isDouble:{type:Boolean},isRTL:{type:Boolean},pages:{type:Array},totalImgs:{type:Number},gap:{type:Number},zoom:{type:Number},zooming:{type:Boolean},pinchToZoome:{type:Boolean},tapZone:{type:Number},spaceTop:{type:Number},touchDevice:{type:Boolean},playController:{type:Object},busy:{type:Boolean},controlsVisible:{type:Boolean}},emits:["ready","update:zoom","update:zooming","update:playing","dragEnd","click","end","prev","next"],setup(e,{expose:t,emit:n}){const o=e,i=n,r=ee(null),s=G(()=>{var A;return(A=r.value)==null?void 0:A.rootEl});t({rootEl:s});const l=hn(),a=G(()=>{const{width:A,height:w}=l,g=o.isLongStrip?o.isVertical?A.value:w.value:Math.min(A.value,w.value);return Math.min(4,Math.max(1,Math.ceil(g/400-1)))*o.gap}),u=ee(o.isLongStrip?{min:o.pageIndex-1,max:o.pageIndex}:_()),c=G(()=>{const{min:A,max:w}=u.value,g={};for(let I=A;I<=w;I++)g[I]=!0;return g}),d=ee(p()),f=P(()=>{d.value=p()},100);ue(l.width,f),ue(l.height,f),ue(()=>o.pages,f),ue(()=>o.isLongStrip,f),ue(()=>o.isVertical,f);function p(){const A=l.width.value,w=l.height.value,{pages:g,isLongStrip:I,isVertical:q}=o;return g.map(K=>{var k;const R=K.some(y=>{var O;return(O=y.img)==null?void 0:O.isLoading}),Q=K.map(y=>y.index),H={isLoading:R,indexes:Q,visible:!1};if(R)return H;const T=K.map(({img:y})=>y).filter(Boolean);if(!T.length||(H.srcs=T.map(({src:y})=>y),T.every(y=>y.hasError)))return H;const S=(k=T.find(y=>!y.hasError))==null?void 0:k.size;if(!S)return H;const J=T.reduce((y,O)=>{var $;return y+((($=O.size)==null?void 0:$.width)??S.width)},0),F=T.reduce((y,O)=>{var $;return y+((($=O.size)==null?void 0:$.height)??S.height)},0)/T.length;return I&&q||!I&&A/J<w/F?(H.width=Math.min(A,J),H.height=F*(H.width/J)):(H.height=Math.min(w,F),H.width=J*(H.height/F)),H})}const x=G(()=>{const A=o.isVertical?"width":"height";return d.value.map(w=>w[A]).filter(Boolean).sort((w,g)=>g-w)[0]});je(()=>{const A=vr(s.value,o.pageIndex);A==null||A.scrollIntoView({behavior:"instant",block:"start"});let w,g=!1;Ns(()=>{w!==o.pageIndex&&(w=o.pageIndex,I(),g||(g=!0,gt(()=>i("ready"))))});async function I(){if(!o.isLongStrip){u.value=_();return}const q=Math.floor(o.page),K=vr(s.value,q);if(!K)return;const R=+D(K).getAttribute("data-index"),Q=+b(K).getAttribute("data-index");(R!==u.value.min||Q!==u.value.max)&&(u.value={min:R,max:Q})}});function _(){const{pageIndex:A}=o;return{min:A-(o.isDouble?5:3),max:A+(o.isDouble?6:3)}}function D(A,w=0){const g=A.previousElementSibling;if(!g)return A;const I=w+(o.isVertical?g.clientHeight:g.clientWidth);return(o.isVertical?I>l.height.value*1.5:o.isRTL?I>l.width.value*2.5:I>l.width.value*1.5)?g:D(g,I)}function b(A,w=0){const g=A.nextElementSibling;if(!g)return A;const I=w+(o.isVertical?g.clientHeight:g.clientWidth);return(o.isVertical?I>l.height.value*3.5:o.isRTL?I>l.width.value*1.5:I>l.width.value*2.5)?g:b(g,I)}function P(A,w){let g;return()=>{g||(g??(g=setTimeout(()=>{g=void 0,A()},w)))}}return(A,w)=>(v(),oe(pa,{ref_key:"gestureContainer",ref:r,"space-top":e.spaceTop,"controls-visible":e.controlsVisible,zoom:e.zoom,zooming:e.zooming,"pinch-to-zoome":e.pinchToZoome,"tap-zone":e.tapZone,"page-index":e.pageIndex,class:fe(["rbod",{"rbod--long-strip":e.isLongStrip,"rbod--paging":!e.isLongStrip,"rbod--vertical":e.isVertical,"rbod--rtl":e.isRTL,"rbod--1page":d.value.length===1}]),"play-controller":e.playController,horizontal:!e.isVertical,rtl:e.isRTL,"touch-device":e.touchDevice,busy:e.busy,"long-strip":e.isLongStrip,style:Pe({"--gap":`${a.value}em`,"--space-top":`${e.spaceTop}px`,"--screen-width-em":Z(l).width.value+"em","--screen-height-em":Z(l).height.value+"em",...e.isLongStrip?{"--max-size-em":x.value+"em"}:{}}),"onUpdate:zoom":w[0]||(w[0]=g=>i("update:zoom",g)),"onUpdate:zooming":w[1]||(w[1]=g=>i("update:zooming",g)),onDragEnd:w[2]||(w[2]=()=>i("dragEnd")),onClick:w[3]||(w[3]=()=>i("click")),onPrev:w[4]||(w[4]=()=>i("prev")),onNext:w[5]||(w[5]=()=>i("next"))},{default:ne(()=>[(v(!0),z(be,null,Yt(d.value,g=>{var I;return v(),z("div",cn({key:e.direction+"_"+g.indexes[0],"data-index":g.indexes[0]},{ref_for:!0},g.indexes.length>1?{"data-index2":g.indexes[1]}:{}),[!((I=g.srcs)!=null&&I.length)||g.isLoading?(v(),z("div",eg,[c.value[g.indexes[0]]?(v(),oe(ei,{key:0})):se("",!0)])):g.srcs.length==1?(v(),oe(Pi(c.value[g.indexes[0]]?"img":"div"),cn({key:1,class:"img"},{ref_for:!0},c.value[g.indexes[0]]?{src:g.srcs[0]}:{},{style:{width:g.width!==void 0?g.width+"em":"",height:g.height!==void 0?g.height+"em":""}}),null,16,["style"])):(v(),z("div",{key:2,class:fe(["img img--double",{"flex-row-reverse":e.isRTL}]),style:Pe({width:g.width!==void 0?g.width+a.value+"em":"",height:g.height!==void 0?g.height+"em":""})},[g.indexes.some(q=>c.value[q])?(v(!0),z(be,{key:0},Yt(g.srcs,q=>(v(),z("div",{key:q},[U("img",{src:q},null,8,tg)]))),128)):se("",!0)],6))],16,Qh)}),128)),U("div",{class:"last","data-index":e.totalImgs},[xe(A.$slots,"end")],8,ng)]),_:3},8,["space-top","controls-visible","zoom","zooming","pinch-to-zoome","tap-zone","page-index","play-controller","horizontal","rtl","touch-device","busy","long-strip","class","style"]))}}),[["styles",[".rbod{--tw-translate-y:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width:1024px){.rbod{transform:none}}.rbod--rtl{flex-direction:row-reverse}.rbod.rbod--vertical>div{padding:calc(var(--gap)/2) 0}.rbod:not(.rbod--vertical){align-items:center;display:flex;height:100%;justify-content:flex-start}.rbod:not(.rbod--vertical)>div{padding:0 calc(var(--gap)/2)}.rbod--long-strip.rbod--vertical.rbod--1page>div:first-child{min-height:100vh}.rbod--long-strip.rbod--vertical>div:first-child{margin-top:var(--space-top);padding-top:0}.rbod--long-strip.rbod--vertical>div:last-child{padding-bottom:0}.rbod--long-strip.rbod--vertical>div{width:var(--max-size-em)}.rbod--long-strip.rbod--vertical .img--loading{height:75vh;width:100%}.rbod--long-strip.rbod--vertical .last{height:100vh}.rbod--long-strip:not(.rbod--vertical).rbod--1page>div:first-child{min-width:100vw}.rbod--long-strip:not(.rbod--vertical)>div{align-items:center;display:flex;height:var(--max-size-em)}.rbod--long-strip:not(.rbod--vertical) .img--loading{height:100%;max-width:100vw;width:680px}.rbod--long-strip:not(.rbod--vertical) .last{width:100vw}.rbod--long-strip>div>img{flex-shrink:0;margin:auto}.rbod--paging>div{align-items:center;display:grid;justify-content:center;min-height:100vh;min-width:100vw;scroll-snap-align:center;scroll-snap-stop:always}.rbod--paging.rbod--vertical{scroll-snap-type:y var(--tw-scroll-snap-strictness);--tw-scroll-snap-strictness:mandatory}.rbod--paging.rbod--vertical>div{width:var(--screen-width-em)}.rbod--paging:not(.rbod--vertical){scroll-snap-type:x var(--tw-scroll-snap-strictness);--tw-scroll-snap-strictness:mandatory}.rbod--paging:not(.rbod--vertical)>div{height:var(--screen-height-em)}.rbod--paging .img--loading{height:100%;width:100%}.rbod--paging .img.img--double{align-items:center;background-color:transparent;display:flex;gap:var(--gap);justify-content:center}.rbod--paging .img.img--double div{display:flex;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rbod--paging .img.img--double div img{flex-shrink:0;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.rbod>div{flex-shrink:0}.rbod .img,.rbod>div{margin:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.rbod .img{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));-o-object-fit:contain;object-fit:contain}.rbod .img--loading{align-items:center;background-color:transparent;display:flex;justify-content:center}"]]]),og=Object.freeze(Object.defineProperty({__proto__:null,default:ha},Symbol.toStringTag,{value:"Module"})),ig={},rg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function sg(e,t){return v(),z("svg",rg,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"},null,-1)])])}const ga=ve(ig,[["render",sg]]),lg=Object.freeze(Object.defineProperty({__proto__:null,default:ga},Symbol.toStringTag,{value:"Module"})),ag={class:"flex w-full flex-shrink-0 justify-between items-center h-16 px-3"},ma=pe({__name:"BottomSheet",props:Ye({spaceTop:{type:Number}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=lt(e,"modelValue"),n=ee(null),o=ee(!1),i=ee(0);$t({onKeyDown:s});const r=Ko();ue(t,c=>r(c)),Yi(()=>{const c=t.value;return c&&(t.value=!1),c});function s(c){t.value&&c.key==="Escape"&&(t.value=!1,c.preventDefault())}const l={y:-1};function a(c){const d=n.value;if(!d)return;if(d.scrollTop>0){l.y=-1;return}if(l.y===-1){l.y=Math.max(0,c.touches[0].clientY);return}const p=c.touches[0].clientY-l.y,x=p>0?p:0;x!=i.value&&(i.value=x);const _=x>0;_!==o.value&&(o.value=_)}async function u(){o.value=!1,l.y=-1,await gt();const c=n.value;c&&c.offsetHeight-i.value<window.innerHeight/2&&i.value>c.offsetHeight*.3&&(t.value=!1),i.value=0}return(c,d)=>(v(),z("div",{class:fe(["fixed inset-0 flex flex-col items-center justify-end select-none z-40 text-stone-100",{"!pointer-events-none":!t.value}]),style:Pe({"padding-top":(e.spaceTop??0)+60+"px"}),onClick:d[3]||(d[3]=()=>t.value=!1)},[B(Vo,{name:"slide","enter-from-class":"!translate-y-full","leave-to-class":"!translate-y-full"},{default:ne(()=>[t.value?(v(),z("div",{key:0,class:fe(["w-full sm:w-[31rem] bg-stone-900 bg-opacity-90 backdrop-blur-md rounded-t-xl max-w-full overflow-hidden shadow-lg shadow-neutral-950",{"duration-0":o.value,"duration-200":!o.value}]),style:Pe(i.value?{transform:`translateY(${i.value}px)`}:{}),onClick:d[1]||(d[1]=Le(()=>{},["stop"])),onWheelPassive:d[2]||(d[2]=Le(()=>{},["stop"])),onTouchmove:Le(a,["stop"]),onTouchend:u},[U("div",ag,[B(Ge,{transparent:"",onClick:d[0]||(d[0]=()=>t.value=!1)},{default:ne(()=>[B(ga)]),_:1}),xe(c.$slots,"name"),xe(c.$slots,"actions")]),U("div",{ref_key:"scrollEl",ref:n,class:"overflow-auto px-6 md:px-8 lg:px-10 xl:px-12 pt-1.5 pb-8 md:pb-6 flex-grow scrollbar-sm",style:{"max-height":"calc(100% - 4rem)"}},[xe(c.$slots,"default")],512)],38)):se("",!0)]),_:3})],6))}}),cg=Object.freeze(Object.defineProperty({__proto__:null,default:ma},Symbol.toStringTag,{value:"Module"})),ug=["onClick","onKeyup"],va=ve(pe({__name:"TabBar",props:Ye({items:{type:Array}},{modelValue:{type:Number,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=lt(e,"modelValue"),o=ee(null),i=ee({width:"",left:""}),r=ee(!1);je(()=>{const l=Date.now();ue(n,async a=>{var c;await gt();const u=(c=o.value)==null?void 0:c.children[a+1];u&&(i.value={width:u.offsetWidth+"px",left:u.offsetLeft+"px"},!r.value&&Date.now()-l>500&&(r.value=!0),u.scrollIntoView({behavior:r.value?"smooth":"auto",block:"center",inline:"center"}))},{immediate:!0})});function s(l){n.value=l}return(l,a)=>(v(),z("div",{ref_key:"root",ref:o,class:"relative h-8 rounded-[2.5rem] inline-flex bg-black bg-opacity-50 p-1 font-medium max-w-full leading-none overflow-auto scrollbar-none",style:{}},[U("div",{class:fe(["bg-stone-300 h-6 rounded-2xl absolute top-1 pointer-events-none",{"duration-200":r.value}]),style:Pe(i.value)},null,6),(v(!0),z(be,null,Yt(t.items,(u,c)=>Ne((v(),z("div",{key:c,tabindex:"0",class:fe(["text-sm inline-flex justify-center items-center h-6 rounded-2xl px-4 cursor-pointer relative z-10 whitespace-nowrap flex-shrink-0 focus:outline-primary hover:bg-stone-50 hover:bg-opacity-10 duration-200",{"text-stone-900":c==n.value,"text-stone-400":c!=n.value}]),onClick:Le(()=>s(c),["stop"]),onKeyup:[Fo(()=>s(c),["enter"]),Fo(()=>s(c),["space"])]},[Wt(He(u),1)],42,ug)),[[Z(zt),30]])),128))],512))}}),[["styles",[".scrollbar-none{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}"]]]),dg=Object.freeze(Object.defineProperty({__proto__:null,default:va},Symbol.toStringTag,{value:"Module"})),fg={},pg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function hg(e,t){return v(),z("svg",pg,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5c0-2.21-1.79-4-4-4z"},null,-1)])])}const ba=ve(fg,[["render",hg]]),gg=Object.freeze(Object.defineProperty({__proto__:null,default:ba},Symbol.toStringTag,{value:"Module"})),mg={},vg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"};function bg(e,t){return v(),z("svg",vg,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M14 8.25a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5m0 8a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5M11.75 22a2.25 2.25 0 1 0 4.5 0a2.25 2.25 0 0 0-4.5 0"},null,-1)])])}const ya=ve(mg,[["render",bg]]),yg=Object.freeze(Object.defineProperty({__proto__:null,default:ya},Symbol.toStringTag,{value:"Module"})),wg={key:1,class:"w-full text-center text-xl whitespace-nowrap text-ellipsis flex-shrink overflow-hidden px-5 select-text"},xg={class:"opacity-90"},_g={key:0,class:"w-full text-center text-sm text-stone-400 whitespace-nowrap text-ellipsis flex-shrink overflow-hidden mb-3 -mt-2 select-text"},br=pe({__name:"SettingsBottomSheet",props:Ye({name:{type:String},spaceTop:{type:Number},enableHelp:{type:Boolean},enableDefaultPreferences:{type:Boolean}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:Ye(["help","more"],["update:modelValue"]),setup(e,{emit:t}){const n=e,o=t,i=lt(e,"modelValue"),r=ee(0),s=G(()=>n.name??location.hostname);$t({onKeyUp:a=>{a.key==="s"&&!a.metaKey&&!a.ctrlKey&&(i.value=!0)}}),je(()=>{ue(i,a=>{a||setTimeout(()=>{r.value!==0&&(r.value=0)},300)})});function l(){o("help"),i.value=!1}return(a,u)=>(v(),oe(ma,{modelValue:i.value,"onUpdate:modelValue":u[2]||(u[2]=c=>i.value=c),"space-top":e.spaceTop},{name:ne(()=>[e.enableDefaultPreferences?(v(),oe(va,{key:0,modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=c=>r.value=c),items:["Preferences","Default"]},null,8,["modelValue"])):(v(),z("h3",wg,He(s.value),1))]),actions:ne(()=>[e.enableDefaultPreferences?(v(),oe(Ge,{key:0,transparent:"",class:fe(e.enableHelp?"":"opacity-0 pointer-events-none"),onClick:l},{default:ne(()=>[U("span",xg,[B(ba)])]),_:1},8,["class"])):(v(),oe(Ge,{key:1,transparent:"",onClick:u[1]||(u[1]=()=>o("more"))},{default:ne(()=>[B(ya)]),_:1}))]),default:ne(()=>[r.value===0?(v(),z(be,{key:0},[e.enableDefaultPreferences?(v(),z("h3",_g,He(s.value),1)):se("",!0),xe(a.$slots,"tab-preferences")],64)):(v(),z(be,{key:1},[xe(a.$slots,"tab-default"),u[3]||(u[3]=U("div",{class:"h-6"},null,-1))],64))]),_:3},8,["modelValue","space-top"]))}}),Sg=Object.freeze(Object.defineProperty({__proto__:null,default:br},Symbol.toStringTag,{value:"Module"}));function Qn(e=0){return new Promise(t=>setTimeout(t,e))}function wa(e){const t=async(n,o)=>{var i;if(!n.toBlob){if(o)return;const r=n.cloneNode(),s=(i=r.getContext)==null?void 0:i.call(r,"2d");if(!s)return;try{s.drawImage(e,0,0)}catch{return}return t(r,!0)}return await new Promise(r=>{const s=l=>{if(!l)return r(void 0);const a=URL.createObjectURL(l);r(a)};try{n.toBlob(s,"image/jpeg",1)}catch{r(void 0)}})};return t(e,!1)}let ti;async function kg(e,t){if(ti||!t.startsWith("blob:"))return t;if(ti===void 0){try{if((await fetch(t)).ok)return ti=!0,t}catch{}ti=!1}e.complete||await new Promise(a=>{let u=0;const c=setInterval(()=>{e.complete?(a(),clearInterval(c)):++u>=30&&a()},100)});const o=e.naturalWidth,i=e.naturalHeight;if(!o||!i)return;const r=document.createElement("canvas"),s=r.getContext("2d");return r.width=o,r.height=i,s==null||s.drawImage(e,0,0,o,i),await wa(r)}function Cg(e){const t=new Set,n=e.getAttributeNames(),o=n.indexOf("src"),i=o!==-1;i&&(n.splice(o,1),n.push("src"));for(const r of n){if(r==="srcset"||i&&r===":src"||r!=="data-url"&&r!=="data-original"&&!r.includes("src"))continue;const s=e.getAttribute(r);s&&(r==="src"&&e.naturalWidth&&e.naturalWidth<200||t.add(s.replace(/(\n|\t)/g," ").trim()))}return Array.from(t)}function ni(e,t){return e>=75&&t>=50&&(e>=200||t>=200)}class Tg{constructor({onChanged:t}){ke(this,"isMounted",!0);ke(this,"elsDisposeCallbacksMap",new Map);ke(this,"onChanged");this.onChanged=t}dispose(){this.isMounted=!1,this.elsDisposeCallbacksMap.forEach(t=>t()),this.elsDisposeCallbacksMap=new Map,this.onChanged=()=>{}}async download(t){if(!this.isMounted)return;const n=t.el,o=!!n&&n instanceof HTMLImageElement,i=n?o?Cg(n):[await wa(n)].filter(Boolean):[t.src].filter(Boolean);if(!(!n&&!i.length||!this.isMounted)){if(n&&!this.elsDisposeCallbacksMap.has(n))if(o){let r=i.slice(-1)[0];const s=new MutationObserver(l=>{l.some(u=>{if(u.attributeName!=="src")return!1;const c=r;return r=n.getAttribute("src"),!!r&&c!==r})&&this.download(t)});s.observe(n,{attributes:!0}),this.elsDisposeCallbacksMap.set(n,()=>s.disconnect())}else{const r=n.getContext("2d");if(r){const s=r.drawImage.bind(r),l=r.putImageData.bind(r),a=(u,c,d)=>(setTimeout(()=>this.download(t),100),u.apply(c,d));try{r.drawImage=new Proxy(s,{apply:a}),r.putImageData=new Proxy(l,{apply:a})}catch{}this.elsDisposeCallbacksMap.set(n,()=>{try{r.drawImage=s,r.putImageData=l}catch{}})}}i.length&&(this.onChanged(t,{src:i[0],isLoading:!0,hasError:!1}),await this.downloadRawImage(t,i))}}async downloadRawImage(t,n){const o=t.el instanceof HTMLImageElement?t.el:void 0;for(let i=0;i<n.length;i++){const r=n[i],s=o?await kg(o,r):r;if(!s||!this.isMounted)return;const l=await Pg(s,o,a=>{this.isMounted&&this.onChanged(t,{src:s,size:a,isLoading:!1,hasError:!1})});if(l.ok||!this.isMounted)return;i===n.length-1&&this.onChanged(t,{src:s,isLoading:!1,hasError:!!l.error,invalid:!!l.invalid,size:l.size})}}}async function Pg(e,t,n){return(t==null?void 0:t.src)===e&&t.naturalWidth&&t.naturalHeight?(n({width:t.naturalWidth,height:t.naturalHeight}),t.complete?{ok:!0}:new Promise(o=>{t.addEventListener("load",()=>o({ok:!0}),{once:!0})})):await new Promise(o=>{const i=new Image,r=setInterval(()=>{const{naturalWidth:s,naturalHeight:l}=i;if(l&&s){const a={width:s,height:l};ni(s,l)?n(a):o({invalid:!0,size:a}),clearInterval(r)}},20);i.onerror=()=>{o({error:!0}),clearInterval(r)},i.onload=()=>setTimeout(()=>o({ok:!0}),25),i.src=e})}const Mg=3;class Eg{constructor(t){ke(this,"download");ke(this,"threads");ke(this,"completedItems");ke(this,"promisesMap",new Map);this.download=t.download}dispose(){var t;(t=this.threads)==null||t.dispose(),this.threads=void 0,this.completedItems=void 0}run({activeIndex:t,items:n}){var r;if(this.completedItems===n)return;this.completedItems=void 0,(r=this.threads)==null||r.dispose();let o=Math.max(0,t-1),i=!0;this.threads=new Ig(Mg,()=>{const s=n[o];if(!s){this.completedItems=n;return}i&&o===n.length-1?(i=!1,o=t-2):i?o++:o--;const l=s.src??s.el;if(l){const u=this.promisesMap.get(l);if(u)return u}const a=this.download(s);return l&&this.promisesMap.set(l,a),a}),this.threads.exec()}}class Ig{constructor(t,n){ke(this,"isDisposed",!1);this.limit=t,this.getNext=n}dispose(){this.isDisposed=!0}exec(){for(let t=0;t<this.limit;t++)this.next()}async next(){if(this.isDisposed)return;const t=this.getNext();t&&(await t,await Qn(20),this.next())}}class xa{constructor(){ke(this,"elsPool",new Map)}check(t){if(!t||t===document.body)return!0;const n=this.elsPool.get(t);if(n!==void 0)return n;const o=getComputedStyle(t);if(!(o.display!=="none"&&+(o.opacity??"1")>.1))return this.elsPool.set(t,!1),!1;const r=this.check(t.parentElement);return this.elsPool.set(t,r),r}}function Og(e,t){let n=[t??document.documentElement];const o=e.split("->");for(let i=0;i<o.length;i++){const r=o[i];n=n.map(s=>Array.from((s.shadowRoot??s).querySelectorAll(r))).flat()}return n}function eo(e,t){if(e instanceof HTMLOptionElement){const n=e.parentElement instanceof HTMLOptGroupElement?e.parentElement.parentElement:e.parentElement;if(!n||!(n instanceof HTMLSelectElement))return;const o=e.getAttribute("value")||"";if(n.value===o)return;n.value=o,n.dispatchEvent(new Event("change"));return}e instanceof HTMLAnchorElement&&(t==null?void 0:t.preventDefault)!==!1&&e.addEventListener("click",n=>n.preventDefault(),{once:!0}),e.click(),e.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse",button:0})),e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0}))}async function $g(e){const{lstrip:t,lstripBtn:n}=e||{};if(!t||!n||!!document.querySelector(t))return!1;const i=n.split(";");for(const r of i)if(!await zg(r.trim()))return!1;return!0}async function zg(e){const t=await gn(50,30,()=>document.querySelector(e));return t?(eo(t),await Qn(),!0):!1}class Dg{constructor({spec:t,onChanged:n}){ke(this,"spec");ke(this,"onChanged");ke(this,"rawImages",[]);ke(this,"isMounted",!0);ke(this,"loadRawImagesTs");ke(this,"imgListenersMap",new Map);ke(this,"disconnectObservers");ke(this,"contentEl");ke(this,"reloadRawImages",ct(()=>{this.contentEl&&this.loadRawImages(this.contentEl)},100));this.spec=t,this.onChanged=n,this.init()}dispose(){var t;this.isMounted=!1,(t=this.disconnectObservers)==null||t.call(this),this.disconnectObservers=void 0,this.onChanged=()=>{}}init(){var i;const t=new MutationObserver(this.reloadRawImages),n=(i=this.spec)!=null&&i.imgDivs?void 0:(()=>{let r=window.innerWidth;return new ResizeObserver(ct(()=>{const s=window.innerWidth;if(s!==r){r=s;return}this.reloadRawImages()},50))})();this.disconnectObservers=async()=>{t.disconnect(),n==null||n.disconnect()};let o=!1;this.loadContentEl(r=>{this.contentEl!==r&&(this.contentEl=r,t.disconnect(),n==null||n.disconnect(),t.observe(this.contentEl,{childList:!0,subtree:!0}),n==null||n.observe(this.contentEl),o?this.reloadRawImages():(o=!0,this.loadRawImages(this.contentEl)))})}setRawImages(t){let n=!1;const o=t.map((i,r)=>{const s=this.rawImages[r];return s&&s.el===i.el&&s.parentEl===i.parentEl&&s.src===i.src?s:(n=!0,i)});(n||!o.length)&&(this.rawImages=o,this.onChanged(t))}async loadContentEl(t){var l;const n=await $g(this.spec),o=(l=this.spec)==null?void 0:l.content;if(!o){t(document.body);return}let i=await gn(n?100:1,10,()=>{for(const a of o.split(",")){const u=document.querySelector(a);if(u)return u}});if(!i)return;t(i);let r=0;const s=async()=>{if(this.isMounted&&!(i!=null&&i.isConnected)){if(r=0,i=await gn(50,20,()=>{const a=document.querySelector(o);return a!=null&&a.isConnected&&a!==i?a:void 0}),!i)return;t(i)}!this.isMounted||++r>=10||setTimeout(s,200)};setTimeout(s,200)}async loadRawImages(t){var r;if(!this.isMounted||!t.isConnected)return;const n=Date.now();this.loadRawImagesTs=n;const o=(r=this.spec)==null?void 0:r.imgDivs,i=o?await this.loadFromImgDivs(t,o):this.loadFromContentEl(t);this.loadRawImagesTs!==n||!t.isConnected||!this.isMounted||this.setRawImages(i)}async loadFromImgDivs(t,n){const o=Og(n,t);if(!o.length)return this.loadFromContentEl(t);const i=new xa;return o.map(s=>{const l=Array.from(s.querySelectorAll("img,canvas"));for(const a of l){if(!i.check(a)){this.observeInvalidImgEl(a);continue}if(a instanceof HTMLCanvasElement){if(_a(a))return{el:a,parentEl:s}}else if(a instanceof HTMLImageElement){if(Sa(a))return{el:a,parentEl:s};this.observeInvalidImgEl(a)}}return{parentEl:s}})}loadFromContentEl(t){const n=[],o={},i=new xa;return Array.from(t.querySelectorAll("img,canvas")).forEach(s=>{if(!i.check(s)){this.observeInvalidImgEl(s);return}if(s instanceof HTMLCanvasElement)_a(s)&&n.push({el:s});else if(s instanceof HTMLImageElement)if(Sa(s)){const l=s.getAttribute("src");if(l){const a=o[l];if(a!==void 0&&a!==-1){n.splice(a,1);return}o[l]=n.length}n.push({el:s})}else this.observeInvalidImgEl(s)}),n}observeInvalidImgEl(t){if(!(t instanceof HTMLImageElement)||this.imgListenersMap.has(t))return;const n=()=>{t.removeEventListener("load",n),this.imgListenersMap.delete(t),this.reloadRawImages()};this.imgListenersMap.set(t,n),t.addEventListener("load",n)}}function _a(e){return e.isConnected&&ni(e.width,e.height)}function Sa(e){if(!e.isConnected)return!1;const t=e.getBoundingClientRect();return!t.width||!t.height||ni(t.width,t.height)}const oi="mp-scroll-container";class yr{constructor(){ke(this,"scrollEl")}dispose(){var t;(t=this.scrollEl)==null||t.classList.remove(oi)}scrollTo({rawImages:t,page:n,skipIfVisible:o,isScrollDown:i,isScrollExact:r,fallbackScrollEl:s}){var D;const l=Math.floor(n),a=t[Math.min(t.length-1,l)];if(!a)return;const u=a.el??a.parentEl??(a.src?document.querySelector(`img[src^="${a.src}"]`):void 0);if(!u)return;const c=u.getBoundingClientRect();if(o&&c.top<=0&&c.top+c.height>0)return;const d=yr.getScrollable(u,s);if(!d)return;const{el:f,top:p}=d;s!==document.documentElement&&!f.classList.contains(oi)&&(f!==this.scrollEl&&((D=this.scrollEl)==null||D.classList.remove(oi),this.scrollEl=f),f.classList.add(oi));const x=n>=t.length?c.height:r?n%1*c.height:i?Math.max(0,c.height-window.innerHeight/2):-window.innerHeight/2,_={top:p+x,behavior:"instant"};f.scrollTo(_),f!==document.documentElement&&document.documentElement.scrollTo(_)}static getScrollable(t,n){const o=(i,r)=>{if(!i)return;const{offsetTop:s,offsetParent:l}=i;if(l&&s&&r.set(l,Math.max(r.get(l)??0,s)),!(i===n||i.scrollHeight-i.clientHeight>=10&&window.getComputedStyle(i).overflow!=="visible"))return o(i.parentElement,r);let u=0;return r.forEach((c,d)=>{u+=d===l?c-s:c}),{el:i,top:u}};return o(t,new Map)}}function ka(e){var t,n;for(let o=0;o<e.length;o++){const i=((t=e[o])==null?void 0:t.el)??((n=e[o])==null?void 0:n.parentEl),r=i==null?void 0:i.getBoundingClientRect();if(!r||r.bottom<=0)continue;const s=r.top;return o+(s>=0?0:-s/r.height)}return 0}function Ag(e){if(document.documentElement.scrollTop<700)return 0;const n=Array.from(document.querySelectorAll("img[src]")).filter(o=>e.includes(o.src)).map(o=>({el:o}));return ka(n)}function jg(e){var R,Q,H;const t=(R=e.raw.value)==null?void 0:R.isWebtoon,n=ee(t===!1),o=ee(t);let i=!1;const r=e.touchDevice&&!navigator.userAgent.toLowerCase().includes("android"),s=((H=(Q=e.raw.value)==null?void 0:Q.imgs)==null?void 0:H.filter(Boolean))??[];let l=e.isAutoShow!==!1?e.page.value:s.length?Ag(s):void 0,a=s.map(T=>({src:T})),u,c;const d=new Map,f=({src:T,el:Y})=>{const S=Y??T;return S?d.get(S):void 0},p=ee(s.map(T=>({src:T,isLoading:!0,hasError:!1}))),x=()=>{const T=[];a.forEach(Y=>{const{src:S,el:J}=Y,F=J??S,k=F?d.get(F):void 0;(F&&!(k!=null&&k.invalid)||Y.parentEl)&&T.push(k)}),p.value=T};let _=setTimeout(e.onTimeout,2e4);const D=()=>{_&&(clearTimeout(_),_=void 0)};let b=0,P=0;const A=4,w=new Tg({onChanged(T,Y){const S=T.el??T.src;if(!S||(d.set(S,Y),x(),Y.isLoading))return;if(Y.hasError){if(c||o.value!==void 0)return;c=setTimeout(()=>{c=void 0,o.value===void 0&&e.onError("Failed to load images")},3e3);return}const{size:J,invalid:F}=Y;if(!(!J||F)){if(!o.value&&P<A){const k=i?a:a.filter(({el:me,src:ge})=>ge||!(me&&me instanceof HTMLImageElement&&!d.has(me)));let y=k.indexOf(T);if(i&&y>4||y===-1&&(T.el&&(y=k.findIndex(me=>me.el===T.el)),y===-1))return;const O=y>Math.min(1,k.length-3)&&y<Math.max(k.length-2,3),$=J.width/J.height;$>2&&b++;const le=$<.5||b>=A,ae=!le&&.65<$&&$<.75;ae&&P++,o.value!==le&&(O||le)&&(o.value=le),O&&n.value!=ae&&(n.value=!0),o.value===void 0&&ae&&P===A&&(o.value=!1)}K()}}}),g=new Eg({download:async T=>{!(T.el&&d.has(T.el))&&!(T.src&&d.has(T.src))&&await w.download(T)}}),I=()=>{g.run({items:a,activeIndex:Math.min(a.length-1,Math.floor(e.page.value))})},q=new yr;if(s.length)I();else{let T=!1;u=new Dg({spec:e.spec,async onChanged(Y){var S;if(a=Y,x(),!e.raw.value&&!Y.length){e.onError("no_img");return}(S=e.spec)!=null&&S.imgDivs&&!T&&e.isAutoShow!==!1&&e.page.value&&(T=!0,q.scrollTo({rawImages:Y,page:e.page.value,skipIfVisible:!0,fallbackScrollEl:r?document.body:document.documentElement,isScrollDown:!0}),await Qn(1)),l===void 0&&e.isAutoShow===!1&&(l=ka(Y)),I()}})}Ti(()=>{w.dispose(),g.dispose(),u==null||u.dispose(),c&&clearTimeout(c),q.dispose(),i&&q.scrollTo({rawImages:a,page:e.page.value,fallbackScrollEl:document.documentElement,isScrollExact:!0})});function K(){if(i||o.value===void 0||l===void 0)return;const T=Math.max(0,Math.min(l,a.length)),Y=Math.min(Math.floor(T),a.length-1);if(Y>=1){const J=a[Y];if(!J||!f(J)){e.isAutoShow&&q.scrollTo({rawImages:a,page:Y,fallbackScrollEl:r?document.body:document.documentElement,isScrollDown:!0});return}for(let F=Y;F<a.length;F++){const k=f(a[F]);if(!k)return;if(!k.invalid){if(!k.size&&!k.hasError)return;break}}for(let F=Y-1;F>=0;F--){const{src:k,el:y}=a[F],O=y??k;if(!O)break;const $=d.get(O);if(!$)return;if(!$.invalid){if(!$.size&&!$.hasError)return;break}}}if(i)return;i=!0,D(),e.onReady(T);let S=!0;ue(()=>Math.floor(e.page.value),(J,F)=>{J===F&&!S||(q.scrollTo({rawImages:a,page:J,isScrollDown:F===void 0||J>F||a.length===1,skipIfVisible:S&&a.length>1,fallbackScrollEl:r?document.body:document.documentElement}),S=!1,F??(F=-1),I())},{immediate:!0})}return{asyncImgs:G(()=>p.value),isWebtoon:G(()=>o.value??!1),isManga:G(()=>n.value)}}function Ca({touchDevice:e,isBusy:t,isPlaying:n,isIdle:o,hideControlsEvent:i,scrollEl:r,moveThreshold:s}){const l=ee(!0);let a=!1,u=!1;const c={x:0,y:0};let d;function f(b){if(i.value===tn.never||t.value&&l.value)return;const P=typeof b=="boolean"?b:!l.value;P!==l.value&&(l.value=P,!a&&!P&&(a=!0))}function p(){r.value&&(c.x=r.value.scrollLeft,c.y=r.value.scrollTop)}function x(){const b=i.value===tn.firstMove,P=r.value;if(!P)return;const A=Uo(()=>{if(!l.value){Lg(P)&&f(!0);return}if(b&&a)return;const w=Math.abs(P.scrollTop-c.y)||Math.abs(P.scrollLeft-c.x),g=s??(b?c.y===0?300:200:150);w>g&&f(!1)},100);P.addEventListener("scroll",A),d=()=>{P.removeEventListener("scroll",A)}}function _(){switch(d==null||d(),d=void 0,i.value){case tn.onLoad:a||f(!1);break;case tn.firstMove:x();break;case tn.move:x();break;case tn.never:l.value||(l.value=!0);break}}function D(){u||(u=!0,p(),_(),e&&ue(Zi(),P=>{P==="hidden"&&!n.value&&!l.value&&f(!0)}),ue(t,b=>{b&&!l.value&&f()}),ue(n,b=>{b||f(!0)}),ue(o,b=>{n.value&&f(!b)}),ue(l,b=>{b&&p()}),ue(i,()=>_()),ue(r,()=>_()),Mt(()=>{d==null||d(),d=void 0}))}return{visible:G(()=>l.value),toggle:f,activate:D}}function Lg(e){const t=Math.max(0,e.scrollTop),n=Math.abs(e.scrollLeft);if(n<10&&t<10)return!0;const{scrollHeight:o,clientHeight:i}=e;if(o>i)return t>o-i-10;const{scrollWidth:s,clientWidth:l}=e;return s>l&&n>s-l-10}function Bg(e,t,n){return G(()=>t.value?Ta(e.value,n.value):e.value.map((o,i)=>[{img:o,index:i}]))}function Ta(e,t,n=0){if(e.length===0)return[];const o=e.slice(0,2),i=o.some(s=>(s==null?void 0:s.size)&&s.size.width>s.size.height),r=i||t?[o[0]]:o;return[r.map((s,l)=>({img:s,index:n+l})),...Ta(e.slice(r.length),t&&i,n+r.length)]}const wr=40;function Vg({page:e,totalImgs:t,direction:n,style:o,isLongStrip:i,isVertical:r,isRTL:s,spaceTop:l,scrollEl:a,isWebtoon:u,interferePlayer:c,onChangedPage:d,onFinished:f}){let p=!1,x=!1,_,D=!1,b;const P=ct(Q,300),A=Uo(()=>{Q(),P()},300),w=y=>(q(y),ct(q,50)(y));function g(){const y=new Promise(O=>{_=()=>{_=void 0,O()}});return K(e.value,{smooth:!1,ensureLastImgVisibility:!0}),y}function I(){var y;x=!0,_==null||_(),H(),(y=a.value)==null||y.addEventListener("scroll",A),setTimeout(()=>{const{width:O,height:$}=hn();ue(O,()=>{r.value&&w(e.value)}),ue($,()=>{r.value||w(e.value)}),ue(o,()=>w(e.value)),ue(n,()=>w(e.value)),/iPad|iPhone|iPod/.test(navigator.userAgent)&&ue(t,()=>{s.value&&w(e.value)})},300)}async function q(y){if(!(!x||p)){if(p=!0,await gt(),Y()===y){p=!1;return}K(y)}}function K(y,{smooth:O,ensureLastImgVisibility:$=!1}={smooth:!1}){const le=a.value;if(!le)return;p=!0;const ae=async()=>{await gt(),p=!1,x||I()},me=Math.floor(y),ge=vr(le,me);if(!ge){ae();return}c(async()=>{await R(le,!i.value&&O,async()=>{await k(le,ge,{smooth:O,page:y,ensureLastImgVisibility:$})}),await ae()})}async function R(y,O,$){O&&y.style.setProperty("scroll-snap-type","none"),await $(),O&&y.style.removeProperty("scroll-snap-type")}function Q(){if(p)return;const y=Y();y!==void 0&&y!==e.value&&d(y),H()}function H(){D||!D&&T()&&(D=!0,f())}function T(){const y=a.value;if(!y)return!1;const O=i.value?u.value?3:!r.value&&y.clientWidth>y.clientHeight?2.25:2.5:2;return r.value?y.scrollHeight-y.scrollTop<y.clientHeight*O:y.scrollWidth-(s.value?-y.scrollLeft:y.scrollLeft)<y.clientWidth*O}function Y(){const y=S();return y?(+y.getAttribute("data-index")||0)+(i.value?J(y):0):void 0}function S(){var O;if(b??(b=a.value.getRootNode()),!b)return;const y=(O=b.elementsFromPoint)==null?void 0:O.call(b,r.value||!i.value?window.innerWidth/2:s.value?window.innerWidth-wr:wr,r.value&&i.value?l.value||wr:window.innerHeight/2);if(y)for(let $=0;$<y.length;$++){const le=y[$];if(le.hasAttribute("data-index"))return le;if(le===a.value)break}}function J(y){const O=y.getBoundingClientRect();return r.value?Math.abs(O.top-l.value)/O.height:s.value?Math.max(0,O.right-a.value.clientWidth)/O.width:Math.abs(O.left)/O.width}let F=!1;async function k(y,O,$){if(F)return;const le=O.getBoundingClientRect();if(!i.value){if(r.value){if(le.top<=0&&le.bottom>=y.clientHeight)return}else if(le.left<=0&&le.right>=y.clientWidth)return}F=!0;const ae=r.value?y.scrollTop:y.scrollLeft,me=$.page,ge=i.value?me%1:0,Se=await gn(30,10,async()=>{await Qn();let ze;if(!(O.offsetHeight<10))return i.value?r.value?ze=O.offsetTop+ge*O.offsetHeight-l.value:s.value?ze=O.offsetLeft-y.clientWidth+O.offsetWidth-ge*O.offsetWidth:ze=O.offsetLeft+ge*O.offsetWidth:r.value?ze=O.offsetTop+(le.top>0?0:le.height-y.clientHeight):ze=O.offsetLeft+(le.left>0?0:le.width-y.clientWidth),me>.5&&Math.abs(ze)<100?void 0:ze})??0,De=$.ensureLastImgVisibility?r.value?Math.min(Se,y.scrollHeight-y.clientHeight*2):s.value?Math.max(Se,-(y.scrollWidth-y.clientWidth*2)):Math.min(Se,y.scrollWidth-y.clientWidth*2):Se;if(!$.smooth){r.value?y.scrollTop=De:y.scrollLeft=De,F=!1;return}const Ke=De-ae,ut=30;let Qe=0;return new Promise(ze=>{(function Tn(){const h=Ng(Qe,ae,Ke,ut);r.value?y.scrollTop=h:y.scrollLeft=h,Qe++,Qe<=ut?requestAnimationFrame(Tn):(ze(),F=!1)})()})}return{init:g,goToPage:K}}function Ng(e,t,n,o){return n*(Math.pow(e/o-1,3)+1)+t}class Rg{constructor(t){ke(this,"player");ke(this,"debounceStartPlayer");ke(this,"isPlaying");ke(this,"isIdle",ee(!1));ke(this,"onIdle");this.player=t.player,this.debounceStartPlayer=ct(()=>this.player.start(),100);const n=ee(t.autoPlay||sessionStorage.getItem("mp:playing")==="true");this.isPlaying=G({get:()=>n.value,set:o=>{n.value=o,sessionStorage.setItem("mp:playing",o?"true":"false")}}),this.onIdle=ct(()=>{this.isIdle.value=!0},t.touchDevice?2e3:1e3),this.awake(),t.touchDevice||St(window,"mousemove",()=>this.awake()),je(()=>{t.touchDevice||ue(Zi(),i=>{this.isPlaying.value&&(i==="visible"?this.player.start():this.player.stop())}),ue(t.speed,()=>this.interfere()),ue(t.isBusy,o=>{!o&&this.isIdle.value&&this.awake()})}),Mt(()=>this.stop())}activate(){this.isPlaying.value&&this.player.start()}toggle(){this.isPlaying.value?this.stop():this.start()}async interfere(t){this.isPlaying.value&&this.player.stop(),t&&(await gt(),await t()),this.isPlaying.value&&this.debounceStartPlayer()}stop(){this.isPlaying.value&&(this.isPlaying.value=!1,this.player.stop(),this.awake())}start(){this.isPlaying.value||(this.isPlaying.value=!0,this.player.start(),this.awake())}pause(){this.player.stop()}resume(){this.player.start()}awake(){setTimeout(()=>{this.isIdle.value=!1,this.onIdle()},30)}}class Pa extends Rg{getMaxOffset(t){return t.scrollHeight-t.clientHeight}getScrollOffset(t){return t.scrollTop}setScrollOffset(t,n){t.scrollTop+=n}constructor(t){let n,o;const{scrollEl:i,speed:r}=t;super({...t,player:{stop:()=>o==null?void 0:o(),start:()=>{const s=i.value;if(!this.isPlaying.value||!s)return;const l=this.getMaxOffset(s),a=this.getScrollOffset(s);if(l<=a){this.stop();return}o=()=>{n=Date.now(),o=void 0};const u=Date.now();n=u;const c=.1*r.value;let d=Date.now(),f=0;const p=()=>{if(n!==u)return;const x=Date.now(),_=x-d;d=x;const D=c*_+f;D>=1?(f=D%1,this.setScrollOffset(s,D-f)):f=D,setTimeout(p,1)};p()}}})}}class Hg extends Pa{constructor(n){super(n);ke(this,"isLongStrip");ke(this,"isVertical");ke(this,"isRTL");const{isLongStrip:o,isVertical:i,isRTL:r}=n;this.isLongStrip=o,this.isVertical=i,this.isRTL=r,o!==void 0&&je(()=>{ue(o,s=>{s||stop()})})}getMaxOffset(n){return this.isVertical.value?n.scrollHeight-n.clientHeight:n.scrollWidth-n.clientWidth}getScrollOffset(n){return this.isVertical.value?n.scrollTop:this.isRTL.value?-n.scrollLeft:n.scrollLeft}setScrollOffset(n,o){n[this.isVertical.value?"scrollTop":"scrollLeft"]+=o*(this.isRTL.value?-1:1)}start(){var n;((n=this.isLongStrip)==null?void 0:n.value)!==!1&&super.start()}}function Fg(e){return new Hg(e)}function Wg({speed:e,fontSize:t,lineHeight:n,...o}){const i=hn().width;return new Pa({...o,speed:G(()=>{const r=900/Math.min(900,i.value)/3.5,s=t.value/48*1.75,l=n.value/96*1.75,a=r*s*l;return e.value*a})})}const qg={key:3,class:"fixed inline-block left-1/2 -translate-x-1/2 bottom-0 p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3"},Ma=pe({inheritAttrs:!1,__name:"GearSecond",props:{chapterNavData:{type:Object},busy:{type:Boolean},defaultPreferences:{type:Object},immediate:{type:Boolean},appVersion:{type:String},raw:{type:Object},spec:{type:Object},siteMeta:{type:null},page:{type:Number},spaceTop:{type:Number},touchDevice:{type:Boolean},entryId:{type:String},isAutoShow:{type:Boolean},tourEnabled:{type:Boolean},offlineMode:{type:Boolean}},emits:["clickEntryButton","hideReader","openHelpScreen","error","crash","ready","pageChanged","playingChanged","tourEnabledChanged","dispose","openEntry","addEntry","finished","getHiddenChapters","hapticFeedback","pressedBack","selectChapter","timeout","openDefaultPreferences","defaultPreferencesChanged","controlsVisibilityChanged"],setup(e,{emit:t}){var V,N;const n=e,o=t,i=ee(!1),r=ee(!1),s=G(()=>n.busy),l=G(()=>n.page),a=G(()=>n.immediate||i.value?n.spaceTop??0:0),u=G(()=>!n.touchDevice&&S.isIdle.value&&!n.busy&&!I.value),{asyncImgs:c,isWebtoon:d}=jg({raw:G(()=>n.raw),spec:n.spec,page:l,touchDevice:n.touchDevice,isAutoShow:n.isAutoShow,async onReady(E){me(E),i.value=!0},onError:()=>o("error"),onTimeout:()=>o("timeout")}),{direction:f,style:p,isRTL:x,isDouble:_,isVertical:D,isLongStrip:b,gap:P,speed:A,zoom:w,breakFirst:g}=ph({touchDevice:n.touchDevice,isWebtoon:d,titleName:(V=n.raw)==null?void 0:V.title.name,defaultPreferences:G(()=>n.defaultPreferences)}),I=ee(!1),q=Bg(c,_,g),K=G(()=>c.value.length),R=G(()=>l.value>=K.value),Q=ee(null),H=ee(null),T=G(()=>{var E;return(E=H.value)==null?void 0:E.rootEl}),Y=ee(!1),S=Fg({autoPlay:!n.tourEnabled&&(((N=n.defaultPreferences)==null?void 0:N.autoPlay)??!1),touchDevice:n.touchDevice,scrollEl:T,speed:A,isRTL:x,isVertical:D,isLongStrip:b,isBusy:s}),J=G({get(){return w.value},set(E){S.interfere(()=>{w.value=E})}}),F=Ca({touchDevice:n.touchDevice,isBusy:s,isPlaying:G(()=>S.isPlaying.value),isIdle:G(()=>S.isIdle.value),hideControlsEvent:G(()=>n.defaultPreferences.hideControlsEvent),scrollEl:T}),k=F.visible,y=Vg({page:l,totalImgs:K,style:p,direction:f,isLongStrip:b,isVertical:D,isRTL:x,spaceTop:a,isWebtoon:d,scrollEl:G(()=>{var E;return(E=H.value)==null?void 0:E.rootEl}),interferePlayer:E=>S.interfere(E),onChangedPage:me,onFinished:()=>o("finished")}),O=G(()=>Math.floor(l.value)),$=G(()=>b.value?l.value:_.value?Tn():Math.floor(l.value)),le=()=>S.interfere(()=>Qn(100));$t({onKeyDown:E=>{if(n.tourEnabled)return!0;const C=b.value&&D.value,L=b.value&&!D.value,j=!b.value&&D.value,re=!b.value&&!D.value;switch(E.key){case" ":E.preventDefault(),b.value||h();break;case"ArrowUp":case"PageUp":C?le():j&&O.value!==0&&(E.preventDefault(),Qe());break;case"ArrowDown":case"PageDown":C?le():j&&!R.value&&(E.preventDefault(),ze());break;case"ArrowLeft":L?le():re?(E.preventDefault(),Ke()):D.value&&De();break;case"ArrowRight":L?le():re?(E.preventDefault(),ut()):D.value&&Se();break;case"Escape":E.preventDefault();break}},onKeyUp:E=>{switch(E.key){case"b":g.value=!g.value;break}}}),ue(S.isPlaying,E=>{o("playingChanged",E)}),ue(k,E=>{o("controlsVisibilityChanged",E)});async function ae(){await y.init(),o("ready"),r.value=!0,F.activate(),S.activate()}function me(E){if(l.value===E)return;const C=c.value.length;if(E<0||E>=C+1)return;const L=Math.floor(E*100)/100;if(L===l.value)return;const j=l.value;if(o("pageChanged",L),E<.01&&j>E){S.awake();return}}function ge(){!n.touchDevice&&!b.value&&y.goToPage(O.value,{smooth:!0})}function Se(E=!1){var C,L;(L=(C=n.chapterNavData)==null?void 0:C.next)==null||L.call(C,E)}function De(E=!1){var C,L;(L=(C=n.chapterNavData)==null?void 0:C.prev)==null||L.call(C,E)}function Ke(){x.value?ze():Qe()}function ut(){x.value?Qe():ze()}function Qe(){var L;const E=q.value,C=R.value?E[E.length-1][0].index:(L=E[Tn()-1])==null?void 0:L[0].index;C!==void 0?y.goToPage(C):De()}function ze(){var E,C;if(R.value)Se();else{const L=((C=(E=q.value[Tn()+1])==null?void 0:E[0])==null?void 0:C.index)??c.value.length;y.goToPage(L)}}function Tn(){const E=O.value,C=q.value.findIndex(L=>L.some(({index:j})=>j===E));return C===-1?q.value.length-1:C}function h(E){F.toggle(E)}function m(){if(S.isPlaying.value){k.value||!n.touchDevice?S.stop():(S.awake(),F.toggle(!0));return}F.toggle()}function M(){S.stop(),o("clickEntryButton")}function W(){F.toggle(!1),S.isPlaying.value&&S.stop(),o("openHelpScreen")}return(E,C)=>e.immediate||i.value?(v(),oe(hr,{key:0,ref_key:"gearLayout",ref:Q,loading:!r.value,immediate:!!e.immediate,idle:u.value,class:"text-stone-100",onClick:C[20]||(C[20]=Le(()=>{},["stop"]))},{default:ne(()=>{var L,j,re,te;return[i.value?(v(),oe(ha,{key:0,ref_key:"body",ref:H,zoom:J.value,"onUpdate:zoom":C[1]||(C[1]=X=>J.value=X),zooming:I.value,"onUpdate:zooming":C[2]||(C[2]=X=>I.value=X),page:l.value,"page-index":O.value,pages:Z(q),"total-imgs":Z(c).length,direction:Z(f),gap:Z(P),"is-long-strip":Z(b),isRTL:Z(x),"is-double":Z(_),"is-vertical":Z(D),"space-top":a.value||0,busy:s.value,"play-controller":Z(S),"touch-device":e.touchDevice,"pinch-to-zoome":((L=e.defaultPreferences)==null?void 0:L.pinchToZoom)??!0,"tap-zone":(j=e.defaultPreferences)==null?void 0:j.tapZone,"controls-visible":Z(k),onReady:ae,onPrev:Qe,onNext:ze,onClick:m,onDragEnd:ge,onWheelPassive:C[3]||(C[3]=()=>Z(S).interfere())},Mi({_:2},[i.value&&Z(c).length?{name:"end",fn:ne(()=>{var X,ce;return[B(Gi,{"has-next":!!((X=e.chapterNavData)!=null&&X.next),"offline-mode":!!e.offlineMode,seconds:((ce=e.defaultPreferences)==null?void 0:ce.autoNextSeconds)??5,"show-add-button":Z(w)===1&&!e.entryId&&!!e.raw&&!e.offlineMode,onNext:Se,onAddToLibrary:M,onHide:C[0]||(C[0]=()=>o("hideReader"))},null,8,["has-next","offline-mode","seconds","show-add-button"])]}),key:"0"}:void 0]),1032,["zoom","zooming","page","page-index","pages","total-imgs","direction","gap","is-long-strip","isRTL","is-double","is-vertical","space-top","busy","play-controller","touch-device","pinch-to-zoome","tap-zone","controls-visible"])):se("",!0),B(br,{modelValue:Y.value,"onUpdate:modelValue":C[10]||(C[10]=X=>Y.value=X),"enable-help":"",name:(re=e.raw)==null?void 0:re.title.name,"space-top":a.value,"enable-default-preferences":!e.touchDevice||!!e.appVersion,onHelp:W,onMore:C[11]||(C[11]=()=>o("openDefaultPreferences"))},{"tab-preferences":ne(()=>[B(da,{"enable-reset":!e.touchDevice||!!e.appVersion,webtoon:Z(d),"reader-style":Z(p),"onUpdate:readerStyle":C[4]||(C[4]=X=>$e(p)?p.value=X:null),direction:Z(f),"onUpdate:direction":C[5]||(C[5]=X=>$e(f)?f.value=X:null),gap:Z(P),"onUpdate:gap":C[6]||(C[6]=X=>$e(P)?P.value=X:null),speed:Z(A),"onUpdate:speed":C[7]||(C[7]=X=>$e(A)?A.value=X:null),zoom:J.value,"onUpdate:zoom":C[8]||(C[8]=X=>J.value=X),"default-preferences":e.defaultPreferences},null,8,["enable-reset","webtoon","reader-style","direction","gap","speed","zoom","default-preferences"])]),"tab-default":ne(()=>[B(fr,{"model-value":e.defaultPreferences,"onUpdate:modelValue":C[9]||(C[9]=X=>o("defaultPreferencesChanged",X))},null,8,["model-value"])]),_:1},8,["modelValue","name","space-top","enable-default-preferences"]),r.value&&!R.value&&!e.tourEnabled?(v(),oe(la,{key:1,direction:Z(f),"tap-zone":(te=e.defaultPreferences)==null?void 0:te.tapZone},null,8,["direction","tap-zone"])):se("",!0),r.value&&!R.value?(v(),oe(gr,{key:2,playing:Z(S).isPlaying.value},null,8,["playing"])):se("",!0),B(aa,{visible:Z(k),"space-top":a.value},Mi({top:ne(()=>{var X;return[e.raw||e.offlineMode?(v(),oe(Ji,{key:0,"offline-mode":e.offlineMode,raw:e.raw,onClick:C[12]||(C[12]=()=>o("pressedBack"))},null,8,["offline-mode","raw"])):se("",!0),!e.touchDevice&&!e.offlineMode?(v(),oe(Yo,{key:1,onClick:C[13]||(C[13]=()=>o("hideReader"))})):se("",!0),e.chapterNavData?(v(),oe(sr,{key:2,"touch-device":e.touchDevice,"chapter-spec":(X=e.spec)==null?void 0:X.chapter,data:e.chapterNavData,rtl:Z(x),onGetHiddenChapters:C[14]||(C[14]=()=>o("getHiddenChapters")),onPrev:De,onNext:Se},null,8,["touch-device","chapter-spec","data","rtl"])):se("",!0)]}),"bottom-right":ne(()=>[!e.offlineMode&&e.raw?(v(),oe(Qi,{key:0,"entry-id":e.entryId,onClick:M},null,8,["entry-id"])):se("",!0),B(or,{disabled:!i.value,onClick:C[15]||(C[15]=()=>Y.value=!0)},null,8,["disabled"]),e.touchDevice?se("",!0):(v(),oe(ir,{key:1,onRequestFullScreen:C[16]||(C[16]=()=>{var X,ce;return(ce=(X=Q.value)==null?void 0:X.rootEl)==null?void 0:ce.requestFullscreen()})})),Z(b)?(v(),oe(nr,{key:2,"tour-message":"Press here to play like a video",playing:Z(S).isPlaying.value,disabled:!r.value,onClick:C[17]||(C[17]=()=>Z(S).toggle())},null,8,["playing","disabled"])):se("",!0),Z(_)?(v(),oe(Ge,{key:3,title:"Break 1st page (B)","data-tour":"Press here to separate the first page from double-page mode",disabled:!r.value,onClick:C[18]||(C[18]=()=>g.value=!Z(g))},{default:ne(()=>[Z(g)?(v(),oe(ua,{key:0})):(v(),oe(ca,{key:1}))]),_:1},8,["disabled"])):se("",!0)]),progress:ne(()=>{var X,ce;return[((X=e.defaultPreferences)==null?void 0:X.progressSize)!==0&&!R.value?(v(),oe(mr,{key:0,value:$.value,total:Z(q).length,"long-strip":Z(b),height:((ce=e.defaultPreferences)==null?void 0:ce.progressSize)??2,rtl:Z(x)},null,8,["value","total","long-strip","height","rtl"])):se("",!0)]}),default:ne(()=>[e.appVersion&&a.value&&!e.offlineMode?(v(),z("div",{key:0,class:"fixed top-0 left-0 right-0 bg-black bg-opacity-70 pointer-events-auto",style:Pe({height:`${a.value}px`})},null,4)):se("",!0)]),_:2},[Z(q).length?{name:"bottom-left",fn:ne(()=>[B(fa,{"model-value":O.value,disabled:!r.value,pages:Z(q),"total-imgs":Z(c).length,"onUpdate:modelValue":Z(y).goToPage},null,8,["model-value","disabled","pages","total-imgs","onUpdate:modelValue"])]),key:"0"}:void 0]),1032,["visible","space-top"]),Z(k)||I.value?(v(),z("div",qg,[B(Vo,{name:"fade","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:ne(()=>[I.value||Z(w)!==1?(v(),oe(ql,{key:0,zoom:J.value,onClick:C[19]||(C[19]=Le(()=>J.value=1,["stop"])),class:"duration-200"},null,8,["zoom"])):se("",!0)]),_:1})])):se("",!0),xe(E.$slots,"default")]}),_:3},8,["loading","immediate","idle"])):se("",!0)}}),Ug=Object.freeze(Object.defineProperty({__proto__:null,default:Ma},Symbol.toStringTag,{value:"Module"}));function Kg({sel:e,heading:t}){const o="h1, h2, h3, h4, h5, h6, p, blockquote, pre, code, strong, b, em, i, small, sub, sup, mark, time, abbr, br, hr".split(",").map(d=>d.trim()),i=["br","hr"],r=["button","figure","img","script","select","input","form","iframe","nav","footer","aside","table"],s=Zg(e),l=Yg(s),a=u(s);if(!a)return;if(t){const d=document.createElement("h1");d.innerText=t,a.prepend(d)}return{el:a,isRTL:l};function u(d){let f=0,p=!1,x=0,_=!1;const D=b(d);if(!D)return;Xg(D),c(D);function b(P,A=!1){var Y;if(_)return;if(P.nodeType===Node.TEXT_NODE)return A||(Y=P.textContent)!=null&&Y.trim()?P.cloneNode():void 0;if(P.nodeType!==Node.ELEMENT_NODE)return;const g=P.tagName.toLocaleLowerCase();if(r.includes(g)||g==="a"&&!A||P.getAttribute("aria-hidden")==="true")return;const I=window.getComputedStyle(P);if(!(I.display!=="none"&&+(I.opacity??"1")>.1&&I.position!=="fixed"))return;const K=Array.from(P.childNodes);if(!K.length)return i.includes(g)?document.createElement(P.tagName):void 0;const R=A||o.includes(g),Q=[];if(K.forEach(S=>{if(_)return;const J=b(S,R);J?(Q.push(J),p?x=0:++f>30&&(p=!0)):p&&++x>30&&(_=!0)}),!Q.length)return;const H=document.createElement(g==="body"?"div":g==="a"?"span":g),T=P.getAttribute("dir");return T&&T!=="auto"&&H.setAttribute("dir",T),Q.forEach(S=>H.appendChild(S)),H}return D}function c(d){Ea(d,f=>{if(f===d||o.includes(f.tagName.toLowerCase()))return;const p=f.parentElement;if((p==null?void 0:p.childNodes.length)===1){Array.from(f.childNodes).forEach(D=>{p.appendChild(D)}),p.removeChild(f);return}f.childNodes.length===1&&f.replaceWith(f.childNodes[0])})}}function Zg(e){const t=(e??"main,article").split(",").filter(Boolean);for(const o of t){const i=document.querySelector(o);if(i)return i}const n=document.querySelector("p:has(+ p), h1, h2");if(n){let o=n;for(;o!==document.body;)o=o.parentElement;return o}return document.body}function Yg(e){if(e.getAttribute("dir")==="rtl")return!0;const t=e.querySelector("p")||e.querySelector("div:not(:empty)")||e;return t.getAttribute("dir")==="rtl"?!0:window.getComputedStyle(t).direction==="rtl"}function Xg(e){xr(e,t=>Array.from(t.children),t=>!t.textContent.trim()),xr(e,t=>Array.from(t.children).reverse(),t=>{if(!t.textContent.trim())return!0;const n=t.tagName;return n.length===2&&n.startsWith("H")})}function Ea(e,t){Array.from(e.children).forEach(o=>{Ea(o,t)}),t(e)}function xr(e,t,n){const o=t(e);for(let i=0;i<o.length;i++){const r=o[i];if(!xr(r,t,n))return!1;Gg(r)}return n(e)}function Gg(e){var t;(t=e.parentNode)==null||t.removeChild(e)}const Jg={key:1,class:"h-14 sm:h-16 px-2 2xs:px-3 flex gap-1 2xs:gap-3 items-center"},Qg={class:"md:fixed left-0 right-0 bottom-0"},em={class:"p-2 2xs:px-3 sm:py-3 pb-6 md:pb-5 lg:pb-3 flex md:flex-col gap-4 justify-between items-center"},Ia=pe({__name:"GearThirdControlsLayout",props:{visible:{type:Boolean},hideTopControls:{type:Boolean},spaceTop:{type:null}},setup(e){return(t,n)=>(v(),z(be,null,[U("div",{class:fe(["fixed left-0 right-0 top-0 bg-inherit z-30",{"opacity-0 pointer-events-none":!e.visible}])},[e.spaceTop?(v(),z("div",{key:0,style:Pe({height:`${e.spaceTop}px`}),class:"bg-gradient-to-b from-black to-transparent"},null,4)):se("",!0),e.hideTopControls?se("",!0):(v(),z("div",Jg,[xe(t.$slots,"top-controls")]))],2),U("div",{class:fe(["fixed left-0 right-0 bottom-0 md:left-auto z-30 bg-inherit md:bg-transparent",{"opacity-0 pointer-events-none":!e.visible}])},[U("div",Qg,[xe(t.$slots,"progress")]),U("div",em,[xe(t.$slots,"bottom-controls")])],2),xe(t.$slots,"default")],64))}}),tm=Object.freeze(Object.defineProperty({__proto__:null,default:Ia},Symbol.toStringTag,{value:"Module"})),nm={},om={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function im(e,t){return v(),z("svg",om,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M16 13q-.425 0-.712-.288T15 12t.288-.712T16 11h6q.425 0 .713.288T23 12t-.288.713T22 13zM4.675 15.425l-1.025 2.85q-.125.35-.4.538T2.625 19q-.575 0-.913-.487t-.137-1.038l4.4-11.725Q6.1 5.4 6.4 5.2t.65-.2h.9q.375 0 .663.2t.412.55L13.45 17.5q.2.55-.137 1.025T12.4 19q-.35 0-.65-.2t-.425-.55l-1-2.825zM5.4 13.4h4.2L7.55 7.6h-.1z"},null,-1)])])}const Oa=ve(nm,[["render",im]]),rm=Object.freeze(Object.defineProperty({__proto__:null,default:Oa},Symbol.toStringTag,{value:"Module"})),sm={},lm={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function am(e,t){return v(),z("svg",lm,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"m4.675 15.425l-1.025 2.85q-.125.35-.4.538T2.625 19q-.575 0-.913-.487t-.137-1.038l4.4-11.725Q6.1 5.4 6.4 5.2t.65-.2h.9q.375 0 .663.2t.412.55L13.45 17.5q.2.55-.137 1.025T12.4 19q-.35 0-.65-.2t-.425-.55l-1-2.825zM5.4 13.4h4.2L7.55 7.6h-.1zM18 13h-2q-.425 0-.712-.288T15 12t.288-.712T16 11h2V9q0-.425.288-.712T19 8t.713.288T20 9v2h2q.425 0 .713.288T23 12t-.288.713T22 13h-2v2q0 .425-.288.713T19 16t-.712-.288T18 15z"},null,-1)])])}const $a=ve(sm,[["render",am]]),cm=Object.freeze(Object.defineProperty({__proto__:null,default:$a},Symbol.toStringTag,{value:"Module"})),za=ve(pe({__name:"NovelBody",props:{hideTopControls:{type:Boolean},progress:{type:Number},touchDevice:{type:Boolean},busy:{type:Boolean},spaceTop:{type:null},content:{type:null},rtl:{type:Boolean},titlePreferences:{type:Object},defaultPreferences:{type:Object}},emits:["ready","click","progressChanged","finished"],setup(e,{expose:t,emit:n}){const o=e,i=n,r=ee(!1),s=ee(),l=ee(),a=Uo(()=>{const c=s.value;if(!c)return;const{clientHeight:d,scrollHeight:f,scrollTop:p}=c,x=f-2*d,_=p/x;i("progressChanged",Math.min(1,Math.round(_*100)/100))},30);t({scrollEl:s}),$t({onKeyDown(){var c;o.busy||(c=s.value)==null||c.focus()}}),je(()=>{ue(()=>o.content,d=>{const f=l.value;f&&(Array.from(f.children).forEach(p=>{f.removeChild(p)}),f.appendChild(d),setTimeout(()=>{const p=s.value;if(p){f.offsetHeight<=p.clientHeight&&i("finished");const{progress:x}=o;x&&u(x)}r.value=!0,i("ready")}))},{immediate:!0});const c=hn();ue(()=>{const{fontFamily:d,fontSize:f,lineHeight:p}=o.titlePreferences;return`${d}-${f}-${p}-${c.width.value}`},async()=>{const d=o.progress;await gt(),u(d)})});function u(c){const d=s.value;d&&(d.scrollTop=c*(d.scrollHeight-2*d.clientHeight))}return(c,d)=>(v(),z("div",{ref_key:"scrollContainer",ref:s,tabindex:"0",class:fe(["novel-body",{"scrollbar-sm":!e.touchDevice,"scrollbar-none":e.touchDevice,"opacity-0":!r.value,"pt-16 sm:pt-18 md:pt-20":!e.hideTopControls,"pt-5 sm:pt-9 md:pt-12":e.hideTopControls}]),style:Pe({fontFamily:e.titlePreferences.fontFamily,"--font-size":`${e.titlePreferences.fontSize}px`,"--line-height":`${e.titlePreferences.lineHeight}px`,"--space-top":e.spaceTop?`${e.spaceTop}px`:void 0}),onClick:d[0]||(d[0]=()=>i("click")),onScroll:d[1]||(d[1]=(...f)=>Z(a)&&Z(a)(...f))},[U("div",cn({ref_key:"contentContainer",ref:l,class:"novel-body__content"},e.rtl?{dir:"rtl"}:{}),null,16),xe(c.$slots,"end")],38))}}),[["styles",['.novel-body{top:0;right:0;bottom:0;left:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding-left:32px;padding-right:32px;position:fixed}.novel-body:focus{outline:2px solid transparent;outline-offset:2px}@media (min-width:640px){.novel-body{padding-left:48px;padding-right:48px}}@media (min-width:768px){.novel-body{padding-left:56px;padding-right:56px}}@media (min-width:1024px){.novel-body{padding-left:64px;padding-right:64px}}@media (min-width:1280px){.novel-body{padding-left:80px;padding-right:80px}}.novel-body{font-size:var(--font-size);letter-spacing:.01em;line-height:var(--line-height)}.novel-body:before{content:"";display:block;height:var(--space-top,0)}.novel-body__content{margin-left:auto;margin-right:auto;max-width:1040px;min-height:100%}.novel-body hr{--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity,1));margin:calc(var(--line-height)*.5) 0}.novel-body h1,.novel-body h2,.novel-body h3,.novel-body h4,.novel-body h5,.novel-body h6{font-weight:500}.novel-body h1{font-size:calc(var(--font-size)*1.5);line-height:calc(var(--font-size)*.5 + var(--line-height))}.novel-body h2{font-size:calc(var(--font-size)*1.25);line-height:calc(var(--font-size)*.25 + var(--line-height))}.novel-body h3{font-size:calc(var(--font-size)*1.125);line-height:calc(var(--font-size)*.125 + var(--line-height))}.novel-body h5,.novel-body h6,.novel-body p{font-size:inherit;line-height:inherit}.novel-body blockquote,.novel-body figure,.novel-body h1,.novel-body h2,.novel-body h3,.novel-body h4,.novel-body h5,.novel-body h6,.novel-body img,.novel-body ol,.novel-body p,.novel-body ul{margin-bottom:calc(var(--line-height)*.5)}.novel-body pre{background-color:transparent;border-style:none;display:block;font-family:inherit;margin:0;padding:0;white-space:normal}']]]),um=Object.freeze(Object.defineProperty({__proto__:null,default:za},Symbol.toStringTag,{value:"Module"})),Da=pe({inheritAttrs:!1,__name:"GearThird",props:{chapterNavData:{type:Object},busy:{type:Boolean},defaultPreferences:{type:Object},immediate:{type:Boolean},appVersion:{type:String},raw:{type:Object},spec:{type:Object},siteMeta:{type:null},page:{type:Number},spaceTop:{type:Number},touchDevice:{type:Boolean},entryId:{type:String},isAutoShow:{type:Boolean},tourEnabled:{type:Boolean},offlineMode:{type:Boolean}},emits:["clickEntryButton","hideReader","openHelpScreen","error","crash","ready","pageChanged","playingChanged","tourEnabledChanged","dispose","openEntry","addEntry","finished","getHiddenChapters","hapticFeedback","pressedBack","selectChapter","timeout","openDefaultPreferences","defaultPreferencesChanged","controlsVisibilityChanged"],setup(e,{emit:t}){var Y,S,J,F,k,y;const n=e,o=t,i=ee(null),r=((Y=n.raw)==null?void 0:Y.novel)??Kg({sel:(S=n.spec)==null?void 0:S.content,heading:(J=n.raw)==null?void 0:J.name});r===void 0&&o("error");const s=ee(r==null?void 0:r.el),l=ee(!!(r!=null&&r.isRTL)),a=ee(!1),u=ee(!1),c=G(()=>n.page),d=G(()=>n.busy),f=ee(null),p=G(()=>{var O;return(O=f.value)==null?void 0:O.scrollEl}),x=(k=(F=n.raw)==null?void 0:F.title)==null?void 0:k.name,_=x?ia(x):location.hostname,D=Zd(`mpr:${_}`,{}),b=G({get(){var ae,me;const O=n.defaultPreferences,$=((ae=D.value)==null?void 0:ae.fontSize)??O.fontSize,le=Math.max($,((me=D.value)==null?void 0:me.lineHeight)??O.lineHeight);return{fontFamily:O.fontFamily,speed:O.speed,...D.value,contrast:O.contrast,fontSize:$,lineHeight:le}},set(O){const $={...O},le=n.defaultPreferences;Object.keys($).forEach(ae=>{$[ae]===le[ae]&&delete $[ae]}),D.value=$}}),P=Wg({isBusy:d,speed:G(()=>b.value.speed),fontSize:G(()=>b.value.fontSize),lineHeight:G(()=>b.value.lineHeight),autoPlay:!!((y=n.defaultPreferences)!=null&&y.autoPlay),touchDevice:n.touchDevice,scrollEl:p}),A=G(()=>!n.touchDevice&&P.isIdle.value&&!d.value),w=Ca({touchDevice:n.touchDevice,moveThreshold:50,isBusy:d,isPlaying:G(()=>P.isPlaying.value),isIdle:G(()=>P.isIdle.value),hideControlsEvent:G(()=>n.defaultPreferences.hideControlsEvent),scrollEl:p}),g=w.visible;ue(P.isPlaying,O=>{o("playingChanged",O)}),ue(g,O=>{o("controlsVisibilityChanged",O)}),I(document.documentElement),I(document.body);function I(O){const $=O.style.getPropertyValue("overflow");$!=="hidden"&&(O.style.setProperty("overflow","hidden","important"),Mt(()=>{$?O.style.setProperty("overflow",$):O.style.removeProperty("overflow")}))}function q(){o("ready"),w.activate(),P.activate()}function K(){P.stop(),o("clickEntryButton")}function R(O){u.value=O}function Q(){if(P.isPlaying.value){g.value||!n.touchDevice?P.stop():(P.awake(),w.toggle(!0));return}w.toggle()}function H(O){O!==n.page&&(o("pageChanged",Math.min(1,O)),O===1&&o("finished"))}function T(O){const $=b.value.fontSize+O;$>48||$<10||(b.value={...b.value,fontSize:$,lineHeight:Math.max(10,Math.min(96,Math.round(b.value.lineHeight/b.value.fontSize*$)))})}return(O,$)=>s.value?(v(),oe(hr,{key:0,ref_key:"gearLayout",ref:i,immediate:"",idle:A.value,class:"bg-stone-900",style:Pe({color:`rgba(255, 255, 255, ${e.defaultPreferences.contrast})`})},{default:ne(()=>{var le;return[B(za,{ref_key:"body",ref:f,progress:c.value,"touch-device":e.touchDevice,busy:d.value,"space-top":e.spaceTop,content:s.value,rtl:l.value,"title-preferences":b.value,"default-preferences":e.defaultPreferences,"hide-top-controls":!e.raw,onClick:Q,onProgressChanged:H,onReady:q},{end:ne(()=>{var ae,me;return[B(Gi,{"has-next":!!((ae=e.chapterNavData)!=null&&ae.next),"offline-mode":!!e.offlineMode,seconds:((me=e.defaultPreferences)==null?void 0:me.autoNextSeconds)??5,onNext:$[0]||($[0]=()=>{var ge,Se;return(Se=(ge=e.chapterNavData)==null?void 0:ge.next)==null?void 0:Se.call(ge,!1)}),onVisibilityChanged:R,onHide:$[1]||($[1]=()=>o("hideReader")),onFinished:$[2]||($[2]=()=>o("finished"))},null,8,["has-next","offline-mode","seconds"])]}),_:1},8,["progress","touch-device","busy","space-top","content","rtl","title-preferences","default-preferences","hide-top-controls"]),!e.touchDevice&&!e.raw&&!e.offlineMode?Ne((v(),oe(Yo,{key:0,class:"hidden md:inline-block fixed left-3 top-2",transparent:"",onClick:$[3]||($[3]=()=>o("hideReader"))},null,512)),[[pl,Z(g)]]):se("",!0),B(Ia,{visible:Z(g),"hide-top-controls":!e.raw,"space-top":e.spaceTop},{"top-controls":ne(()=>{var ae;return[e.raw||e.offlineMode?(v(),oe(Ji,{key:0,"offline-mode":e.offlineMode,raw:e.raw,transparent:"",onClick:$[4]||($[4]=()=>o("pressedBack"))},null,8,["offline-mode","raw"])):se("",!0),e.raw&&!e.touchDevice&&!e.offlineMode?(v(),oe(Yo,{key:1,transparent:"",onClick:$[5]||($[5]=()=>o("hideReader"))})):se("",!0),e.chapterNavData?(v(),oe(sr,{key:2,transparent:"","touch-device":e.touchDevice,"chapter-spec":(ae=e.spec)==null?void 0:ae.chapter,data:e.chapterNavData,rtl:l.value,onGetHiddenChapters:$[6]||($[6]=()=>o("getHiddenChapters")),onPrev:$[7]||($[7]=me=>{var ge,Se;return(Se=(ge=e.chapterNavData)==null?void 0:ge.prev)==null?void 0:Se.call(ge,me)}),onNext:$[8]||($[8]=me=>{var ge,Se;return(Se=(ge=e.chapterNavData)==null?void 0:ge.next)==null?void 0:Se.call(ge,me)})},null,8,["touch-device","chapter-spec","data","rtl"])):se("",!0)]}),"bottom-controls":ne(()=>[!e.offlineMode&&e.raw?(v(),z(be,{key:0},[B(Qi,{"entry-id":e.entryId,transparent:"",onClick:K},null,8,["entry-id"]),$[19]||($[19]=U("div",{class:"hidden 2xs:inline-block md:hidden flex-grow"},null,-1))],64)):se("",!0),B(Ge,{transparent:"",onClick:$[9]||($[9]=()=>T(-1))},{default:ne(()=>[B(Oa)]),_:1}),B(Ge,{transparent:"",onClick:$[10]||($[10]=()=>T(1))},{default:ne(()=>[B($a)]),_:1}),B(or,{transparent:"",onClick:$[11]||($[11]=()=>a.value=!0)}),e.touchDevice?se("",!0):(v(),oe(ir,{key:1,transparent:"",onRequestFullScreen:$[12]||($[12]=()=>{var ae,me;return(me=(ae=i.value)==null?void 0:ae.rootEl)==null?void 0:me.requestFullscreen()})})),B(nr,{transparent:"","tour-message":"Press here to start listening",playing:Z(P).isPlaying.value,class:"order-2 md:order-4",onClick:$[13]||($[13]=()=>Z(P).toggle())},null,8,["playing"])]),progress:ne(()=>{var ae,me;return[((ae=e.defaultPreferences)==null?void 0:ae.progressSize)!==0?(v(),oe(mr,{key:0,value:c.value,height:((me=e.defaultPreferences)==null?void 0:me.progressSize)??2,rtl:l.value,opacity:e.defaultPreferences.contrast},null,8,["value","height","rtl","opacity"])):se("",!0)]}),_:1},8,["visible","hide-top-controls","space-top"]),u.value?se("",!0):(v(),oe(gr,{key:1,playing:Z(P).isPlaying.value},null,8,["playing"])),B(br,{modelValue:a.value,"onUpdate:modelValue":$[17]||($[17]=ae=>a.value=ae),name:(le=e.raw)==null?void 0:le.title.name,"space-top":(e.spaceTop??0)+80,"enable-default-preferences":!e.touchDevice||!!e.appVersion,onMore:$[18]||($[18]=()=>o("openDefaultPreferences"))},{"tab-preferences":ne(()=>[B(dr,{modelValue:b.value,"onUpdate:modelValue":$[14]||($[14]=ae=>b.value=ae),"default-preferences":e.defaultPreferences,"enable-reset":!e.touchDevice||!!e.appVersion,onReset:$[15]||($[15]=()=>D.value=null)},null,8,["modelValue","default-preferences","enable-reset"])]),"tab-default":ne(()=>[B(fr,{"is-novel":"","model-value":e.defaultPreferences,"onUpdate:modelValue":$[16]||($[16]=ae=>o("defaultPreferencesChanged",ae))},null,8,["model-value"])]),_:1},8,["modelValue","name","space-top","enable-default-preferences"]),xe(O.$slots,"default")]}),_:3},8,["idle","style"])):se("",!0)}}),dm=Object.freeze(Object.defineProperty({__proto__:null,default:Da},Symbol.toStringTag,{value:"Module"}));async function fm({siteMeta:e,spec:t}){var l;const n=e==null?void 0:e.contentTypes,o=!e||(n==null?void 0:n.includes(Qt.novel)),i=!n||n.includes(Qt.manga);if(!i&&!o)return;const r=(t==null?void 0:t.content)??"main,article,body",s=i?((l=t==null?void 0:t.content)==null?void 0:l.split(",").map(a=>a.trim()).filter(Boolean).map(a=>`${a} img:not(figure > img), ${a} canvas`).join(","))??r:void 0;return await gn(200,50,async()=>{const a=document.querySelector(r);if(a){if(o){const u=Array.from(a.querySelectorAll("p"));if(u.length){let c=!1,d=0;for(let f=0;f<u.length;f++)if(u[f].textContent.split(" ").length>20&&(d+=1,d===2)){c=!0;break}if(c)return Qt.novel}}if(s&&Array.from(a.querySelectorAll(s)).some(d=>pm(d)))return Qt.manga}})}function pm(e){const t=e.getBoundingClientRect();return ni(t.width,t.height)}function hm({raw:e,spec:t,siteMeta:n,offlineMode:o,onSelect:i}){var H,T,Y;const{vol:r,inferVol:s,chap:l,title:a,slug:u,basePath:c}=e,d=t==null?void 0:t.chapter;let f=-1;async function p(S,J){if(o){i({...S});return}if(S.slug){x(S.slug,J);return}if(S.elIndex===void 0||!(d!=null&&d.sel))return;let F=null;document.querySelector(d.sel)||(d!=null&&d.trigger&&(F=document.querySelector(d.trigger)),F&&(eo(F),await new Promise(y=>setTimeout(()=>y(),50))));const k=d&&d.sel&&!d.url?document.querySelectorAll(d.sel):void 0;k!=null&&k[S.elIndex]&&(eo(k[S.elIndex]),F&&document.querySelector(d.sel)&&eo(F))}function x(S,J){const F=gm(c,S,(n==null?void 0:n.trailing)??!0);J?window.open(F,"_blank","noopener"):location.href=F}function _(S){const J=w[S];return J?F=>p(J,F):void 0}function D(S,J,F){if(J)x(J,F);else if(S){const k=document.querySelector(S);k&&eo(k,{preventDefault:!1})}}const b=r??s,P=d==null?void 0:d.url,A=((H=a.chapters)==null?void 0:H.filter(S=>S.slug||!P&&S.elIndex!==void 0))??[],w=A.length>1?A:[],g=(T=e.prev)==null?void 0:T.slug,I=(Y=e.next)==null?void 0:Y.slug,q=t!=null&&t.prev&&typeof t.prev!="string"?t.prev.sel??t.prevBtn:t==null?void 0:t.prevBtn,K=t!=null&&t.next&&typeof t.next!="string"?t.next.sel??t.nextBtn:t==null?void 0:t.nextBtn;let R=g||q&&!w.length&&document.body.querySelector(q)?S=>D(q,g,S):void 0,Q=I||K&&!w.length&&document.body.querySelector(K)?S=>D(K,I,S):void 0;if(w.length){if(P&&(f=w.findIndex(S=>S.slug===e.slug)),f===-1&&(f=w.findIndex(S=>(S.vol??S.inferVol)===b&&S.chap===l)),P&&f===-1&&(f=w.findIndex(S=>S.slug&&u.startsWith(`${S.slug}-`)&&u.length-S.slug.length>3)),f!==-1)R??(R=_(f+1)),Q??(Q=_(f-1));else if(!g&&!I){const S=w.findIndex(J=>{const F=J.vol??J.inferVol;return b===void 0||F===void 0||b===F?J.chap<l:F<b});S!==-1?(R=_(S),Q=_(S-1)):Q=_(w.length-1)}}return{activeIndex:f,activeLabel:Aa({vol:r,chap:l}),prev:R,next:Q,chapters:w.map(S=>({label:Aa(S),select:J=>p(S,J)}))}}function Aa({vol:e,chap:t}){return e==null?`Ch.${t}`:`Vol.${e} ch.${t}`}function gm(e,t,n){const o=!t||t.includes("//")||t.startsWith("/")?t:"/"+[...e.split("/"),...t.split("/")].filter(Boolean).join("/"),[i,r]=(o.includes("//")?o:location.origin+o).split("?");return[i.endsWith("/")===n?i:n?i+"/":i.substring(0,-1),r].filter(Boolean).join("?")}function mm(e){return e instanceof Error?JSON.stringify(e,Object.getOwnPropertyNames(e)):e}const ja=ve(pe({inheritAttrs:!1,__name:"App",props:{immediate:{type:Boolean},appVersion:{type:String},raw:{type:Object},spec:{type:Object},siteMeta:{type:null},page:{type:Number},spaceTop:{type:Number},touchDevice:{type:Boolean},entryId:{type:String},defaultPreferences:{type:Object},isAutoShow:{type:Boolean},tourEnabled:{type:Boolean},offlineMode:{type:Boolean}},emits:["error","crash","ready","pageChanged","playingChanged","tourEnabledChanged","dispose","openEntry","addEntry","finished","getHiddenChapters","hapticFeedback","pressedBack","selectChapter","timeout","openDefaultPreferences","defaultPreferencesChanged","controlsVisibilityChanged"],setup(e,{emit:t}){const n=e,o=t;let i=!1;vs((b,P,A)=>{if(!i){i=!0;const g=`(3.0.1) ${(P==null?void 0:P.$options.name)??(P==null?void 0:P.$options.__name)??(P==null?void 0:P.$options.__file)}.${A}: ${mm(b)}`;o("crash",g)}return!1});const r=ee(n.raw?n.raw.contentType??Qt.manga:void 0);r.value===void 0&&fm({siteMeta:n.siteMeta,spec:n.spec}).then(b=>{b?r.value=b:o("error")});const s=ee(!1),l=Qd({touchDevice:n.touchDevice}),a=of(n.page,n.isAutoShow),u=G(()=>n.raw?hm({raw:n.raw,spec:n.spec,siteMeta:n.siteMeta,offlineMode:n.offlineMode,onSelect:b=>o("selectChapter",b)}):void 0);nf().addListener({onKeyUp:b=>{switch(b.key){case"h":_();break}}}),ef(()=>o("hapticFeedback"));const d=G(()=>{var w,g;const b=n.defaultPreferences,P=((w=n.defaultPreferences)==null?void 0:w.fontSize)??16,A=Math.max(P,((g=n.defaultPreferences)==null?void 0:g.lineHeight)??28);return{...b,speed:(b==null?void 0:b.speed)??1,progressSize:(b==null?void 0:b.progressSize)??2,autoNextSeconds:(b==null?void 0:b.autoNextSeconds)??5,hideControlsEvent:(b==null?void 0:b.hideControlsEvent)??tn.firstMove,autoPlay:(b==null?void 0:b.autoPlay)??!1,pinchToZoom:(b==null?void 0:b.pinchToZoom)??!0,readerStyle:(b==null?void 0:b.readerStyle)??Dt.longStrip,direction:(b==null?void 0:b.direction)??nt.vertical,gap:(b==null?void 0:b.gap)??0,fontFamily:"system-ui, sans-serif",contrast:.8,fontSize:P,lineHeight:A}});function f(){if(n.offlineMode){o("pressedBack");return}rf(),o("dispose")}function p(b){a.value=b,o("pageChanged",b)}function x(){n.entryId?o("openEntry",n.entryId):o("addEntry")}function _(b){s.value!==b&&(s.value=b??!s.value)}function D(){o("error"),f()}return(b,P)=>r.value!==void 0?(v(),oe(Pi(r.value===Z(Qt).novel?Da:Ma),cn({key:0,ref:"root"},n,{page:Z(a),busy:Z(l),"chapter-nav-data":u.value,"default-preferences":d.value,onOpenDefaultPreferences:P[1]||(P[1]=()=>o("openDefaultPreferences")),onDefaultPreferencesChanged:P[2]||(P[2]=A=>o("defaultPreferencesChanged",A)),onTimeout:P[3]||(P[3]=()=>o("timeout")),onReady:P[4]||(P[4]=()=>o("ready")),onFinished:P[5]||(P[5]=()=>o("finished")),onPlayingChanged:P[6]||(P[6]=A=>o("playingChanged",A)),onControlsVisibilityChanged:P[7]||(P[7]=A=>o("controlsVisibilityChanged",A)),onPressedBack:P[8]||(P[8]=()=>o("pressedBack")),onGetHiddenChapters:P[9]||(P[9]=()=>o("getHiddenChapters")),onError:D,onHideReader:f,onPageChanged:p,onClickEntryButton:x,onOpenHelpScreen:P[10]||(P[10]=()=>_(!0))}),{default:ne(()=>[s.value?(v(),oe(Ll,{key:0,"touch-device":e.touchDevice,onHide:_},null,8,["touch-device"])):se("",!0),e.tourEnabled?(v(),oe(Bl,{key:1,onHide:P[0]||(P[0]=()=>o("tourEnabledChanged",!1))})):se("",!0)]),_:1},16,["page","busy","chapter-nav-data","default-preferences"])):se("",!0)}}),[["styles",['*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:Helvetica,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}*{-webkit-tap-highlight-color:rgba(0,0,0,0)!important}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:none;border-style:none;cursor:pointer;outline:2px solid transparent;outline-offset:2px;white-space:nowrap}button[disabled]{cursor:default!important}svg{height:100%}.container,svg{width:100%}@media (min-width:300px){.container{max-width:300px}}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.scrollbar-none{scrollbar-width:none}.scrollbar-none::-webkit-scrollbar{display:none}.scrollbar-sm{scrollbar-color:#777 transparent;scrollbar-width:thin}.scrollbar-sm::-webkit-scrollbar{background-color:transparent;height:4px;width:4px}.scrollbar-sm::-webkit-scrollbar-track{background:transparent}.scrollbar-sm::-webkit-scrollbar-thumb{background-color:#777;border-radius:2px}.\\!pointer-events-none{pointer-events:none!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.\\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-1{bottom:4px}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:4px}.left-1\\/2{left:50%}.left-10{left:40px}.left-3{left:12px}.left-9{left:36px}.right-0{right:0}.top-0{top:0}.top-1{top:4px}.top-1\\/2{top:50%}.top-10{top:40px}.top-2{top:8px}.top-9{top:36px}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.order-2{order:2}.m-0{margin:0}.m-auto{margin:auto}.-mx-12{margin-left:-48px;margin-right:-48px}.-my-12{margin-bottom:-48px;margin-top:-48px}.-ml-20{margin-left:-80px}.-mr-3{margin-right:-12px}.-mt-2{margin-top:-8px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-5{margin-bottom:20px}.ml-1{margin-left:4px}.ml-auto{margin-left:auto}.mt-5{margin-top:20px}.box-border{box-sizing:border-box}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.\\!h-9{height:36px!important}.h-0{height:0}.h-1{height:4px}.h-1\\/3{height:33.333333%}.h-10{height:40px}.h-12{height:48px}.h-14{height:56px}.h-16{height:64px}.h-2{height:8px}.h-20{height:80px}.h-24{height:96px}.h-28{height:112px}.h-3{height:12px}.h-4{height:16px}.h-5{height:20px}.h-6{height:24px}.h-8{height:32px}.h-9{height:36px}.h-\\[101\\%\\]{height:101%}.h-full{height:100%}.max-h-\\[70vh\\]{max-height:70vh}.max-h-full{max-height:100%}.max-h-none{max-height:none}.min-h-full{min-height:100%}.w-0{width:0}.w-1{width:4px}.w-1\\/3{width:33.333333%}.w-10{width:40px}.w-12{width:48px}.w-14{width:56px}.w-2{width:8px}.w-2\\/3{width:66.666667%}.w-20{width:80px}.w-24{width:96px}.w-28{width:112px}.w-3{width:12px}.w-4{width:16px}.w-40{width:160px}.w-5{width:20px}.w-6{width:24px}.w-auto{width:auto}.w-full{width:100%}.w-min{width:-moz-min-content;width:min-content}.max-w-full{max-width:100%}.max-w-none{max-width:none}.max-w-xs{max-width:320px}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.origin-bottom{transform-origin:bottom}.origin-right{transform-origin:right}.origin-top{transform-origin:top}.\\!translate-y-full{--tw-translate-y:100%!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1\\.5{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\.5{--tw-translate-y:-6px}.-translate-y-1\\/2{--tw-translate-y:-50%}.-translate-y-1\\/2,.translate-y-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y:0px}.translate-y-1\\.5{--tw-translate-y:6px}.-rotate-90,.translate-y-1\\.5{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate:-90deg}.rotate-180{--tw-rotate:180deg}.rotate-180,.rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate:90deg}.scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.scale-95,.scale-y-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-y-90{--tw-scale-y:.9}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-auto{cursor:auto}.cursor-default{cursor:default}.cursor-grabbing{cursor:grabbing}.cursor-none{cursor:none}.cursor-pointer{cursor:pointer}.touch-pan-x{--tw-pan-x:pan-x}.touch-pan-x,.touch-pan-y{touch-action:var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)}.touch-pan-y{--tw-pan-y:pan-y}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}.resize{resize:both}.\\!snap-none{scroll-snap-type:none!important}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-y{scroll-snap-type:y var(--tw-scroll-snap-strictness)}.snap-center{scroll-snap-align:center}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-6{gap:24px}.gap-\\[1px\\]{gap:1px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overscroll-contain{overscroll-behavior:contain}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:4px}.rounded-2xl{border-radius:16px}.rounded-\\[2\\.5rem\\]{border-radius:40px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:6px}.rounded-xl{border-radius:12px}.\\!rounded-l-none{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.\\!rounded-r-none{border-bottom-right-radius:0!important;border-top-right-radius:0!important}.rounded-l-sm{border-bottom-left-radius:2px;border-top-left-radius:2px}.rounded-r-sm{border-bottom-right-radius:2px;border-top-right-radius:2px}.rounded-t-xl{border-top-left-radius:12px;border-top-right-radius:12px}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-t-\\[1px\\]{border-top-width:1px}.border-solid{border-style:solid}.border-none{border-style:none}.border-primary{--tw-border-opacity:1;border-color:rgb(184 92 56/var(--tw-border-opacity,1))}.border-stone-200{--tw-border-opacity:1;border-color:rgb(231 229 228/var(--tw-border-opacity,1))}.border-stone-400{--tw-border-opacity:1;border-color:rgb(168 162 158/var(--tw-border-opacity,1))}.border-stone-500{--tw-border-opacity:1;border-color:rgb(120 113 108/var(--tw-border-opacity,1))}.border-stone-600{--tw-border-opacity:1;border-color:rgb(87 83 78/var(--tw-border-opacity,1))}.border-textPrimary{--tw-border-opacity:1;border-color:rgb(251 130 82/var(--tw-border-opacity,1))}.border-opacity-30{--tw-border-opacity:.3}.border-opacity-70{--tw-border-opacity:.7}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.bg-inherit{background-color:inherit}.bg-primary{--tw-bg-opacity:1;background-color:rgb(184 92 56/var(--tw-bg-opacity,1))}.bg-stone-100{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity,1))}.bg-stone-300{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity,1))}.bg-stone-500{--tw-bg-opacity:1;background-color:rgb(120 113 108/var(--tw-bg-opacity,1))}.bg-stone-600{--tw-bg-opacity:1;background-color:rgb(87 83 78/var(--tw-bg-opacity,1))}.bg-stone-800{--tw-bg-opacity:1;background-color:rgb(41 37 36/var(--tw-bg-opacity,1))}.bg-stone-900{--tw-bg-opacity:1;background-color:rgb(28 25 23/var(--tw-bg-opacity,1))}.bg-textPrimary{--tw-bg-opacity:1;background-color:rgb(251 130 82/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.\\!bg-opacity-100{--tw-bg-opacity:1!important}.bg-opacity-40{--tw-bg-opacity:.4}.bg-opacity-50{--tw-bg-opacity:.5}.bg-opacity-70{--tw-bg-opacity:.7}.bg-opacity-80{--tw-bg-opacity:.8}.bg-opacity-90{--tw-bg-opacity:.9}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-none{background-image:none}.from-black{--tw-gradient-from:#000 var(--tw-gradient-from-position);--tw-gradient-to:transparent var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.to-transparent{--tw-gradient-to:transparent var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-2{padding:8px}.p-4{padding:16px}.p-6{padding:24px}.px-2{padding-left:8px;padding-right:8px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-5{padding-left:20px;padding-right:20px}.px-6{padding-left:24px;padding-right:24px}.px-8{padding-left:32px;padding-right:32px}.py-0\\.5{padding-bottom:2px;padding-top:2px}.py-1{padding-bottom:4px;padding-top:4px}.py-1\\.5{padding-bottom:6px;padding-top:6px}.py-2{padding-bottom:8px;padding-top:8px}.pb-6{padding-bottom:24px}.pb-7{padding-bottom:28px}.pb-8{padding-bottom:32px}.pl-1{padding-left:4px}.pr-2{padding-right:8px}.pt-1{padding-top:4px}.pt-1\\.5{padding-top:6px}.pt-12{padding-top:48px}.pt-16{padding-top:64px}.pt-20{padding-top:80px}.pt-5{padding-top:20px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-sans{font-family:Helvetica,sans-serif}.text-base{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.font-medium{font-weight:500}.font-normal{font-weight:400}.lowercase{text-transform:lowercase}.leading-none{line-height:1}.text-stone-100{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}.text-stone-200{--tw-text-opacity:1;color:rgb(231 229 228/var(--tw-text-opacity,1))}.text-stone-300{--tw-text-opacity:1;color:rgb(214 211 209/var(--tw-text-opacity,1))}.text-stone-400{--tw-text-opacity:1;color:rgb(168 162 158/var(--tw-text-opacity,1))}.text-stone-50{--tw-text-opacity:1;color:rgb(250 250 249/var(--tw-text-opacity,1))}.text-stone-800{--tw-text-opacity:1;color:rgb(41 37 36/var(--tw-text-opacity,1))}.text-stone-900{--tw-text-opacity:1;color:rgb(28 25 23/var(--tw-text-opacity,1))}.text-textPrimary{--tw-text-opacity:1;color:rgb(251 130 82/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-neutral-950{--tw-shadow-color:#0a0a0a;--tw-shadow:var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur:blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-bg{transition-duration:.15s;transition-property:background-color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-0{transition-duration:0s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.children-pointer-events-auto>*{pointer-events:auto}.last\\:mb-0:last-child{margin-bottom:0}.last\\:border-b-transparent:last-child{border-bottom-color:transparent}@media (hover:hover) and (pointer:fine){.hover\\:bg-stone-100:hover{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity,1))}.hover\\:bg-stone-300:hover{--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity,1))}.hover\\:bg-stone-50:hover{--tw-bg-opacity:1;background-color:rgb(250 250 249/var(--tw-bg-opacity,1))}.hover\\:bg-stone-500:hover{--tw-bg-opacity:1;background-color:rgb(120 113 108/var(--tw-bg-opacity,1))}.hover\\:bg-stone-900:hover{--tw-bg-opacity:1;background-color:rgb(28 25 23/var(--tw-bg-opacity,1))}.hover\\:bg-opacity-10:hover{--tw-bg-opacity:.1}.hover\\:bg-opacity-50:hover{--tw-bg-opacity:.5}.hover\\:bg-opacity-80:hover{--tw-bg-opacity:.8}.hover\\:text-stone-100:hover{--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:outline-primary:focus{outline-color:#b85c38}@media (hover:hover) and (pointer:fine){.group:hover .group-hover\\:bg-stone-100{--tw-bg-opacity:1;background-color:rgb(245 245 244/var(--tw-bg-opacity,1))}.group:hover .group-hover\\:bg-opacity-20{--tw-bg-opacity:.2}}@media (min-width:300px){.\\32xs\\:inline-block{display:inline-block}.\\32xs\\:gap-3{gap:12px}.\\32xs\\:px-3{padding-left:12px;padding-right:12px}}@media (min-width:640px){.sm\\:h-16{height:64px}.sm\\:w-\\[31rem\\]{width:496px}.sm\\:p-3{padding:12px}.sm\\:px-12{padding-left:48px;padding-right:48px}.sm\\:py-3{padding-bottom:12px;padding-top:12px}.sm\\:pt-18{padding-top:72px}.sm\\:pt-9{padding-top:36px}}@media (min-width:768px){.md\\:fixed{position:fixed}.md\\:left-auto{left:auto}.md\\:order-4{order:4}.md\\:inline-block{display:inline-block}.md\\:hidden{display:none}.md\\:flex-col{flex-direction:column}.md\\:bg-transparent{background-color:transparent}.md\\:px-14{padding-left:56px;padding-right:56px}.md\\:px-8{padding-left:32px;padding-right:32px}.md\\:pb-5{padding-bottom:20px}.md\\:pb-6{padding-bottom:24px}.md\\:pt-12{padding-top:48px}.md\\:pt-20{padding-top:80px}}@media (min-width:1024px){.lg\\:px-10{padding-left:40px;padding-right:40px}.lg\\:px-16{padding-left:64px;padding-right:64px}.lg\\:pb-3{padding-bottom:12px}.lg\\:pb-4{padding-bottom:16px}}@media (min-width:1280px){.xl\\:px-12{padding-left:48px;padding-right:48px}}']]]),vm=Object.freeze(Object.defineProperty({__proto__:null,default:ja},Symbol.toStringTag,{value:"Module"})),bm={class:"max-h-none max-w-none h-full w-full m-0 p-0 border-none outline-none"},ym={key:0,class:"fixed inset-0 h-[101%] flex justify-center items-center z-10 bg-black"},wm={class:"flex justify-between items-end"},xm={class:"inline-block children-pointer-events-auto"},_m={class:"inline-flex flex-col items-end gap-4 children-pointer-events-auto"},Sm={class:"fixed pointer-events-none left-0 right-0 bottom-0"},km={key:1,class:"fixed inline-block left-1/2 -translate-x-1/2 bottom-0 p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3"},Cm=Object.freeze(Object.defineProperty({__proto__:null,default:ve(pe({__name:"ReaderLayout",props:{loading:{type:Boolean},immediate:{type:Boolean},idle:{type:Boolean},controlsVisible:{type:Boolean},zooming:{type:Boolean},spaceTop:{type:null}},setup(e,{expose:t}){const n={mounted:i=>i.showModal(),beforeUnmount:i=>i.close()},o=ee(null);return t({rootEl:o}),(i,r)=>Ne((v(),z("dialog",bm,[U("div",{ref_key:"rootEl",ref:o,id:"reader-layout",class:fe({"cursor-none":e.idle,"cursor-default":!e.idle,"bg-black":e.immediate||!e.loading,"opacity-0":!e.immediate&&e.loading,"duration-200 transition-colors":!e.immediate})},[e.loading&&e.immediate?(v(),z("div",ym,[B(ei)])):se("",!0),xe(i.$slots,"default"),U("div",{id:"controls",class:fe(["fixed pointer-events-none cursor-auto left-0 top-0 w-full h-full flex flex-col justify-between p-2 sm:p-3 pb-6 md:pb-5 lg:pb-3",{"opacity-100 z-20":e.controlsVisible,"opacity-0 -z-10":!e.controlsVisible}])},[U("div",{class:"flex gap-1 items-center children-pointer-events-auto relative z-30 flex-shrink-0 2xs:gap-3",style:Pe({paddingTop:`${e.spaceTop||0}px`})},[xe(i.$slots,"top-controls")],4),U("div",wm,[U("div",xm,[xe(i.$slots,"bottom-left-controls")]),U("div",_m,[xe(i.$slots,"bottom-right-controls")])]),U("div",Sm,[xe(i.$slots,"progress")])],2),e.controlsVisible||e.zooming?(v(),z("div",km,[xe(i.$slots,"reset-zoom")])):se("",!0)],2)])),[[n]])}}),[["styles",["#reader-layout{direction:ltr;font-family:Helvetica,sans-serif;font-size:16px;font-weight:400;height:100%;line-height:24px;overflow:hidden;overscroll-behavior:contain;pointer-events:auto;text-align:left;width:100%;--tw-text-opacity:1;color:rgb(245 245 244/var(--tw-text-opacity,1))}"]]])},Symbol.toStringTag,{value:"Module"})),Tm={},Pm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"};function Mm(e,t){return v(),z("svg",Pm,[...t[0]||(t[0]=[U("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46s46-20.595 46-46s-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1)])])}const Em=Object.freeze(Object.defineProperty({__proto__:null,default:ve(Tm,[["render",Mm]])},Symbol.toStringTag,{value:"Module"})),Im="gear-second{height:0!important;opacity:0!important;pointer-events:none!important;width:0!important;z-index:-10!important}html.gear-second,html.gear-second *{scroll-behavior:auto!important;scrollbar-width:none!important}html.gear-second ::-webkit-scrollbar,html.gear-second::-webkit-scrollbar{display:none!important}html.gear-second body{touch-action:pan-x pan-y!important}html.gear-second body .m-content #progress-bar{display:none!important}html.gear-second body>:not(dialog[open]),html.gear-second>body~*{visibility:hidden!important}html.gear-second>body~*{display:none!important;height:0!important;left:100%!important;max-height:0!important;max-width:0!important;opacity:0!important;pointer-events:none!important;top:100%!important;width:0!important}.mp-scroll-container{max-height:100vh!important;overflow:hidden!important}html:has(body.mp-scroll-container){overflow:auto!important}",mn="gear-second",_r={appVersion:void 0,immediate:void 0,raw:void 0,spec:void 0,siteMeta:void 0,page:0,spaceTop:void 0,touchDevice:void 0,entryId:void 0,isAutoShow:void 0,tourEnabled:void 0,offlineMode:void 0,defaultPreferences:void 0,onError:void 0,onCrash:void 0,onDispose:void 0,onFullScreenChanged:void 0,onControlsVisibilityChanged:void 0,onPageChanged:void 0,onOpenEntry:void 0,onAddEntry:void 0,onFinished:void 0,onHapticFeedback:void 0,onPressedBack:void 0,onSelectChapter:void 0,onTimeout:void 0,onDefaultPreferencesChanged:void 0,onOpenDefaultPreferences:void 0},Je={promise:void 0,data:vo({..._r})};async function Om(e){return Je.promise?(Je.data.raw=e.raw,await Je.promise):(Je.promise=new Promise(t=>{let n=!1,o=!1,i,r,s=0;const l=!!e.spaceTop||!!e.isAutoShow&&!!e.page,a=()=>{n||(n=!0,clearInterval(i),i=void 0,r!=null&&r.isConnected&&document.body.removeChild(r),document.documentElement.classList.remove(mn),Je.data.touchDevice||Object.assign(Je.data,_r),Je.promise=void 0,Gn.clear())},u=ct(f=>{var p;return!n&&((p=e.onPageChanged)==null?void 0:p.call(e,f))},300);Object.assign(Je.data,_r,e.appVersion?e:La(e),{immediate:l,onReady(){l||(c(),document.documentElement.classList.add(mn))},onError(){var f,p;a(),o?((f=e.onDispose)==null||f.call(e),(p=e.onError)==null||p.call(e)):d()},onDispose:()=>{var f;a(),(f=e==null?void 0:e.onDispose)==null||f.call(e)},onControlsVisibilityChanged(f){var p,x;(p=e.onFullScreenChanged)==null||p.call(e,!f),(x=e.onControlsVisibilityChanged)==null||x.call(e,f)},onPageChanged:f=>{Je.data.page=f,!(s>=f)&&(s=f,u(f))},onTourEnabledChanged:f=>{Je.data.tourEnabled=f},onDefaultPreferencesChanged:f=>{var p;Je.data.defaultPreferences=f,(p=e.onDefaultPreferencesChanged)==null||p.call(e,f)}}),$m().then(()=>{if(n){d();return}r=document.createElement(mn),l?(document.documentElement.classList.add(mn),document.body.appendChild(r),setTimeout(c)):document.body.appendChild(r);let f=0;i=setInterval(()=>{if(++f===30||n){clearInterval(i),i=void 0;return}r.isConnected||(document.documentElement.classList.add(mn),document.body.appendChild(r))},100)});function c(){o||(o=!0,t({updateArgs(f){Object.assign(Je.data,Je.data.appVersion?f:La(f))},dispose:a,back:()=>Gn.trigger()}))}function d(){o||t(void 0)}}),await Je.promise)}function La(e){if(!["autoPlay","readerStyle","direction","autoNextSeconds","defaultSpeed","defaultGap","hideControlsEvent","progressSize","pinchToZoom","tapZone"].some(p=>p in e))return e;const{autoPlay:n,readerStyle:o,direction:i,autoNextSeconds:r,defaultSpeed:s,defaultGap:l,hideControlsEvent:a,progressSize:u,pinchToZoom:c,tapZone:d,...f}=e;return{...f,defaultPreferences:{autoPlay:n,readerStyle:o,direction:i,autoNextSeconds:r,speed:s,gap:l,hideControlsEvent:a,progressSize:u,pinchToZoom:c,tapZone:d}}}async function $m(){if(window.customElements.get(mn))return;const e=document.createElement("style"),t=Im;e.appendChild(document.createTextNode(t)),document.head.appendChild(e);const n=dd({styles:[await zm()],data:()=>({readerData:Je.data}),render(){return tl(ja,this.readerData)}});window.customElements.define(mn,n)}async function zm(){const e=Object.assign({"./App.vue":vm,"./GearSecond.vue":Ug,"./GearThird.vue":dm,"./components/AutoNext.vue":vf,"./components/ButtonWebFullScreen.vue":pp,"./components/ChapterNav.vue":Bp,"./components/DefaultPreferencesForm.vue":wh,"./components/DirectionToast.vue":Ph,"./components/GearControlsLayout.vue":Ih,"./components/GearLayout.vue":Bh,"./components/GearThirdControlsLayout.vue":tm,"./components/GesturesContainer.vue":Jh,"./components/HelpScreen.vue":Yd,"./components/MangaPreferencesForm.vue":Kh,"./components/NovelBody.vue":um,"./components/NovelPreferencesForm.vue":gh,"./components/PageNav.vue":Zh,"./components/PauseToast.vue":Yh,"./components/ProgressBar.vue":Gh,"./components/ReaderBody.vue":og,"./components/ReaderLayout.vue":Cm,"./components/ReaderTour.vue":Jd,"./components/SettingsBottomSheet.vue":Sg,"./components/TapZonePreview.vue":Ch,"./components/base/BaseButton.vue":af,"./components/base/BottomSheet.vue":cg,"./components/base/ButtonDropdown.vue":Mp,"./components/base/ButtonIcon.vue":bf,"./components/base/ButtonOutline.vue":sh,"./components/base/DropdownMenu.vue":mp,"./components/base/InputPercentage.vue":Rp,"./components/base/InputSelect.vue":Wp,"./components/base/InputSwitcher.vue":Zp,"./components/base/LoadingIndicator.vue":Ah,"./components/base/TabBar.vue":dg,"./components/base/TableField.vue":Xp,"./components/buttons/ButtonBack.vue":Sf,"./components/buttons/ButtonEntry.vue":$f,"./components/buttons/ButtonHide.vue":Lf,"./components/buttons/ButtonPlay.vue":Uf,"./components/buttons/ButtonResetZoom.vue":Qf,"./components/buttons/ButtonSettings.vue":ip,"./components/fields/FieldContrast.vue":Gp,"./components/fields/FieldFontFamily.vue":lh,"./components/icons/IconBack.vue":_f,"./components/icons/IconBookmarkNew.vue":Of,"./components/icons/IconBookmarked.vue":Pf,"./components/icons/IconChevronLeft.vue":$p,"./components/icons/IconChevronRight.vue":jp,"./components/icons/IconClose.vue":lg,"./components/icons/IconDouble.vue":Hh,"./components/icons/IconDoubleSkip.vue":Uh,"./components/icons/IconExclamationCircle.vue":Em,"./components/icons/IconFullscreen.vue":ap,"./components/icons/IconFullscreenExit.vue":fp,"./components/icons/IconHelp.vue":gg,"./components/icons/IconLandscape.vue":th,"./components/icons/IconLoading.vue":wp,"./components/icons/IconMoreVert.vue":yg,"./components/icons/IconNext.vue":kh,"./components/icons/IconPause.vue":Rf,"./components/icons/IconPlay.vue":qf,"./components/icons/IconPlus.vue":ff,"./components/icons/IconPortrait.vue":rh,"./components/icons/IconReaderExit.vue":jf,"./components/icons/IconSettings.vue":op,"./components/icons/IconTextDecre.vue":rm,"./components/icons/IconTextIncre.vue":cm,"./components/icons/IconTriangle.vue":kp,"./components/icons/IconZoom.vue":Xf}),t=[];for(const n in e){const o=e[n];t.push(o.default.styles)}return t.join("")}return Om});
|