@delta-comic/model 0.0.4 → 0.0.5

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.
@@ -1,2 +1,2 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@delta-comic/utils`),require(`vue`),require(`axios`)):typeof define==`function`&&define.amd?define([`exports`,`@delta-comic/utils`,`vue`,`axios`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DcModel={},e.window.$$lib$$.DcUtils,e.window.$$lib$$.Vue,e.window.$$lib$$.Axios))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),d=(e,t)=>{let n={};for(var r in e)a(n,r,{get:e[r],enumerable:!0});return t||a(n,Symbol.toStringTag,{value:`Module`}),n},f=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},p=(e,t,n)=>(n=e==null?{}:i(c(e)),f(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e));function m(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function h(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}function g(e){return e instanceof Error}function _(e){return Number.isSafeInteger(e)&&e>=0}function v(e){return typeof e==`string`}function y(e){return e!=null&&typeof e!=`function`&&_(e.length)}function b(e){return typeof e==`object`&&!!e&&h(e)===`[object Arguments]`}function x(e){return typeof e==`string`||e instanceof String}function S(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function C(e){return m(e)}function w(e){if(e==null)return!0;if(y(e))return typeof e.splice!=`function`&&typeof e!=`string`&&(typeof Buffer>`u`||!Buffer.isBuffer(e))&&!C(e)&&!b(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return S(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}function T(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}var E=class e{[Symbol.toStringTag]=`PromiseContent`;static _this;static{this._this=(0,t.useGlobalVar)(this,`data/PromiseContent`)}static isPromiseContent(e){return e instanceof this._this}static fromPromise(e,t=e=>e){return(0,n.markRaw)(new this._this(e,t))}constructor(e,t=e=>e){this.promise=e,this.processor=t,this.loadPromise(e)}async loadPromise(e){this.data.value=void 0,this.isLoading.value=!0,this.isError.value=!1,this.errorCause.value=void 0,this.isEmpty.value=!0;try{let t=await e;this.data.value=this.processor(t),this.isLoading.value=!1,this.isError.value=!1,this.isEmpty.value=w(t),this.emitter.emit(`success`,this.data.value)}catch(e){this.data.value=void 0,this.isError.value=!0,this.errorCause.value=g(e)?e:Error(String(e)),console.error(`Non-throw Error [PromiseContent]`,e),this.emitter.emit(`error`,e)}this.emitter.emit(`finial`,void 0)}emitter=T();onError(e){return this.emitter.on(`error`,e),()=>this.emitter.off(`error`,e)}onSuccess(e){return this.emitter.on(`success`,e),()=>this.emitter.off(`success`,e)}onFinal(e){return this.emitter.on(`finial`,e),()=>this.emitter.off(`finial`,e)}setProcessor(t){return e.fromPromise(this.promise,t)}catch(e){return this.promise.catch(e)}then(e,t){return this.promise.then(e,t)}finally(e){return this.promise.finally(e)}data=(0,n.shallowRef)();isLoading=(0,n.shallowRef)(!0);isError=(0,n.shallowRef)(!1);errorCause=(0,n.shallowRef)();isEmpty=(0,n.shallowRef)(!0);static fromAsyncFunction(e){return(...t)=>this.fromPromise(e(...t))}static resolve(e){let t=this.fromPromise(Promise.resolve(e));return t.isLoading.value=!1,t}static withResolvers(e=!1){let t=Promise.withResolvers(),n=new this._this(t.promise);return n.isLoading.value=e,{content:n,reject:e=>{t.reject(e)},resolve:e=>{t.resolve(e)},reset(e=!1){t=Promise.withResolvers(),n.loadPromise(t.promise),n.isLoading.value=e}}}},D=class{toJSON(e){return v(e)?this.parse(e):e}parse(e){let t=e.split(this.separator);return[t[0],t.slice(1).join(this.separator)]}toString(e){return v(e)?e:this.stringify(e)}stringify(e){return e.join(this.separator)}constructor(e=`:`){this.separator=e}},O=class extends D{static create(e=`:`){return(0,n.shallowReactive)(new this(e))}constructor(e=`:`){super(e)}store=(0,n.shallowReactive)(new Map);get size(){return this.store.size}[Symbol.toStringTag]=`SourcedKeyMap`;clear(){this.store.clear()}delete(e){return this.store.delete(this.toString(e))}forEach(e,t){this.store.forEach((n,r)=>{e.call(t,n,r,this)})}get(e){return this.store.get(this.toString(e))}has(e){return this.store.has(this.toString(e))}set(e,t){return this.store.set(this.toString(e),t),this}entries(){return this.store.entries()}keys(){return this.store.keys()}values(){return this.store.values()}[Symbol.iterator](){return this.entries()}};function k(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}var A=class{_controller=new AbortController;mitt=k();get signal(){return this._controller.signal}abort(e){this._controller.abort(e),this._controller=new AbortController,this.mitt.emit(`abort`)}onAbort(e){return this.mitt.on(`abort`,e),()=>this.mitt.off(`abort`,e)}onAbortOnce(e){let t=async()=>{await e(),this.mitt.off(`abort`,t)};this.mitt.on(`abort`,t)}};Error,typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;function j(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{t?setTimeout(()=>i(n),e):setTimeout(r,e)})}function M(e,t=!1){function r(r,{flush:i=`sync`,deep:a=!1,timeout:o,throwOnTimeout:s}={}){let c=null,l=[new Promise(o=>{c=(0,n.watch)(e,e=>{r(e)!==t&&(c?c():(0,n.nextTick)(()=>c?.()),o(e))},{flush:i,deep:a,immediate:!0})})];return o!=null&&l.push(j(o,s).then(()=>(0,n.toValue)(e)).finally(()=>c?.())),Promise.race(l)}function i(i,a){if(!(0,n.isRef)(i))return r(e=>e===i,a);let{flush:o=`sync`,deep:s=!1,timeout:c,throwOnTimeout:l}=a??{},u=null,d=[new Promise(r=>{u=(0,n.watch)([e,i],([e,i])=>{t!==(e===i)&&(u?u():(0,n.nextTick)(()=>u?.()),r(e))},{flush:o,deep:s,immediate:!0})})];return c!=null&&d.push(j(c,l).then(()=>(0,n.toValue)(e)).finally(()=>(u?.(),(0,n.toValue)(e)))),Promise.race(d)}function a(e){return r(e=>!!e,e)}function o(e){return i(null,e)}function s(e){return i(void 0,e)}function c(e){return r(Number.isNaN,e)}function l(e,t){return r(t=>{let r=Array.from(t);return r.includes(e)||r.includes((0,n.toValue)(e))},t)}function u(e){return d(1,e)}function d(e=1,t){let n=-1;return r(()=>(n+=1,n>=e),t)}return Array.isArray((0,n.toValue)(e))?{toMatch:r,toContains:l,changed:u,changedTimes:d,get not(){return M(e,!t)}}:{toMatch:r,toBe:i,toBeTruthy:a,toBeNull:o,toBeNaN:c,toBeUndefined:s,changed:u,changedTimes:d,get not(){return M(e,!t)}}}function N(e){return M(e)}var P=new Map,F=class{constructor(e){this.generator=e(this.abortController.signal,this),P.set(this,e)}static _this;static{this._this=(0,t.useGlobalVar)(this,`data/Stream`)}static isStream(e){return e instanceof this._this}static create(e){return(0,n.markRaw)(new this._this(e))}abortController=new A;generator;_setupData=[];setupData(e){return this._setupData.push(...e),this.data.value.unshift(...e),this}async next(e=!1){try{if(e||(await N(this.isRequesting).toBe(!1),this.isRequesting.value=!0),this._isDone)return e||(this.isRequesting.value=!1),{done:!0,value:void 0};e&&console.log(`igRequesting next`);let{value:t,done:n}=await this.generator.next(this);return this.isDone.value=n??!1,e||(this.isRequesting.value=!1),n?{done:!0,value:void 0}:(this.data.value.push(...t),{value:t,done:n})}catch(t){throw e||(this.isRequesting.value=!1),this.error.value=t,t}}async return(){return await this.generator.return?.()??{value:void 0,done:!0}}async throw(e){return await this.generator.throw?.(e)??{value:void 0,done:!0}}reset(){this.generator=P.get(this)(this.abortController.signal,this),this.total.value=NaN,this.page.value=0,this.pageSize.value=NaN,this.data.value=this._setupData,this.isDone.value=!1,this.isRequesting.value=!1,this.error.value=void 0}async retry(){return this.page.value--,this.next()}async nextToDone(){isNaN(this._pages)&&await this.next(!0);let e=[];for(let t=this._page+1;t<=this._pages;t++)e.push(this.next(!0));return await Promise.all(e),this._data}stop(){this.abortController.abort(),this.isRequesting.value=!1}[Symbol.asyncIterator](){return this}error=(0,n.shallowRef)();data=(0,n.ref)([]);get _data(){return this.data.value}page=(0,n.shallowRef)(0);get _page(){return this.page.value}pages=(0,n.shallowRef)(NaN);get _pages(){return this.pages.value}total=(0,n.shallowRef)(NaN);get _total(){return this.total.value}pageSize=(0,n.shallowRef)(NaN);get _pageSize(){return this.pageSize.value}length=(0,n.computed)(()=>this.data.value.length);get _length(){return this.data.value.length}isRequesting=(0,n.shallowRef)(!1);get _isRequesting(){return this.isRequesting.value}isDone=(0,n.shallowRef)(!1);get _isDone(){return this.isDone.value}isNoData=(0,n.computed)(()=>this.isDone.value&&this.isEmpty.value);get _isNoData(){return this.isNoData.value}isEmpty=(0,n.computed)(()=>this.length.value===0);get _isEmpty(){return this.isEmpty.value}};let I=e=>{let{resolve:t,promise:n}=Promise.withResolvers();return e(t),n};var L=class e{toJSON(){return JSON.parse(JSON.stringify(this.$$raw))}constructor(e){this.$$raw=e}static toRaw(t){return t instanceof e?t.toJSON():t}},R=u(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),z=d({Comment:()=>V}),B=p(R(),1),V=class extends L{static commentRow=O.create();constructor(e){super(e),this.content=e.content,this.time=e.time,this.id=e.id,this.childrenCount=e.childrenCount,this.likeCount=e.likeCount,this.isLiked=e.isLiked,this.reported=e.reported,this.$$plugin=e.$$plugin,this.$$meta=e.$$meta,this.isTop=e.isTop}content;time;get $time(){return(0,B.default)(this.time)}id;childrenCount;likeCount;isTop;isLiked;reported;$$plugin;$$meta},H=d({Ep:()=>U}),U=class extends L{name;index;$$plugin;$$meta;constructor(e){super(e),this.name=e.name,this.index=e.index,this.$$plugin=e.$$plugin,this.$$meta=e.$$meta}},W=d({Resource:()=>G}),G=class e extends L{static processInstances=(0,t.useGlobalVar)(O.create(),`uni/resource/processInstances`);static fork=(0,t.useGlobalVar)(O.create(),`uni/resource/fork`);static precedenceFork=(0,t.useGlobalVar)(O.create(),`uni/resource/precedenceFork`);static is(e){return e instanceof this}static create(e){return new this(e)}constructor(e){super(e),this.$$plugin=e.$$plugin,this.$$meta=e.$$meta,this.pathname=e.pathname,this.type=e.type,this.processSteps=(e.processSteps??[]).map(e=>x(e)?{referenceName:e,ignoreExit:!1}:e)}type;pathname;processSteps;$$meta;$$plugin;async getUrl(){let t=this.pathname;for(let n of this.processSteps){let r=e.processInstances.get([this.$$plugin,n.referenceName]);if(!r){console.warn(`[Resource.getUrl] process not found, fullname: [${this.$$plugin}, ${n.referenceName}]`);continue}let i=await r(t,this);if(t=i[0],!(n.ignoreExit||!i[1]))break}return URL.canParse(t)?t:`${this.getThisFork()}/${t}`}omittedForks=(0,n.shallowReactive)(new Set);getThisFork(){let t=new Set(e.fork.get([this.$$plugin,this.type])?.urls??[]);if(this.omittedForks.size==0)var n=e.precedenceFork.get([this.$$plugin,this.type]);else var n=Array.from(t.difference(this.omittedForks).values())[0];if(!n)throw Error(`[Resource.getThisFork] fork not found, type: [${this.$$plugin}, ${this.type}]`);return n}localChangeFork(){let t=new Set(e.fork.get([this.$$plugin,this.type])?.urls??[]);this.omittedForks.add(this.getThisFork());let n=t.difference(this.omittedForks).size!=0;return n&&this.omittedForks.clear(),n}},K=d({Image:()=>q}),q=class extends G{static is(e){return e instanceof this}static create(e,t){return new this(e,t)}constructor(e,t){`forkNamespace`in e?super({$$plugin:e.$$plugin,$$meta:{...e.$$meta,...t},pathname:e.path,type:e.forkNamespace,processSteps:e.processSteps}):super(e)}get aspect(){return this.$$meta}set aspect(e){this.$$meta??={},this.$$meta.width=e.width,this.$$meta.height=e.height}},J=d({Item:()=>Y}),Y=class extends L{static itemTranslator=O.create();static create(e){let t=this.itemTranslator.get(e.contentType);if(!t)throw Error(`can not found itemTranslator contentType:"${Z.contentPage.toString(e.contentType)}"`);return t(e)}static authorIcon=O.create();static itemCard=(0,t.useGlobalVar)(O.create(),`uni/item/itemCard`);static is(e){return e instanceof this}cover;get $cover(){return q.create(this.cover)}title;id;categories;author;viewNumber;likeNumber;commentNumber;isLiked;description;updateTime;get $updateTime(){return(0,B.default)(this.updateTime)}contentType;length;epLength;$$plugin;$$meta;thisEp;customIsSafe;get $thisEp(){return new U(this.thisEp)}constructor(e){super(e),this.$$plugin=e.$$plugin,this.$$meta=e.$$meta,this.thisEp=e.thisEp,this.updateTime=e.updateTime,this.cover=e.cover,this.title=e.title,this.id=e.id,this.categories=e.categories,this.author=e.author,this.viewNumber=e.viewNumber,this.likeNumber=e.likeNumber,this.commentNumber=e.commentNumber,this.isLiked=e.isLiked,this.customIsAI=e.customIsAI,this.contentType=Z.contentPage.toJSON(e.contentType),this.length=e.length,this.epLength=e.epLength,this.description=e.description,this.commentSendable=e.commentSendable,this.customIsSafe=e.customIsSafe}commentSendable;customIsAI;get $isAi(){let e=e=>/(^|[\((\[\s【])ai[】\))\]\s]?/gi.test(e);return this.customIsAI||e(this.title)||this.author.some(t=>e(`${t.label}\u1145${t.description}`))}},X=d({ContentPage:()=>Z}),Z=class{static viewLayout=(0,t.useGlobalVar)(O.create(),`uni/contentPage/viewLayout`);static contentPage=(0,t.useGlobalVar)(O.create(),`uni/contentPage/contentPage`);constructor(e,t,n){this.id=t,this.ep=n,this.preload.value=e}pid=E.withResolvers();preload=(0,n.shallowRef)(void 0);detail=E.withResolvers();union=(0,n.computed)(()=>this.detail.content.data.value??this.preload.value);recommends=E.withResolvers();eps=E.withResolvers()},Q=d({Downloader:()=>$}),$=class{},ee=d({User:()=>te}),te=class{static userBase=(0,n.shallowReactive)(new Map);static userEditorBase=(0,n.shallowReactive)(new Map);constructor(e){e.avatar&&(this.avatar=q.create(e.avatar)),this.name=e.name,this.id=e.id,this.$$plugin=e.$$plugin}avatar;name;id;$$plugin},ne=d({comment:()=>z,content:()=>X,download:()=>Q,ep:()=>H,image:()=>K,item:()=>J,resource:()=>W,user:()=>ee});e.PromiseContent=E,e.SourcedKeyMap=O,e.SourcedValue=D,e.Stream=F,e.Struct=L,e.callbackToPromise=I,Object.defineProperty(e,`uni`,{enumerable:!0,get:function(){return ne}})});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@delta-comic/utils`),require(`vue`),require(`axios`)):typeof define==`function`&&define.amd?define([`exports`,`@delta-comic/utils`,`vue`,`axios`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DcModel={},e.window.$$lib$$.DcUtils,e.window.$$lib$$.Vue,e.window.$$lib$$.Axios))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),d=(e,t)=>{let n={};for(var r in e)a(n,r,{get:e[r],enumerable:!0});return t||a(n,Symbol.toStringTag,{value:`Module`}),n},f=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},p=(e,t,n)=>(n=e==null?{}:i(c(e)),f(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e));function m(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function h(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}function g(e){return e instanceof Error}function _(e){return Number.isSafeInteger(e)&&e>=0}function v(e){return typeof e==`string`}function y(e){return e!=null&&typeof e!=`function`&&_(e.length)}function b(e){return typeof e==`object`&&!!e&&h(e)===`[object Arguments]`}function x(e){return typeof e==`string`||e instanceof String}function S(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function C(e){return m(e)}function w(e){if(e==null)return!0;if(y(e))return typeof e.splice!=`function`&&typeof e!=`string`&&(typeof Buffer>`u`||!Buffer.isBuffer(e))&&!C(e)&&!b(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return S(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}function T(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}var E=class e{[Symbol.toStringTag]=`PromiseContent`;static _this;static{this._this=(0,t.useGlobalVar)(this,`data/PromiseContent`)}static isPromiseContent(e){return e instanceof this._this}static fromPromise(e,t=e=>e){return(0,n.markRaw)(new this._this(e,t))}constructor(e,t=e=>e){this.promise=e,this.processor=t,this.loadPromise(e)}async loadPromise(e){this.data.value=void 0,this.isLoading.value=!0,this.isError.value=!1,this.errorCause.value=void 0,this.isEmpty.value=!0;try{let t=await e;this.data.value=this.processor(t),this.isLoading.value=!1,this.isError.value=!1,this.isEmpty.value=w(t),this.emitter.emit(`success`,this.data.value)}catch(e){this.data.value=void 0,this.isError.value=!0,this.errorCause.value=g(e)?e:Error(String(e)),console.error(`Non-throw Error [PromiseContent]`,e),this.emitter.emit(`error`,e)}this.emitter.emit(`finial`,void 0)}emitter=T();onError(e){return this.emitter.on(`error`,e),()=>this.emitter.off(`error`,e)}onSuccess(e){return this.emitter.on(`success`,e),()=>this.emitter.off(`success`,e)}onFinal(e){return this.emitter.on(`finial`,e),()=>this.emitter.off(`finial`,e)}setProcessor(t){return e.fromPromise(this.promise,t)}catch(e){return this.promise.catch(e)}then(e,t){return this.promise.then(e,t)}finally(e){return this.promise.finally(e)}data=(0,n.shallowRef)();isLoading=(0,n.shallowRef)(!0);isError=(0,n.shallowRef)(!1);errorCause=(0,n.shallowRef)();isEmpty=(0,n.shallowRef)(!0);static fromAsyncFunction(e){return(...t)=>this.fromPromise(e(...t))}static resolve(e){let t=this.fromPromise(Promise.resolve(e));return t.isLoading.value=!1,t}static withResolvers(e=!1){let t=Promise.withResolvers(),n=new this._this(t.promise);return n.isLoading.value=e,{content:n,reject:e=>{t.reject(e)},resolve:e=>{t.resolve(e)},reset(e=!1){t=Promise.withResolvers(),n.loadPromise(t.promise),n.isLoading.value=e}}}},D=class{toJSON(e){return v(e)?this.parse(e):e}parse(e){let t=e.split(this.separator);return[t[0],t.slice(1).join(this.separator)]}toString(e){return v(e)?e:this.stringify(e)}stringify(e){return e.join(this.separator)}constructor(e=`:`){this.separator=e}},O=class extends D{static create(e=`:`){return(0,n.shallowReactive)(new this(e))}constructor(e=`:`){super(e)}store=(0,n.shallowReactive)(new Map);get size(){return this.store.size}[Symbol.toStringTag]=`SourcedKeyMap`;clear(){this.store.clear()}delete(e){return this.store.delete(this.toString(e))}forEach(e,t){this.store.forEach((n,r)=>{e.call(t,n,r,this)})}get(e){return this.store.get(this.toString(e))}has(e){return this.store.has(this.toString(e))}set(e,t){return this.store.set(this.toString(e),t),this}entries(){return this.store.entries()}keys(){return this.store.keys()}values(){return this.store.values()}[Symbol.iterator](){return this.entries()}};function k(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}var A=class{_controller=new AbortController;mitt=k();get signal(){return this._controller.signal}abort(e){this._controller.abort(e),this._controller=new AbortController,this.mitt.emit(`abort`)}onAbort(e){return this.mitt.on(`abort`,e),()=>this.mitt.off(`abort`,e)}onAbortOnce(e){let t=async()=>{await e(),this.mitt.off(`abort`,t)};this.mitt.on(`abort`,t)}};Error,typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;function j(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{t?setTimeout(()=>i(n),e):setTimeout(r,e)})}function M(e,t=!1){function r(r,{flush:i=`sync`,deep:a=!1,timeout:o,throwOnTimeout:s}={}){let c=null,l=[new Promise(o=>{c=(0,n.watch)(e,e=>{r(e)!==t&&(c?c():(0,n.nextTick)(()=>c?.()),o(e))},{flush:i,deep:a,immediate:!0})})];return o!=null&&l.push(j(o,s).then(()=>(0,n.toValue)(e)).finally(()=>c?.())),Promise.race(l)}function i(i,a){if(!(0,n.isRef)(i))return r(e=>e===i,a);let{flush:o=`sync`,deep:s=!1,timeout:c,throwOnTimeout:l}=a??{},u=null,d=[new Promise(r=>{u=(0,n.watch)([e,i],([e,i])=>{t!==(e===i)&&(u?u():(0,n.nextTick)(()=>u?.()),r(e))},{flush:o,deep:s,immediate:!0})})];return c!=null&&d.push(j(c,l).then(()=>(0,n.toValue)(e)).finally(()=>(u?.(),(0,n.toValue)(e)))),Promise.race(d)}function a(e){return r(e=>!!e,e)}function o(e){return i(null,e)}function s(e){return i(void 0,e)}function c(e){return r(Number.isNaN,e)}function l(e,t){return r(t=>{let r=Array.from(t);return r.includes(e)||r.includes((0,n.toValue)(e))},t)}function u(e){return d(1,e)}function d(e=1,t){let n=-1;return r(()=>(n+=1,n>=e),t)}return Array.isArray((0,n.toValue)(e))?{toMatch:r,toContains:l,changed:u,changedTimes:d,get not(){return M(e,!t)}}:{toMatch:r,toBe:i,toBeTruthy:a,toBeNull:o,toBeNaN:c,toBeUndefined:s,changed:u,changedTimes:d,get not(){return M(e,!t)}}}function N(e){return M(e)}var P=new Map,F=class{constructor(e){this.generator=e.bind(this)(this.abortController.signal,this),P.set(this,e)}static _this;static{this._this=(0,t.useGlobalVar)(this,`data/Stream`)}static isStream(e){return e instanceof this._this}static create(e){return(0,n.markRaw)(new this._this(e))}abortController=new A;generator;_setupData=[];setupData(e){return this._setupData.push(...e),this.data.value.unshift(...e),this}async next(e=!1){try{if(e||(await N(this.isRequesting).toBe(!1),this.isRequesting.value=!0),this._isDone)return e||(this.isRequesting.value=!1),{done:!0,value:void 0};e&&console.log(`igRequesting next`);let{value:t,done:n}=await this.generator.next(this);return this.isDone.value=n??!1,e||(this.isRequesting.value=!1),n?{done:!0,value:void 0}:(this.data.value.push(...t),{value:t,done:n})}catch(t){throw e||(this.isRequesting.value=!1),this.error.value=t,t}}async return(){return await this.generator.return?.()??{value:void 0,done:!0}}async throw(e){return await this.generator.throw?.(e)??{value:void 0,done:!0}}toReadableStream(){let e=this;return new ReadableStream({async pull(t){let{value:n,done:r}=await e.next();r?t.close():t.enqueue(n)}})}reset(){this.generator=P.get(this).bind(this)(this.abortController.signal,this),this.total.value=NaN,this.page.value=0,this.pageSize.value=NaN,this.data.value=this._setupData,this.isDone.value=!1,this.isRequesting.value=!1,this.error.value=void 0}async retry(){return this.page.value--,this.next()}async nextToDone(){isNaN(this._pages)&&await this.next(!0);let e=[];for(let t=this._page+1;t<=this._pages;t++)e.push(this.next(!0));return await Promise.all(e),this._data}stop(){this.abortController.abort(),this.isRequesting.value=!1}[Symbol.asyncIterator](){return this}error=(0,n.shallowRef)();data=(0,n.ref)([]);get _data(){return this.data.value}page=(0,n.shallowRef)(0);get _page(){return this.page.value}pages=(0,n.shallowRef)(NaN);get _pages(){return this.pages.value}total=(0,n.shallowRef)(NaN);get _total(){return this.total.value}pageSize=(0,n.shallowRef)(NaN);get _pageSize(){return this.pageSize.value}length=(0,n.computed)(()=>this.data.value.length);get _length(){return this.data.value.length}isRequesting=(0,n.shallowRef)(!1);get _isRequesting(){return this.isRequesting.value}isDone=(0,n.shallowRef)(!1);get _isDone(){return this.isDone.value}isNoData=(0,n.computed)(()=>this.isDone.value&&this.isEmpty.value);get _isNoData(){return this.isNoData.value}isEmpty=(0,n.computed)(()=>this.length.value===0);get _isEmpty(){return this.isEmpty.value}};let I=e=>{let{resolve:t,promise:n}=Promise.withResolvers();return e(t),n};var L=class e{toJSON(){return JSON.parse(JSON.stringify(this.$$raw))}constructor(e){this.$$raw=e}static toRaw(t){return t instanceof e?t.toJSON():t}},R=u(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),z=d({Comment:()=>V}),B=p(R(),1),V=class extends L{static commentRow=O.create();constructor(e){super(e),this.content=e.content,this.time=e.time,this.id=e.id,this.childrenCount=e.childrenCount,this.likeCount=e.likeCount,this.isLiked=e.isLiked,this.reported=e.reported,this.$$plugin=e.$$plugin,this.$$meta=e.$$meta,this.isTop=e.isTop}content;time;get $time(){return(0,B.default)(this.time)}id;childrenCount;likeCount;isTop;isLiked;reported;$$plugin;$$meta},H=d({Ep:()=>U}),U=class extends L{name;index;$$plugin;$$meta;constructor(e){super(e),this.name=e.name,this.index=e.index,this.$$plugin=e.$$plugin,this.$$meta=e.$$meta}},W=d({Resource:()=>G}),G=class e extends L{static processInstances=(0,t.useGlobalVar)(O.create(),`uni/resource/processInstances`);static fork=(0,t.useGlobalVar)(O.create(),`uni/resource/fork`);static precedenceFork=(0,t.useGlobalVar)(O.create(),`uni/resource/precedenceFork`);static is(e){return e instanceof this}static create(e){return new this(e)}constructor(e){super(e),this.$$plugin=e.$$plugin,this.$$meta=e.$$meta,this.pathname=e.pathname,this.type=e.type,this.processSteps=(e.processSteps??[]).map(e=>x(e)?{referenceName:e,ignoreExit:!1}:e)}type;pathname;processSteps;$$meta;$$plugin;async getUrl(){let t=this.pathname;for(let n of this.processSteps){let r=e.processInstances.get([this.$$plugin,n.referenceName]);if(!r){console.warn(`[Resource.getUrl] process not found, fullname: [${this.$$plugin}, ${n.referenceName}]`);continue}let i=await r(t,this);if(t=i[0],!(n.ignoreExit||!i[1]))break}return URL.canParse(t)?t:`${this.getThisFork()}/${t}`}omittedForks=(0,n.shallowReactive)(new Set);getThisFork(){let t=new Set(e.fork.get([this.$$plugin,this.type])?.urls??[]),n;if(n=w(this.omittedForks)?e.precedenceFork.get([this.$$plugin,this.type]):Array.from(t.difference(this.omittedForks).values())[0],!n)throw Error(`[Resource.getThisFork] fork not found, type: [${this.$$plugin}, ${this.type}]`);return n}localChangeFork(){let t=new Set(e.fork.get([this.$$plugin,this.type])?.urls??[]);this.omittedForks.add(this.getThisFork());let n=w(t.difference(this.omittedForks));return n&&this.omittedForks.clear(),n}},K=d({Image:()=>q}),q=class extends G{static is(e){return e instanceof this}static create(e,t){return new this(e,t)}constructor(e,t){`forkNamespace`in e?super({$$plugin:e.$$plugin,$$meta:{...e.$$meta,...t},pathname:e.path,type:e.forkNamespace,processSteps:e.processSteps}):super(e)}get aspect(){return this.$$meta}set aspect(e){this.$$meta??={},this.$$meta.width=e.width,this.$$meta.height=e.height}},J=d({Item:()=>Y}),Y=class extends L{static itemTranslator=O.create();static create(e){let t=this.itemTranslator.get(e.contentType);if(!t)throw Error(`can not found itemTranslator contentType:"${Z.contentPage.toString(e.contentType)}"`);return t(e)}static authorIcon=O.create();static itemCard=(0,t.useGlobalVar)(O.create(),`uni/item/itemCard`);static is(e){return e instanceof this}cover;get $cover(){return q.create(this.cover)}title;id;categories;author;viewNumber;likeNumber;commentNumber;isLiked;description;updateTime;get $updateTime(){return(0,B.default)(this.updateTime)}contentType;length;epLength;$$plugin;$$meta;thisEp;customIsSafe;get $thisEp(){return new U(this.thisEp)}constructor(e){super(e),this.$$plugin=e.$$plugin,this.$$meta=e.$$meta,this.thisEp=e.thisEp,this.updateTime=e.updateTime,this.cover=e.cover,this.title=e.title,this.id=e.id,this.categories=e.categories,this.author=e.author,this.viewNumber=e.viewNumber,this.likeNumber=e.likeNumber,this.commentNumber=e.commentNumber,this.isLiked=e.isLiked,this.customIsAI=e.customIsAI,this.contentType=Z.contentPage.toJSON(e.contentType),this.length=e.length,this.epLength=e.epLength,this.description=e.description,this.commentSendable=e.commentSendable,this.customIsSafe=e.customIsSafe}commentSendable;customIsAI;get $isAi(){let e=e=>/(^|[\((\[\s【])ai[】\))\]\s]?/gi.test(e);return this.customIsAI||e(this.title)||this.author.some(t=>e(`${t.label}\u1145${t.description}`))}},X=d({ContentPage:()=>Z}),Z=class{static viewLayout=(0,t.useGlobalVar)(O.create(),`uni/contentPage/viewLayout`);static contentPage=(0,t.useGlobalVar)(O.create(),`uni/contentPage/contentPage`);constructor(e,t,n){this.id=t,this.ep=n,this.preload.value=e}pid=E.withResolvers();preload=(0,n.shallowRef)(void 0);detail=E.withResolvers();union=(0,n.computed)(()=>this.detail.content.data.value??this.preload.value);recommends=E.withResolvers();eps=E.withResolvers()},Q=d({Downloader:()=>$}),$=class{},ee=d({User:()=>te}),te=class{static userBase=(0,n.shallowReactive)(new Map);static userEditorBase=(0,n.shallowReactive)(new Map);constructor(e){e.avatar&&(this.avatar=q.create(e.avatar)),this.name=e.name,this.id=e.id,this.$$plugin=e.$$plugin}avatar;name;id;$$plugin},ne=d({comment:()=>z,content:()=>X,download:()=>Q,ep:()=>H,image:()=>K,item:()=>J,resource:()=>W,user:()=>ee});e.PromiseContent=E,e.SourcedKeyMap=O,e.SourcedValue=D,e.Stream=F,e.Struct=L,e.callbackToPromise=I,Object.defineProperty(e,`uni`,{enumerable:!0,get:function(){return ne}})});
2
2
  //# sourceMappingURL=index.umd.cjs.map