@univerjs/core 0.1.0-alpha.3 → 0.1.0-beta.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/lib/cjs/index.js +6 -6
- package/lib/es/index.js +771 -788
- package/lib/types/index.d.ts +1 -1
- package/lib/types/services/instance/instance.service.d.ts +4 -4
- package/lib/types/shared/index.d.ts +0 -1
- package/lib/types/shared/object-matrix.d.ts +1 -0
- package/lib/types/sheets/workbook.d.ts +7 -13
- package/lib/types/types/const/index.d.ts +0 -1
- package/lib/types/types/enum/border-style-types.d.ts +6 -1
- package/lib/types/types/interfaces/i-style-data.d.ts +17 -0
- package/lib/types/types/interfaces/i-workbook-data.d.ts +12 -3
- package/lib/umd/index.js +5 -5
- package/package.json +7 -7
- package/lib/types/shared/gen-name.d.ts +0 -23
- package/lib/types/types/const/action-names.d.ts +0 -65
- package/lib/types/types/const/doc-action-names.d.ts +0 -21
package/lib/umd/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(c,
|
|
1
|
+
(function(c,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("@wendellhu/redi"),require("rxjs"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@wendellhu/redi","rxjs","rxjs/operators"],A):(c=typeof globalThis<"u"?globalThis:c||self,A(c.UniverCore={},c["@wendellhu/redi"],c.rxjs,c.rxjs.operators))})(this,function(c,A,N,ys){"use strict";var Wo=Object.defineProperty;var $o=(c,A,N)=>A in c?Wo(c,A,{enumerable:!0,configurable:!0,writable:!0,value:N}):c[A]=N;var _=(c,A,N)=>($o(c,typeof A!="symbol"?A+"":A,N),N);var Ho,Bo;function tr(){er()}const wt=typeof global<"u"?global:typeof self<"u"?self:window;function er(){typeof wt.requestIdleCallback!="function"&&(wt.requestIdleCallback=function(n){const s=Date.now();return setTimeout(function(){const i=Math.max(0,50-(Date.now()-s));n({didTimeout:i===0,timeRemaining(){return i}})},1)}),typeof wt.cancelIdleCallback!="function"&&(wt.cancelIdleCallback=function(n){clearTimeout(n)})}class te{constructor(){_(this,"_data",[])}static create(){return new te}add(e){this._data.indexOf(e)>-1||this._data.push(e)}delete(e){const n=this._data.indexOf(e);this._data.splice(n,1)}getData(){return this._data}}class ee{constructor(){_(this,"_data",new Map)}static create(){return new ee}add(e,n){this._data.has(e)||this._data.set(e,n)}delete(e){this._data.delete(e)}getData(){return this._data}}var M=(t=>(t[t.Univer=0]="Univer",t[t.Doc=1]="Doc",t[t.Sheet=2]="Sheet",t[t.Slide=3]="Slide",t))(M||{});class Be{constructor(e){_(this,"_name");this._name=e}onStarting(e){}onReady(){}onRendered(){}onSteady(){}onDestroy(){}getPluginName(){return this._name}}_(Be,"type",0);class nr{constructor(){_(this,"_plugins",[])}addPlugin(e){this._plugins.push(e)}removePlugins(){const e=this._plugins.slice();return this._plugins.length=0,e}forEachPlugin(e){this._plugins.forEach(e)}}class sr{constructor(){_(this,"_pluginsRegisteredByBusiness",new Map)}registerPlugin(e,n){const s=e.type;this._pluginsRegisteredByBusiness.has(s)||this._pluginsRegisteredByBusiness.set(s,[]),this._pluginsRegisteredByBusiness.get(s).push({plugin:e,options:n})}getRegisterPlugins(e){return this._pluginsRegisteredByBusiness.get(e)||[]}clearPluginsOfType(e){this._pluginsRegisteredByBusiness.delete(e)}}function q(t,e){const n=t.indexOf(e);return n>-1?(t.splice(n,1),!0):!1}function rr(t){const e=new Set,n=[];for(const s of t)e.has(s)||(e.add(s),n.push(s));return n}function ir(t,e){for(let n=t.length-1;n>-1;n--){const s=t[n];if(e(s,n))return s}return null}async function We(t){for(const[e,n]of t.entries())try{if(!await n())return{index:e,result:!1}}catch(s){return{index:e,result:!1,error:s}}return{result:!0,index:-1}}function $e(t){for(const[e,n]of t.entries())try{if(!n())return{index:e,result:!1}}catch(s){return{index:e,result:!1,error:s}}return{result:!0,index:-1}}function Ge(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],s=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ke(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var s=n.call(t),r,i=[],o;try{for(;(e===void 0||e-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i}function xe(t,e,n){if(n||arguments.length===2)for(var s=0,r=e.length,i;s<r;s++)(i||!(s in e))&&(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;function Rt(t){return typeof t=="function"}function or(t){var e=function(s){Error.call(s),s.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var ne=or(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
|
2
2
|
`+n.map(function(s,r){return r+1+") "+s.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function Ve(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var pe=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,s,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=$e(o),h=a.next();!h.done;h=a.next()){var l=h.value;l.remove(this)}}catch(R){e={error:R}}finally{try{h&&!h.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(Rt(u))try{u()}catch(R){i=R instanceof ee?R.errors:[R]}var _=this._finalizers;if(_){this._finalizers=null;try{for(var g=$e(_),f=g.next();!f.done;f=g.next()){var E=f.value;try{je(E)}catch(R){i=i??[],R instanceof ee?i=xe(xe([],ke(i)),ke(R.errors)):i.push(R)}}}catch(R){s={error:R}}finally{try{f&&!f.done&&(r=g.return)&&r.call(g)}finally{if(s)throw s.error}}}if(i)throw new ee(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)je(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&Ve(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Ve(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}();pe.EMPTY;function ur(t){return t instanceof pe||t&&"closed"in t&&Rt(t.remove)&&Rt(t.add)&&Rt(t.unsubscribe)}function je(t){Rt(t)?t():t.unsubscribe()}class ze{constructor(e=!1){d(this,"skipNextObservers");d(this,"lastReturnValue");d(this,"isStopPropagation",!1);this.initialize(e)}initialize(e=!1){return this.skipNextObservers=e,this}stopPropagation(){this.isStopPropagation=!0}}function Ye(t){return t instanceof vt}class vt{constructor(e,n){d(this,"_willBeUnregistered",!1);d(this,"unregisterOnNextCall",!1);this.callback=e,this.observable=n}dispose(){this.observable.remove(this)}}class Dt{constructor(e){d(this,"_observers",new Array);d(this,"_eventState");d(this,"_onObserverAdded");this._eventState=new ze,e&&(this._onObserverAdded=e)}get observers(){return this._observers}add(e,n=!1,s=!1){if(!e)return null;const r=new vt(e,this);return r.unregisterOnNextCall=s,n?this._observers.unshift(r):this._observers.push(r),this._onObserverAdded&&this._onObserverAdded(r),r}addOnce(e){return this.add(e,void 0,!0)}remove(e){return e&&this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1}removeCallback(e){for(let n=0;n<this._observers.length;n++){const s=this._observers[n];if(!s._willBeUnregistered&&s.callback===e)return this._deferUnregister(s),!0}return!1}makeObserverTopPriority(e){this._remove(e),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e),this._observers.push(e)}notifyObservers(e){if(!this._observers.length)return null;const n=this._eventState;n.skipNextObservers=!1,n.lastReturnValue=e,n.isStopPropagation=!1;let s=!1;for(let r=0;r<this._observers.length;r++){const i=this._observers[r];if(!i._willBeUnregistered&&(n.lastReturnValue=i.callback(e,n),i.unregisterOnNextCall&&this._deferUnregister(i),n.isStopPropagation&&(s=!0),n.skipNextObservers))return{lastReturnValue:n.lastReturnValue,stopPropagation:s}}return{lastReturnValue:n.lastReturnValue,stopPropagation:s}}notifyObserversWithPromise(e){let n=Promise.resolve(e);if(!this._observers.length)return n;const s=this._eventState;s.skipNextObservers=!1;for(let r=0;r<this._observers.length;r++){const i=this._observers[r];s.skipNextObservers||i._willBeUnregistered||(n=n.then(()=>i.callback(e,s)),i.unregisterOnNextCall&&this._deferUnregister(i))}return n.then(()=>e)}notifyObserver(e,n){if(e._willBeUnregistered)return;const s=this._eventState;return s.skipNextObservers=!1,e.callback(n,s),e.unregisterOnNextCall&&this._deferUnregister(e),{lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}hasObservers(){return this._observers.length>0}clear(){this._observers=new Array,this._onObserverAdded=null}clone(){const e=new Dt;return e._observers=this._observers.slice(0),e}_deferUnregister(e){e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(()=>{this._remove(e)},0)}_remove(e){if(!e)return!1;const n=this._observers.indexOf(e);return n!==-1?(this._observers.splice(n,1),!0):!1}}function D(t){let e=!1;return ur(t)?{dispose:()=>{e||(e=!0,t.unsubscribe())}}:Ye(t)?{dispose:()=>{e||(e=!0,t.dispose())}}:{dispose:()=>{e||(e=!0,t())}}}function cr(t){return D(()=>{t.unsubscribe()})}class Ke{constructor(){d(this,"_disposables",new Set)}add(e){return this._disposables.add(e),{dispose:()=>{e.dispose(),this._disposables.delete(e)}}}dispose(){this._disposables.forEach(e=>{e.dispose(),this._disposables.delete(e)})}}class M{constructor(){d(this,"_disposed",!1);d(this,"_collection",new Ke)}disposeWithMe(e){return this._collection.add(e)}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class hr extends M{constructor(){super(...arguments);d(this,"dispose$",new N.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}const at=O.createIdentifier("univer.context-service");class Xe extends M{constructor(){super(...arguments);d(this,"_contextChanged$",new N.Subject);d(this,"contextChanged$",this._contextChanged$.asObservable());d(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(n){return this._contextMap.get(n)??!1}setContextValue(n,s){this._contextMap.set(n,s),this._contextChanged$.next()}}var Qe=(t=>(t[t.SILENT=0]="SILENT",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.VERBOSE=3]="VERBOSE",t))(Qe||{});const lt=O.createIdentifier("univer.log");class Ze extends M{constructor(){super(...arguments);d(this,"_logLevel",0)}log(...n){if(this._logLevel<3||!n.length)return;const s=n[0];/^\[(.*?)\]/g.test(s)?console.log(`\x1B[97;104m${s}\x1B[0m:`,...n.slice(1)):console.log(...n)}warn(...n){this._logLevel>=2&&console.warn(...n)}error(...n){this._logLevel>=1&&console.error(...n)}setLogLevel(n){this._logLevel=n}}var _r=Object.defineProperty,dr=Object.getOwnPropertyDescriptor,fr=(t,e,n,s)=>{for(var r=s>1?void 0:s?dr(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&_r(e,n,r),r},qe=(t,e)=>(n,s)=>e(n,s,t),Tt=(t=>(t[t.COMMAND=0]="COMMAND",t[t.OPERATION=1]="OPERATION",t[t.MUTATION=2]="MUTATION",t))(Tt||{});const mt=O.createIdentifier("anywhere.command-service");class gr{constructor(){d(this,"_commands",new Map)}registerCommand(e){if(this._commands.has(e.id))throw new Error(`Command ${e.id} has registered before!`);return this._commands.set(e.id,e),D(()=>{var n;this._commands.delete(e.id),(n=e.onDispose)==null||n.call(e)})}getCommand(e){return this._commands.has(e)?[this._commands.get(e)]:null}}c.CommandService=class{constructor(e,n){d(this,"_commandRegistry");d(this,"_beforeCommandExecutionListeners",[]);d(this,"_commandExecutedListeners",[]);d(this,"_multiCommandDisposables",new Map);d(this,"_commandExecutingLevel",0);d(this,"_commandExecutionStack",[]);this._injector=e,this._log=n,this._commandRegistry=new gr}registerCommand(e){return this._registerCommand(e)}registerAsMultipleCommand(e){return this._registerMultiCommand(e)}beforeCommandExecuted(e){if(this._beforeCommandExecutionListeners.indexOf(e)===-1)return this._beforeCommandExecutionListeners.push(e),D(()=>{const n=this._beforeCommandExecutionListeners.indexOf(e);this._beforeCommandExecutionListeners.splice(n,1)});throw new Error("Could not add a listener twice.")}onCommandExecuted(e){if(this._commandExecutedListeners.indexOf(e)===-1)return this._commandExecutedListeners.push(e),D(()=>{const n=this._commandExecutedListeners.indexOf(e);this._commandExecutedListeners.splice(n,1)});throw new Error("Could not add a listener twice.")}async executeCommand(e,n,s){const r=this._commandRegistry.getCommand(e);if(r){const[i]=r,o={id:i.id,type:i.type,params:n},a=this._pushCommandExecutionStack(o);this._beforeCommandExecutionListeners.forEach(l=>l(o,s));const h=await this._execute(i,n);return this._commandExecutedListeners.forEach(l=>l(o,s)),a.dispose(),h}throw new Error(`[CommandService]: Command "${e}" is not registered.`)}syncExecuteCommand(e,n,s){const r=this._commandRegistry.getCommand(e);if(r){const[i]=r,o={id:i.id,type:i.type,params:n};if(i.type===2){const l=ar(this._commandExecutionStack,u=>u.type===0);l&&(o.params=o.params??{},o.params.trigger=l.id)}const a=this._pushCommandExecutionStack(o),h=this._syncExecute(i,n);return a.dispose(),this._commandExecutedListeners.forEach(l=>l(o,s)),h}throw new Error(`[CommandService]: Command "${e}" is not registered.`)}_pushCommandExecutionStack(e){return this._commandExecutionStack.push(e),D(()=>Q(this._commandExecutionStack,e))}_registerCommand(e){return this._commandRegistry.registerCommand(e)}_registerMultiCommand(e){const n=this._commandRegistry.getCommand(e.id);let s;if(!n)s=new Er(e.id),this._multiCommandDisposables.set(e.id,this._commandRegistry.registerCommand(s));else{if(n[0].multi!==!0)throw new Error("Command has registered as a single command.");s=n[0]}const r=s.registerImplementation(e);return D(()=>{var i;r.dispose(),s.hasImplementations()||(i=this._multiCommandDisposables.get(e.id))==null||i.dispose()})}async _execute(e,n){this._log.log("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${e.id}"`),this._commandExecutingLevel++;let s;try{s=await this._injector.invoke(e.handler,n),this._commandExecutingLevel--}catch(r){throw s=!1,this._commandExecutingLevel=0,r}return s}_syncExecute(e,n){this._log.log("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${e.id}".`),this._commandExecutingLevel++;let s;try{if(s=this._injector.invoke(e.handler,n),s instanceof Promise)throw new Error("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(r){throw s=!1,this._commandExecutingLevel=0,r}return s}},c.CommandService=fr([qe(0,O.Inject(O.Injector)),qe(1,lt)],c.CommandService);class Er{constructor(e){d(this,"name");d(this,"multi",!0);d(this,"type",0);d(this,"priority",0);d(this,"_implementations",[]);d(this,"handler",async(e,n)=>{if(!this._implementations.length)return!1;const s=e.get(lt),r=e.get(at),i=e.get(O.Injector);for(const o of this._implementations){const a=o.command.preconditions;if(a!=null&&a(r)&&(s.log("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,n)))return!0}return!1});this.id=e,this.name=e}registerImplementation(e){const n={command:e};return this._implementations.push(n),this._implementations.sort((s,r)=>r.command.priority-s.command.priority),D(()=>{var r;const s=this._implementations.indexOf(n);this._implementations.splice(s,1),(r=e.onDispose)==null||r.call(e)})}hasImplementations(){return this._implementations.length>0}}function ne(t,e,n){const s=t.map(r=>()=>e.syncExecuteCommand(r.id,r.params,n));return Ge(s)}function Rr(t,e,n){const s=t.map(r=>()=>e.executeCommand(r.id,r.params,n));return We(s)}const Je=O.createIdentifier("univer.config-service");class mr{constructor(){d(this,"_config",new Map)}getConfig(e){return this._config.get(e)}setConfig(e,n){this._config.set(e,n)}deleteConfig(e){this._config.delete(e)}}class ye extends M{constructor(){super(...arguments);d(this,"_error$",new N.Subject);d(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}const Or="__default_document_sub_component_id20231101__";class tn{constructor(){d(this,"_managerInfo",new Map);d(this,"_remove$",new N.Subject);d(this,"remove$",this._remove$.asObservable());d(this,"_andOrUpdate$",new N.Subject);d(this,"andOrUpdate$",this._andOrUpdate$.asObservable());d(this,"_pluginUpdate$",new N.Subject);d(this,"pluginUpdate$",this._pluginUpdate$.asObservable())}getFloatObject(e){return this._getFloatingObject(e)}getFloatObjects(e){return this._getFloatingObjects(e)}dispose(){this._remove$.complete(),this._andOrUpdate$.complete(),this._pluginUpdate$.complete(),this._managerInfo.clear()}clear(e){const n=this._clearByParam(e);this._remove$.next(n)}addOrUpdate(e){const n=this._addByParam(e);this._andOrUpdate$.next(n)}BatchAddOrUpdate(e){const n=[];e.forEach(s=>{n.push(...this._addByParam(s))}),this._andOrUpdate$.next(n)}remove(e){const n=this._removeByParam(e);this._remove$.next(n)}pluginUpdateRefresh(e){this._pluginUpdate$.next(e)}_getFloatingObjects(e){var r;if(e==null)return;const{unitId:n,subComponentId:s}=e;return(r=this._managerInfo.get(n))==null?void 0:r.get(s)}_getFloatingObject(e){var i,o;if(e==null)return;const{unitId:n,subComponentId:s,floatingObjectId:r}=e;return(o=(i=this._managerInfo.get(n))==null?void 0:i.get(s))==null?void 0:o.get(r)}_addByParam(e){const{unitId:n,subComponentId:s,floatingObject:r,floatingObjectId:i}=e;this._managerInfo.has(n)||this._managerInfo.set(n,new Map);const o=this._managerInfo.get(n);return o.has(s)||o.set(s,new Map),o.get(s).set(i,r),[{unitId:n,subComponentId:s,floatingObjectId:i,floatingObject:r}]}_clearByParam(e){const n=this._getFloatingObjects(e),{unitId:s,subComponentId:r}=e,i=[];return n==null||n.forEach((o,a)=>{i.push({unitId:s,subComponentId:r,floatingObjectId:a,floatingObject:o})}),n==null||n.clear(),i}_removeByParam(e){const n=this._getFloatingObjects(e),s=n==null?void 0:n.get(e.floatingObjectId);return s==null?[]:(n==null||n.delete(e.floatingObjectId),[{...e,floatingObject:s}])}}const en=O.createIdentifier("univer.floating-object.service");class nn{constructor(){d(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(e){this.cursor+=e}moveCursorTo(e){this.cursor=e}}function sn(t,e){let n=0,s=t.length-1;for(;n<=s;){const r=Math.floor((s+n)/2);if(e<t[r]&&(r===0||e>=t[r-1]))return r;if(e>=t[r])n=r+1;else if(e<t[r])s=r-1;else return-1}return-1}function rn(t,e){let n=0,s=0,r=0,i=-1,o=t.length-1;for(;n<t.length&&o>=0&&o>=n;){if(s=t[o],o===0?r=0:r=t[o-1],e>=r&&e<=s){i=o;break}if(s=t[n],n===0?r=0:r=t[n-1],e>=r&&e<s){i=n;break}n++,o--}return i}function Ar(t,e){let n=t.length-1;return e<t[0]?-1:e>t[t.length-1]?1/0:(t.length<40||e<=t[20]||e>=t[n-20]?n=rn(t,e):n=sn(t,e),n)}function Ir(t){const e=new Blob([t],{type:"text/javascript"});return window.URL.createObjectURL(e)}var on=(t=>(t[t.DEFAULT_SERIES=0]="DEFAULT_SERIES",t[t.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",t))(on||{}),L=(t=>(t[t.NONE=0]="NONE",t[t.THIN=1]="THIN",t[t.HAIR=2]="HAIR",t[t.DOTTED=3]="DOTTED",t[t.DASHED=4]="DASHED",t[t.DASH_DOT=5]="DASH_DOT",t[t.DASH_DOT_DOT=6]="DASH_DOT_DOT",t[t.DOUBLE=7]="DOUBLE",t[t.MEDIUM=8]="MEDIUM",t[t.MEDIUM_DASHED=9]="MEDIUM_DASHED",t[t.MEDIUM_DASH_DOT=10]="MEDIUM_DASH_DOT",t[t.MEDIUM_DASH_DOT_DOT=11]="MEDIUM_DASH_DOT_DOT",t[t.SLANT_DASH_DOT=12]="SLANT_DASH_DOT",t[t.THICK=13]="THICK",t))(L||{}),an=(t=>(t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right",t.NONE="none",t.ALL="all",t.OUTSIDE="outside",t.INSIDE="inside",t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))(an||{}),$=(t=>(t[t.UNSUPPORTED=0]="UNSUPPORTED",t[t.RGB=1]="RGB",t[t.HEX=2]="HEX",t[t.THEME=3]="THEME",t))($||{}),ln=(t=>(t[t.ON=0]="ON",t[t.OFF=1]="OFF",t))(ln||{}),un=(t=>(t[t.CONDITION_TYPE_UNSPECIFIED=0]="CONDITION_TYPE_UNSPECIFIED",t[t.NUMNUMBER_BETWEENR_GREATER=1]="NUMNUMBER_BETWEENR_GREATER",t[t.NUMBER_GREATER_THAN_EQ=2]="NUMBER_GREATER_THAN_EQ",t[t.NUMBER_LESS=3]="NUMBER_LESS",t[t.NUMBER_LESS_THAN_EQ=4]="NUMBER_LESS_THAN_EQ",t[t.NUMBER_EQ=5]="NUMBER_EQ",t[t.NUMBER_NOT_EQ=6]="NUMBER_NOT_EQ",t[t.NUMBER_BETWEEN=7]="NUMBER_BETWEEN",t[t.NUMBER_NOT_BETWEEN=8]="NUMBER_NOT_BETWEEN",t[t.TEXT_CONTAINS=9]="TEXT_CONTAINS",t[t.TEXT_NOT_CONTAINS=10]="TEXT_NOT_CONTAINS",t[t.TEXT_STARTS_WITH=11]="TEXT_STARTS_WITH",t[t.TEXT_ENDS_WITH=12]="TEXT_ENDS_WITH",t[t.TEXT_EQ=13]="TEXT_EQ",t[t.TEXT_IS_EMAIL=14]="TEXT_IS_EMAIL",t[t.TEXT_IS_URL=15]="TEXT_IS_URL",t[t.DATE_EQ=16]="DATE_EQ",t[t.DATE_BEFORE=17]="DATE_BEFORE",t[t.DATE_AFTER=18]="DATE_AFTER",t[t.DATE_ON_OR_BEFORE=19]="DATE_ON_OR_BEFORE",t[t.DATE_ON_OR_AFTER=20]="DATE_ON_OR_AFTER",t[t.DATE_BETWEEN=21]="DATE_BETWEEN",t[t.DATE_NOT_BETWEEN=22]="DATE_NOT_BETWEEN",t[t.DATE_IS_VALID=23]="DATE_IS_VALID",t[t.ONE_OF_RANGE=24]="ONE_OF_RANGE",t[t.ONE_OF_LIST=25]="ONE_OF_LIST",t[t.BLANK=26]="BLANK",t[t.NOT_BLANK=27]="NOT_BLANK",t[t.CUSTOM_FORMULA=28]="CUSTOM_FORMULA",t[t.BOOLEAN=29]="BOOLEAN",t[t.TEXT_NOT_EQ=30]="TEXT_NOT_EQ",t[t.DATE_NOT_EQ=31]="DATE_NOT_EQ",t))(un||{}),cn=(t=>(t[t.PASTE_NORMAL=0]="PASTE_NORMAL",t[t.PASTE_NO_BORDERS=1]="PASTE_NO_BORDERS",t[t.PASTE_FORMAT=2]="PASTE_FORMAT",t[t.PASTE_FORMULA=3]="PASTE_FORMULA",t[t.PASTE_DATA_VALIDATION=4]="PASTE_DATA_VALIDATION",t[t.PASTE_VALUES=5]="PASTE_VALUES",t[t.PASTE_CONDITIONAL_FORMATTING=6]="PASTE_CONDITIONAL_FORMATTING",t[t.PASTE_COLUMN_WIDTHS=7]="PASTE_COLUMN_WIDTHS",t))(cn||{}),hn=(t=>(t[t.DOCUMENT=0]="DOCUMENT",t[t.PROJECT=1]="PROJECT",t))(hn||{}),_n=(t=>(t[t.COLUMNS=0]="COLUMNS",t[t.ROWS=1]="ROWS",t))(_n||{}),dn=(t=>(t[t.UP=0]="UP",t[t.RIGHT=1]="RIGHT",t[t.DOWN=2]="DOWN",t[t.LEFT=3]="LEFT",t))(dn||{});function Cr(t){switch(t){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var fn=(t=>(t[t.NUMBER_FORMAT_TYPE_UNSPECIFIED=0]="NUMBER_FORMAT_TYPE_UNSPECIFIED",t[t.TEXT=1]="TEXT",t[t.NUMBER=2]="NUMBER",t[t.PERCENT=3]="PERCENT",t[t.CURRENCY=4]="CURRENCY",t[t.DATE=5]="DATE",t[t.TIME=6]="TIME",t[t.DATE_TIME=7]="DATE_TIME",t[t.SCIENTIFIC=8]="SCIENTIFIC",t))(fn||{}),gn=(t=>(t[t.INTERPOLATION_POINT_TYPE_UNSPECIFIED=0]="INTERPOLATION_POINT_TYPE_UNSPECIFIED",t[t.MIN=1]="MIN",t[t.MAX=2]="MAX",t[t.NUMBER=3]="NUMBER",t[t.PERCENT=4]="PERCENT",t[t.PERCENTILE=5]="PERCENTILE",t))(gn||{}),Ut=(t=>(t.EN_US="enUS",t.ZH_CN="zhCN",t))(Ut||{}),En=(t=>(t[t.RANGE=0]="RANGE",t[t.SHEET=1]="SHEET",t))(En||{}),Rn=(t=>(t[t.RELATIVE_DATE_UNSPECIFIED=0]="RELATIVE_DATE_UNSPECIFIED",t[t.PAST_YEAR=1]="PAST_YEAR",t[t.PAST_MONTH=2]="PAST_MONTH",t[t.PAST_WEEK=3]="PAST_WEEK",t[t.YESTERDAY=4]="YESTERDAY",t[t.TODAY=5]="TODAY",t[t.TOMORROW=6]="TOMORROW",t))(Rn||{}),mn=(t=>(t[t.TYPE_UNSPECIFIED=0]="TYPE_UNSPECIFIED",t[t.TEXT_BOX=1]="TEXT_BOX",t[t.RECTANGLE=2]="RECTANGLE",t[t.ROUND_RECTANGLE=3]="ROUND_RECTANGLE",t[t.ELLIPSE=4]="ELLIPSE",t[t.ARC=5]="ARC",t[t.BENT_ARROW=6]="BENT_ARROW",t[t.BENT_UP_ARROW=7]="BENT_UP_ARROW",t[t.BEVEL=8]="BEVEL",t[t.BLOCK_ARC=9]="BLOCK_ARC",t[t.BRACE_PAIR=10]="BRACE_PAIR",t[t.BRACKET_PAIR=11]="BRACKET_PAIR",t[t.CAN=12]="CAN",t[t.CHEVRON=13]="CHEVRON",t[t.CHORD=14]="CHORD",t[t.CLOUD=15]="CLOUD",t[t.CORNER=16]="CORNER",t[t.CUBE=17]="CUBE",t[t.CURVED_DOWN_ARROW=18]="CURVED_DOWN_ARROW",t[t.CURVED_LEFT_ARROW=19]="CURVED_LEFT_ARROW",t[t.CURVED_RIGHT_ARROW=20]="CURVED_RIGHT_ARROW",t[t.CURVED_UP_ARROW=21]="CURVED_UP_ARROW",t[t.DECAGON=22]="DECAGON",t[t.DIAGONAL_STRIPE=23]="DIAGONAL_STRIPE",t[t.DIAMOND=24]="DIAMOND",t[t.DODECAGON=25]="DODECAGON",t[t.DONUT=26]="DONUT",t[t.DOUBLE_WAVE=27]="DOUBLE_WAVE",t[t.DOWN_ARROW=28]="DOWN_ARROW",t[t.DOWN_ARROW_CALLOUT=29]="DOWN_ARROW_CALLOUT",t[t.FOLDED_CORNER=30]="FOLDED_CORNER",t[t.FRAME=31]="FRAME",t[t.HALF_FRAME=32]="HALF_FRAME",t[t.HEART=33]="HEART",t[t.HEPTAGON=34]="HEPTAGON",t[t.HEXAGON=35]="HEXAGON",t[t.HOME_PLATE=36]="HOME_PLATE",t[t.HORIZONTAL_SCROLL=37]="HORIZONTAL_SCROLL",t[t.IRREGULAR_SEAL_1=38]="IRREGULAR_SEAL_1",t[t.IRREGULAR_SEAL_2=39]="IRREGULAR_SEAL_2",t[t.LEFT_ARROW=40]="LEFT_ARROW",t[t.LEFT_ARROW_CALLOUT=41]="LEFT_ARROW_CALLOUT",t[t.LEFT_BRACE=42]="LEFT_BRACE",t[t.LEFT_BRACKET=43]="LEFT_BRACKET",t[t.LEFT_RIGHT_ARROW=44]="LEFT_RIGHT_ARROW",t[t.LEFT_RIGHT_ARROW_CALLOUT=45]="LEFT_RIGHT_ARROW_CALLOUT",t[t.LEFT_RIGHT_UP_ARROW=46]="LEFT_RIGHT_UP_ARROW",t[t.LEFT_UP_ARROW=47]="LEFT_UP_ARROW",t[t.LIGHTNING_BOLT=48]="LIGHTNING_BOLT",t[t.MATH_DIVIDE=49]="MATH_DIVIDE",t[t.MATH_EQUAL=50]="MATH_EQUAL",t[t.MATH_MINUS=51]="MATH_MINUS",t[t.MATH_MULTIPLY=52]="MATH_MULTIPLY",t[t.MATH_NOT_EQUAL=53]="MATH_NOT_EQUAL",t[t.MATH_PLUS=54]="MATH_PLUS",t[t.MOON=55]="MOON",t[t.NO_SMOKING=56]="NO_SMOKING",t[t.NOTCHED_RIGHT_ARROW=57]="NOTCHED_RIGHT_ARROW",t[t.OCTAGON=58]="OCTAGON",t[t.PARALLELOGRAM=59]="PARALLELOGRAM",t[t.PENTAGON=60]="PENTAGON",t[t.PIE=61]="PIE",t[t.PLAQUE=62]="PLAQUE",t[t.PLUS=63]="PLUS",t[t.QUAD_ARROW=64]="QUAD_ARROW",t[t.QUAD_ARROW_CALLOUT=65]="QUAD_ARROW_CALLOUT",t[t.RIBBON=66]="RIBBON",t[t.RIBBON_2=67]="RIBBON_2",t[t.RIGHT_ARROW=68]="RIGHT_ARROW",t[t.RIGHT_ARROW_CALLOUT=69]="RIGHT_ARROW_CALLOUT",t[t.RIGHT_BRACE=70]="RIGHT_BRACE",t[t.RIGHT_BRACKET=71]="RIGHT_BRACKET",t[t.ROUND_1_RECTANGLE=72]="ROUND_1_RECTANGLE",t[t.ROUND_2_DIAGONAL_RECTANGLE=73]="ROUND_2_DIAGONAL_RECTANGLE",t[t.ROUND_2_SAME_RECTANGLE=74]="ROUND_2_SAME_RECTANGLE",t[t.RIGHT_TRIANGLE=75]="RIGHT_TRIANGLE",t[t.SMILEY_FACE=76]="SMILEY_FACE",t[t.SNIP_1_RECTANGLE=77]="SNIP_1_RECTANGLE",t[t.SNIP_2_DIAGONAL_RECTANGLE=78]="SNIP_2_DIAGONAL_RECTANGLE",t[t.SNIP_2_SAME_RECTANGLE=79]="SNIP_2_SAME_RECTANGLE",t[t.SNIP_ROUND_RECTANGLE=80]="SNIP_ROUND_RECTANGLE",t[t.STAR_10=81]="STAR_10",t[t.STAR_12=82]="STAR_12",t[t.STAR_16=83]="STAR_16",t[t.STAR_24=84]="STAR_24",t[t.STAR_32=85]="STAR_32",t[t.STAR_4=86]="STAR_4",t[t.STAR_5=87]="STAR_5",t[t.STAR_6=88]="STAR_6",t[t.STAR_7=89]="STAR_7",t[t.STAR_8=90]="STAR_8",t[t.STRIPED_RIGHT_ARROW=91]="STRIPED_RIGHT_ARROW",t[t.SUN=92]="SUN",t[t.TRAPEZOID=93]="TRAPEZOID",t[t.TRIANGLE=94]="TRIANGLE",t[t.UP_ARROW=95]="UP_ARROW",t[t.UP_ARROW_CALLOUT=96]="UP_ARROW_CALLOUT",t[t.UP_DOWN_ARROW=97]="UP_DOWN_ARROW",t[t.UTURN_ARROW=98]="UTURN_ARROW",t[t.VERTICAL_SCROLL=99]="VERTICAL_SCROLL",t[t.WAVE=100]="WAVE",t[t.WEDGE_ELLIPSE_CALLOUT=101]="WEDGE_ELLIPSE_CALLOUT",t[t.WEDGE_RECTANGLE_CALLOUT=102]="WEDGE_RECTANGLE_CALLOUT",t[t.WEDGE_ROUND_RECTANGLE_CALLOUT=103]="WEDGE_ROUND_RECTANGLE_CALLOUT",t[t.FLOW_CHART_ALTERNATE_PROCESS=104]="FLOW_CHART_ALTERNATE_PROCESS",t[t.FLOW_CHART_COLLATE=105]="FLOW_CHART_COLLATE",t[t.FLOW_CHART_CONNECTOR=106]="FLOW_CHART_CONNECTOR",t[t.FLOW_CHART_DECISION=107]="FLOW_CHART_DECISION",t[t.FLOW_CHART_DELAY=108]="FLOW_CHART_DELAY",t[t.FLOW_CHART_DISPLAY=109]="FLOW_CHART_DISPLAY",t[t.FLOW_CHART_DOCUMENT=110]="FLOW_CHART_DOCUMENT",t[t.FLOW_CHART_EXTRACT=111]="FLOW_CHART_EXTRACT",t[t.FLOW_CHART_INPUT_OUTPUT=112]="FLOW_CHART_INPUT_OUTPUT",t[t.FLOW_CHART_INTERNAL_STORAGE=113]="FLOW_CHART_INTERNAL_STORAGE",t[t.FLOW_CHART_MAGNETIC_DISK=114]="FLOW_CHART_MAGNETIC_DISK",t[t.FLOW_CHART_MAGNETIC_DRUM=115]="FLOW_CHART_MAGNETIC_DRUM",t[t.FLOW_CHART_MAGNETIC_TAPE=116]="FLOW_CHART_MAGNETIC_TAPE",t[t.FLOW_CHART_MANUAL_INPUT=117]="FLOW_CHART_MANUAL_INPUT",t[t.FLOW_CHART_MANUAL_OPERATION=118]="FLOW_CHART_MANUAL_OPERATION",t[t.FLOW_CHART_MERGE=119]="FLOW_CHART_MERGE",t[t.FLOW_CHART_MULTIDOCUMENT=120]="FLOW_CHART_MULTIDOCUMENT",t[t.FLOW_CHART_OFFLINE_STORAGE=121]="FLOW_CHART_OFFLINE_STORAGE",t[t.FLOW_CHART_OFFPAGE_CONNECTOR=122]="FLOW_CHART_OFFPAGE_CONNECTOR",t[t.FLOW_CHART_ONLINE_STORAGE=123]="FLOW_CHART_ONLINE_STORAGE",t[t.FLOW_CHART_OR=124]="FLOW_CHART_OR",t[t.FLOW_CHART_PREDEFINED_PROCESS=125]="FLOW_CHART_PREDEFINED_PROCESS",t[t.FLOW_CHART_PREPARATION=126]="FLOW_CHART_PREPARATION",t[t.FLOW_CHART_PROCESS=127]="FLOW_CHART_PROCESS",t[t.FLOW_CHART_PUNCHED_CARD=128]="FLOW_CHART_PUNCHED_CARD",t[t.FLOW_CHART_PUNCHED_TAPE=129]="FLOW_CHART_PUNCHED_TAPE",t[t.FLOW_CHART_SORT=130]="FLOW_CHART_SORT",t[t.FLOW_CHART_SUMMING_JUNCTION=131]="FLOW_CHART_SUMMING_JUNCTION",t[t.FLOW_CHART_TERMINATOR=132]="FLOW_CHART_TERMINATOR",t[t.ARROW_EAST=133]="ARROW_EAST",t[t.ARROW_NORTH_EAST=134]="ARROW_NORTH_EAST",t[t.ARROW_NORTH=135]="ARROW_NORTH",t[t.SPEECH=136]="SPEECH",t[t.STARBURST=137]="STARBURST",t[t.TEARDROP=138]="TEARDROP",t[t.ELLIPSE_RIBBON=139]="ELLIPSE_RIBBON",t[t.ELLIPSE_RIBBON_2=140]="ELLIPSE_RIBBON_2",t[t.CLOUD_CALLOUT=141]="CLOUD_CALLOUT",t[t.CUSTOM=142]="CUSTOM",t))(mn||{}),se=(t=>(t[t.GRID=0]="GRID",t[t.KANBAN=1]="KANBAN",t[t.GANTT=2]="GANTT",t))(se||{}),Ot=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",t))(Ot||{}),On=(t=>(t[t.DASH=0]="DASH",t[t.DASH_DOT_DOT_HEAVY=1]="DASH_DOT_DOT_HEAVY",t[t.DASH_DOT_HEAVY=2]="DASH_DOT_HEAVY",t[t.DASHED_HEAVY=3]="DASHED_HEAVY",t[t.DASH_LONG=4]="DASH_LONG",t[t.DASH_LONG_HEAVY=5]="DASH_LONG_HEAVY",t[t.DOT_DASH=6]="DOT_DASH",t[t.DOT_DOT_DASH=7]="DOT_DOT_DASH",t[t.DOTTED=8]="DOTTED",t[t.DOTTED_HEAVY=9]="DOTTED_HEAVY",t[t.DOUBLE=10]="DOUBLE",t[t.NONE=11]="NONE",t[t.SINGLE=12]="SINGLE",t[t.THICK=13]="THICK",t[t.WAVE=14]="WAVE",t[t.WAVY_DOUBLE=15]="WAVY_DOUBLE",t[t.WAVY_HEAVY=16]="WAVY_HEAVY",t[t.WORDS=17]="WORDS",t))(On||{}),st=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LEFT=1]="LEFT",t[t.CENTER=2]="CENTER",t[t.RIGHT=3]="RIGHT",t[t.JUSTIFIED=4]="JUSTIFIED",t))(st||{}),ut=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TOP=1]="TOP",t[t.MIDDLE=2]="MIDDLE",t[t.BOTTOM=3]="BOTTOM",t))(ut||{}),ct=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OVERFLOW=1]="OVERFLOW",t[t.CLIP=2]="CLIP",t[t.WRAP=3]="WRAP",t))(ct||{}),Mt=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ITALIC=1]="ITALIC",t))(Mt||{}),Pt=(t=>(t[t.NORMAL=0]="NORMAL",t[t.BOLD=1]="BOLD",t))(Pt||{}),Ft=(t=>(t[t.NORMAL=1]="NORMAL",t[t.SUBSCRIPT=2]="SUBSCRIPT",t[t.SUPERSCRIPT=3]="SUPERSCRIPT",t))(Ft||{}),C=(t=>(t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE",t))(C||{}),At=(t=>(t[t.STRING=1]="STRING",t[t.NUMBER=2]="NUMBER",t[t.BOOLEAN=3]="BOOLEAN",t[t.FORCE_STRING=4]="FORCE_STRING",t))(At||{}),H=(t=>(t[t.DARK1=0]="DARK1",t[t.LIGHT1=1]="LIGHT1",t[t.DARK2=2]="DARK2",t[t.LIGHT2=3]="LIGHT2",t[t.ACCENT1=4]="ACCENT1",t[t.ACCENT2=5]="ACCENT2",t[t.ACCENT3=6]="ACCENT3",t[t.ACCENT4=7]="ACCENT4",t[t.ACCENT5=8]="ACCENT5",t[t.ACCENT6=9]="ACCENT6",t[t.HYPERLINK=10]="HYPERLINK",t[t.FOLLOWED_HYPERLINK=11]="FOLLOWED_HYPERLINK",t))(H||{}),Ht=(t=>(t.OFFICE="Office",t.OFFICE_2007_2010="Office 2007-2010",t.GRAYSCALE="Grayscale",t.BLUE_WARM="Blue Warm",t.BLUE="Blue",t.BLUE_II="Blue II",t.BLUE_GREEN="Blue Green",t.GREEN="Green",t.GREEN_YELLOW="Green Yellow",t.YELLOW="Yellow",t.YELLOW_ORANGE="Yellow Orange",t.ORANGE="Orange",t.ORANGE_RED="Orange Red",t.RED_ORANGE="Red Orange",t.RED="Red",t.RED_VIOLET="Red Violet",t.VIOLET="Violet",t.VIOLET_II="Violet II",t.MEDIAN="Median",t.PAPER="Paper",t.MARQUEE="Marquee",t.SLIPSTREAM="Slipstream",t.Aspect="Aspect",t))(Ht||{});const An={[Ht.OFFICE]:{[H.ACCENT1]:"#4472C4",[H.ACCENT2]:"#ED7D31",[H.ACCENT3]:"#A5A5A5",[H.ACCENT4]:"#70AD47",[H.ACCENT5]:"#5B9BD5",[H.ACCENT6]:"#70AD47",[H.DARK1]:"#000000",[H.DARK2]:"#44546A",[H.LIGHT1]:"#FFFFFF",[H.LIGHT2]:"#E7E6E6",[H.HYPERLINK]:"#0563C1",[H.FOLLOWED_HYPERLINK]:"#954F72"}};class Bt{constructor(){d(this,"_themeValue",H.LIGHT1);d(this,"_themeColors");d(this,"_themeTint");d(this,"_rgbValue","");d(this,"_colorType");this._colorType=$.UNSUPPORTED,this._themeColors=Ht.OFFICE,this._themeTint=0}asRgbColor(){return new Wt(this._rgbValue,this)}asThemeColor(){return new Gt(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case $.THEME:return this.asThemeColor();case $.RGB:return this.asRgbColor();case $.UNSUPPORTED:throw Error("unsupported color type")}}setRgbColor(e){return this._colorType=$.RGB,this._rgbValue=e,this}setThemeColors(e){this._colorType=$.THEME,this._themeColors=e}setThemeTint(e){this._colorType=$.THEME,this._themeTint=e}setThemeColor(e){return this._colorType=$.THEME,this._themeValue=e,this}getColorType(){return this._colorType}}class rt{constructor(e){d(this,"_builder");this._builder=e}static rgbColorToHexValue(e){return`#${((1<<24)+(e.getRed()<<16)+(e.getGreen()<<8)+e.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(e){e?e.indexOf("#")>-1&&(e=e.substring(1)):e="#000000";const n=+`0x${e[0]}${e[1]}`,s=+`0x${e[2]}${e[3]}`,r=+`0x${e[4]}${e[5]}`;return new Bt().setRgbColor(`rgb(${n},${s},${r})`).asRgbColor()}static hexToRgbString(e){const n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(n,(i,o,a,h)=>o+o+a+a+h+h);const s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let r=null;if(s){const i=parseInt(s[1],16),o=parseInt(s[2],16),a=parseInt(s[3],16);r=`rgba(${i},${o},${a})`}return r}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new rt(this._builder)}equals(e){return!1}}class In{constructor(e){d(this,"_saturation",0);d(this,"_hue",0);d(this,"_lightness",0);d(this,"_alpha",0);const n=e.getRed()/255,s=e.getGreen()/255,r=e.getBlue()/255,i=e.getAlpha()/255,o=Math.min(n,Math.min(s,r)),a=Math.max(n,Math.max(s,r)),h=a-o;if(a===o){this._hue=0,this._saturation=0,this._lightness=a;return}this._lightness=(o+a)/2,this._lightness<.5?this._saturation=h/(a+o):this._saturation=h/(2-a-o),n===a&&(this._hue=(s-r)/h),s===a&&(this._hue=2+(r-n)/h),r===a&&(this._hue=4+(n-s)/h),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const e=new Bt;if(this._saturation===0)return e.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),e.asRgbColor();let n;this._lightness<.5?n=this._lightness*(1+this._saturation):n=this._lightness+this._saturation-this._lightness*this._saturation;const s=2*this._lightness-n,r=this._hue/360,i=r+1/3,o=this.setColor(n,s,i),a=this.setColor(n,s,r),h=r-1/3,l=this.setColor(n,s,h);return e.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(l*255)},${this._alpha*255})`),e.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(e,n,s){s<0&&(s+=1),s>1&&(s-=1);let r;return 6*s<1?r=n+(e-n)*6*s:2*s<1?r=e:3*s<2?r=n+(e-n)*(2/3-s)*6:r=n,r}setLightness(e){this._lightness=e}}const k=class k extends rt{constructor(n,s){super(s);d(this,"_cssString");d(this,"_red");d(this,"_green");d(this,"_blue");d(this,"_alpha");let r=n.match(k.RGBA_EXTRACT);if(r){const i=+r[1],o=+r[2],a=+r[3],h=+r[4];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=h;return}if(r=n.match(k.RGB_EXTRACT),r){const i=+r[1],o=+r[2],a=+r[3];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return rt.rgbColorToHexValue(this)}getRed(){let n=this._red+k.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+k.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+k.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return $.RGB}clone(){return new k(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof k?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};d(k,"RGB_COLOR_AMT",0),d(k,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),d(k,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let Wt=k;const tt=class tt extends rt{constructor(n,s,r,i){super(i);d(this,"_themeColorType");d(this,"_themeTint");d(this,"_themeColors");this._themeColorType=n,this._themeTint=s,this._themeColors=r}lumValue(n,s){if(n==null)return s;let r;return n<0?r=s*(1+n):r=s*(1-n)+(255-255*(1-n)),r}asRgbColor(){const n=An[this._themeColors];if(n==null)throw new Error("not find themeColors type");const s=n[this._themeColorType];if(s==null)throw new Error("not find themeColors value");let r;if(tt._cacheThemeColor.has(this._themeColors)){if(r=tt._cacheThemeColor.get(this._themeColors),r.has(this._themeColorType))return r.get(this._themeColorType)}else r=new Map,tt._cacheThemeColor.set(this._themeColors,r);const i=new In(rt.hexValueToRgbColor(s));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return r.set(this._themeColorType,o),o}clone(){return new tt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof tt?n._themeColorType===this._themeColorType:!1}getColorType(){return $.THEME}getThemeColorType(){return this._themeColorType}};d(tt,"_cacheThemeColor",new Map);let Gt=tt;const Sr="rgb(",Nr="rgba(",re={aliceBlue:[240,248,255],antiqueWhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blancheAlmond:[255,235,205],blue:[0,0,255],blueViolet:[138,43,226],brown:[165,42,42],burlyWood:[222,184,135],cadetBlue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornFlowerBlue:[100,149,237],cornSilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkCyan:[0,139,139],darkGoldenrod:[184,132,11],darkGray:[169,169,169],darkGreen:[0,100,0],darkGrey:[169,169,169],darkKhaki:[189,183,107],darkMagenta:[139,0,139],darkOliveGreen:[85,107,47],darkOrange:[255,140,0],darkOrchid:[153,50,204],darkRed:[139,0,0],darkSalmon:[233,150,122],darkSeaGreen:[143,188,143],darkSlateBlue:[72,61,139],darkSlateGray:[47,79,79],darkSlateGrey:[47,79,79],darkTurquoise:[0,206,209],darkViolet:[148,0,211],deepPink:[255,20,147],deepSkyBlue:[0,191,255],dimGray:[105,105,105],dimGrey:[105,105,105],dodgerBlue:[30,144,255],firebrick:[178,34,34],floralWhite:[255,255,240],forestGreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostWhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenYellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotPink:[255,105,180],indianRed:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderBlush:[255,240,245],lawnGreen:[124,252,0],lemonChiffon:[255,250,205],lightblue:[173,216,230],lightCoral:[240,128,128],lightCyan:[224,255,255],lightGoldenrodYellow:[250,250,210],lightGray:[211,211,211],lightGreen:[144,238,144],lightGrey:[211,211,211],lightPink:[255,182,193],lightSalmon:[255,160,122],lightSeaGreen:[32,178,170],lightSkyBlue:[135,206,250],lightSlateGray:[119,136,153],lightSlateGrey:[119,136,153],lightSteelBlue:[176,196,222],lightYellow:[255,255,224],lime:[0,255,0],limeGreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumAquamarine:[102,205,170],mediumBlue:[0,0,205],mediumOrchid:[186,85,211],mediumPurple:[147,112,219],mediumSeaGreen:[60,179,113],mediumSlateBlue:[123,104,238],mediumSpringGreen:[0,250,154],mediumTurquoise:[72,209,204],mediumVioletRed:[199,21,133],midBightBlue:[25,25,112],mintCream:[245,255,250],mistyRose:[255,228,225],moccasin:[255,228,181],navajoWhite:[255,222,173],navy:[0,0,128],oldLace:[253,245,230],olive:[128,128,0],oliveDrab:[107,142,35],orange:[255,165,0],orangeRed:[255,69,0],orchid:[218,112,214],paleGoldenrod:[238,232,170],paleGreen:[152,251,152],paleTurquoise:[175,238,238],paleVioletRed:[219,112,147],papayaWhip:[255,239,213],peachPuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderBlue:[176,224,230],purple:[128,0,128],rebeccaPurple:[102,51,153],red:[255,0,0],rosyBrown:[188,143,143],royalBlue:[65,105,225],saddleBrown:[139,69,19],salmon:[250,128,114],sandyBrown:[244,164,96],seaGreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyBlue:[135,206,235],slateBlue:[106,90,205],slateGray:[119,128,144],slateGrey:[119,128,144],snow:[255,255,250],springGreen:[0,255,127],steelBlue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whiteSmoke:[245,245,245],yellow:[255,255,0],yellowGreen:[154,205,5]};class x{constructor(e){d(this,"_color");d(this,"_rgbColor");d(this,"_isValid",!1);if(e==null){this._setNullColor();return}if(e instanceof x){this._color={...e._color},this._rgbColor={...e._rgbColor};return}const n=Cn(e);if(n==null){this._setNullColor();return}this._color=n;const s=Dr(this._color);if(s==null){this._setNullColor();return}this._rgbColor=s,this._isValid=!0}static mix(e,n,s){s=Math.min(1,Math.max(0,s));const r=new x(e).toRgb(),i=new x(n).toRgb(),o=r.a??1,a=i.a??1,h={r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(a-o)*s+o};return new x(h)}static getContrastRatio(e,n){const s=new x(e).getLuminance(),r=new x(n).getLuminance();return(Math.max(s,r)+.05)/(Math.min(s,r)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:e,g:n,b:s,a:r=1}=this.toRgb(),i=r<1;return`rgb${i?"a":""}(${e},${n},${s}${i?`,${r}`:""})`}toString(){return this.toRgbString()}toHexString(e){const{r:n,g:s,b:r,a:i=1}=this.toRgb(),o=i<1,a=[$t(Math.round(n).toString(16)),$t(Math.round(s).toString(16)),$t(Math.round(r).toString(16)),$t(Math.round(i*255).toString(16))];return e&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return Pr(this.toRgb())}toHsl(){return Mr(this.toRgb())}lighten(e=10){const n=this.toHsl();return n.l+=e,n.l=Math.min(Math.max(n.l,0),100),new x(n)}darken(e=10){const n=this.toHsl();return n.l-=e,n.l=Math.min(Math.max(n.l,0),100),new x(n)}setAlpha(e){return new x({...this._rgbColor,a:e})}getLuminance(){let{r:e,g:n,b:s}=this.toRgb();return e=ie(e),n=ie(n),s=ie(s),Number((.2126*e+.7152*n+.0722*s).toFixed(3))}getBrightness(){const{r:e,g:n,b:s}=this.toRgb();return(e*299+n*587+s*114)/1e3}getAlpha(){return this._color.a??1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const $t=t=>t.length===1?`0${t}`:t,ie=t=>(t/=255,t<=.03928?t/12.92:((t+.055)/1.055)**2.4),Cn=t=>{if(Hr(t)){if("r"in t){const s={r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)};return t.a!==void 0&&(s.a=t.a),s}if("l"in t){const s={h:Math.round(t.h),s:t.s,l:t.l};return t.a!==void 0&&(s.a=t.a),s}const n={h:Math.round(t.h),s:t.s,v:t.v};return t.a!==void 0&&(n.a=t.a),n}const e=t.trim();if(re[e]){const n=re[e],s={r:Math.round(n[0]),g:Math.round(n[1]),b:Math.round(n[2])};return s.a=n[3]||1,s}if(e.startsWith("#"))return br(e);if(e.startsWith("rgb"))return Lr(e);if(e.startsWith("hsl"))return wr(e);if(e.startsWith("hsv"))return vr(e)},br=t=>{const e=t.substring(1),n=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let s=e.match(n);if(!s||s.length<3)throw new Error(`The color '${t}' is illegal hex color`);s[0].length===1&&(s=s.map(i=>i+i));const r={r:parseInt(s[0],16),g:parseInt(s[1],16),b:parseInt(s[2],16)};return s.length>3&&(r.a=parseInt(s[3],16)/255),r},Lr=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal rgb color`);const n=t.substring(e+1,t.length-1).split(",");if(n.length<3)throw new Error(`The color '${t}' is illegal rgb color`);const s={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)};return n.length>3&&(s.a=parseFloat(n[3])),s},wr=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal hsl color`);const n=t.substring(e+1,t.length-1).split(",");if(n.length<3)throw new Error(`The color '${t}' is illegal hsl color`);const s={h:parseInt(n[0],10),s:parseFloat(n[1]),l:parseFloat(n[2])};return n.length>3&&(s.a=parseFloat(n[3])),s},vr=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal hsv color`);const n=t.substring(e+1,t.length-1).split(",");if(n.length<3)throw new Error(`The color '${t}' is illegal hsv color`);const s={h:parseInt(n[0],10),s:parseFloat(n[1]),v:parseFloat(n[2])};return n.length>3&&(s.a=parseFloat(n[3])),s},Dr=t=>{const e=Cn(t);if(e!=null)return"r"in e?e:"l"in e?Tr(e):Ur(e)},oe=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t),Tr=t=>{let{h:e,s:n,l:s}=t;e/=360,n/=100,s/=100;let r=0,i=0,o=0;if(n===0)r=i=o=s;else{const h=s<.5?s*(1+n):s+n-s*n,l=2*s-h;r=oe(l,h,e+1/3),i=oe(l,h,e),o=oe(l,h,e-1/3)}const a={r:Math.round(r*255),g:Math.round(i*255),b:Math.round(o*255)};return t.a!==void 0&&(a.a=t.a),a},Ur=t=>{let{h:e,s:n,v:s}=t;e=e/360*6,n/=100,s/=100;const r=Math.floor(e),i=e-r,o=s*(1-n),a=s*(1-i*n),h=s*(1-(1-i)*n),l=r%6,u=[s,a,o,o,h,s][l],_=[h,s,s,a,o,o][l],g=[o,o,h,s,s,a][l],f={r:u*255,g:_*255,b:g*255};return t.a!==void 0&&(f.a=t.a),f},Mr=t=>{let{r:e,g:n,b:s}=t;e/=255,n/=255,s/=255;const r=Math.max(e,n,s),i=Math.min(e,n,s),o=(r+i)/2;let a,h;if(r===i)a=h=0;else{const u=r-i;switch(h=o>.5?u/(2-r-i):u/(r+i),r){case e:a=(n-s)/u+(n<s?6:0);break;case n:a=(s-e)/u+2;break;default:a=(e-n)/u+4;break}a/=6}const l={h:Math.round(a*360),s:Math.round(h*100),l:Math.round(o*100)};return t.a!==void 0&&(l.a=t.a),l},Pr=t=>{let{r:e,g:n,b:s}=t;e/=255,n/=255,s/=255;const r=Math.max(e,n,s),i=Math.min(e,n,s);let o;const a=r,h=r-i,l=r===0?0:h/r;if(r===i)o=0;else{switch(r){case e:o=(n-s)/h+(n<s?6:0);break;case n:o=(s-e)/h+2;break;default:o=(e-n)/h+4;break}o/=6}const u={h:Math.round(o*360),s:Math.round(l*100),v:Math.round(a*100)};return t.a!==void 0&&(u.a=t.a),u},Fr=t=>t==null,Hr=t=>!Fr(t)&&typeof t=="object";var F=(t=>(t[t.COVER=0]="COVER",t[t.REPLACE=1]="REPLACE",t[t.INTERSECTION=2]="INTERSECTION",t))(F||{});let Br=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");const Wr=/^-ms-/,Gr=/-([a-z])/g,Z=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];class A{static stringAt(e){let n="",s=e;for(;s>=Z.length;)s/=Z.length,s-=1,n+=Z[s%Z.length];const r=e%Z.length;return n+=Z[r],n}static indexAt(e){let n=0;for(let s=0;s<e.length-1;s+=1){const r=e.charCodeAt(s)-65,i=e.length-1-s;n+=Z.length**i+Z.length*r}return n+=e.charCodeAt(e.length-1)-65,n}static deleteBlank(e){return A.isString(e)?e.replace(/\s/g,""):e}static getSystemType(){const e=navigator.userAgent,n=navigator.platform==="Win32"||navigator.platform==="Windows",s=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(s)return"Mac";if(navigator.platform==="X11"&&!n&&!s)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(n){if(e.indexOf("Windows NT 5.0")>-1||e.indexOf("Windows 2000")>-1)return"Windows 2000";if(e.indexOf("Windows NT 5.1")>-1||e.indexOf("Windows XP")>-1)return"Windows XP";if(e.indexOf("Windows NT 5.2")>-1||e.indexOf("Windows 2003")>-1)return"Windows 2003";if(e.indexOf("Windows NT 6.0")>-1||e.indexOf("Windows Vista")>-1)return"Windows Vista";if(e.indexOf("Windows NT 6.1")>-1||e.indexOf("Windows 7")>-1)return"Windows 7";if(e.indexOf("Windows NT 10")>-1||e.indexOf("Windows 10")>-1)return"Windows 10";if(e.indexOf("Windows NT 11")>-1||e.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const e=navigator.userAgent,n=e.indexOf("Opera")>-1,s=e.indexOf("compatible")>-1&&e.indexOf("MSIE")>-1&&!n,r=e.indexOf("Trident")>-1&&e.indexOf("rv:11.0")>-1,i=e.indexOf("Edge")>-1,o=e.indexOf("Firefox")>-1,a=e.indexOf("Safari")>-1&&e.indexOf("Chrome")===-1,h=e.indexOf("Chrome")>-1&&e.indexOf("Safari")>-1;if(s){new RegExp("MSIE (\\d+\\.\\d+);").test(e);const u=parseFloat(RegExp.$1);return u===7?"IE7":u===8?"IE8":u===9?"IE9":u===10?"IE10":"0"}return o?"FF":n?"Opera":a?"Safari":h?"Chrome":i?"Edge":r?"IE11":"Unknown browser"}static generateRandomId(e=21){return Br(e)}static getClassName(e){return e.constructor.name}static deepMerge(e,...n){n.forEach(o=>o&&i(o));function s(o,a){o.forEach((h,l)=>{if(A.isArray(h)){const u=a[l]??[];a[l]=u,s(h,u);return}if(A.isObject(h)){const u=a[l]??{};a[l]=u,r(h,u);return}a[l]=h})}function r(o,a){Object.keys(o).forEach(h=>{const l=o[h];if(A.isObject(l)){const u=a[h]??{};a[h]=u,r(l,u);return}if(A.isArray(l)){const u=a[h]??[];a[h]=u,s(l,u);return}a[h]=l})}function i(o){Object.keys(o).forEach(a=>{const h=o[a];if(A.isArray(h)){const l=e[a]??[];e[a]=l,s(h,l);return}if(A.isObject(h)){const l=e[a]??{};e[a]=l,r(h,l);return}e[a]=h})}return e}static numberFixed(e,n){return Number(Number(e).toFixed(n))}static diffValue(e,n){function s(o,a){const h=A.getValueType(o),l=A.getValueType(a);return h!==l?!1:A.isArray(o)?r(o,a):A.isObject(o)?i(o,a):A.isDate(o)?o.getTime()===a.getTime():A.isRegExp(o)?o.toString()===a.toString():o===a}function r(o,a){if(e.length!==n.length)return!1;for(let h=0,l=o.length;h<l;h++){const u=o[h],_=a[h];if(!s(u,_))return!1}return!0}function i(o,a){const h=Object.keys(o),l=Object.keys(a);if(h.length!==l.length)return!1;for(const u of h){if(!l.includes(u))return!1;const _=o[u],g=a[u];if(!s(_,g))return!1}return!0}return s(e,n)}static deepClone(e){if(!this.isDefine(e))return e;if(this.isRegExp(e))return new RegExp(e);if(this.isDate(e))return new Date(e);if(this.isArray(e)){const n=[];return e.forEach((s,r)=>{n[r]=A.deepClone(s)}),n}if(this.isObject(e)){const n={};return Object.keys(e).forEach(s=>{const r=e[s];n[s]=A.deepClone(r)}),Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}return e}static getLanguage(){const e="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||e}static getValueType(e){return Object.prototype.toString.apply(e)}static isDefine(e){return e!=null}static isBlank(e){return this.isDefine(e)?this.isString(e)?e.trim()==="":!1:!0}static isAssignableFrom(e,n){return e instanceof n}static isBoolean(e){return this.getValueType(e)==="[object Boolean]"}static isPlainObject(e){return this.isDefine(e)?Object.getPrototypeOf(e)===Object.getPrototypeOf({}):!1}static isFunction(e){return this.getValueType(e)==="[object Function]"}static isDate(e){return this.getValueType(e)==="[object Date]"}static isRegExp(e){return this.getValueType(e)==="[object RegExp]"}static isArray(e){return this.getValueType(e)==="[object Array]"}static isString(e){return this.getValueType(e)==="[object String]"}static isNumber(e){return this.getValueType(e)==="[object Number]"}static isStringNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}static isObject(e){return this.getValueType(e)==="[object Object]"}static isEmptyObject(e){for(const n in e)return!1;return!0}static isMobile(){let e=0,n=0;return document.body.clientWidth&&(e=document.body.clientWidth),document.body.clientHeight&&(n=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||e<350&&n<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const e=navigator.userAgent.toLowerCase();return String(e.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const e=navigator.userAgent;return e.indexOf("Android")>-1||e.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static itCount(e){return n=>{for(let s=0;s<e;s++)n&&n()}}static hasLength(e,n){return A.isDefine(e)?A.isDefine(n)?e.length===n:e.length>0:!1}static capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}static fCamelCase(e,n){return n.toUpperCase()}static camelCase(e){return e.replace(Wr,"ms-").replace(Gr,this.fCamelCase)}static removeNull(e){return this.isObject(e)&&Object.keys(e).forEach(n=>{const s=e[n];s==null?delete e[n]:A.removeNull(s)}),e}static fillTwoDimensionalArray(e,n,s){return new Array(e).fill(s).map(r=>new Array(n).fill(s))}static numToWord(e){let n="";for(;e>0;){let s=e%26;s=s===0?s=26:s,n=String.fromCharCode(96+s)+n,e=(e-s)/26}return n.toLocaleUpperCase()}static ABCatNum(e){if(e==null||e.length===0)return NaN;const n=e.toLowerCase().split(""),s=n.length;let r=0,i=0;for(let o=0;o<s;o++)i=n[o].charCodeAt(0)-96,r+=i*26**(s-o-1);return r===0?NaN:r-1}static chatAtABC(e){let i="";for(;e>=0;)i=String.fromCharCode(e%26+97)+i,e=Math.floor(e/26)-1;return i.toUpperCase()}static randSort(e){for(let n=0,s=e.length;n<s;n++){const r=parseInt((Math.random()*s).toString()),i=e[r];e[r]=e[n],e[n]=i}return e}static commonExtend(e,n){const s={};for(const r in e)s[r]=e[r];for(const r in n)n[r]!=null&&(s[r]=n[r]);return s}static commonExtend1(e,n){for(const s in e)n[s]==null&&(n[s]=e[s]);return n}static arrayToObject(e){const n={};return e.forEach((s,r)=>{n[r]={},s.forEach((i,o)=>{n[r][o]=i})}),n}static hasIntersectionBetweenTwoRanges(e,n,s,r){return n>=s&&r>=e}}function $r(t){if(!t)return;const{actualRow:e,actualColumn:n,isMerged:s,isMergedMainCell:r,mergeInfo:i}=t;let{startY:o,endY:a,startX:h,endX:l}=t,u=e,_=n,g=e,f=n;if(s&&i){const{startRow:E,startColumn:R,endRow:m,endColumn:I,startY:S,endY:v,startX:W,endX:B}=i;u=E,_=R,g=m,f=I,o=S,a=v,h=W,l=B}return r&&(o=i.startY,a=i.endY,h=i.startX,l=i.endX,g=i.endRow,f=i.endColumn),{startRow:u,startColumn:_,endRow:g,endColumn:f,startY:o,endY:a,startX:h,endX:l}}function kr(t){if(!t)return;const{actualRow:e,actualColumn:n,isMerged:s,isMergedMainCell:r,startRow:i,startColumn:o,endRow:a,endColumn:h}=t;let l=e,u=n,_=e,g=n;return(s||r)&&(l=i,u=o,_=a,g=h),{startRow:l,startColumn:u,endRow:_,endColumn:g}}function xr(t){var n;return!t||(((n=t==null?void 0:t.v)==null?void 0:n.toString())||"").length===0&&!t.p}function p(t){if(t){if(t.rgb)return t.rgb;if(t.th)return new Bt().setThemeColor(t.th).asThemeColor().asRgbColor().getCssString()}return null}function Vr(t){return A.isString(t)&&t.substring(0,1)==="="&&t.length>1}function pr(t){return A.isString(t)&&t.indexOf("=")===-1&&t.length===6}function jr(t){return""}function zr(t,e=!1){var i;let n="";const s=new Map([["ff",()=>{t.ff&&(n+=`font-family: ${t.ff}; `)}],["fs",()=>{if(t.fs){let o=t.fs;t.va&&(o/=2),n+=`font-size: ${o}pt; `}}],["it",()=>{t.it&&(n+="font-style: italic; ")}],["bl",()=>{t.bl&&(n+="font-weight: bold; ")}],["ul",()=>{var o;(o=t.ul)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," underline"):n+="text-decoration-line: underline; ",t.ul.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${p(t.ul.cl)}; `),t.ul.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${t.ul.t} `))}],["st",()=>{var o;(o=t.st)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," line-through"):n+="text-decoration-line: line-through; ",t.st.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${p(t.st.cl)}; `),t.st.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${t.st.t} `))}],["ol",()=>{var o;(o=t.ol)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," overline"):n+="text-decoration-line: overline; ",t.ol.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${p(t.ol.cl)}; `),t.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${t.ol.t} `))}],["bg",()=>{t.bg&&(n+=`background: ${p(t.bg)}; `)}],["bd",()=>{var o,a,h,l,u,_,g,f;(o=t.bd)!=null&&o.b&&(n+=`border-bottom: ${kt((a=t.bd)==null?void 0:a.b.s)} ${p(t.bd.b.cl)??""}; `),(h=t.bd)!=null&&h.t&&(n+=`border-top: ${kt((l=t.bd)==null?void 0:l.t.s)} ${p(t.bd.t.cl)??""}; `),(u=t.bd)!=null&&u.r&&(n+=`border-right: ${kt((_=t.bd)==null?void 0:_.r.s)} ${p(t.bd.r.cl)??""}; `),(g=t.bd)!=null&&g.l&&(n+=`border-left: ${kt((f=t.bd)==null?void 0:f.l.s)} ${p(t.bd.l.cl)??""}; `)}],["cl",()=>{t.cl&&(n+=`color: ${p(t.cl)}; `)}],["va",()=>{t.va===Ft.SUBSCRIPT?n+="vertical-align: sub; ":t.va===Ft.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{t.td===Ot.LEFT_TO_RIGHT?n+="direction: ltr; ":t.td===Ot.RIGHT_TO_LEFT&&(n+="direction: rtl; ")}],["tr",()=>{var o,a,h;t.tr&&(n+=`data-rotate: (${(o=t.tr)==null?void 0:o.a}deg${(a=t.tr)!=null&&a.v?` ,${(h=t.tr)==null?void 0:h.v}`:""});`)}],["ht",()=>{t.ht===st.LEFT?n+="text-align: left; ":t.ht===st.RIGHT?n+="text-align: right; ":t.ht===st.CENTER?n+="text-align: center; ":t.ht===st.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{t.vt===ut.BOTTOM?n+="vertical-align: bottom; ":t.vt===ut.TOP?n+="vertical-align: top; ":t.vt===ut.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{t.tb===ct.CLIP?n+="text-overflow: clip; ":t.tb===ct.OVERFLOW?n+="text-break: overflow; ":t.tb===ct.WRAP&&(n+="word-wrap: break-word;")}],["pd",()=>{var u,_,g,f,E,R,m,I;const o=`${(u=t.pd)==null?void 0:u.b}pt`,a=`${(_=t.pd)==null?void 0:_.t}pt`,h=`${(g=t.pd)==null?void 0:g.l}pt`,l=`${(f=t.pd)==null?void 0:f.r}pt`;(E=t.pd)!=null&&E.b&&(n+=`padding-bottom: ${o}; `),(R=t.pd)!=null&&R.t&&(n+=`padding-top: ${a}; `),(m=t.pd)!=null&&m.l&&(n+=`padding-left: ${h}; `),(I=t.pd)!=null&&I.r&&(n+=`padding-right: ${l}; `)}]]),r=["bd","tr","tb"];for(const o in t)e&&r.includes(o)||(i=s.get(o))==null||i();return n}function kt(t){let e="";return t===L.NONE?e="none":t===L.THIN?e="0.5pt solid":t===L.HAIR?e="0.5pt double":t===L.DOTTED?e="0.5pt dotted":t===L.DASHED||t===L.DASH_DOT?e="0.5pt dashed":t===L.DASH_DOT_DOT?e="0.5pt dotted":t===L.DOUBLE?e="0.5pt double":t===L.MEDIUM?e="1pt solid":t===L.MEDIUM_DASHED||t===L.MEDIUM_DASH_DOT?e="1pt dashed":t===L.MEDIUM_DASH_DOT_DOT?e="1pt dotted":t===L.SLANT_DASH_DOT?e="0.5pt dashed":t===L.THICK&&(e="1.5pt solid"),e}function Yr(t){let e=0;if(t=t.trim(),t==="none")e=L.NONE;else if(t==="0.5pt solid")e=L.THIN;else if(t==="0.5pt double")e=L.HAIR;else if(t==="0.5pt dotted")e=L.DOTTED;else if(t==="0.5pt dashed")e=L.DASHED;else if(t==="1pt solid")e=L.MEDIUM;else if(t==="1pt dashed")e=L.MEDIUM_DASHED;else if(t==="1pt dotted")e=L.MEDIUM_DASH_DOT_DOT;else if(t==="1.5pt solid")e=L.THICK;else return L.NONE;return e}function xt(t,e){let n=t.body;if(e){const{headers:s,footers:r}=t;s!=null&&s[e]?n=s[e].body:r!=null&&r[e]&&(n=r[e].body)}return n}function Kr(t){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=t;return!(e<0||s<0||n<0||r<0)}function ae(t,e){return Object.prototype.toString.call(t)===Object.prototype.toString.call(e)?Object.prototype.toString.call(t)==="[object Object]"||Object.prototype.toString.call(t)==="[object Array]"?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>ae(t[n],e[n])):t===e:!1}function Sn(t,e){const n=t.ts||{},s=e.ts||{};return t.sId!==e.sId?!1:ae(n,s)}function le(t,e,n,s){if(t>e&&([t,e]=[e,t]),n>s&&([n,s]=[s,n]),e<n||s<t)return[t,e];n<t&&(n=t),s>e&&(s=e);const r=s-n+1;let i=[];return t===n?i=[s+1-r,e-r]:e===s?i=[t,n-1]:i=[t,e-r],i}function Xr(t){if(t==null)return!1;const e=t.bullet;return(e==null?void 0:e.listId)!=null}function Qr(t){if(t==null)return!1;const e=t.paragraphStyle;return Nn(e)}function Nn(t){return!(t==null||(t.indentStart==null||t.indentStart===0)&&t.hanging==null||t.hanging===0)}function bn(t,e,n){return t.slice(0,e)+n+t.slice(e)}function Ln(t,e,n){return e>n?t:t.slice(0,e)+t.slice(n)}class wn{constructor(){d(this,"_include");d(this,"_count");this._include=[],this._count=1}checked(e){return this._include.includes(e)}onlyName(e){let n=e,s=1;for(;this.checked(n);)n=e+s,s++;return this._include.push(n),n}sheetName(e="sheet1"){let n=e;for(;this.checked(n);)n=`sheet${this._count}`,this._count++;return this._include.push(n),n}}var Zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vn={exports:{}};/*! @preserve
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function Ve(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var pe=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,s,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Ge(o),h=a.next();!h.done;h=a.next()){var l=h.value;l.remove(this)}}catch(R){e={error:R}}finally{try{h&&!h.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(Rt(u))try{u()}catch(R){i=R instanceof ne?R.errors:[R]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var g=Ge(d),f=g.next();!f.done;f=g.next()){var E=f.value;try{je(E)}catch(R){i=i??[],R instanceof ne?i=xe(xe([],ke(i)),ke(R.errors)):i.push(R)}}}catch(R){s={error:R}}finally{try{f&&!f.done&&(r=g.return)&&r.call(g)}finally{if(s)throw s.error}}}if(i)throw new ne(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)je(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&Ve(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Ve(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}();pe.EMPTY;function ar(t){return t instanceof pe||t&&"closed"in t&&Rt(t.remove)&&Rt(t.add)&&Rt(t.unsubscribe)}function je(t){Rt(t)?t():t.unsubscribe()}class ze{constructor(e=!1){_(this,"skipNextObservers");_(this,"lastReturnValue");_(this,"isStopPropagation",!1);this.initialize(e)}initialize(e=!1){return this.skipNextObservers=e,this}stopPropagation(){this.isStopPropagation=!0}}function Ye(t){return t instanceof vt}class vt{constructor(e,n){_(this,"_willBeUnregistered",!1);_(this,"unregisterOnNextCall",!1);this.callback=e,this.observable=n}dispose(){this.observable.remove(this)}}class Dt{constructor(e){_(this,"_observers",new Array);_(this,"_eventState");_(this,"_onObserverAdded");this._eventState=new ze,e&&(this._onObserverAdded=e)}get observers(){return this._observers}add(e,n=!1,s=!1){if(!e)return null;const r=new vt(e,this);return r.unregisterOnNextCall=s,n?this._observers.unshift(r):this._observers.push(r),this._onObserverAdded&&this._onObserverAdded(r),r}addOnce(e){return this.add(e,void 0,!0)}remove(e){return e&&this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1}removeCallback(e){for(let n=0;n<this._observers.length;n++){const s=this._observers[n];if(!s._willBeUnregistered&&s.callback===e)return this._deferUnregister(s),!0}return!1}makeObserverTopPriority(e){this._remove(e),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e),this._observers.push(e)}notifyObservers(e){if(!this._observers.length)return null;const n=this._eventState;n.skipNextObservers=!1,n.lastReturnValue=e,n.isStopPropagation=!1;let s=!1;for(let r=0;r<this._observers.length;r++){const i=this._observers[r];if(!i._willBeUnregistered&&(n.lastReturnValue=i.callback(e,n),i.unregisterOnNextCall&&this._deferUnregister(i),n.isStopPropagation&&(s=!0),n.skipNextObservers))return{lastReturnValue:n.lastReturnValue,stopPropagation:s}}return{lastReturnValue:n.lastReturnValue,stopPropagation:s}}notifyObserversWithPromise(e){let n=Promise.resolve(e);if(!this._observers.length)return n;const s=this._eventState;s.skipNextObservers=!1;for(let r=0;r<this._observers.length;r++){const i=this._observers[r];s.skipNextObservers||i._willBeUnregistered||(n=n.then(()=>i.callback(e,s)),i.unregisterOnNextCall&&this._deferUnregister(i))}return n.then(()=>e)}notifyObserver(e,n){if(e._willBeUnregistered)return;const s=this._eventState;return s.skipNextObservers=!1,e.callback(n,s),e.unregisterOnNextCall&&this._deferUnregister(e),{lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}hasObservers(){return this._observers.length>0}clear(){this._observers=new Array,this._onObserverAdded=null}clone(){const e=new Dt;return e._observers=this._observers.slice(0),e}_deferUnregister(e){e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(()=>{this._remove(e)},0)}_remove(e){if(!e)return!1;const n=this._observers.indexOf(e);return n!==-1?(this._observers.splice(n,1),!0):!1}}function D(t){let e=!1;return ar(t)?{dispose:()=>{e||(e=!0,t.unsubscribe())}}:Ye(t)?{dispose:()=>{e||(e=!0,t.dispose())}}:{dispose:()=>{e||(e=!0,t())}}}function lr(t){return D(()=>{t.unsubscribe()})}class Ke{constructor(){_(this,"_disposables",new Set)}add(e){return this._disposables.add(e),{dispose:()=>{e.dispose(),this._disposables.delete(e)}}}dispose(){this._disposables.forEach(e=>{e.dispose(),this._disposables.delete(e)})}}class T{constructor(){_(this,"_disposed",!1);_(this,"_collection",new Ke)}disposeWithMe(e){return this._collection.add(e)}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class ur extends T{constructor(){super(...arguments);_(this,"dispose$",new N.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}const lt=A.createIdentifier("univer.context-service");class Xe extends T{constructor(){super(...arguments);_(this,"_contextChanged$",new N.Subject);_(this,"contextChanged$",this._contextChanged$.asObservable());_(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(n){return this._contextMap.get(n)??!1}setContextValue(n,s){this._contextMap.set(n,s),this._contextChanged$.next()}}var qe=(t=>(t[t.SILENT=0]="SILENT",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.VERBOSE=3]="VERBOSE",t))(qe||{});const st=A.createIdentifier("univer.log");class Qe extends T{constructor(){super(...arguments);_(this,"_logLevel",0)}log(...n){if(this._logLevel<3||!n.length)return;const s=n[0];/^\[(.*?)\]/g.test(s)?console.log(`\x1B[97;104m${s}\x1B[0m:`,...n.slice(1)):console.log(...n)}warn(...n){this._logLevel>=2&&console.warn(...n)}error(...n){this._logLevel>=1&&console.error(...n)}setLogLevel(n){this._logLevel=n}}var cr=Object.defineProperty,hr=Object.getOwnPropertyDescriptor,dr=(t,e,n,s)=>{for(var r=s>1?void 0:s?hr(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&cr(e,n,r),r},Ze=(t,e)=>(n,s)=>e(n,s,t),Mt=(t=>(t[t.COMMAND=0]="COMMAND",t[t.OPERATION=1]="OPERATION",t[t.MUTATION=2]="MUTATION",t))(Mt||{});const mt=A.createIdentifier("anywhere.command-service");class _r{constructor(){_(this,"_commands",new Map)}registerCommand(e){if(this._commands.has(e.id))throw new Error(`Command ${e.id} has registered before!`);return this._commands.set(e.id,e),D(()=>{var n;this._commands.delete(e.id),(n=e.onDispose)==null||n.call(e)})}getCommand(e){return this._commands.has(e)?[this._commands.get(e)]:null}}c.CommandService=class{constructor(e,n){_(this,"_commandRegistry");_(this,"_beforeCommandExecutionListeners",[]);_(this,"_commandExecutedListeners",[]);_(this,"_multiCommandDisposables",new Map);_(this,"_commandExecutingLevel",0);_(this,"_commandExecutionStack",[]);this._injector=e,this._log=n,this._commandRegistry=new _r}registerCommand(e){return this._registerCommand(e)}registerAsMultipleCommand(e){return this._registerMultiCommand(e)}beforeCommandExecuted(e){if(this._beforeCommandExecutionListeners.indexOf(e)===-1)return this._beforeCommandExecutionListeners.push(e),D(()=>{const n=this._beforeCommandExecutionListeners.indexOf(e);this._beforeCommandExecutionListeners.splice(n,1)});throw new Error("Could not add a listener twice.")}onCommandExecuted(e){if(this._commandExecutedListeners.indexOf(e)===-1)return this._commandExecutedListeners.push(e),D(()=>{const n=this._commandExecutedListeners.indexOf(e);this._commandExecutedListeners.splice(n,1)});throw new Error("Could not add a listener twice.")}async executeCommand(e,n,s){const r=this._commandRegistry.getCommand(e);if(r){const[i]=r,o={id:i.id,type:i.type,params:n},a=this._pushCommandExecutionStack(o);this._beforeCommandExecutionListeners.forEach(l=>l(o,s));const h=await this._execute(i,n);return this._commandExecutedListeners.forEach(l=>l(o,s)),a.dispose(),h}throw new Error(`[CommandService]: command "${e}" is not registered.`)}syncExecuteCommand(e,n,s){const r=this._commandRegistry.getCommand(e);if(r){const[i]=r,o={id:i.id,type:i.type,params:n};if(i.type===2){const l=ir(this._commandExecutionStack,u=>u.type===0);l&&(o.params=o.params??{},o.params.trigger=l.id)}const a=this._pushCommandExecutionStack(o);this._beforeCommandExecutionListeners.forEach(l=>l(o,s));const h=this._syncExecute(i,n);return this._commandExecutedListeners.forEach(l=>l(o,s)),a.dispose(),h}throw new Error(`[CommandService]: command "${e}" is not registered.`)}_pushCommandExecutionStack(e){return this._commandExecutionStack.push(e),D(()=>q(this._commandExecutionStack,e))}_registerCommand(e){return this._commandRegistry.registerCommand(e)}_registerMultiCommand(e){const n=this._commandRegistry.getCommand(e.id);let s;if(!n)s=new fr(e.id),this._multiCommandDisposables.set(e.id,this._commandRegistry.registerCommand(s));else{if(n[0].multi!==!0)throw new Error("Command has registered as a single command.");s=n[0]}const r=s.registerImplementation(e);return D(()=>{var i;r.dispose(),s.hasImplementations()||(i=this._multiCommandDisposables.get(e.id))==null||i.dispose()})}async _execute(e,n){this._log.log("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${e.id}"`),this._commandExecutingLevel++;let s;try{s=await this._injector.invoke(e.handler,n),this._commandExecutingLevel--}catch(r){throw s=!1,this._commandExecutingLevel=0,r}return s}_syncExecute(e,n){this._log.log("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${e.id}".`),this._commandExecutingLevel++;let s;try{if(s=this._injector.invoke(e.handler,n),s instanceof Promise)throw new Error("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(r){throw s=!1,this._commandExecutingLevel=0,r}return s}},c.CommandService=dr([Ze(0,A.Inject(A.Injector)),Ze(1,st)],c.CommandService);class fr{constructor(e){_(this,"name");_(this,"multi",!0);_(this,"type",0);_(this,"priority",0);_(this,"_implementations",[]);_(this,"handler",async(e,n)=>{if(!this._implementations.length)return!1;const s=e.get(st),r=e.get(lt),i=e.get(A.Injector);for(const o of this._implementations){const a=o.command.preconditions;if(a!=null&&a(r)&&(s.log("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,n)))return!0}return!1});this.id=e,this.name=e}registerImplementation(e){const n={command:e};return this._implementations.push(n),this._implementations.sort((s,r)=>r.command.priority-s.command.priority),D(()=>{var r;const s=this._implementations.indexOf(n);this._implementations.splice(s,1),(r=e.onDispose)==null||r.call(e)})}hasImplementations(){return this._implementations.length>0}}function se(t,e,n){const s=t.map(r=>()=>e.syncExecuteCommand(r.id,r.params,n));return $e(s)}function gr(t,e,n){const s=t.map(r=>()=>e.executeCommand(r.id,r.params,n));return We(s)}const Je=A.createIdentifier("univer.config-service");class Er{constructor(){_(this,"_config",new Map)}getConfig(e){return this._config.get(e)}setConfig(e,n){this._config.set(e,n)}deleteConfig(e){this._config.delete(e)}}class ye extends T{constructor(){super(...arguments);_(this,"_error$",new N.Subject);_(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}const Rr="__default_document_sub_component_id20231101__";class tn{constructor(){_(this,"_managerInfo",new Map);_(this,"_remove$",new N.Subject);_(this,"remove$",this._remove$.asObservable());_(this,"_andOrUpdate$",new N.Subject);_(this,"andOrUpdate$",this._andOrUpdate$.asObservable());_(this,"_pluginUpdate$",new N.Subject);_(this,"pluginUpdate$",this._pluginUpdate$.asObservable())}getFloatObject(e){return this._getFloatingObject(e)}getFloatObjects(e){return this._getFloatingObjects(e)}dispose(){this._remove$.complete(),this._andOrUpdate$.complete(),this._pluginUpdate$.complete(),this._managerInfo.clear()}clear(e){const n=this._clearByParam(e);this._remove$.next(n)}addOrUpdate(e){const n=this._addByParam(e);this._andOrUpdate$.next(n)}BatchAddOrUpdate(e){const n=[];e.forEach(s=>{n.push(...this._addByParam(s))}),this._andOrUpdate$.next(n)}remove(e){const n=this._removeByParam(e);this._remove$.next(n)}pluginUpdateRefresh(e){this._pluginUpdate$.next(e)}_getFloatingObjects(e){var r;if(e==null)return;const{unitId:n,subComponentId:s}=e;return(r=this._managerInfo.get(n))==null?void 0:r.get(s)}_getFloatingObject(e){var i,o;if(e==null)return;const{unitId:n,subComponentId:s,floatingObjectId:r}=e;return(o=(i=this._managerInfo.get(n))==null?void 0:i.get(s))==null?void 0:o.get(r)}_addByParam(e){const{unitId:n,subComponentId:s,floatingObject:r,floatingObjectId:i}=e;this._managerInfo.has(n)||this._managerInfo.set(n,new Map);const o=this._managerInfo.get(n);return o.has(s)||o.set(s,new Map),o.get(s).set(i,r),[{unitId:n,subComponentId:s,floatingObjectId:i,floatingObject:r}]}_clearByParam(e){const n=this._getFloatingObjects(e),{unitId:s,subComponentId:r}=e,i=[];return n==null||n.forEach((o,a)=>{i.push({unitId:s,subComponentId:r,floatingObjectId:a,floatingObject:o})}),n==null||n.clear(),i}_removeByParam(e){const n=this._getFloatingObjects(e),s=n==null?void 0:n.get(e.floatingObjectId);return s==null?[]:(n==null||n.delete(e.floatingObjectId),[{...e,floatingObject:s}])}}const en=A.createIdentifier("univer.floating-object.service");class nn{constructor(){_(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(e){this.cursor+=e}moveCursorTo(e){this.cursor=e}}function sn(t,e){let n=0,s=t.length-1;for(;n<=s;){const r=Math.floor((s+n)/2);if(e<t[r]&&(r===0||e>=t[r-1]))return r;if(e>=t[r])n=r+1;else if(e<t[r])s=r-1;else return-1}return-1}function rn(t,e){let n=0,s=0,r=0,i=-1,o=t.length-1;for(;n<t.length&&o>=0&&o>=n;){if(s=t[o],o===0?r=0:r=t[o-1],e>=r&&e<=s){i=o;break}if(s=t[n],n===0?r=0:r=t[n-1],e>=r&&e<s){i=n;break}n++,o--}return i}function mr(t,e){let n=t.length-1;return e<0?-1:e<t[0]?0:e>t[t.length-1]?1/0:(t.length<40||e<=t[20]||e>=t[n-20]?n=rn(t,e):n=sn(t,e),n)}function Or(t){const e=new Blob([t],{type:"text/javascript"});return window.URL.createObjectURL(e)}var on=(t=>(t[t.DEFAULT_SERIES=0]="DEFAULT_SERIES",t[t.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",t))(on||{}),L=(t=>(t[t.NONE=0]="NONE",t[t.THIN=1]="THIN",t[t.HAIR=2]="HAIR",t[t.DOTTED=3]="DOTTED",t[t.DASHED=4]="DASHED",t[t.DASH_DOT=5]="DASH_DOT",t[t.DASH_DOT_DOT=6]="DASH_DOT_DOT",t[t.DOUBLE=7]="DOUBLE",t[t.MEDIUM=8]="MEDIUM",t[t.MEDIUM_DASHED=9]="MEDIUM_DASHED",t[t.MEDIUM_DASH_DOT=10]="MEDIUM_DASH_DOT",t[t.MEDIUM_DASH_DOT_DOT=11]="MEDIUM_DASH_DOT_DOT",t[t.SLANT_DASH_DOT=12]="SLANT_DASH_DOT",t[t.THICK=13]="THICK",t))(L||{}),an=(t=>(t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right",t.NONE="none",t.ALL="all",t.OUTSIDE="outside",t.INSIDE="inside",t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t.TLBR="tlbr",t.TLBC_TLMR="tlbc_tlmr",t.TLBR_TLBC_TLMR="tlbr_tlbc_tlmr",t.BLTR="bl_tr",t.MLTR_BCTR="mltr_bctr",t))(an||{}),G=(t=>(t[t.UNSUPPORTED=0]="UNSUPPORTED",t[t.RGB=1]="RGB",t[t.HEX=2]="HEX",t[t.THEME=3]="THEME",t))(G||{}),ln=(t=>(t[t.ON=0]="ON",t[t.OFF=1]="OFF",t))(ln||{}),un=(t=>(t[t.CONDITION_TYPE_UNSPECIFIED=0]="CONDITION_TYPE_UNSPECIFIED",t[t.NUMNUMBER_BETWEENR_GREATER=1]="NUMNUMBER_BETWEENR_GREATER",t[t.NUMBER_GREATER_THAN_EQ=2]="NUMBER_GREATER_THAN_EQ",t[t.NUMBER_LESS=3]="NUMBER_LESS",t[t.NUMBER_LESS_THAN_EQ=4]="NUMBER_LESS_THAN_EQ",t[t.NUMBER_EQ=5]="NUMBER_EQ",t[t.NUMBER_NOT_EQ=6]="NUMBER_NOT_EQ",t[t.NUMBER_BETWEEN=7]="NUMBER_BETWEEN",t[t.NUMBER_NOT_BETWEEN=8]="NUMBER_NOT_BETWEEN",t[t.TEXT_CONTAINS=9]="TEXT_CONTAINS",t[t.TEXT_NOT_CONTAINS=10]="TEXT_NOT_CONTAINS",t[t.TEXT_STARTS_WITH=11]="TEXT_STARTS_WITH",t[t.TEXT_ENDS_WITH=12]="TEXT_ENDS_WITH",t[t.TEXT_EQ=13]="TEXT_EQ",t[t.TEXT_IS_EMAIL=14]="TEXT_IS_EMAIL",t[t.TEXT_IS_URL=15]="TEXT_IS_URL",t[t.DATE_EQ=16]="DATE_EQ",t[t.DATE_BEFORE=17]="DATE_BEFORE",t[t.DATE_AFTER=18]="DATE_AFTER",t[t.DATE_ON_OR_BEFORE=19]="DATE_ON_OR_BEFORE",t[t.DATE_ON_OR_AFTER=20]="DATE_ON_OR_AFTER",t[t.DATE_BETWEEN=21]="DATE_BETWEEN",t[t.DATE_NOT_BETWEEN=22]="DATE_NOT_BETWEEN",t[t.DATE_IS_VALID=23]="DATE_IS_VALID",t[t.ONE_OF_RANGE=24]="ONE_OF_RANGE",t[t.ONE_OF_LIST=25]="ONE_OF_LIST",t[t.BLANK=26]="BLANK",t[t.NOT_BLANK=27]="NOT_BLANK",t[t.CUSTOM_FORMULA=28]="CUSTOM_FORMULA",t[t.BOOLEAN=29]="BOOLEAN",t[t.TEXT_NOT_EQ=30]="TEXT_NOT_EQ",t[t.DATE_NOT_EQ=31]="DATE_NOT_EQ",t))(un||{}),cn=(t=>(t[t.PASTE_NORMAL=0]="PASTE_NORMAL",t[t.PASTE_NO_BORDERS=1]="PASTE_NO_BORDERS",t[t.PASTE_FORMAT=2]="PASTE_FORMAT",t[t.PASTE_FORMULA=3]="PASTE_FORMULA",t[t.PASTE_DATA_VALIDATION=4]="PASTE_DATA_VALIDATION",t[t.PASTE_VALUES=5]="PASTE_VALUES",t[t.PASTE_CONDITIONAL_FORMATTING=6]="PASTE_CONDITIONAL_FORMATTING",t[t.PASTE_COLUMN_WIDTHS=7]="PASTE_COLUMN_WIDTHS",t))(cn||{}),hn=(t=>(t[t.DOCUMENT=0]="DOCUMENT",t[t.PROJECT=1]="PROJECT",t))(hn||{}),dn=(t=>(t[t.COLUMNS=0]="COLUMNS",t[t.ROWS=1]="ROWS",t))(dn||{}),_n=(t=>(t[t.UP=0]="UP",t[t.RIGHT=1]="RIGHT",t[t.DOWN=2]="DOWN",t[t.LEFT=3]="LEFT",t))(_n||{});function Ar(t){switch(t){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var fn=(t=>(t[t.NUMBER_FORMAT_TYPE_UNSPECIFIED=0]="NUMBER_FORMAT_TYPE_UNSPECIFIED",t[t.TEXT=1]="TEXT",t[t.NUMBER=2]="NUMBER",t[t.PERCENT=3]="PERCENT",t[t.CURRENCY=4]="CURRENCY",t[t.DATE=5]="DATE",t[t.TIME=6]="TIME",t[t.DATE_TIME=7]="DATE_TIME",t[t.SCIENTIFIC=8]="SCIENTIFIC",t))(fn||{}),gn=(t=>(t[t.INTERPOLATION_POINT_TYPE_UNSPECIFIED=0]="INTERPOLATION_POINT_TYPE_UNSPECIFIED",t[t.MIN=1]="MIN",t[t.MAX=2]="MAX",t[t.NUMBER=3]="NUMBER",t[t.PERCENT=4]="PERCENT",t[t.PERCENTILE=5]="PERCENTILE",t))(gn||{}),Ut=(t=>(t.EN_US="enUS",t.ZH_CN="zhCN",t))(Ut||{}),En=(t=>(t[t.RANGE=0]="RANGE",t[t.SHEET=1]="SHEET",t))(En||{}),Rn=(t=>(t[t.RELATIVE_DATE_UNSPECIFIED=0]="RELATIVE_DATE_UNSPECIFIED",t[t.PAST_YEAR=1]="PAST_YEAR",t[t.PAST_MONTH=2]="PAST_MONTH",t[t.PAST_WEEK=3]="PAST_WEEK",t[t.YESTERDAY=4]="YESTERDAY",t[t.TODAY=5]="TODAY",t[t.TOMORROW=6]="TOMORROW",t))(Rn||{}),mn=(t=>(t[t.TYPE_UNSPECIFIED=0]="TYPE_UNSPECIFIED",t[t.TEXT_BOX=1]="TEXT_BOX",t[t.RECTANGLE=2]="RECTANGLE",t[t.ROUND_RECTANGLE=3]="ROUND_RECTANGLE",t[t.ELLIPSE=4]="ELLIPSE",t[t.ARC=5]="ARC",t[t.BENT_ARROW=6]="BENT_ARROW",t[t.BENT_UP_ARROW=7]="BENT_UP_ARROW",t[t.BEVEL=8]="BEVEL",t[t.BLOCK_ARC=9]="BLOCK_ARC",t[t.BRACE_PAIR=10]="BRACE_PAIR",t[t.BRACKET_PAIR=11]="BRACKET_PAIR",t[t.CAN=12]="CAN",t[t.CHEVRON=13]="CHEVRON",t[t.CHORD=14]="CHORD",t[t.CLOUD=15]="CLOUD",t[t.CORNER=16]="CORNER",t[t.CUBE=17]="CUBE",t[t.CURVED_DOWN_ARROW=18]="CURVED_DOWN_ARROW",t[t.CURVED_LEFT_ARROW=19]="CURVED_LEFT_ARROW",t[t.CURVED_RIGHT_ARROW=20]="CURVED_RIGHT_ARROW",t[t.CURVED_UP_ARROW=21]="CURVED_UP_ARROW",t[t.DECAGON=22]="DECAGON",t[t.DIAGONAL_STRIPE=23]="DIAGONAL_STRIPE",t[t.DIAMOND=24]="DIAMOND",t[t.DODECAGON=25]="DODECAGON",t[t.DONUT=26]="DONUT",t[t.DOUBLE_WAVE=27]="DOUBLE_WAVE",t[t.DOWN_ARROW=28]="DOWN_ARROW",t[t.DOWN_ARROW_CALLOUT=29]="DOWN_ARROW_CALLOUT",t[t.FOLDED_CORNER=30]="FOLDED_CORNER",t[t.FRAME=31]="FRAME",t[t.HALF_FRAME=32]="HALF_FRAME",t[t.HEART=33]="HEART",t[t.HEPTAGON=34]="HEPTAGON",t[t.HEXAGON=35]="HEXAGON",t[t.HOME_PLATE=36]="HOME_PLATE",t[t.HORIZONTAL_SCROLL=37]="HORIZONTAL_SCROLL",t[t.IRREGULAR_SEAL_1=38]="IRREGULAR_SEAL_1",t[t.IRREGULAR_SEAL_2=39]="IRREGULAR_SEAL_2",t[t.LEFT_ARROW=40]="LEFT_ARROW",t[t.LEFT_ARROW_CALLOUT=41]="LEFT_ARROW_CALLOUT",t[t.LEFT_BRACE=42]="LEFT_BRACE",t[t.LEFT_BRACKET=43]="LEFT_BRACKET",t[t.LEFT_RIGHT_ARROW=44]="LEFT_RIGHT_ARROW",t[t.LEFT_RIGHT_ARROW_CALLOUT=45]="LEFT_RIGHT_ARROW_CALLOUT",t[t.LEFT_RIGHT_UP_ARROW=46]="LEFT_RIGHT_UP_ARROW",t[t.LEFT_UP_ARROW=47]="LEFT_UP_ARROW",t[t.LIGHTNING_BOLT=48]="LIGHTNING_BOLT",t[t.MATH_DIVIDE=49]="MATH_DIVIDE",t[t.MATH_EQUAL=50]="MATH_EQUAL",t[t.MATH_MINUS=51]="MATH_MINUS",t[t.MATH_MULTIPLY=52]="MATH_MULTIPLY",t[t.MATH_NOT_EQUAL=53]="MATH_NOT_EQUAL",t[t.MATH_PLUS=54]="MATH_PLUS",t[t.MOON=55]="MOON",t[t.NO_SMOKING=56]="NO_SMOKING",t[t.NOTCHED_RIGHT_ARROW=57]="NOTCHED_RIGHT_ARROW",t[t.OCTAGON=58]="OCTAGON",t[t.PARALLELOGRAM=59]="PARALLELOGRAM",t[t.PENTAGON=60]="PENTAGON",t[t.PIE=61]="PIE",t[t.PLAQUE=62]="PLAQUE",t[t.PLUS=63]="PLUS",t[t.QUAD_ARROW=64]="QUAD_ARROW",t[t.QUAD_ARROW_CALLOUT=65]="QUAD_ARROW_CALLOUT",t[t.RIBBON=66]="RIBBON",t[t.RIBBON_2=67]="RIBBON_2",t[t.RIGHT_ARROW=68]="RIGHT_ARROW",t[t.RIGHT_ARROW_CALLOUT=69]="RIGHT_ARROW_CALLOUT",t[t.RIGHT_BRACE=70]="RIGHT_BRACE",t[t.RIGHT_BRACKET=71]="RIGHT_BRACKET",t[t.ROUND_1_RECTANGLE=72]="ROUND_1_RECTANGLE",t[t.ROUND_2_DIAGONAL_RECTANGLE=73]="ROUND_2_DIAGONAL_RECTANGLE",t[t.ROUND_2_SAME_RECTANGLE=74]="ROUND_2_SAME_RECTANGLE",t[t.RIGHT_TRIANGLE=75]="RIGHT_TRIANGLE",t[t.SMILEY_FACE=76]="SMILEY_FACE",t[t.SNIP_1_RECTANGLE=77]="SNIP_1_RECTANGLE",t[t.SNIP_2_DIAGONAL_RECTANGLE=78]="SNIP_2_DIAGONAL_RECTANGLE",t[t.SNIP_2_SAME_RECTANGLE=79]="SNIP_2_SAME_RECTANGLE",t[t.SNIP_ROUND_RECTANGLE=80]="SNIP_ROUND_RECTANGLE",t[t.STAR_10=81]="STAR_10",t[t.STAR_12=82]="STAR_12",t[t.STAR_16=83]="STAR_16",t[t.STAR_24=84]="STAR_24",t[t.STAR_32=85]="STAR_32",t[t.STAR_4=86]="STAR_4",t[t.STAR_5=87]="STAR_5",t[t.STAR_6=88]="STAR_6",t[t.STAR_7=89]="STAR_7",t[t.STAR_8=90]="STAR_8",t[t.STRIPED_RIGHT_ARROW=91]="STRIPED_RIGHT_ARROW",t[t.SUN=92]="SUN",t[t.TRAPEZOID=93]="TRAPEZOID",t[t.TRIANGLE=94]="TRIANGLE",t[t.UP_ARROW=95]="UP_ARROW",t[t.UP_ARROW_CALLOUT=96]="UP_ARROW_CALLOUT",t[t.UP_DOWN_ARROW=97]="UP_DOWN_ARROW",t[t.UTURN_ARROW=98]="UTURN_ARROW",t[t.VERTICAL_SCROLL=99]="VERTICAL_SCROLL",t[t.WAVE=100]="WAVE",t[t.WEDGE_ELLIPSE_CALLOUT=101]="WEDGE_ELLIPSE_CALLOUT",t[t.WEDGE_RECTANGLE_CALLOUT=102]="WEDGE_RECTANGLE_CALLOUT",t[t.WEDGE_ROUND_RECTANGLE_CALLOUT=103]="WEDGE_ROUND_RECTANGLE_CALLOUT",t[t.FLOW_CHART_ALTERNATE_PROCESS=104]="FLOW_CHART_ALTERNATE_PROCESS",t[t.FLOW_CHART_COLLATE=105]="FLOW_CHART_COLLATE",t[t.FLOW_CHART_CONNECTOR=106]="FLOW_CHART_CONNECTOR",t[t.FLOW_CHART_DECISION=107]="FLOW_CHART_DECISION",t[t.FLOW_CHART_DELAY=108]="FLOW_CHART_DELAY",t[t.FLOW_CHART_DISPLAY=109]="FLOW_CHART_DISPLAY",t[t.FLOW_CHART_DOCUMENT=110]="FLOW_CHART_DOCUMENT",t[t.FLOW_CHART_EXTRACT=111]="FLOW_CHART_EXTRACT",t[t.FLOW_CHART_INPUT_OUTPUT=112]="FLOW_CHART_INPUT_OUTPUT",t[t.FLOW_CHART_INTERNAL_STORAGE=113]="FLOW_CHART_INTERNAL_STORAGE",t[t.FLOW_CHART_MAGNETIC_DISK=114]="FLOW_CHART_MAGNETIC_DISK",t[t.FLOW_CHART_MAGNETIC_DRUM=115]="FLOW_CHART_MAGNETIC_DRUM",t[t.FLOW_CHART_MAGNETIC_TAPE=116]="FLOW_CHART_MAGNETIC_TAPE",t[t.FLOW_CHART_MANUAL_INPUT=117]="FLOW_CHART_MANUAL_INPUT",t[t.FLOW_CHART_MANUAL_OPERATION=118]="FLOW_CHART_MANUAL_OPERATION",t[t.FLOW_CHART_MERGE=119]="FLOW_CHART_MERGE",t[t.FLOW_CHART_MULTIDOCUMENT=120]="FLOW_CHART_MULTIDOCUMENT",t[t.FLOW_CHART_OFFLINE_STORAGE=121]="FLOW_CHART_OFFLINE_STORAGE",t[t.FLOW_CHART_OFFPAGE_CONNECTOR=122]="FLOW_CHART_OFFPAGE_CONNECTOR",t[t.FLOW_CHART_ONLINE_STORAGE=123]="FLOW_CHART_ONLINE_STORAGE",t[t.FLOW_CHART_OR=124]="FLOW_CHART_OR",t[t.FLOW_CHART_PREDEFINED_PROCESS=125]="FLOW_CHART_PREDEFINED_PROCESS",t[t.FLOW_CHART_PREPARATION=126]="FLOW_CHART_PREPARATION",t[t.FLOW_CHART_PROCESS=127]="FLOW_CHART_PROCESS",t[t.FLOW_CHART_PUNCHED_CARD=128]="FLOW_CHART_PUNCHED_CARD",t[t.FLOW_CHART_PUNCHED_TAPE=129]="FLOW_CHART_PUNCHED_TAPE",t[t.FLOW_CHART_SORT=130]="FLOW_CHART_SORT",t[t.FLOW_CHART_SUMMING_JUNCTION=131]="FLOW_CHART_SUMMING_JUNCTION",t[t.FLOW_CHART_TERMINATOR=132]="FLOW_CHART_TERMINATOR",t[t.ARROW_EAST=133]="ARROW_EAST",t[t.ARROW_NORTH_EAST=134]="ARROW_NORTH_EAST",t[t.ARROW_NORTH=135]="ARROW_NORTH",t[t.SPEECH=136]="SPEECH",t[t.STARBURST=137]="STARBURST",t[t.TEARDROP=138]="TEARDROP",t[t.ELLIPSE_RIBBON=139]="ELLIPSE_RIBBON",t[t.ELLIPSE_RIBBON_2=140]="ELLIPSE_RIBBON_2",t[t.CLOUD_CALLOUT=141]="CLOUD_CALLOUT",t[t.CUSTOM=142]="CUSTOM",t))(mn||{}),re=(t=>(t[t.GRID=0]="GRID",t[t.KANBAN=1]="KANBAN",t[t.GANTT=2]="GANTT",t))(re||{}),Ot=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",t))(Ot||{}),On=(t=>(t[t.DASH=0]="DASH",t[t.DASH_DOT_DOT_HEAVY=1]="DASH_DOT_DOT_HEAVY",t[t.DASH_DOT_HEAVY=2]="DASH_DOT_HEAVY",t[t.DASHED_HEAVY=3]="DASHED_HEAVY",t[t.DASH_LONG=4]="DASH_LONG",t[t.DASH_LONG_HEAVY=5]="DASH_LONG_HEAVY",t[t.DOT_DASH=6]="DOT_DASH",t[t.DOT_DOT_DASH=7]="DOT_DOT_DASH",t[t.DOTTED=8]="DOTTED",t[t.DOTTED_HEAVY=9]="DOTTED_HEAVY",t[t.DOUBLE=10]="DOUBLE",t[t.NONE=11]="NONE",t[t.SINGLE=12]="SINGLE",t[t.THICK=13]="THICK",t[t.WAVE=14]="WAVE",t[t.WAVY_DOUBLE=15]="WAVY_DOUBLE",t[t.WAVY_HEAVY=16]="WAVY_HEAVY",t[t.WORDS=17]="WORDS",t))(On||{}),rt=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LEFT=1]="LEFT",t[t.CENTER=2]="CENTER",t[t.RIGHT=3]="RIGHT",t[t.JUSTIFIED=4]="JUSTIFIED",t))(rt||{}),ut=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TOP=1]="TOP",t[t.MIDDLE=2]="MIDDLE",t[t.BOTTOM=3]="BOTTOM",t))(ut||{}),ct=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OVERFLOW=1]="OVERFLOW",t[t.CLIP=2]="CLIP",t[t.WRAP=3]="WRAP",t))(ct||{}),Tt=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ITALIC=1]="ITALIC",t))(Tt||{}),Pt=(t=>(t[t.NORMAL=0]="NORMAL",t[t.BOLD=1]="BOLD",t))(Pt||{}),Ft=(t=>(t[t.NORMAL=1]="NORMAL",t[t.SUBSCRIPT=2]="SUBSCRIPT",t[t.SUPERSCRIPT=3]="SUPERSCRIPT",t))(Ft||{}),C=(t=>(t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE",t))(C||{}),At=(t=>(t[t.STRING=1]="STRING",t[t.NUMBER=2]="NUMBER",t[t.BOOLEAN=3]="BOOLEAN",t[t.FORCE_STRING=4]="FORCE_STRING",t))(At||{}),H=(t=>(t[t.DARK1=0]="DARK1",t[t.LIGHT1=1]="LIGHT1",t[t.DARK2=2]="DARK2",t[t.LIGHT2=3]="LIGHT2",t[t.ACCENT1=4]="ACCENT1",t[t.ACCENT2=5]="ACCENT2",t[t.ACCENT3=6]="ACCENT3",t[t.ACCENT4=7]="ACCENT4",t[t.ACCENT5=8]="ACCENT5",t[t.ACCENT6=9]="ACCENT6",t[t.HYPERLINK=10]="HYPERLINK",t[t.FOLLOWED_HYPERLINK=11]="FOLLOWED_HYPERLINK",t))(H||{}),Ht=(t=>(t.OFFICE="Office",t.OFFICE_2007_2010="Office 2007-2010",t.GRAYSCALE="Grayscale",t.BLUE_WARM="Blue Warm",t.BLUE="Blue",t.BLUE_II="Blue II",t.BLUE_GREEN="Blue Green",t.GREEN="Green",t.GREEN_YELLOW="Green Yellow",t.YELLOW="Yellow",t.YELLOW_ORANGE="Yellow Orange",t.ORANGE="Orange",t.ORANGE_RED="Orange Red",t.RED_ORANGE="Red Orange",t.RED="Red",t.RED_VIOLET="Red Violet",t.VIOLET="Violet",t.VIOLET_II="Violet II",t.MEDIAN="Median",t.PAPER="Paper",t.MARQUEE="Marquee",t.SLIPSTREAM="Slipstream",t.Aspect="Aspect",t))(Ht||{});const An={[Ht.OFFICE]:{[H.ACCENT1]:"#4472C4",[H.ACCENT2]:"#ED7D31",[H.ACCENT3]:"#A5A5A5",[H.ACCENT4]:"#70AD47",[H.ACCENT5]:"#5B9BD5",[H.ACCENT6]:"#70AD47",[H.DARK1]:"#000000",[H.DARK2]:"#44546A",[H.LIGHT1]:"#FFFFFF",[H.LIGHT2]:"#E7E6E6",[H.HYPERLINK]:"#0563C1",[H.FOLLOWED_HYPERLINK]:"#954F72"}};class Bt{constructor(){_(this,"_themeValue",H.LIGHT1);_(this,"_themeColors");_(this,"_themeTint");_(this,"_rgbValue","");_(this,"_colorType");this._colorType=G.UNSUPPORTED,this._themeColors=Ht.OFFICE,this._themeTint=0}asRgbColor(){return new Wt(this._rgbValue,this)}asThemeColor(){return new $t(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case G.THEME:return this.asThemeColor();case G.RGB:return this.asRgbColor();case G.UNSUPPORTED:throw Error("unsupported color type")}}setRgbColor(e){return this._colorType=G.RGB,this._rgbValue=e,this}setThemeColors(e){this._colorType=G.THEME,this._themeColors=e}setThemeTint(e){this._colorType=G.THEME,this._themeTint=e}setThemeColor(e){return this._colorType=G.THEME,this._themeValue=e,this}getColorType(){return this._colorType}}class it{constructor(e){_(this,"_builder");this._builder=e}static rgbColorToHexValue(e){return`#${((1<<24)+(e.getRed()<<16)+(e.getGreen()<<8)+e.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(e){e?e.indexOf("#")>-1&&(e=e.substring(1)):e="#000000";const n=+`0x${e[0]}${e[1]}`,s=+`0x${e[2]}${e[3]}`,r=+`0x${e[4]}${e[5]}`;return new Bt().setRgbColor(`rgb(${n},${s},${r})`).asRgbColor()}static hexToRgbString(e){const n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(n,(i,o,a,h)=>o+o+a+a+h+h);const s=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let r=null;if(s){const i=parseInt(s[1],16),o=parseInt(s[2],16),a=parseInt(s[3],16);r=`rgba(${i},${o},${a})`}return r}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new it(this._builder)}equals(e){return!1}}class In{constructor(e){_(this,"_saturation",0);_(this,"_hue",0);_(this,"_lightness",0);_(this,"_alpha",0);const n=e.getRed()/255,s=e.getGreen()/255,r=e.getBlue()/255,i=e.getAlpha()/255,o=Math.min(n,Math.min(s,r)),a=Math.max(n,Math.max(s,r)),h=a-o;if(a===o){this._hue=0,this._saturation=0,this._lightness=a;return}this._lightness=(o+a)/2,this._lightness<.5?this._saturation=h/(a+o):this._saturation=h/(2-a-o),n===a&&(this._hue=(s-r)/h),s===a&&(this._hue=2+(r-n)/h),r===a&&(this._hue=4+(n-s)/h),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const e=new Bt;if(this._saturation===0)return e.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),e.asRgbColor();let n;this._lightness<.5?n=this._lightness*(1+this._saturation):n=this._lightness+this._saturation-this._lightness*this._saturation;const s=2*this._lightness-n,r=this._hue/360,i=r+1/3,o=this.setColor(n,s,i),a=this.setColor(n,s,r),h=r-1/3,l=this.setColor(n,s,h);return e.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(l*255)},${this._alpha*255})`),e.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(e,n,s){s<0&&(s+=1),s>1&&(s-=1);let r;return 6*s<1?r=n+(e-n)*6*s:2*s<1?r=e:3*s<2?r=n+(e-n)*(2/3-s)*6:r=n,r}setLightness(e){this._lightness=e}}const k=class k extends it{constructor(n,s){super(s);_(this,"_cssString");_(this,"_red");_(this,"_green");_(this,"_blue");_(this,"_alpha");let r=n.match(k.RGBA_EXTRACT);if(r){const i=+r[1],o=+r[2],a=+r[3],h=+r[4];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=h;return}if(r=n.match(k.RGB_EXTRACT),r){const i=+r[1],o=+r[2],a=+r[3];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return it.rgbColorToHexValue(this)}getRed(){let n=this._red+k.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+k.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+k.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return G.RGB}clone(){return new k(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof k?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};_(k,"RGB_COLOR_AMT",0),_(k,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),_(k,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let Wt=k;const tt=class tt extends it{constructor(n,s,r,i){super(i);_(this,"_themeColorType");_(this,"_themeTint");_(this,"_themeColors");this._themeColorType=n,this._themeTint=s,this._themeColors=r}lumValue(n,s){if(n==null)return s;let r;return n<0?r=s*(1+n):r=s*(1-n)+(255-255*(1-n)),r}asRgbColor(){const n=An[this._themeColors];if(n==null)throw new Error("not find themeColors type");const s=n[this._themeColorType];if(s==null)throw new Error("not find themeColors value");let r;if(tt._cacheThemeColor.has(this._themeColors)){if(r=tt._cacheThemeColor.get(this._themeColors),r.has(this._themeColorType))return r.get(this._themeColorType)}else r=new Map,tt._cacheThemeColor.set(this._themeColors,r);const i=new In(it.hexValueToRgbColor(s));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return r.set(this._themeColorType,o),o}clone(){return new tt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof tt?n._themeColorType===this._themeColorType:!1}getColorType(){return G.THEME}getThemeColorType(){return this._themeColorType}};_(tt,"_cacheThemeColor",new Map);let $t=tt;const Ir="rgb(",Cr="rgba(",ie={aliceBlue:[240,248,255],antiqueWhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blancheAlmond:[255,235,205],blue:[0,0,255],blueViolet:[138,43,226],brown:[165,42,42],burlyWood:[222,184,135],cadetBlue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornFlowerBlue:[100,149,237],cornSilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkCyan:[0,139,139],darkGoldenrod:[184,132,11],darkGray:[169,169,169],darkGreen:[0,100,0],darkGrey:[169,169,169],darkKhaki:[189,183,107],darkMagenta:[139,0,139],darkOliveGreen:[85,107,47],darkOrange:[255,140,0],darkOrchid:[153,50,204],darkRed:[139,0,0],darkSalmon:[233,150,122],darkSeaGreen:[143,188,143],darkSlateBlue:[72,61,139],darkSlateGray:[47,79,79],darkSlateGrey:[47,79,79],darkTurquoise:[0,206,209],darkViolet:[148,0,211],deepPink:[255,20,147],deepSkyBlue:[0,191,255],dimGray:[105,105,105],dimGrey:[105,105,105],dodgerBlue:[30,144,255],firebrick:[178,34,34],floralWhite:[255,255,240],forestGreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostWhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenYellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotPink:[255,105,180],indianRed:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderBlush:[255,240,245],lawnGreen:[124,252,0],lemonChiffon:[255,250,205],lightblue:[173,216,230],lightCoral:[240,128,128],lightCyan:[224,255,255],lightGoldenrodYellow:[250,250,210],lightGray:[211,211,211],lightGreen:[144,238,144],lightGrey:[211,211,211],lightPink:[255,182,193],lightSalmon:[255,160,122],lightSeaGreen:[32,178,170],lightSkyBlue:[135,206,250],lightSlateGray:[119,136,153],lightSlateGrey:[119,136,153],lightSteelBlue:[176,196,222],lightYellow:[255,255,224],lime:[0,255,0],limeGreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumAquamarine:[102,205,170],mediumBlue:[0,0,205],mediumOrchid:[186,85,211],mediumPurple:[147,112,219],mediumSeaGreen:[60,179,113],mediumSlateBlue:[123,104,238],mediumSpringGreen:[0,250,154],mediumTurquoise:[72,209,204],mediumVioletRed:[199,21,133],midBightBlue:[25,25,112],mintCream:[245,255,250],mistyRose:[255,228,225],moccasin:[255,228,181],navajoWhite:[255,222,173],navy:[0,0,128],oldLace:[253,245,230],olive:[128,128,0],oliveDrab:[107,142,35],orange:[255,165,0],orangeRed:[255,69,0],orchid:[218,112,214],paleGoldenrod:[238,232,170],paleGreen:[152,251,152],paleTurquoise:[175,238,238],paleVioletRed:[219,112,147],papayaWhip:[255,239,213],peachPuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderBlue:[176,224,230],purple:[128,0,128],rebeccaPurple:[102,51,153],red:[255,0,0],rosyBrown:[188,143,143],royalBlue:[65,105,225],saddleBrown:[139,69,19],salmon:[250,128,114],sandyBrown:[244,164,96],seaGreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyBlue:[135,206,235],slateBlue:[106,90,205],slateGray:[119,128,144],slateGrey:[119,128,144],snow:[255,255,250],springGreen:[0,255,127],steelBlue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whiteSmoke:[245,245,245],yellow:[255,255,0],yellowGreen:[154,205,5]};class x{constructor(e){_(this,"_color");_(this,"_rgbColor");_(this,"_isValid",!1);if(e==null){this._setNullColor();return}if(e instanceof x){this._color={...e._color},this._rgbColor={...e._rgbColor};return}const n=Cn(e);if(n==null){this._setNullColor();return}this._color=n;const s=wr(this._color);if(s==null){this._setNullColor();return}this._rgbColor=s,this._isValid=!0}static mix(e,n,s){s=Math.min(1,Math.max(0,s));const r=new x(e).toRgb(),i=new x(n).toRgb(),o=r.a??1,a=i.a??1,h={r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(a-o)*s+o};return new x(h)}static getContrastRatio(e,n){const s=new x(e).getLuminance(),r=new x(n).getLuminance();return(Math.max(s,r)+.05)/(Math.min(s,r)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:e,g:n,b:s,a:r=1}=this.toRgb(),i=r<1;return`rgb${i?"a":""}(${e},${n},${s}${i?`,${r}`:""})`}toString(){return this.toRgbString()}toHexString(e){const{r:n,g:s,b:r,a:i=1}=this.toRgb(),o=i<1,a=[Gt(Math.round(n).toString(16)),Gt(Math.round(s).toString(16)),Gt(Math.round(r).toString(16)),Gt(Math.round(i*255).toString(16))];return e&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return Ur(this.toRgb())}toHsl(){return Mr(this.toRgb())}lighten(e=10){const n=this.toHsl();return n.l+=e,n.l=Math.min(Math.max(n.l,0),100),new x(n)}darken(e=10){const n=this.toHsl();return n.l-=e,n.l=Math.min(Math.max(n.l,0),100),new x(n)}setAlpha(e){return new x({...this._rgbColor,a:e})}getLuminance(){let{r:e,g:n,b:s}=this.toRgb();return e=oe(e),n=oe(n),s=oe(s),Number((.2126*e+.7152*n+.0722*s).toFixed(3))}getBrightness(){const{r:e,g:n,b:s}=this.toRgb();return(e*299+n*587+s*114)/1e3}getAlpha(){return this._color.a??1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const Gt=t=>t.length===1?`0${t}`:t,oe=t=>(t/=255,t<=.03928?t/12.92:((t+.055)/1.055)**2.4),Cn=t=>{if(Pr(t)){if("r"in t){const s={r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)};return t.a!==void 0&&(s.a=t.a),s}if("l"in t){const s={h:Math.round(t.h),s:t.s,l:t.l};return t.a!==void 0&&(s.a=t.a),s}const n={h:Math.round(t.h),s:t.s,v:t.v};return t.a!==void 0&&(n.a=t.a),n}const e=t.trim();if(ie[e]){const n=ie[e],s={r:Math.round(n[0]),g:Math.round(n[1]),b:Math.round(n[2])};return s.a=n[3]||1,s}if(e.startsWith("#"))return Sr(e);if(e.startsWith("rgb"))return Nr(e);if(e.startsWith("hsl"))return br(e);if(e.startsWith("hsv"))return Lr(e)},Sr=t=>{const e=t.substring(1),n=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let s=e.match(n);if(!s||s.length<3)throw new Error(`The color '${t}' is illegal hex color`);s[0].length===1&&(s=s.map(i=>i+i));const r={r:parseInt(s[0],16),g:parseInt(s[1],16),b:parseInt(s[2],16)};return s.length>3&&(r.a=parseInt(s[3],16)/255),r},Nr=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal rgb color`);const n=t.substring(e+1,t.length-1).split(",");if(n.length<3)throw new Error(`The color '${t}' is illegal rgb color`);const s={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)};return n.length>3&&(s.a=parseFloat(n[3])),s},br=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal hsl color`);const n=t.substring(e+1,t.length-1).split(",");if(n.length<3)throw new Error(`The color '${t}' is illegal hsl color`);const s={h:parseInt(n[0],10),s:parseFloat(n[1]),l:parseFloat(n[2])};return n.length>3&&(s.a=parseFloat(n[3])),s},Lr=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal hsv color`);const n=t.substring(e+1,t.length-1).split(",");if(n.length<3)throw new Error(`The color '${t}' is illegal hsv color`);const s={h:parseInt(n[0],10),s:parseFloat(n[1]),v:parseFloat(n[2])};return n.length>3&&(s.a=parseFloat(n[3])),s},wr=t=>{const e=Cn(t);if(e!=null)return"r"in e?e:"l"in e?vr(e):Dr(e)},ae=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t),vr=t=>{let{h:e,s:n,l:s}=t;e/=360,n/=100,s/=100;let r=0,i=0,o=0;if(n===0)r=i=o=s;else{const h=s<.5?s*(1+n):s+n-s*n,l=2*s-h;r=ae(l,h,e+1/3),i=ae(l,h,e),o=ae(l,h,e-1/3)}const a={r:Math.round(r*255),g:Math.round(i*255),b:Math.round(o*255)};return t.a!==void 0&&(a.a=t.a),a},Dr=t=>{let{h:e,s:n,v:s}=t;e=e/360*6,n/=100,s/=100;const r=Math.floor(e),i=e-r,o=s*(1-n),a=s*(1-i*n),h=s*(1-(1-i)*n),l=r%6,u=[s,a,o,o,h,s][l],d=[h,s,s,a,o,o][l],g=[o,o,h,s,s,a][l],f={r:u*255,g:d*255,b:g*255};return t.a!==void 0&&(f.a=t.a),f},Mr=t=>{let{r:e,g:n,b:s}=t;e/=255,n/=255,s/=255;const r=Math.max(e,n,s),i=Math.min(e,n,s),o=(r+i)/2;let a,h;if(r===i)a=h=0;else{const u=r-i;switch(h=o>.5?u/(2-r-i):u/(r+i),r){case e:a=(n-s)/u+(n<s?6:0);break;case n:a=(s-e)/u+2;break;default:a=(e-n)/u+4;break}a/=6}const l={h:Math.round(a*360),s:Math.round(h*100),l:Math.round(o*100)};return t.a!==void 0&&(l.a=t.a),l},Ur=t=>{let{r:e,g:n,b:s}=t;e/=255,n/=255,s/=255;const r=Math.max(e,n,s),i=Math.min(e,n,s);let o;const a=r,h=r-i,l=r===0?0:h/r;if(r===i)o=0;else{switch(r){case e:o=(n-s)/h+(n<s?6:0);break;case n:o=(s-e)/h+2;break;default:o=(e-n)/h+4;break}o/=6}const u={h:Math.round(o*360),s:Math.round(l*100),v:Math.round(a*100)};return t.a!==void 0&&(u.a=t.a),u},Tr=t=>t==null,Pr=t=>!Tr(t)&&typeof t=="object";var F=(t=>(t[t.COVER=0]="COVER",t[t.REPLACE=1]="REPLACE",t[t.INTERSECTION=2]="INTERSECTION",t))(F||{});let Fr=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");const Hr=/^-ms-/,Br=/-([a-z])/g,Q=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];class O{static stringAt(e){let n="",s=e;for(;s>=Q.length;)s/=Q.length,s-=1,n+=Q[s%Q.length];const r=e%Q.length;return n+=Q[r],n}static indexAt(e){let n=0;for(let s=0;s<e.length-1;s+=1){const r=e.charCodeAt(s)-65,i=e.length-1-s;n+=Q.length**i+Q.length*r}return n+=e.charCodeAt(e.length-1)-65,n}static deleteBlank(e){return O.isString(e)?e.replace(/\s/g,""):e}static getSystemType(){const e=navigator.userAgent,n=navigator.platform==="Win32"||navigator.platform==="Windows",s=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(s)return"Mac";if(navigator.platform==="X11"&&!n&&!s)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(n){if(e.indexOf("Windows NT 5.0")>-1||e.indexOf("Windows 2000")>-1)return"Windows 2000";if(e.indexOf("Windows NT 5.1")>-1||e.indexOf("Windows XP")>-1)return"Windows XP";if(e.indexOf("Windows NT 5.2")>-1||e.indexOf("Windows 2003")>-1)return"Windows 2003";if(e.indexOf("Windows NT 6.0")>-1||e.indexOf("Windows Vista")>-1)return"Windows Vista";if(e.indexOf("Windows NT 6.1")>-1||e.indexOf("Windows 7")>-1)return"Windows 7";if(e.indexOf("Windows NT 10")>-1||e.indexOf("Windows 10")>-1)return"Windows 10";if(e.indexOf("Windows NT 11")>-1||e.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const e=navigator.userAgent,n=e.indexOf("Opera")>-1,s=e.indexOf("compatible")>-1&&e.indexOf("MSIE")>-1&&!n,r=e.indexOf("Trident")>-1&&e.indexOf("rv:11.0")>-1,i=e.indexOf("Edge")>-1,o=e.indexOf("Firefox")>-1,a=e.indexOf("Safari")>-1&&e.indexOf("Chrome")===-1,h=e.indexOf("Chrome")>-1&&e.indexOf("Safari")>-1;if(s){new RegExp("MSIE (\\d+\\.\\d+);").test(e);const u=parseFloat(RegExp.$1);return u===7?"IE7":u===8?"IE8":u===9?"IE9":u===10?"IE10":"0"}return o?"FF":n?"Opera":a?"Safari":h?"Chrome":i?"Edge":r?"IE11":"Unknown browser"}static generateRandomId(e=21){return Fr(e)}static getClassName(e){return e.constructor.name}static deepMerge(e,...n){n.forEach(o=>o&&i(o));function s(o,a){o.forEach((h,l)=>{if(O.isArray(h)){const u=a[l]??[];a[l]=u,s(h,u);return}if(O.isObject(h)){const u=a[l]??{};a[l]=u,r(h,u);return}a[l]=h})}function r(o,a){Object.keys(o).forEach(h=>{const l=o[h];if(O.isObject(l)){const u=a[h]??{};a[h]=u,r(l,u);return}if(O.isArray(l)){const u=a[h]??[];a[h]=u,s(l,u);return}a[h]=l})}function i(o){Object.keys(o).forEach(a=>{const h=o[a];if(O.isArray(h)){const l=e[a]??[];e[a]=l,s(h,l);return}if(O.isObject(h)){const l=e[a]??{};e[a]=l,r(h,l);return}e[a]=h})}return e}static numberFixed(e,n){return Number(Number(e).toFixed(n))}static diffValue(e,n){function s(o,a){const h=O.getValueType(o),l=O.getValueType(a);return h!==l?!1:O.isArray(o)?r(o,a):O.isObject(o)?i(o,a):O.isDate(o)?o.getTime()===a.getTime():O.isRegExp(o)?o.toString()===a.toString():o===a}function r(o,a){if(e.length!==n.length)return!1;for(let h=0,l=o.length;h<l;h++){const u=o[h],d=a[h];if(!s(u,d))return!1}return!0}function i(o,a){const h=Object.keys(o),l=Object.keys(a);if(h.length!==l.length)return!1;for(const u of h){if(!l.includes(u))return!1;const d=o[u],g=a[u];if(!s(d,g))return!1}return!0}return s(e,n)}static deepClone(e){if(!this.isDefine(e))return e;if(this.isRegExp(e))return new RegExp(e);if(this.isDate(e))return new Date(e);if(this.isArray(e)){const n=[];return e.forEach((s,r)=>{n[r]=O.deepClone(s)}),n}if(this.isObject(e)){const n={};return Object.keys(e).forEach(s=>{const r=e[s];n[s]=O.deepClone(r)}),Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}return e}static getLanguage(){const e="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||e}static getValueType(e){return Object.prototype.toString.apply(e)}static isDefine(e){return e!=null}static isBlank(e){return this.isDefine(e)?this.isString(e)?e.trim()==="":!1:!0}static isAssignableFrom(e,n){return e instanceof n}static isBoolean(e){return this.getValueType(e)==="[object Boolean]"}static isPlainObject(e){return this.isDefine(e)?Object.getPrototypeOf(e)===Object.getPrototypeOf({}):!1}static isFunction(e){return this.getValueType(e)==="[object Function]"}static isDate(e){return this.getValueType(e)==="[object Date]"}static isRegExp(e){return this.getValueType(e)==="[object RegExp]"}static isArray(e){return this.getValueType(e)==="[object Array]"}static isString(e){return this.getValueType(e)==="[object String]"}static isNumber(e){return this.getValueType(e)==="[object Number]"}static isStringNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}static isObject(e){return this.getValueType(e)==="[object Object]"}static isEmptyObject(e){for(const n in e)return!1;return!0}static isMobile(){let e=0,n=0;return document.body.clientWidth&&(e=document.body.clientWidth),document.body.clientHeight&&(n=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||e<350&&n<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const e=navigator.userAgent.toLowerCase();return String(e.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const e=navigator.userAgent;return e.indexOf("Android")>-1||e.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static itCount(e){return n=>{for(let s=0;s<e;s++)n&&n()}}static hasLength(e,n){return O.isDefine(e)?O.isDefine(n)?e.length===n:e.length>0:!1}static capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}static fCamelCase(e,n){return n.toUpperCase()}static camelCase(e){return e.replace(Hr,"ms-").replace(Br,this.fCamelCase)}static removeNull(e){return this.isObject(e)&&Object.keys(e).forEach(n=>{const s=e[n];s==null?delete e[n]:O.removeNull(s)}),e}static fillTwoDimensionalArray(e,n,s){return new Array(e).fill(s).map(r=>new Array(n).fill(s))}static numToWord(e){let n="";for(;e>0;){let s=e%26;s=s===0?s=26:s,n=String.fromCharCode(96+s)+n,e=(e-s)/26}return n.toLocaleUpperCase()}static ABCatNum(e){if(e==null||e.length===0)return NaN;const n=e.toLowerCase().split(""),s=n.length;let r=0,i=0;for(let o=0;o<s;o++)i=n[o].charCodeAt(0)-96,r+=i*26**(s-o-1);return r===0?NaN:r-1}static chatAtABC(e){let i="";for(;e>=0;)i=String.fromCharCode(e%26+97)+i,e=Math.floor(e/26)-1;return i.toUpperCase()}static randSort(e){for(let n=0,s=e.length;n<s;n++){const r=parseInt((Math.random()*s).toString()),i=e[r];e[r]=e[n],e[n]=i}return e}static commonExtend(e,n){const s={};for(const r in e)s[r]=e[r];for(const r in n)n[r]!=null&&(s[r]=n[r]);return s}static commonExtend1(e,n){for(const s in e)n[s]==null&&(n[s]=e[s]);return n}static arrayToObject(e){const n={};return e.forEach((s,r)=>{n[r]={},s.forEach((i,o)=>{n[r][o]=i})}),n}static hasIntersectionBetweenTwoRanges(e,n,s,r){return n>=s&&r>=e}}function Wr(t){if(!t)return;const{actualRow:e,actualColumn:n,isMerged:s,isMergedMainCell:r,mergeInfo:i}=t;let{startY:o,endY:a,startX:h,endX:l}=t,u=e,d=n,g=e,f=n;if(s&&i){const{startRow:E,startColumn:R,endRow:m,endColumn:I,startY:S,endY:v,startX:W,endX:B}=i;u=E,d=R,g=m,f=I,o=S,a=v,h=W,l=B}return r&&(o=i.startY,a=i.endY,h=i.startX,l=i.endX,g=i.endRow,f=i.endColumn),{startRow:u,startColumn:d,endRow:g,endColumn:f,startY:o,endY:a,startX:h,endX:l}}function $r(t){if(!t)return;const{actualRow:e,actualColumn:n,isMerged:s,isMergedMainCell:r,startRow:i,startColumn:o,endRow:a,endColumn:h}=t;let l=e,u=n,d=e,g=n;return(s||r)&&(l=i,u=o,d=a,g=h),{startRow:l,startColumn:u,endRow:d,endColumn:g}}function Gr(t){var n;return!t||(((n=t==null?void 0:t.v)==null?void 0:n.toString())||"").length===0&&!t.p}function j(t){if(t){if(t.rgb)return t.rgb;if(t.th)return new Bt().setThemeColor(t.th).asThemeColor().asRgbColor().getCssString()}return null}function kr(t){return O.isString(t)&&t.substring(0,1)==="="&&t.length>1}function xr(t){return O.isString(t)&&t.indexOf("=")===-1&&t.length===6}function Vr(t){return""}function pr(t,e=!1){var i;let n="";const s=new Map([["ff",()=>{t.ff&&(n+=`font-family: ${t.ff}; `)}],["fs",()=>{if(t.fs){let o=t.fs;t.va&&(o/=2),n+=`font-size: ${o}pt; `}}],["it",()=>{t.it&&(n+="font-style: italic; ")}],["bl",()=>{t.bl&&(n+="font-weight: bold; ")}],["ul",()=>{var o;(o=t.ul)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," underline"):n+="text-decoration-line: underline; ",t.ul.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${j(t.ul.cl)}; `),t.ul.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${t.ul.t} `))}],["st",()=>{var o;(o=t.st)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," line-through"):n+="text-decoration-line: line-through; ",t.st.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${j(t.st.cl)}; `),t.st.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${t.st.t} `))}],["ol",()=>{var o;(o=t.ol)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," overline"):n+="text-decoration-line: overline; ",t.ol.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${j(t.ol.cl)}; `),t.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${t.ol.t} `))}],["bg",()=>{t.bg&&(n+=`background: ${j(t.bg)}; `)}],["bd",()=>{var o,a,h,l,u,d,g,f;(o=t.bd)!=null&&o.b&&(n+=`border-bottom: ${kt((a=t.bd)==null?void 0:a.b.s)} ${j(t.bd.b.cl)??""}; `),(h=t.bd)!=null&&h.t&&(n+=`border-top: ${kt((l=t.bd)==null?void 0:l.t.s)} ${j(t.bd.t.cl)??""}; `),(u=t.bd)!=null&&u.r&&(n+=`border-right: ${kt((d=t.bd)==null?void 0:d.r.s)} ${j(t.bd.r.cl)??""}; `),(g=t.bd)!=null&&g.l&&(n+=`border-left: ${kt((f=t.bd)==null?void 0:f.l.s)} ${j(t.bd.l.cl)??""}; `)}],["cl",()=>{t.cl&&(n+=`color: ${j(t.cl)}; `)}],["va",()=>{t.va===Ft.SUBSCRIPT?n+="vertical-align: sub; ":t.va===Ft.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{t.td===Ot.LEFT_TO_RIGHT?n+="direction: ltr; ":t.td===Ot.RIGHT_TO_LEFT&&(n+="direction: rtl; ")}],["tr",()=>{var o,a,h;t.tr&&(n+=`data-rotate: (${(o=t.tr)==null?void 0:o.a}deg${(a=t.tr)!=null&&a.v?` ,${(h=t.tr)==null?void 0:h.v}`:""});`)}],["ht",()=>{t.ht===rt.LEFT?n+="text-align: left; ":t.ht===rt.RIGHT?n+="text-align: right; ":t.ht===rt.CENTER?n+="text-align: center; ":t.ht===rt.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{t.vt===ut.BOTTOM?n+="vertical-align: bottom; ":t.vt===ut.TOP?n+="vertical-align: top; ":t.vt===ut.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{t.tb===ct.CLIP?n+="text-overflow: clip; ":t.tb===ct.OVERFLOW?n+="text-break: overflow; ":t.tb===ct.WRAP&&(n+="word-wrap: break-word;")}],["pd",()=>{var u,d,g,f,E,R,m,I;const o=`${(u=t.pd)==null?void 0:u.b}pt`,a=`${(d=t.pd)==null?void 0:d.t}pt`,h=`${(g=t.pd)==null?void 0:g.l}pt`,l=`${(f=t.pd)==null?void 0:f.r}pt`;(E=t.pd)!=null&&E.b&&(n+=`padding-bottom: ${o}; `),(R=t.pd)!=null&&R.t&&(n+=`padding-top: ${a}; `),(m=t.pd)!=null&&m.l&&(n+=`padding-left: ${h}; `),(I=t.pd)!=null&&I.r&&(n+=`padding-right: ${l}; `)}]]),r=["bd","tr","tb"];for(const o in t)e&&r.includes(o)||(i=s.get(o))==null||i();return n}function kt(t){let e="";return t===L.NONE?e="none":t===L.THIN?e="0.5pt solid":t===L.HAIR?e="0.5pt double":t===L.DOTTED?e="0.5pt dotted":t===L.DASHED||t===L.DASH_DOT?e="0.5pt dashed":t===L.DASH_DOT_DOT?e="0.5pt dotted":t===L.DOUBLE?e="0.5pt double":t===L.MEDIUM?e="1pt solid":t===L.MEDIUM_DASHED||t===L.MEDIUM_DASH_DOT?e="1pt dashed":t===L.MEDIUM_DASH_DOT_DOT?e="1pt dotted":t===L.SLANT_DASH_DOT?e="0.5pt dashed":t===L.THICK&&(e="1.5pt solid"),e}function jr(t){let e=0;if(t=t.trim(),t==="none")e=L.NONE;else if(t==="0.5pt solid")e=L.THIN;else if(t==="0.5pt double")e=L.HAIR;else if(t==="0.5pt dotted")e=L.DOTTED;else if(t==="0.5pt dashed")e=L.DASHED;else if(t==="1pt solid")e=L.MEDIUM;else if(t==="1pt dashed")e=L.MEDIUM_DASHED;else if(t==="1pt dotted")e=L.MEDIUM_DASH_DOT_DOT;else if(t==="1.5pt solid")e=L.THICK;else return L.NONE;return e}function xt(t,e){let n=t.body;if(e){const{headers:s,footers:r}=t;s!=null&&s[e]?n=s[e].body:r!=null&&r[e]&&(n=r[e].body)}return n}function zr(t){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=t;return!(e<0||s<0||n<0||r<0)}function le(t,e){return Object.prototype.toString.call(t)===Object.prototype.toString.call(e)?Object.prototype.toString.call(t)==="[object Object]"||Object.prototype.toString.call(t)==="[object Array]"?Object.keys(t).length!==Object.keys(e).length?!1:Object.keys(t).every(n=>le(t[n],e[n])):t===e:!1}function Sn(t,e){const n=t.ts||{},s=e.ts||{};return t.sId!==e.sId?!1:le(n,s)}function ue(t,e,n,s){if(t>e&&([t,e]=[e,t]),n>s&&([n,s]=[s,n]),e<n||s<t)return[t,e];n<t&&(n=t),s>e&&(s=e);const r=s-n+1;let i=[];return t===n?i=[s+1-r,e-r]:e===s?i=[t,n-1]:i=[t,e-r],i}function Yr(t){if(t==null)return!1;const e=t.bullet;return(e==null?void 0:e.listId)!=null}function Kr(t){if(t==null)return!1;const e=t.paragraphStyle;return Nn(e)}function Nn(t){return!(t==null||(t.indentStart==null||t.indentStart===0)&&t.hanging==null||t.hanging===0)}function bn(t,e,n){return t.slice(0,e)+n+t.slice(e)}function Ln(t,e,n){return e>n?t:t.slice(0,e)+t.slice(n)}var Xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wn={exports:{}};/*! @preserve
|
|
4
4
|
* numeral.js
|
|
5
5
|
* version : 2.0.6
|
|
6
6
|
* author : Adam Draper
|
|
7
7
|
* license : MIT
|
|
8
8
|
* http://adamwdraper.github.com/Numeral-js/
|
|
9
|
-
*/(function(t){(function(e,n){t.exports?t.exports=n():e.numeral=n()})(Zr,function(){var e,n,s="2.0.6",r={},i={},o={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},a={currentLocale:o.currentLocale,zeroFormat:o.zeroFormat,nullFormat:o.nullFormat,defaultFormat:o.defaultFormat,scalePercentBy100:o.scalePercentBy100};function h(l,u){this._input=l,this._value=u}return e=function(l){var u,_,g,f;if(e.isNumeral(l))u=l.value();else if(l===0||typeof l>"u")u=0;else if(l===null||n.isNaN(l))u=null;else if(typeof l=="string")if(a.zeroFormat&&l===a.zeroFormat)u=0;else if(a.nullFormat&&l===a.nullFormat||!l.replace(/[^0-9]+/g,"").length)u=null;else{for(_ in r)if(f=typeof r[_].regexps.unformat=="function"?r[_].regexps.unformat():r[_].regexps.unformat,f&&l.match(f)){g=r[_].unformat;break}g=g||e._.stringToNumber,u=g(l)}else u=Number(l)||null;return new h(l,u)},e.version=s,e.isNumeral=function(l){return l instanceof h},e._=n={numberToFormat:function(l,u,_){var g=i[e.options.currentLocale],f=!1,E=!1,R=0,m="",I=1e12,S=1e9,v=1e6,W=1e3,B="",Et=!1,G,nt,P,V,He,ys,X;if(l=l||0,nt=Math.abs(l),e._.includes(u,"(")?(f=!0,u=u.replace(/[\(|\)]/g,"")):(e._.includes(u,"+")||e._.includes(u,"-"))&&(He=e._.includes(u,"+")?u.indexOf("+"):l<0?u.indexOf("-"):-1,u=u.replace(/[\+|\-]/g,"")),e._.includes(u,"a")&&(G=u.match(/a(k|m|b|t)?/),G=G?G[1]:!1,e._.includes(u," a")&&(m=" "),u=u.replace(new RegExp(m+"a[kmbt]?"),""),nt>=I&&!G||G==="t"?(m+=g.abbreviations.trillion,l=l/I):nt<I&&nt>=S&&!G||G==="b"?(m+=g.abbreviations.billion,l=l/S):nt<S&&nt>=v&&!G||G==="m"?(m+=g.abbreviations.million,l=l/v):(nt<v&&nt>=W&&!G||G==="k")&&(m+=g.abbreviations.thousand,l=l/W)),e._.includes(u,"[.]")&&(E=!0,u=u.replace("[.]",".")),P=l.toString().split(".")[0],V=u.split(".")[1],ys=u.indexOf(","),R=(u.split(".")[0].split(",")[0].match(/0/g)||[]).length,V?(e._.includes(V,"[")?(V=V.replace("]",""),V=V.split("["),B=e._.toFixed(l,V[0].length+V[1].length,_,V[1].length)):B=e._.toFixed(l,V.length,_),P=B.split(".")[0],e._.includes(B,".")?B=g.delimiters.decimal+B.split(".")[1]:B="",E&&Number(B.slice(1))===0&&(B="")):P=e._.toFixed(l,0,_),m&&!G&&Number(P)>=1e3&&m!==g.abbreviations.trillion)switch(P=String(Number(P)/1e3),m){case g.abbreviations.thousand:m=g.abbreviations.million;break;case g.abbreviations.million:m=g.abbreviations.billion;break;case g.abbreviations.billion:m=g.abbreviations.trillion;break}if(e._.includes(P,"-")&&(P=P.slice(1),Et=!0),P.length<R)for(var tr=R-P.length;tr>0;tr--)P="0"+P;return ys>-1&&(P=P.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+g.delimiters.thousands)),u.indexOf(".")===0&&(P=""),X=P+B+(m||""),f?X=(f&&Et?"(":"")+X+(f&&Et?")":""):He>=0?X=He===0?(Et?"-":"+")+X:X+(Et?"-":"+"):Et&&(X="-"+X),X},stringToNumber:function(l){var u=i[a.currentLocale],_=l,g={thousand:3,million:6,billion:9,trillion:12},f,E,R;if(a.zeroFormat&&l===a.zeroFormat)E=0;else if(a.nullFormat&&l===a.nullFormat||!l.replace(/[^0-9]+/g,"").length)E=null;else{E=1,u.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(u.delimiters.decimal,"."));for(f in g)if(R=new RegExp("[^a-zA-Z]"+u.abbreviations[f]+"(?:\\)|(\\"+u.currency.symbol+")?(?:\\))?)?$"),_.match(R)){E*=Math.pow(10,g[f]);break}E*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),E*=Number(l)}return E},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,u){return l.indexOf(u)!==-1},insert:function(l,u,_){return l.slice(0,_)+u+l.slice(_)},reduce:function(l,u){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof u!="function")throw new TypeError(u+" is not a function");var _=Object(l),g=_.length>>>0,f=0,E;if(arguments.length===3)E=arguments[2];else{for(;f<g&&!(f in _);)f++;if(f>=g)throw new TypeError("Reduce of empty array with no initial value");E=_[f++]}for(;f<g;f++)f in _&&(E=u(E,_[f],f,_));return E},multiplier:function(l){var u=l.toString().split(".");return u.length<2?1:Math.pow(10,u[1].length)},correctionFactor:function(){var l=Array.prototype.slice.call(arguments);return l.reduce(function(u,_){var g=n.multiplier(_);return u>g?u:g},1)},toFixed:function(l,u,_,g){var f=l.toString().split("."),E=u-(g||0),R,m,I,S;return f.length===2?R=Math.min(Math.max(f[1].length,E),u):R=E,I=Math.pow(10,R),S=(_(l+"e+"+R)/I).toFixed(R),g>u-R&&(m=new RegExp("\\.?0{1,"+(g-(u-R))+"}$"),S=S.replace(m,"")),S}},e.options=a,e.formats=r,e.locales=i,e.locale=function(l){return l&&(a.currentLocale=l.toLowerCase()),a.currentLocale},e.localeData=function(l){if(!l)return i[a.currentLocale];if(l=l.toLowerCase(),!i[l])throw new Error("Unknown locale : "+l);return i[l]},e.reset=function(){for(var l in o)a[l]=o[l]},e.zeroFormat=function(l){a.zeroFormat=typeof l=="string"?l:null},e.nullFormat=function(l){a.nullFormat=typeof l=="string"?l:null},e.defaultFormat=function(l){a.defaultFormat=typeof l=="string"?l:"0.0"},e.register=function(l,u,_){if(u=u.toLowerCase(),this[l+"s"][u])throw new TypeError(u+" "+l+" already registered.");return this[l+"s"][u]=_,_},e.validate=function(l,u){var _,g,f,E,R,m,I,S;if(typeof l!="string"&&(l+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",l)),l=l.trim(),l.match(/^\d+$/))return!0;if(l==="")return!1;try{I=e.localeData(u)}catch{I=e.localeData(e.locale())}return f=I.currency.symbol,R=I.abbreviations,_=I.delimiters.decimal,I.delimiters.thousands==="."?g="\\.":g=I.delimiters.thousands,S=l.match(/^[^\d]+/),S!==null&&(l=l.substr(1),S[0]!==f)||(S=l.match(/[^\d]+$/),S!==null&&(l=l.slice(0,-1),S[0]!==R.thousand&&S[0]!==R.million&&S[0]!==R.billion&&S[0]!==R.trillion))?!1:(m=new RegExp(g+"{2}"),l.match(/[^\d.,]/g)?!1:(E=l.split(_),E.length>2?!1:E.length<2?!!E[0].match(/^\d+.*\d$/)&&!E[0].match(m):E[0].length===1?!!E[0].match(/^\d+$/)&&!E[0].match(m)&&!!E[1].match(/^\d+$/):!!E[0].match(/^\d+.*\d$/)&&!E[0].match(m)&&!!E[1].match(/^\d+$/)))},e.fn=h.prototype={clone:function(){return e(this)},format:function(l,u){var _=this._value,g=l||a.defaultFormat,f,E,R;if(u=u||Math.round,_===0&&a.zeroFormat!==null)E=a.zeroFormat;else if(_===null&&a.nullFormat!==null)E=a.nullFormat;else{for(f in r)if(g.match(r[f].regexps.format)){R=r[f].format;break}R=R||e._.numberToFormat,E=R(_,g,u)}return E},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var u=n.correctionFactor.call(null,this._value,l);function _(g,f,E,R){return g+Math.round(u*f)}return this._value=n.reduce([this._value,l],_,0)/u,this},subtract:function(l){var u=n.correctionFactor.call(null,this._value,l);function _(g,f,E,R){return g-Math.round(u*f)}return this._value=n.reduce([l],_,Math.round(this._value*u))/u,this},multiply:function(l){function u(_,g,f,E){var R=n.correctionFactor(_,g);return Math.round(_*R)*Math.round(g*R)/Math.round(R*R)}return this._value=n.reduce([this._value,l],u,1),this},divide:function(l){function u(_,g,f,E){var R=n.correctionFactor(_,g);return Math.round(_*R)/Math.round(g*R)}return this._value=n.reduce([this._value,l],u),this},difference:function(l){return Math.abs(e(this._value).subtract(l).value())}},e.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(l){var u=l%10;return~~(l%100/10)===1?"th":u===1?"st":u===2?"nd":u===3?"rd":"th"},currency:{symbol:"$"}}),function(){e.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(l,u,_){var g=e._.includes(u," BPS")?" ":"",f;return l=l*1e4,u=u.replace(/\s?BPS/,""),f=e._.numberToFormat(l,u,_),e._.includes(f,")")?(f=f.split(""),f.splice(-1,0,g+"BPS"),f=f.join("")):f=f+g+"BPS",f},unformat:function(l){return+(e._.stringToNumber(l)*1e-4).toFixed(15)}})}(),function(){var l={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},u={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},_=l.suffixes.concat(u.suffixes.filter(function(f){return l.suffixes.indexOf(f)<0})),g=_.join("|");g="("+g.replace("B","B(?!PS)")+")",e.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(g)},format:function(f,E,R){var m,I=e._.includes(E,"ib")?u:l,S=e._.includes(E," b")||e._.includes(E," ib")?" ":"",v,W,B;for(E=E.replace(/\s?i?b/,""),v=0;v<=I.suffixes.length;v++)if(W=Math.pow(I.base,v),B=Math.pow(I.base,v+1),f===null||f===0||f>=W&&f<B){S+=I.suffixes[v],W>0&&(f=f/W);break}return m=e._.numberToFormat(f,E,R),m+S},unformat:function(f){var E=e._.stringToNumber(f),R,m;if(E){for(R=l.suffixes.length-1;R>=0;R--){if(e._.includes(f,l.suffixes[R])){m=Math.pow(l.base,R);break}if(e._.includes(f,u.suffixes[R])){m=Math.pow(u.base,R);break}}E*=m||1}return E}})}(),function(){e.register("format","currency",{regexps:{format:/(\$)/},format:function(l,u,_){var g=e.locales[e.options.currentLocale],f={before:u.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:u.match(/([\+|\-|\)|\s|\$]*)$/)[0]},E,R,m;for(u=u.replace(/\s?\$\s?/,""),E=e._.numberToFormat(l,u,_),l>=0?(f.before=f.before.replace(/[\-\(]/,""),f.after=f.after.replace(/[\-\)]/,"")):l<0&&!e._.includes(f.before,"-")&&!e._.includes(f.before,"(")&&(f.before="-"+f.before),m=0;m<f.before.length;m++)switch(R=f.before[m],R){case"$":E=e._.insert(E,g.currency.symbol,m);break;case" ":E=e._.insert(E," ",m+g.currency.symbol.length-1);break}for(m=f.after.length-1;m>=0;m--)switch(R=f.after[m],R){case"$":E=m===f.after.length-1?E+g.currency.symbol:e._.insert(E,g.currency.symbol,-(f.after.length-(1+m)));break;case" ":E=m===f.after.length-1?E+" ":e._.insert(E," ",-(f.after.length-(1+m)+g.currency.symbol.length-1));break}return E}})}(),function(){e.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,u,_){var g,f=typeof l=="number"&&!e._.isNaN(l)?l.toExponential():"0e+0",E=f.split("e");return u=u.replace(/e[\+|\-]{1}0/,""),g=e._.numberToFormat(Number(E[0]),u,_),g+"e"+E[1]},unformat:function(l){var u=e._.includes(l,"e+")?l.split("e+"):l.split("e-"),_=Number(u[0]),g=Number(u[1]);g=e._.includes(l,"e-")?g*=-1:g;function f(E,R,m,I){var S=e._.correctionFactor(E,R),v=E*S*(R*S)/(S*S);return v}return e._.reduce([_,Math.pow(10,g)],f,1)}})}(),function(){e.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,u,_){var g=e.locales[e.options.currentLocale],f,E=e._.includes(u," o")?" ":"";return u=u.replace(/\s?o/,""),E+=g.ordinal(l),f=e._.numberToFormat(l,u,_),f+E}})}(),function(){e.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,u,_){var g=e._.includes(u," %")?" ":"",f;return e.options.scalePercentBy100&&(l=l*100),u=u.replace(/\s?\%/,""),f=e._.numberToFormat(l,u,_),e._.includes(f,")")?(f=f.split(""),f.splice(-1,0,g+"%"),f=f.join("")):f=f+g+"%",f},unformat:function(l){var u=e._.stringToNumber(l);return e.options.scalePercentBy100?u*.01:u}})}(),function(){e.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(l,u,_){var g=Math.floor(l/60/60),f=Math.floor((l-g*60*60)/60),E=Math.round(l-g*60*60-f*60);return g+":"+(f<10?"0"+f:f)+":"+(E<10?"0"+E:E)},unformat:function(l){var u=l.split(":"),_=0;return u.length===3?(_=_+Number(u[0])*60*60,_=_+Number(u[1])*60,_=_+Number(u[2])):u.length===2&&(_=_+Number(u[0])*60,_=_+Number(u[1])),Number(_)}})}(),e})})(vn);var Jr=vn.exports;const it=qr(Jr),ue={v:"#VALUE!",n:"#NAME?",na:"#N/A",r:"#REF!",d:"#DIV/0!",nm:"#NUM!",nl:"#NULL!",sp:"#SPILL!"};function yr(t){let e=!1;for(const n in ue)if(t===ue[n]){e=!0;break}return e}function ot(t){return t===null||t.toString().replace(/\s/g,"")===""||typeof t=="boolean"?!1:!isNaN(t)}function ti(t){if(t===null||t.toString().length<5)return!1;if(e(t))return!0;return!1;function e(n){const s=/^(\d{4})-(\d{1,2})-(\d{1,2})(\s(\d{1,2}):(\d{1,2})(:(\d{1,2}))?)?$/,r=/^(\d{4})\/(\d{1,2})\/(\d{1,2})(\s(\d{1,2}):(\d{1,2})(:(\d{1,2}))?)?$/;if(!s.test(n)&&!r.test(n))return!1;const i=RegExp.$1,o=RegExp.$2,a=RegExp.$3;return!(i<1900||o>12||a>31||o===2&&(new Date(i,1,29).getDate()===29&&a>29||new Date(i,1,29).getDate()!==29&&a>28))}}let Vt=new Date("2017-02-19T19:06:09.000Z");Number.isNaN(Vt.getFullYear())&&(Vt=new Date("2/19/17"));const ei=Vt.getFullYear()===2017;function ni(t,e){const n=new Date(t);if(ei)return e>0?n.setTime(n.getTime()+n.getTimezoneOffset()*60*1e3):e<0&&n.setTime(n.getTime()-n.getTimezoneOffset()*60*1e3),n;if(t instanceof Date)return t;if(Vt.getFullYear()===1917&&!Number.isNaN(n.getFullYear())){const i=n.getFullYear();return t.indexOf(`${i}`)>-1||n.setFullYear(n.getFullYear()+100),n}const s=t.match(/\d+/g)||["2017","2","19","0","0","0"];let r=new Date(+s[0],+s[1]-1,+s[2],+s[3]||0,+s[4]||0,+s[5]||0);return t.indexOf("Z")>-1&&(r=new Date(r.getTime()-r.getTimezoneOffset()*60*1e3)),r}const si=new Date(1900,2,1,0,0,0);function Dn(t,e){let n=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());const s=Date.UTC(1899,11,31,0,0,0);return e?n-=1461*24*60*60*1e3:t>=si&&(n+=24*60*60*1e3),(n-s)/(24*60*60*1e3)}function ri(t){let e=null,n={},s=t;if(t===null)return null;if(/^-?[0-9]{1,}[,][0-9]{3}(.[0-9]{1,2})?$/.test(t)){e=t,s=Number(t.split(".")[0].replace(",",""));let r="#,##0";if(t.split(".")[1]){r="#,##0.";for(let i=0;i<t.split(".")[1].length;i++)r+=0}n={fa:r,t:"n"}}else if(t.toString().substr(0,1)==="'")e=t.toString().substr(1),n={fa:"@",t:"s"};else if(t.toString().toUpperCase()==="TRUE")e="TRUE",n={fa:"General",t:"b"},s=!0;else if(t.toString().toUpperCase()==="FALSE")e="FALSE",n={fa:"General",t:"b"},s=!1;else if(yr(t))e=t.toString(),n={fa:"General",t:"e"};else if(/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(t))e=t.toString(),n={fa:"@",t:"s"};else if(ot(t)&&Math.abs(parseFloat(t))>0&&(Math.abs(parseFloat(t))>=1e11||Math.abs(parseFloat(t))<1e-9)){s=it(t).value();const r=s.toExponential();if(r.indexOf(".")>-1){let i=r.split(".")[1].split("e")[0].length;i>5&&(i=5),n={fa:`#0.${new Array(i+1).join("0")}E+00`,t:"n"}}else n={fa:"#0.E+00",t:"n"};e=q.format(n.fa,s)}else if(t.toString().indexOf("%")>-1){const r=t.toString().indexOf("%"),i=t.toString().substr(0,r),o=i.replace(/,/g,"");if(r===t.toString().length-1&&ot(o))if(i.indexOf(".")>-1)if(i.indexOf(".")===i.lastIndexOf(".")){const a=i.split(".")[0];let l=i.split(".")[1].length;if(l>9&&(l=9),a.indexOf(",")>-1){let u=!0;const _=a.split(",");for(let g=1;g<_.length;g++)if(_[g].length<3){u=!1;break}u?(n={fa:`#,##0.${new Array(l+1).join("0")}%`,t:"n"},s=it(t).value(),e=q.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else n={fa:`0.${new Array(l+1).join("0")}%`,t:"n"},s=it(t).value(),e=q.format(n.fa,s)}else e=t.toString(),n={fa:"@",t:"s"};else if(i.indexOf(",")>-1){let a=!0;const h=i.split(",");for(let l=1;l<h.length;l++)if(h[l].length<3){a=!1;break}a?(n={fa:"#,##0%",t:"n"},s=it(t).value(),e=q.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else n={fa:"0%",t:"n"},s=it(t).value(),e=q.format(n.fa,s);else e=t.toString(),n={fa:"@",t:"s"}}else if(t.toString().indexOf(".")>-1)if(t.toString().indexOf(".")===t.toString().lastIndexOf(".")){const r=t.toString().split(".")[0],i=t.toString().split(".")[1];let o=i.length;if(o>9&&(o=9),r.indexOf(",")>-1){let a=!0;const h=r.split(",");for(let l=1;l<h.length;l++)if(!ot(h[l])||h[l].length<3){a=!1;break}a?(n={fa:`#,##0.${new Array(o+1).join("0")}`,t:"n"},s=it(t).value(),e=q.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else ot(r)&&ot(i)?(n={fa:`0.${new Array(o+1).join("0")}`,t:"n"},s=it(t).value(),e=q.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else e=t.toString(),n={fa:"@",t:"s"};else ot(t)?(e=t.toString(),n={fa:"General",t:"n"},s=parseFloat(t)):ti(t)&&(t.toString().indexOf(".")>-1||t.toString().indexOf(":")>-1||t.toString().length<16)?(s=Dn(ni(t.toString().replace(/-/g,"/"))),s.toString().indexOf(".")>-1?t.toString().length>18?n.fa="yyyy-MM-dd hh:mm:ss":t.toString().length>11?n.fa="yyyy-MM-dd hh:mm":n.fa="yyyy-MM-dd":n.fa="yyyy-MM-dd",n.t="d",e=q.format(n.fa,s)):(e=t,n.fa="General",n.t="g");return[e,n,s]}const q={format(t,e){}},ii=(t,e)=>{};function oi(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+(e<<6)+(e<<16)-e;return e>>>0}class It{static hasLength(e,n){return e.length===n}static getValueType(e){return Object.prototype.toString.apply(e)}static isObject(e){return this.getValueType(e)==="[object Object]"}static isIterable(e){return e[Symbol.iterator]!=null}static isNumber(e){return this.getValueType(e)==="[object Number]"}}const b=Symbol("newer"),U=Symbol("older");class Tn{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[b],{done:!1,value:e.key}):{done:!0,value:void 0}}}class Un{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[b],{done:!1,value:e.value}):{done:!0,value:void 0}}}class Mn{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[b],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}}}class ce{constructor(e,n){d(this,"key");d(this,"value");d(this,Bo);d(this,Wo);this.key=e,this.value=n,this[b]=void 0,this[U]=void 0}toJSON(){return{key:this.key,value:this.value}}}Bo=b,Wo=U;class Pn{constructor(...e){d(this,"_keymap");d(this,"size",0);d(this,"limit");d(this,"oldest");d(this,"newest");d(this,"_onShiftListeners",[]);if(It.hasLength(e,1)){if(It.isNumber(e[0])){const n=e[0];this._initialize(n,void 0);return}if(It.isIterable(e[0])){const n=e[0];this._initialize(0,n);return}return}if(It.hasLength(e,2)){const n=e[0],s=e[1];this._initialize(n,s)}}onShift(e){if(this._onShiftListeners.indexOf(e)===-1)return this._onShiftListeners.push(e),D(()=>Q(this._onShiftListeners,e));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(e,n){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=e,this._keymap=new Map,n&&(this.assign(n),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[b]&&(e===this.oldest&&(this.oldest=e[b]),e[b][U]=e[U]),e[U]&&(e[U][b]=e[b]),e[b]=void 0,e[U]=this.newest,this.newest&&(this.newest[b]=e),this.newest=e)}assign(e){let n,s=this.limit||Number.MAX_VALUE;this._keymap.clear();const r=e[Symbol.iterator]();for(let i=r.next();!i.done;i=r.next()){const o=new ce(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[b]=o,o[U]=n):this.oldest=o,n=o,s--===0)throw new Error("overflow")}this.newest=n,this.size=this._keymap.size}set(e,n){let s=this._keymap.get(e);return s?(s.value=n,this._markEntryAsUsed(s),this):(this._keymap.set(e,s=new ce(e,n)),this.newest?(this.newest[b]=s,s[U]=this.newest):this.oldest=s,this.newest=s,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const e=this.oldest;if(e)return this.oldest&&this.oldest[b]?(this.oldest=this.oldest[b],this.oldest[U]=void 0):(this.oldest=void 0,this.newest=void 0),e[b]=e[U]=void 0,this._keymap.delete(e.key),--this.size,this._onShiftListeners.forEach(n=>n(e)),[e.key,e.value]}get(e){const n=this._keymap.get(e);if(n)return this._markEntryAsUsed(n),n.value}has(e){return this._keymap.has(e)}find(e){const n=this._keymap.get(e);return n?n.value:void 0}delete(e){const n=this._keymap.get(e);if(n)return this._keymap.delete(n.key),n[b]&&n[U]?(n[U][b]=n[b],n[b][U]=n[U]):n[b]?(n[b][U]=void 0,this.oldest=n[b]):n[U]?(n[U][b]=void 0,this.newest=n[U]):this.oldest=this.newest=void 0,this.size--,n.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new Tn(this.oldest)}values(){return new Un(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new Mn(this.oldest)}forEach(e,n){typeof n!="object"&&(n=this);let s=this.oldest;for(;s;)e.call(n,s.value,s.key,this),s=s[b]}toJSON(){const e=new Array(this.size);let n=0,s=this.oldest;for(;s;)e[n++]={key:s.key,value:s.value},s=s[b];return e}toString(){let e="",n=this.oldest;for(;n;)e+=`${String(n.key)}:${n.value}`,n=n[b],n&&(e+=" < ");return e}}function j(t){let e=0;const n=Object.keys(t);for(const s of n){const r=Number(s);e=Math.max(e,r)}return e+1}function ai(t,e,n){const s=j(n),r=n;for(let i=s-1;i>=t;i--)r[i+1]=r[i];r[t]=e}function li(t,e){const n=t,s=Object.keys(n),r=s.length,i=e,o=Object.keys(i),a=o.length,h={};let l=0;for(let u=0;u<r;u++,l++){const _=s[u];h[l]=n[_]}for(let u=0;u<a;u++,l++){const _=o[u];h[l]=i[_]}return h}function ui(t,e,n){const s=n;if(j(n)>0){const i={};let o=0;for(let a=t;a<e;a++)s[a]&&(i[o]=s[a],o++);return i}return{}}function he(t,e,n,s){const r=t>n;if(!r&&t+e>n)throw new Error("Invalid move operation");r?ci(t,e,n,s):hi(t,e,n,s)}function ci(t,e,n,s){const r=s,i=[];for(let o=t;o<t+e;o++)i.push(r[o]);for(let o=t-1;o>=n;o--){const a=r[o];r[o+e]=a,a==null&&delete r[o+e]}i.forEach((o,a)=>{r[n+a]=o})}function hi(t,e,n,s){const r=s,i=[];for(let o=t;o<t+e;o++)i.push(r[o]);for(let o=t+e;o<n;o++){const a=r[o];r[o-e]=a,a==null&&delete r[o-e]}i.forEach((o,a)=>{r[n+a-e]=o})}class z{constructor(e={}){d(this,"_matrix");this._setOriginValue(e)}static MakeObjectMatrixSize(e){return new z({[e-1]:{}})}getMatrix(){return this._matrix}forEach(e){const n=this._matrix,s=Object.keys(n);for(const r of s){const i=Number(r),o=n[i];if(e(i,o)===!1)return this}return this}forRow(e){const n=this._matrix,s=Object.keys(n);for(const r of s){const i=Number(r),o=n[i];if(e(i,Object.keys(o).map(h=>Number(h)))===!1)return this}return this}forValue(e){const n=this._matrix,s=Object.keys(n);for(const r of s){const i=Number(r),o=n[i],a=Object.keys(o);for(const h of a){const l=Number(h),u=o[Number(h)];if(e(i,l,u)===!1)return this}}return this}swapRow(e,n){const s=this._matrix[e],r=this._matrix[n];this._matrix[e]=r,this._matrix[n]=s}getRow(e){return this._matrix[e]}getRowOrCreate(e){let n=this.getRow(e);return n==null&&(n={},this._matrix[e]=n),n}reset(){this._setOriginValue({})}hasValue(){const e=this._matrix,n=Object.keys(e);if(n.length===0)return!1;for(const s of n){const r=Number(s),i=e[r];if(Object.keys(i).length>0)return!0}return!1}getValue(e,n){var s,r;return(r=(s=this._matrix)==null?void 0:s[e])==null?void 0:r[n]}setValue(e,n,s){const r=this.getRowOrCreate(e);r[n]=s}deleteValue(e,n){var s,r;(r=(s=this._matrix)==null?void 0:s[e])==null||delete r[n]}realDeleteValue(e,n){var s,r,i;if((r=(s=this._matrix)==null?void 0:s[e])==null||delete r[n],this.getRow(e)){const o=this.getRow(e);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[e])}}setRow(e,n){this._matrix[e]=n}moveRows(e,n,s){he(e,n,s,this._matrix)}moveColumns(e,n,s){this.forEach((r,i)=>{he(e,n,s,i)})}getFragment(e,n,s,r){const i=new z;let o=0;for(let a=e;a<=n;a++){const h={};let l=0;for(let u=s;u<=r;u++){const _=this.getValue(a,u);h[l]=_,l++}i.setRow(o,h),o++}return i}getSlice(e,n,s,r){const i=new z;for(let o=e;o<=n;o++)for(let a=s;a<=r;a++){const h=this.getValue(o,a);h&&i.setValue(o,a,A.deepClone(h))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return j(this._matrix)}getRange(){const s=this.getLength()-1;let r=0;const i=this.getLength();for(let o=0;o<i;o++){const a=this.getRow(o);if(a){const h=j(a)-1;r=h>r?h:r}}return{startRow:0,startColumn:0,endRow:s,endColumn:r}}toNativeArray(){const e=new Array;return this.forValue((n,s,r)=>{e.push(r)}),e}toArray(){const e=[];return this.forRow((n,s)=>{e[n]==null&&(e[n]=[]),s.forEach(r=>{e[n][r]=this.getValue(n,r)})}),e}toJSON(){return this._matrix}clone(){const e=JSON.stringify(this._matrix);return JSON.parse(e)}getData(){const e=JSON.stringify(this._matrix);return JSON.parse(e)}getArrayData(){let e=0,n=0,s=!1,r=!1;const i=new z;return this.forEach((o,a)=>{s||(s=!0,e=o),Object.keys(a).forEach(h=>{const l=Number(h);r?l<n&&(n=l):(r=!0,n=l);const u=this.getValue(o,l);i.setValue(o-e,l-n,u)})}),i.getData()}getDataRange(){let e=0,n=0,s=0,r=!1,i=!1;this.forEach((a,h)=>{r||(r=!0,e=a);const l=j(h)-1;l>s&&(s=l),Object.keys(h).forEach(u=>{const _=Number(u);i?_<n&&(n=_):(i=!0,n=_)})});const o=e+this.getSizeOf()-1;return{startRow:e,startColumn:n,endRow:o,endColumn:s}}getDiscreteRanges(){const e=[];return this.forEach((n,s)=>{Object.keys(s).forEach(r=>{const i=Number(r);let o=!1;for(const a of e)if(n>=a.startRow&&n<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(n,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||e.push({startRow:n,endRow:n,startColumn:i,endColumn:i})})}),e}merge(e){this.forValue((n,s)=>{const r=e.getValue(n,s);r!=null&&this.setValue(n,s,r)})}_setOriginValue(e={}){this._matrix=e}}var _e=(t=>(t.INIT="init",t.FETCHING="fetching",t.DONE="done",t))(_e||{});class Fn{constructor(){d(this,"status","init")}}const _i=t=>t.some(e=>e.status==="init")?"init":t.some(e=>e.status==="fetching")?"fetching":"done";var Y=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN",t[t.ALL=3]="ALL",t))(Y||{}),K=(t=>(t[t.NONE=0]="NONE",t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN",t[t.ALL=3]="ALL",t))(K||{});function di(t){return[t.startRow,t.startColumn,t.endRow,t.endColumn]}const et=class et{static clone(e){return{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType}}static equals(e,n){return e.endRow===n.endRow&&e.endColumn===n.endColumn&&e.startRow===n.startRow&&e.startColumn===n.startColumn&&(e.rangeType===n.rangeType||e.rangeType===void 0&&n.rangeType===Y.NORMAL||n.rangeType===void 0&&e.rangeType===Y.NORMAL)}static intersects(e,n){const s=e.startRow,r=e.endRow,i=e.startColumn,o=e.endColumn,a=n.startRow,h=n.endRow,l=n.startColumn,u=n.endColumn,_=Math.abs(i+o-l-u),g=Math.abs(i-o)+Math.abs(l-u),f=Math.abs(s+r-a-h),E=Math.abs(s-r)+Math.abs(a-h);return _<=g&&f<=E}static getIntersects(e,n){const s=e.startRow,r=e.endRow,i=e.startColumn,o=e.endColumn,a=n.startRow,h=n.endRow,l=n.startColumn,u=n.endColumn;let _,g,f,E;if(a<=r)a>=s?g=a:g=s;else return null;if(h>=s)h>=r?E=r:E=h;else return null;if(l<=o)l>i?_=l:_=i;else return null;if(u>=i)u>=o?f=o:f=u;else return null;return{startRow:g,endRow:E,startColumn:_,endColumn:f,rangeType:Y.NORMAL}}static contains(e,n){return e.startRow<=n.startRow&&e.endRow>=n.endRow&&e.startColumn<=n.startColumn&&e.endColumn>=n.endColumn}static realContain(e,n){return et.contains(e,n)&&(e.startRow<n.startRow||e.endRow>n.endRow||e.startColumn<n.startColumn||e.endColumn>n.endColumn)}static union(...e){return e.reduce((n,s)=>({startRow:Math.min(n.startRow,s.startRow),startColumn:Math.min(n.startColumn,s.startColumn),endRow:Math.max(n.endRow,s.endRow),endColumn:Math.max(n.endColumn,s.endColumn),rangeType:Y.NORMAL}),e[0])}static subtract(e,n){if(n.startRow>=e.endRow||n.endRow<=e.startRow||n.startColumn>=e.endColumn||n.endColumn<=e.startColumn)return[e];const s=[];n.startRow>e.startRow&&s.push({startRow:e.startRow,startColumn:e.startColumn,endRow:n.startRow,endColumn:e.endColumn}),n.endRow<e.endRow&&s.push({startRow:n.endRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn});const r=Math.max(e.startRow,n.startRow),i=Math.min(e.endRow,n.endRow);return n.startColumn>e.startColumn&&s.push({startRow:r,startColumn:e.startColumn,endRow:i,endColumn:n.startColumn}),n.endColumn<e.endColumn&&s.push({startRow:r,startColumn:n.endColumn,endRow:i,endColumn:e.endColumn}),s}};d(et,"getRelativeRange",(e,n)=>({startRow:e.startRow-n.startRow,endRow:e.endRow-e.startRow,startColumn:e.startColumn-n.startColumn,endColumn:e.endColumn-e.startColumn})),d(et,"getPositionRange",(e,n)=>({startRow:e.startRow+n.startRow,endRow:e.endRow+e.startRow+n.startRow,startColumn:e.startColumn+n.startColumn,endColumn:e.endColumn+e.startColumn+n.startColumn})),d(et,"moveHorizontal",(e,n=0,s=0)=>({...e,startColumn:e.startColumn+n,endColumn:e.endColumn+n+s})),d(et,"moveVertical",(e,n=0,s=0)=>({...e,startRow:e.startRow+n,endRow:e.endRow+n+s})),d(et,"moveOffset",(e,n,s)=>({...e,startRow:e.startRow+s,endRow:e.endRow+s,startColumn:e.startColumn+n,endColumn:e.endColumn+n}));let ht=et;class fi{constructor(e,n){d(this,"_values",[]);d(this,"_keys",[]);d(this,"_keyMaps",new Map);this._values=e,this._keys=n,e.forEach(s=>{this._initKeyMap(s)})}_initKeyMap(e){this._keys.forEach(n=>{const s=e[n],r=this._keyMaps.get(n)||new Map;r.set(s,e),this._keyMaps.set(n,r)})}getValue(e){for(let n=0;n<this._keys.length;n++){const s=this._keyMaps.get(this._keys[n]);if(s!=null&&s.has(e))return s.get(e)}return null}hasValue(e){for(let n=0;n<this._keys.length;n++){const s=this._keyMaps.get(this._keys[n]);if(s!=null&&s.has(e))return!0}return!1}addValue(e){this._values.push(e),this._initKeyMap(e)}setValue(e,n,s){const r=this.getValue(e);r&&Object.keys(r).includes(n)&&(r[n]=s)}deleteValue(e){const n=this.getValue(e);if(n){this._keys.forEach(r=>{const i=this._keyMaps.get(r),o=n[r];i==null||i.delete(o)});const s=this._values.findIndex(r=>r===n);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(e){var n;return[...((n=this._keyMaps.get(e))==null?void 0:n.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function de(t,e,n,s){return{forEach(r){for(let i=t;i<=e;i++)for(let o=n;o<=s;o++)r(i,o)}}}function gi(t){if(t==null||t.length===0)return NaN;const e=t.toLowerCase().split(""),n=e.length,s=o=>o.charCodeAt(0)-96;let r=0,i=0;for(let o=0;o<n;o++)i=s(e[o]),r+=i*26**(n-o-1);return r===0?NaN:r-1}const pt=65,Hn=90,Ei=97;function Ri(t){const e=Hn-pt+1;let n="";for(;t>=0;)n=String.fromCharCode(t%e+pt)+n,t=Math.floor(t/e)-1;return n}function Bn(t,e){let n="";for(;e>0;)n+=t,e--;return n}function mi(t,e=!1){const n=Hn-pt+1;let s=Ei;e&&(s=pt);const r=String.fromCharCode(t%n+s),i=Math.floor(t/n)+1;return Bn(r,i)}function Oi(t,e){return t.zIndex>e.zIndex?1:t.zIndex===e.zIndex?0:-1}function Ai(t,e){return t.zIndex>e.zIndex?-1:t.zIndex===e.zIndex?0:1}function _t(t="index",e=1){return(n,s)=>n[t]>s[t]?e:n[t]===s[t]?0:-e}var Wn=(t=>(t[t.PARAGRAPH=0]="PARAGRAPH",t[t.SECTION_BREAK=1]="SECTION_BREAK",t[t.TABLE=2]="TABLE",t[t.TABLE_ROW=3]="TABLE_ROW",t[t.TABLE_CELL=4]="TABLE_CELL",t))(Wn||{}),fe=(t=>(t.PARAGRAPH="\r",t.SECTION_BREAK=`
|
|
10
|
-
`,t.TABLE_START="",t.TABLE_ROW_START="\x1B",t.TABLE_CELL_START="",t.TABLE_CELL_END="",t.TABLE_ROW_END="",t.TABLE_END="",t.CUSTOM_RANGE_START="",t.CUSTOM_RANGE_END="",t.COLUMN_BREAK="\v",t.PAGE_BREAK="\f",t.DOCS_END="\0",t.TAB=" ",t.CUSTOM_BLOCK="\b",t.LETTER="",t.SPACE=" ",t))(fe||{});function Gn(t){const e=[];for(const n of t){const{st:s,ed:r}=n;if(s===r)continue;if(e.length===0){e.push(n);continue}const i=e.pop();Sn(n,i)&&A.hasIntersectionBetweenTwoRanges(i.st,i.ed,n.st,n.ed)?e.push({...n,st:i.st,ed:r}):e.push(i,n)}return e}function $n(t,e,n,s){const{textRuns:r}=t;if(r==null)return;const i=[],o=r.length;let a=!1;const h=e.textRuns??[];if(h.length)for(let l=0,u=h.length;l<u;l++){const _=h[l];_.st+=s,_.ed+=s}for(let l=0;l<o;l++){const u=r[l],{st:_,ed:g}=u;if(g<s)i.push(u);else if(s>=_&&s<=g)if(a)u.st+=n,u.ed+=n,i.push(u);else{a=!0,u.ed+=n;const f=[];if(h.length){const E={...u,st:_,ed:h[0].st};f.push(E),f.push(...h);const R=h[h.length-1],m={...u,st:R.ed,ed:g+n};f.push(m)}else f.push(u);i.push(...f)}else u.st+=n,u.ed+=n,a||(a=!0,i.push(...h)),i.push(u)}a||(a=!0,i.push(...h)),t.textRuns=Gn(i)}function ge(t,e,n,s){const{paragraphs:r}=t;if(r==null)return;const{paragraphs:i,dataStream:o}=e,a=[];let h=-1;for(let u=0,_=r.length;u<_;u++){const g=r[u],{startIndex:f}=g;f>=s&&(g.startIndex+=n),h===-1&&f>=s&&(h=u),a.push(g.startIndex)}let l=-1;if(i){for(let u=0,_=i.length;u<_;u++){const g=i[u];g.startIndex+=s;const f=g.startIndex;l=a.indexOf(f)}if(o===fe.PARAGRAPH&&i.length===1){const u=r[h],_=i[0],g=u.paragraphStyle,f=u.bullet;u.paragraphStyle=_.paragraphStyle,u.bullet=_.bullet,_.paragraphStyle=g,_.bullet=f}l!==-1&&r.splice(l,1),r.push(...i),r.sort(_t("startIndex"))}}function Ii(t,e,n,s){const{sectionBreaks:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const h=r[o],{startIndex:l}=h;l>=s&&(h.startIndex+=n)}const i=e.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const h=i[o];h.startIndex+=s}r.push(...i),r.sort(_t("startIndex"))}}function kn(t,e,n,s){const{customBlocks:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const h=r[o],{startIndex:l}=h;l>=s&&(h.startIndex+=n)}const i=e.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const h=i[o];h.startIndex+=s}r.push(...i),r.sort(_t("startIndex"))}}function Ee(t,e,n,s){const{tables:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const h=r[o],{startIndex:l,endIndex:u}=h;l>s?(h.startIndex+=n,h.endIndex+=n):u>=s-1&&(h.endIndex+=n)}const i=e.tables;if(i){for(let o=0,a=i.length;o<a;o++){const h=i[o];h.startIndex+=s,h.endIndex+=s}r.push(...i),r.sort(_t("startIndex"))}}function Ci(t,e,n,s){const{customRanges:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const h=r[o],{startIndex:l,endIndex:u}=h;l>s?(h.startIndex+=n,h.endIndex+=n):u>=s-1&&(h.endIndex+=n)}const i=e.customRanges;if(i){for(let o=0,a=i.length;o<a;o++){const h=i[o];h.startIndex+=s,h.endIndex+=s}r.push(...i),r.sort(_t("startIndex"))}}function xn(t,e,n){const{textRuns:s}=t,r=n,i=n+e,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{st:_,ed:g}=u;if(r<=_&&i>=g){o.push({...u,st:_-r,ed:g-r});continue}else _<=r&&g>=i?(o.push({...u,st:r-r,ed:i-r}),u.ed-=e):r>=_&&r<g?(o.push({...u,st:r-r,ed:g-r}),u.ed=r):i>_&&i<=g?(o.push({...u,st:_-r,ed:i-r}),u.st=i-e,u.ed-=e):_>=i&&(u.st-=e,u.ed-=e);a.push(u)}t.textRuns=a}return o}function Vn(t,e,n){const{paragraphs:s}=t,r=n,i=n+e,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{startIndex:_}=u;if(_>=r&&_<i){o.push({...u,startIndex:_-n});continue}else _>=i&&(u.startIndex-=e);a.push(u)}t.paragraphs=a}return o}function pn(t,e,n){const{sectionBreaks:s}=t,r=n,i=n+e-1,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{startIndex:_}=u;if(_>=r&&_<=i){o.push({...u,startIndex:_-n});continue}else _>i&&(u.startIndex-=e);a.push(u)}t.sectionBreaks=a}return o}function jn(t,e,n){const{customBlocks:s}=t,r=n,i=n+e-1,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{startIndex:_}=u;if(_>=r&&_<=i){o.push({...u,startIndex:_-n});continue}else _>i&&(u.startIndex-=e);a.push(u)}t.customBlocks=a}return o}function zn(t,e,n){const{tables:s}=t,r=n,i=n+e-1,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{startIndex:_,endIndex:g}=u;if(r<=_&&i>=g){o.push({...u,startIndex:_-n,endIndex:g-n});continue}else if(_<=r&&g>=i){const f=le(_,g,r,i);u.startIndex=f[0],u.endIndex=f[1]}else i<_&&(u.startIndex-=e,u.endIndex-=e);a.push(u)}t.tables=a}return o}function Yn(t,e,n){const{customRanges:s}=t,r=n,i=n+e-1,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{startIndex:_,endIndex:g}=u;if(r<=_&&i>=g){o.push({...u,startIndex:_-n,endIndex:g-n});continue}else if(_<=r&&g>=i){const f=le(_,g,r,i);u.startIndex=f[0],u.endIndex=f[1]}else i<_&&(u.startIndex-=e,u.endIndex-=e);a.push(u)}t.customRanges=a}return o}function Si(t,e,n){const{dataStream:s}=t,r=n,i=n+e,o=xn(t,e,n),a=Vn(t,e,n),h=pn(t,e,n),l=jn(t,e,n),u=zn(t,e,n),_=Yn(t,e,n);let g="";return s&&(t.dataStream=Ln(s,r,i),g=s.slice(r,i)),{dataStream:g,textRuns:o,paragraphs:a,sectionBreaks:h,customBlocks:l,tables:u,customRanges:_}}function Ni(t,e,n,s){t.dataStream=bn(t.dataStream,s,e.dataStream),$n(t,e,n,s),ge(t,e,n,s),Ii(t,e,n,s),kn(t,e,n,s),Ee(t,e,n,s),Ci(t,e,n,s)}var Kn=(t=>(t[t.character=0]="character",t[t.paragraph=1]="paragraph",t[t.table=2]="table",t[t.numbering=3]="numbering",t))(Kn||{}),Xn=(t=>(t[t.TAB=0]="TAB",t[t.SPACE=1]="SPACE",t[t.NOTHING=2]="NOTHING",t))(Xn||{}),Ct=(t=>(t[t.GLYPH_TYPE_UNSPECIFIED=0]="GLYPH_TYPE_UNSPECIFIED",t[t.NONE=1]="NONE",t[t.DECIMAL=2]="DECIMAL",t[t.ZERO_DECIMAL=3]="ZERO_DECIMAL",t[t.UPPER_ALPHA=4]="UPPER_ALPHA",t[t.ALPHA=5]="ALPHA",t[t.UPPER_ROMAN=6]="UPPER_ROMAN",t[t.ROMAN=7]="ROMAN",t))(Ct||{}),J=(t=>(t[t.BULLET_ALIGNMENT_UNSPECIFIED=0]="BULLET_ALIGNMENT_UNSPECIFIED",t[t.START=1]="START",t[t.CENTER=2]="CENTER",t[t.END=3]="END",t))(J||{}),Qn=(t=>(t[t.HYPERLINK=0]="HYPERLINK",t[t.FIELD=1]="FIELD",t[t.SDT=2]="SDT",t[t.BOOKMARK=3]="BOOKMARK",t[t.COMMENT=4]="COMMENT",t[t.CUSTOM=5]="CUSTOM",t))(Qn||{}),Zn=(t=>(t[t.DRAWING=0]="DRAWING",t[t.CUSTOM=1]="CUSTOM",t))(Zn||{}),qn=(t=>(t[t.DEFAULT=0]="DEFAULT",t[t.LINES=1]="LINES",t[t.LINES_AND_CHARS=2]="LINES_AND_CHARS",t[t.SNAP_TO_CHARS=3]="SNAP_TO_CHARS",t))(qn||{}),Jn=(t=>(t[t.SECTION_TYPE_UNSPECIFIED=0]="SECTION_TYPE_UNSPECIFIED",t[t.CONTINUOUS=1]="CONTINUOUS",t[t.NEXT_PAGE=2]="NEXT_PAGE",t[t.EVEN_PAGE=3]="EVEN_PAGE",t[t.ODD_PAGE=4]="ODD_PAGE",t))(Jn||{}),yn=(t=>(t[t.COLUMN_SEPARATOR_STYLE_UNSPECIFIED=0]="COLUMN_SEPARATOR_STYLE_UNSPECIFIED",t[t.NONE=1]="NONE",t[t.BETWEEN_EACH_COLUMN=2]="BETWEEN_EACH_COLUMN",t))(yn||{}),ts=(t=>(t[t.NORMAL=0]="NORMAL",t[t.TBRL=1]="TBRL",t[t.LRTBV=2]="LRTBV",t))(ts||{}),es=(t=>(t[t.TEXT_RUN=0]="TEXT_RUN",t[t.AUTO_TEXT=1]="AUTO_TEXT",t[t.PAGE_BREAK=2]="PAGE_BREAK",t[t.COLUMN_BREAK=3]="COLUMN_BREAK",t[t.FOOT_NOTE_REFERENCE=4]="FOOT_NOTE_REFERENCE",t[t.HORIZONTAL_RULE=5]="HORIZONTAL_RULE",t[t.EQUATION=6]="EQUATION",t[t.DRAWING=7]="DRAWING",t[t.PERSON=8]="PERSON",t[t.RICH_LINK=9]="RICH_LINK",t))(es||{}),ns=(t=>(t[t.BOTH_SIDES=0]="BOTH_SIDES",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.LARGEST=3]="LARGEST",t))(ns||{}),ss=(t=>(t[t.INLINE=0]="INLINE",t[t.WRAP_NONE=1]="WRAP_NONE",t[t.WRAP_POLYGON=2]="WRAP_POLYGON",t[t.WRAP_SQUARE=3]="WRAP_SQUARE",t[t.WRAP_THROUGH=4]="WRAP_THROUGH",t[t.WRAP_TIGHT=5]="WRAP_TIGHT",t[t.WRAP_TOP_AND_BOTTOM=6]="WRAP_TOP_AND_BOTTOM",t))(ss||{}),rs=(t=>(t[t.NAMED_STYLE_TYPE_UNSPECIFIED=0]="NAMED_STYLE_TYPE_UNSPECIFIED",t[t.NORMAL_TEXT=1]="NORMAL_TEXT",t[t.TITLE=2]="TITLE",t[t.SUBTITLE=3]="SUBTITLE",t[t.HEADING_1=4]="HEADING_1",t[t.HEADING_2=5]="HEADING_2",t[t.HEADING_3=6]="HEADING_3",t[t.HEADING_4=7]="HEADING_4",t[t.HEADING_5=8]="HEADING_5",t[t.HEADING_6=9]="HEADING_6",t))(rs||{}),is=(t=>(t[t.AUTO=0]="AUTO",t[t.AT_LEAST=1]="AT_LEAST",t[t.EXACT=2]="EXACT",t))(is||{}),os=(t=>(t[t.DASH_STYLE_UNSPECIFIED=0]="DASH_STYLE_UNSPECIFIED",t[t.SOLID=1]="SOLID",t[t.DOT=2]="DOT",t[t.DASH=3]="DASH",t))(os||{}),as=(t=>(t[t.TAB_STOP_ALIGNMENT_UNSPECIFIED=0]="TAB_STOP_ALIGNMENT_UNSPECIFIED",t[t.START=1]="START",t[t.CENTER=2]="CENTER",t[t.END=3]="END",t))(as||{}),ls=(t=>(t.EVENLY_DISTRIBUTED="0",t.FIXED_WIDTH="1",t))(ls||{}),us=(t=>(t[t.CONTENT_ALIGNMENT_UNSPECIFIED=0]="CONTENT_ALIGNMENT_UNSPECIFIED",t[t.CONTENT_ALIGNMENT_UNSUPPORTED=1]="CONTENT_ALIGNMENT_UNSUPPORTED",t[t.TOP=2]="TOP",t[t.MIDDLE=3]="MIDDLE",t[t.BOTTOM=4]="BOTTOM",t))(us||{}),cs=(t=>(t.NORMAL="normal",t.BOLD="bold",t.ITALIC="italic",t))(cs||{}),hs=(t=>(t[t.CHARACTER=0]="CHARACTER",t[t.COLUMN=1]="COLUMN",t[t.INSIDE_MARGIN=2]="INSIDE_MARGIN",t[t.LEFT_MARGIN=3]="LEFT_MARGIN",t[t.MARGIN=4]="MARGIN",t[t.OUTSIDE_MARGIN=5]="OUTSIDE_MARGIN",t[t.PAGE=6]="PAGE",t[t.RIGHT_MARGIN=7]="RIGHT_MARGIN",t))(hs||{}),_s=(t=>(t[t.BOTTOM_MARGIN=0]="BOTTOM_MARGIN",t[t.INSIDE_MARGIN=1]="INSIDE_MARGIN",t[t.LINE=2]="LINE",t[t.MARGIN=3]="MARGIN",t[t.OUTSIDE_MARGIN=4]="OUTSIDE_MARGIN",t[t.PAGE=5]="PAGE",t[t.PARAGRAPH=6]="PARAGRAPH",t[t.TOP_MARGIN=7]="TOP_MARGIN",t))(_s||{}),ds=(t=>(t[t.POINT=0]="POINT",t[t.LINE=1]="LINE",t[t.CHARACTER=2]="CHARACTER",t))(ds||{}),fs=(t=>(t[t.CENTER=0]="CENTER",t[t.INSIDE=1]="INSIDE",t[t.LEFT=2]="LEFT",t[t.OUTSIDE=3]="OUTSIDE",t[t.RIGHT=4]="RIGHT",t))(fs||{}),gs=(t=>(t[t.BOTTOM=0]="BOTTOM",t[t.CENTER=1]="CENTER",t[t.INSIDE=2]="INSIDE",t[t.OUTSIDE=3]="OUTSIDE",t[t.TOP=4]="TOP",t))(gs||{}),Es=(t=>(t[t.compressPunctuation=0]="compressPunctuation",t[t.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",t[t.doNotCompress=2]="doNotCompress",t))(Es||{}),Rs=(t=>(t[t.PORTRAIT=0]="PORTRAIT",t[t.LANDSCAPE=1]="LANDSCAPE",t))(Rs||{}),jt=(t=>(t.BULLET_LIST="BULLET_LIST",t.ORDER_LIST="ORDER_LIST",t))(jt||{});const bi={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:[{bulletAlignment:J.START,glyphFormat:" %0",textStyle:{fs:12},startNumber:0,glyphSymbol:"●",hanging:21,indentStart:21},{bulletAlignment:J.START,glyphFormat:" %1",textStyle:{fs:12},startNumber:0,glyphSymbol:"■",hanging:21,indentStart:42},{bulletAlignment:J.START,glyphFormat:" %1",textStyle:{fs:12},startNumber:0,glyphSymbol:"◆",hanging:21,indentStart:63}]},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:[{bulletAlignment:J.START,glyphFormat:" %1.",textStyle:{fs:12},startNumber:0,glyphType:Ct.DECIMAL,hanging:21,indentStart:21},{bulletAlignment:J.START,glyphFormat:" %1.%2)",textStyle:{fs:12},startNumber:0,glyphType:Ct.DECIMAL,hanging:21,indentStart:42},{bulletAlignment:J.START,glyphFormat:" %1.%2.%3.",textStyle:{fs:12},startNumber:0,glyphType:Ct.DECIMAL,hanging:21,indentStart:63}]}};function Li(t,e,n,s,r){const i=wi(t,e,n,s,r),o=Di(t,e,n,s,r),a=Ti(t,e,n,s,r),h=Ui(t,e,n,s,r),l=Mi(t,e,n,s,r),u=Pi(t,e,n,s,r);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:h,tables:l,customRanges:u}}function wi(t,e,n,s,r){const{textRuns:i}=t,{textRuns:o}=e;if(i==null||o==null)return;const a=xn(t,n,s);if(r!==F.REPLACE){const h=vi(o,a,r);e.textRuns=h}return $n(t,e,n,s),a}function vi(t,e,n){if(e.length===0)return t;t=A.deepClone(t),e=A.deepClone(e);const s=[],r=t.length,i=e.length;let o=0,a=0,h=null;function l(){return h?(s.push(h),h=null,!0):!1}for(;o<r&&a<i;){const{st:f,ed:E,ts:R}=t[o],{st:m,ed:I,ts:S,sId:v}=e[a];let W;n===F.COVER?W={...S,...R}:W={...R,...S},E<m?(l()||s.push(t[o]),o++):I<f?(l()||s.push(e[a]),a++):(s.push({st:Math.min(f,m),ed:Math.max(f,m),ts:f<m?{...R}:{...S},sId:f<m?void 0:v}),s.push({st:Math.max(f,m),ed:Math.min(E,I),ts:W,sId:v}),E<I?(o++,e[a].st=E):(a++,t[o].st=I),h={st:Math.min(E,I),ed:Math.max(E,I),ts:E<I?{...S}:{...R},sId:E<I?v:void 0})}l();const u=s[s.length-1],_=t[r-1],g=e[i-1];return u.ed!==Math.max(_.ed,g.ed)&&(_.ed>g.ed?s.push(_):s.push(g)),Gn(s)}function Di(t,e,n,s,r){const{paragraphs:i}=t,{paragraphs:o}=e;if(i==null||o==null)return;const a=Vn(t,n,s);if(r!==F.REPLACE){const h=[];for(const l of o){const{startIndex:u,paragraphStyle:_,bullet:g}=l;let f=[];for(const E of a){const{startIndex:R,paragraphStyle:m,bullet:I}=E;let S,v;if(r===F.COVER?(S={...m,..._},v={listId:"",listType:jt.BULLET_LIST,nestingLevel:0,textStyle:{},...I,...g}):(S={..._,...m},v={listId:"",listType:jt.BULLET_LIST,nestingLevel:0,textStyle:{},...g,...I}),u===R){f.push({startIndex:u,paragraphStyle:S,bullet:v});break}}h.push(...f),f=[]}e.paragraphs=h}return ge(t,e,n,s),a}function Ti(t,e,n,s,r){const{sectionBreaks:i}=t,{sectionBreaks:o}=e;if(i==null||o==null)return;const a=pn(t,n,s);if(r!==F.REPLACE){const h=[];for(const l of o){const{startIndex:u}=l;let _=[];for(const g of a){const{startIndex:f}=g;if(u===f){r===F.COVER?_.push({...g,...l}):_.push({...l,...g});break}}h.push(..._),_=[]}e.sectionBreaks=h}return ge(t,e,n,s),a}function Ui(t,e,n,s,r){const{customBlocks:i}=t,{customBlocks:o}=e;if(i==null||o==null)return;const a=jn(t,n,s);if(r!==F.REPLACE){const h=[];for(const l of o){const{startIndex:u}=l;let _=[];for(const g of a){const{startIndex:f}=g;if(u===f){r===F.COVER?_.push({...g,...l}):_.push({...l,...g});break}}h.push(..._),_=[]}e.customBlocks=h}return kn(t,e,n,s),a}function Mi(t,e,n,s,r){const{tables:i}=t,{tables:o}=e;if(i==null||o==null)return;const a=zn(t,n,s);if(r!==F.REPLACE){const h=[];for(const l of o){const{startIndex:u,endIndex:_}=l;let g=[];for(const f of a){const{startIndex:E,endIndex:R}=f;if(E>=u&&R<=_){r===F.COVER?g.push({...f,...l}):g.push({...l,...f});break}}h.push(...g),g=[]}e.tables=h}return Ee(t,e,n,s),a}function Pi(t,e,n,s,r){const{customRanges:i}=t,{tables:o}=e;if(i==null||o==null)return;const a=Yn(t,n,s);if(r!==F.REPLACE){const h=[];for(const l of o){const{startIndex:u,endIndex:_}=l;let g=[];for(const f of a){const{startIndex:E,endIndex:R}=f;if(E>=u&&R<=_){r===F.COVER?g.push({...f,...l}):g.push({...l,...f});break}}h.push(...g),g=[]}e.customRanges=h}return Ee(t,e,n,s),a}const Re={id:"default_doc",documentStyle:{}};class Fi{constructor(e){d(this,"snapshot");this.snapshot={...Re,...e}}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get body(){return this.snapshot.body}get zoomRatio(){var e;return((e=this.snapshot.settings)==null?void 0:e.zoomRatio)||1}getBody(){return this.snapshot.body}getShouldRenderLoopImmediately(){return this.snapshot.shouldStartRenderingImmediately!==!1}getContainer(){return this.snapshot.container}getParentRenderUnitId(){return this.snapshot.parentRenderUnitId}getSnapshot(){return this.snapshot}updateDocumentId(e){this.snapshot.id=e}updateDocumentRenderConfig(e){const{documentStyle:n}=this.snapshot;n.renderConfig==null?n.renderConfig=e:n.renderConfig={...n.renderConfig,...e}}updateDocumentDataMargin(e){const{t:n,l:s,b:r,r:i}=e,{documentStyle:o}=this.snapshot;n!=null&&(o.marginTop=n),s!=null&&(o.marginLeft=s),r!=null&&(o.marginBottom=r),i!=null&&(o.marginRight=i)}updateDocumentDataPageSize(e,n){const{documentStyle:s}=this.snapshot;if(!s.pageSize){e=e??1/0,n=n??1/0,s.pageSize={width:e,height:n};return}e!==void 0&&(s.pageSize.width=e),n!==void 0&&(s.pageSize.height=n)}updateDrawing(e,n){const{drawings:s}=this,{width:r,height:i,left:o,top:a}=n,h=s==null?void 0:s[e];if(!h)return;const l=h.objectTransform;l.size.width=r,l.size.height=i,l.positionH.posOffset=o,l.positionV.posOffset=a}setZoomRatio(e=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:e}:this.snapshot.settings.zoomRatio=1}}class dt extends Fi{constructor(n){super(n);d(this,"_unitId");d(this,"headerModelMap",new Map);d(this,"footerModelMap",new Map);const s=6;this._unitId=this.snapshot.id??A.generateRandomId(s),this._initializeHeaderFooterModel()}dispose(){this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()})}getRev(){return this.snapshot.rev??0}incrementRev(){this.snapshot.rev=this.getRev()+1}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...Re,...n},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){const s=[],r=new nn;return r.reset(),n.forEach(i=>{if(i=A.deepClone(i),i.t==="r"){const{coverType:o,body:a,len:h,segmentId:l}=i;if(a!=null){const u=this._updateApply(a,h,r.cursor,o,l);s.push({...i,t:"r",coverType:F.REPLACE,body:u})}else s.push({...i,t:"r"});r.moveCursor(h)}else if(i.t==="i"){const{body:o,len:a,segmentId:h,line:l}=i;this._insertApply(o,a,r.cursor,h),r.moveCursor(a),s.push({t:"d",len:a,line:l,segmentId:h})}else if(i.t==="d"){const{len:o,segmentId:a}=i,h=this._deleteApply(o,r.cursor,a);s.push({...i,t:"i",body:h})}else throw new Error(`Unknown mutation type for mutation: ${i}.`)}),s}_updateApply(n,s,r,i=F.COVER,o){if(n==null)throw new Error("updateBody is none");const a=this.snapshot,h=xt(a,o);if(h==null)throw new Error("no body has changed");return Li(h,n,s,r,i)}_deleteApply(n,s,r){const i=this.snapshot,o=xt(i,r);if(o==null)throw new Error("no body has changed");return n<=0?{dataStream:""}:Si(o,n,s)}_insertApply(n,s,r,i){const o=this.snapshot,a=xt(o,i);if(s!==0){if(a==null)throw new Error("no body has changed");Ni(a,n,s,r)}}_initializeHeaderFooterModel(){const{headers:n,footers:s}=this.getSnapshot();if(n)for(const r in n){const i=n[r];this.headerModelMap.set(r,new dt(i))}if(s)for(const r in s){const i=s[r];this.footerModelMap.set(r,new dt(i))}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}}var ms=(t=>(t.INSERT_ROW_DATA_ACTION="InsertRowDataAction",t.REMOVE_ROW_DATA_ACTION="RemoveRowDataAction",t.INSERT_ROW_ACTION="InsertRowAction",t.REMOVE_ROW_ACTION="RemoveRowAction",t.SET_RANGE_STYLE_ACTION="SetRangeStyleAction",t.SET_SELECTION_ACTION="SetSelectionActivateAction",t.SET_RANGE_DATA_ACTION="SetRangeDataAction",t.SET_RANGE_FORMATTED_VALUE_ACTION="SetRangeFormattedValueAction",t.SET_RANGE_NOTE_ACTION="SetRangeNoteAction",t.DELETE_RANGE_ACTION="DeleteRangeAction",t.INSERT_SHEET_ACTION="InsertSheetAction",t.REMOVE_SHEET_ACTION="RemoveSheetAction",t.CLEAR_RANGE_ACTION="ClearRangeAction",t.INSERT_RANGE_ACTION="InsertRangeAction",t.SET_TAB_COLOR_ACTION="SetTabColorAction",t.HIDE_SHEET_ACTION="SetWorkSheetHideAction",t.SET_WORKSHEET_ACTIVATE_ACTION="SetWorkSheetActivateAction",t.INSERT_COLUMN_ACTION="InsertColumnAction",t.INSERT_COLUMN_DATA_ACTION="InsertColumnDataAction",t.REMOVE_COLUMN_ACTION="RemoveColumnAction",t.REMOVE_COLUMN_DATA_ACTION="RemoveColumnDataAction",t.SET_HIDE_ROW_ACTION="SetRowHideAction",t.SET_HIDE_COLUMN_ACTION="SetColumnHideAction",t.SET_SHOW_ROW_ACTION="SetRowShowAction",t.SET_SHOW_COLUMN_ACTION="SetColumnShowAction",t.ADD_MERGE_ACTION="AddMergeAction",t.REMOVE_MERGE_ACTION="RemoveMergeAction",t.SET_WORKSHEET_NAME_ACTION="SetWorkSheetNameAction",t.SET_WORKSHEET_STATUS_ACTION="SetWorkSheetStatusAction",t.SET_BORDER_ACTION="SetBorderAction",t.SET_COLUMN_WIDTH_ACTION="SetColumnWidthAction",t.SET_ROW_HEIGHT_ACTION="SetRowHeightAction",t.SET_HIDDEN_GRIDLINES_ACTION="SetHiddenGridlinesAction",t.SET_RIGHT_TO_LEFT_ACTION="SetRightToLeftAction",t.DELETE_BANDING_ACTION="DeleteBandingAction",t.SET_BANDING_ACTION="SetBandingAction",t.ADD_BANDING_ACTION="AddBandingAction",t.DELETE_NAMED_RANGE_ACTION="DeleteNamedRangeAction",t.SET_NAMED_RANGE_ACTION="SetNamedRangeAction",t.ADD_NAMED_RANGE_ACTION="AddNamedRangeAction",t.SET_SHEET_ORDER_ACTION="SetSheetOrderAction",t.SET_ZOOM_RATIO_ACTION="SetZoomRatioAction",t.SET_FROZEN_COLUMNS_ACTION="SetFrozenColumnsAction",t.SET_FROZEN_ROWS_ACTION="SetFrozenRowsAction",t))(ms||{});const St={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},Hi={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},Bi={startRow:0,startColumn:0,endRow:0,endColumn:0},Wi={row:0,column:0},Os={id:"",sheetOrder:[],name:"",appVersion:"",locale:Ut.ZH_CN,styles:{},sheets:{},resources:[]},As=1e3,Is=20,Cs=19,Ss=73,Ns=46,bs=20,zt={type:se.GRID,name:"Sheet1",id:"sheet-01",tabColor:"",hidden:C.FALSE,rowCount:As,columnCount:Is,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Ss,defaultRowHeight:Cs,mergeData:[],hideRow:[],hideColumn:[],cellData:{},rowData:{},columnData:{},status:C.FALSE,showGridlines:C.TRUE,rowHeader:{width:Ns,hidden:C.FALSE},columnHeader:{height:bs,hidden:C.FALSE},selections:["A1"],rightToLeft:C.FALSE,pluginMeta:{}},Yt={ff:"Times New Roman",fs:14,it:C.FALSE,bl:C.FALSE,ul:{s:C.FALSE},st:{s:C.FALSE},ol:{s:C.FALSE},tr:{a:0,v:C.FALSE},td:Ot.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:st.UNSPECIFIED,vt:ut.UNSPECIFIED,tb:ct.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0}},Ls={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}};var ws=(t=>(t.ARRAY_CONVERTOR="ARRAY_CONVERTOR",t.MATRIX_CONVERTOR="MATRIX_CONVERTOR",t))(ws||{});class vs{constructor(e={}){d(this,"_styles");d(this,"_cacheMap",new Pn(1e5));this._styles=e,this._generateCacheMap()}each(e){return Object.entries(this._styles).forEach(e),this}search(e,n){if(this._cacheMap.has(n))return this._cacheMap.get(n);const s=this._getExistingStyleId(e);return s||"-1"}get(e){return typeof e!="string"?e:(e=String(e),this._styles[e])}add(e,n){const s=A.generateRandomId(6);return this._styles[s]=e,this._cacheMap.set(n,s),s}setValue(e){if(e==null)return;const n=JSON.stringify(e),s=this.search(e,n);return s!=="-1"?s:this.add(e,n)}toJSON(){return this._styles}getStyleByCell(e){let n;e&&A.isObject(e.s)?n=e.s:n=(e==null?void 0:e.s)&&this.get(e.s);const s=e==null?void 0:e.interceptorStyle;return s?{...n,...s}:n}_generateCacheMap(){const{_styles:e,_cacheMap:n}=this;for(const s in e){const r=JSON.stringify(e[s]);n.set(r,s)}}_getExistingStyleId(e){const{_styles:n}=this;for(const s in n)if(A.diffValue(n[s],e))return s;return null}}function Gi(t){return t&&(t.s!==void 0||t.p!==void 0||t.v!==void 0)||t.f!==void 0||t.si!==void 0}function $i(t){if(t.t!==void 0)return t.t;if(typeof t.v=="string")return At.STRING;if(typeof t.v=="number")return At.NUMBER;if(typeof t.v=="boolean")return At.BOOLEAN}function ki(t){if(t==null)return!0;const{v:e,f:n,si:s,p:r,s:i}=t;return!(!(e==null||typeof e=="string"&&e.length===0)||n!=null&&n.length>0||s!=null&&s.length>0||r!=null)}var me=(t=>(t[t.SLIDE=0]="SLIDE",t[t.MASTER=1]="MASTER",t[t.LAYOUT=2]="LAYOUT",t[t.HANDOUT_MASTER=3]="HANDOUT_MASTER",t[t.NOTES_MASTER=4]="NOTES_MASTER",t))(me||{}),Ds=(t=>(t[t.SHAPE=0]="SHAPE",t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.SPREADSHEET=3]="SPREADSHEET",t[t.DOCUMENT=4]="DOCUMENT",t[t.SLIDE=5]="SLIDE",t))(Ds||{}),Ts=(t=>(t[t.RELATIVE_SLIDE_LINK_UNSPECIFIED=0]="RELATIVE_SLIDE_LINK_UNSPECIFIED",t[t.NEXT_SLIDE=1]="NEXT_SLIDE",t[t.PREVIOUS_SLIDE=2]="PREVIOUS_SLIDE",t[t.FIRST_SLIDE=3]="FIRST_SLIDE",t[t.LAST_SLIDE=4]="LAST_SLIDE",t))(Ts||{});class xi{constructor(e,n){d(this,"_columnData",{});this._config=e,this._columnData=n}getColumnData(){return this._columnData}getColVisible(e){const{_columnData:n}=this,s=n[e];return s?s.hd!==C.TRUE:!0}getHiddenCols(e=0,n=j(this._columnData)-1){const s=[];let r=!1,i=-1;for(let o=e;o<=n;o++){const a=this.getColVisible(o);r&&a?(r=!1,s.push({rangeType:Y.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!r&&!a&&(r=!0,i=o)}return r&&s.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:Y.COLUMN}),s}getColumnDatas(e,n){const s={};let r=0;for(let i=e;i<e+n;i++){const o=this.getColumnOrCreate(i);s[r]=o,r++}return s}getSize(){return j(this._columnData)}getColumnWidth(e){const{_columnData:n}=this,s=this._config;let r=0;return r=(n[e]||{hd:C.FALSE,w:s.defaultColumnWidth}).w||s.defaultColumnWidth,r}getColumn(e){const n=this._columnData[e];if(n)return n}getColumnOrCreate(e){const{_columnData:n}=this,s=this._config,r=n[e];if(r)return r;const i={w:s.defaultColumnWidth,hd:C.FALSE};return this._columnData[e]=i,i}}function Kt(t,e){for(const n of e){const{ts:s={}}=n;if(s[t]==null)return C.FALSE;switch(t){case"bl":case"it":{if(s[t]===C.FALSE)return C.FALSE;break}case"ul":case"st":{if(s[t].s===C.FALSE)return C.FALSE;break}default:throw new Error(`unknown style key: ${t} in IStyleBase`)}}return C.TRUE}class ft{constructor(e,n,s){d(this,"_range");d(this,"_worksheet");this._deps=s,this._range=n,this._worksheet=e}static foreach(e,n){const{startRow:s,startColumn:r,endRow:i,endColumn:o}=e;for(let a=s;a<=i;a++)for(let h=r;h<=o;h++)n(a,h)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range,i=[];for(let o=e;o<=n;o++){const a=[];for(let h=s;h<=r;h++)a.push(this.getMatrix().getValue(o,h)||null);i.push(a)}return i}getMatrix(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),o=new z;for(let a=e;a<=n;a++)for(let h=s;h<=r;h++)o.setValue(a,h,i.getValue(a,h)||null);return o}getMatrixObject(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),o=new z;for(let a=e;a<=n;a++)for(let h=s;h<=r;h++)o.setValue(a-e,h-s,i.getValue(a,h)||{});return o}getA1Notation(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range;let i,o;return s<r?(i=A.numToWord(s+1)+(e+1),o=A.numToWord(r+1)+(n+1)):(i=A.numToWord(r+1)+(n+1),o=A.numToWord(s+1)+(e+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const e=this._deps.getStyles();return this.getValues().map(n=>n.map(s=>{var i;const r=e.getStyleByCell(s);return((i=r==null?void 0:r.bg)==null?void 0:i.rgb)||Yt.bg.rgb}))}getCell(e,n){const{startRow:s,endRow:r,startColumn:i,endColumn:o}=this._range,a={startRow:s+e,endRow:s+e,startColumn:i+n,endColumn:i+n};return new ft(this._worksheet,a,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(e={}){return this.getObjectValues(e)[0][0]}getObjectValues(e={}){var a;const{startRow:n,endRow:s,startColumn:r,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(n,s,r,i).getData();if(e.isIncludeStyle){const h=this._deps.getStyles();for(let l=0;l<=s-n;l++)for(let u=0;u<=i-r;u++){if(o==null||((a=o==null?void 0:o[l])==null?void 0:a[u])==null)continue;const _=o[l][u].s;_&&(o[l][u].s=h.get(_))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const e=this._deps.getStyles();return this.getValues().map(n=>n.map(s=>{var i;const r=e.getStyleByCell(s);return((i=r==null?void 0:r.cl)==null?void 0:i.rgb)||Yt.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("ul",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?{s:C.TRUE}:{s:C.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("st",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?{s:C.TRUE}:{s:C.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){return this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("it",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?Mt.ITALIC:Mt.NORMAL:this.getFontStyles()[0][0]}getFontStyles(){return this._getStyles("it")}getFontWeight(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("bl",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?Pt.BOLD:Pt.NORMAL:this.getFontWeights()[0][0]}getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:e,_worksheet:n}=this,{startRow:s,endRow:r}=e;let i=0;for(let o=0;o<=r-s;o++){const a=n.getRowHeight(o);i+=a}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:e,endColumn:n}=this._range;return n-e+1}getNumRows(){const{startRow:e,endRow:n}=this._range;return n-e+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(e=>e.map(n=>(n==null?void 0:n.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const e=this._deps.getStyles();return this.getValues().map(n=>n.map(s=>e.getStyleByCell(s)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:e,_worksheet:n}=this,{startColumn:s,endColumn:r}=e;let i=0;for(let o=0;o<=r-s;o++)i+=n.getColumnWidth(o);return i}getWrap(){return this.getWraps()[0][0]}getWraps(){return this._getStyles("tb")}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(e){ft.foreach(this._range,e)}_getStyles(e){const n=this._deps.getStyles();return this.getValues().map(s=>s.map(r=>{const i=n&&n.getStyleByCell(r);return i&&i[e]||Yt[e]}))}}class Vi{constructor(e,n){d(this,"_rowData");this._config=e,this._rowData=n}getRowData(){return this._rowData}getRowDatas(e,n){const s={};let r=0;for(let i=e;i<e+n;i++){const o=this.getRowOrCreate(i);s[r]=o,r++}return s}getRowHeight(e,n=1){const{_rowData:s}=this,r=this._config;let i=0;for(let o=0;o<n;o++){const a=s[o+e]||{hd:C.FALSE,h:r.defaultRowHeight},{isAutoHeight:h,ah:l,h:u=r.defaultRowHeight}=a;i+=(h==null||h)&&typeof l=="number"?l:u}return i}getRow(e){return this._rowData[e]}getRowOrCreate(e){const{_rowData:n}=this,s=n[e];if(s)return s;const r=this._config,i={hd:C.FALSE,h:r.defaultRowHeight};return n[e]=i,i}getHiddenRows(e=0,n=j(this._rowData)-1){const s=[];let r=!1,i=-1;for(let o=e;o<=n;o++){const a=this.getRowVisible(o);r&&a?(r=!1,s.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:Y.ROW})):!r&&!a&&(r=!0,i=o)}return r&&s.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:Y.ROW}),s}getRowVisible(e){const n=this.getRow(e);return n?n.hd!==C.TRUE:!0}getSize(){return j(this._rowData)}}class Us extends M{constructor(){super(...arguments);d(this,"_cellContentInterceptors",[]);d(this,"_rowFilteredInterceptors",[]);d(this,"_rowVisibleInterceptors",[]);d(this,"_colVisibleInterceptors",[])}dispose(){super.dispose(),this._cellContentInterceptors.length=0,this._rowFilteredInterceptors.length=0,this._rowVisibleInterceptors.length=0,this._colVisibleInterceptors.length=0}getCell(n,s){for(const r of this._cellContentInterceptors){const i=r.getCell(n,s);if(typeof i<"u")return i}return null}registerCellContentInterceptor(n){if(this._cellContentInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptors.push(n),D(()=>Q(this._cellContentInterceptors,n))}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptors.push(n),D(()=>Q(this._rowFilteredInterceptors,n))}registerRowVisibleInterceptor(n){if(this._rowVisibleInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowVisibleInterceptors.push(n),D(()=>Q(this._rowVisibleInterceptors,n))}registerColVisibleInterceptor(n){if(this._colVisibleInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._colVisibleInterceptors.push(n),D(()=>Q(this._colVisibleInterceptors,n))}}class Nt{constructor(e,n){d(this,"_initialized");d(this,"_sheetId");d(this,"_snapshot");d(this,"_cellData");d(this,"_rowManager");d(this,"_columnManager");d(this,"_viewModel");this._styles=n;const s={...zt,mergeData:[],hideRow:[],hideColumn:[],cellData:{},rowData:{},columnData:{},rowHeader:{width:46,hidden:C.FALSE},columnHeader:{height:20,hidden:C.FALSE},selections:["A1"],rightToLeft:C.FALSE,pluginMeta:{},...e};this._snapshot=s;const{columnData:r,rowData:i,cellData:o}=this._snapshot;this._sheetId=this._snapshot.id??A.generateRandomId(6),this._initialized=!1,this._cellData=new z(o),this._rowManager=new Vi(this._snapshot,i),this._columnManager=new xi(this._snapshot,r),this._viewModel=new Us}__interceptViewModel(e){e(this._viewModel)}getSnapshot(){return this._snapshot}getCellMatrix(){return this._cellData}getRowManager(){return this._rowManager}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:e}=this,n=A.deepClone(e);return new Nt(n,this._styles)}getMergeData(){return this._snapshot.mergeData}getMergedCells(e,n){const s=this._snapshot.mergeData,r=[];for(let i=0;i<s.length;i++){const o=s[i];ht.intersects({startRow:e,startColumn:n,endRow:e,endColumn:n},o)&&r.push(o)}return r.length?r:null}getMergedCell(e,n){const s=this._snapshot.mergeData;for(let r=0;r<s.length;r++){const i=s[r];if(ht.intersects({startRow:e,startColumn:n,endRow:e,endColumn:n},i))return i}return null}getCell(e,n){return e<0||n<0?null:this._viewModel.getCell(e,n)}getCellRaw(e,n){return this.getCellMatrix().getValue(e,n)}getMatrixWithMergedCells(e,n,s,r){const i=this.getCellMatrix(),o=this._snapshot.mergeData.filter(h=>ht.intersects({startRow:e,startColumn:n,endRow:s,endColumn:r},h)),a=new z;return de(e,s,n,r).forEach((h,l)=>{const u=i.getValue(h,l);u&&a.setValue(h,l,u)}),o.forEach(h=>{const{startColumn:l,startRow:u,endColumn:_,endRow:g}=h;de(u,g,l,_).forEach((f,E)=>{f===u&&E===l&&a.setValue(f,E,{...i.getValue(f,E),rowSpan:g-u+1,colSpan:_-l+1}),(f!==u||E!==l)&&a.realDeleteValue(f,E)})}),a}getRange(e,n,s,r){return typeof e=="object"?new ft(this,e,{getStyles:()=>this._styles}):new ft(this,{startRow:e,startColumn:n,endColumn:r||n,endRow:s||e},{getStyles:()=>this._styles})}getStatus(){const{_snapshot:e}=this;return e.status}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){const{_snapshot:e}=this,{columnCount:n}=e;return n}getMaxRows(){const{_snapshot:e}=this,{rowCount:n}=e;return n}getType(){const{_snapshot:e}=this,{type:n}=e;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(e){this._snapshot.rowCount=e}getColumnCount(){return this._snapshot.columnCount}setColumnCount(e){this._snapshot.columnCount=e}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:e}=this,{showGridlines:n}=e;return n===0}getTabColor(){const{_snapshot:e}=this,{tabColor:n}=e;return n}getColumnWidth(e){return this.getColumnManager().getColumnWidth(e)}getRowHeight(e){return this.getRowManager().getRowHeight(e)}getRowVisible(e){return this.getRowManager().getRowVisible(e)}getHiddenRows(e,n){const s=this.getMaxColumns()-1,r=this._rowManager.getHiddenRows(e,n);return r.forEach(i=>i.endColumn=s),r}getColVisible(e){return this._columnManager.getColVisible(e)}getHiddenCols(e,n){const s=this.getMaxRows()-1,r=this._columnManager.getHiddenCols(e,n);return r.forEach(i=>i.endRow=s),r}isRightToLeft(){const{_snapshot:e}=this,{rightToLeft:n}=e;return n}getPluginMeta(e){return this._snapshot.pluginMeta[e]}setPluginMeta(e,n){this._snapshot.pluginMeta[e]=n}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}cellHasValue(e){return e&&(e.v!==void 0||e.f!==void 0||e.p!==void 0)}}var pi=Object.defineProperty,ji=Object.getOwnPropertyDescriptor,zi=(t,e,n,s)=>{for(var r=s>1?void 0:s?ji(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&pi(e,n,r),r},Yi=(t,e)=>(n,s)=>e(n,s,t);function Ki(t,e){return`${t.getUnitId()}|${e.getSheetId()}`}c.Workbook=class extends M{constructor(n={},s){super();d(this,"_sheetCreated$",new N.Subject);d(this,"sheetCreated$",this._sheetCreated$.asObservable());d(this,"_sheetDisposed$",new N.Subject);d(this,"sheetDisposed$",this._sheetDisposed$.asObservable());d(this,"_genName",new wn);d(this,"_activeSheet$",new N.BehaviorSubject(null));d(this,"activeSheet$",this._activeSheet$.asObservable());d(this,"_worksheets");d(this,"_styles");d(this,"_snapshot");d(this,"_unitId");this._injector=s,this._snapshot=A.commonExtend(Os,n);const{styles:r}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=A.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new vs(r),this._worksheets=new Map,this._getDefaultWorkSheet()}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete()}save(){return this._snapshot}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getRev(){return this._snapshot.rev??1}incrementRev(){this._snapshot.rev=this.getRev()+1}getShouldRenderLoopImmediately(){return this._snapshot.shouldStartRenderingImmediately!==!1}getContainer(){return this._snapshot.container}addWorksheet(n,s,r){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=r,o.splice(s,0,n);const a=new Nt(r,this._styles);return this._worksheets.set(n,a),this._sheetCreated$.next(a),!0}getParentRenderUnitId(){return this._snapshot.parentRenderUnitId}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:s}=this._snapshot;return s.findIndex(r=>r===n)}getRawActiveSheet(){const{sheetOrder:n}=this._snapshot;return n.find(r=>this._worksheets.get(r).getStatus()===C.TRUE)}getActiveSheet(){const{sheetOrder:n}=this._snapshot,s=this.getRawActiveSheet();return s?this._worksheets.get(s):this._worksheets.get(n[0])}__setActiveSheet(n){this._activeSheet$.next(n)}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(s=>this._worksheets.get(s).getStatus()===1)}getSheetSize(){return this._snapshot.sheetOrder.length}flush(){}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(s=>this._worksheets.get(s))}getSheetIndex(n){const{sheetOrder:s}=this._snapshot;return s.findIndex(r=>n.getSheetId()===r)}getSheetBySheetName(n){const{sheetOrder:s}=this._snapshot,r=s.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(r)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:s}=this._snapshot;return this._worksheets.get(s[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===C.TRUE).map(n=>n.getConfig().id)}transformRangeType(n){if(typeof n=="string")return this._getCellRange(n);if(typeof n!="string"&&"row"in n){const s=n;return{sheetId:"",range:{startRow:s.row[0],startColumn:s.column[0],endRow:s.row[1],endColumn:s.column[1]}}}return typeof n!="string"&&"startRow"in n?{sheetId:"",range:n}:St}load(n){this._snapshot=n}_getCellRange(n){var u,_,g,f,E;let s="",r="";if(n.indexOf("!")>-1){const R=n.split("!");s=R[0],r=R[1],s=s.replace(/\\'/g,"'").replace(/''/g,"'"),s.substring(0,1)==="'"&&s.substring(s.length-1,1)==="'"&&(s=s.substring(1,s.length-1))}else r=n;if(r.indexOf(":")===-1){const R=parseInt(r.replace(/[^0-9]/g,""),10)-1,m=A.ABCatNum(r.replace(/[^A-Za-z]/g,""));return!Number.isNaN(R)&&!Number.isNaN(m)?{sheetId:s,range:{startRow:R,endRow:R,startColumn:m,endColumn:m}}:St}r=r.split(":");const i=[0,0],o=[0,0],a=((u=this.getSheetBySheetName(s))==null?void 0:u.getMaxRows())||((_=this.getActiveSheet())==null?void 0:_.getMaxRows()),h=((g=this.getSheetBySheetName(s))==null?void 0:g.getMaxColumns())||((f=this.getActiveSheet())==null?void 0:f.getMaxColumns());return i[0]=parseInt(r[0].replace(/[^0-9]/g,""),10)-1,i[1]=parseInt(r[1].replace(/[^0-9]/g,""),10)-1,Number.isNaN(i[0])&&(i[0]=0),Number.isNaN(i[1])&&(i[1]=a),i[0]>i[1]||(o[0]=A.ABCatNum(r[0].replace(/[^A-Za-z]/g,"")),o[1]=A.ABCatNum(r[1].replace(/[^A-Za-z]/g,"")),Number.isNaN(o[0])&&(o[0]=0),Number.isNaN(o[1])&&(o[1]=h),o[0]>o[1])?St:{sheetId:((E=this.getSheetBySheetName(s))==null?void 0:E.getSheetId())||"",range:{startRow:i[0],endRow:i[1],startColumn:o[0],endColumn:o[1]}}}_getDefaultWorkSheet(){const{_snapshot:n,_worksheets:s}=this,{sheets:r,sheetOrder:i}=n;A.isEmptyObject(r)&&(r[zt.id]=Object.assign(zt,{status:C.TRUE}));for(const o in r){const a=r[o];a.name=this._genName.sheetName(a.name);const h=new Nt(a,this._styles);s.set(o,h),i.includes(o)||i.push(o)}}},c.Workbook=zi([Yi(1,O.Inject(O.Injector))],c.Workbook);class Oe{constructor(e){d(this,"_snapshot");d(this,"_unitId");this._snapshot={...Ls,...e},this._unitId=this._snapshot.id??A.generateRandomId(6)}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var e;return(e=this._snapshot.body)==null?void 0:e.pages}getPageOrder(){var e;return(e=this._snapshot.body)==null?void 0:e.pageOrder}getPage(e){const n=this.getPages();return n==null?void 0:n[e]}getElementsByPage(e){var n;return(n=this.getPage(e))==null?void 0:n.pageElements}getElement(e,n){var s;return(s=this.getElementsByPage(e))==null?void 0:s[n]}getPageSize(){return this._snapshot.pageSize}addPage(){return{id:"cover_1",pageType:me.SLIDE,zIndex:1,title:"cover",description:"this is first page, cover",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}}const Ae="FOCUSING_SHEET",Ie="FOCUSING_DOC",Ce="FOCUSING_SLIDE",Xi="FOCUSING_EDITOR_BUT_HIDDEN",Ms="FOCUSING_EDITOR",Qi="FOCUSING_EDITOR_INPUT_FORMULA",Ps="FOCUSING_FORMULA_EDITOR";var Zi=Object.defineProperty,qi=Object.getOwnPropertyDescriptor,Ji=(t,e,n,s)=>{for(var r=s>1?void 0:s?qi(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&Zi(e,n,r),r},yi=(t,e)=>(n,s)=>e(n,s,t),Fs=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.DOC=1]="DOC",t[t.SHEET=2]="SHEET",t[t.SLIDE=3]="SLIDE",t))(Fs||{});const gt=O.createIdentifier("univer.current");let Se=class extends M{constructor(e,n){super();d(this,"_focused$",new N.BehaviorSubject(null));d(this,"_focused",null);d(this,"focused$",this._focused$.asObservable());d(this,"_currentSheet$",new N.BehaviorSubject(null));d(this,"currentSheet$",this._currentSheet$.asObservable());d(this,"_currentDoc$",new N.BehaviorSubject(null));d(this,"currentDoc$",this._currentDoc$.asObservable());d(this,"_currentSlide$",new N.BehaviorSubject(null));d(this,"currentSlide$",this._currentSlide$.asObservable());d(this,"_sheetAdded$",new N.Subject);d(this,"sheetAdded$",this._sheetAdded$.asObservable());d(this,"_docAdded$",new N.Subject);d(this,"docAdded$",this._docAdded$.asObservable());d(this,"_slideAdded$",new N.Subject);d(this,"slideAdded$",this._slideAdded$.asObservable());d(this,"_sheetDisposed$",new N.Subject);d(this,"sheetDisposed$",this._sheetDisposed$.asObservable());d(this,"_docDisposed$",new N.Subject);d(this,"docDisposed$",this._docDisposed$.asObservable());d(this,"_slideDisposed$",new N.Subject);d(this,"slideDisposed$",this._slideDisposed$.asObservable());d(this,"_sheets",[]);d(this,"_docs",[]);d(this,"_slides",[]);this._handler=e,this._contextService=n}dispose(){super.dispose(),this._focused$.complete(),this._currentDoc$.complete(),this._currentSheet$.complete(),this._currentSlide$.complete(),this._sheetAdded$.complete(),this._docAdded$.complete(),this._slideAdded$.complete(),this._sheetDisposed$.complete(),this._docDisposed$.complete(),this._slideDisposed$.complete()}createDoc(e){return this._handler.createUniverDoc(e)}createSheet(e){return this._handler.createUniverSheet(e)}createSlide(e){return this._handler.createUniverSlide(e)}addSheet(e){this._sheets.push(e),this._sheetAdded$.next(e),this.setCurrentUniverSheetInstance(e.getUnitId())}changeDoc(e,n){const s=this._docs.find(r=>r.getUnitId()===e);if(s!=null){const r=this._docs.indexOf(s);this._docs.splice(r,1)}this.addDoc(n)}addDoc(e){this._docs.push(e),this._docAdded$.next(e),this.setCurrentUniverDocInstance(e.getUnitId())}addSlide(e){this._slides.push(e),this._slideAdded$.next(e),this.setCurrentUniverSlideInstance(e.getUnitId())}getUniverSheetInstance(e){return this._sheets.find(n=>n.getUnitId()===e)}getUniverDocInstance(e){return this._docs.find(n=>n.getUnitId()===e)}getUniverSlideInstance(e){return this._slides.find(n=>n.getUnitId()===e)}getAllUniverSheetsInstance(){return this._sheets}getAllUniverDocsInstance(){return this._docs}getAllUniverSlidesInstance(){return this._slides}setCurrentUniverSheetInstance(e){this._currentSheet$.next(this.getUniverSheetInstance(e)||null)}setCurrentUniverSlideInstance(e){this._currentSlide$.next(this.getUniverSlideInstance(e)||null)}setCurrentUniverDocInstance(e){this._currentDoc$.next(this.getUniverDocInstance(e)||null)}getCurrentUniverSheetInstance(){const e=this._currentSheet$.getValue();if(!e)throw new Error("No current sheet!");return e}getCurrentUniverDocInstance(){const e=this._currentDoc$.getValue();if(!e)throw new Error("No current doc!");return e}getCurrentUniverSlideInstance(){const e=this._currentSlide$.getValue();if(!e)throw new Error("No current slide!");return e}focusUniverInstance(e){e&&(this._focused=this.getUniverSheetInstance(e)||this.getUniverDocInstance(e)||this.getUniverSlideInstance(e)||null),this._focused$.next(e),[Ie,Ae,Ce].forEach(n=>this._contextService.setContextValue(n,!1)),this._focused instanceof c.Workbook?this._contextService.setContextValue(Ae,!0):this._focused instanceof dt?this._contextService.setContextValue(Ie,!0):this._focused instanceof Oe&&this._contextService.setContextValue(Ce,!0)}getFocusedUniverInstance(){return this._focused}getDocumentType(e){if(this.getUniverDocInstance(e))return 1;if(this.getUniverSheetInstance(e))return 2;if(this.getUniverSlideInstance(e))return 3;throw new Error(`[UniverInstanceService]: No document with unitID ${e}`)}disposeDocument(e){const n=this.getUniverDocInstance(e);if(n){const i=this._docs.indexOf(n);return this._docs.splice(i,1),this._docDisposed$.next(n),this.focusUniverInstance(null),!0}const s=this.getUniverSheetInstance(e);if(s){const i=this._sheets.indexOf(s);return this._sheets.splice(i,1),this._sheetDisposed$.next(s),this.focusUniverInstance(null),!0}const r=this.getUniverSlideInstance(e);if(r){const i=this._slides.indexOf(r);return this._slides.splice(i,1),this._slideDisposed$.next(r),this.focusUniverInstance(null),!0}return!1}};Se=Ji([yi(1,at)],Se);var w=(t=>(t[t.Starting=0]="Starting",t[t.Ready=1]="Ready",t[t.Rendered=2]="Rendered",t[t.Steady=3]="Steady",t))(w||{});const Hs={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"},Xt=new Map;function Ne(t,e){return function(r){be(t,e)}}function be(t,e){Xt.has(t)||Xt.set(t,[]),Xt.get(t).push(e)}var to=Object.defineProperty,eo=Object.getOwnPropertyDescriptor,Bs=(t,e,n,s)=>{for(var r=s>1?void 0:s?eo(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&to(e,n,r),r},Le=(t,e)=>(n,s)=>e(n,s,t);c.LifecycleService=class extends M{constructor(n){super();d(this,"_lifecycle$",new N.BehaviorSubject(w.Starting));d(this,"lifecycle$",this._lifecycle$.asObservable());this._logService=n,this._logService.log("[LifecycleService]",`lifecycle progressed to "${Hs[w.Starting]}".`)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._logService.log("[LifecycleService]",`lifecycle progressed to "${Hs[n]}".`),this._lifecycle$.next(n))}subscribeWithPrevious(){return new N.Observable(n=>(this.stage===w.Starting||(this.stage===w.Ready?n.next(w.Starting):this.stage===w.Rendered?(n.next(w.Starting),n.next(w.Ready)):(n.next(w.Starting),n.next(w.Ready),n.next(w.Rendered))),this._lifecycle$.subscribe(n)))}},c.LifecycleService=Bs([Le(0,lt)],c.LifecycleService);let y=class extends M{constructor(e,n){super();d(this,"_started",!1);this._lifecycleService=e,this._injector=n}start(){this._started||(this._started=!0,this.disposeWithMe(D(this._lifecycleService.subscribeWithPrevious().subscribe(e=>this.initModulesOnStage(e)))))}initModulesOnStage(e){const n=Xt.get(e);n==null||n.forEach(s=>{this._injector.has(s)&&this._injector.get(s)})}};y=Bs([Le(0,O.Inject(c.LifecycleService)),Le(1,O.Inject(O.Injector))],y);function no(t,e){if(t)try{return t[e]?t[e]:e.split(".").reduce((n,s)=>n[s],t)}catch{return console.warn("Key %s not found",e),e}}class bt extends M{constructor(){super();d(this,"currentLocale",Ut.ZH_CN);d(this,"locales",null);d(this,"localeChanged$",new N.Subject);d(this,"t",n=>{if(!this.locales)throw new Error("Locale not initialized");return no(this.locales[this.currentLocale],n)??n});this.disposeWithMe(D(()=>this.localeChanged$.complete()))}load(n){this.locales=A.deepMerge(this.locales??{},n)}setLocale(n){this.currentLocale=n,this.localeChanged$.next()}getLocales(){var n;return(n=this.locales)==null?void 0:n[this.currentLocale]}getCurrentLocale(){return this.currentLocale}}const we=O.createIdentifier("resource-manager-service"),Ws=O.createIdentifier("ResourcePersistenceService");be(w.Ready,Ws);var so=Object.defineProperty,ro=Object.getOwnPropertyDescriptor,io=(t,e,n,s)=>{for(var r=s>1?void 0:s?ro(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&so(e,n,r),r},Gs=(t,e)=>(n,s)=>e(n,s,t);const ve=O.createIdentifier("univer.permission-service"),$s="PERMISSION";c.PermissionService=class extends M{constructor(n,s){super();d(this,"_permissionPointMap",new Map);d(this,"deletePermissionPoint",(n,s)=>{const r=this._permissionPointMap.get(n);if(r){const i=r.get(s);i&&(i.complete(),this._permissionPointMap.delete(s))}});d(this,"addPermissionPoint",(n,s)=>{const r=this._permissionPointMap.get(n)||new Map;return r.has(s.id)?!1:(r.set(s.id,new N.BehaviorSubject(s)),this._permissionPointMap.set(n,r),!0)});d(this,"updatePermissionPoint",(n,s,r)=>{const i=this._permissionPointMap.get(n);if(!i)return;const o=i.get(s);if(o){const a=o.getValue();a.value=r,a.status=_e.DONE,o.next(a)}});d(this,"getPermissionPoint",(n,s)=>{const r=this._permissionPointMap.get(n);if(!r)return;const i=r.get(s);if(i)return i.getValue()});this._resourceManagerService=n,this._univerInstanceService=s}_init(){this.disposeWithMe(D(this._univerInstanceService.sheetAdded$.subscribe(n=>{this._resourceManagerService.registerPluginResource(n.getUnitId(),$s,{onChange:(s,r)=>{r.forEach(i=>{this.getPermissionPoint(s,i.id)?this.updatePermissionPoint(s,i.id,i.value):this.addPermissionPoint(s,i)})},toJson:s=>this._toJson(s),parseJson:s=>this._parseJson(s)})}))),this.disposeWithMe(D(this._univerInstanceService.sheetDisposed$.subscribe(n=>{this._resourceManagerService.disposePluginResource(n.getUnitId(),$s)})))}_toJson(n){const s=this._permissionPointMap.get(n);let r=[];return s&&(r=[...s.keys()].reduce((i,o)=>{const a=s.get(o);return a&&i.push(a.getValue()),i},[])),JSON.stringify(r)}_parseJson(n){return JSON.parse(n)}composePermission$(n,s){const r=this._permissionPointMap.get(n),i=s.map(o=>{const a=r==null?void 0:r.get(o);if(!a)throw new Error(`${o} permissionPoint is not exist`);return a.asObservable()});return N.combineLatest(i).pipe(er.map(o=>(o.every(a=>this._permissionPointMap.get(a.id)),o)))}composePermission(n,s){const r=this._permissionPointMap.get(n);return s.map(o=>{const a=r==null?void 0:r.get(o);if(!a)throw new Error(`${o} permissionPoint is not exist`);return a.getValue()})}},c.PermissionService=io([Ne(w.Starting,c.PermissionService),Gs(0,O.Inject(we)),Gs(1,O.Inject(gt))],c.PermissionService);const ks="univer.editable";class Qt extends Fn{constructor(n){super();d(this,"id",ks);d(this,"value",!0);d(this,"unitID");this.unitID=n}}var oo=Object.defineProperty,ao=Object.getOwnPropertyDescriptor,lo=(t,e,n,s)=>{for(var r=s>1?void 0:s?ao(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&oo(e,n,r),r},xs=(t,e)=>(n,s)=>e(n,s,t);c.UniverPermissionService=class extends M{constructor(e,n){super(),this._permissionService=e,this._univerInstanceService=n,this._init()}_init(){this._univerInstanceService.sheetAdded$.subscribe(e=>{const n=new Qt(e.getUnitId());this._permissionService.addPermissionPoint(e.getUnitId(),n)})}getEditable(e){let n=e;n||(n=this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId());const s=new Qt(n),r=this._permissionService.getPermissionPoint(n,s.id);return r==null?void 0:r.value}setEditable(e,n){const s=new Qt(e);this._permissionService.updatePermissionPoint(e,s.id,n)}},c.UniverPermissionService=lo([Ne(w.Starting,c.UniverPermissionService),xs(0,O.Inject(ve)),xs(1,O.Inject(gt))],c.UniverPermissionService);class Vs extends M{constructor(){super(...arguments);d(this,"_resourceMap",new Map);d(this,"_register$",new N.Subject);d(this,"register$",this._register$.asObservable())}getAllResource(n){const s=this._resourceMap.get(n);return s?[...s.keys()].reduce((r,i)=>{const o=s.get(i);return o&&r.push({unitID:n,resourceName:i,hook:o}),r},[]):[]}registerPluginResource(n,s,r){const i=this._resourceMap.get(n)||new Map;if(i.has(s))throw new Error("the pluginName is registered");return i.set(s,r),this._resourceMap.set(n,i),this._register$.next({unitID:n,resourceName:s,hook:r}),D(()=>i.delete(s))}disposePluginResource(n,s){const r=this._resourceMap.get(n);r==null||r.delete(s)}dispose(){this._register$.complete(),this._resourceMap.clear()}}class De extends M{constructor(){super();d(this,"_currentTheme");d(this,"_currentTheme$",new N.BehaviorSubject({}));d(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(D(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}}const ps="__defaultDocumentNormalEditorSpecialUnitId_20231006__",js="__defaultDocumentFormulaBarEditorSpecialUnitId_20231012__",uo=`\r
|
|
11
|
-
`;var co=Object.defineProperty,ho=Object.getOwnPropertyDescriptor,_o=(t,e,n,s)=>{for(var r=s>1?void 0:s?ho(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&co(e,n,r),r},Te=(t,e)=>(n,s)=>e(n,s,t);const Zt=O.createIdentifier("univer.undo-redo.service"),fo=20;c.LocalUndoRedoService=class extends M{constructor(n,s,r){super();d(this,"undoRedoStatus$");d(this,"_undoRedoStatus$",new N.BehaviorSubject({undos:0,redos:0}));d(this,"_undoStacks",new Map);d(this,"_redoStacks",new Map);this._univerInstanceService=n,this._commandService=s,this._contextService=r,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(Ys)),this.disposeWithMe(this._commandService.registerCommand(Ks)),this.disposeWithMe(D(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(D(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:s}=n,r=this._getRedoStack(s,!0),i=this._getUndoStack(s,!0);r.length=0,i.push(n),i.length>fo&&i.splice(0,1),this._updateStatus()}clearUndoRedo(n){const s=this._getRedoStack(n);s&&(s.length=0);const r=this._getUndoStack(n);r&&(r.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getUndoStackForFocused();return n.length?n[n.length-1]:null}pitchTopRedoElement(){const n=this._getRedoStackForFocused();return n.length?n[n.length-1]:null}popUndoToRedo(){const s=this._getUndoStackForFocused().pop();s&&(this._getRedoStackForFocused().push(s),this._updateStatus())}popRedoToUndo(){const s=this._getRedoStackForFocused().pop();s&&(this._getUndoStackForFocused().push(s),this._updateStatus())}_updateStatus(){var i,o;const n=this._getFocusedUniverInstanceId(),s=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,r=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:s,redos:r})}_getUndoStack(n,s=!1){let r=this._undoStacks.get(n);return!r&&s&&(r=[],this._undoStacks.set(n,r)),r||null}_getRedoStack(n,s=!1){let r=this._redoStacks.get(n);return!r&&s&&(r=[],this._redoStacks.set(n,r)),r||null}_getUndoStackForFocused(){const n=this._getFocusedUniverInstanceId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUniverInstanceId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_getFocusedUniverInstanceId(){var s;let n="";return this._contextService.getContextValue(Ps)?n=js:this._contextService.getContextValue(Ms)?n=ps:n=((s=this._univerInstanceService.getFocusedUniverInstance())==null?void 0:s.getUnitId())??"",n}},c.LocalUndoRedoService=_o([Te(0,gt),Te(1,mt),Te(2,at)],c.LocalUndoRedoService);class zs{dispose(){}async dispatchToHandlers(){return!1}}const Ys=new class extends zs{constructor(){super(...arguments);d(this,"type",Tt.COMMAND);d(this,"id","univer.command.undo")}async handler(e){const n=e.get(Zt),s=n.pitchTopUndoElement();if(!s)return!1;const r=e.get(mt);return(s.undo?await s.undo(s.undoMutations):ne(s.undoMutations,r))?(n.popUndoToRedo(),!0):!1}},Ks=new class extends zs{constructor(){super(...arguments);d(this,"type",Tt.COMMAND);d(this,"id","univer.command.redo")}async handler(e){const n=e.get(Zt),s=n.pitchTopRedoElement();if(!s)return!1;const r=e.get(mt);return(s.redo?await s.redo(s.redoMutations):ne(s.redoMutations,r))?(n.popRedoToUndo(),!0):!1}};class qt extends M{constructor(){super(...arguments);d(this,"_started",!1)}addPlugins(n){if(this._started){const s=n.map(([r,i])=>this._initPlugin(r,i));this._pluginsRunLifecycle(s,w.Starting),setTimeout(()=>this._takePluginsThroughLifecycle(s))}else{const s=n.map(([r,i])=>this._initPlugin(r,i));this._takePluginsThroughLifecycle(s),this._started=!0}}_takePluginsThroughLifecycle(n,s=!1){this.disposeWithMe(D(this._lifecycleService.subscribeWithPrevious().subscribe(r=>{s&&r===w.Starting||this._pluginsRunLifecycle(n,r)})))}_pluginsRunLifecycle(n,s){n.forEach(r=>{switch(s){case w.Starting:r.onStarting(this._injector);break;case w.Ready:r.onReady();break;case w.Rendered:r.onRendered();break;case w.Steady:r.onSteady();break}}),this._lifecycleInitializerService.initModulesOnStage(s)}_initPlugin(n,s){return this._injector.createInstance(n,s)}}var go=Object.defineProperty,Eo=Object.getOwnPropertyDescriptor,Ro=(t,e,n,s)=>{for(var r=s>1?void 0:s?Eo(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&go(e,n,r),r},Ue=(t,e)=>(n,s)=>e(n,s,t);c.UniverDoc=class extends qt{constructor(e,n,s){super(),this._injector=e,this._lifecycleService=n,this._lifecycleInitializerService=s}createDoc(e){return this._injector.createInstance(dt,e)}},c.UniverDoc=Ro([Ue(0,O.Inject(O.Injector)),Ue(1,O.Inject(c.LifecycleService)),Ue(2,O.Inject(y))],c.UniverDoc);var mo=Object.defineProperty,Oo=Object.getOwnPropertyDescriptor,Ao=(t,e,n,s)=>{for(var r=s>1?void 0:s?Oo(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&mo(e,n,r),r},Me=(t,e)=>(n,s)=>e(n,s,t);c.UniverSheet=class extends qt{constructor(e,n,s){super(),this._injector=e,this._lifecycleService=n,this._lifecycleInitializerService=s}createSheet(e){return this._injector.createInstance(c.Workbook,e)}},c.UniverSheet=Ao([Me(0,O.Inject(O.Injector)),Me(1,O.Inject(c.LifecycleService)),Me(2,O.Inject(y))],c.UniverSheet);var Io=Object.defineProperty,Co=Object.getOwnPropertyDescriptor,So=(t,e,n,s)=>{for(var r=s>1?void 0:s?Co(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&Io(e,n,r),r},Pe=(t,e)=>(n,s)=>e(n,s,t);c.UniverSlide=class extends qt{constructor(e,n,s){super(),this._injector=e,this._lifecycleService=n,this._lifecycleInitializerService=s}createSlide(e){return this._injector.createInstance(Oe,e)}},c.UniverSlide=So([Pe(0,O.Inject(O.Injector)),Pe(1,O.Inject(c.LifecycleService)),Pe(2,O.Inject(y))],c.UniverSlide);const No=200;class bo extends qt{constructor(n={}){super();d(this,"_injector");d(this,"_univerPluginStore",new rr);d(this,"_univerPluginRegistry",new ir);d(this,"_univerSheet",null);d(this,"_univerDoc",null);d(this,"_univerSlide",null);d(this,"_initLazyPluginsTimer");this._injector=this._initDependencies();const{theme:s,locale:r,locales:i,logLevel:o}=n;s&&this._injector.get(De).setTheme(s),i&&this._injector.get(bt).load(i),r&&this._injector.get(bt).setLocale(r),o&&this._injector.get(lt).setLogLevel(o)}get _univerInstanceService(){return this._injector.get(gt)}get _lifecycleService(){return this._injector.get(c.LifecycleService)}get _lifecycleInitializerService(){return this._injector.get(y)}__getInjector(){return this._injector}dispose(){this._injector.dispose()}setLocale(n){this._injector.get(bt).setLocale(n)}createUniverSheet(n){let s;const r=()=>{s=this._univerSheet.createSheet(n),this._univerInstanceService.addSheet(s)};if(this._univerSheet)r();else{this._tryProgressToStart();const i=this._univerSheet=this._injector.createInstance(c.UniverSheet),o=this._univerPluginRegistry.getRegisterPlugins(T.Sheet).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(T.Sheet),i.addPlugins(o),r(),this._tryProgressToReady()}return s}createUniverDoc(n){let s;const r=()=>{s=this._univerDoc.createDoc(n),this._univerInstanceService.addDoc(s)};if(this._univerDoc)r();else{this._tryProgressToStart();const i=this._univerDoc=this._injector.createInstance(c.UniverDoc),o=this._univerPluginRegistry.getRegisterPlugins(T.Doc).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(T.Doc),i.addPlugins(o),r(),this._tryProgressToReady()}return s}createUniverSlide(n){let s;const r=()=>{s=this._univerSlide.createSlide(n),this._univerInstanceService.addSlide(s)};if(this._univerSlide)r();else{this._tryProgressToStart();const i=this._univerSlide=this._injector.createInstance(c.UniverSlide),o=this._univerPluginRegistry.getRegisterPlugins(T.Slide).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(T.Slide),i.addPlugins(o),r(),this._tryProgressToReady()}return s}_initDependencies(){return new O.Injector([[gt,{useFactory:n=>new Se({createUniverDoc:s=>this.createUniverDoc(s),createUniverSheet:s=>this.createUniverSheet(s),createUniverSlide:s=>this.createUniverSlide(s)},n),deps:[at]}],[ye],[bt],[De],[c.LifecycleService],[y],[ve,{useClass:c.PermissionService}],[c.UniverPermissionService],[lt,{useClass:Ze,lazy:!0}],[mt,{useClass:c.CommandService,lazy:!0}],[Zt,{useClass:c.LocalUndoRedoService,lazy:!0}],[Je,{useClass:mr}],[at,{useClass:Xe}],[en,{useClass:tn,lazy:!0}],[we,{useClass:Vs,lazy:!0}]])}_tryProgressToStart(){this._started||(this._injector.get(y).start(),this._started=!0)}_tryProgressToReady(){this._injector.get(c.LifecycleService).stage<w.Ready&&(this._injector.get(c.LifecycleService).stage=w.Ready,this._univerPluginStore.forEachPlugin(s=>s.onReady()))}registerPlugin(n,s){if(n.type===T.Univer)this._registerUniverPlugin(n,s);else if(n.type===T.Sheet)this._registerSheetsPlugin(n,s);else if(n.type===T.Doc)this._registerDocsPlugin(n,s);else if(n.type===T.Slide)this._registerSlidesPlugin(n,s);else throw new Error(`Unimplemented plugin system for business: "${n.type}".`);if(this._started)return this._scheduleInitPluginAfterStarted()}_scheduleInitPluginAfterStarted(){this._initLazyPluginsTimer===void 0&&(this._initLazyPluginsTimer=setTimeout(()=>this._flushLazyPlugins(),No))}_flushLazyPlugins(){this._initLazyPluginsTimer=void 0;const n=this._univerPluginRegistry.getRegisterPlugins(T.Univer);if(n.length){this._univerPluginRegistry.clearPluginsOfType(T.Univer);const s=n.map(r=>this._injector.createInstance(r.plugin,r.options));this._takePluginsThroughLifecycle(s)}if(this._univerSheet){const s=this._univerPluginRegistry.getRegisterPlugins(T.Sheet).map(r=>[r.plugin,r.options]);s.length&&(this._univerSheet.addPlugins(s),this._univerPluginRegistry.clearPluginsOfType(T.Sheet))}if(this._univerDoc){const s=this._univerPluginRegistry.getRegisterPlugins(T.Doc).map(r=>[r.plugin,r.options]);s.length&&(this._univerDoc.addPlugins(s),this._univerPluginRegistry.clearPluginsOfType(T.Doc))}if(this._univerSlide){const s=this._univerPluginRegistry.getRegisterPlugins(T.Slide).map(r=>[r.plugin,r.options]);s.length&&(this._univerSlide.addPlugins(s),this._univerPluginRegistry.clearPluginsOfType(T.Slide))}}_registerUniverPlugin(n,s){if(this._started)this._univerPluginRegistry.registerPlugin(n,s);else{const r=this._injector.createInstance(n,s);r.onStarting(this._injector),this._univerPluginStore.addPlugin(r)}}_registerSheetsPlugin(n,s){this._univerPluginRegistry.registerPlugin(n,s)}_registerDocsPlugin(n,s){this._univerPluginRegistry.registerPlugin(n,s)}_registerSlidesPlugin(n,s){this._univerPluginRegistry.registerPlugin(n,s)}}function Lo(t){const e=new MessageChannel;let n=!1;return e.port1.onmessage=()=>{n||t()},e.port2.postMessage(null),()=>{n=!0}}class wo extends Dt{add(e){if(!e)return null;const n=new vt(e,this);return this._observers=[n],this._onObserverAdded&&this._onObserverAdded(n),n}makeObserverTopPriority(){}makeObserverBottomPriority(){}}const vo=O.createIdentifier("ILocalStorageService"),Do=t=>`sheet_interceptor_${t}`,Xs=t=>function(e,n){let s=-1;function r(i,o){if(i<=s)throw new Error("[SheetInterceptorService]: next() called multiple times!");return s=i,i===t.length?o:t[i].handler(o,n,r.bind(null,i+1))}return r(0,e)};class To{constructor(e){d(this,"_interceptorsByName",new Map);d(this,"_interceptorPoints");this._interceptorPoints=e}fetchThroughInterceptors(e){const n=e,s=this._interceptorsByName.get(n);return Xs(s||[])}intercept(e,n){const s=e;this._interceptorsByName.has(s)||this._interceptorsByName.set(s,[]);const r=this._interceptorsByName.get(s);return r.push(n),this._interceptorsByName.set(s,r.sort((i,o)=>(o.priority??0)-(i.priority??0))),()=>Q(this._interceptorsByName.get(s),n)}getInterceptPoints(){return this._interceptorPoints}}const Qs=`'?\\[((?![\\/?:"<>|*\\\\]).)*\\]`,Uo=/[^0-9]/g,Mo=/[^A-Za-z]/g;function Lt(t){const e=t[0]==="$",s=t.substring(1).indexOf("$")>-1;return e&&s?K.ALL:e?K.COLUMN:s?K.ROW:K.NONE}function Po(t){const e=t.split("!");e.length>1&&(t=e[e.length-1]);const n=t.split(":");return n.length>1?{startAbsoluteRefType:Lt(n[0]),endAbsoluteRefType:Lt(n[1])}:{startAbsoluteRefType:Lt(n[0])}}function Zs(t=K.NONE){let e="",n="";return t===K.ROW?e="$":t===K.COLUMN?n="$":t===K.ALL&&(e="$",n="$"),{rowAbsoluteString:e,columnAbsoluteString:n}}function Jt(t){const{startColumn:e,startRow:n,endColumn:s,endRow:r,startAbsoluteRefType:i,endAbsoluteRefType:o}=t,a=Zs(i),h=Zs(o),l=`${a.columnAbsoluteString}${A.chatAtABC(e)}${a.rowAbsoluteString}${n+1}`,u=`${h.columnAbsoluteString}${A.chatAtABC(s)}${h.rowAbsoluteString}${r+1}`;return l===u?l:`${l}:${u}`}function qs(t,e){return`${t}!${Jt(e)}`}function Js(t,e,n){return`[${t}]${e}!${Jt(n)}`}function Fo(t){const{unitId:e,sheetName:n,range:s}=t;return e!=null&&e.length>0&&n!=null&&n.length>0?Js(e,n,s):n!=null&&n.length>0?qs(n,s):Jt(s)}function Fe(t){const e=parseInt(t.replace(Uo,""))-1,n=A.ABCatNum(t.replace(Mo,"")),s=Lt(t);return{row:e,column:n,absoluteRefType:s}}function Ho(t){const e=new RegExp(Qs).exec(t);let n="";e!=null&&(n=e[0],t=t.replace(new RegExp(Qs,"g"),""));const s=t.indexOf("!");let r="",i="";s>-1?(r=t.substring(0,s),i=t.substring(s)):i=t;const o=i.indexOf(":");if(o===-1){const R=Fe(i),m=R.row,I=R.column,S=R.absoluteRefType;return{unitId:n,sheetName:r,range:{startRow:m,startColumn:I,endRow:m,endColumn:I,startAbsoluteRefType:S,endAbsoluteRefType:S}}}const a=i.substring(0,o),h=i.substring(o+1),l=Fe(a),u=Fe(h),_=l.row,g=l.column,f=u.row,E=u.column;return{unitId:n,sheetName:r,range:{startRow:_,startColumn:g,endRow:f,endColumn:E,startAbsoluteRefType:l.absoluteRefType,endAbsoluteRefType:u.absoluteRefType}}}nr(),c.ABCToNumber=gi,c.ACTION_NAMES=ms,c.AbsoluteRefType=K,c.AlignTypeH=fs,c.AlignTypeV=gs,c.AutoFillSeries=on,c.BaselineOffset=Ft,c.BlockType=Zn,c.BooleanNumber=C,c.BorderStyleTypes=L,c.BorderType=an,c.BulletAlignment=J,c.COLORS=re,c.CellValueType=At,c.Color=rt,c.ColorBuilder=Bt,c.ColorKit=x,c.ColorType=$,c.ColumnSeparatorType=yn,c.CommandType=Tt,c.CommonHideTypes=ln,c.ConditionType=un,c.ContentAlignment=us,c.ContextService=Xe,c.CopyPasteType=cn,c.CustomRangeType=Qn,c.DEFAULT_CELL=Wi,c.DEFAULT_DOC=Re,c.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=Or,c.DEFAULT_EMPTY_DOCUMENT_VALUE=uo,c.DEFAULT_RANGE=Hi,c.DEFAULT_RANGE_ARRAY=St,c.DEFAULT_SELECTION=Bi,c.DEFAULT_SLIDE=Ls,c.DEFAULT_STYLES=Yt,c.DEFAULT_WORKBOOK=Os,c.DEFAULT_WORKSHEET=zt,c.DEFAULT_WORKSHEET_COLUMN_COUNT=Is,c.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=bs,c.DEFAULT_WORKSHEET_COLUMN_WIDTH=Ss,c.DEFAULT_WORKSHEET_ROW_COUNT=As,c.DEFAULT_WORKSHEET_ROW_HEIGHT=Cs,c.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Ns,c.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=js,c.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=ps,c.DashStyleType=os,c.DataStreamTreeNodeType=Wn,c.DataStreamTreeTokenType=fe,c.DesktopLogService=Ze,c.DeveloperMetadataVisibility=hn,c.Dimension=_n,c.Direction=dn,c.Disposable=M,c.DisposableCollection=Ke,c.DocStyleType=Kn,c.DocumentDataModel=dt,c.DocumentType=Fs,c.EXTENSION_NAMES=ws,c.Entry=ce,c.EntryIterator=Mn,c.ErrorService=ye,c.EventState=ze,c.FOCUSING_DOC=Ie,c.FOCUSING_EDITOR=Ms,c.FOCUSING_EDITOR_BUT_HIDDEN=Xi,c.FOCUSING_EDITOR_INPUT_FORMULA=Qi,c.FOCUSING_FORMULA_EDITOR=Ps,c.FOCUSING_SHEET=Ae,c.FOCUSING_SLIDE=Ce,c.FloatingObjectManagerService=tn,c.FollowNumberWithType=Xn,c.FontItalic=Mt,c.FontStyleType=cs,c.FontWeight=Pt,c.FormatType=fn,c.GenName=wn,c.GlyphType=Ct,c.GridType=qn,c.HLSColor=In,c.HorizontalAlign=st,c.ICommandService=mt,c.IConfigService=Je,c.IContextService=at,c.IFloatingObjectManagerService=en,c.ILocalStorageService=vo,c.ILogService=lt,c.IPermissionService=ve,c.IResourceManagerService=we,c.ISnapshotPersistenceService=Ws,c.IUndoRedoService=Zt,c.IUniverInstanceService=gt,c.InterceptorManager=To,c.InterpolationPointType=gn,c.KeyIterator=Tn,c.LRUHelper=It,c.LRUMap=Pn,c.LifecycleStages=w,c.LocaleService=bt,c.LocaleType=Ut,c.LogLevel=Qe,c.MemoryCursor=nn,c.NamedStyleType=rs,c.NumberUnitType=ds,c.ObjectMatrix=z,c.ObjectRelativeFromH=hs,c.ObjectRelativeFromV=_s,c.Observable=Dt,c.ObservableHooks=wo,c.Observer=vt,c.OnLifecycle=Ne,c.PRESET_LIST_TYPE=bi,c.PageElementType=Ds,c.PageOrientType=Rs,c.PageType=me,c.ParagraphElementType=es,c.PermissionPoint=Fn,c.PermissionStatus=_e,c.Plugin=Be,c.PluginType=T,c.PositionedObjectLayoutType=ss,c.PresetListType=jt,c.ProtectionType=En,c.RANGE_TYPE=Y,c.RGBA_PAREN=Nr,c.RGB_PAREN=Sr,c.Range=ft,c.Rectangle=ht,c.RedoCommand=Ks,c.RefAlias=fi,c.Registry=yt,c.RegistryAsMap=te,c.RelativeDate=Rn,c.RelativeSlideLink=Ts,c.ResourceManagerService=Vs,c.RgbColor=Wt,c.RxDisposable=hr,c.SectionType=Jn,c.ShapeType=mn,c.SheetTypes=se,c.SheetViewModel=Us,c.Slide=Oe,c.SpacingRule=is,c.Styles=vs,c.THEME_COLORS=An,c.TabStopAlignment=as,c.TextDecoration=On,c.TextDirection=Ot,c.TextDirectionType=ts,c.ThemeColor=Gt,c.ThemeColorType=H,c.ThemeColors=Ht,c.ThemeService=De,c.Tools=A,c.UndoCommand=Ys,c.Univer=bo,c.UniverEditablePermission=Qt,c.UniverEditablePermissionPoint=ks,c.UpdateDocsAttributeType=F,c.ValueIterator=Un,c.VerticalAlign=ut,c.WidthType=ls,c.Worksheet=Nt,c.WrapStrategy=ct,c.WrapTextType=ns,c.binarySearchArray=sn,c.characterSpacingControlType=Es,c.checkParagraphHasBullet=Xr,c.checkParagraphHasIndent=Qr,c.checkParagraphHasIndentByStyle=Nn,c.codeToBlob=Ir,c.composeInterceptors=Xs,c.concatMatrixArray=li,c.createInterceptorKey=Do,c.createRowColIter=de,c.datenum_local=Dn,c.dedupe=or,c.deepCompare=ae,c.deleteContent=Ln,c.deserializeRangeWithSheet=Ho,c.error=ue,c.fromObservable=cr,c.generate=ri,c.getAbsoluteRefTypeWitString=Po,c.getAbsoluteRefTypeWithSingleString=Lt,c.getArrayLength=j,c.getBorderStyleType=Yr,c.getCellValueType=$i,c.getColorStyle=p,c.getDocsUpdateBody=xt,c.getReverseDirection=Cr,c.getTypeFromPermissionItemList=_i,c.getWorksheetUID=Ki,c.handleJsonToDom=jr,c.handleStyleToString=zr,c.hashAlgorithm=oi,c.horizontalLineSegmentsSubtraction=le,c.insertMatrixArray=ai,c.insertTextToContent=bn,c.isEmptyCell=xr,c.isFormulaId=pr,c.isFormulaString=Vr,c.isICellData=Gi,c.isNullCell=ki,c.isObserver=Ye,c.isRealNum=ot,c.isSameStyleTextRun=Sn,c.isValidRange=Kr,c.makeCellRangeToRangeData=kr,c.makeCellToSelection=$r,c.moveMatrixArray=he,c.numberToABC=Ri,c.numberToListABC=mi,c.orderSearchArray=rn,c.remove=Q,c.repeatStringNumTimes=Bn,c.requestImmediateMacroTask=Lo,c.runOnLifecycle=be,c.searchArray=Ar,c.selectionToArray=di,c.sequence=Ge,c.sequenceAsync=We,c.sequenceExecute=ne,c.sequenceExecuteAsync=Rr,c.serializeRange=Jt,c.serializeRangeToRefString=Fo,c.serializeRangeWithSheet=qs,c.serializeRangeWithSpreadsheet=Js,c.sliceMatrixArray=ui,c.sortRules=Oi,c.sortRulesByDesc=Ai,c.sortRulesFactory=_t,c.toDisposable=D,c.update=ii,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
9
|
+
*/(function(t){(function(e,n){t.exports?t.exports=n():e.numeral=n()})(Xr,function(){var e,n,s="2.0.6",r={},i={},o={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},a={currentLocale:o.currentLocale,zeroFormat:o.zeroFormat,nullFormat:o.nullFormat,defaultFormat:o.defaultFormat,scalePercentBy100:o.scalePercentBy100};function h(l,u){this._input=l,this._value=u}return e=function(l){var u,d,g,f;if(e.isNumeral(l))u=l.value();else if(l===0||typeof l>"u")u=0;else if(l===null||n.isNaN(l))u=null;else if(typeof l=="string")if(a.zeroFormat&&l===a.zeroFormat)u=0;else if(a.nullFormat&&l===a.nullFormat||!l.replace(/[^0-9]+/g,"").length)u=null;else{for(d in r)if(f=typeof r[d].regexps.unformat=="function"?r[d].regexps.unformat():r[d].regexps.unformat,f&&l.match(f)){g=r[d].unformat;break}g=g||e._.stringToNumber,u=g(l)}else u=Number(l)||null;return new h(l,u)},e.version=s,e.isNumeral=function(l){return l instanceof h},e._=n={numberToFormat:function(l,u,d){var g=i[e.options.currentLocale],f=!1,E=!1,R=0,m="",I=1e12,S=1e9,v=1e6,W=1e3,B="",Et=!1,$,nt,P,p,He,Zs,X;if(l=l||0,nt=Math.abs(l),e._.includes(u,"(")?(f=!0,u=u.replace(/[\(|\)]/g,"")):(e._.includes(u,"+")||e._.includes(u,"-"))&&(He=e._.includes(u,"+")?u.indexOf("+"):l<0?u.indexOf("-"):-1,u=u.replace(/[\+|\-]/g,"")),e._.includes(u,"a")&&($=u.match(/a(k|m|b|t)?/),$=$?$[1]:!1,e._.includes(u," a")&&(m=" "),u=u.replace(new RegExp(m+"a[kmbt]?"),""),nt>=I&&!$||$==="t"?(m+=g.abbreviations.trillion,l=l/I):nt<I&&nt>=S&&!$||$==="b"?(m+=g.abbreviations.billion,l=l/S):nt<S&&nt>=v&&!$||$==="m"?(m+=g.abbreviations.million,l=l/v):(nt<v&&nt>=W&&!$||$==="k")&&(m+=g.abbreviations.thousand,l=l/W)),e._.includes(u,"[.]")&&(E=!0,u=u.replace("[.]",".")),P=l.toString().split(".")[0],p=u.split(".")[1],Zs=u.indexOf(","),R=(u.split(".")[0].split(",")[0].match(/0/g)||[]).length,p?(e._.includes(p,"[")?(p=p.replace("]",""),p=p.split("["),B=e._.toFixed(l,p[0].length+p[1].length,d,p[1].length)):B=e._.toFixed(l,p.length,d),P=B.split(".")[0],e._.includes(B,".")?B=g.delimiters.decimal+B.split(".")[1]:B="",E&&Number(B.slice(1))===0&&(B="")):P=e._.toFixed(l,0,d),m&&!$&&Number(P)>=1e3&&m!==g.abbreviations.trillion)switch(P=String(Number(P)/1e3),m){case g.abbreviations.thousand:m=g.abbreviations.million;break;case g.abbreviations.million:m=g.abbreviations.billion;break;case g.abbreviations.billion:m=g.abbreviations.trillion;break}if(e._.includes(P,"-")&&(P=P.slice(1),Et=!0),P.length<R)for(var Js=R-P.length;Js>0;Js--)P="0"+P;return Zs>-1&&(P=P.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+g.delimiters.thousands)),u.indexOf(".")===0&&(P=""),X=P+B+(m||""),f?X=(f&&Et?"(":"")+X+(f&&Et?")":""):He>=0?X=He===0?(Et?"-":"+")+X:X+(Et?"-":"+"):Et&&(X="-"+X),X},stringToNumber:function(l){var u=i[a.currentLocale],d=l,g={thousand:3,million:6,billion:9,trillion:12},f,E,R;if(a.zeroFormat&&l===a.zeroFormat)E=0;else if(a.nullFormat&&l===a.nullFormat||!l.replace(/[^0-9]+/g,"").length)E=null;else{E=1,u.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(u.delimiters.decimal,"."));for(f in g)if(R=new RegExp("[^a-zA-Z]"+u.abbreviations[f]+"(?:\\)|(\\"+u.currency.symbol+")?(?:\\))?)?$"),d.match(R)){E*=Math.pow(10,g[f]);break}E*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),E*=Number(l)}return E},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,u){return l.indexOf(u)!==-1},insert:function(l,u,d){return l.slice(0,d)+u+l.slice(d)},reduce:function(l,u){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof u!="function")throw new TypeError(u+" is not a function");var d=Object(l),g=d.length>>>0,f=0,E;if(arguments.length===3)E=arguments[2];else{for(;f<g&&!(f in d);)f++;if(f>=g)throw new TypeError("Reduce of empty array with no initial value");E=d[f++]}for(;f<g;f++)f in d&&(E=u(E,d[f],f,d));return E},multiplier:function(l){var u=l.toString().split(".");return u.length<2?1:Math.pow(10,u[1].length)},correctionFactor:function(){var l=Array.prototype.slice.call(arguments);return l.reduce(function(u,d){var g=n.multiplier(d);return u>g?u:g},1)},toFixed:function(l,u,d,g){var f=l.toString().split("."),E=u-(g||0),R,m,I,S;return f.length===2?R=Math.min(Math.max(f[1].length,E),u):R=E,I=Math.pow(10,R),S=(d(l+"e+"+R)/I).toFixed(R),g>u-R&&(m=new RegExp("\\.?0{1,"+(g-(u-R))+"}$"),S=S.replace(m,"")),S}},e.options=a,e.formats=r,e.locales=i,e.locale=function(l){return l&&(a.currentLocale=l.toLowerCase()),a.currentLocale},e.localeData=function(l){if(!l)return i[a.currentLocale];if(l=l.toLowerCase(),!i[l])throw new Error("Unknown locale : "+l);return i[l]},e.reset=function(){for(var l in o)a[l]=o[l]},e.zeroFormat=function(l){a.zeroFormat=typeof l=="string"?l:null},e.nullFormat=function(l){a.nullFormat=typeof l=="string"?l:null},e.defaultFormat=function(l){a.defaultFormat=typeof l=="string"?l:"0.0"},e.register=function(l,u,d){if(u=u.toLowerCase(),this[l+"s"][u])throw new TypeError(u+" "+l+" already registered.");return this[l+"s"][u]=d,d},e.validate=function(l,u){var d,g,f,E,R,m,I,S;if(typeof l!="string"&&(l+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",l)),l=l.trim(),l.match(/^\d+$/))return!0;if(l==="")return!1;try{I=e.localeData(u)}catch{I=e.localeData(e.locale())}return f=I.currency.symbol,R=I.abbreviations,d=I.delimiters.decimal,I.delimiters.thousands==="."?g="\\.":g=I.delimiters.thousands,S=l.match(/^[^\d]+/),S!==null&&(l=l.substr(1),S[0]!==f)||(S=l.match(/[^\d]+$/),S!==null&&(l=l.slice(0,-1),S[0]!==R.thousand&&S[0]!==R.million&&S[0]!==R.billion&&S[0]!==R.trillion))?!1:(m=new RegExp(g+"{2}"),l.match(/[^\d.,]/g)?!1:(E=l.split(d),E.length>2?!1:E.length<2?!!E[0].match(/^\d+.*\d$/)&&!E[0].match(m):E[0].length===1?!!E[0].match(/^\d+$/)&&!E[0].match(m)&&!!E[1].match(/^\d+$/):!!E[0].match(/^\d+.*\d$/)&&!E[0].match(m)&&!!E[1].match(/^\d+$/)))},e.fn=h.prototype={clone:function(){return e(this)},format:function(l,u){var d=this._value,g=l||a.defaultFormat,f,E,R;if(u=u||Math.round,d===0&&a.zeroFormat!==null)E=a.zeroFormat;else if(d===null&&a.nullFormat!==null)E=a.nullFormat;else{for(f in r)if(g.match(r[f].regexps.format)){R=r[f].format;break}R=R||e._.numberToFormat,E=R(d,g,u)}return E},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var u=n.correctionFactor.call(null,this._value,l);function d(g,f,E,R){return g+Math.round(u*f)}return this._value=n.reduce([this._value,l],d,0)/u,this},subtract:function(l){var u=n.correctionFactor.call(null,this._value,l);function d(g,f,E,R){return g-Math.round(u*f)}return this._value=n.reduce([l],d,Math.round(this._value*u))/u,this},multiply:function(l){function u(d,g,f,E){var R=n.correctionFactor(d,g);return Math.round(d*R)*Math.round(g*R)/Math.round(R*R)}return this._value=n.reduce([this._value,l],u,1),this},divide:function(l){function u(d,g,f,E){var R=n.correctionFactor(d,g);return Math.round(d*R)/Math.round(g*R)}return this._value=n.reduce([this._value,l],u),this},difference:function(l){return Math.abs(e(this._value).subtract(l).value())}},e.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(l){var u=l%10;return~~(l%100/10)===1?"th":u===1?"st":u===2?"nd":u===3?"rd":"th"},currency:{symbol:"$"}}),function(){e.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(l,u,d){var g=e._.includes(u," BPS")?" ":"",f;return l=l*1e4,u=u.replace(/\s?BPS/,""),f=e._.numberToFormat(l,u,d),e._.includes(f,")")?(f=f.split(""),f.splice(-1,0,g+"BPS"),f=f.join("")):f=f+g+"BPS",f},unformat:function(l){return+(e._.stringToNumber(l)*1e-4).toFixed(15)}})}(),function(){var l={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},u={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},d=l.suffixes.concat(u.suffixes.filter(function(f){return l.suffixes.indexOf(f)<0})),g=d.join("|");g="("+g.replace("B","B(?!PS)")+")",e.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(g)},format:function(f,E,R){var m,I=e._.includes(E,"ib")?u:l,S=e._.includes(E," b")||e._.includes(E," ib")?" ":"",v,W,B;for(E=E.replace(/\s?i?b/,""),v=0;v<=I.suffixes.length;v++)if(W=Math.pow(I.base,v),B=Math.pow(I.base,v+1),f===null||f===0||f>=W&&f<B){S+=I.suffixes[v],W>0&&(f=f/W);break}return m=e._.numberToFormat(f,E,R),m+S},unformat:function(f){var E=e._.stringToNumber(f),R,m;if(E){for(R=l.suffixes.length-1;R>=0;R--){if(e._.includes(f,l.suffixes[R])){m=Math.pow(l.base,R);break}if(e._.includes(f,u.suffixes[R])){m=Math.pow(u.base,R);break}}E*=m||1}return E}})}(),function(){e.register("format","currency",{regexps:{format:/(\$)/},format:function(l,u,d){var g=e.locales[e.options.currentLocale],f={before:u.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:u.match(/([\+|\-|\)|\s|\$]*)$/)[0]},E,R,m;for(u=u.replace(/\s?\$\s?/,""),E=e._.numberToFormat(l,u,d),l>=0?(f.before=f.before.replace(/[\-\(]/,""),f.after=f.after.replace(/[\-\)]/,"")):l<0&&!e._.includes(f.before,"-")&&!e._.includes(f.before,"(")&&(f.before="-"+f.before),m=0;m<f.before.length;m++)switch(R=f.before[m],R){case"$":E=e._.insert(E,g.currency.symbol,m);break;case" ":E=e._.insert(E," ",m+g.currency.symbol.length-1);break}for(m=f.after.length-1;m>=0;m--)switch(R=f.after[m],R){case"$":E=m===f.after.length-1?E+g.currency.symbol:e._.insert(E,g.currency.symbol,-(f.after.length-(1+m)));break;case" ":E=m===f.after.length-1?E+" ":e._.insert(E," ",-(f.after.length-(1+m)+g.currency.symbol.length-1));break}return E}})}(),function(){e.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,u,d){var g,f=typeof l=="number"&&!e._.isNaN(l)?l.toExponential():"0e+0",E=f.split("e");return u=u.replace(/e[\+|\-]{1}0/,""),g=e._.numberToFormat(Number(E[0]),u,d),g+"e"+E[1]},unformat:function(l){var u=e._.includes(l,"e+")?l.split("e+"):l.split("e-"),d=Number(u[0]),g=Number(u[1]);g=e._.includes(l,"e-")?g*=-1:g;function f(E,R,m,I){var S=e._.correctionFactor(E,R),v=E*S*(R*S)/(S*S);return v}return e._.reduce([d,Math.pow(10,g)],f,1)}})}(),function(){e.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,u,d){var g=e.locales[e.options.currentLocale],f,E=e._.includes(u," o")?" ":"";return u=u.replace(/\s?o/,""),E+=g.ordinal(l),f=e._.numberToFormat(l,u,d),f+E}})}(),function(){e.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,u,d){var g=e._.includes(u," %")?" ":"",f;return e.options.scalePercentBy100&&(l=l*100),u=u.replace(/\s?\%/,""),f=e._.numberToFormat(l,u,d),e._.includes(f,")")?(f=f.split(""),f.splice(-1,0,g+"%"),f=f.join("")):f=f+g+"%",f},unformat:function(l){var u=e._.stringToNumber(l);return e.options.scalePercentBy100?u*.01:u}})}(),function(){e.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(l,u,d){var g=Math.floor(l/60/60),f=Math.floor((l-g*60*60)/60),E=Math.round(l-g*60*60-f*60);return g+":"+(f<10?"0"+f:f)+":"+(E<10?"0"+E:E)},unformat:function(l){var u=l.split(":"),d=0;return u.length===3?(d=d+Number(u[0])*60*60,d=d+Number(u[1])*60,d=d+Number(u[2])):u.length===2&&(d=d+Number(u[0])*60,d=d+Number(u[1])),Number(d)}})}(),e})})(wn);var Qr=wn.exports;const ot=qr(Qr),ce={v:"#VALUE!",n:"#NAME?",na:"#N/A",r:"#REF!",d:"#DIV/0!",nm:"#NUM!",nl:"#NULL!",sp:"#SPILL!"};function Zr(t){let e=!1;for(const n in ce)if(t===ce[n]){e=!0;break}return e}function at(t){return t===null||t.toString().replace(/\s/g,"")===""||typeof t=="boolean"?!1:!isNaN(t)}function Jr(t){if(t===null||t.toString().length<5)return!1;if(e(t))return!0;return!1;function e(n){const s=/^(\d{4})-(\d{1,2})-(\d{1,2})(\s(\d{1,2}):(\d{1,2})(:(\d{1,2}))?)?$/,r=/^(\d{4})\/(\d{1,2})\/(\d{1,2})(\s(\d{1,2}):(\d{1,2})(:(\d{1,2}))?)?$/;if(!s.test(n)&&!r.test(n))return!1;const i=RegExp.$1,o=RegExp.$2,a=RegExp.$3;return!(i<1900||o>12||a>31||o===2&&(new Date(i,1,29).getDate()===29&&a>29||new Date(i,1,29).getDate()!==29&&a>28))}}let Vt=new Date("2017-02-19T19:06:09.000Z");Number.isNaN(Vt.getFullYear())&&(Vt=new Date("2/19/17"));const yr=Vt.getFullYear()===2017;function ti(t,e){const n=new Date(t);if(yr)return e>0?n.setTime(n.getTime()+n.getTimezoneOffset()*60*1e3):e<0&&n.setTime(n.getTime()-n.getTimezoneOffset()*60*1e3),n;if(t instanceof Date)return t;if(Vt.getFullYear()===1917&&!Number.isNaN(n.getFullYear())){const i=n.getFullYear();return t.indexOf(`${i}`)>-1||n.setFullYear(n.getFullYear()+100),n}const s=t.match(/\d+/g)||["2017","2","19","0","0","0"];let r=new Date(+s[0],+s[1]-1,+s[2],+s[3]||0,+s[4]||0,+s[5]||0);return t.indexOf("Z")>-1&&(r=new Date(r.getTime()-r.getTimezoneOffset()*60*1e3)),r}const ei=new Date(1900,2,1,0,0,0);function vn(t,e){let n=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());const s=Date.UTC(1899,11,31,0,0,0);return e?n-=1461*24*60*60*1e3:t>=ei&&(n+=24*60*60*1e3),(n-s)/(24*60*60*1e3)}function ni(t){let e=null,n={},s=t;if(t===null)return null;if(/^-?[0-9]{1,}[,][0-9]{3}(.[0-9]{1,2})?$/.test(t)){e=t,s=Number(t.split(".")[0].replace(",",""));let r="#,##0";if(t.split(".")[1]){r="#,##0.";for(let i=0;i<t.split(".")[1].length;i++)r+=0}n={fa:r,t:"n"}}else if(t.toString().substr(0,1)==="'")e=t.toString().substr(1),n={fa:"@",t:"s"};else if(t.toString().toUpperCase()==="TRUE")e="TRUE",n={fa:"General",t:"b"},s=!0;else if(t.toString().toUpperCase()==="FALSE")e="FALSE",n={fa:"General",t:"b"},s=!1;else if(Zr(t))e=t.toString(),n={fa:"General",t:"e"};else if(/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(t))e=t.toString(),n={fa:"@",t:"s"};else if(at(t)&&Math.abs(parseFloat(t))>0&&(Math.abs(parseFloat(t))>=1e11||Math.abs(parseFloat(t))<1e-9)){s=ot(t).value();const r=s.toExponential();if(r.indexOf(".")>-1){let i=r.split(".")[1].split("e")[0].length;i>5&&(i=5),n={fa:`#0.${new Array(i+1).join("0")}E+00`,t:"n"}}else n={fa:"#0.E+00",t:"n"};e=Z.format(n.fa,s)}else if(t.toString().indexOf("%")>-1){const r=t.toString().indexOf("%"),i=t.toString().substr(0,r),o=i.replace(/,/g,"");if(r===t.toString().length-1&&at(o))if(i.indexOf(".")>-1)if(i.indexOf(".")===i.lastIndexOf(".")){const a=i.split(".")[0];let l=i.split(".")[1].length;if(l>9&&(l=9),a.indexOf(",")>-1){let u=!0;const d=a.split(",");for(let g=1;g<d.length;g++)if(d[g].length<3){u=!1;break}u?(n={fa:`#,##0.${new Array(l+1).join("0")}%`,t:"n"},s=ot(t).value(),e=Z.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else n={fa:`0.${new Array(l+1).join("0")}%`,t:"n"},s=ot(t).value(),e=Z.format(n.fa,s)}else e=t.toString(),n={fa:"@",t:"s"};else if(i.indexOf(",")>-1){let a=!0;const h=i.split(",");for(let l=1;l<h.length;l++)if(h[l].length<3){a=!1;break}a?(n={fa:"#,##0%",t:"n"},s=ot(t).value(),e=Z.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else n={fa:"0%",t:"n"},s=ot(t).value(),e=Z.format(n.fa,s);else e=t.toString(),n={fa:"@",t:"s"}}else if(t.toString().indexOf(".")>-1)if(t.toString().indexOf(".")===t.toString().lastIndexOf(".")){const r=t.toString().split(".")[0],i=t.toString().split(".")[1];let o=i.length;if(o>9&&(o=9),r.indexOf(",")>-1){let a=!0;const h=r.split(",");for(let l=1;l<h.length;l++)if(!at(h[l])||h[l].length<3){a=!1;break}a?(n={fa:`#,##0.${new Array(o+1).join("0")}`,t:"n"},s=ot(t).value(),e=Z.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else at(r)&&at(i)?(n={fa:`0.${new Array(o+1).join("0")}`,t:"n"},s=ot(t).value(),e=Z.format(n.fa,s)):(e=t.toString(),n={fa:"@",t:"s"})}else e=t.toString(),n={fa:"@",t:"s"};else at(t)?(e=t.toString(),n={fa:"General",t:"n"},s=parseFloat(t)):Jr(t)&&(t.toString().indexOf(".")>-1||t.toString().indexOf(":")>-1||t.toString().length<16)?(s=vn(ti(t.toString().replace(/-/g,"/"))),s.toString().indexOf(".")>-1?t.toString().length>18?n.fa="yyyy-MM-dd hh:mm:ss":t.toString().length>11?n.fa="yyyy-MM-dd hh:mm":n.fa="yyyy-MM-dd":n.fa="yyyy-MM-dd",n.t="d",e=Z.format(n.fa,s)):(e=t,n.fa="General",n.t="g");return[e,n,s]}const Z={format(t,e){}},si=(t,e)=>{};function ri(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+(e<<6)+(e<<16)-e;return e>>>0}class It{static hasLength(e,n){return e.length===n}static getValueType(e){return Object.prototype.toString.apply(e)}static isObject(e){return this.getValueType(e)==="[object Object]"}static isIterable(e){return e[Symbol.iterator]!=null}static isNumber(e){return this.getValueType(e)==="[object Number]"}}const b=Symbol("newer"),U=Symbol("older");class Dn{constructor(e){_(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[b],{done:!1,value:e.key}):{done:!0,value:void 0}}}class Mn{constructor(e){_(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[b],{done:!1,value:e.value}):{done:!0,value:void 0}}}class Un{constructor(e){_(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[b],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}}}class he{constructor(e,n){_(this,"key");_(this,"value");_(this,Ho);_(this,Bo);this.key=e,this.value=n,this[b]=void 0,this[U]=void 0}toJSON(){return{key:this.key,value:this.value}}}Ho=b,Bo=U;class Tn{constructor(...e){_(this,"_keymap");_(this,"size",0);_(this,"limit");_(this,"oldest");_(this,"newest");_(this,"_onShiftListeners",[]);if(It.hasLength(e,1)){if(It.isNumber(e[0])){const n=e[0];this._initialize(n,void 0);return}if(It.isIterable(e[0])){const n=e[0];this._initialize(0,n);return}return}if(It.hasLength(e,2)){const n=e[0],s=e[1];this._initialize(n,s)}}onShift(e){if(this._onShiftListeners.indexOf(e)===-1)return this._onShiftListeners.push(e),D(()=>q(this._onShiftListeners,e));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(e,n){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=e,this._keymap=new Map,n&&(this.assign(n),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[b]&&(e===this.oldest&&(this.oldest=e[b]),e[b][U]=e[U]),e[U]&&(e[U][b]=e[b]),e[b]=void 0,e[U]=this.newest,this.newest&&(this.newest[b]=e),this.newest=e)}assign(e){let n,s=this.limit||Number.MAX_VALUE;this._keymap.clear();const r=e[Symbol.iterator]();for(let i=r.next();!i.done;i=r.next()){const o=new he(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[b]=o,o[U]=n):this.oldest=o,n=o,s--===0)throw new Error("overflow")}this.newest=n,this.size=this._keymap.size}set(e,n){let s=this._keymap.get(e);return s?(s.value=n,this._markEntryAsUsed(s),this):(this._keymap.set(e,s=new he(e,n)),this.newest?(this.newest[b]=s,s[U]=this.newest):this.oldest=s,this.newest=s,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const e=this.oldest;if(e)return this.oldest&&this.oldest[b]?(this.oldest=this.oldest[b],this.oldest[U]=void 0):(this.oldest=void 0,this.newest=void 0),e[b]=e[U]=void 0,this._keymap.delete(e.key),--this.size,this._onShiftListeners.forEach(n=>n(e)),[e.key,e.value]}get(e){const n=this._keymap.get(e);if(n)return this._markEntryAsUsed(n),n.value}has(e){return this._keymap.has(e)}find(e){const n=this._keymap.get(e);return n?n.value:void 0}delete(e){const n=this._keymap.get(e);if(n)return this._keymap.delete(n.key),n[b]&&n[U]?(n[U][b]=n[b],n[b][U]=n[U]):n[b]?(n[b][U]=void 0,this.oldest=n[b]):n[U]?(n[U][b]=void 0,this.newest=n[U]):this.oldest=this.newest=void 0,this.size--,n.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new Dn(this.oldest)}values(){return new Mn(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new Un(this.oldest)}forEach(e,n){typeof n!="object"&&(n=this);let s=this.oldest;for(;s;)e.call(n,s.value,s.key,this),s=s[b]}toJSON(){const e=new Array(this.size);let n=0,s=this.oldest;for(;s;)e[n++]={key:s.key,value:s.value},s=s[b];return e}toString(){let e="",n=this.oldest;for(;n;)e+=`${String(n.key)}:${n.value}`,n=n[b],n&&(e+=" < ");return e}}function V(t){let e=0;const n=Object.keys(t);for(const s of n){const r=Number(s);e=Math.max(e,r)}return e+1}function ii(t,e,n){const s=V(n),r=n;for(let i=s-1;i>=t;i--)r[i+1]=r[i];r[t]=e}function oi(t,e,n){const s=t+e,r=V(n),i=n;let o=0;const a={};for(let u=t;u<s;u++){const d=i[u];d!==void 0&&(delete i[u],a[o]=d,o++)}const h=s-t,l=r;for(let u=s;u<l;u++)i[u]!==void 0&&(i[u-h]=i[u],delete i[u])}function ai(t,e){const n=t,s=Object.keys(n),r=s.length,i=e,o=Object.keys(i),a=o.length,h={};let l=0;for(let u=0;u<r;u++,l++){const d=s[u];h[l]=n[d]}for(let u=0;u<a;u++,l++){const d=o[u];h[l]=i[d]}return h}function li(t,e,n){const s=n;if(V(n)>0){const i={};let o=0;for(let a=t;a<e;a++)s[a]&&(i[o]=s[a],o++);return i}return{}}function de(t,e,n,s){const r=t>n;if(!r&&t+e>n)throw new Error("Invalid move operation");r?ui(t,e,n,s):ci(t,e,n,s)}function ui(t,e,n,s){const r=s,i=[];for(let o=t;o<t+e;o++)i.push(r[o]);for(let o=t-1;o>=n;o--){const a=r[o];r[o+e]=a,a==null&&delete r[o+e]}i.forEach((o,a)=>{r[n+a]=o})}function ci(t,e,n,s){const r=s,i=[];for(let o=t;o<t+e;o++)i.push(r[o]);for(let o=t+e;o<n;o++){const a=r[o];r[o-e]=a,a==null&&delete r[o-e]}i.forEach((o,a)=>{r[n+a-e]=o})}class z{constructor(e={}){_(this,"_matrix");this._setOriginValue(e)}static MakeObjectMatrixSize(e){return new z({[e-1]:{}})}getMatrix(){return this._matrix}forEach(e){const n=this._matrix,s=Object.keys(n);for(const r of s){const i=Number(r),o=n[i];if(e(i,o)===!1)return this}return this}forRow(e){const n=this._matrix,s=Object.keys(n);for(const r of s){const i=Number(r),o=n[i];if(e(i,Object.keys(o).map(h=>Number(h)))===!1)return this}return this}forValue(e){const n=this._matrix,s=Object.keys(n);for(const r of s){const i=Number(r),o=n[i],a=Object.keys(o);for(const h of a){const l=Number(h),u=o[Number(h)];if(e(i,l,u)===!1)return this}}return this}swapRow(e,n){const s=this._matrix[e],r=this._matrix[n];this._matrix[e]=r,this._matrix[n]=s}getRow(e){return this._matrix[e]}getRowOrCreate(e){let n=this.getRow(e);return n==null&&(n={},this._matrix[e]=n),n}reset(){this._setOriginValue({})}hasValue(){const e=this._matrix,n=Object.keys(e);if(n.length===0)return!1;for(const s of n){const r=Number(s),i=e[r];if(Object.keys(i).length>0)return!0}return!1}getValue(e,n){var s,r;return(r=(s=this._matrix)==null?void 0:s[e])==null?void 0:r[n]}setValue(e,n,s){const r=this.getRowOrCreate(e);r[n]=s}deleteValue(e,n){var s,r;(r=(s=this._matrix)==null?void 0:s[e])==null||delete r[n]}realDeleteValue(e,n){var s,r,i;if((r=(s=this._matrix)==null?void 0:s[e])==null||delete r[n],this.getRow(e)){const o=this.getRow(e);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[e])}}setRow(e,n){this._matrix[e]=n}moveRows(e,n,s){de(e,n,s,this._matrix)}moveColumns(e,n,s){this.forEach((r,i)=>{de(e,n,s,i)})}getFragment(e,n,s,r){const i=new z;let o=0;for(let a=e;a<=n;a++){const h={};let l=0;for(let u=s;u<=r;u++){const d=this.getValue(a,u);h[l]=d,l++}i.setRow(o,h),o++}return i}getSlice(e,n,s,r){const i=new z;for(let o=e;o<=n;o++)for(let a=s;a<=r;a++){const h=this.getValue(o,a);h&&i.setValue(o,a,O.deepClone(h))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return V(this._matrix)}getRange(){const s=this.getLength()-1;let r=0;const i=this.getLength();for(let o=0;o<i;o++){const a=this.getRow(o);if(a){const h=V(a)-1;r=h>r?h:r}}return{startRow:0,startColumn:0,endRow:s,endColumn:r}}toNativeArray(){const e=new Array;return this.forValue((n,s,r)=>{e.push(r)}),e}toArray(){const e=[];return this.forRow((n,s)=>{e[n]==null&&(e[n]=[]),s.forEach(r=>{e[n][r]=this.getValue(n,r)})}),e}toJSON(){return this._matrix}clone(){const e=JSON.stringify(this._matrix);return JSON.parse(e)}getData(){const e=JSON.stringify(this._matrix);return JSON.parse(e)}getArrayData(){let e=0,n=0,s=!1,r=!1;const i=new z;return this.forEach((o,a)=>{s||(s=!0,e=o),Object.keys(a).forEach(h=>{const l=Number(h);r?l<n&&(n=l):(r=!0,n=l);const u=this.getValue(o,l);i.setValue(o-e,l-n,u)})}),i.getData()}getDataRange(){let e=0,n=0,s=0,r=!1,i=!1;this.forEach((a,h)=>{r||(r=!0,e=a);const l=V(h)-1;l>s&&(s=l),Object.keys(h).forEach(u=>{const d=Number(u);i?d<n&&(n=d):(i=!0,n=d)})});const o=e+this.getSizeOf()-1;return{startRow:e,startColumn:n,endRow:o,endColumn:s}}getDiscreteRanges(){const e=[];return this.forEach((n,s)=>{Object.keys(s).forEach(r=>{const i=Number(r);let o=!1;for(const a of e)if(n>=a.startRow&&n<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(n,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||e.push({startRow:n,endRow:n,startColumn:i,endColumn:i})})}),e}merge(e){this.forValue((n,s)=>{const r=e.getValue(n,s);r!=null&&this.setValue(n,s,r)})}_setOriginValue(e={}){this._matrix=e}}var _e=(t=>(t.INIT="init",t.FETCHING="fetching",t.DONE="done",t))(_e||{});class Pn{constructor(){_(this,"status","init")}}const hi=t=>t.some(e=>e.status==="init")?"init":t.some(e=>e.status==="fetching")?"fetching":"done";var Y=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN",t[t.ALL=3]="ALL",t))(Y||{}),K=(t=>(t[t.NONE=0]="NONE",t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN",t[t.ALL=3]="ALL",t))(K||{});function di(t){return[t.startRow,t.startColumn,t.endRow,t.endColumn]}const et=class et{static clone(e){return{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType}}static equals(e,n){return e.endRow===n.endRow&&e.endColumn===n.endColumn&&e.startRow===n.startRow&&e.startColumn===n.startColumn&&(e.rangeType===n.rangeType||e.rangeType===void 0&&n.rangeType===Y.NORMAL||n.rangeType===void 0&&e.rangeType===Y.NORMAL)}static intersects(e,n){const s=e.startRow,r=e.endRow,i=e.startColumn,o=e.endColumn,a=n.startRow,h=n.endRow,l=n.startColumn,u=n.endColumn,d=Math.abs(i+o-l-u),g=Math.abs(i-o)+Math.abs(l-u),f=Math.abs(s+r-a-h),E=Math.abs(s-r)+Math.abs(a-h);return d<=g&&f<=E}static getIntersects(e,n){const s=e.startRow,r=e.endRow,i=e.startColumn,o=e.endColumn,a=n.startRow,h=n.endRow,l=n.startColumn,u=n.endColumn;let d,g,f,E;if(a<=r)a>=s?g=a:g=s;else return null;if(h>=s)h>=r?E=r:E=h;else return null;if(l<=o)l>i?d=l:d=i;else return null;if(u>=i)u>=o?f=o:f=u;else return null;return{startRow:g,endRow:E,startColumn:d,endColumn:f,rangeType:Y.NORMAL}}static contains(e,n){return e.startRow<=n.startRow&&e.endRow>=n.endRow&&e.startColumn<=n.startColumn&&e.endColumn>=n.endColumn}static realContain(e,n){return et.contains(e,n)&&(e.startRow<n.startRow||e.endRow>n.endRow||e.startColumn<n.startColumn||e.endColumn>n.endColumn)}static union(...e){return e.reduce((n,s)=>({startRow:Math.min(n.startRow,s.startRow),startColumn:Math.min(n.startColumn,s.startColumn),endRow:Math.max(n.endRow,s.endRow),endColumn:Math.max(n.endColumn,s.endColumn),rangeType:Y.NORMAL}),e[0])}static subtract(e,n){if(n.startRow>=e.endRow||n.endRow<=e.startRow||n.startColumn>=e.endColumn||n.endColumn<=e.startColumn)return[e];const s=[];n.startRow>e.startRow&&s.push({startRow:e.startRow,startColumn:e.startColumn,endRow:n.startRow,endColumn:e.endColumn}),n.endRow<e.endRow&&s.push({startRow:n.endRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn});const r=Math.max(e.startRow,n.startRow),i=Math.min(e.endRow,n.endRow);return n.startColumn>e.startColumn&&s.push({startRow:r,startColumn:e.startColumn,endRow:i,endColumn:n.startColumn}),n.endColumn<e.endColumn&&s.push({startRow:r,startColumn:n.endColumn,endRow:i,endColumn:e.endColumn}),s}};_(et,"getRelativeRange",(e,n)=>({startRow:e.startRow-n.startRow,endRow:e.endRow-e.startRow,startColumn:e.startColumn-n.startColumn,endColumn:e.endColumn-e.startColumn})),_(et,"getPositionRange",(e,n)=>({startRow:e.startRow+n.startRow,endRow:e.endRow+e.startRow+n.startRow,startColumn:e.startColumn+n.startColumn,endColumn:e.endColumn+e.startColumn+n.startColumn})),_(et,"moveHorizontal",(e,n=0,s=0)=>({...e,startColumn:e.startColumn+n,endColumn:e.endColumn+n+s})),_(et,"moveVertical",(e,n=0,s=0)=>({...e,startRow:e.startRow+n,endRow:e.endRow+n+s})),_(et,"moveOffset",(e,n,s)=>({...e,startRow:e.startRow+s,endRow:e.endRow+s,startColumn:e.startColumn+n,endColumn:e.endColumn+n}));let ht=et;class _i{constructor(e,n){_(this,"_values",[]);_(this,"_keys",[]);_(this,"_keyMaps",new Map);this._values=e,this._keys=n,e.forEach(s=>{this._initKeyMap(s)})}_initKeyMap(e){this._keys.forEach(n=>{const s=e[n],r=this._keyMaps.get(n)||new Map;r.set(s,e),this._keyMaps.set(n,r)})}getValue(e){for(let n=0;n<this._keys.length;n++){const s=this._keyMaps.get(this._keys[n]);if(s!=null&&s.has(e))return s.get(e)}return null}hasValue(e){for(let n=0;n<this._keys.length;n++){const s=this._keyMaps.get(this._keys[n]);if(s!=null&&s.has(e))return!0}return!1}addValue(e){this._values.push(e),this._initKeyMap(e)}setValue(e,n,s){const r=this.getValue(e);r&&Object.keys(r).includes(n)&&(r[n]=s)}deleteValue(e){const n=this.getValue(e);if(n){this._keys.forEach(r=>{const i=this._keyMaps.get(r),o=n[r];i==null||i.delete(o)});const s=this._values.findIndex(r=>r===n);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(e){var n;return[...((n=this._keyMaps.get(e))==null?void 0:n.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function fe(t,e,n,s){return{forEach(r){for(let i=t;i<=e;i++)for(let o=n;o<=s;o++)r(i,o)}}}function fi(t){if(t==null||t.length===0)return NaN;const e=t.toLowerCase().split(""),n=e.length,s=o=>o.charCodeAt(0)-96;let r=0,i=0;for(let o=0;o<n;o++)i=s(e[o]),r+=i*26**(n-o-1);return r===0?NaN:r-1}const pt=65,Fn=90,gi=97;function Ei(t){const e=Fn-pt+1;let n="";for(;t>=0;)n=String.fromCharCode(t%e+pt)+n,t=Math.floor(t/e)-1;return n}function Hn(t,e){let n="";for(;e>0;)n+=t,e--;return n}function Ri(t,e=!1){const n=Fn-pt+1;let s=gi;e&&(s=pt);const r=String.fromCharCode(t%n+s),i=Math.floor(t/n)+1;return Hn(r,i)}function mi(t,e){return t.zIndex>e.zIndex?1:t.zIndex===e.zIndex?0:-1}function Oi(t,e){return t.zIndex>e.zIndex?-1:t.zIndex===e.zIndex?0:1}function dt(t="index",e=1){return(n,s)=>n[t]>s[t]?e:n[t]===s[t]?0:-e}var Bn=(t=>(t[t.PARAGRAPH=0]="PARAGRAPH",t[t.SECTION_BREAK=1]="SECTION_BREAK",t[t.TABLE=2]="TABLE",t[t.TABLE_ROW=3]="TABLE_ROW",t[t.TABLE_CELL=4]="TABLE_CELL",t))(Bn||{}),ge=(t=>(t.PARAGRAPH="\r",t.SECTION_BREAK=`
|
|
10
|
+
`,t.TABLE_START="",t.TABLE_ROW_START="\x1B",t.TABLE_CELL_START="",t.TABLE_CELL_END="",t.TABLE_ROW_END="",t.TABLE_END="",t.CUSTOM_RANGE_START="",t.CUSTOM_RANGE_END="",t.COLUMN_BREAK="\v",t.PAGE_BREAK="\f",t.DOCS_END="\0",t.TAB=" ",t.CUSTOM_BLOCK="\b",t.LETTER="",t.SPACE=" ",t))(ge||{});function Wn(t){const e=[];for(const n of t){const{st:s,ed:r}=n;if(s===r)continue;if(e.length===0){e.push(n);continue}const i=e.pop();Sn(n,i)&&O.hasIntersectionBetweenTwoRanges(i.st,i.ed,n.st,n.ed)?e.push({...n,st:i.st,ed:r}):e.push(i,n)}return e}function $n(t,e,n,s){const{textRuns:r}=t;if(r==null)return;const i=[],o=r.length;let a=!1;const h=e.textRuns??[];if(h.length)for(let l=0,u=h.length;l<u;l++){const d=h[l];d.st+=s,d.ed+=s}for(let l=0;l<o;l++){const u=r[l],{st:d,ed:g}=u;if(g<s)i.push(u);else if(s>=d&&s<=g)if(a)u.st+=n,u.ed+=n,i.push(u);else{a=!0,u.ed+=n;const f=[];if(h.length){const E={...u,st:d,ed:h[0].st};f.push(E),f.push(...h);const R=h[h.length-1],m={...u,st:R.ed,ed:g+n};f.push(m)}else f.push(u);i.push(...f)}else u.st+=n,u.ed+=n,a||(a=!0,i.push(...h)),i.push(u)}a||(a=!0,i.push(...h)),t.textRuns=Wn(i)}function Ee(t,e,n,s){const{paragraphs:r}=t;if(r==null)return;const{paragraphs:i,dataStream:o}=e,a=[];let h=-1;for(let u=0,d=r.length;u<d;u++){const g=r[u],{startIndex:f}=g;f>=s&&(g.startIndex+=n),h===-1&&f>=s&&(h=u),a.push(g.startIndex)}let l=-1;if(i){for(let u=0,d=i.length;u<d;u++){const g=i[u];g.startIndex+=s;const f=g.startIndex;l=a.indexOf(f)}if(o===ge.PARAGRAPH&&i.length===1){const u=r[h],d=i[0],g=u.paragraphStyle,f=u.bullet;u.paragraphStyle=d.paragraphStyle,u.bullet=d.bullet,d.paragraphStyle=g,d.bullet=f}l!==-1&&r.splice(l,1),r.push(...i),r.sort(dt("startIndex"))}}function Ai(t,e,n,s){const{sectionBreaks:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const h=r[o],{startIndex:l}=h;l>=s&&(h.startIndex+=n)}const i=e.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const h=i[o];h.startIndex+=s}r.push(...i),r.sort(dt("startIndex"))}}function Gn(t,e,n,s){const{customBlocks:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const h=r[o],{startIndex:l}=h;l>=s&&(h.startIndex+=n)}const i=e.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const h=i[o];h.startIndex+=s}r.push(...i),r.sort(dt("startIndex"))}}function Re(t,e,n,s){const{tables:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const h=r[o],{startIndex:l,endIndex:u}=h;l>s?(h.startIndex+=n,h.endIndex+=n):u>=s-1&&(h.endIndex+=n)}const i=e.tables;if(i){for(let o=0,a=i.length;o<a;o++){const h=i[o];h.startIndex+=s,h.endIndex+=s}r.push(...i),r.sort(dt("startIndex"))}}function Ii(t,e,n,s){const{customRanges:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const h=r[o],{startIndex:l,endIndex:u}=h;l>s?(h.startIndex+=n,h.endIndex+=n):u>=s-1&&(h.endIndex+=n)}const i=e.customRanges;if(i){for(let o=0,a=i.length;o<a;o++){const h=i[o];h.startIndex+=s,h.endIndex+=s}r.push(...i),r.sort(dt("startIndex"))}}function kn(t,e,n){const{textRuns:s}=t,r=n,i=n+e,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{st:d,ed:g}=u;if(r<=d&&i>=g){o.push({...u,st:d-r,ed:g-r});continue}else d<=r&&g>=i?(o.push({...u,st:r-r,ed:i-r}),u.ed-=e):r>=d&&r<g?(o.push({...u,st:r-r,ed:g-r}),u.ed=r):i>d&&i<=g?(o.push({...u,st:d-r,ed:i-r}),u.st=i-e,u.ed-=e):d>=i&&(u.st-=e,u.ed-=e);a.push(u)}t.textRuns=a}return o}function xn(t,e,n){const{paragraphs:s}=t,r=n,i=n+e,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{startIndex:d}=u;if(d>=r&&d<i){o.push({...u,startIndex:d-n});continue}else d>=i&&(u.startIndex-=e);a.push(u)}t.paragraphs=a}return o}function Vn(t,e,n){const{sectionBreaks:s}=t,r=n,i=n+e-1,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{startIndex:d}=u;if(d>=r&&d<=i){o.push({...u,startIndex:d-n});continue}else d>i&&(u.startIndex-=e);a.push(u)}t.sectionBreaks=a}return o}function pn(t,e,n){const{customBlocks:s}=t,r=n,i=n+e-1,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{startIndex:d}=u;if(d>=r&&d<=i){o.push({...u,startIndex:d-n});continue}else d>i&&(u.startIndex-=e);a.push(u)}t.customBlocks=a}return o}function jn(t,e,n){const{tables:s}=t,r=n,i=n+e-1,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{startIndex:d,endIndex:g}=u;if(r<=d&&i>=g){o.push({...u,startIndex:d-n,endIndex:g-n});continue}else if(d<=r&&g>=i){const f=ue(d,g,r,i);u.startIndex=f[0],u.endIndex=f[1]}else i<d&&(u.startIndex-=e,u.endIndex-=e);a.push(u)}t.tables=a}return o}function zn(t,e,n){const{customRanges:s}=t,r=n,i=n+e-1,o=[];if(s){const a=[];for(let h=0,l=s.length;h<l;h++){const u=s[h],{startIndex:d,endIndex:g}=u;if(r<=d&&i>=g){o.push({...u,startIndex:d-n,endIndex:g-n});continue}else if(d<=r&&g>=i){const f=ue(d,g,r,i);u.startIndex=f[0],u.endIndex=f[1]}else i<d&&(u.startIndex-=e,u.endIndex-=e);a.push(u)}t.customRanges=a}return o}function Ci(t,e,n){const{dataStream:s}=t,r=n,i=n+e,o=kn(t,e,n),a=xn(t,e,n),h=Vn(t,e,n),l=pn(t,e,n),u=jn(t,e,n),d=zn(t,e,n);let g="";return s&&(t.dataStream=Ln(s,r,i),g=s.slice(r,i)),{dataStream:g,textRuns:o,paragraphs:a,sectionBreaks:h,customBlocks:l,tables:u,customRanges:d}}function Si(t,e,n,s){t.dataStream=bn(t.dataStream,s,e.dataStream),$n(t,e,n,s),Ee(t,e,n,s),Ai(t,e,n,s),Gn(t,e,n,s),Re(t,e,n,s),Ii(t,e,n,s)}var Yn=(t=>(t[t.character=0]="character",t[t.paragraph=1]="paragraph",t[t.table=2]="table",t[t.numbering=3]="numbering",t))(Yn||{}),Kn=(t=>(t[t.TAB=0]="TAB",t[t.SPACE=1]="SPACE",t[t.NOTHING=2]="NOTHING",t))(Kn||{}),Ct=(t=>(t[t.GLYPH_TYPE_UNSPECIFIED=0]="GLYPH_TYPE_UNSPECIFIED",t[t.NONE=1]="NONE",t[t.DECIMAL=2]="DECIMAL",t[t.ZERO_DECIMAL=3]="ZERO_DECIMAL",t[t.UPPER_ALPHA=4]="UPPER_ALPHA",t[t.ALPHA=5]="ALPHA",t[t.UPPER_ROMAN=6]="UPPER_ROMAN",t[t.ROMAN=7]="ROMAN",t))(Ct||{}),J=(t=>(t[t.BULLET_ALIGNMENT_UNSPECIFIED=0]="BULLET_ALIGNMENT_UNSPECIFIED",t[t.START=1]="START",t[t.CENTER=2]="CENTER",t[t.END=3]="END",t))(J||{}),Xn=(t=>(t[t.HYPERLINK=0]="HYPERLINK",t[t.FIELD=1]="FIELD",t[t.SDT=2]="SDT",t[t.BOOKMARK=3]="BOOKMARK",t[t.COMMENT=4]="COMMENT",t[t.CUSTOM=5]="CUSTOM",t))(Xn||{}),qn=(t=>(t[t.DRAWING=0]="DRAWING",t[t.CUSTOM=1]="CUSTOM",t))(qn||{}),Qn=(t=>(t[t.DEFAULT=0]="DEFAULT",t[t.LINES=1]="LINES",t[t.LINES_AND_CHARS=2]="LINES_AND_CHARS",t[t.SNAP_TO_CHARS=3]="SNAP_TO_CHARS",t))(Qn||{}),Zn=(t=>(t[t.SECTION_TYPE_UNSPECIFIED=0]="SECTION_TYPE_UNSPECIFIED",t[t.CONTINUOUS=1]="CONTINUOUS",t[t.NEXT_PAGE=2]="NEXT_PAGE",t[t.EVEN_PAGE=3]="EVEN_PAGE",t[t.ODD_PAGE=4]="ODD_PAGE",t))(Zn||{}),Jn=(t=>(t[t.COLUMN_SEPARATOR_STYLE_UNSPECIFIED=0]="COLUMN_SEPARATOR_STYLE_UNSPECIFIED",t[t.NONE=1]="NONE",t[t.BETWEEN_EACH_COLUMN=2]="BETWEEN_EACH_COLUMN",t))(Jn||{}),yn=(t=>(t[t.NORMAL=0]="NORMAL",t[t.TBRL=1]="TBRL",t[t.LRTBV=2]="LRTBV",t))(yn||{}),ts=(t=>(t[t.TEXT_RUN=0]="TEXT_RUN",t[t.AUTO_TEXT=1]="AUTO_TEXT",t[t.PAGE_BREAK=2]="PAGE_BREAK",t[t.COLUMN_BREAK=3]="COLUMN_BREAK",t[t.FOOT_NOTE_REFERENCE=4]="FOOT_NOTE_REFERENCE",t[t.HORIZONTAL_RULE=5]="HORIZONTAL_RULE",t[t.EQUATION=6]="EQUATION",t[t.DRAWING=7]="DRAWING",t[t.PERSON=8]="PERSON",t[t.RICH_LINK=9]="RICH_LINK",t))(ts||{}),es=(t=>(t[t.BOTH_SIDES=0]="BOTH_SIDES",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.LARGEST=3]="LARGEST",t))(es||{}),ns=(t=>(t[t.INLINE=0]="INLINE",t[t.WRAP_NONE=1]="WRAP_NONE",t[t.WRAP_POLYGON=2]="WRAP_POLYGON",t[t.WRAP_SQUARE=3]="WRAP_SQUARE",t[t.WRAP_THROUGH=4]="WRAP_THROUGH",t[t.WRAP_TIGHT=5]="WRAP_TIGHT",t[t.WRAP_TOP_AND_BOTTOM=6]="WRAP_TOP_AND_BOTTOM",t))(ns||{}),ss=(t=>(t[t.NAMED_STYLE_TYPE_UNSPECIFIED=0]="NAMED_STYLE_TYPE_UNSPECIFIED",t[t.NORMAL_TEXT=1]="NORMAL_TEXT",t[t.TITLE=2]="TITLE",t[t.SUBTITLE=3]="SUBTITLE",t[t.HEADING_1=4]="HEADING_1",t[t.HEADING_2=5]="HEADING_2",t[t.HEADING_3=6]="HEADING_3",t[t.HEADING_4=7]="HEADING_4",t[t.HEADING_5=8]="HEADING_5",t[t.HEADING_6=9]="HEADING_6",t))(ss||{}),rs=(t=>(t[t.AUTO=0]="AUTO",t[t.AT_LEAST=1]="AT_LEAST",t[t.EXACT=2]="EXACT",t))(rs||{}),is=(t=>(t[t.DASH_STYLE_UNSPECIFIED=0]="DASH_STYLE_UNSPECIFIED",t[t.SOLID=1]="SOLID",t[t.DOT=2]="DOT",t[t.DASH=3]="DASH",t))(is||{}),os=(t=>(t[t.TAB_STOP_ALIGNMENT_UNSPECIFIED=0]="TAB_STOP_ALIGNMENT_UNSPECIFIED",t[t.START=1]="START",t[t.CENTER=2]="CENTER",t[t.END=3]="END",t))(os||{}),as=(t=>(t.EVENLY_DISTRIBUTED="0",t.FIXED_WIDTH="1",t))(as||{}),ls=(t=>(t[t.CONTENT_ALIGNMENT_UNSPECIFIED=0]="CONTENT_ALIGNMENT_UNSPECIFIED",t[t.CONTENT_ALIGNMENT_UNSUPPORTED=1]="CONTENT_ALIGNMENT_UNSUPPORTED",t[t.TOP=2]="TOP",t[t.MIDDLE=3]="MIDDLE",t[t.BOTTOM=4]="BOTTOM",t))(ls||{}),us=(t=>(t.NORMAL="normal",t.BOLD="bold",t.ITALIC="italic",t))(us||{}),cs=(t=>(t[t.CHARACTER=0]="CHARACTER",t[t.COLUMN=1]="COLUMN",t[t.INSIDE_MARGIN=2]="INSIDE_MARGIN",t[t.LEFT_MARGIN=3]="LEFT_MARGIN",t[t.MARGIN=4]="MARGIN",t[t.OUTSIDE_MARGIN=5]="OUTSIDE_MARGIN",t[t.PAGE=6]="PAGE",t[t.RIGHT_MARGIN=7]="RIGHT_MARGIN",t))(cs||{}),hs=(t=>(t[t.BOTTOM_MARGIN=0]="BOTTOM_MARGIN",t[t.INSIDE_MARGIN=1]="INSIDE_MARGIN",t[t.LINE=2]="LINE",t[t.MARGIN=3]="MARGIN",t[t.OUTSIDE_MARGIN=4]="OUTSIDE_MARGIN",t[t.PAGE=5]="PAGE",t[t.PARAGRAPH=6]="PARAGRAPH",t[t.TOP_MARGIN=7]="TOP_MARGIN",t))(hs||{}),ds=(t=>(t[t.POINT=0]="POINT",t[t.LINE=1]="LINE",t[t.CHARACTER=2]="CHARACTER",t))(ds||{}),_s=(t=>(t[t.CENTER=0]="CENTER",t[t.INSIDE=1]="INSIDE",t[t.LEFT=2]="LEFT",t[t.OUTSIDE=3]="OUTSIDE",t[t.RIGHT=4]="RIGHT",t))(_s||{}),fs=(t=>(t[t.BOTTOM=0]="BOTTOM",t[t.CENTER=1]="CENTER",t[t.INSIDE=2]="INSIDE",t[t.OUTSIDE=3]="OUTSIDE",t[t.TOP=4]="TOP",t))(fs||{}),gs=(t=>(t[t.compressPunctuation=0]="compressPunctuation",t[t.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",t[t.doNotCompress=2]="doNotCompress",t))(gs||{}),Es=(t=>(t[t.PORTRAIT=0]="PORTRAIT",t[t.LANDSCAPE=1]="LANDSCAPE",t))(Es||{}),jt=(t=>(t.BULLET_LIST="BULLET_LIST",t.ORDER_LIST="ORDER_LIST",t))(jt||{});const Ni={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:[{bulletAlignment:J.START,glyphFormat:" %0",textStyle:{fs:12},startNumber:0,glyphSymbol:"●",hanging:21,indentStart:21},{bulletAlignment:J.START,glyphFormat:" %1",textStyle:{fs:12},startNumber:0,glyphSymbol:"■",hanging:21,indentStart:42},{bulletAlignment:J.START,glyphFormat:" %1",textStyle:{fs:12},startNumber:0,glyphSymbol:"◆",hanging:21,indentStart:63}]},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:[{bulletAlignment:J.START,glyphFormat:" %1.",textStyle:{fs:12},startNumber:0,glyphType:Ct.DECIMAL,hanging:21,indentStart:21},{bulletAlignment:J.START,glyphFormat:" %1.%2)",textStyle:{fs:12},startNumber:0,glyphType:Ct.DECIMAL,hanging:21,indentStart:42},{bulletAlignment:J.START,glyphFormat:" %1.%2.%3.",textStyle:{fs:12},startNumber:0,glyphType:Ct.DECIMAL,hanging:21,indentStart:63}]}};function bi(t,e,n,s,r){const i=Li(t,e,n,s,r),o=vi(t,e,n,s,r),a=Di(t,e,n,s,r),h=Mi(t,e,n,s,r),l=Ui(t,e,n,s,r),u=Ti(t,e,n,s,r);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:h,tables:l,customRanges:u}}function Li(t,e,n,s,r){const{textRuns:i}=t,{textRuns:o}=e;if(i==null||o==null)return;const a=kn(t,n,s);if(r!==F.REPLACE){const h=wi(o,a,r);e.textRuns=h}return $n(t,e,n,s),a}function wi(t,e,n){if(e.length===0)return t;t=O.deepClone(t),e=O.deepClone(e);const s=[],r=t.length,i=e.length;let o=0,a=0,h=null;function l(){return h?(s.push(h),h=null,!0):!1}for(;o<r&&a<i;){const{st:f,ed:E,ts:R}=t[o],{st:m,ed:I,ts:S,sId:v}=e[a];let W;n===F.COVER?W={...S,...R}:W={...R,...S},E<m?(l()||s.push(t[o]),o++):I<f?(l()||s.push(e[a]),a++):(s.push({st:Math.min(f,m),ed:Math.max(f,m),ts:f<m?{...R}:{...S},sId:f<m?void 0:v}),s.push({st:Math.max(f,m),ed:Math.min(E,I),ts:W,sId:v}),E<I?(o++,e[a].st=E):(a++,t[o].st=I),h={st:Math.min(E,I),ed:Math.max(E,I),ts:E<I?{...S}:{...R},sId:E<I?v:void 0})}l();const u=s[s.length-1],d=t[r-1],g=e[i-1];return u.ed!==Math.max(d.ed,g.ed)&&(d.ed>g.ed?s.push(d):s.push(g)),Wn(s)}function vi(t,e,n,s,r){const{paragraphs:i}=t,{paragraphs:o}=e;if(i==null||o==null)return;const a=xn(t,n,s);if(r!==F.REPLACE){const h=[];for(const l of o){const{startIndex:u,paragraphStyle:d,bullet:g}=l;let f=[];for(const E of a){const{startIndex:R,paragraphStyle:m,bullet:I}=E;let S,v;if(r===F.COVER?(S={...m,...d},v={listId:"",listType:jt.BULLET_LIST,nestingLevel:0,textStyle:{},...I,...g}):(S={...d,...m},v={listId:"",listType:jt.BULLET_LIST,nestingLevel:0,textStyle:{},...g,...I}),u===R){f.push({startIndex:u,paragraphStyle:S,bullet:v});break}}h.push(...f),f=[]}e.paragraphs=h}return Ee(t,e,n,s),a}function Di(t,e,n,s,r){const{sectionBreaks:i}=t,{sectionBreaks:o}=e;if(i==null||o==null)return;const a=Vn(t,n,s);if(r!==F.REPLACE){const h=[];for(const l of o){const{startIndex:u}=l;let d=[];for(const g of a){const{startIndex:f}=g;if(u===f){r===F.COVER?d.push({...g,...l}):d.push({...l,...g});break}}h.push(...d),d=[]}e.sectionBreaks=h}return Ee(t,e,n,s),a}function Mi(t,e,n,s,r){const{customBlocks:i}=t,{customBlocks:o}=e;if(i==null||o==null)return;const a=pn(t,n,s);if(r!==F.REPLACE){const h=[];for(const l of o){const{startIndex:u}=l;let d=[];for(const g of a){const{startIndex:f}=g;if(u===f){r===F.COVER?d.push({...g,...l}):d.push({...l,...g});break}}h.push(...d),d=[]}e.customBlocks=h}return Gn(t,e,n,s),a}function Ui(t,e,n,s,r){const{tables:i}=t,{tables:o}=e;if(i==null||o==null)return;const a=jn(t,n,s);if(r!==F.REPLACE){const h=[];for(const l of o){const{startIndex:u,endIndex:d}=l;let g=[];for(const f of a){const{startIndex:E,endIndex:R}=f;if(E>=u&&R<=d){r===F.COVER?g.push({...f,...l}):g.push({...l,...f});break}}h.push(...g),g=[]}e.tables=h}return Re(t,e,n,s),a}function Ti(t,e,n,s,r){const{customRanges:i}=t,{tables:o}=e;if(i==null||o==null)return;const a=zn(t,n,s);if(r!==F.REPLACE){const h=[];for(const l of o){const{startIndex:u,endIndex:d}=l;let g=[];for(const f of a){const{startIndex:E,endIndex:R}=f;if(E>=u&&R<=d){r===F.COVER?g.push({...f,...l}):g.push({...l,...f});break}}h.push(...g),g=[]}e.customRanges=h}return Re(t,e,n,s),a}const me={id:"default_doc",documentStyle:{}};class Pi{constructor(e){_(this,"snapshot");this.snapshot={...me,...e}}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get body(){return this.snapshot.body}get zoomRatio(){var e;return((e=this.snapshot.settings)==null?void 0:e.zoomRatio)||1}getBody(){return this.snapshot.body}getShouldRenderLoopImmediately(){return this.snapshot.shouldStartRenderingImmediately!==!1}getContainer(){return this.snapshot.container}getParentRenderUnitId(){return this.snapshot.parentRenderUnitId}getSnapshot(){return this.snapshot}updateDocumentId(e){this.snapshot.id=e}updateDocumentRenderConfig(e){const{documentStyle:n}=this.snapshot;n.renderConfig==null?n.renderConfig=e:n.renderConfig={...n.renderConfig,...e}}updateDocumentDataMargin(e){const{t:n,l:s,b:r,r:i}=e,{documentStyle:o}=this.snapshot;n!=null&&(o.marginTop=n),s!=null&&(o.marginLeft=s),r!=null&&(o.marginBottom=r),i!=null&&(o.marginRight=i)}updateDocumentDataPageSize(e,n){const{documentStyle:s}=this.snapshot;if(!s.pageSize){e=e??1/0,n=n??1/0,s.pageSize={width:e,height:n};return}e!==void 0&&(s.pageSize.width=e),n!==void 0&&(s.pageSize.height=n)}updateDrawing(e,n){const{drawings:s}=this,{width:r,height:i,left:o,top:a}=n,h=s==null?void 0:s[e];if(!h)return;const l=h.objectTransform;l.size.width=r,l.size.height=i,l.positionH.posOffset=o,l.positionV.posOffset=a}setZoomRatio(e=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:e}:this.snapshot.settings.zoomRatio=1}}class _t extends Pi{constructor(n){super(n);_(this,"_unitId");_(this,"headerModelMap",new Map);_(this,"footerModelMap",new Map);const s=6;this._unitId=this.snapshot.id??O.generateRandomId(s),this._initializeHeaderFooterModel()}dispose(){this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()})}getRev(){return this.snapshot.rev??0}incrementRev(){this.snapshot.rev=this.getRev()+1}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...me,...n},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){const s=[],r=new nn;return r.reset(),n.forEach(i=>{if(i=O.deepClone(i),i.t==="r"){const{coverType:o,body:a,len:h,segmentId:l}=i;if(a!=null){const u=this._updateApply(a,h,r.cursor,o,l);s.push({...i,t:"r",coverType:F.REPLACE,body:u})}else s.push({...i,t:"r"});r.moveCursor(h)}else if(i.t==="i"){const{body:o,len:a,segmentId:h,line:l}=i;this._insertApply(o,a,r.cursor,h),r.moveCursor(a),s.push({t:"d",len:a,line:l,segmentId:h})}else if(i.t==="d"){const{len:o,segmentId:a}=i,h=this._deleteApply(o,r.cursor,a);s.push({...i,t:"i",body:h})}else throw new Error(`Unknown mutation type for mutation: ${i}.`)}),s}_updateApply(n,s,r,i=F.COVER,o){if(n==null)throw new Error("updateBody is none");const a=this.snapshot,h=xt(a,o);if(h==null)throw new Error("no body has changed");return bi(h,n,s,r,i)}_deleteApply(n,s,r){const i=this.snapshot,o=xt(i,r);if(o==null)throw new Error("no body has changed");return n<=0?{dataStream:""}:Ci(o,n,s)}_insertApply(n,s,r,i){const o=this.snapshot,a=xt(o,i);if(s!==0){if(a==null)throw new Error("no body has changed");Si(a,n,s,r)}}_initializeHeaderFooterModel(){const{headers:n,footers:s}=this.getSnapshot();if(n)for(const r in n){const i=n[r];this.headerModelMap.set(r,new _t(i))}if(s)for(const r in s){const i=s[r];this.footerModelMap.set(r,new _t(i))}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}}const St={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},Fi={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},Hi={startRow:0,startColumn:0,endRow:0,endColumn:0},Bi={row:0,column:0},Rs={id:"",sheetOrder:[],name:"",appVersion:"",locale:Ut.ZH_CN,styles:{},sheets:{},resources:[]},ms=1e3,Os=20,As=19,Is=73,Cs=46,Ss=20,zt={type:re.GRID,name:"Sheet1",id:"sheet-01",tabColor:"",hidden:C.FALSE,rowCount:ms,columnCount:Os,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Is,defaultRowHeight:As,mergeData:[],hideRow:[],hideColumn:[],cellData:{},rowData:{},columnData:{},status:C.FALSE,showGridlines:C.TRUE,rowHeader:{width:Cs,hidden:C.FALSE},columnHeader:{height:Ss,hidden:C.FALSE},selections:["A1"],rightToLeft:C.FALSE,pluginMeta:{}},Yt={ff:"Times New Roman",fs:14,it:C.FALSE,bl:C.FALSE,ul:{s:C.FALSE},st:{s:C.FALSE},ol:{s:C.FALSE},tr:{a:0,v:C.FALSE},td:Ot.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:rt.UNSPECIFIED,vt:ut.UNSPECIFIED,tb:ct.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0}},Ns={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}};var bs=(t=>(t.ARRAY_CONVERTOR="ARRAY_CONVERTOR",t.MATRIX_CONVERTOR="MATRIX_CONVERTOR",t))(bs||{});class Ls{constructor(e={}){_(this,"_styles");_(this,"_cacheMap",new Tn(1e5));this._styles=e,this._generateCacheMap()}each(e){return Object.entries(this._styles).forEach(e),this}search(e,n){if(this._cacheMap.has(n))return this._cacheMap.get(n);const s=this._getExistingStyleId(e);return s||"-1"}get(e){return typeof e!="string"?e:(e=String(e),this._styles[e])}add(e,n){const s=O.generateRandomId(6);return this._styles[s]=e,this._cacheMap.set(n,s),s}setValue(e){if(e==null)return;const n=JSON.stringify(e),s=this.search(e,n);return s!=="-1"?s:this.add(e,n)}toJSON(){return this._styles}getStyleByCell(e){let n;e&&O.isObject(e.s)?n=e.s:n=(e==null?void 0:e.s)&&this.get(e.s);const s=e==null?void 0:e.interceptorStyle;return s?{...n,...s}:n}_generateCacheMap(){const{_styles:e,_cacheMap:n}=this;for(const s in e){const r=JSON.stringify(e[s]);n.set(r,s)}}_getExistingStyleId(e){const{_styles:n}=this;for(const s in n)if(O.diffValue(n[s],e))return s;return null}}function Wi(t){return t&&(t.s!==void 0||t.p!==void 0||t.v!==void 0)||t.f!==void 0||t.si!==void 0}function $i(t){if(t.t!==void 0)return t.t;if(typeof t.v=="string")return At.STRING;if(typeof t.v=="number")return At.NUMBER;if(typeof t.v=="boolean")return At.BOOLEAN}function Gi(t){if(t==null)return!0;const{v:e,f:n,si:s,p:r,s:i}=t;return!(!(e==null||typeof e=="string"&&e.length===0)||n!=null&&n.length>0||s!=null&&s.length>0||r!=null)}var Oe=(t=>(t[t.SLIDE=0]="SLIDE",t[t.MASTER=1]="MASTER",t[t.LAYOUT=2]="LAYOUT",t[t.HANDOUT_MASTER=3]="HANDOUT_MASTER",t[t.NOTES_MASTER=4]="NOTES_MASTER",t))(Oe||{}),ws=(t=>(t[t.SHAPE=0]="SHAPE",t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.SPREADSHEET=3]="SPREADSHEET",t[t.DOCUMENT=4]="DOCUMENT",t[t.SLIDE=5]="SLIDE",t))(ws||{}),vs=(t=>(t[t.RELATIVE_SLIDE_LINK_UNSPECIFIED=0]="RELATIVE_SLIDE_LINK_UNSPECIFIED",t[t.NEXT_SLIDE=1]="NEXT_SLIDE",t[t.PREVIOUS_SLIDE=2]="PREVIOUS_SLIDE",t[t.FIRST_SLIDE=3]="FIRST_SLIDE",t[t.LAST_SLIDE=4]="LAST_SLIDE",t))(vs||{});class ki{constructor(e,n){_(this,"_columnData",{});this._config=e,this._columnData=n}getColumnData(){return this._columnData}getColVisible(e){const{_columnData:n}=this,s=n[e];return s?s.hd!==C.TRUE:!0}getHiddenCols(e=0,n=V(this._columnData)-1){const s=[];let r=!1,i=-1;for(let o=e;o<=n;o++){const a=this.getColVisible(o);r&&a?(r=!1,s.push({rangeType:Y.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!r&&!a&&(r=!0,i=o)}return r&&s.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:Y.COLUMN}),s}getColumnDatas(e,n){const s={};let r=0;for(let i=e;i<e+n;i++){const o=this.getColumnOrCreate(i);s[r]=o,r++}return s}getSize(){return V(this._columnData)}getColumnWidth(e){const{_columnData:n}=this,s=this._config;let r=0;return r=(n[e]||{hd:C.FALSE,w:s.defaultColumnWidth}).w||s.defaultColumnWidth,r}getColumn(e){const n=this._columnData[e];if(n)return n}getColumnOrCreate(e){const{_columnData:n}=this,s=this._config,r=n[e];if(r)return r;const i={w:s.defaultColumnWidth,hd:C.FALSE};return this._columnData[e]=i,i}}function Kt(t,e){for(const n of e){const{ts:s={}}=n;if(s[t]==null)return C.FALSE;switch(t){case"bl":case"it":{if(s[t]===C.FALSE)return C.FALSE;break}case"ul":case"st":{if(s[t].s===C.FALSE)return C.FALSE;break}default:throw new Error(`unknown style key: ${t} in IStyleBase`)}}return C.TRUE}class ft{constructor(e,n,s){_(this,"_range");_(this,"_worksheet");this._deps=s,this._range=n,this._worksheet=e}static foreach(e,n){const{startRow:s,startColumn:r,endRow:i,endColumn:o}=e;for(let a=s;a<=i;a++)for(let h=r;h<=o;h++)n(a,h)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range,i=[];for(let o=e;o<=n;o++){const a=[];for(let h=s;h<=r;h++)a.push(this.getMatrix().getValue(o,h)||null);i.push(a)}return i}getMatrix(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),o=new z;for(let a=e;a<=n;a++)for(let h=s;h<=r;h++)o.setValue(a,h,i.getValue(a,h)||null);return o}getMatrixObject(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),o=new z;for(let a=e;a<=n;a++)for(let h=s;h<=r;h++)o.setValue(a-e,h-s,i.getValue(a,h)||{});return o}getA1Notation(){const{startRow:e,endRow:n,startColumn:s,endColumn:r}=this._range;let i,o;return s<r?(i=O.numToWord(s+1)+(e+1),o=O.numToWord(r+1)+(n+1)):(i=O.numToWord(r+1)+(n+1),o=O.numToWord(s+1)+(e+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const e=this._deps.getStyles();return this.getValues().map(n=>n.map(s=>{var i;const r=e.getStyleByCell(s);return((i=r==null?void 0:r.bg)==null?void 0:i.rgb)||Yt.bg.rgb}))}getCell(e,n){const{startRow:s,endRow:r,startColumn:i,endColumn:o}=this._range,a={startRow:s+e,endRow:s+e,startColumn:i+n,endColumn:i+n};return new ft(this._worksheet,a,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(e={}){return this.getObjectValues(e)[0][0]}getObjectValues(e={}){var a;const{startRow:n,endRow:s,startColumn:r,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(n,s,r,i).getData();if(e.isIncludeStyle){const h=this._deps.getStyles();for(let l=0;l<=s-n;l++)for(let u=0;u<=i-r;u++){if(o==null||((a=o==null?void 0:o[l])==null?void 0:a[u])==null)continue;const d=o[l][u].s;d&&(o[l][u].s=h.get(d))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const e=this._deps.getStyles();return this.getValues().map(n=>n.map(s=>{var i;const r=e.getStyleByCell(s);return((i=r==null?void 0:r.cl)==null?void 0:i.rgb)||Yt.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("ul",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?{s:C.TRUE}:{s:C.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("st",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?{s:C.TRUE}:{s:C.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){return this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("it",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?Tt.ITALIC:Tt.NORMAL:this.getFontStyles()[0][0]}getFontStyles(){return this._getStyles("it")}getFontWeight(){var n,s;const{p:e}=this.getValue()??{};return e&&Array.isArray((n=e.body)==null?void 0:n.textRuns)?Kt("bl",(s=e.body)==null?void 0:s.textRuns)===C.TRUE?Pt.BOLD:Pt.NORMAL:this.getFontWeights()[0][0]}getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:e,_worksheet:n}=this,{startRow:s,endRow:r}=e;let i=0;for(let o=0;o<=r-s;o++){const a=n.getRowHeight(o);i+=a}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:e,endColumn:n}=this._range;return n-e+1}getNumRows(){const{startRow:e,endRow:n}=this._range;return n-e+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(e=>e.map(n=>(n==null?void 0:n.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const e=this._deps.getStyles();return this.getValues().map(n=>n.map(s=>e.getStyleByCell(s)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:e,_worksheet:n}=this,{startColumn:s,endColumn:r}=e;let i=0;for(let o=0;o<=r-s;o++)i+=n.getColumnWidth(o);return i}getWrap(){return this.getWraps()[0][0]}getWraps(){return this._getStyles("tb")}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(e){ft.foreach(this._range,e)}_getStyles(e){const n=this._deps.getStyles();return this.getValues().map(s=>s.map(r=>{const i=n&&n.getStyleByCell(r);return i&&i[e]||Yt[e]}))}}class xi{constructor(e,n){_(this,"_rowData");this._config=e,this._rowData=n}getRowData(){return this._rowData}getRowDatas(e,n){const s={};let r=0;for(let i=e;i<e+n;i++){const o=this.getRowOrCreate(i);s[r]=o,r++}return s}getRowHeight(e,n=1){const{_rowData:s}=this,r=this._config;let i=0;for(let o=0;o<n;o++){const a=s[o+e]||{hd:C.FALSE,h:r.defaultRowHeight},{isAutoHeight:h,ah:l,h:u=r.defaultRowHeight}=a;i+=(h==null||h)&&typeof l=="number"?l:u}return i}getRow(e){return this._rowData[e]}getRowOrCreate(e){const{_rowData:n}=this,s=n[e];if(s)return s;const r=this._config,i={hd:C.FALSE,h:r.defaultRowHeight};return n[e]=i,i}getHiddenRows(e=0,n=V(this._rowData)-1){const s=[];let r=!1,i=-1;for(let o=e;o<=n;o++){const a=this.getRowVisible(o);r&&a?(r=!1,s.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:Y.ROW})):!r&&!a&&(r=!0,i=o)}return r&&s.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:Y.ROW}),s}getRowVisible(e){const n=this.getRow(e);return n?n.hd!==C.TRUE:!0}getSize(){return V(this._rowData)}}class Ds extends T{constructor(){super(...arguments);_(this,"_cellContentInterceptors",[]);_(this,"_rowFilteredInterceptors",[]);_(this,"_rowVisibleInterceptors",[]);_(this,"_colVisibleInterceptors",[])}dispose(){super.dispose(),this._cellContentInterceptors.length=0,this._rowFilteredInterceptors.length=0,this._rowVisibleInterceptors.length=0,this._colVisibleInterceptors.length=0}getCell(n,s){for(const r of this._cellContentInterceptors){const i=r.getCell(n,s);if(typeof i<"u")return i}return null}registerCellContentInterceptor(n){if(this._cellContentInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptors.push(n),D(()=>q(this._cellContentInterceptors,n))}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptors.push(n),D(()=>q(this._rowFilteredInterceptors,n))}registerRowVisibleInterceptor(n){if(this._rowVisibleInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowVisibleInterceptors.push(n),D(()=>q(this._rowVisibleInterceptors,n))}registerColVisibleInterceptor(n){if(this._colVisibleInterceptors.includes(n))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._colVisibleInterceptors.push(n),D(()=>q(this._colVisibleInterceptors,n))}}class Nt{constructor(e,n){_(this,"_initialized");_(this,"_sheetId");_(this,"_snapshot");_(this,"_cellData");_(this,"_rowManager");_(this,"_columnManager");_(this,"_viewModel");this._styles=n;const s={...zt,mergeData:[],hideRow:[],hideColumn:[],cellData:{},rowData:{},columnData:{},rowHeader:{width:46,hidden:C.FALSE},columnHeader:{height:20,hidden:C.FALSE},selections:["A1"],rightToLeft:C.FALSE,pluginMeta:{},...e};this._snapshot=s;const{columnData:r,rowData:i,cellData:o}=this._snapshot;this._sheetId=this._snapshot.id??O.generateRandomId(6),this._initialized=!1,this._cellData=new z(o),this._rowManager=new xi(this._snapshot,i),this._columnManager=new ki(this._snapshot,r),this._viewModel=new Ds}__interceptViewModel(e){e(this._viewModel)}getSnapshot(){return this._snapshot}getCellMatrix(){return this._cellData}getRowManager(){return this._rowManager}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:e}=this,n=O.deepClone(e);return new Nt(n,this._styles)}getMergeData(){return this._snapshot.mergeData}getMergedCells(e,n){const s=this._snapshot.mergeData,r=[];for(let i=0;i<s.length;i++){const o=s[i];ht.intersects({startRow:e,startColumn:n,endRow:e,endColumn:n},o)&&r.push(o)}return r.length?r:null}getMergedCell(e,n){const s=this._snapshot.mergeData;for(let r=0;r<s.length;r++){const i=s[r];if(ht.intersects({startRow:e,startColumn:n,endRow:e,endColumn:n},i))return i}return null}getCell(e,n){return e<0||n<0?null:this._viewModel.getCell(e,n)}getCellRaw(e,n){return this.getCellMatrix().getValue(e,n)}getMatrixWithMergedCells(e,n,s,r){const i=this.getCellMatrix(),o=this._snapshot.mergeData.filter(h=>ht.intersects({startRow:e,startColumn:n,endRow:s,endColumn:r},h)),a=new z;return fe(e,s,n,r).forEach((h,l)=>{const u=i.getValue(h,l);u&&a.setValue(h,l,u)}),o.forEach(h=>{const{startColumn:l,startRow:u,endColumn:d,endRow:g}=h;fe(u,g,l,d).forEach((f,E)=>{f===u&&E===l&&a.setValue(f,E,{...i.getValue(f,E),rowSpan:g-u+1,colSpan:d-l+1}),(f!==u||E!==l)&&a.realDeleteValue(f,E)})}),a}getRange(e,n,s,r){return typeof e=="object"?new ft(this,e,{getStyles:()=>this._styles}):new ft(this,{startRow:e,startColumn:n,endColumn:r||n,endRow:s||e},{getStyles:()=>this._styles})}getStatus(){const{_snapshot:e}=this;return e.status}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){const{_snapshot:e}=this,{columnCount:n}=e;return n}getMaxRows(){const{_snapshot:e}=this,{rowCount:n}=e;return n}getType(){const{_snapshot:e}=this,{type:n}=e;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(e){this._snapshot.rowCount=e}getColumnCount(){return this._snapshot.columnCount}setColumnCount(e){this._snapshot.columnCount=e}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:e}=this,{showGridlines:n}=e;return n===0}getTabColor(){const{_snapshot:e}=this,{tabColor:n}=e;return n}getColumnWidth(e){return this.getColumnManager().getColumnWidth(e)}getRowHeight(e){return this.getRowManager().getRowHeight(e)}getRowVisible(e){return this.getRowManager().getRowVisible(e)}getHiddenRows(e,n){const s=this.getMaxColumns()-1,r=this._rowManager.getHiddenRows(e,n);return r.forEach(i=>i.endColumn=s),r}getColVisible(e){return this._columnManager.getColVisible(e)}getHiddenCols(e,n){const s=this.getMaxRows()-1,r=this._columnManager.getHiddenCols(e,n);return r.forEach(i=>i.endRow=s),r}isRightToLeft(){const{_snapshot:e}=this,{rightToLeft:n}=e;return n}getPluginMeta(e){return this._snapshot.pluginMeta[e]}setPluginMeta(e,n){this._snapshot.pluginMeta[e]=n}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}cellHasValue(e){return e&&(e.v!==void 0||e.f!==void 0||e.p!==void 0)}}var Vi=Object.defineProperty,pi=Object.getOwnPropertyDescriptor,ji=(t,e,n,s)=>{for(var r=s>1?void 0:s?pi(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&Vi(e,n,r),r},zi=(t,e)=>(n,s)=>e(n,s,t);function Yi(t,e){return`${t.getUnitId()}|${e.getSheetId()}`}c.Workbook=class extends T{constructor(n={},s){super();_(this,"_sheetCreated$",new N.Subject);_(this,"sheetCreated$",this._sheetCreated$.asObservable());_(this,"_sheetDisposed$",new N.Subject);_(this,"sheetDisposed$",this._sheetDisposed$.asObservable());_(this,"_activeSheet$",new N.BehaviorSubject(null));_(this,"activeSheet$",this._activeSheet$.asObservable());_(this,"_worksheets");_(this,"_styles");_(this,"_snapshot");_(this,"_unitId");_(this,"_count");this._log=s,this._snapshot=O.commonExtend(Rs,n);const{styles:r}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=O.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new Ls(r),this._count=1,this._worksheets=new Map,this._getDefaultWorkSheet()}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete()}save(){return O.deepClone(this._snapshot)}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getRev(){return this._snapshot.rev??1}incrementRev(){this._snapshot.rev=this.getRev()+1}getShouldRenderLoopImmediately(){return this._snapshot.shouldStartRenderingImmediately!==!1}getContainer(){return this._snapshot.container}addWorksheet(n,s,r){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=r,o.splice(s,0,n);const a=new Nt(r,this._styles);return this._worksheets.set(n,a),this._sheetCreated$.next(a),!0}getParentRenderUnitId(){return this._snapshot.parentRenderUnitId}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:s}=this._snapshot;return s.findIndex(r=>r===n)}getRawActiveSheet(){const{sheetOrder:n}=this._snapshot;return n.find(r=>this._worksheets.get(r).getStatus()===C.TRUE)}getActiveSheet(){const{sheetOrder:n}=this._snapshot,s=this.getRawActiveSheet();return s?this._worksheets.get(s):this._worksheets.get(n[0])}__setActiveSheet(n){this._activeSheet$.next(n)}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(s=>this._worksheets.get(s).getStatus()===1)}getSheetSize(){return this._snapshot.sheetOrder.length}flush(){}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(s=>this._worksheets.get(s))}getSheetsName(){const{sheetOrder:n}=this._snapshot,s=[];return n.forEach(r=>{const i=this._worksheets.get(r);i&&s.push(i.getName())}),s}getSheetIndex(n){const{sheetOrder:s}=this._snapshot;return s.findIndex(r=>n.getSheetId()===r)}getSheetBySheetName(n){const{sheetOrder:s}=this._snapshot,r=s.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(r)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:s}=this._snapshot;return this._worksheets.get(s[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===C.TRUE).map(n=>n.getConfig().id)}transformRangeType(n){if(typeof n=="string")return this._getCellRange(n);if(typeof n!="string"&&"row"in n){const s=n;return{sheetId:"",range:{startRow:s.row[0],startColumn:s.column[0],endRow:s.row[1],endColumn:s.column[1]}}}return typeof n!="string"&&"startRow"in n?{sheetId:"",range:n}:St}load(n){this._snapshot=n}checkSheetName(n){return this.getSheetsName().includes(n)}uniqueSheetName(n="sheet1"){let s=n;for(;this.checkSheetName(s);)s=n+this._count,this._count++;return s}_getCellRange(n){var u,d,g,f,E;let s="",r="";if(n.indexOf("!")>-1){const R=n.split("!");s=R[0],r=R[1],s=s.replace(/\\'/g,"'").replace(/''/g,"'"),s.substring(0,1)==="'"&&s.substring(s.length-1,1)==="'"&&(s=s.substring(1,s.length-1))}else r=n;if(r.indexOf(":")===-1){const R=parseInt(r.replace(/[^0-9]/g,""),10)-1,m=O.ABCatNum(r.replace(/[^A-Za-z]/g,""));return!Number.isNaN(R)&&!Number.isNaN(m)?{sheetId:s,range:{startRow:R,endRow:R,startColumn:m,endColumn:m}}:St}r=r.split(":");const i=[0,0],o=[0,0],a=((u=this.getSheetBySheetName(s))==null?void 0:u.getMaxRows())||((d=this.getActiveSheet())==null?void 0:d.getMaxRows()),h=((g=this.getSheetBySheetName(s))==null?void 0:g.getMaxColumns())||((f=this.getActiveSheet())==null?void 0:f.getMaxColumns());return i[0]=parseInt(r[0].replace(/[^0-9]/g,""),10)-1,i[1]=parseInt(r[1].replace(/[^0-9]/g,""),10)-1,Number.isNaN(i[0])&&(i[0]=0),Number.isNaN(i[1])&&(i[1]=a),i[0]>i[1]||(o[0]=O.ABCatNum(r[0].replace(/[^A-Za-z]/g,"")),o[1]=O.ABCatNum(r[1].replace(/[^A-Za-z]/g,"")),Number.isNaN(o[0])&&(o[0]=0),Number.isNaN(o[1])&&(o[1]=h),o[0]>o[1])?St:{sheetId:((E=this.getSheetBySheetName(s))==null?void 0:E.getSheetId())||"",range:{startRow:i[0],endRow:i[1],startColumn:o[0],endColumn:o[1]}}}_getDefaultWorkSheet(){const{_snapshot:n,_worksheets:s}=this,{sheets:r,sheetOrder:i}=n;O.isEmptyObject(r)&&(r[zt.id]=Object.assign(zt,{status:C.TRUE}));for(const o in r){const a=r[o],{name:h}=a;a.name=this.uniqueSheetName(h),a.name!==h&&this._log.warn(`The worksheet name ${h} is duplicated, we change it to ${a.name}`);const l=new Nt(a,this._styles);s.set(o,l),i.includes(o)||i.push(o)}}},c.Workbook=ji([zi(1,st)],c.Workbook);class Ae{constructor(e){_(this,"_snapshot");_(this,"_unitId");this._snapshot={...Ns,...e},this._unitId=this._snapshot.id??O.generateRandomId(6)}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var e;return(e=this._snapshot.body)==null?void 0:e.pages}getPageOrder(){var e;return(e=this._snapshot.body)==null?void 0:e.pageOrder}getPage(e){const n=this.getPages();return n==null?void 0:n[e]}getElementsByPage(e){var n;return(n=this.getPage(e))==null?void 0:n.pageElements}getElement(e,n){var s;return(s=this.getElementsByPage(e))==null?void 0:s[n]}getPageSize(){return this._snapshot.pageSize}addPage(){return{id:"cover_1",pageType:Oe.SLIDE,zIndex:1,title:"cover",description:"this is first page, cover",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}}const Xt="FOCUSING_SHEET",Ie="FOCUSING_DOC",Ce="FOCUSING_SLIDE",Ki="FOCUSING_EDITOR_BUT_HIDDEN",Ms="FOCUSING_EDITOR",Xi="FOCUSING_EDITOR_INPUT_FORMULA",Us="FOCUSING_FORMULA_EDITOR";var qi=Object.defineProperty,Qi=Object.getOwnPropertyDescriptor,Zi=(t,e,n,s)=>{for(var r=s>1?void 0:s?Qi(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&qi(e,n,r),r},Ji=(t,e)=>(n,s)=>e(n,s,t),Ts=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.DOC=1]="DOC",t[t.SHEET=2]="SHEET",t[t.SLIDE=3]="SLIDE",t))(Ts||{});const gt=A.createIdentifier("univer.current");let Se=class extends T{constructor(e,n){super();_(this,"_focused",null);_(this,"_focused$",new N.BehaviorSubject(null));_(this,"focused$",this._focused$.asObservable());_(this,"_currentSheet$",new N.BehaviorSubject(null));_(this,"currentSheet$",this._currentSheet$.asObservable());_(this,"_currentDoc$",new N.BehaviorSubject(null));_(this,"currentDoc$",this._currentDoc$.asObservable());_(this,"_currentSlide$",new N.BehaviorSubject(null));_(this,"currentSlide$",this._currentSlide$.asObservable());_(this,"_sheetAdded$",new N.Subject);_(this,"sheetAdded$",this._sheetAdded$.asObservable());_(this,"_docAdded$",new N.Subject);_(this,"docAdded$",this._docAdded$.asObservable());_(this,"_slideAdded$",new N.Subject);_(this,"slideAdded$",this._slideAdded$.asObservable());_(this,"_sheetDisposed$",new N.Subject);_(this,"sheetDisposed$",this._sheetDisposed$.asObservable());_(this,"_docDisposed$",new N.Subject);_(this,"docDisposed$",this._docDisposed$.asObservable());_(this,"_slideDisposed$",new N.Subject);_(this,"slideDisposed$",this._slideDisposed$.asObservable());_(this,"_sheets",[]);_(this,"_docs",[]);_(this,"_slides",[]);this._handler=e,this._contextService=n}dispose(){super.dispose(),this._focused$.complete(),this._currentDoc$.complete(),this._currentSheet$.complete(),this._currentSlide$.complete(),this._sheetAdded$.complete(),this._docAdded$.complete(),this._slideAdded$.complete(),this._sheetDisposed$.complete(),this._docDisposed$.complete(),this._slideDisposed$.complete()}createDoc(e){return this._handler.createUniverDoc(e)}createSheet(e){return this._handler.createUniverSheet(e)}createSlide(e){return this._handler.createUniverSlide(e)}addSheet(e){this._sheets.push(e),this._sheetAdded$.next(e),this.setCurrentUniverSheetInstance(e.getUnitId())}changeDoc(e,n){const s=this._docs.find(r=>r.getUnitId()===e);if(s!=null){const r=this._docs.indexOf(s);this._docs.splice(r,1)}this.addDoc(n)}addDoc(e){this._docs.push(e),this._docAdded$.next(e),this.setCurrentUniverDocInstance(e.getUnitId())}addSlide(e){this._slides.push(e),this._slideAdded$.next(e),this.setCurrentUniverSlideInstance(e.getUnitId())}getUniverSheetInstance(e){return this._sheets.find(n=>n.getUnitId()===e)}getUniverDocInstance(e){return this._docs.find(n=>n.getUnitId()===e)}getUniverSlideInstance(e){return this._slides.find(n=>n.getUnitId()===e)}getAllUniverSheetsInstance(){return this._sheets}getAllUniverDocsInstance(){return this._docs}getAllUniverSlidesInstance(){return this._slides}setCurrentUniverSheetInstance(e){this._currentSheet$.next(this.getUniverSheetInstance(e)||null)}setCurrentUniverSlideInstance(e){this._currentSlide$.next(this.getUniverSlideInstance(e)||null)}setCurrentUniverDocInstance(e){this._currentDoc$.next(this.getUniverDocInstance(e)||null)}getCurrentUniverSheetInstance(){const e=this._currentSheet$.getValue();if(!e)throw new Error("No current sheet!");return e}getCurrentUniverDocInstance(){const e=this._currentDoc$.getValue();if(!e)throw new Error("No current doc!");return e}getCurrentUniverSlideInstance(){const e=this._currentSlide$.getValue();if(!e)throw new Error("No current slide!");return e}focusUniverInstance(e){e&&(this._focused=this.getUniverSheetInstance(e)||this.getUniverDocInstance(e)||this.getUniverSlideInstance(e)||null),this._focused$.next(e),[Ie,Xt,Ce].forEach(n=>this._contextService.setContextValue(n,!1)),this._focused instanceof c.Workbook?this._contextService.setContextValue(Xt,!0):this._focused instanceof _t?this._contextService.setContextValue(Ie,!0):this._focused instanceof Ae&&this._contextService.setContextValue(Ce,!0)}getFocusedUniverInstance(){return this._focused}getDocumentType(e){if(this.getUniverDocInstance(e))return 1;if(this.getUniverSheetInstance(e))return 2;if(this.getUniverSlideInstance(e))return 3;throw new Error(`[UniverInstanceService]: No document with unitId ${e}`)}disposeDocument(e){const n=this.getUniverDocInstance(e);if(n){const i=this._docs.indexOf(n);return this._docs.splice(i,1),this._docDisposed$.next(n),this.focusUniverInstance(null),!0}const s=this.getUniverSheetInstance(e);if(s){const i=this._sheets.indexOf(s);return this._sheets.splice(i,1),this._sheetDisposed$.next(s),this.focusUniverInstance(null),!0}const r=this.getUniverSlideInstance(e);if(r){const i=this._slides.indexOf(r);return this._slides.splice(i,1),this._slideDisposed$.next(r),this.focusUniverInstance(null),!0}return!1}};Se=Zi([Ji(1,lt)],Se);var w=(t=>(t[t.Starting=0]="Starting",t[t.Ready=1]="Ready",t[t.Rendered=2]="Rendered",t[t.Steady=3]="Steady",t))(w||{});const Ps={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"},qt=new Map;function Ne(t,e){return function(r){be(t,e)}}function be(t,e){qt.has(t)||qt.set(t,[]),qt.get(t).push(e)}var yi=Object.defineProperty,to=Object.getOwnPropertyDescriptor,Fs=(t,e,n,s)=>{for(var r=s>1?void 0:s?to(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&yi(e,n,r),r},Le=(t,e)=>(n,s)=>e(n,s,t);c.LifecycleService=class extends T{constructor(n){super();_(this,"_lifecycle$",new N.BehaviorSubject(w.Starting));_(this,"lifecycle$",this._lifecycle$.asObservable());this._logService=n,this._logService.log("[LifecycleService]",`lifecycle progressed to "${Ps[w.Starting]}".`)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._logService.log("[LifecycleService]",`lifecycle progressed to "${Ps[n]}".`),this._lifecycle$.next(n))}subscribeWithPrevious(){return new N.Observable(n=>(this.stage===w.Starting||(this.stage===w.Ready?n.next(w.Starting):this.stage===w.Rendered?(n.next(w.Starting),n.next(w.Ready)):(n.next(w.Starting),n.next(w.Ready),n.next(w.Rendered))),this._lifecycle$.subscribe(n)))}},c.LifecycleService=Fs([Le(0,st)],c.LifecycleService);let y=class extends T{constructor(e,n){super();_(this,"_started",!1);this._lifecycleService=e,this._injector=n}start(){this._started||(this._started=!0,this.disposeWithMe(D(this._lifecycleService.subscribeWithPrevious().subscribe(e=>this.initModulesOnStage(e)))))}initModulesOnStage(e){const n=qt.get(e);n==null||n.forEach(s=>{this._injector.has(s)&&this._injector.get(s)})}};y=Fs([Le(0,A.Inject(c.LifecycleService)),Le(1,A.Inject(A.Injector))],y);function eo(t,e){if(t)try{return t[e]?t[e]:e.split(".").reduce((n,s)=>n[s],t)}catch{return console.warn("Key %s not found",e),e}}class bt extends T{constructor(){super();_(this,"currentLocale",Ut.ZH_CN);_(this,"locales",null);_(this,"localeChanged$",new N.Subject);_(this,"t",n=>{if(!this.locales)throw new Error("Locale not initialized");return eo(this.locales[this.currentLocale],n)??n});this.disposeWithMe(D(()=>this.localeChanged$.complete()))}load(n){this.locales=O.deepMerge(this.locales??{},n)}setLocale(n){this.currentLocale=n,this.localeChanged$.next()}getLocales(){var n;return(n=this.locales)==null?void 0:n[this.currentLocale]}getCurrentLocale(){return this.currentLocale}}const we=A.createIdentifier("resource-manager-service"),Hs=A.createIdentifier("ResourcePersistenceService");be(w.Ready,Hs);var no=Object.defineProperty,so=Object.getOwnPropertyDescriptor,ro=(t,e,n,s)=>{for(var r=s>1?void 0:s?so(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&no(e,n,r),r},Bs=(t,e)=>(n,s)=>e(n,s,t);const ve=A.createIdentifier("univer.permission-service"),Ws="PERMISSION";c.PermissionService=class extends T{constructor(n,s){super();_(this,"_permissionPointMap",new Map);_(this,"deletePermissionPoint",(n,s)=>{const r=this._permissionPointMap.get(n);if(r){const i=r.get(s);i&&(i.complete(),this._permissionPointMap.delete(s))}});_(this,"addPermissionPoint",(n,s)=>{const r=this._permissionPointMap.get(n)||new Map;return r.has(s.id)?!1:(r.set(s.id,new N.BehaviorSubject(s)),this._permissionPointMap.set(n,r),!0)});_(this,"updatePermissionPoint",(n,s,r)=>{const i=this._permissionPointMap.get(n);if(!i)return;const o=i.get(s);if(o){const a=o.getValue();a.value=r,a.status=_e.DONE,o.next(a)}});_(this,"getPermissionPoint",(n,s)=>{const r=this._permissionPointMap.get(n);if(!r)return;const i=r.get(s);if(i)return i.getValue()});this._resourceManagerService=n,this._univerInstanceService=s}_init(){this.disposeWithMe(D(this._univerInstanceService.sheetAdded$.subscribe(n=>{this._resourceManagerService.registerPluginResource(n.getUnitId(),Ws,{onChange:(s,r)=>{r.forEach(i=>{this.getPermissionPoint(s,i.id)?this.updatePermissionPoint(s,i.id,i.value):this.addPermissionPoint(s,i)})},toJson:s=>this._toJson(s),parseJson:s=>this._parseJson(s)})}))),this.disposeWithMe(D(this._univerInstanceService.sheetDisposed$.subscribe(n=>{this._resourceManagerService.disposePluginResource(n.getUnitId(),Ws)})))}_toJson(n){const s=this._permissionPointMap.get(n);let r=[];return s&&(r=[...s.keys()].reduce((i,o)=>{const a=s.get(o);return a&&i.push(a.getValue()),i},[])),JSON.stringify(r)}_parseJson(n){return JSON.parse(n)}composePermission$(n,s){const r=this._permissionPointMap.get(n),i=s.map(o=>{const a=r==null?void 0:r.get(o);if(!a)throw new Error(`${o} permissionPoint is not exist`);return a.asObservable()});return N.combineLatest(i).pipe(ys.map(o=>(o.every(a=>this._permissionPointMap.get(a.id)),o)))}composePermission(n,s){const r=this._permissionPointMap.get(n);return s.map(o=>{const a=r==null?void 0:r.get(o);if(!a)throw new Error(`${o} permissionPoint is not exist`);return a.getValue()})}},c.PermissionService=ro([Ne(w.Starting,c.PermissionService),Bs(0,A.Inject(we)),Bs(1,A.Inject(gt))],c.PermissionService);const $s="univer.editable";class Qt extends Pn{constructor(n){super();_(this,"id",$s);_(this,"value",!0);_(this,"unitID");this.unitID=n}}var io=Object.defineProperty,oo=Object.getOwnPropertyDescriptor,ao=(t,e,n,s)=>{for(var r=s>1?void 0:s?oo(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&io(e,n,r),r},Gs=(t,e)=>(n,s)=>e(n,s,t);c.UniverPermissionService=class extends T{constructor(e,n){super(),this._permissionService=e,this._univerInstanceService=n,this._init()}_init(){this._univerInstanceService.sheetAdded$.subscribe(e=>{const n=new Qt(e.getUnitId());this._permissionService.addPermissionPoint(e.getUnitId(),n)})}getEditable(e){let n=e;n||(n=this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId());const s=new Qt(n),r=this._permissionService.getPermissionPoint(n,s.id);return r==null?void 0:r.value}setEditable(e,n){const s=new Qt(e);this._permissionService.updatePermissionPoint(e,s.id,n)}},c.UniverPermissionService=ao([Ne(w.Starting,c.UniverPermissionService),Gs(0,A.Inject(ve)),Gs(1,A.Inject(gt))],c.UniverPermissionService);class ks extends T{constructor(){super(...arguments);_(this,"_resourceMap",new Map);_(this,"_register$",new N.Subject);_(this,"register$",this._register$.asObservable())}getAllResource(n){const s=this._resourceMap.get(n);return s?[...s.keys()].reduce((r,i)=>{const o=s.get(i);return o&&r.push({unitID:n,resourceName:i,hook:o}),r},[]):[]}registerPluginResource(n,s,r){const i=this._resourceMap.get(n)||new Map;if(i.has(s))throw new Error("the pluginName is registered");return i.set(s,r),this._resourceMap.set(n,i),this._register$.next({unitID:n,resourceName:s,hook:r}),D(()=>i.delete(s))}disposePluginResource(n,s){const r=this._resourceMap.get(n);r==null||r.delete(s)}dispose(){this._register$.complete(),this._resourceMap.clear()}}class De extends T{constructor(){super();_(this,"_currentTheme");_(this,"_currentTheme$",new N.BehaviorSubject({}));_(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(D(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}}const xs="__defaultDocumentNormalEditorSpecialUnitId_20231006__",Vs="__defaultDocumentFormulaBarEditorSpecialUnitId_20231012__",lo=`\r
|
|
11
|
+
`;var uo=Object.defineProperty,co=Object.getOwnPropertyDescriptor,ho=(t,e,n,s)=>{for(var r=s>1?void 0:s?co(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&uo(e,n,r),r},Me=(t,e)=>(n,s)=>e(n,s,t);const Zt=A.createIdentifier("univer.undo-redo.service"),_o=20;c.LocalUndoRedoService=class extends T{constructor(n,s,r){super();_(this,"undoRedoStatus$");_(this,"_undoRedoStatus$",new N.BehaviorSubject({undos:0,redos:0}));_(this,"_undoStacks",new Map);_(this,"_redoStacks",new Map);this._univerInstanceService=n,this._commandService=s,this._contextService=r,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(js)),this.disposeWithMe(this._commandService.registerCommand(zs)),this.disposeWithMe(D(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(D(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:s}=n,r=this._getRedoStack(s,!0),i=this._getUndoStack(s,!0);r.length=0,i.push(n),i.length>_o&&i.splice(0,1),this._updateStatus()}clearUndoRedo(n){const s=this._getRedoStack(n);s&&(s.length=0);const r=this._getUndoStack(n);r&&(r.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getUndoStackForFocused();return n.length?n[n.length-1]:null}pitchTopRedoElement(){const n=this._getRedoStackForFocused();return n.length?n[n.length-1]:null}popUndoToRedo(){const s=this._getUndoStackForFocused().pop();s&&(this._getRedoStackForFocused().push(s),this._updateStatus())}popRedoToUndo(){const s=this._getRedoStackForFocused().pop();s&&(this._getUndoStackForFocused().push(s),this._updateStatus())}_updateStatus(){var i,o;const n=this._getFocusedUniverInstanceId(),s=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,r=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:s,redos:r})}_getUndoStack(n,s=!1){let r=this._undoStacks.get(n);return!r&&s&&(r=[],this._undoStacks.set(n,r)),r||null}_getRedoStack(n,s=!1){let r=this._redoStacks.get(n);return!r&&s&&(r=[],this._redoStacks.set(n,r)),r||null}_getUndoStackForFocused(){const n=this._getFocusedUniverInstanceId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUniverInstanceId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_getFocusedUniverInstanceId(){var o,a;let n="";const s=this._contextService.getContextValue(Xt),r=this._contextService.getContextValue(Us),i=this._contextService.getContextValue(Ms);return s?r?n=Vs:i?n=xs:n=((o=this._univerInstanceService.getFocusedUniverInstance())==null?void 0:o.getUnitId())??"":n=((a=this._univerInstanceService.getFocusedUniverInstance())==null?void 0:a.getUnitId())??"",n}},c.LocalUndoRedoService=ho([Me(0,gt),Me(1,mt),Me(2,lt)],c.LocalUndoRedoService);class ps{dispose(){}async dispatchToHandlers(){return!1}}const js=new class extends ps{constructor(){super(...arguments);_(this,"type",Mt.COMMAND);_(this,"id","univer.command.undo")}async handler(e){const n=e.get(Zt),s=n.pitchTopUndoElement();if(!s)return!1;const r=e.get(mt);return(s.undo?await s.undo(s.undoMutations):se(s.undoMutations,r))?(n.popUndoToRedo(),!0):!1}},zs=new class extends ps{constructor(){super(...arguments);_(this,"type",Mt.COMMAND);_(this,"id","univer.command.redo")}async handler(e){const n=e.get(Zt),s=n.pitchTopRedoElement();if(!s)return!1;const r=e.get(mt);return(s.redo?await s.redo(s.redoMutations):se(s.redoMutations,r))?(n.popRedoToUndo(),!0):!1}};class Jt extends T{constructor(){super(...arguments);_(this,"_started",!1)}addPlugins(n){if(this._started){const s=n.map(([r,i])=>this._initPlugin(r,i));this._pluginsRunLifecycle(s,w.Starting),setTimeout(()=>this._takePluginsThroughLifecycle(s))}else{const s=n.map(([r,i])=>this._initPlugin(r,i));this._takePluginsThroughLifecycle(s),this._started=!0}}_takePluginsThroughLifecycle(n,s=!1){this.disposeWithMe(D(this._lifecycleService.subscribeWithPrevious().subscribe(r=>{s&&r===w.Starting||this._pluginsRunLifecycle(n,r)})))}_pluginsRunLifecycle(n,s){n.forEach(r=>{switch(s){case w.Starting:r.onStarting(this._injector);break;case w.Ready:r.onReady();break;case w.Rendered:r.onRendered();break;case w.Steady:r.onSteady();break}}),this._lifecycleInitializerService.initModulesOnStage(s)}_initPlugin(n,s){return this._injector.createInstance(n,s)}}var fo=Object.defineProperty,go=Object.getOwnPropertyDescriptor,Eo=(t,e,n,s)=>{for(var r=s>1?void 0:s?go(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&fo(e,n,r),r},Ue=(t,e)=>(n,s)=>e(n,s,t);c.UniverDoc=class extends Jt{constructor(e,n,s){super(),this._injector=e,this._lifecycleService=n,this._lifecycleInitializerService=s}createDoc(e){return this._injector.createInstance(_t,e)}},c.UniverDoc=Eo([Ue(0,A.Inject(A.Injector)),Ue(1,A.Inject(c.LifecycleService)),Ue(2,A.Inject(y))],c.UniverDoc);var Ro=Object.defineProperty,mo=Object.getOwnPropertyDescriptor,Oo=(t,e,n,s)=>{for(var r=s>1?void 0:s?mo(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&Ro(e,n,r),r},Te=(t,e)=>(n,s)=>e(n,s,t);c.UniverSheet=class extends Jt{constructor(e,n,s){super(),this._injector=e,this._lifecycleService=n,this._lifecycleInitializerService=s}createSheet(e){return this._injector.createInstance(c.Workbook,e)}},c.UniverSheet=Oo([Te(0,A.Inject(A.Injector)),Te(1,A.Inject(c.LifecycleService)),Te(2,A.Inject(y))],c.UniverSheet);var Ao=Object.defineProperty,Io=Object.getOwnPropertyDescriptor,Co=(t,e,n,s)=>{for(var r=s>1?void 0:s?Io(e,n):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(s?o(e,n,r):o(r))||r);return s&&r&&Ao(e,n,r),r},Pe=(t,e)=>(n,s)=>e(n,s,t);c.UniverSlide=class extends Jt{constructor(e,n,s){super(),this._injector=e,this._lifecycleService=n,this._lifecycleInitializerService=s}createSlide(e){return this._injector.createInstance(Ae,e)}},c.UniverSlide=Co([Pe(0,A.Inject(A.Injector)),Pe(1,A.Inject(c.LifecycleService)),Pe(2,A.Inject(y))],c.UniverSlide);const So=200;class No extends Jt{constructor(n={}){super();_(this,"_injector");_(this,"_univerPluginStore",new nr);_(this,"_univerPluginRegistry",new sr);_(this,"_univerSheet",null);_(this,"_univerDoc",null);_(this,"_univerSlide",null);_(this,"_initLazyPluginsTimer");this._injector=this._initDependencies();const{theme:s,locale:r,locales:i,logLevel:o}=n;s&&this._injector.get(De).setTheme(s),i&&this._injector.get(bt).load(i),r&&this._injector.get(bt).setLocale(r),o&&this._injector.get(st).setLogLevel(o)}get _univerInstanceService(){return this._injector.get(gt)}get _lifecycleService(){return this._injector.get(c.LifecycleService)}get _lifecycleInitializerService(){return this._injector.get(y)}__getInjector(){return this._injector}dispose(){this._injector.dispose()}setLocale(n){this._injector.get(bt).setLocale(n)}createUniverSheet(n){let s;const r=()=>{s=this._univerSheet.createSheet(n),this._univerInstanceService.addSheet(s)};if(this._univerSheet)r();else{this._tryProgressToStart();const i=this._univerSheet=this._injector.createInstance(c.UniverSheet),o=this._univerPluginRegistry.getRegisterPlugins(M.Sheet).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(M.Sheet),i.addPlugins(o),r(),this._tryProgressToReady()}return s}createUniverDoc(n){let s;const r=()=>{s=this._univerDoc.createDoc(n),this._univerInstanceService.addDoc(s)};if(this._univerDoc)r();else{this._tryProgressToStart();const i=this._univerDoc=this._injector.createInstance(c.UniverDoc),o=this._univerPluginRegistry.getRegisterPlugins(M.Doc).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(M.Doc),i.addPlugins(o),r(),this._tryProgressToReady()}return s}createUniverSlide(n){let s;const r=()=>{s=this._univerSlide.createSlide(n),this._univerInstanceService.addSlide(s)};if(this._univerSlide)r();else{this._tryProgressToStart();const i=this._univerSlide=this._injector.createInstance(c.UniverSlide),o=this._univerPluginRegistry.getRegisterPlugins(M.Slide).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(M.Slide),i.addPlugins(o),r(),this._tryProgressToReady()}return s}_initDependencies(){return new A.Injector([[gt,{useFactory:n=>new Se({createUniverDoc:s=>this.createUniverDoc(s),createUniverSheet:s=>this.createUniverSheet(s),createUniverSlide:s=>this.createUniverSlide(s)},n),deps:[lt]}],[ye],[bt],[De],[c.LifecycleService],[y],[ve,{useClass:c.PermissionService}],[c.UniverPermissionService],[st,{useClass:Qe,lazy:!0}],[mt,{useClass:c.CommandService,lazy:!0}],[Zt,{useClass:c.LocalUndoRedoService,lazy:!0}],[Je,{useClass:Er}],[lt,{useClass:Xe}],[en,{useClass:tn,lazy:!0}],[we,{useClass:ks,lazy:!0}]])}_tryProgressToStart(){this._started||(this._injector.get(y).start(),this._started=!0)}_tryProgressToReady(){this._injector.get(c.LifecycleService).stage<w.Ready&&(this._injector.get(c.LifecycleService).stage=w.Ready,this._univerPluginStore.forEachPlugin(s=>s.onReady()))}registerPlugin(n,s){if(n.type===M.Univer)this._registerUniverPlugin(n,s);else if(n.type===M.Sheet)this._registerSheetsPlugin(n,s);else if(n.type===M.Doc)this._registerDocsPlugin(n,s);else if(n.type===M.Slide)this._registerSlidesPlugin(n,s);else throw new Error(`Unimplemented plugin system for business: "${n.type}".`);if(this._started)return this._scheduleInitPluginAfterStarted()}_scheduleInitPluginAfterStarted(){this._initLazyPluginsTimer===void 0&&(this._initLazyPluginsTimer=setTimeout(()=>this._flushLazyPlugins(),So))}_flushLazyPlugins(){this._initLazyPluginsTimer=void 0;const n=this._univerPluginRegistry.getRegisterPlugins(M.Univer);if(n.length){this._univerPluginRegistry.clearPluginsOfType(M.Univer);const s=n.map(r=>this._injector.createInstance(r.plugin,r.options));this._takePluginsThroughLifecycle(s)}if(this._univerSheet){const s=this._univerPluginRegistry.getRegisterPlugins(M.Sheet).map(r=>[r.plugin,r.options]);s.length&&(this._univerSheet.addPlugins(s),this._univerPluginRegistry.clearPluginsOfType(M.Sheet))}if(this._univerDoc){const s=this._univerPluginRegistry.getRegisterPlugins(M.Doc).map(r=>[r.plugin,r.options]);s.length&&(this._univerDoc.addPlugins(s),this._univerPluginRegistry.clearPluginsOfType(M.Doc))}if(this._univerSlide){const s=this._univerPluginRegistry.getRegisterPlugins(M.Slide).map(r=>[r.plugin,r.options]);s.length&&(this._univerSlide.addPlugins(s),this._univerPluginRegistry.clearPluginsOfType(M.Slide))}}_registerUniverPlugin(n,s){if(this._started)this._univerPluginRegistry.registerPlugin(n,s);else{const r=this._injector.createInstance(n,s);r.onStarting(this._injector),this._univerPluginStore.addPlugin(r)}}_registerSheetsPlugin(n,s){this._univerPluginRegistry.registerPlugin(n,s)}_registerDocsPlugin(n,s){this._univerPluginRegistry.registerPlugin(n,s)}_registerSlidesPlugin(n,s){this._univerPluginRegistry.registerPlugin(n,s)}}function bo(t){const e=new MessageChannel;let n=!1;return e.port1.onmessage=()=>{n||t()},e.port2.postMessage(null),()=>{n=!0}}class Lo extends Dt{add(e){if(!e)return null;const n=new vt(e,this);return this._observers=[n],this._onObserverAdded&&this._onObserverAdded(n),n}makeObserverTopPriority(){}makeObserverBottomPriority(){}}const wo=A.createIdentifier("ILocalStorageService"),vo=t=>`sheet_interceptor_${t}`,Ys=t=>function(e,n){let s=-1;function r(i,o){if(i<=s)throw new Error("[SheetInterceptorService]: next() called multiple times!");return s=i,i===t.length?o:t[i].handler(o,n,r.bind(null,i+1))}return r(0,e)};class Do{constructor(e){_(this,"_interceptorsByName",new Map);_(this,"_interceptorPoints");this._interceptorPoints=e}fetchThroughInterceptors(e){const n=e,s=this._interceptorsByName.get(n);return Ys(s||[])}intercept(e,n){const s=e;this._interceptorsByName.has(s)||this._interceptorsByName.set(s,[]);const r=this._interceptorsByName.get(s);return r.push(n),this._interceptorsByName.set(s,r.sort((i,o)=>(o.priority??0)-(i.priority??0))),()=>q(this._interceptorsByName.get(s),n)}getInterceptPoints(){return this._interceptorPoints}}const Ks=`'?\\[((?![\\/?:"<>|*\\\\]).)*\\]`,Mo=/[^0-9]/g,Uo=/[^A-Za-z]/g;function Lt(t){const e=t[0]==="$",s=t.substring(1).indexOf("$")>-1;return e&&s?K.ALL:e?K.COLUMN:s?K.ROW:K.NONE}function To(t){const e=t.split("!");e.length>1&&(t=e[e.length-1]);const n=t.split(":");return n.length>1?{startAbsoluteRefType:Lt(n[0]),endAbsoluteRefType:Lt(n[1])}:{startAbsoluteRefType:Lt(n[0])}}function Xs(t=K.NONE){let e="",n="";return t===K.ROW?e="$":t===K.COLUMN?n="$":t===K.ALL&&(e="$",n="$"),{rowAbsoluteString:e,columnAbsoluteString:n}}function yt(t){const{startColumn:e,startRow:n,endColumn:s,endRow:r,startAbsoluteRefType:i,endAbsoluteRefType:o}=t,a=Xs(i),h=Xs(o),l=`${a.columnAbsoluteString}${O.chatAtABC(e)}${a.rowAbsoluteString}${n+1}`,u=`${h.columnAbsoluteString}${O.chatAtABC(s)}${h.rowAbsoluteString}${r+1}`;return l===u?l:`${l}:${u}`}function qs(t,e){return`${t}!${yt(e)}`}function Qs(t,e,n){return`[${t}]${e}!${yt(n)}`}function Po(t){const{unitId:e,sheetName:n,range:s}=t;return e!=null&&e.length>0&&n!=null&&n.length>0?Qs(e,n,s):n!=null&&n.length>0?qs(n,s):yt(s)}function Fe(t){const e=parseInt(t.replace(Mo,""))-1,n=O.ABCatNum(t.replace(Uo,"")),s=Lt(t);return{row:e,column:n,absoluteRefType:s}}function Fo(t){const e=new RegExp(Ks).exec(t);let n="";e!=null&&(n=e[0],t=t.replace(new RegExp(Ks,"g"),""));const s=t.indexOf("!");let r="",i="";s>-1?(r=t.substring(0,s),i=t.substring(s)):i=t;const o=i.indexOf(":");if(o===-1){const R=Fe(i),m=R.row,I=R.column,S=R.absoluteRefType;return{unitId:n,sheetName:r,range:{startRow:m,startColumn:I,endRow:m,endColumn:I,startAbsoluteRefType:S,endAbsoluteRefType:S}}}const a=i.substring(0,o),h=i.substring(o+1),l=Fe(a),u=Fe(h),d=l.row,g=l.column,f=u.row,E=u.column;return{unitId:n,sheetName:r,range:{startRow:d,startColumn:g,endRow:f,endColumn:E,startAbsoluteRefType:l.absoluteRefType,endAbsoluteRefType:u.absoluteRefType}}}tr(),c.ABCToNumber=fi,c.AbsoluteRefType=K,c.AlignTypeH=_s,c.AlignTypeV=fs,c.AutoFillSeries=on,c.BaselineOffset=Ft,c.BlockType=qn,c.BooleanNumber=C,c.BorderStyleTypes=L,c.BorderType=an,c.BulletAlignment=J,c.COLORS=ie,c.CellValueType=At,c.Color=it,c.ColorBuilder=Bt,c.ColorKit=x,c.ColorType=G,c.ColumnSeparatorType=Jn,c.CommandType=Mt,c.CommonHideTypes=ln,c.ConditionType=un,c.ContentAlignment=ls,c.ContextService=Xe,c.CopyPasteType=cn,c.CustomRangeType=Xn,c.DEFAULT_CELL=Bi,c.DEFAULT_DOC=me,c.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=Rr,c.DEFAULT_EMPTY_DOCUMENT_VALUE=lo,c.DEFAULT_RANGE=Fi,c.DEFAULT_RANGE_ARRAY=St,c.DEFAULT_SELECTION=Hi,c.DEFAULT_SLIDE=Ns,c.DEFAULT_STYLES=Yt,c.DEFAULT_WORKBOOK=Rs,c.DEFAULT_WORKSHEET=zt,c.DEFAULT_WORKSHEET_COLUMN_COUNT=Os,c.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Ss,c.DEFAULT_WORKSHEET_COLUMN_WIDTH=Is,c.DEFAULT_WORKSHEET_ROW_COUNT=ms,c.DEFAULT_WORKSHEET_ROW_HEIGHT=As,c.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Cs,c.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=Vs,c.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=xs,c.DashStyleType=is,c.DataStreamTreeNodeType=Bn,c.DataStreamTreeTokenType=ge,c.DesktopLogService=Qe,c.DeveloperMetadataVisibility=hn,c.Dimension=dn,c.Direction=_n,c.Disposable=T,c.DisposableCollection=Ke,c.DocStyleType=Yn,c.DocumentDataModel=_t,c.EXTENSION_NAMES=bs,c.Entry=he,c.EntryIterator=Un,c.ErrorService=ye,c.EventState=ze,c.FOCUSING_DOC=Ie,c.FOCUSING_EDITOR=Ms,c.FOCUSING_EDITOR_BUT_HIDDEN=Ki,c.FOCUSING_EDITOR_INPUT_FORMULA=Xi,c.FOCUSING_FORMULA_EDITOR=Us,c.FOCUSING_SHEET=Xt,c.FOCUSING_SLIDE=Ce,c.FloatingObjectManagerService=tn,c.FollowNumberWithType=Kn,c.FontItalic=Tt,c.FontStyleType=us,c.FontWeight=Pt,c.FormatType=fn,c.GlyphType=Ct,c.GridType=Qn,c.HLSColor=In,c.HorizontalAlign=rt,c.ICommandService=mt,c.IConfigService=Je,c.IContextService=lt,c.IFloatingObjectManagerService=en,c.ILocalStorageService=wo,c.ILogService=st,c.IPermissionService=ve,c.IResourceManagerService=we,c.ISnapshotPersistenceService=Hs,c.IUndoRedoService=Zt,c.IUniverInstanceService=gt,c.InterceptorManager=Do,c.InterpolationPointType=gn,c.KeyIterator=Dn,c.LRUHelper=It,c.LRUMap=Tn,c.LifecycleStages=w,c.LocaleService=bt,c.LocaleType=Ut,c.LogLevel=qe,c.MemoryCursor=nn,c.NamedStyleType=ss,c.NumberUnitType=ds,c.ObjectMatrix=z,c.ObjectRelativeFromH=cs,c.ObjectRelativeFromV=hs,c.Observable=Dt,c.ObservableHooks=Lo,c.Observer=vt,c.OnLifecycle=Ne,c.PRESET_LIST_TYPE=Ni,c.PageElementType=ws,c.PageOrientType=Es,c.PageType=Oe,c.ParagraphElementType=ts,c.PermissionPoint=Pn,c.PermissionStatus=_e,c.Plugin=Be,c.PluginType=M,c.PositionedObjectLayoutType=ns,c.PresetListType=jt,c.ProtectionType=En,c.RANGE_TYPE=Y,c.RGBA_PAREN=Cr,c.RGB_PAREN=Ir,c.Range=ft,c.Rectangle=ht,c.RedoCommand=zs,c.RefAlias=_i,c.Registry=te,c.RegistryAsMap=ee,c.RelativeDate=Rn,c.RelativeSlideLink=vs,c.ResourceManagerService=ks,c.RgbColor=Wt,c.RxDisposable=ur,c.SectionType=Zn,c.ShapeType=mn,c.SheetTypes=re,c.SheetViewModel=Ds,c.Slide=Ae,c.SpacingRule=rs,c.Styles=Ls,c.THEME_COLORS=An,c.TabStopAlignment=os,c.TextDecoration=On,c.TextDirection=Ot,c.TextDirectionType=yn,c.ThemeColor=$t,c.ThemeColorType=H,c.ThemeColors=Ht,c.ThemeService=De,c.Tools=O,c.UndoCommand=js,c.Univer=No,c.UniverEditablePermission=Qt,c.UniverEditablePermissionPoint=$s,c.UniverInstanceType=Ts,c.UpdateDocsAttributeType=F,c.ValueIterator=Mn,c.VerticalAlign=ut,c.WidthType=as,c.Worksheet=Nt,c.WrapStrategy=ct,c.WrapTextType=es,c.binarySearchArray=sn,c.characterSpacingControlType=gs,c.checkParagraphHasBullet=Yr,c.checkParagraphHasIndent=Kr,c.checkParagraphHasIndentByStyle=Nn,c.codeToBlob=Or,c.composeInterceptors=Ys,c.concatMatrixArray=ai,c.createInterceptorKey=vo,c.createRowColIter=fe,c.datenum_local=vn,c.dedupe=rr,c.deepCompare=le,c.deleteContent=Ln,c.deserializeRangeWithSheet=Fo,c.error=ce,c.fromObservable=lr,c.generate=ni,c.getAbsoluteRefTypeWitString=To,c.getAbsoluteRefTypeWithSingleString=Lt,c.getArrayLength=V,c.getBorderStyleType=jr,c.getCellValueType=$i,c.getColorStyle=j,c.getDocsUpdateBody=xt,c.getReverseDirection=Ar,c.getTypeFromPermissionItemList=hi,c.getWorksheetUID=Yi,c.handleJsonToDom=Vr,c.handleStyleToString=pr,c.hashAlgorithm=ri,c.horizontalLineSegmentsSubtraction=ue,c.insertMatrixArray=ii,c.insertTextToContent=bn,c.isEmptyCell=Gr,c.isFormulaId=xr,c.isFormulaString=kr,c.isICellData=Wi,c.isNullCell=Gi,c.isObserver=Ye,c.isRealNum=at,c.isSameStyleTextRun=Sn,c.isValidRange=zr,c.makeCellRangeToRangeData=$r,c.makeCellToSelection=Wr,c.moveMatrixArray=de,c.numberToABC=Ei,c.numberToListABC=Ri,c.orderSearchArray=rn,c.remove=q,c.repeatStringNumTimes=Hn,c.requestImmediateMacroTask=bo,c.runOnLifecycle=be,c.searchArray=mr,c.selectionToArray=di,c.sequence=$e,c.sequenceAsync=We,c.sequenceExecute=se,c.sequenceExecuteAsync=gr,c.serializeRange=yt,c.serializeRangeToRefString=Po,c.serializeRangeWithSheet=qs,c.serializeRangeWithSpreadsheet=Qs,c.sliceMatrixArray=li,c.sortRules=mi,c.sortRulesByDesc=Oi,c.sortRulesFactory=dt,c.spliceArray=oi,c.toDisposable=D,c.update=si,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|