@univerjs/thread-comment 0.4.2-nightly.202411061606 → 0.4.2-nightly.202411081606
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/lib/cjs/index.js +1 -0
- package/lib/es/index.js +613 -619
- package/package.json +8 -4
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var Me=Object.defineProperty;var _e=(a,s,e)=>s in a?Me(a,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[s]=e;var N=(a,s,e)=>_e(a,typeof s!="symbol"?s+"":s,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("@univerjs/core"),ve=require("rxjs");class ae extends M.Disposable{constructor(){super();N(this,"_dataSource",null);N(this,"syncUpdateMutationToColla",!0)}set dataSource(e){this._dataSource=e}get dataSource(){return this._dataSource}async getThreadComment(e,t,n){return this._dataSource?(await this._dataSource.listComments(e,t,[n]))[0]:null}async addComment(e){var t;return this._dataSource?this._dataSource.addComment(e):{...e,threadId:(t=e.threadId)!=null?t:e.id}}async updateComment(e){return this._dataSource?this._dataSource.updateComment(e):!0}async resolveComment(e){return this._dataSource?this._dataSource.resolveComment(e):!0}async deleteComment(e,t,n,r){return this._dataSource?this._dataSource.deleteComment(e,t,n,r):!0}async listThreadComments(e,t,n){return this.dataSource?this.dataSource.listComments(e,t,n):!1}saveToSnapshot(e,t){if(this._dataSource){const n={};return Object.keys(e).forEach(r=>{const o=e[r];n[r]=o.map(this.dataSource.saveCommentToSnapshot)}),n}return e}}const I=M.createIdentifier("univer.thread-comment.data-source-service");var ge=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,Se=(a,s,e,t)=>{for(var n=t>1?void 0:t?ye(s,e):s,r=a.length-1,o;r>=0;r--)(o=a[r])&&(n=(t?o(s,e,n):o(n))||n);return t&&n&&ge(s,e,n),n},oe=(a,s)=>(e,t)=>s(e,t,a);exports.ThreadCommentModel=class extends M.Disposable{constructor(e,t){super();N(this,"_commentsMap",new Map);N(this,"_threadMap",new Map);N(this,"_commentUpdate$",new ve.Subject);N(this,"commentUpdate$",this._commentUpdate$.asObservable());N(this,"_tasks",[]);this._dataSourceService=e,this._lifecycleService=t,this.disposeWithMe(()=>{this._commentUpdate$.complete()}),this.disposeWithMe(this._lifecycleService.lifecycle$.subscribe(n=>{const r=new Map;n===M.LifecycleStages.Rendered&&(this._tasks.forEach(({unitId:o,subUnitId:d,threadIds:l})=>{let f=r.get(o);f||(f=new Map,r.set(o,f));let _=f.get(d);_||(_=new Set,f.set(d,_));for(const y of l)_.add(y)}),this._tasks=[],r.forEach((o,d)=>{o.forEach((l,f)=>{this.syncThreadComments(d,f,Array.from(l))})}))}))}_ensureCommentMap(e,t){let n=this._commentsMap.get(e);n||(n=new Map,this._commentsMap.set(e,n));let r=n.get(t);return r||(r=new Map,n.set(t,r)),r}ensureMap(e,t){return this._ensureCommentMap(e,t)}_ensureThreadMap(e,t){let n=this._threadMap.get(e);n||(n=new Map,this._threadMap.set(e,n));let r=n.get(t);return r||(r=new Map,n.set(t,r)),r}_replaceComment(e,t,n){const r=this._ensureCommentMap(e,t),o=r.get(n.id);if(o){const{children:d,...l}=n,f={...l,ref:o.ref};r.set(n.id,f),d==null||d.forEach(_=>{r.set(_.id,{..._,ref:""})}),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"syncUpdate",payload:f}),!!n.resolved!=!!o.resolved&&this._commentUpdate$.next({unitId:e,subUnitId:t,type:"resolve",payload:{commentId:n.id,resolved:!!n.resolved}})}}async syncThreadComments(e,t,n){if(this._lifecycleService.stage<M.LifecycleStages.Rendered){this._tasks.push({unitId:e,subUnitId:t,threadIds:n});return}const r=this._ensureThreadMap(e,t),o=this._ensureCommentMap(e,t),d=await this._dataSourceService.listThreadComments(e,t,n);if(!d)return;const l=new Set(n);d.forEach(f=>{this._replaceComment(e,t,f),l.delete(f.threadId)}),l.forEach(f=>{r.delete(f),o.forEach((_,y)=>{_.threadId===f&&o.delete(y)})})}addComment(e,t,n,r){const o=this._ensureCommentMap(e,t),{parentId:d,children:l=[],...f}=n,_={...f,parentId:d===n.id?void 0:d},y=T=>{o.set(T.id,T),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"add",payload:T,isRoot:!T.parentId})};y(_);const A=this._ensureThreadMap(e,t);if(!_.parentId){A.set(_.threadId,_);for(const T of l)y(T)}return r&&this.syncThreadComments(e,t,[_.threadId]),!0}updateComment(e,t,n,r){const d=this._ensureCommentMap(e,t).get(n.commentId);return d&&(d.updated=!0,d.text=n.text,d.attachments=n.attachments,d.updateT=n.updateT,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"update",payload:n,silent:r})),!0}updateCommentRef(e,t,n,r){const d=this._ensureCommentMap(e,t).get(n.commentId);return d?(d.ref=n.ref,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"updateRef",payload:n,silent:r,threadId:d.threadId}),!0):!1}resolveComment(e,t,n,r){const d=this._ensureCommentMap(e,t).get(n);return d?(d.resolved=r,this._commentUpdate$.next({unitId:e,subUnitId:t,type:"resolve",payload:{commentId:n,resolved:r}}),!0):!1}getComment(e,t,n){return this._ensureCommentMap(e,t).get(n)}getRootComment(e,t,n){return this._ensureThreadMap(e,t).get(n)}getThread(e,t,n){const r=this._ensureCommentMap(e,t),o=Array.from(r.values()).filter(_=>_.threadId===n);let d;const l=[],f=new Set;for(const _ of o)_.parentId?l.push(_):d=_,f.add(_.personId);if(d)return{root:d,children:l,relativeUsers:f,unitId:e,subUnitId:t,threadId:n}}getCommentWithChildren(e,t,n){const r=this.getComment(e,t,n);if(r)return this.getThread(e,t,r.threadId)}_deleteComment(e,t,n){const r=this._ensureCommentMap(e,t),o=r.get(n);o&&(r.delete(n),this._commentUpdate$.next({unitId:e,subUnitId:t,type:"delete",payload:{commentId:n,isRoot:!o.parentId,comment:o}}))}deleteThread(e,t,n){this._ensureThreadMap(e,t).delete(n),this._ensureCommentMap(e,t).forEach(d=>{d.threadId===n&&this._deleteComment(e,t,d.id)})}deleteComment(e,t,n){const o=this._ensureCommentMap(e,t).get(n);return o&&(o.parentId?this._deleteComment(e,t,n):this.deleteThread(e,t,o.threadId)),!0}deleteUnit(e){const t=this._commentsMap.get(e);t&&t.forEach((n,r)=>{n.forEach(o=>{this.deleteComment(e,r,o.id)})})}getUnit(e){const t=this._threadMap.get(e);if(!t)return[];const n=[];return t.forEach((r,o)=>{r.forEach((d,l)=>{const f=this.getThread(e,o,l);f&&n.push(f)})}),n}getAll(){const e=[];return this._commentsMap.forEach((t,n)=>{e.push({unitId:n,threads:this.getUnit(n)})}),e}};exports.ThreadCommentModel=Se([oe(0,M.Inject(I)),oe(1,M.Inject(M.LifecycleService))],exports.ThreadCommentModel);var q=(a=>(a[a.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",a[a.UNIVER_DOC=1]="UNIVER_DOC",a[a.UNIVER_SHEET=2]="UNIVER_SHEET",a[a.UNIVER_SLIDE=3]="UNIVER_SLIDE",a[a.UNIVER_PROJECT=4]="UNIVER_PROJECT",a[a.UNRECOGNIZED=-1]="UNRECOGNIZED",a))(q||{});const z="UNIVER_THREAD_COMMENT_PLUGIN";var Te=Object.defineProperty,$e=Object.getOwnPropertyDescriptor,De=(a,s,e,t)=>{for(var n=t>1?void 0:t?$e(s,e):s,r=a.length-1,o;r>=0;r--)(o=a[r])&&(n=(t?o(s,e,n):o(n))||n);return t&&n&&Te(s,e,n),n},B=(a,s)=>(e,t)=>s(e,t,a);exports.ThreadCommentResourceController=class extends M.Disposable{constructor(s,e,t){super(),this._resourceManagerService=s,this._threadCommentModel=e,this._threadCommentDataSourceService=t,this._initSnapshot()}_initSnapshot(){const s=t=>{const n=this._threadCommentModel.getUnit(t),r={};return n?(n.forEach(o=>{var l;const d=(l=r[o.subUnitId])!=null?l:[];d.push({...o.root,children:o.children}),r[o.unitId]=d}),JSON.stringify(this._threadCommentDataSourceService.saveToSnapshot(r,t))):""},e=t=>{if(!t)return{};try{return JSON.parse(t)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:`SHEET_${z}`,businesses:[q.UNIVER_SHEET,q.UNIVER_DOC],toJson:t=>s(t),parseJson:t=>e(t),onUnLoad:t=>{this._threadCommentModel.deleteUnit(t)},onLoad:async(t,n)=>{Object.keys(n).forEach(r=>{const o=n[r];o.forEach(d=>{this._threadCommentModel.addComment(t,r,d)}),this._threadCommentModel.syncThreadComments(t,r,o.map(d=>d.threadId))})}}))}};exports.ThreadCommentResourceController=De([B(0,M.IResourceManagerService),B(1,M.Inject(exports.ThreadCommentModel)),B(2,I)],exports.ThreadCommentResourceController);const Q={id:"thread-comment.mutation.add-comment",type:M.CommandType.MUTATION,handler(a,s,e){if(!s)return!1;const t=a.get(exports.ThreadCommentModel),{unitId:n,subUnitId:r,comment:o,sync:d}=s,l=d||(e==null?void 0:e.fromChangeset)&&!o.parentId;return t.addComment(n,r,o,l)}},X={id:"thread-comment.mutation.update-comment",type:M.CommandType.MUTATION,handler(a,s){if(!s)return!1;const e=a.get(exports.ThreadCommentModel),{unitId:t,subUnitId:n,payload:r,silent:o}=s;return e.updateComment(t,n,r,o)}},se={id:"thread-comment.mutation.update-comment-ref",type:M.CommandType.MUTATION,handler(a,s){if(!s)return!1;const e=a.get(exports.ThreadCommentModel),{unitId:t,subUnitId:n,payload:r,silent:o}=s;return e.updateCommentRef(t,n,r,o)}},ee={id:"thread-comment.mutation.resolve-comment",type:M.CommandType.MUTATION,handler(a,s){if(!s)return!1;const e=a.get(exports.ThreadCommentModel),{unitId:t,subUnitId:n,resolved:r,commentId:o}=s;return e.resolveComment(t,n,o,r)}},k={id:"thread-comment.mutation.delete-comment",type:M.CommandType.MUTATION,handler(a,s){if(!s)return!1;const e=a.get(exports.ThreadCommentModel),{unitId:t,subUnitId:n,commentId:r}=s;return e.deleteComment(t,n,r)}},ie={id:"thread-comment.command.add-comment",type:M.CommandType.COMMAND,async handler(a,s){if(!s)return!1;const e=a.get(M.ICommandService),t=a.get(I),{comment:n}=s,r=await t.addComment(n),o=t.syncUpdateMutationToColla,d=!n.parentId,l={id:Q.id,params:{...s,comment:r}};return d?await e.executeCommand(l.id,l.params):e.executeCommand(l.id,l.params,{onlyLocal:!o})}},me={id:"thread-comment.command.update-comment",type:M.CommandType.COMMAND,async handler(a,s){if(!s)return!1;const{unitId:e,subUnitId:t,payload:n}=s,r=a.get(M.ICommandService),o=a.get(exports.ThreadCommentModel),d=a.get(I),l=d.syncUpdateMutationToColla,f=o.getComment(e,t,n.commentId);if(!f)return!1;const{children:_,...y}=f;if(!await d.updateComment({...y,...n}))return!1;const T={id:X.id,params:s};return r.executeCommand(T.id,T.params,{onlyLocal:!l}),!0}},ce={id:"thread-comment.command.resolve-comment",type:M.CommandType.COMMAND,async handler(a,s){if(!s)return!1;const{unitId:e,subUnitId:t,resolved:n,commentId:r}=s,o=a.get(I),l=a.get(exports.ThreadCommentModel).getComment(e,t,r),f=o.syncUpdateMutationToColla;return!l||!await o.resolveComment({...l,resolved:n})?!1:a.get(M.ICommandService).executeCommand(ee.id,s,{onlyLocal:!f})}},de={id:"thread-comment.command.delete-comment",type:M.CommandType.COMMAND,async handler(a,s){if(!s)return!1;const e=a.get(exports.ThreadCommentModel),t=a.get(I),n=a.get(M.ICommandService),{unitId:r,subUnitId:o,commentId:d}=s,l=t.syncUpdateMutationToColla,f=e.getComment(r,o,d);if(!f||!await t.deleteComment(r,o,f.threadId,d))return!1;const _={id:k.id,params:s};return n.executeCommand(_.id,_.params,{onlyLocal:!l})}},ue={id:"thread-comment.command.delete-comment-tree",type:M.CommandType.COMMAND,async handler(a,s){if(!s)return!1;const e=a.get(exports.ThreadCommentModel),t=a.get(M.ICommandService),n=a.get(I),{unitId:r,subUnitId:o,commentId:d}=s,l=e.getCommentWithChildren(r,o,d);return!l||!await n.deleteComment(r,o,l.root.threadId,d)?!1:await t.executeCommand(k.id,{unitId:r,subUnitId:o,commentId:l.root.id})}},Oe="thread-comment.config",Ue={};var we=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ie=(a,s,e,t)=>{for(var n=t>1?void 0:t?Ne(s,e):s,r=a.length-1,o;r>=0;r--)(o=a[r])&&(n=(t?o(s,e,n):o(n))||n);return t&&n&&we(s,e,n),n},K=(a,s)=>(e,t)=>s(e,t,a),G;exports.UniverThreadCommentPlugin=(G=class extends M.Plugin{constructor(s=Ue,e,t,n){super(),this._config=s,this._injector=e,this._commandService=t,this._configService=n;const{...r}=this._config;this._configService.setConfig(Oe,r)}onStarting(){var s;M.mergeOverrideWithDependencies([[I,{useClass:ae}],[exports.ThreadCommentModel],[exports.ThreadCommentResourceController]],(s=this._config)==null?void 0:s.overrides).forEach(e=>{this._injector.add(e)}),[ie,me,de,ce,ue,Q,X,se,k,ee].forEach(e=>{this._commandService.registerCommand(e)}),this._injector.get(exports.ThreadCommentResourceController)}},N(G,"pluginName",z),N(G,"type",M.UniverInstanceType.UNIVER_UNKNOWN),G);exports.UniverThreadCommentPlugin=Ie([K(1,M.Inject(M.Injector)),K(2,M.ICommandService),K(3,M.IConfigService)],exports.UniverThreadCommentPlugin);var Ee=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Re(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var he={exports:{}};(function(a,s){(function(e,t){a.exports=t()})(Ee,function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",d="minute",l="hour",f="day",_="week",y="month",A="quarter",T="year",x="date",te="Invalid Date",le=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,fe=/\[([^\]]+)]|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,pe={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(h){var c=["th","st","nd","rd"],i=h%100;return"["+h+(c[(i-20)%10]||c[i]||c[0])+"]"}},F=function(h,c,i){var u=String(h);return!u||u.length>=c?h:""+Array(c+1-u.length).join(i)+h},Ce={s:F,z:function(h){var c=-h.utcOffset(),i=Math.abs(c),u=Math.floor(i/60),m=i%60;return(c<=0?"+":"-")+F(u,2,"0")+":"+F(m,2,"0")},m:function h(c,i){if(c.date()<i.date())return-h(i,c);var u=12*(i.year()-c.year())+(i.month()-c.month()),m=c.clone().add(u,y),p=i-m<0,C=c.clone().add(u+(p?-1:1),y);return+(-(u+(i-m)/(p?m-C:C-m))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:y,y:T,w:_,d:f,D:x,h:l,m:d,s:o,ms:r,Q:A}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},L="en",R={};R[L]=pe;var ne="$isDayjsObject",Z=function(h){return h instanceof V||!(!h||!h[ne])},Y=function h(c,i,u){var m;if(!c)return L;if(typeof c=="string"){var p=c.toLowerCase();R[p]&&(m=p),i&&(R[p]=i,m=p);var C=c.split("-");if(!m&&C.length>1)return h(C[0])}else{var g=c.name;R[g]=c,m=g}return!u&&m&&(L=m),m||!u&&L},$=function(h,c){if(Z(h))return h.clone();var i=typeof c=="object"?c:{};return i.date=h,i.args=arguments,new V(i)},v=Ce;v.l=Y,v.i=Z,v.w=function(h,c){return $(h,{locale:c.$L,utc:c.$u,x:c.$x,$offset:c.$offset})};var V=function(){function h(i){this.$L=Y(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[ne]=!0}var c=h.prototype;return c.parse=function(i){this.$d=function(u){var m=u.date,p=u.utc;if(m===null)return new Date(NaN);if(v.u(m))return new Date;if(m instanceof Date)return new Date(m);if(typeof m=="string"&&!/Z$/i.test(m)){var C=m.match(le);if(C){var g=C[2]-1||0,S=(C[7]||"0").substring(0,3);return p?new Date(Date.UTC(C[1],g,C[3]||1,C[4]||0,C[5]||0,C[6]||0,S)):new Date(C[1],g,C[3]||1,C[4]||0,C[5]||0,C[6]||0,S)}}return new Date(m)}(i),this.init()},c.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},c.$utils=function(){return v},c.isValid=function(){return this.$d.toString()!==te},c.isSame=function(i,u){var m=$(i);return this.startOf(u)<=m&&m<=this.endOf(u)},c.isAfter=function(i,u){return $(i)<this.startOf(u)},c.isBefore=function(i,u){return this.endOf(u)<$(i)},c.$g=function(i,u,m){return v.u(i)?this[u]:this.set(m,i)},c.unix=function(){return Math.floor(this.valueOf()/1e3)},c.valueOf=function(){return this.$d.getTime()},c.startOf=function(i,u){var m=this,p=!!v.u(u)||u,C=v.p(i),g=function(P,U){var E=v.w(m.$u?Date.UTC(m.$y,U,P):new Date(m.$y,U,P),m);return p?E:E.endOf(f)},S=function(P,U){return v.w(m.toDate()[P].apply(m.toDate("s"),(p?[0,0,0,0]:[23,59,59,999]).slice(U)),m)},D=this.$W,O=this.$M,w=this.$D,j="set"+(this.$u?"UTC":"");switch(C){case T:return p?g(1,0):g(31,11);case y:return p?g(1,O):g(0,O+1);case _:var b=this.$locale().weekStart||0,H=(D<b?D+7:D)-b;return g(p?w-H:w+(6-H),O);case f:case x:return S(j+"Hours",0);case l:return S(j+"Minutes",1);case d:return S(j+"Seconds",2);case o:return S(j+"Milliseconds",3);default:return this.clone()}},c.endOf=function(i){return this.startOf(i,!1)},c.$set=function(i,u){var m,p=v.p(i),C="set"+(this.$u?"UTC":""),g=(m={},m[f]=C+"Date",m[x]=C+"Date",m[y]=C+"Month",m[T]=C+"FullYear",m[l]=C+"Hours",m[d]=C+"Minutes",m[o]=C+"Seconds",m[r]=C+"Milliseconds",m)[p],S=p===f?this.$D+(u-this.$W):u;if(p===y||p===T){var D=this.clone().set(x,1);D.$d[g](S),D.init(),this.$d=D.set(x,Math.min(this.$D,D.daysInMonth())).$d}else g&&this.$d[g](S);return this.init(),this},c.set=function(i,u){return this.clone().$set(i,u)},c.get=function(i){return this[v.p(i)]()},c.add=function(i,u){var m,p=this;i=Number(i);var C=v.p(u),g=function(O){var w=$(p);return v.w(w.date(w.date()+Math.round(O*i)),p)};if(C===y)return this.set(y,this.$M+i);if(C===T)return this.set(T,this.$y+i);if(C===f)return g(1);if(C===_)return g(7);var S=(m={},m[d]=t,m[l]=n,m[o]=e,m)[C]||1,D=this.$d.getTime()+i*S;return v.w(D,this)},c.subtract=function(i,u){return this.add(-1*i,u)},c.format=function(i){var u=this,m=this.$locale();if(!this.isValid())return m.invalidDate||te;var p=i||"YYYY-MM-DDTHH:mm:ssZ",C=v.z(this),g=this.$H,S=this.$m,D=this.$M,O=m.weekdays,w=m.months,j=m.meridiem,b=function(U,E,W,J){return U&&(U[E]||U(u,p))||W[E].slice(0,J)},H=function(U){return v.s(g%12||12,U,"0")},P=j||function(U,E,W){var J=U<12?"AM":"PM";return W?J.toLowerCase():J};return p.replace(fe,function(U,E){return E||function(W){switch(W){case"YY":return String(u.$y).slice(-2);case"YYYY":return v.s(u.$y,4,"0");case"M":return D+1;case"MM":return v.s(D+1,2,"0");case"MMM":return b(m.monthsShort,D,w,3);case"MMMM":return b(w,D);case"D":return u.$D;case"DD":return v.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return b(m.weekdaysMin,u.$W,O,2);case"ddd":return b(m.weekdaysShort,u.$W,O,3);case"dddd":return O[u.$W];case"H":return String(g);case"HH":return v.s(g,2,"0");case"h":return H(1);case"hh":return H(2);case"a":return P(g,S,!0);case"A":return P(g,S,!1);case"m":return String(S);case"mm":return v.s(S,2,"0");case"s":return String(u.$s);case"ss":return v.s(u.$s,2,"0");case"SSS":return v.s(u.$ms,3,"0");case"Z":return C}return null}(U)||C.replace(":","")})},c.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},c.diff=function(i,u,m){var p,C=this,g=v.p(u),S=$(i),D=(S.utcOffset()-this.utcOffset())*t,O=this-S,w=function(){return v.m(C,S)};switch(g){case T:p=w()/12;break;case y:p=w();break;case A:p=w()/3;break;case _:p=(O-D)/6048e5;break;case f:p=(O-D)/864e5;break;case l:p=O/n;break;case d:p=O/t;break;case o:p=O/e;break;default:p=O}return m?p:v.a(p)},c.daysInMonth=function(){return this.endOf(y).$D},c.$locale=function(){return R[this.$L]},c.locale=function(i,u){if(!i)return this.$L;var m=this.clone(),p=Y(i,u,!0);return p&&(m.$L=p),m},c.clone=function(){return v.w(this.$d,this)},c.toDate=function(){return new Date(this.valueOf())},c.toJSON=function(){return this.isValid()?this.toISOString():null},c.toISOString=function(){return this.$d.toISOString()},c.toString=function(){return this.$d.toUTCString()},h}(),re=V.prototype;return $.prototype=re,[["$ms",r],["$s",o],["$m",d],["$H",l],["$W",f],["$M",y],["$y",T],["$D",x]].forEach(function(h){re[h[1]]=function(c){return this.$g(c,h[0],h[1])}}),$.extend=function(h,c){return h.$i||(h(c,V,$),h.$i=!0),$},$.locale=Y,$.isDayjs=Z,$.unix=function(h){return $(1e3*h)},$.en=R[L],$.Ls=R,$.p={},$})})(he);var be=he.exports;const Pe=Re(be);function xe(){return Pe().format("YYYY/MM/DD HH:mm")}exports.AddCommentCommand=ie;exports.AddCommentMutation=Q;exports.DeleteCommentCommand=de;exports.DeleteCommentMutation=k;exports.DeleteCommentTreeCommand=ue;exports.IThreadCommentDataSourceService=I;exports.ResolveCommentCommand=ce;exports.ResolveCommentMutation=ee;exports.TC_PLUGIN_NAME=z;exports.ThreadCommentDataSourceService=ae;exports.UpdateCommentCommand=me;exports.UpdateCommentMutation=X;exports.UpdateCommentRefMutation=se;exports.getDT=xe;
|