@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/cjs/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`+s.map(function(n
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=s}});function Ge(t,e){if(t){var s=t.indexOf(e);0<=s&&t.splice(s,1)}}var Je=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,s,n,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=He(o),c=a.next();!c.done;c=a.next()){var l=c.value;l.remove(this)}}catch(E){e={error:E}}finally{try{c&&!c.done&&(s=a.return)&&s.call(a)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(Ot(u))try{u()}catch(E){i=E instanceof yt?E.errors:[E]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=He(h),_=f.next();!_.done;_=f.next()){var g=_.value;try{$e(g)}catch(E){i=i??[],E instanceof yt?i=We(We([],Be(i)),Be(E.errors)):i.push(E)}}}catch(E){n={error:E}}finally{try{_&&!_.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}if(i)throw new yt(i)}},t.prototype.add=function(e){var s;if(e&&e!==this)if(this.closed)$e(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(s=this._finalizers)!==null&&s!==void 0?s:[]).push(e)}},t.prototype._hasParent=function(e){var s=this._parentage;return s===e||Array.isArray(s)&&s.includes(e)},t.prototype._addParent=function(e){var s=this._parentage;this._parentage=Array.isArray(s)?(s.push(e),s):s?[s,e]:e},t.prototype._removeParent=function(e){var s=this._parentage;s===e?this._parentage=null:Array.isArray(s)&&Ge(s,e)},t.prototype.remove=function(e){var s=this._finalizers;s&&Ge(s,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}();Je.EMPTY;function cr(t){return t instanceof Je||t&&"closed"in t&&Ot(t.remove)&&Ot(t.add)&&Ot(t.unsubscribe)}function $e(t){Ot(t)?t():t.unsubscribe()}class ye{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 ts(t){return t instanceof Vt}class Vt{constructor(e,s){d(this,"_willBeUnregistered",!1);d(this,"unregisterOnNextCall",!1);this.callback=e,this.observable=s}dispose(){this.observable.remove(this)}}class jt{constructor(e){d(this,"_observers",new Array);d(this,"_eventState");d(this,"_onObserverAdded");this._eventState=new ye,e&&(this._onObserverAdded=e)}get observers(){return this._observers}add(e,s=!1,n=!1){if(!e)return null;const r=new Vt(e,this);return r.unregisterOnNextCall=n,s?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 s=0;s<this._observers.length;s++){const n=this._observers[s];if(!n._willBeUnregistered&&n.callback===e)return this._deferUnregister(n),!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 s=this._eventState;s.skipNextObservers=!1,s.lastReturnValue=e,s.isStopPropagation=!1;let n=!1;for(let r=0;r<this._observers.length;r++){const i=this._observers[r];if(!i._willBeUnregistered&&(s.lastReturnValue=i.callback(e,s),i.unregisterOnNextCall&&this._deferUnregister(i),s.isStopPropagation&&(n=!0),s.skipNextObservers))return{lastReturnValue:s.lastReturnValue,stopPropagation:n}}return{lastReturnValue:s.lastReturnValue,stopPropagation:n}}notifyObserversWithPromise(e){let s=Promise.resolve(e);if(!this._observers.length)return s;const n=this._eventState;n.skipNextObservers=!1;for(let r=0;r<this._observers.length;r++){const i=this._observers[r];n.skipNextObservers||i._willBeUnregistered||(s=s.then(()=>i.callback(e,n)),i.unregisterOnNextCall&&this._deferUnregister(i))}return s.then(()=>e)}notifyObserver(e,s){if(e._willBeUnregistered)return;const n=this._eventState;return n.skipNextObservers=!1,e.callback(s,n),e.unregisterOnNextCall&&this._deferUnregister(e),{lastReturnValue:n.lastReturnValue,stopPropagation:n.isStopPropagation}}hasObservers(){return this._observers.length>0}clear(){this._observers=new Array,this._onObserverAdded=null}clone(){const e=new jt;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 s=this._observers.indexOf(e);return s!==-1?(this._observers.splice(s,1),!0):!1}}function v(t){let e=!1;return cr(t)?{dispose:()=>{e||(e=!0,t.unsubscribe())}}:ts(t)?{dispose:()=>{e||(e=!0,t.dispose())}}:{dispose:()=>{e||(e=!0,t())}}}function hr(t){return v(()=>{t.unsubscribe()})}class es{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 es)}disposeWithMe(e){return this._collection.add(e)}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class dr extends M{constructor(){super(...arguments);d(this,"dispose$",new N.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}const ct=C.createIdentifier("univer.context-service");class ss 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(s){return this._contextMap.get(s)??!1}setContextValue(s,n){this._contextMap.set(s,n),this._contextChanged$.next()}}var ns=(t=>(t[t.SILENT=0]="SILENT",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.VERBOSE=3]="VERBOSE",t))(ns||{});const ht=C.createIdentifier("univer.log");class rs extends M{constructor(){super(...arguments);d(this,"_logLevel",0)}log(...s){if(this._logLevel<3||!s.length)return;const n=s[0];/^\[(.*?)\]/g.test(n)?console.log(`\x1B[97;104m${n}\x1B[0m:`,...s.slice(1)):console.log(...s)}warn(...s){this._logLevel>=2&&console.warn(...s)}error(...s){this._logLevel>=1&&console.error(...s)}setLogLevel(s){this._logLevel=s}}var _r=Object.defineProperty,fr=Object.getOwnPropertyDescriptor,gr=(t,e,s,n)=>{for(var r=n>1?void 0:n?fr(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&_r(e,s,r),r},ke=(t,e)=>(s,n)=>e(s,n,t),zt=(t=>(t[t.COMMAND=0]="COMMAND",t[t.OPERATION=1]="OPERATION",t[t.MUTATION=2]="MUTATION",t))(zt||{});const bt=C.createIdentifier("anywhere.command-service");class Er{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),v(()=>{var s;this._commands.delete(e.id),(s=e.onDispose)==null||s.call(e)})}getCommand(e){return this._commands.has(e)?[this._commands.get(e)]:null}}exports.CommandService=class{constructor(e,s){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=s,this._commandRegistry=new Er}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),v(()=>{const s=this._beforeCommandExecutionListeners.indexOf(e);this._beforeCommandExecutionListeners.splice(s,1)});throw new Error("Could not add a listener twice.")}onCommandExecuted(e){if(this._commandExecutedListeners.indexOf(e)===-1)return this._commandExecutedListeners.push(e),v(()=>{const s=this._commandExecutedListeners.indexOf(e);this._commandExecutedListeners.splice(s,1)});throw new Error("Could not add a listener twice.")}async executeCommand(e,s,n){const r=this._commandRegistry.getCommand(e);if(r){const[i]=r,o={id:i.id,type:i.type,params:s},a=this._pushCommandExecutionStack(o);this._beforeCommandExecutionListeners.forEach(l=>l(o,n));const c=await this._execute(i,s);return this._commandExecutedListeners.forEach(l=>l(o,n)),a.dispose(),c}throw new Error(`[CommandService]: Command "${e}" is not registered.`)}syncExecuteCommand(e,s,n){const r=this._commandRegistry.getCommand(e);if(r){const[i]=r,o={id:i.id,type:i.type,params:s};if(i.type===2){const l=lr(this._commandExecutionStack,u=>u.type===0);l&&(o.params=o.params??{},o.params.trigger=l.id)}const a=this._pushCommandExecutionStack(o),c=this._syncExecute(i,s);return a.dispose(),this._commandExecutedListeners.forEach(l=>l(o,n)),c}throw new Error(`[CommandService]: Command "${e}" is not registered.`)}_pushCommandExecutionStack(e){return this._commandExecutionStack.push(e),v(()=>tt(this._commandExecutionStack,e))}_registerCommand(e){return this._commandRegistry.registerCommand(e)}_registerMultiCommand(e){const s=this._commandRegistry.getCommand(e.id);let n;if(!s)n=new Rr(e.id),this._multiCommandDisposables.set(e.id,this._commandRegistry.registerCommand(n));else{if(s[0].multi!==!0)throw new Error("Command has registered as a single command.");n=s[0]}const r=n.registerImplementation(e);return v(()=>{var i;r.dispose(),n.hasImplementations()||(i=this._multiCommandDisposables.get(e.id))==null||i.dispose()})}async _execute(e,s){this._log.log("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${e.id}"`),this._commandExecutingLevel++;let n;try{n=await this._injector.invoke(e.handler,s),this._commandExecutingLevel--}catch(r){throw n=!1,this._commandExecutingLevel=0,r}return n}_syncExecute(e,s){this._log.log("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${e.id}".`),this._commandExecutingLevel++;let n;try{if(n=this._injector.invoke(e.handler,s),n instanceof Promise)throw new Error("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(r){throw n=!1,this._commandExecutingLevel=0,r}return n}};exports.CommandService=gr([ke(0,C.Inject(C.Injector)),ke(1,ht)],exports.CommandService);class Rr{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,s)=>{if(!this._implementations.length)return!1;const n=e.get(ht),r=e.get(ct),i=e.get(C.Injector);for(const o of this._implementations){const a=o.command.preconditions;if(a!=null&&a(r)&&(n.log("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,s)))return!0}return!1});this.id=e,this.name=e}registerImplementation(e){const s={command:e};return this._implementations.push(s),this._implementations.sort((n,r)=>r.command.priority-n.command.priority),v(()=>{var r;const n=this._implementations.indexOf(s);this._implementations.splice(n,1),(r=e.onDispose)==null||r.call(e)})}hasImplementations(){return this._implementations.length>0}}function Ae(t,e,s){const n=t.map(r=>()=>e.syncExecuteCommand(r.id,r.params,s));return qe(n)}function mr(t,e,s){const n=t.map(r=>()=>e.executeCommand(r.id,r.params,s));return Ze(n)}const is=C.createIdentifier("univer.config-service");class Or{constructor(){d(this,"_config",new Map)}getConfig(e){return this._config.get(e)}setConfig(e,s){this._config.set(e,s)}deleteConfig(e){this._config.delete(e)}}class os extends M{constructor(){super(...arguments);d(this,"_error$",new N.Subject);d(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(s){this._error$.next({errorKey:s})}}const Ar="__default_document_sub_component_id20231101__";class as{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 s=this._clearByParam(e);this._remove$.next(s)}addOrUpdate(e){const s=this._addByParam(e);this._andOrUpdate$.next(s)}BatchAddOrUpdate(e){const s=[];e.forEach(n=>{s.push(...this._addByParam(n))}),this._andOrUpdate$.next(s)}remove(e){const s=this._removeByParam(e);this._remove$.next(s)}pluginUpdateRefresh(e){this._pluginUpdate$.next(e)}_getFloatingObjects(e){var r;if(e==null)return;const{unitId:s,subComponentId:n}=e;return(r=this._managerInfo.get(s))==null?void 0:r.get(n)}_getFloatingObject(e){var i,o;if(e==null)return;const{unitId:s,subComponentId:n,floatingObjectId:r}=e;return(o=(i=this._managerInfo.get(s))==null?void 0:i.get(n))==null?void 0:o.get(r)}_addByParam(e){const{unitId:s,subComponentId:n,floatingObject:r,floatingObjectId:i}=e;this._managerInfo.has(s)||this._managerInfo.set(s,new Map);const o=this._managerInfo.get(s);return o.has(n)||o.set(n,new Map),o.get(n).set(i,r),[{unitId:s,subComponentId:n,floatingObjectId:i,floatingObject:r}]}_clearByParam(e){const s=this._getFloatingObjects(e),{unitId:n,subComponentId:r}=e,i=[];return s==null||s.forEach((o,a)=>{i.push({unitId:n,subComponentId:r,floatingObjectId:a,floatingObject:o})}),s==null||s.clear(),i}_removeByParam(e){const s=this._getFloatingObjects(e),n=s==null?void 0:s.get(e.floatingObjectId);return n==null?[]:(s==null||s.delete(e.floatingObjectId),[{...e,floatingObject:n}])}}const ls=C.createIdentifier("univer.floating-object.service");class us{constructor(){d(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(e){this.cursor+=e}moveCursorTo(e){this.cursor=e}}function cs(t,e){let s=0,n=t.length-1;for(;s<=n;){const r=Math.floor((n+s)/2);if(e<t[r]&&(r===0||e>=t[r-1]))return r;if(e>=t[r])s=r+1;else if(e<t[r])n=r-1;else return-1}return-1}function hs(t,e){let s=0,n=0,r=0,i=-1,o=t.length-1;for(;s<t.length&&o>=0&&o>=s;){if(n=t[o],o===0?r=0:r=t[o-1],e>=r&&e<=n){i=o;break}if(n=t[s],s===0?r=0:r=t[s-1],e>=r&&e<n){i=s;break}s++,o--}return i}function Ir(t,e){let s=t.length-1;return e<t[0]?-1:e>t[t.length-1]?1/0:(t.length<40||e<=t[20]||e>=t[s-20]?s=hs(t,e):s=cs(t,e),s)}function Cr(t){const e=new Blob([t],{type:"text/javascript"});return window.URL.createObjectURL(e)}var ds=(t=>(t[t.DEFAULT_SERIES=0]="DEFAULT_SERIES",t[t.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",t))(ds||{}),b=(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))(b||{}),_s=(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))(_s||{}),W=(t=>(t[t.UNSUPPORTED=0]="UNSUPPORTED",t[t.RGB=1]="RGB",t[t.HEX=2]="HEX",t[t.THEME=3]="THEME",t))(W||{}),fs=(t=>(t[t.ON=0]="ON",t[t.OFF=1]="OFF",t))(fs||{}),gs=(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))(gs||{}),Es=(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))(Es||{}),Rs=(t=>(t[t.DOCUMENT=0]="DOCUMENT",t[t.PROJECT=1]="PROJECT",t))(Rs||{}),ms=(t=>(t[t.COLUMNS=0]="COLUMNS",t[t.ROWS=1]="ROWS",t))(ms||{}),Os=(t=>(t[t.UP=0]="UP",t[t.RIGHT=1]="RIGHT",t[t.DOWN=2]="DOWN",t[t.LEFT=3]="LEFT",t))(Os||{});function Sr(t){switch(t){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var As=(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))(As||{}),Is=(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))(Is||{}),Yt=(t=>(t.EN_US="enUS",t.ZH_CN="zhCN",t))(Yt||{}),Cs=(t=>(t[t.RANGE=0]="RANGE",t[t.SHEET=1]="SHEET",t))(Cs||{}),Ss=(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))(Ss||{}),Ns=(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))(Ns||{}),Ie=(t=>(t[t.GRID=0]="GRID",t[t.KANBAN=1]="KANBAN",t[t.GANTT=2]="GANTT",t))(Ie||{}),St=(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))(St||{}),bs=(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))(bs||{}),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||{}),at=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TOP=1]="TOP",t[t.MIDDLE=2]="MIDDLE",t[t.BOTTOM=3]="BOTTOM",t))(at||{}),lt=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OVERFLOW=1]="OVERFLOW",t[t.CLIP=2]="CLIP",t[t.WRAP=3]="WRAP",t))(lt||{}),xt=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ITALIC=1]="ITALIC",t))(xt||{}),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||{}),I=(t=>(t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE",t))(I||{}),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||{}),p=(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))(p||{}),Kt=(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))(Kt||{});const Ls={[Kt.OFFICE]:{[p.ACCENT1]:"#4472C4",[p.ACCENT2]:"#ED7D31",[p.ACCENT3]:"#A5A5A5",[p.ACCENT4]:"#70AD47",[p.ACCENT5]:"#5B9BD5",[p.ACCENT6]:"#70AD47",[p.DARK1]:"#000000",[p.DARK2]:"#44546A",[p.LIGHT1]:"#FFFFFF",[p.LIGHT2]:"#E7E6E6",[p.HYPERLINK]:"#0563C1",[p.FOLLOWED_HYPERLINK]:"#954F72"}};class Xt{constructor(){d(this,"_themeValue",p.LIGHT1);d(this,"_themeColors");d(this,"_themeTint");d(this,"_rgbValue","");d(this,"_colorType");this._colorType=W.UNSUPPORTED,this._themeColors=Kt.OFFICE,this._themeTint=0}asRgbColor(){return new Ht(this._rgbValue,this)}asThemeColor(){return new Bt(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case W.THEME:return this.asThemeColor();case W.RGB:return this.asRgbColor();case W.UNSUPPORTED:throw Error("unsupported color type")}}setRgbColor(e){return this._colorType=W.RGB,this._rgbValue=e,this}setThemeColors(e){this._colorType=W.THEME,this._themeColors=e}setThemeTint(e){this._colorType=W.THEME,this._themeTint=e}setThemeColor(e){return this._colorType=W.THEME,this._themeValue=e,this}getColorType(){return this._colorType}}class it{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 s=+`0x${e[0]}${e[1]}`,n=+`0x${e[2]}${e[3]}`,r=+`0x${e[4]}${e[5]}`;return new Xt().setRgbColor(`rgb(${s},${n},${r})`).asRgbColor()}static hexToRgbString(e){const s=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(s,(i,o,a,c)=>o+o+a+a+c+c);const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let r=null;if(n){const i=parseInt(n[1],16),o=parseInt(n[2],16),a=parseInt(n[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 ws{constructor(e){d(this,"_saturation",0);d(this,"_hue",0);d(this,"_lightness",0);d(this,"_alpha",0);const s=e.getRed()/255,n=e.getGreen()/255,r=e.getBlue()/255,i=e.getAlpha()/255,o=Math.min(s,Math.min(n,r)),a=Math.max(s,Math.max(n,r)),c=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=c/(a+o):this._saturation=c/(2-a-o),s===a&&(this._hue=(n-r)/c),n===a&&(this._hue=2+(r-s)/c),r===a&&(this._hue=4+(s-n)/c),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const e=new Xt;if(this._saturation===0)return e.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),e.asRgbColor();let s;this._lightness<.5?s=this._lightness*(1+this._saturation):s=this._lightness+this._saturation-this._lightness*this._saturation;const n=2*this._lightness-s,r=this._hue/360,i=r+1/3,o=this.setColor(s,n,i),a=this.setColor(s,n,r),c=r-1/3,l=this.setColor(s,n,c);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,s,n){n<0&&(n+=1),n>1&&(n-=1);let r;return 6*n<1?r=s+(e-s)*6*n:2*n<1?r=e:3*n<2?r=s+(e-s)*(2/3-n)*6:r=s,r}setLightness(e){this._lightness=e}}const B=class B extends it{constructor(s,n){super(n);d(this,"_cssString");d(this,"_red");d(this,"_green");d(this,"_blue");d(this,"_alpha");let r=s.match(B.RGBA_EXTRACT);if(r){const i=+r[1],o=+r[2],a=+r[3],c=+r[4];this._cssString=s,this._red=i,this._green=o,this._blue=a,this._alpha=c;return}if(r=s.match(B.RGB_EXTRACT),r){const i=+r[1],o=+r[2],a=+r[3];this._cssString=s,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 s=this._red+B.RGB_COLOR_AMT;return s>255?s=255:s<0&&(s=0),s}getGreen(){let s=this._green+B.RGB_COLOR_AMT;return s>255?s=255:s<0&&(s=0),s}getBlue(){let s=this._blue+B.RGB_COLOR_AMT;return s>255?s=255:s<0&&(s=0),s}getAlpha(){return this._alpha}getColorType(){return W.RGB}clone(){return new B(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(s){return s instanceof B?s._red===this._red&&s._blue===this._blue&&s._green===this._green&&s._alpha===this._alpha:!1}getCssString(){return this._cssString}};d(B,"RGB_COLOR_AMT",0),d(B,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),d(B,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let Ht=B;const J=class J extends it{constructor(s,n,r,i){super(i);d(this,"_themeColorType");d(this,"_themeTint");d(this,"_themeColors");this._themeColorType=s,this._themeTint=n,this._themeColors=r}lumValue(s,n){if(s==null)return n;let r;return s<0?r=n*(1+s):r=n*(1-s)+(255-255*(1-s)),r}asRgbColor(){const s=Ls[this._themeColors];if(s==null)throw new Error("not find themeColors type");const n=s[this._themeColorType];if(n==null)throw new Error("not find themeColors value");let r;if(J._cacheThemeColor.has(this._themeColors)){if(r=J._cacheThemeColor.get(this._themeColors),r.has(this._themeColorType))return r.get(this._themeColorType)}else r=new Map,J._cacheThemeColor.set(this._themeColors,r);const i=new ws(it.hexValueToRgbColor(n));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return r.set(this._themeColorType,o),o}clone(){return new J(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(s){return s instanceof J?s._themeColorType===this._themeColorType:!1}getColorType(){return W.THEME}getThemeColorType(){return this._themeColorType}};d(J,"_cacheThemeColor",new Map);let Bt=J;const Nr="rgb(",br="rgba(",ae={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 ${constructor(e){d(this,"_color");d(this,"_rgbColor");d(this,"_isValid",!1);if(e==null){this._setNullColor();return}if(e instanceof $){this._color={...e._color},this._rgbColor={...e._rgbColor};return}const s=vs(e);if(s==null){this._setNullColor();return}this._color=s;const n=Tr(this._color);if(n==null){this._setNullColor();return}this._rgbColor=n,this._isValid=!0}static mix(e,s,n){n=Math.min(1,Math.max(0,n));const r=new $(e).toRgb(),i=new $(s).toRgb(),o=r.a??1,a=i.a??1,c={r:(i.r-r.r)*n+r.r,g:(i.g-r.g)*n+r.g,b:(i.b-r.b)*n+r.b,a:(a-o)*n+o};return new $(c)}static getContrastRatio(e,s){const n=new $(e).getLuminance(),r=new $(s).getLuminance();return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:e,g:s,b:n,a:r=1}=this.toRgb(),i=r<1;return`rgb${i?"a":""}(${e},${s},${n}${i?`,${r}`:""})`}toString(){return this.toRgbString()}toHexString(e){const{r:s,g:n,b:r,a:i=1}=this.toRgb(),o=i<1,a=[wt(Math.round(s).toString(16)),wt(Math.round(n).toString(16)),wt(Math.round(r).toString(16)),wt(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 xr(this.toRgb())}toHsl(){return Pr(this.toRgb())}lighten(e=10){const s=this.toHsl();return s.l+=e,s.l=Math.min(Math.max(s.l,0),100),new $(s)}darken(e=10){const s=this.toHsl();return s.l-=e,s.l=Math.min(Math.max(s.l,0),100),new $(s)}setAlpha(e){return new $({...this._rgbColor,a:e})}getLuminance(){let{r:e,g:s,b:n}=this.toRgb();return e=te(e),s=te(s),n=te(n),Number((.2126*e+.7152*s+.0722*n).toFixed(3))}getBrightness(){const{r:e,g:s,b:n}=this.toRgb();return(e*299+s*587+n*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 wt=t=>t.length===1?`0${t}`:t,te=t=>(t/=255,t<=.03928?t/12.92:((t+.055)/1.055)**2.4),vs=t=>{if(Fr(t)){if("r"in t){const n={r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)};return t.a!==void 0&&(n.a=t.a),n}if("l"in t){const n={h:Math.round(t.h),s:t.s,l:t.l};return t.a!==void 0&&(n.a=t.a),n}const s={h:Math.round(t.h),s:t.s,v:t.v};return t.a!==void 0&&(s.a=t.a),s}const e=t.trim();if(ae[e]){const s=ae[e],n={r:Math.round(s[0]),g:Math.round(s[1]),b:Math.round(s[2])};return n.a=s[3]||1,n}if(e.startsWith("#"))return Lr(e);if(e.startsWith("rgb"))return wr(e);if(e.startsWith("hsl"))return vr(e);if(e.startsWith("hsv"))return Dr(e)},Lr=t=>{const e=t.substring(1),s=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(s);if(!n||n.length<3)throw new Error(`The color '${t}' is illegal hex color`);n[0].length===1&&(n=n.map(i=>i+i));const r={r:parseInt(n[0],16),g:parseInt(n[1],16),b:parseInt(n[2],16)};return n.length>3&&(r.a=parseInt(n[3],16)/255),r},wr=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal rgb color`);const s=t.substring(e+1,t.length-1).split(",");if(s.length<3)throw new Error(`The color '${t}' is illegal rgb color`);const n={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)};return s.length>3&&(n.a=parseFloat(s[3])),n},vr=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal hsl color`);const s=t.substring(e+1,t.length-1).split(",");if(s.length<3)throw new Error(`The color '${t}' is illegal hsl color`);const n={h:parseInt(s[0],10),s:parseFloat(s[1]),l:parseFloat(s[2])};return s.length>3&&(n.a=parseFloat(s[3])),n},Dr=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal hsv color`);const s=t.substring(e+1,t.length-1).split(",");if(s.length<3)throw new Error(`The color '${t}' is illegal hsv color`);const n={h:parseInt(s[0],10),s:parseFloat(s[1]),v:parseFloat(s[2])};return s.length>3&&(n.a=parseFloat(s[3])),n},Tr=t=>{const e=vs(t);if(e!=null)return"r"in e?e:"l"in e?Ur(e):Mr(e)},ee=(t,e,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+(e-t)*6*s:s<1/2?e:s<2/3?t+(e-t)*(2/3-s)*6:t),Ur=t=>{let{h:e,s,l:n}=t;e/=360,s/=100,n/=100;let r=0,i=0,o=0;if(s===0)r=i=o=n;else{const c=n<.5?n*(1+s):n+s-n*s,l=2*n-c;r=ee(l,c,e+1/3),i=ee(l,c,e),o=ee(l,c,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},Mr=t=>{let{h:e,s,v:n}=t;e=e/360*6,s/=100,n/=100;const r=Math.floor(e),i=e-r,o=n*(1-s),a=n*(1-i*s),c=n*(1-(1-i)*s),l=r%6,u=[n,a,o,o,c,n][l],h=[c,n,n,a,o,o][l],f=[o,o,c,n,n,a][l],_={r:u*255,g:h*255,b:f*255};return t.a!==void 0&&(_.a=t.a),_},Pr=t=>{let{r:e,g:s,b:n}=t;e/=255,s/=255,n/=255;const r=Math.max(e,s,n),i=Math.min(e,s,n),o=(r+i)/2;let a,c;if(r===i)a=c=0;else{const u=r-i;switch(c=o>.5?u/(2-r-i):u/(r+i),r){case e:a=(s-n)/u+(s<n?6:0);break;case s:a=(n-e)/u+2;break;default:a=(e-s)/u+4;break}a/=6}const l={h:Math.round(a*360),s:Math.round(c*100),l:Math.round(o*100)};return t.a!==void 0&&(l.a=t.a),l},xr=t=>{let{r:e,g:s,b:n}=t;e/=255,s/=255,n/=255;const r=Math.max(e,s,n),i=Math.min(e,s,n);let o;const a=r,c=r-i,l=r===0?0:c/r;if(r===i)o=0;else{switch(r){case e:o=(s-n)/c+(s<n?6:0);break;case s:o=(n-e)/c+2;break;default:o=(e-s)/c+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},pr=t=>t==null,Fr=t=>!pr(t)&&typeof t=="object";var P=(t=>(t[t.COVER=0]="COVER",t[t.REPLACE=1]="REPLACE",t[t.INTERSECTION=2]="INTERSECTION",t))(P||{});let Hr=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,s)=>(s&=63,s<36?e+=s.toString(36):s<62?e+=(s-26).toString(36).toUpperCase():s>62?e+="-":e+="_",e),"");const Br=/^-ms-/,Wr=/-([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 m{static stringAt(e){let s="",n=e;for(;n>=Q.length;)n/=Q.length,n-=1,s+=Q[n%Q.length];const r=e%Q.length;return s+=Q[r],s}static indexAt(e){let s=0;for(let n=0;n<e.length-1;n+=1){const r=e.charCodeAt(n)-65,i=e.length-1-n;s+=Q.length**i+Q.length*r}return s+=e.charCodeAt(e.length-1)-65,s}static deleteBlank(e){return m.isString(e)?e.replace(/\s/g,""):e}static getSystemType(){const e=navigator.userAgent,s=navigator.platform==="Win32"||navigator.platform==="Windows",n=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(n)return"Mac";if(navigator.platform==="X11"&&!s&&!n)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(s){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,s=e.indexOf("Opera")>-1,n=e.indexOf("compatible")>-1&&e.indexOf("MSIE")>-1&&!s,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,c=e.indexOf("Chrome")>-1&&e.indexOf("Safari")>-1;if(n){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":s?"Opera":a?"Safari":c?"Chrome":i?"Edge":r?"IE11":"Unknown browser"}static generateRandomId(e=21){return Hr(e)}static getClassName(e){return e.constructor.name}static deepMerge(e,...s){s.forEach(o=>o&&i(o));function n(o,a){o.forEach((c,l)=>{if(m.isArray(c)){const u=a[l]??[];a[l]=u,n(c,u);return}if(m.isObject(c)){const u=a[l]??{};a[l]=u,r(c,u);return}a[l]=c})}function r(o,a){Object.keys(o).forEach(c=>{const l=o[c];if(m.isObject(l)){const u=a[c]??{};a[c]=u,r(l,u);return}if(m.isArray(l)){const u=a[c]??[];a[c]=u,n(l,u);return}a[c]=l})}function i(o){Object.keys(o).forEach(a=>{const c=o[a];if(m.isArray(c)){const l=e[a]??[];e[a]=l,n(c,l);return}if(m.isObject(c)){const l=e[a]??{};e[a]=l,r(c,l);return}e[a]=c})}return e}static numberFixed(e,s){return Number(Number(e).toFixed(s))}static diffValue(e,s){function n(o,a){const c=m.getValueType(o),l=m.getValueType(a);return c!==l?!1:m.isArray(o)?r(o,a):m.isObject(o)?i(o,a):m.isDate(o)?o.getTime()===a.getTime():m.isRegExp(o)?o.toString()===a.toString():o===a}function r(o,a){if(e.length!==s.length)return!1;for(let c=0,l=o.length;c<l;c++){const u=o[c],h=a[c];if(!n(u,h))return!1}return!0}function i(o,a){const c=Object.keys(o),l=Object.keys(a);if(c.length!==l.length)return!1;for(const u of c){if(!l.includes(u))return!1;const h=o[u],f=a[u];if(!n(h,f))return!1}return!0}return n(e,s)}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 s=[];return e.forEach((n,r)=>{s[r]=m.deepClone(n)}),s}if(this.isObject(e)){const s={};return Object.keys(e).forEach(n=>{const r=e[n];s[n]=m.deepClone(r)}),Object.setPrototypeOf(s,Object.getPrototypeOf(e)),s}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,s){return e instanceof s}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 s in e)return!1;return!0}static isMobile(){let e=0,s=0;return document.body.clientWidth&&(e=document.body.clientWidth),document.body.clientHeight&&(s=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||e<350&&s<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 s=>{for(let n=0;n<e;n++)s&&s()}}static hasLength(e,s){return m.isDefine(e)?m.isDefine(s)?e.length===s:e.length>0:!1}static capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}static fCamelCase(e,s){return s.toUpperCase()}static camelCase(e){return e.replace(Br,"ms-").replace(Wr,this.fCamelCase)}static removeNull(e){return this.isObject(e)&&Object.keys(e).forEach(s=>{const n=e[s];n==null?delete e[s]:m.removeNull(n)}),e}static fillTwoDimensionalArray(e,s,n){return new Array(e).fill(n).map(r=>new Array(s).fill(n))}static numToWord(e){let s="";for(;e>0;){let n=e%26;n=n===0?n=26:n,s=String.fromCharCode(96+n)+s,e=(e-n)/26}return s.toLocaleUpperCase()}static ABCatNum(e){if(e==null||e.length===0)return NaN;const s=e.toLowerCase().split(""),n=s.length;let r=0,i=0;for(let o=0;o<n;o++)i=s[o].charCodeAt(0)-96,r+=i*26**(n-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 s=0,n=e.length;s<n;s++){const r=parseInt((Math.random()*n).toString()),i=e[r];e[r]=e[s],e[s]=i}return e}static commonExtend(e,s){const n={};for(const r in e)n[r]=e[r];for(const r in s)s[r]!=null&&(n[r]=s[r]);return n}static commonExtend1(e,s){for(const n in e)s[n]==null&&(s[n]=e[n]);return s}static arrayToObject(e){const s={};return e.forEach((n,r)=>{s[r]={},n.forEach((i,o)=>{s[r][o]=i})}),s}static hasIntersectionBetweenTwoRanges(e,s,n,r){return s>=n&&r>=e}}function Gr(t){if(!t)return;const{actualRow:e,actualColumn:s,isMerged:n,isMergedMainCell:r,mergeInfo:i}=t;let{startY:o,endY:a,startX:c,endX:l}=t,u=e,h=s,f=e,_=s;if(n&&i){const{startRow:g,startColumn:E,endRow:R,endColumn:O,startY:A,endY:L,startX:F,endX:x}=i;u=g,h=E,f=R,_=O,o=A,a=L,c=F,l=x}return r&&(o=i.startY,a=i.endY,c=i.startX,l=i.endX,f=i.endRow,_=i.endColumn),{startRow:u,startColumn:h,endRow:f,endColumn:_,startY:o,endY:a,startX:c,endX:l}}function $r(t){if(!t)return;const{actualRow:e,actualColumn:s,isMerged:n,isMergedMainCell:r,startRow:i,startColumn:o,endRow:a,endColumn:c}=t;let l=e,u=s,h=e,f=s;return(n||r)&&(l=i,u=o,h=a,f=c),{startRow:l,startColumn:u,endRow:h,endColumn:f}}function kr(t){var s;return!t||(((s=t==null?void 0:t.v)==null?void 0:s.toString())||"").length===0&&!t.p}function k(t){if(t){if(t.rgb)return t.rgb;if(t.th)return new Xt().setThemeColor(t.th).asThemeColor().asRgbColor().getCssString()}return null}function Vr(t){return m.isString(t)&&t.substring(0,1)==="="&&t.length>1}function jr(t){return m.isString(t)&&t.indexOf("=")===-1&&t.length===6}function zr(t){return""}function Yr(t,e=!1){var i;let s="";const n=new Map([["ff",()=>{t.ff&&(s+=`font-family: ${t.ff}; `)}],["fs",()=>{if(t.fs){let o=t.fs;t.va&&(o/=2),s+=`font-size: ${o}pt; `}}],["it",()=>{t.it&&(s+="font-style: italic; ")}],["bl",()=>{t.bl&&(s+="font-weight: bold; ")}],["ul",()=>{var o;(o=t.ul)!=null&&o.s&&(s.indexOf("text-decoration-line")>-1?s=s.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," underline"):s+="text-decoration-line: underline; ",t.ul.cl&&s.indexOf("text-decoration-color")===-1&&(s+=`text-decoration-color: ${k(t.ul.cl)}; `),t.ul.t&&s.indexOf("text-decoration-style")===-1&&(s+=`text-decoration-style: ${t.ul.t} `))}],["st",()=>{var o;(o=t.st)!=null&&o.s&&(s.indexOf("text-decoration-line")>-1?s=s.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," line-through"):s+="text-decoration-line: line-through; ",t.st.cl&&s.indexOf("text-decoration-color")===-1&&(s+=`text-decoration-color: ${k(t.st.cl)}; `),t.st.t&&s.indexOf("text-decoration-style")===-1&&(s+=`text-decoration-style: ${t.st.t} `))}],["ol",()=>{var o;(o=t.ol)!=null&&o.s&&(s.indexOf("text-decoration-line")>-1?s=s.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," overline"):s+="text-decoration-line: overline; ",t.ol.cl&&s.indexOf("text-decoration-color")===-1&&(s+=`text-decoration-color: ${k(t.ol.cl)}; `),t.ol.t&&s.indexOf("text-decoration-style")===-1&&(s+=`text-decoration-style: ${t.ol.t} `))}],["bg",()=>{t.bg&&(s+=`background: ${k(t.bg)}; `)}],["bd",()=>{var o,a,c,l,u,h,f,_;(o=t.bd)!=null&&o.b&&(s+=`border-bottom: ${vt((a=t.bd)==null?void 0:a.b.s)} ${k(t.bd.b.cl)??""}; `),(c=t.bd)!=null&&c.t&&(s+=`border-top: ${vt((l=t.bd)==null?void 0:l.t.s)} ${k(t.bd.t.cl)??""}; `),(u=t.bd)!=null&&u.r&&(s+=`border-right: ${vt((h=t.bd)==null?void 0:h.r.s)} ${k(t.bd.r.cl)??""}; `),(f=t.bd)!=null&&f.l&&(s+=`border-left: ${vt((_=t.bd)==null?void 0:_.l.s)} ${k(t.bd.l.cl)??""}; `)}],["cl",()=>{t.cl&&(s+=`color: ${k(t.cl)}; `)}],["va",()=>{t.va===Ft.SUBSCRIPT?s+="vertical-align: sub; ":t.va===Ft.SUPERSCRIPT&&(s+="vertical-align: super; ")}],["td",()=>{t.td===St.LEFT_TO_RIGHT?s+="direction: ltr; ":t.td===St.RIGHT_TO_LEFT&&(s+="direction: rtl; ")}],["tr",()=>{var o,a,c;t.tr&&(s+=`data-rotate: (${(o=t.tr)==null?void 0:o.a}deg${(a=t.tr)!=null&&a.v?` ,${(c=t.tr)==null?void 0:c.v}`:""});`)}],["ht",()=>{t.ht===rt.LEFT?s+="text-align: left; ":t.ht===rt.RIGHT?s+="text-align: right; ":t.ht===rt.CENTER?s+="text-align: center; ":t.ht===rt.JUSTIFIED&&(s+="text-align: justify; ")}],["vt",()=>{t.vt===at.BOTTOM?s+="vertical-align: bottom; ":t.vt===at.TOP?s+="vertical-align: top; ":t.vt===at.MIDDLE&&(s+="vertical-align: middle; ")}],["tb",()=>{t.tb===lt.CLIP?s+="text-overflow: clip; ":t.tb===lt.OVERFLOW?s+="text-break: overflow; ":t.tb===lt.WRAP&&(s+="word-wrap: break-word;")}],["pd",()=>{var u,h,f,_,g,E,R,O;const o=`${(u=t.pd)==null?void 0:u.b}pt`,a=`${(h=t.pd)==null?void 0:h.t}pt`,c=`${(f=t.pd)==null?void 0:f.l}pt`,l=`${(_=t.pd)==null?void 0:_.r}pt`;(g=t.pd)!=null&&g.b&&(s+=`padding-bottom: ${o}; `),(E=t.pd)!=null&&E.t&&(s+=`padding-top: ${a}; `),(R=t.pd)!=null&&R.l&&(s+=`padding-left: ${c}; `),(O=t.pd)!=null&&O.r&&(s+=`padding-right: ${l}; `)}]]),r=["bd","tr","tb"];for(const o in t)e&&r.includes(o)||(i=n.get(o))==null||i();return s}function vt(t){let e="";return t===b.NONE?e="none":t===b.THIN?e="0.5pt solid":t===b.HAIR?e="0.5pt double":t===b.DOTTED?e="0.5pt dotted":t===b.DASHED||t===b.DASH_DOT?e="0.5pt dashed":t===b.DASH_DOT_DOT?e="0.5pt dotted":t===b.DOUBLE?e="0.5pt double":t===b.MEDIUM?e="1pt solid":t===b.MEDIUM_DASHED||t===b.MEDIUM_DASH_DOT?e="1pt dashed":t===b.MEDIUM_DASH_DOT_DOT?e="1pt dotted":t===b.SLANT_DASH_DOT?e="0.5pt dashed":t===b.THICK&&(e="1.5pt solid"),e}function Kr(t){let e=0;if(t=t.trim(),t==="none")e=b.NONE;else if(t==="0.5pt solid")e=b.THIN;else if(t==="0.5pt double")e=b.HAIR;else if(t==="0.5pt dotted")e=b.DOTTED;else if(t==="0.5pt dashed")e=b.DASHED;else if(t==="1pt solid")e=b.MEDIUM;else if(t==="1pt dashed")e=b.MEDIUM_DASHED;else if(t==="1pt dotted")e=b.MEDIUM_DASH_DOT_DOT;else if(t==="1.5pt solid")e=b.THICK;else return b.NONE;return e}function Tt(t,e){let s=t.body;if(e){const{headers:n,footers:r}=t;n!=null&&n[e]?s=n[e].body:r!=null&&r[e]&&(s=r[e].body)}return s}function Xr(t){const{startRow:e,endRow:s,startColumn:n,endColumn:r}=t;return!(e<0||n<0||s<0||r<0)}function Ce(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(s=>Ce(t[s],e[s])):t===e:!1}function Ds(t,e){const s=t.ts||{},n=e.ts||{};return t.sId!==e.sId?!1:Ce(s,n)}function Se(t,e,s,n){if(t>e&&([t,e]=[e,t]),s>n&&([s,n]=[n,s]),e<s||n<t)return[t,e];s<t&&(s=t),n>e&&(n=e);const r=n-s+1;let i=[];return t===s?i=[n+1-r,e-r]:e===n?i=[t,s-1]:i=[t,e-r],i}function Qr(t){if(t==null)return!1;const e=t.bullet;return(e==null?void 0:e.listId)!=null}function Zr(t){if(t==null)return!1;const e=t.paragraphStyle;return Ts(e)}function Ts(t){return!(t==null||(t.indentStart==null||t.indentStart===0)&&t.hanging==null||t.hanging===0)}function Us(t,e,s){return t.slice(0,e)+s+t.slice(e)}function Ms(t,e,s){return e>s?t:t.slice(0,e)+t.slice(s)}class Ps{constructor(){d(this,"_include");d(this,"_count");this._include=[],this._count=1}checked(e){return this._include.includes(e)}onlyName(e){let s=e,n=1;for(;this.checked(s);)s=e+n,n++;return this._include.push(s),s}sheetName(e="sheet1"){let s=e;for(;this.checked(s);)s=`sheet${this._count}`,this._count++;return this._include.push(s),s}}var qr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xs={exports:{}};/*! @preserve
|
|
1
|
+
"use strict";var Zr=Object.defineProperty;var Jr=(t,e,s)=>e in t?Zr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var d=(t,e,s)=>(Jr(t,typeof e!="symbol"?e+"":e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("@wendellhu/redi"),N=require("rxjs"),yr=require("rxjs/operators");function tn(){en()}const Lt=typeof global<"u"?global:typeof self<"u"?self:window;function en(){typeof Lt.requestIdleCallback!="function"&&(Lt.requestIdleCallback=function(s){const r=Date.now();return setTimeout(function(){const i=Math.max(0,50-(Date.now()-r));s({didTimeout:i===0,timeRemaining(){return i}})},1)}),typeof Lt.cancelIdleCallback!="function"&&(Lt.cancelIdleCallback=function(s){clearTimeout(s)})}class me{constructor(){d(this,"_data",[])}static create(){return new me}add(e){this._data.indexOf(e)>-1||this._data.push(e)}delete(e){const s=this._data.indexOf(e);this._data.splice(s,1)}getData(){return this._data}}class Oe{constructor(){d(this,"_data",new Map)}static create(){return new Oe}add(e,s){this._data.has(e)||this._data.set(e,s)}delete(e){this._data.delete(e)}getData(){return this._data}}var D=(t=>(t[t.Univer=0]="Univer",t[t.Doc=1]="Doc",t[t.Sheet=2]="Sheet",t[t.Slide=3]="Slide",t))(D||{});class qe{constructor(e){d(this,"_name");this._name=e}onStarting(e){}onReady(){}onRendered(){}onSteady(){}onDestroy(){}getPluginName(){return this._name}}d(qe,"type",0);class sn{constructor(){d(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 rn{constructor(){d(this,"_pluginsRegisteredByBusiness",new Map)}registerPlugin(e,s){const r=e.type;this._pluginsRegisteredByBusiness.has(r)||this._pluginsRegisteredByBusiness.set(r,[]),this._pluginsRegisteredByBusiness.get(r).push({plugin:e,options:s})}getRegisterPlugins(e){return this._pluginsRegisteredByBusiness.get(e)||[]}clearPluginsOfType(e){this._pluginsRegisteredByBusiness.delete(e)}}function tt(t,e){const s=t.indexOf(e);return s>-1?(t.splice(s,1),!0):!1}function nn(t){const e=new Set,s=[];for(const r of t)e.has(r)||(e.add(r),s.push(r));return s}function on(t,e){for(let s=t.length-1;s>-1;s--){const r=t[s];if(e(r,s))return r}return null}async function Qe(t){for(const[e,s]of t.entries())try{if(!await s())return{index:e,result:!1}}catch(r){return{index:e,result:!1,error:r}}return{result:!0,index:-1}}function Ze(t){for(const[e,s]of t.entries())try{if(!s())return{index:e,result:!1}}catch(r){return{index:e,result:!1,error:r}}return{result:!0,index:-1}}function He(t){var e=typeof Symbol=="function"&&Symbol.iterator,s=e&&t[e],r=0;if(s)return s.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Be(t,e){var s=typeof Symbol=="function"&&t[Symbol.iterator];if(!s)return t;var r=s.call(t),n,i=[],o;try{for(;(e===void 0||e-- >0)&&!(n=r.next()).done;)i.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(s=r.return)&&s.call(r)}finally{if(o)throw o.error}}return i}function We(t,e,s){if(s||arguments.length===2)for(var r=0,n=e.length,i;r<n;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}function Ot(t){return typeof t=="function"}function an(t){var e=function(r){Error.call(r),r.stack=new Error().stack},s=t(e);return s.prototype=Object.create(Error.prototype),s.prototype.constructor=s,s}var te=an(function(t){return function(s){t(this),this.message=s?s.length+` errors occurred during unsubscription:
|
|
2
|
+
`+s.map(function(r,n){return n+1+") "+r.toString()}).join(`
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=s}});function $e(t,e){if(t){var s=t.indexOf(e);0<=s&&t.splice(s,1)}}var Je=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,s,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=He(o),c=a.next();!c.done;c=a.next()){var l=c.value;l.remove(this)}}catch(E){e={error:E}}finally{try{c&&!c.done&&(s=a.return)&&s.call(a)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(Ot(u))try{u()}catch(E){i=E instanceof te?E.errors:[E]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=He(h),_=f.next();!_.done;_=f.next()){var g=_.value;try{Ge(g)}catch(E){i=i??[],E instanceof te?i=We(We([],Be(i)),Be(E.errors)):i.push(E)}}}catch(E){r={error:E}}finally{try{_&&!_.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}}if(i)throw new te(i)}},t.prototype.add=function(e){var s;if(e&&e!==this)if(this.closed)Ge(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(s=this._finalizers)!==null&&s!==void 0?s:[]).push(e)}},t.prototype._hasParent=function(e){var s=this._parentage;return s===e||Array.isArray(s)&&s.includes(e)},t.prototype._addParent=function(e){var s=this._parentage;this._parentage=Array.isArray(s)?(s.push(e),s):s?[s,e]:e},t.prototype._removeParent=function(e){var s=this._parentage;s===e?this._parentage=null:Array.isArray(s)&&$e(s,e)},t.prototype.remove=function(e){var s=this._finalizers;s&&$e(s,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}();Je.EMPTY;function ln(t){return t instanceof Je||t&&"closed"in t&&Ot(t.remove)&&Ot(t.add)&&Ot(t.unsubscribe)}function Ge(t){Ot(t)?t():t.unsubscribe()}class ye{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 ts(t){return t instanceof jt}class jt{constructor(e,s){d(this,"_willBeUnregistered",!1);d(this,"unregisterOnNextCall",!1);this.callback=e,this.observable=s}dispose(){this.observable.remove(this)}}class zt{constructor(e){d(this,"_observers",new Array);d(this,"_eventState");d(this,"_onObserverAdded");this._eventState=new ye,e&&(this._onObserverAdded=e)}get observers(){return this._observers}add(e,s=!1,r=!1){if(!e)return null;const n=new jt(e,this);return n.unregisterOnNextCall=r,s?this._observers.unshift(n):this._observers.push(n),this._onObserverAdded&&this._onObserverAdded(n),n}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 s=0;s<this._observers.length;s++){const r=this._observers[s];if(!r._willBeUnregistered&&r.callback===e)return this._deferUnregister(r),!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 s=this._eventState;s.skipNextObservers=!1,s.lastReturnValue=e,s.isStopPropagation=!1;let r=!1;for(let n=0;n<this._observers.length;n++){const i=this._observers[n];if(!i._willBeUnregistered&&(s.lastReturnValue=i.callback(e,s),i.unregisterOnNextCall&&this._deferUnregister(i),s.isStopPropagation&&(r=!0),s.skipNextObservers))return{lastReturnValue:s.lastReturnValue,stopPropagation:r}}return{lastReturnValue:s.lastReturnValue,stopPropagation:r}}notifyObserversWithPromise(e){let s=Promise.resolve(e);if(!this._observers.length)return s;const r=this._eventState;r.skipNextObservers=!1;for(let n=0;n<this._observers.length;n++){const i=this._observers[n];r.skipNextObservers||i._willBeUnregistered||(s=s.then(()=>i.callback(e,r)),i.unregisterOnNextCall&&this._deferUnregister(i))}return s.then(()=>e)}notifyObserver(e,s){if(e._willBeUnregistered)return;const r=this._eventState;return r.skipNextObservers=!1,e.callback(s,r),e.unregisterOnNextCall&&this._deferUnregister(e),{lastReturnValue:r.lastReturnValue,stopPropagation:r.isStopPropagation}}hasObservers(){return this._observers.length>0}clear(){this._observers=new Array,this._onObserverAdded=null}clone(){const e=new zt;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 s=this._observers.indexOf(e);return s!==-1?(this._observers.splice(s,1),!0):!1}}function v(t){let e=!1;return ln(t)?{dispose:()=>{e||(e=!0,t.unsubscribe())}}:ts(t)?{dispose:()=>{e||(e=!0,t.dispose())}}:{dispose:()=>{e||(e=!0,t())}}}function un(t){return v(()=>{t.unsubscribe()})}class es{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 T{constructor(){d(this,"_disposed",!1);d(this,"_collection",new es)}disposeWithMe(e){return this._collection.add(e)}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class cn extends T{constructor(){super(...arguments);d(this,"dispose$",new N.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}const ht=C.createIdentifier("univer.context-service");class ss extends T{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(s){return this._contextMap.get(s)??!1}setContextValue(s,r){this._contextMap.set(s,r),this._contextChanged$.next()}}var rs=(t=>(t[t.SILENT=0]="SILENT",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.VERBOSE=3]="VERBOSE",t))(rs||{});const it=C.createIdentifier("univer.log");class ns extends T{constructor(){super(...arguments);d(this,"_logLevel",0)}log(...s){if(this._logLevel<3||!s.length)return;const r=s[0];/^\[(.*?)\]/g.test(r)?console.log(`\x1B[97;104m${r}\x1B[0m:`,...s.slice(1)):console.log(...s)}warn(...s){this._logLevel>=2&&console.warn(...s)}error(...s){this._logLevel>=1&&console.error(...s)}setLogLevel(s){this._logLevel=s}}var hn=Object.defineProperty,dn=Object.getOwnPropertyDescriptor,_n=(t,e,s,r)=>{for(var n=r>1?void 0:r?dn(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(n=(r?o(e,s,n):o(n))||n);return r&&n&&hn(e,s,n),n},ke=(t,e)=>(s,r)=>e(s,r,t),Yt=(t=>(t[t.COMMAND=0]="COMMAND",t[t.OPERATION=1]="OPERATION",t[t.MUTATION=2]="MUTATION",t))(Yt||{});const bt=C.createIdentifier("anywhere.command-service");class fn{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),v(()=>{var s;this._commands.delete(e.id),(s=e.onDispose)==null||s.call(e)})}getCommand(e){return this._commands.has(e)?[this._commands.get(e)]:null}}exports.CommandService=class{constructor(e,s){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=s,this._commandRegistry=new fn}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),v(()=>{const s=this._beforeCommandExecutionListeners.indexOf(e);this._beforeCommandExecutionListeners.splice(s,1)});throw new Error("Could not add a listener twice.")}onCommandExecuted(e){if(this._commandExecutedListeners.indexOf(e)===-1)return this._commandExecutedListeners.push(e),v(()=>{const s=this._commandExecutedListeners.indexOf(e);this._commandExecutedListeners.splice(s,1)});throw new Error("Could not add a listener twice.")}async executeCommand(e,s,r){const n=this._commandRegistry.getCommand(e);if(n){const[i]=n,o={id:i.id,type:i.type,params:s},a=this._pushCommandExecutionStack(o);this._beforeCommandExecutionListeners.forEach(l=>l(o,r));const c=await this._execute(i,s);return this._commandExecutedListeners.forEach(l=>l(o,r)),a.dispose(),c}throw new Error(`[CommandService]: command "${e}" is not registered.`)}syncExecuteCommand(e,s,r){const n=this._commandRegistry.getCommand(e);if(n){const[i]=n,o={id:i.id,type:i.type,params:s};if(i.type===2){const l=on(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,r));const c=this._syncExecute(i,s);return this._commandExecutedListeners.forEach(l=>l(o,r)),a.dispose(),c}throw new Error(`[CommandService]: command "${e}" is not registered.`)}_pushCommandExecutionStack(e){return this._commandExecutionStack.push(e),v(()=>tt(this._commandExecutionStack,e))}_registerCommand(e){return this._commandRegistry.registerCommand(e)}_registerMultiCommand(e){const s=this._commandRegistry.getCommand(e.id);let r;if(!s)r=new gn(e.id),this._multiCommandDisposables.set(e.id,this._commandRegistry.registerCommand(r));else{if(s[0].multi!==!0)throw new Error("Command has registered as a single command.");r=s[0]}const n=r.registerImplementation(e);return v(()=>{var i;n.dispose(),r.hasImplementations()||(i=this._multiCommandDisposables.get(e.id))==null||i.dispose()})}async _execute(e,s){this._log.log("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${e.id}"`),this._commandExecutingLevel++;let r;try{r=await this._injector.invoke(e.handler,s),this._commandExecutingLevel--}catch(n){throw r=!1,this._commandExecutingLevel=0,n}return r}_syncExecute(e,s){this._log.log("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${e.id}".`),this._commandExecutingLevel++;let r;try{if(r=this._injector.invoke(e.handler,s),r instanceof Promise)throw new Error("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(n){throw r=!1,this._commandExecutingLevel=0,n}return r}};exports.CommandService=_n([ke(0,C.Inject(C.Injector)),ke(1,it)],exports.CommandService);class gn{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,s)=>{if(!this._implementations.length)return!1;const r=e.get(it),n=e.get(ht),i=e.get(C.Injector);for(const o of this._implementations){const a=o.command.preconditions;if(a!=null&&a(n)&&(r.log("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,s)))return!0}return!1});this.id=e,this.name=e}registerImplementation(e){const s={command:e};return this._implementations.push(s),this._implementations.sort((r,n)=>n.command.priority-r.command.priority),v(()=>{var n;const r=this._implementations.indexOf(s);this._implementations.splice(r,1),(n=e.onDispose)==null||n.call(e)})}hasImplementations(){return this._implementations.length>0}}function Ae(t,e,s){const r=t.map(n=>()=>e.syncExecuteCommand(n.id,n.params,s));return Ze(r)}function En(t,e,s){const r=t.map(n=>()=>e.executeCommand(n.id,n.params,s));return Qe(r)}const is=C.createIdentifier("univer.config-service");class Rn{constructor(){d(this,"_config",new Map)}getConfig(e){return this._config.get(e)}setConfig(e,s){this._config.set(e,s)}deleteConfig(e){this._config.delete(e)}}class os extends T{constructor(){super(...arguments);d(this,"_error$",new N.Subject);d(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(s){this._error$.next({errorKey:s})}}const mn="__default_document_sub_component_id20231101__";class as{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 s=this._clearByParam(e);this._remove$.next(s)}addOrUpdate(e){const s=this._addByParam(e);this._andOrUpdate$.next(s)}BatchAddOrUpdate(e){const s=[];e.forEach(r=>{s.push(...this._addByParam(r))}),this._andOrUpdate$.next(s)}remove(e){const s=this._removeByParam(e);this._remove$.next(s)}pluginUpdateRefresh(e){this._pluginUpdate$.next(e)}_getFloatingObjects(e){var n;if(e==null)return;const{unitId:s,subComponentId:r}=e;return(n=this._managerInfo.get(s))==null?void 0:n.get(r)}_getFloatingObject(e){var i,o;if(e==null)return;const{unitId:s,subComponentId:r,floatingObjectId:n}=e;return(o=(i=this._managerInfo.get(s))==null?void 0:i.get(r))==null?void 0:o.get(n)}_addByParam(e){const{unitId:s,subComponentId:r,floatingObject:n,floatingObjectId:i}=e;this._managerInfo.has(s)||this._managerInfo.set(s,new Map);const o=this._managerInfo.get(s);return o.has(r)||o.set(r,new Map),o.get(r).set(i,n),[{unitId:s,subComponentId:r,floatingObjectId:i,floatingObject:n}]}_clearByParam(e){const s=this._getFloatingObjects(e),{unitId:r,subComponentId:n}=e,i=[];return s==null||s.forEach((o,a)=>{i.push({unitId:r,subComponentId:n,floatingObjectId:a,floatingObject:o})}),s==null||s.clear(),i}_removeByParam(e){const s=this._getFloatingObjects(e),r=s==null?void 0:s.get(e.floatingObjectId);return r==null?[]:(s==null||s.delete(e.floatingObjectId),[{...e,floatingObject:r}])}}const ls=C.createIdentifier("univer.floating-object.service");class us{constructor(){d(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(e){this.cursor+=e}moveCursorTo(e){this.cursor=e}}function cs(t,e){let s=0,r=t.length-1;for(;s<=r;){const n=Math.floor((r+s)/2);if(e<t[n]&&(n===0||e>=t[n-1]))return n;if(e>=t[n])s=n+1;else if(e<t[n])r=n-1;else return-1}return-1}function hs(t,e){let s=0,r=0,n=0,i=-1,o=t.length-1;for(;s<t.length&&o>=0&&o>=s;){if(r=t[o],o===0?n=0:n=t[o-1],e>=n&&e<=r){i=o;break}if(r=t[s],s===0?n=0:n=t[s-1],e>=n&&e<r){i=s;break}s++,o--}return i}function On(t,e){let s=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[s-20]?s=hs(t,e):s=cs(t,e),s)}function An(t){const e=new Blob([t],{type:"text/javascript"});return window.URL.createObjectURL(e)}var ds=(t=>(t[t.DEFAULT_SERIES=0]="DEFAULT_SERIES",t[t.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",t))(ds||{}),b=(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))(b||{}),_s=(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))(_s||{}),W=(t=>(t[t.UNSUPPORTED=0]="UNSUPPORTED",t[t.RGB=1]="RGB",t[t.HEX=2]="HEX",t[t.THEME=3]="THEME",t))(W||{}),fs=(t=>(t[t.ON=0]="ON",t[t.OFF=1]="OFF",t))(fs||{}),gs=(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))(gs||{}),Es=(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))(Es||{}),Rs=(t=>(t[t.DOCUMENT=0]="DOCUMENT",t[t.PROJECT=1]="PROJECT",t))(Rs||{}),ms=(t=>(t[t.COLUMNS=0]="COLUMNS",t[t.ROWS=1]="ROWS",t))(ms||{}),Os=(t=>(t[t.UP=0]="UP",t[t.RIGHT=1]="RIGHT",t[t.DOWN=2]="DOWN",t[t.LEFT=3]="LEFT",t))(Os||{});function In(t){switch(t){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var As=(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))(As||{}),Is=(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))(Is||{}),Kt=(t=>(t.EN_US="enUS",t.ZH_CN="zhCN",t))(Kt||{}),Cs=(t=>(t[t.RANGE=0]="RANGE",t[t.SHEET=1]="SHEET",t))(Cs||{}),Ss=(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))(Ss||{}),Ns=(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))(Ns||{}),Ie=(t=>(t[t.GRID=0]="GRID",t[t.KANBAN=1]="KANBAN",t[t.GANTT=2]="GANTT",t))(Ie||{}),St=(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))(St||{}),bs=(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))(bs||{}),nt=(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))(nt||{}),lt=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TOP=1]="TOP",t[t.MIDDLE=2]="MIDDLE",t[t.BOTTOM=3]="BOTTOM",t))(lt||{}),ut=(t=>(t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OVERFLOW=1]="OVERFLOW",t[t.CLIP=2]="CLIP",t[t.WRAP=3]="WRAP",t))(ut||{}),xt=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ITALIC=1]="ITALIC",t))(xt||{}),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||{}),I=(t=>(t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE",t))(I||{}),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||{}),p=(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))(p||{}),Xt=(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))(Xt||{});const Ls={[Xt.OFFICE]:{[p.ACCENT1]:"#4472C4",[p.ACCENT2]:"#ED7D31",[p.ACCENT3]:"#A5A5A5",[p.ACCENT4]:"#70AD47",[p.ACCENT5]:"#5B9BD5",[p.ACCENT6]:"#70AD47",[p.DARK1]:"#000000",[p.DARK2]:"#44546A",[p.LIGHT1]:"#FFFFFF",[p.LIGHT2]:"#E7E6E6",[p.HYPERLINK]:"#0563C1",[p.FOLLOWED_HYPERLINK]:"#954F72"}};class qt{constructor(){d(this,"_themeValue",p.LIGHT1);d(this,"_themeColors");d(this,"_themeTint");d(this,"_rgbValue","");d(this,"_colorType");this._colorType=W.UNSUPPORTED,this._themeColors=Xt.OFFICE,this._themeTint=0}asRgbColor(){return new Ht(this._rgbValue,this)}asThemeColor(){return new Bt(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case W.THEME:return this.asThemeColor();case W.RGB:return this.asRgbColor();case W.UNSUPPORTED:throw Error("unsupported color type")}}setRgbColor(e){return this._colorType=W.RGB,this._rgbValue=e,this}setThemeColors(e){this._colorType=W.THEME,this._themeColors=e}setThemeTint(e){this._colorType=W.THEME,this._themeTint=e}setThemeColor(e){return this._colorType=W.THEME,this._themeValue=e,this}getColorType(){return this._colorType}}class ot{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 s=+`0x${e[0]}${e[1]}`,r=+`0x${e[2]}${e[3]}`,n=+`0x${e[4]}${e[5]}`;return new qt().setRgbColor(`rgb(${s},${r},${n})`).asRgbColor()}static hexToRgbString(e){const s=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(s,(i,o,a,c)=>o+o+a+a+c+c);const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let n=null;if(r){const i=parseInt(r[1],16),o=parseInt(r[2],16),a=parseInt(r[3],16);n=`rgba(${i},${o},${a})`}return n}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new ot(this._builder)}equals(e){return!1}}class ws{constructor(e){d(this,"_saturation",0);d(this,"_hue",0);d(this,"_lightness",0);d(this,"_alpha",0);const s=e.getRed()/255,r=e.getGreen()/255,n=e.getBlue()/255,i=e.getAlpha()/255,o=Math.min(s,Math.min(r,n)),a=Math.max(s,Math.max(r,n)),c=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=c/(a+o):this._saturation=c/(2-a-o),s===a&&(this._hue=(r-n)/c),r===a&&(this._hue=2+(n-s)/c),n===a&&(this._hue=4+(s-r)/c),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const e=new qt;if(this._saturation===0)return e.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),e.asRgbColor();let s;this._lightness<.5?s=this._lightness*(1+this._saturation):s=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-s,n=this._hue/360,i=n+1/3,o=this.setColor(s,r,i),a=this.setColor(s,r,n),c=n-1/3,l=this.setColor(s,r,c);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,s,r){r<0&&(r+=1),r>1&&(r-=1);let n;return 6*r<1?n=s+(e-s)*6*r:2*r<1?n=e:3*r<2?n=s+(e-s)*(2/3-r)*6:n=s,n}setLightness(e){this._lightness=e}}const B=class B extends ot{constructor(s,r){super(r);d(this,"_cssString");d(this,"_red");d(this,"_green");d(this,"_blue");d(this,"_alpha");let n=s.match(B.RGBA_EXTRACT);if(n){const i=+n[1],o=+n[2],a=+n[3],c=+n[4];this._cssString=s,this._red=i,this._green=o,this._blue=a,this._alpha=c;return}if(n=s.match(B.RGB_EXTRACT),n){const i=+n[1],o=+n[2],a=+n[3];this._cssString=s,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return ot.rgbColorToHexValue(this)}getRed(){let s=this._red+B.RGB_COLOR_AMT;return s>255?s=255:s<0&&(s=0),s}getGreen(){let s=this._green+B.RGB_COLOR_AMT;return s>255?s=255:s<0&&(s=0),s}getBlue(){let s=this._blue+B.RGB_COLOR_AMT;return s>255?s=255:s<0&&(s=0),s}getAlpha(){return this._alpha}getColorType(){return W.RGB}clone(){return new B(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(s){return s instanceof B?s._red===this._red&&s._blue===this._blue&&s._green===this._green&&s._alpha===this._alpha:!1}getCssString(){return this._cssString}};d(B,"RGB_COLOR_AMT",0),d(B,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),d(B,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let Ht=B;const J=class J extends ot{constructor(s,r,n,i){super(i);d(this,"_themeColorType");d(this,"_themeTint");d(this,"_themeColors");this._themeColorType=s,this._themeTint=r,this._themeColors=n}lumValue(s,r){if(s==null)return r;let n;return s<0?n=r*(1+s):n=r*(1-s)+(255-255*(1-s)),n}asRgbColor(){const s=Ls[this._themeColors];if(s==null)throw new Error("not find themeColors type");const r=s[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let n;if(J._cacheThemeColor.has(this._themeColors)){if(n=J._cacheThemeColor.get(this._themeColors),n.has(this._themeColorType))return n.get(this._themeColorType)}else n=new Map,J._cacheThemeColor.set(this._themeColors,n);const i=new ws(ot.hexValueToRgbColor(r));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return n.set(this._themeColorType,o),o}clone(){return new J(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(s){return s instanceof J?s._themeColorType===this._themeColorType:!1}getColorType(){return W.THEME}getThemeColorType(){return this._themeColorType}};d(J,"_cacheThemeColor",new Map);let Bt=J;const Cn="rgb(",Sn="rgba(",le={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 G{constructor(e){d(this,"_color");d(this,"_rgbColor");d(this,"_isValid",!1);if(e==null){this._setNullColor();return}if(e instanceof G){this._color={...e._color},this._rgbColor={...e._rgbColor};return}const s=vs(e);if(s==null){this._setNullColor();return}this._color=s;const r=vn(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(e,s,r){r=Math.min(1,Math.max(0,r));const n=new G(e).toRgb(),i=new G(s).toRgb(),o=n.a??1,a=i.a??1,c={r:(i.r-n.r)*r+n.r,g:(i.g-n.g)*r+n.g,b:(i.b-n.b)*r+n.b,a:(a-o)*r+o};return new G(c)}static getContrastRatio(e,s){const r=new G(e).getLuminance(),n=new G(s).getLuminance();return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:e,g:s,b:r,a:n=1}=this.toRgb(),i=n<1;return`rgb${i?"a":""}(${e},${s},${r}${i?`,${n}`:""})`}toString(){return this.toRgbString()}toHexString(e){const{r:s,g:r,b:n,a:i=1}=this.toRgb(),o=i<1,a=[wt(Math.round(s).toString(16)),wt(Math.round(r).toString(16)),wt(Math.round(n).toString(16)),wt(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 Tn(this.toRgb())}toHsl(){return Un(this.toRgb())}lighten(e=10){const s=this.toHsl();return s.l+=e,s.l=Math.min(Math.max(s.l,0),100),new G(s)}darken(e=10){const s=this.toHsl();return s.l-=e,s.l=Math.min(Math.max(s.l,0),100),new G(s)}setAlpha(e){return new G({...this._rgbColor,a:e})}getLuminance(){let{r:e,g:s,b:r}=this.toRgb();return e=ee(e),s=ee(s),r=ee(r),Number((.2126*e+.7152*s+.0722*r).toFixed(3))}getBrightness(){const{r:e,g:s,b:r}=this.toRgb();return(e*299+s*587+r*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 wt=t=>t.length===1?`0${t}`:t,ee=t=>(t/=255,t<=.03928?t/12.92:((t+.055)/1.055)**2.4),vs=t=>{if(xn(t)){if("r"in t){const r={r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)};return t.a!==void 0&&(r.a=t.a),r}if("l"in t){const r={h:Math.round(t.h),s:t.s,l:t.l};return t.a!==void 0&&(r.a=t.a),r}const s={h:Math.round(t.h),s:t.s,v:t.v};return t.a!==void 0&&(s.a=t.a),s}const e=t.trim();if(le[e]){const s=le[e],r={r:Math.round(s[0]),g:Math.round(s[1]),b:Math.round(s[2])};return r.a=s[3]||1,r}if(e.startsWith("#"))return Nn(e);if(e.startsWith("rgb"))return bn(e);if(e.startsWith("hsl"))return Ln(e);if(e.startsWith("hsv"))return wn(e)},Nn=t=>{const e=t.substring(1),s=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(s);if(!r||r.length<3)throw new Error(`The color '${t}' is illegal hex color`);r[0].length===1&&(r=r.map(i=>i+i));const n={r:parseInt(r[0],16),g:parseInt(r[1],16),b:parseInt(r[2],16)};return r.length>3&&(n.a=parseInt(r[3],16)/255),n},bn=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal rgb color`);const s=t.substring(e+1,t.length-1).split(",");if(s.length<3)throw new Error(`The color '${t}' is illegal rgb color`);const r={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)};return s.length>3&&(r.a=parseFloat(s[3])),r},Ln=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal hsl color`);const s=t.substring(e+1,t.length-1).split(",");if(s.length<3)throw new Error(`The color '${t}' is illegal hsl color`);const r={h:parseInt(s[0],10),s:parseFloat(s[1]),l:parseFloat(s[2])};return s.length>3&&(r.a=parseFloat(s[3])),r},wn=t=>{const e=t.indexOf("(");if(e===-1)throw new Error(`The color '${t}' is illegal hsv color`);const s=t.substring(e+1,t.length-1).split(",");if(s.length<3)throw new Error(`The color '${t}' is illegal hsv color`);const r={h:parseInt(s[0],10),s:parseFloat(s[1]),v:parseFloat(s[2])};return s.length>3&&(r.a=parseFloat(s[3])),r},vn=t=>{const e=vs(t);if(e!=null)return"r"in e?e:"l"in e?Dn(e):Mn(e)},se=(t,e,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+(e-t)*6*s:s<1/2?e:s<2/3?t+(e-t)*(2/3-s)*6:t),Dn=t=>{let{h:e,s,l:r}=t;e/=360,s/=100,r/=100;let n=0,i=0,o=0;if(s===0)n=i=o=r;else{const c=r<.5?r*(1+s):r+s-r*s,l=2*r-c;n=se(l,c,e+1/3),i=se(l,c,e),o=se(l,c,e-1/3)}const a={r:Math.round(n*255),g:Math.round(i*255),b:Math.round(o*255)};return t.a!==void 0&&(a.a=t.a),a},Mn=t=>{let{h:e,s,v:r}=t;e=e/360*6,s/=100,r/=100;const n=Math.floor(e),i=e-n,o=r*(1-s),a=r*(1-i*s),c=r*(1-(1-i)*s),l=n%6,u=[r,a,o,o,c,r][l],h=[c,r,r,a,o,o][l],f=[o,o,c,r,r,a][l],_={r:u*255,g:h*255,b:f*255};return t.a!==void 0&&(_.a=t.a),_},Un=t=>{let{r:e,g:s,b:r}=t;e/=255,s/=255,r/=255;const n=Math.max(e,s,r),i=Math.min(e,s,r),o=(n+i)/2;let a,c;if(n===i)a=c=0;else{const u=n-i;switch(c=o>.5?u/(2-n-i):u/(n+i),n){case e:a=(s-r)/u+(s<r?6:0);break;case s:a=(r-e)/u+2;break;default:a=(e-s)/u+4;break}a/=6}const l={h:Math.round(a*360),s:Math.round(c*100),l:Math.round(o*100)};return t.a!==void 0&&(l.a=t.a),l},Tn=t=>{let{r:e,g:s,b:r}=t;e/=255,s/=255,r/=255;const n=Math.max(e,s,r),i=Math.min(e,s,r);let o;const a=n,c=n-i,l=n===0?0:c/n;if(n===i)o=0;else{switch(n){case e:o=(s-r)/c+(s<r?6:0);break;case s:o=(r-e)/c+2;break;default:o=(e-s)/c+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},Pn=t=>t==null,xn=t=>!Pn(t)&&typeof t=="object";var P=(t=>(t[t.COVER=0]="COVER",t[t.REPLACE=1]="REPLACE",t[t.INTERSECTION=2]="INTERSECTION",t))(P||{});let pn=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,s)=>(s&=63,s<36?e+=s.toString(36):s<62?e+=(s-26).toString(36).toUpperCase():s>62?e+="-":e+="_",e),"");const Fn=/^-ms-/,Hn=/-([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 m{static stringAt(e){let s="",r=e;for(;r>=q.length;)r/=q.length,r-=1,s+=q[r%q.length];const n=e%q.length;return s+=q[n],s}static indexAt(e){let s=0;for(let r=0;r<e.length-1;r+=1){const n=e.charCodeAt(r)-65,i=e.length-1-r;s+=q.length**i+q.length*n}return s+=e.charCodeAt(e.length-1)-65,s}static deleteBlank(e){return m.isString(e)?e.replace(/\s/g,""):e}static getSystemType(){const e=navigator.userAgent,s=navigator.platform==="Win32"||navigator.platform==="Windows",r=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(r)return"Mac";if(navigator.platform==="X11"&&!s&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(s){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,s=e.indexOf("Opera")>-1,r=e.indexOf("compatible")>-1&&e.indexOf("MSIE")>-1&&!s,n=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,c=e.indexOf("Chrome")>-1&&e.indexOf("Safari")>-1;if(r){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":s?"Opera":a?"Safari":c?"Chrome":i?"Edge":n?"IE11":"Unknown browser"}static generateRandomId(e=21){return pn(e)}static getClassName(e){return e.constructor.name}static deepMerge(e,...s){s.forEach(o=>o&&i(o));function r(o,a){o.forEach((c,l)=>{if(m.isArray(c)){const u=a[l]??[];a[l]=u,r(c,u);return}if(m.isObject(c)){const u=a[l]??{};a[l]=u,n(c,u);return}a[l]=c})}function n(o,a){Object.keys(o).forEach(c=>{const l=o[c];if(m.isObject(l)){const u=a[c]??{};a[c]=u,n(l,u);return}if(m.isArray(l)){const u=a[c]??[];a[c]=u,r(l,u);return}a[c]=l})}function i(o){Object.keys(o).forEach(a=>{const c=o[a];if(m.isArray(c)){const l=e[a]??[];e[a]=l,r(c,l);return}if(m.isObject(c)){const l=e[a]??{};e[a]=l,n(c,l);return}e[a]=c})}return e}static numberFixed(e,s){return Number(Number(e).toFixed(s))}static diffValue(e,s){function r(o,a){const c=m.getValueType(o),l=m.getValueType(a);return c!==l?!1:m.isArray(o)?n(o,a):m.isObject(o)?i(o,a):m.isDate(o)?o.getTime()===a.getTime():m.isRegExp(o)?o.toString()===a.toString():o===a}function n(o,a){if(e.length!==s.length)return!1;for(let c=0,l=o.length;c<l;c++){const u=o[c],h=a[c];if(!r(u,h))return!1}return!0}function i(o,a){const c=Object.keys(o),l=Object.keys(a);if(c.length!==l.length)return!1;for(const u of c){if(!l.includes(u))return!1;const h=o[u],f=a[u];if(!r(h,f))return!1}return!0}return r(e,s)}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 s=[];return e.forEach((r,n)=>{s[n]=m.deepClone(r)}),s}if(this.isObject(e)){const s={};return Object.keys(e).forEach(r=>{const n=e[r];s[r]=m.deepClone(n)}),Object.setPrototypeOf(s,Object.getPrototypeOf(e)),s}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,s){return e instanceof s}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 s in e)return!1;return!0}static isMobile(){let e=0,s=0;return document.body.clientWidth&&(e=document.body.clientWidth),document.body.clientHeight&&(s=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||e<350&&s<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 s=>{for(let r=0;r<e;r++)s&&s()}}static hasLength(e,s){return m.isDefine(e)?m.isDefine(s)?e.length===s:e.length>0:!1}static capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}static fCamelCase(e,s){return s.toUpperCase()}static camelCase(e){return e.replace(Fn,"ms-").replace(Hn,this.fCamelCase)}static removeNull(e){return this.isObject(e)&&Object.keys(e).forEach(s=>{const r=e[s];r==null?delete e[s]:m.removeNull(r)}),e}static fillTwoDimensionalArray(e,s,r){return new Array(e).fill(r).map(n=>new Array(s).fill(r))}static numToWord(e){let s="";for(;e>0;){let r=e%26;r=r===0?r=26:r,s=String.fromCharCode(96+r)+s,e=(e-r)/26}return s.toLocaleUpperCase()}static ABCatNum(e){if(e==null||e.length===0)return NaN;const s=e.toLowerCase().split(""),r=s.length;let n=0,i=0;for(let o=0;o<r;o++)i=s[o].charCodeAt(0)-96,n+=i*26**(r-o-1);return n===0?NaN:n-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 s=0,r=e.length;s<r;s++){const n=parseInt((Math.random()*r).toString()),i=e[n];e[n]=e[s],e[s]=i}return e}static commonExtend(e,s){const r={};for(const n in e)r[n]=e[n];for(const n in s)s[n]!=null&&(r[n]=s[n]);return r}static commonExtend1(e,s){for(const r in e)s[r]==null&&(s[r]=e[r]);return s}static arrayToObject(e){const s={};return e.forEach((r,n)=>{s[n]={},r.forEach((i,o)=>{s[n][o]=i})}),s}static hasIntersectionBetweenTwoRanges(e,s,r,n){return s>=r&&n>=e}}function Bn(t){if(!t)return;const{actualRow:e,actualColumn:s,isMerged:r,isMergedMainCell:n,mergeInfo:i}=t;let{startY:o,endY:a,startX:c,endX:l}=t,u=e,h=s,f=e,_=s;if(r&&i){const{startRow:g,startColumn:E,endRow:R,endColumn:O,startY:A,endY:L,startX:F,endX:x}=i;u=g,h=E,f=R,_=O,o=A,a=L,c=F,l=x}return n&&(o=i.startY,a=i.endY,c=i.startX,l=i.endX,f=i.endRow,_=i.endColumn),{startRow:u,startColumn:h,endRow:f,endColumn:_,startY:o,endY:a,startX:c,endX:l}}function Wn(t){if(!t)return;const{actualRow:e,actualColumn:s,isMerged:r,isMergedMainCell:n,startRow:i,startColumn:o,endRow:a,endColumn:c}=t;let l=e,u=s,h=e,f=s;return(r||n)&&(l=i,u=o,h=a,f=c),{startRow:l,startColumn:u,endRow:h,endColumn:f}}function $n(t){var s;return!t||(((s=t==null?void 0:t.v)==null?void 0:s.toString())||"").length===0&&!t.p}function V(t){if(t){if(t.rgb)return t.rgb;if(t.th)return new qt().setThemeColor(t.th).asThemeColor().asRgbColor().getCssString()}return null}function Gn(t){return m.isString(t)&&t.substring(0,1)==="="&&t.length>1}function kn(t){return m.isString(t)&&t.indexOf("=")===-1&&t.length===6}function Vn(t){return""}function jn(t,e=!1){var i;let s="";const r=new Map([["ff",()=>{t.ff&&(s+=`font-family: ${t.ff}; `)}],["fs",()=>{if(t.fs){let o=t.fs;t.va&&(o/=2),s+=`font-size: ${o}pt; `}}],["it",()=>{t.it&&(s+="font-style: italic; ")}],["bl",()=>{t.bl&&(s+="font-weight: bold; ")}],["ul",()=>{var o;(o=t.ul)!=null&&o.s&&(s.indexOf("text-decoration-line")>-1?s=s.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," underline"):s+="text-decoration-line: underline; ",t.ul.cl&&s.indexOf("text-decoration-color")===-1&&(s+=`text-decoration-color: ${V(t.ul.cl)}; `),t.ul.t&&s.indexOf("text-decoration-style")===-1&&(s+=`text-decoration-style: ${t.ul.t} `))}],["st",()=>{var o;(o=t.st)!=null&&o.s&&(s.indexOf("text-decoration-line")>-1?s=s.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," line-through"):s+="text-decoration-line: line-through; ",t.st.cl&&s.indexOf("text-decoration-color")===-1&&(s+=`text-decoration-color: ${V(t.st.cl)}; `),t.st.t&&s.indexOf("text-decoration-style")===-1&&(s+=`text-decoration-style: ${t.st.t} `))}],["ol",()=>{var o;(o=t.ol)!=null&&o.s&&(s.indexOf("text-decoration-line")>-1?s=s.replace(new RegExp("(?<=text-decoration-line:.*)\\b(?=;)","g")," overline"):s+="text-decoration-line: overline; ",t.ol.cl&&s.indexOf("text-decoration-color")===-1&&(s+=`text-decoration-color: ${V(t.ol.cl)}; `),t.ol.t&&s.indexOf("text-decoration-style")===-1&&(s+=`text-decoration-style: ${t.ol.t} `))}],["bg",()=>{t.bg&&(s+=`background: ${V(t.bg)}; `)}],["bd",()=>{var o,a,c,l,u,h,f,_;(o=t.bd)!=null&&o.b&&(s+=`border-bottom: ${vt((a=t.bd)==null?void 0:a.b.s)} ${V(t.bd.b.cl)??""}; `),(c=t.bd)!=null&&c.t&&(s+=`border-top: ${vt((l=t.bd)==null?void 0:l.t.s)} ${V(t.bd.t.cl)??""}; `),(u=t.bd)!=null&&u.r&&(s+=`border-right: ${vt((h=t.bd)==null?void 0:h.r.s)} ${V(t.bd.r.cl)??""}; `),(f=t.bd)!=null&&f.l&&(s+=`border-left: ${vt((_=t.bd)==null?void 0:_.l.s)} ${V(t.bd.l.cl)??""}; `)}],["cl",()=>{t.cl&&(s+=`color: ${V(t.cl)}; `)}],["va",()=>{t.va===Ft.SUBSCRIPT?s+="vertical-align: sub; ":t.va===Ft.SUPERSCRIPT&&(s+="vertical-align: super; ")}],["td",()=>{t.td===St.LEFT_TO_RIGHT?s+="direction: ltr; ":t.td===St.RIGHT_TO_LEFT&&(s+="direction: rtl; ")}],["tr",()=>{var o,a,c;t.tr&&(s+=`data-rotate: (${(o=t.tr)==null?void 0:o.a}deg${(a=t.tr)!=null&&a.v?` ,${(c=t.tr)==null?void 0:c.v}`:""});`)}],["ht",()=>{t.ht===nt.LEFT?s+="text-align: left; ":t.ht===nt.RIGHT?s+="text-align: right; ":t.ht===nt.CENTER?s+="text-align: center; ":t.ht===nt.JUSTIFIED&&(s+="text-align: justify; ")}],["vt",()=>{t.vt===lt.BOTTOM?s+="vertical-align: bottom; ":t.vt===lt.TOP?s+="vertical-align: top; ":t.vt===lt.MIDDLE&&(s+="vertical-align: middle; ")}],["tb",()=>{t.tb===ut.CLIP?s+="text-overflow: clip; ":t.tb===ut.OVERFLOW?s+="text-break: overflow; ":t.tb===ut.WRAP&&(s+="word-wrap: break-word;")}],["pd",()=>{var u,h,f,_,g,E,R,O;const o=`${(u=t.pd)==null?void 0:u.b}pt`,a=`${(h=t.pd)==null?void 0:h.t}pt`,c=`${(f=t.pd)==null?void 0:f.l}pt`,l=`${(_=t.pd)==null?void 0:_.r}pt`;(g=t.pd)!=null&&g.b&&(s+=`padding-bottom: ${o}; `),(E=t.pd)!=null&&E.t&&(s+=`padding-top: ${a}; `),(R=t.pd)!=null&&R.l&&(s+=`padding-left: ${c}; `),(O=t.pd)!=null&&O.r&&(s+=`padding-right: ${l}; `)}]]),n=["bd","tr","tb"];for(const o in t)e&&n.includes(o)||(i=r.get(o))==null||i();return s}function vt(t){let e="";return t===b.NONE?e="none":t===b.THIN?e="0.5pt solid":t===b.HAIR?e="0.5pt double":t===b.DOTTED?e="0.5pt dotted":t===b.DASHED||t===b.DASH_DOT?e="0.5pt dashed":t===b.DASH_DOT_DOT?e="0.5pt dotted":t===b.DOUBLE?e="0.5pt double":t===b.MEDIUM?e="1pt solid":t===b.MEDIUM_DASHED||t===b.MEDIUM_DASH_DOT?e="1pt dashed":t===b.MEDIUM_DASH_DOT_DOT?e="1pt dotted":t===b.SLANT_DASH_DOT?e="0.5pt dashed":t===b.THICK&&(e="1.5pt solid"),e}function zn(t){let e=0;if(t=t.trim(),t==="none")e=b.NONE;else if(t==="0.5pt solid")e=b.THIN;else if(t==="0.5pt double")e=b.HAIR;else if(t==="0.5pt dotted")e=b.DOTTED;else if(t==="0.5pt dashed")e=b.DASHED;else if(t==="1pt solid")e=b.MEDIUM;else if(t==="1pt dashed")e=b.MEDIUM_DASHED;else if(t==="1pt dotted")e=b.MEDIUM_DASH_DOT_DOT;else if(t==="1.5pt solid")e=b.THICK;else return b.NONE;return e}function Mt(t,e){let s=t.body;if(e){const{headers:r,footers:n}=t;r!=null&&r[e]?s=r[e].body:n!=null&&n[e]&&(s=n[e].body)}return s}function Yn(t){const{startRow:e,endRow:s,startColumn:r,endColumn:n}=t;return!(e<0||r<0||s<0||n<0)}function Ce(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(s=>Ce(t[s],e[s])):t===e:!1}function Ds(t,e){const s=t.ts||{},r=e.ts||{};return t.sId!==e.sId?!1:Ce(s,r)}function Se(t,e,s,r){if(t>e&&([t,e]=[e,t]),s>r&&([s,r]=[r,s]),e<s||r<t)return[t,e];s<t&&(s=t),r>e&&(r=e);const n=r-s+1;let i=[];return t===s?i=[r+1-n,e-n]:e===r?i=[t,s-1]:i=[t,e-n],i}function Kn(t){if(t==null)return!1;const e=t.bullet;return(e==null?void 0:e.listId)!=null}function Xn(t){if(t==null)return!1;const e=t.paragraphStyle;return Ms(e)}function Ms(t){return!(t==null||(t.indentStart==null||t.indentStart===0)&&t.hanging==null||t.hanging===0)}function Us(t,e,s){return t.slice(0,e)+s+t.slice(e)}function Ts(t,e,s){return e>s?t:t.slice(0,e)+t.slice(s)}var qn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ps={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,s){t.exports?t.exports=s():e.numeral=s()})(qr,function(){var e,s,n="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 c(l,u){this._input=l,this._value=u}return e=function(l){var u,h,f,_;if(e.isNumeral(l))u=l.value();else if(l===0||typeof l>"u")u=0;else if(l===null||s.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(h in r)if(_=typeof r[h].regexps.unformat=="function"?r[h].regexps.unformat():r[h].regexps.unformat,_&&l.match(_)){f=r[h].unformat;break}f=f||e._.stringToNumber,u=f(l)}else u=Number(l)||null;return new c(l,u)},e.version=n,e.isNumeral=function(l){return l instanceof c},e._=s={numberToFormat:function(l,u,h){var f=i[e.options.currentLocale],_=!1,g=!1,E=0,R="",O=1e12,A=1e9,L=1e6,F=1e3,x="",ot=!1,H,X,U,G,Jt,pe,K;if(l=l||0,X=Math.abs(l),e._.includes(u,"(")?(_=!0,u=u.replace(/[\(|\)]/g,"")):(e._.includes(u,"+")||e._.includes(u,"-"))&&(Jt=e._.includes(u,"+")?u.indexOf("+"):l<0?u.indexOf("-"):-1,u=u.replace(/[\+|\-]/g,"")),e._.includes(u,"a")&&(H=u.match(/a(k|m|b|t)?/),H=H?H[1]:!1,e._.includes(u," a")&&(R=" "),u=u.replace(new RegExp(R+"a[kmbt]?"),""),X>=O&&!H||H==="t"?(R+=f.abbreviations.trillion,l=l/O):X<O&&X>=A&&!H||H==="b"?(R+=f.abbreviations.billion,l=l/A):X<A&&X>=L&&!H||H==="m"?(R+=f.abbreviations.million,l=l/L):(X<L&&X>=F&&!H||H==="k")&&(R+=f.abbreviations.thousand,l=l/F)),e._.includes(u,"[.]")&&(g=!0,u=u.replace("[.]",".")),U=l.toString().split(".")[0],G=u.split(".")[1],pe=u.indexOf(","),E=(u.split(".")[0].split(",")[0].match(/0/g)||[]).length,G?(e._.includes(G,"[")?(G=G.replace("]",""),G=G.split("["),x=e._.toFixed(l,G[0].length+G[1].length,h,G[1].length)):x=e._.toFixed(l,G.length,h),U=x.split(".")[0],e._.includes(x,".")?x=f.delimiters.decimal+x.split(".")[1]:x="",g&&Number(x.slice(1))===0&&(x="")):U=e._.toFixed(l,0,h),R&&!H&&Number(U)>=1e3&&R!==f.abbreviations.trillion)switch(U=String(Number(U)/1e3),R){case f.abbreviations.thousand:R=f.abbreviations.million;break;case f.abbreviations.million:R=f.abbreviations.billion;break;case f.abbreviations.billion:R=f.abbreviations.trillion;break}if(e._.includes(U,"-")&&(U=U.slice(1),ot=!0),U.length<E)for(var Fe=E-U.length;Fe>0;Fe--)U="0"+U;return pe>-1&&(U=U.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),u.indexOf(".")===0&&(U=""),K=U+x+(R||""),_?K=(_&&ot?"(":"")+K+(_&&ot?")":""):Jt>=0?K=Jt===0?(ot?"-":"+")+K:K+(ot?"-":"+"):ot&&(K="-"+K),K},stringToNumber:function(l){var u=i[a.currentLocale],h=l,f={thousand:3,million:6,billion:9,trillion:12},_,g,E;if(a.zeroFormat&&l===a.zeroFormat)g=0;else if(a.nullFormat&&l===a.nullFormat||!l.replace(/[^0-9]+/g,"").length)g=null;else{g=1,u.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(u.delimiters.decimal,"."));for(_ in f)if(E=new RegExp("[^a-zA-Z]"+u.abbreviations[_]+"(?:\\)|(\\"+u.currency.symbol+")?(?:\\))?)?$"),h.match(E)){g*=Math.pow(10,f[_]);break}g*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),g*=Number(l)}return g},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,u){return l.indexOf(u)!==-1},insert:function(l,u,h){return l.slice(0,h)+u+l.slice(h)},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 h=Object(l),f=h.length>>>0,_=0,g;if(arguments.length===3)g=arguments[2];else{for(;_<f&&!(_ in h);)_++;if(_>=f)throw new TypeError("Reduce of empty array with no initial value");g=h[_++]}for(;_<f;_++)_ in h&&(g=u(g,h[_],_,h));return g},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,h){var f=s.multiplier(h);return u>f?u:f},1)},toFixed:function(l,u,h,f){var _=l.toString().split("."),g=u-(f||0),E,R,O,A;return _.length===2?E=Math.min(Math.max(_[1].length,g),u):E=g,O=Math.pow(10,E),A=(h(l+"e+"+E)/O).toFixed(E),f>u-E&&(R=new RegExp("\\.?0{1,"+(f-(u-E))+"}$"),A=A.replace(R,"")),A}},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,h){if(u=u.toLowerCase(),this[l+"s"][u])throw new TypeError(u+" "+l+" already registered.");return this[l+"s"][u]=h,h},e.validate=function(l,u){var h,f,_,g,E,R,O,A;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{O=e.localeData(u)}catch{O=e.localeData(e.locale())}return _=O.currency.symbol,E=O.abbreviations,h=O.delimiters.decimal,O.delimiters.thousands==="."?f="\\.":f=O.delimiters.thousands,A=l.match(/^[^\d]+/),A!==null&&(l=l.substr(1),A[0]!==_)||(A=l.match(/[^\d]+$/),A!==null&&(l=l.slice(0,-1),A[0]!==E.thousand&&A[0]!==E.million&&A[0]!==E.billion&&A[0]!==E.trillion))?!1:(R=new RegExp(f+"{2}"),l.match(/[^\d.,]/g)?!1:(g=l.split(h),g.length>2?!1:g.length<2?!!g[0].match(/^\d+.*\d$/)&&!g[0].match(R):g[0].length===1?!!g[0].match(/^\d+$/)&&!g[0].match(R)&&!!g[1].match(/^\d+$/):!!g[0].match(/^\d+.*\d$/)&&!g[0].match(R)&&!!g[1].match(/^\d+$/)))},e.fn=c.prototype={clone:function(){return e(this)},format:function(l,u){var h=this._value,f=l||a.defaultFormat,_,g,E;if(u=u||Math.round,h===0&&a.zeroFormat!==null)g=a.zeroFormat;else if(h===null&&a.nullFormat!==null)g=a.nullFormat;else{for(_ in r)if(f.match(r[_].regexps.format)){E=r[_].format;break}E=E||e._.numberToFormat,g=E(h,f,u)}return g},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var u=s.correctionFactor.call(null,this._value,l);function h(f,_,g,E){return f+Math.round(u*_)}return this._value=s.reduce([this._value,l],h,0)/u,this},subtract:function(l){var u=s.correctionFactor.call(null,this._value,l);function h(f,_,g,E){return f-Math.round(u*_)}return this._value=s.reduce([l],h,Math.round(this._value*u))/u,this},multiply:function(l){function u(h,f,_,g){var E=s.correctionFactor(h,f);return Math.round(h*E)*Math.round(f*E)/Math.round(E*E)}return this._value=s.reduce([this._value,l],u,1),this},divide:function(l){function u(h,f,_,g){var E=s.correctionFactor(h,f);return Math.round(h*E)/Math.round(f*E)}return this._value=s.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,h){var f=e._.includes(u," BPS")?" ":"",_;return l=l*1e4,u=u.replace(/\s?BPS/,""),_=e._.numberToFormat(l,u,h),e._.includes(_,")")?(_=_.split(""),_.splice(-1,0,f+"BPS"),_=_.join("")):_=_+f+"BPS",_},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"]},h=l.suffixes.concat(u.suffixes.filter(function(_){return l.suffixes.indexOf(_)<0})),f=h.join("|");f="("+f.replace("B","B(?!PS)")+")",e.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(_,g,E){var R,O=e._.includes(g,"ib")?u:l,A=e._.includes(g," b")||e._.includes(g," ib")?" ":"",L,F,x;for(g=g.replace(/\s?i?b/,""),L=0;L<=O.suffixes.length;L++)if(F=Math.pow(O.base,L),x=Math.pow(O.base,L+1),_===null||_===0||_>=F&&_<x){A+=O.suffixes[L],F>0&&(_=_/F);break}return R=e._.numberToFormat(_,g,E),R+A},unformat:function(_){var g=e._.stringToNumber(_),E,R;if(g){for(E=l.suffixes.length-1;E>=0;E--){if(e._.includes(_,l.suffixes[E])){R=Math.pow(l.base,E);break}if(e._.includes(_,u.suffixes[E])){R=Math.pow(u.base,E);break}}g*=R||1}return g}})}(),function(){e.register("format","currency",{regexps:{format:/(\$)/},format:function(l,u,h){var f=e.locales[e.options.currentLocale],_={before:u.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:u.match(/([\+|\-|\)|\s|\$]*)$/)[0]},g,E,R;for(u=u.replace(/\s?\$\s?/,""),g=e._.numberToFormat(l,u,h),l>=0?(_.before=_.before.replace(/[\-\(]/,""),_.after=_.after.replace(/[\-\)]/,"")):l<0&&!e._.includes(_.before,"-")&&!e._.includes(_.before,"(")&&(_.before="-"+_.before),R=0;R<_.before.length;R++)switch(E=_.before[R],E){case"$":g=e._.insert(g,f.currency.symbol,R);break;case" ":g=e._.insert(g," ",R+f.currency.symbol.length-1);break}for(R=_.after.length-1;R>=0;R--)switch(E=_.after[R],E){case"$":g=R===_.after.length-1?g+f.currency.symbol:e._.insert(g,f.currency.symbol,-(_.after.length-(1+R)));break;case" ":g=R===_.after.length-1?g+" ":e._.insert(g," ",-(_.after.length-(1+R)+f.currency.symbol.length-1));break}return g}})}(),function(){e.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,u,h){var f,_=typeof l=="number"&&!e._.isNaN(l)?l.toExponential():"0e+0",g=_.split("e");return u=u.replace(/e[\+|\-]{1}0/,""),f=e._.numberToFormat(Number(g[0]),u,h),f+"e"+g[1]},unformat:function(l){var u=e._.includes(l,"e+")?l.split("e+"):l.split("e-"),h=Number(u[0]),f=Number(u[1]);f=e._.includes(l,"e-")?f*=-1:f;function _(g,E,R,O){var A=e._.correctionFactor(g,E),L=g*A*(E*A)/(A*A);return L}return e._.reduce([h,Math.pow(10,f)],_,1)}})}(),function(){e.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,u,h){var f=e.locales[e.options.currentLocale],_,g=e._.includes(u," o")?" ":"";return u=u.replace(/\s?o/,""),g+=f.ordinal(l),_=e._.numberToFormat(l,u,h),_+g}})}(),function(){e.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,u,h){var f=e._.includes(u," %")?" ":"",_;return e.options.scalePercentBy100&&(l=l*100),u=u.replace(/\s?\%/,""),_=e._.numberToFormat(l,u,h),e._.includes(_,")")?(_=_.split(""),_.splice(-1,0,f+"%"),_=_.join("")):_=_+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,h){var f=Math.floor(l/60/60),_=Math.floor((l-f*60*60)/60),g=Math.round(l-f*60*60-_*60);return f+":"+(_<10?"0"+_:_)+":"+(g<10?"0"+g:g)},unformat:function(l){var u=l.split(":"),h=0;return u.length===3?(h=h+Number(u[0])*60*60,h=h+Number(u[1])*60,h=h+Number(u[2])):u.length===2&&(h=h+Number(u[0])*60,h=h+Number(u[1])),Number(h)}})}(),e})})(xs);var yr=xs.exports;const st=Jr(yr),le={v:"#VALUE!",n:"#NAME?",na:"#N/A",r:"#REF!",d:"#DIV/0!",nm:"#NUM!",nl:"#NULL!",sp:"#SPILL!"};function ti(t){let e=!1;for(const s in le)if(t===le[s]){e=!0;break}return e}function nt(t){return t===null||t.toString().replace(/\s/g,"")===""||typeof t=="boolean"?!1:!isNaN(t)}function ei(t){if(t===null||t.toString().length<5)return!1;if(e(t))return!0;return!1;function e(s){const n=/^(\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(!n.test(s)&&!r.test(s))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 Wt=new Date("2017-02-19T19:06:09.000Z");Number.isNaN(Wt.getFullYear())&&(Wt=new Date("2/19/17"));const si=Wt.getFullYear()===2017;function ni(t,e){const s=new Date(t);if(si)return e>0?s.setTime(s.getTime()+s.getTimezoneOffset()*60*1e3):e<0&&s.setTime(s.getTime()-s.getTimezoneOffset()*60*1e3),s;if(t instanceof Date)return t;if(Wt.getFullYear()===1917&&!Number.isNaN(s.getFullYear())){const i=s.getFullYear();return t.indexOf(`${i}`)>-1||s.setFullYear(s.getFullYear()+100),s}const n=t.match(/\d+/g)||["2017","2","19","0","0","0"];let r=new Date(+n[0],+n[1]-1,+n[2],+n[3]||0,+n[4]||0,+n[5]||0);return t.indexOf("Z")>-1&&(r=new Date(r.getTime()-r.getTimezoneOffset()*60*1e3)),r}const ri=new Date(1900,2,1,0,0,0);function ps(t,e){let s=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());const n=Date.UTC(1899,11,31,0,0,0);return e?s-=1461*24*60*60*1e3:t>=ri&&(s+=24*60*60*1e3),(s-n)/(24*60*60*1e3)}function ii(t){let e=null,s={},n=t;if(t===null)return null;if(/^-?[0-9]{1,}[,][0-9]{3}(.[0-9]{1,2})?$/.test(t)){e=t,n=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}s={fa:r,t:"n"}}else if(t.toString().substr(0,1)==="'")e=t.toString().substr(1),s={fa:"@",t:"s"};else if(t.toString().toUpperCase()==="TRUE")e="TRUE",s={fa:"General",t:"b"},n=!0;else if(t.toString().toUpperCase()==="FALSE")e="FALSE",s={fa:"General",t:"b"},n=!1;else if(ti(t))e=t.toString(),s={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(),s={fa:"@",t:"s"};else if(nt(t)&&Math.abs(parseFloat(t))>0&&(Math.abs(parseFloat(t))>=1e11||Math.abs(parseFloat(t))<1e-9)){n=st(t).value();const r=n.toExponential();if(r.indexOf(".")>-1){let i=r.split(".")[1].split("e")[0].length;i>5&&(i=5),s={fa:`#0.${new Array(i+1).join("0")}E+00`,t:"n"}}else s={fa:"#0.E+00",t:"n"};e=Z.format(s.fa,n)}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&&nt(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 h=a.split(",");for(let f=1;f<h.length;f++)if(h[f].length<3){u=!1;break}u?(s={fa:`#,##0.${new Array(l+1).join("0")}%`,t:"n"},n=st(t).value(),e=Z.format(s.fa,n)):(e=t.toString(),s={fa:"@",t:"s"})}else s={fa:`0.${new Array(l+1).join("0")}%`,t:"n"},n=st(t).value(),e=Z.format(s.fa,n)}else e=t.toString(),s={fa:"@",t:"s"};else if(i.indexOf(",")>-1){let a=!0;const c=i.split(",");for(let l=1;l<c.length;l++)if(c[l].length<3){a=!1;break}a?(s={fa:"#,##0%",t:"n"},n=st(t).value(),e=Z.format(s.fa,n)):(e=t.toString(),s={fa:"@",t:"s"})}else s={fa:"0%",t:"n"},n=st(t).value(),e=Z.format(s.fa,n);else e=t.toString(),s={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 c=r.split(",");for(let l=1;l<c.length;l++)if(!nt(c[l])||c[l].length<3){a=!1;break}a?(s={fa:`#,##0.${new Array(o+1).join("0")}`,t:"n"},n=st(t).value(),e=Z.format(s.fa,n)):(e=t.toString(),s={fa:"@",t:"s"})}else nt(r)&&nt(i)?(s={fa:`0.${new Array(o+1).join("0")}`,t:"n"},n=st(t).value(),e=Z.format(s.fa,n)):(e=t.toString(),s={fa:"@",t:"s"})}else e=t.toString(),s={fa:"@",t:"s"};else nt(t)?(e=t.toString(),s={fa:"General",t:"n"},n=parseFloat(t)):ei(t)&&(t.toString().indexOf(".")>-1||t.toString().indexOf(":")>-1||t.toString().length<16)?(n=ps(ni(t.toString().replace(/-/g,"/"))),n.toString().indexOf(".")>-1?t.toString().length>18?s.fa="yyyy-MM-dd hh:mm:ss":t.toString().length>11?s.fa="yyyy-MM-dd hh:mm":s.fa="yyyy-MM-dd":s.fa="yyyy-MM-dd",s.t="d",e=Z.format(s.fa,n)):(e=t,s.fa="General",s.t="g");return[e,s,n]}const Z={format(t,e){}},oi=(t,e)=>{};function ai(t){let e=0;for(let s=0;s<t.length;s++)e=t.charCodeAt(s)+(e<<6)+(e<<16)-e;return e>>>0}class Et{static hasLength(e,s){return e.length===s}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 S=Symbol("newer"),T=Symbol("older");class Fs{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[S],{done:!1,value:e.key}):{done:!0,value:void 0}}}class Hs{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[S],{done:!1,value:e.value}):{done:!0,value:void 0}}}class Bs{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[S],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}}}var Ho,Bo;class ue{constructor(e,s){d(this,"key");d(this,"value");d(this,Ho);d(this,Bo);this.key=e,this.value=s,this[S]=void 0,this[T]=void 0}toJSON(){return{key:this.key,value:this.value}}}Ho=S,Bo=T;class Ws{constructor(...e){d(this,"_keymap");d(this,"size",0);d(this,"limit");d(this,"oldest");d(this,"newest");d(this,"_onShiftListeners",[]);if(Et.hasLength(e,1)){if(Et.isNumber(e[0])){const s=e[0];this._initialize(s,void 0);return}if(Et.isIterable(e[0])){const s=e[0];this._initialize(0,s);return}return}if(Et.hasLength(e,2)){const s=e[0],n=e[1];this._initialize(s,n)}}onShift(e){if(this._onShiftListeners.indexOf(e)===-1)return this._onShiftListeners.push(e),v(()=>tt(this._onShiftListeners,e));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(e,s){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=e,this._keymap=new Map,s&&(this.assign(s),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[S]&&(e===this.oldest&&(this.oldest=e[S]),e[S][T]=e[T]),e[T]&&(e[T][S]=e[S]),e[S]=void 0,e[T]=this.newest,this.newest&&(this.newest[S]=e),this.newest=e)}assign(e){let s,n=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 ue(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),s?(s[S]=o,o[T]=s):this.oldest=o,s=o,n--===0)throw new Error("overflow")}this.newest=s,this.size=this._keymap.size}set(e,s){let n=this._keymap.get(e);return n?(n.value=s,this._markEntryAsUsed(n),this):(this._keymap.set(e,n=new ue(e,s)),this.newest?(this.newest[S]=n,n[T]=this.newest):this.oldest=n,this.newest=n,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const e=this.oldest;if(e)return this.oldest&&this.oldest[S]?(this.oldest=this.oldest[S],this.oldest[T]=void 0):(this.oldest=void 0,this.newest=void 0),e[S]=e[T]=void 0,this._keymap.delete(e.key),--this.size,this._onShiftListeners.forEach(s=>s(e)),[e.key,e.value]}get(e){const s=this._keymap.get(e);if(s)return this._markEntryAsUsed(s),s.value}has(e){return this._keymap.has(e)}find(e){const s=this._keymap.get(e);return s?s.value:void 0}delete(e){const s=this._keymap.get(e);if(s)return this._keymap.delete(s.key),s[S]&&s[T]?(s[T][S]=s[S],s[S][T]=s[T]):s[S]?(s[S][T]=void 0,this.oldest=s[S]):s[T]?(s[T][S]=void 0,this.newest=s[T]):this.oldest=this.newest=void 0,this.size--,s.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new Fs(this.oldest)}values(){return new Hs(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new Bs(this.oldest)}forEach(e,s){typeof s!="object"&&(s=this);let n=this.oldest;for(;n;)e.call(s,n.value,n.key,this),n=n[S]}toJSON(){const e=new Array(this.size);let s=0,n=this.oldest;for(;n;)e[s++]={key:n.key,value:n.value},n=n[S];return e}toString(){let e="",s=this.oldest;for(;s;)e+=`${String(s.key)}:${s.value}`,s=s[S],s&&(e+=" < ");return e}}function Y(t){let e=0;const s=Object.keys(t);for(const n of s){const r=Number(n);e=Math.max(e,r)}return e+1}function li(t,e,s){const n=Y(s),r=s;for(let i=n-1;i>=t;i--)r[i+1]=r[i];r[t]=e}function ui(t,e){const s=t,n=Object.keys(s),r=n.length,i=e,o=Object.keys(i),a=o.length,c={};let l=0;for(let u=0;u<r;u++,l++){const h=n[u];c[l]=s[h]}for(let u=0;u<a;u++,l++){const h=o[u];c[l]=i[h]}return c}function ci(t,e,s){const n=s;if(Y(s)>0){const i={};let o=0;for(let a=t;a<e;a++)n[a]&&(i[o]=n[a],o++);return i}return{}}function ce(t,e,s,n){const r=t>s;if(!r&&t+e>s)throw new Error("Invalid move operation");r?hi(t,e,s,n):di(t,e,s,n)}function hi(t,e,s,n){const r=n,i=[];for(let o=t;o<t+e;o++)i.push(r[o]);for(let o=t-1;o>=s;o--){const a=r[o];r[o+e]=a,a==null&&delete r[o+e]}i.forEach((o,a)=>{r[s+a]=o})}function di(t,e,s,n){const r=n,i=[];for(let o=t;o<t+e;o++)i.push(r[o]);for(let o=t+e;o<s;o++){const a=r[o];r[o-e]=a,a==null&&delete r[o-e]}i.forEach((o,a)=>{r[s+a-e]=o})}class V{constructor(e={}){d(this,"_matrix");this._setOriginValue(e)}static MakeObjectMatrixSize(e){return new V({[e-1]:{}})}getMatrix(){return this._matrix}forEach(e){const s=this._matrix,n=Object.keys(s);for(const r of n){const i=Number(r),o=s[i];if(e(i,o)===!1)return this}return this}forRow(e){const s=this._matrix,n=Object.keys(s);for(const r of n){const i=Number(r),o=s[i];if(e(i,Object.keys(o).map(c=>Number(c)))===!1)return this}return this}forValue(e){const s=this._matrix,n=Object.keys(s);for(const r of n){const i=Number(r),o=s[i],a=Object.keys(o);for(const c of a){const l=Number(c),u=o[Number(c)];if(e(i,l,u)===!1)return this}}return this}swapRow(e,s){const n=this._matrix[e],r=this._matrix[s];this._matrix[e]=r,this._matrix[s]=n}getRow(e){return this._matrix[e]}getRowOrCreate(e){let s=this.getRow(e);return s==null&&(s={},this._matrix[e]=s),s}reset(){this._setOriginValue({})}hasValue(){const e=this._matrix,s=Object.keys(e);if(s.length===0)return!1;for(const n of s){const r=Number(n),i=e[r];if(Object.keys(i).length>0)return!0}return!1}getValue(e,s){var n,r;return(r=(n=this._matrix)==null?void 0:n[e])==null?void 0:r[s]}setValue(e,s,n){const r=this.getRowOrCreate(e);r[s]=n}deleteValue(e,s){var n,r;(r=(n=this._matrix)==null?void 0:n[e])==null||delete r[s]}realDeleteValue(e,s){var n,r,i;if((r=(n=this._matrix)==null?void 0:n[e])==null||delete r[s],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,s){this._matrix[e]=s}moveRows(e,s,n){ce(e,s,n,this._matrix)}moveColumns(e,s,n){this.forEach((r,i)=>{ce(e,s,n,i)})}getFragment(e,s,n,r){const i=new V;let o=0;for(let a=e;a<=s;a++){const c={};let l=0;for(let u=n;u<=r;u++){const h=this.getValue(a,u);c[l]=h,l++}i.setRow(o,c),o++}return i}getSlice(e,s,n,r){const i=new V;for(let o=e;o<=s;o++)for(let a=n;a<=r;a++){const c=this.getValue(o,a);c&&i.setValue(o,a,m.deepClone(c))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Y(this._matrix)}getRange(){const n=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 c=Y(a)-1;r=c>r?c:r}}return{startRow:0,startColumn:0,endRow:n,endColumn:r}}toNativeArray(){const e=new Array;return this.forValue((s,n,r)=>{e.push(r)}),e}toArray(){const e=[];return this.forRow((s,n)=>{e[s]==null&&(e[s]=[]),n.forEach(r=>{e[s][r]=this.getValue(s,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,s=0,n=!1,r=!1;const i=new V;return this.forEach((o,a)=>{n||(n=!0,e=o),Object.keys(a).forEach(c=>{const l=Number(c);r?l<s&&(s=l):(r=!0,s=l);const u=this.getValue(o,l);i.setValue(o-e,l-s,u)})}),i.getData()}getDataRange(){let e=0,s=0,n=0,r=!1,i=!1;this.forEach((a,c)=>{r||(r=!0,e=a);const l=Y(c)-1;l>n&&(n=l),Object.keys(c).forEach(u=>{const h=Number(u);i?h<s&&(s=h):(i=!0,s=h)})});const o=e+this.getSizeOf()-1;return{startRow:e,startColumn:s,endRow:o,endColumn:n}}getDiscreteRanges(){const e=[];return this.forEach((s,n)=>{Object.keys(n).forEach(r=>{const i=Number(r);let o=!1;for(const a of e)if(s>=a.startRow&&s<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(s,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||e.push({startRow:s,endRow:s,startColumn:i,endColumn:i})})}),e}merge(e){this.forValue((s,n)=>{const r=e.getValue(s,n);r!=null&&this.setValue(s,n,r)})}_setOriginValue(e={}){this._matrix=e}}var Ne=(t=>(t.INIT="init",t.FETCHING="fetching",t.DONE="done",t))(Ne||{});class Gs{constructor(){d(this,"status","init")}}const _i=t=>t.some(e=>e.status==="init")?"init":t.some(e=>e.status==="fetching")?"fetching":"done";var j=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN",t[t.ALL=3]="ALL",t))(j||{}),z=(t=>(t[t.NONE=0]="NONE",t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN",t[t.ALL=3]="ALL",t))(z||{});function fi(t){return[t.startRow,t.startColumn,t.endRow,t.endColumn]}const y=class y{static clone(e){return{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType}}static equals(e,s){return e.endRow===s.endRow&&e.endColumn===s.endColumn&&e.startRow===s.startRow&&e.startColumn===s.startColumn&&(e.rangeType===s.rangeType||e.rangeType===void 0&&s.rangeType===j.NORMAL||s.rangeType===void 0&&e.rangeType===j.NORMAL)}static intersects(e,s){const n=e.startRow,r=e.endRow,i=e.startColumn,o=e.endColumn,a=s.startRow,c=s.endRow,l=s.startColumn,u=s.endColumn,h=Math.abs(i+o-l-u),f=Math.abs(i-o)+Math.abs(l-u),_=Math.abs(n+r-a-c),g=Math.abs(n-r)+Math.abs(a-c);return h<=f&&_<=g}static getIntersects(e,s){const n=e.startRow,r=e.endRow,i=e.startColumn,o=e.endColumn,a=s.startRow,c=s.endRow,l=s.startColumn,u=s.endColumn;let h,f,_,g;if(a<=r)a>=n?f=a:f=n;else return null;if(c>=n)c>=r?g=r:g=c;else return null;if(l<=o)l>i?h=l:h=i;else return null;if(u>=i)u>=o?_=o:_=u;else return null;return{startRow:f,endRow:g,startColumn:h,endColumn:_,rangeType:j.NORMAL}}static contains(e,s){return e.startRow<=s.startRow&&e.endRow>=s.endRow&&e.startColumn<=s.startColumn&&e.endColumn>=s.endColumn}static realContain(e,s){return y.contains(e,s)&&(e.startRow<s.startRow||e.endRow>s.endRow||e.startColumn<s.startColumn||e.endColumn>s.endColumn)}static union(...e){return e.reduce((s,n)=>({startRow:Math.min(s.startRow,n.startRow),startColumn:Math.min(s.startColumn,n.startColumn),endRow:Math.max(s.endRow,n.endRow),endColumn:Math.max(s.endColumn,n.endColumn),rangeType:j.NORMAL}),e[0])}static subtract(e,s){if(s.startRow>=e.endRow||s.endRow<=e.startRow||s.startColumn>=e.endColumn||s.endColumn<=e.startColumn)return[e];const n=[];s.startRow>e.startRow&&n.push({startRow:e.startRow,startColumn:e.startColumn,endRow:s.startRow,endColumn:e.endColumn}),s.endRow<e.endRow&&n.push({startRow:s.endRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn});const r=Math.max(e.startRow,s.startRow),i=Math.min(e.endRow,s.endRow);return s.startColumn>e.startColumn&&n.push({startRow:r,startColumn:e.startColumn,endRow:i,endColumn:s.startColumn}),s.endColumn<e.endColumn&&n.push({startRow:r,startColumn:s.endColumn,endRow:i,endColumn:e.endColumn}),n}};d(y,"getRelativeRange",(e,s)=>({startRow:e.startRow-s.startRow,endRow:e.endRow-e.startRow,startColumn:e.startColumn-s.startColumn,endColumn:e.endColumn-e.startColumn})),d(y,"getPositionRange",(e,s)=>({startRow:e.startRow+s.startRow,endRow:e.endRow+e.startRow+s.startRow,startColumn:e.startColumn+s.startColumn,endColumn:e.endColumn+e.startColumn+s.startColumn})),d(y,"moveHorizontal",(e,s=0,n=0)=>({...e,startColumn:e.startColumn+s,endColumn:e.endColumn+s+n})),d(y,"moveVertical",(e,s=0,n=0)=>({...e,startRow:e.startRow+s,endRow:e.endRow+s+n})),d(y,"moveOffset",(e,s,n)=>({...e,startRow:e.startRow+n,endRow:e.endRow+n,startColumn:e.startColumn+s,endColumn:e.endColumn+s}));let ut=y;class gi{constructor(e,s){d(this,"_values",[]);d(this,"_keys",[]);d(this,"_keyMaps",new Map);this._values=e,this._keys=s,e.forEach(n=>{this._initKeyMap(n)})}_initKeyMap(e){this._keys.forEach(s=>{const n=e[s],r=this._keyMaps.get(s)||new Map;r.set(n,e),this._keyMaps.set(s,r)})}getValue(e){for(let s=0;s<this._keys.length;s++){const n=this._keyMaps.get(this._keys[s]);if(n!=null&&n.has(e))return n.get(e)}return null}hasValue(e){for(let s=0;s<this._keys.length;s++){const n=this._keyMaps.get(this._keys[s]);if(n!=null&&n.has(e))return!0}return!1}addValue(e){this._values.push(e),this._initKeyMap(e)}setValue(e,s,n){const r=this.getValue(e);r&&Object.keys(r).includes(s)&&(r[s]=n)}deleteValue(e){const s=this.getValue(e);if(s){this._keys.forEach(r=>{const i=this._keyMaps.get(r),o=s[r];i==null||i.delete(o)});const n=this._values.findIndex(r=>r===s);this._values.splice(n,1)}}getValues(){return this._values}getKeyMap(e){var s;return[...((s=this._keyMaps.get(e))==null?void 0:s.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function he(t,e,s,n){return{forEach(r){for(let i=t;i<=e;i++)for(let o=s;o<=n;o++)r(i,o)}}}function Ei(t){if(t==null||t.length===0)return NaN;const e=t.toLowerCase().split(""),s=e.length,n=o=>o.charCodeAt(0)-96;let r=0,i=0;for(let o=0;o<s;o++)i=n(e[o]),r+=i*26**(s-o-1);return r===0?NaN:r-1}const Gt=65,$s=90,Ri=97;function mi(t){const e=$s-Gt+1;let s="";for(;t>=0;)s=String.fromCharCode(t%e+Gt)+s,t=Math.floor(t/e)-1;return s}function ks(t,e){let s="";for(;e>0;)s+=t,e--;return s}function Oi(t,e=!1){const s=$s-Gt+1;let n=Ri;e&&(n=Gt);const r=String.fromCharCode(t%s+n),i=Math.floor(t/s)+1;return ks(r,i)}function Ai(t,e){return t.zIndex>e.zIndex?1:t.zIndex===e.zIndex?0:-1}function Ii(t,e){return t.zIndex>e.zIndex?-1:t.zIndex===e.zIndex?0:1}function gt(t="index",e=1){return(s,n)=>s[t]>n[t]?e:s[t]===n[t]?0:-e}var Vs=(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))(Vs||{}),be=(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))(be||{});function js(t){const e=[];for(const s of t){const{st:n,ed:r}=s;if(n===r)continue;if(e.length===0){e.push(s);continue}const i=e.pop();Ds(s,i)&&m.hasIntersectionBetweenTwoRanges(i.st,i.ed,s.st,s.ed)?e.push({...s,st:i.st,ed:r}):e.push(i,s)}return e}function zs(t,e,s,n){const{textRuns:r}=t;if(r==null)return;const i=[],o=r.length;let a=!1;const c=e.textRuns??[];if(c.length)for(let l=0,u=c.length;l<u;l++){const h=c[l];h.st+=n,h.ed+=n}for(let l=0;l<o;l++){const u=r[l],{st:h,ed:f}=u;if(f<n)i.push(u);else if(n>=h&&n<=f)if(a)u.st+=s,u.ed+=s,i.push(u);else{a=!0,u.ed+=s;const _=[];if(c.length){const g={...u,st:h,ed:c[0].st};_.push(g),_.push(...c);const E=c[c.length-1],R={...u,st:E.ed,ed:f+s};_.push(R)}else _.push(u);i.push(..._)}else u.st+=s,u.ed+=s,a||(a=!0,i.push(...c)),i.push(u)}a||(a=!0,i.push(...c)),t.textRuns=js(i)}function Le(t,e,s,n){const{paragraphs:r}=t;if(r==null)return;const{paragraphs:i,dataStream:o}=e,a=[];let c=-1;for(let u=0,h=r.length;u<h;u++){const f=r[u],{startIndex:_}=f;_>=n&&(f.startIndex+=s),c===-1&&_>=n&&(c=u),a.push(f.startIndex)}let l=-1;if(i){for(let u=0,h=i.length;u<h;u++){const f=i[u];f.startIndex+=n;const _=f.startIndex;l=a.indexOf(_)}if(o===be.PARAGRAPH&&i.length===1){const u=r[c],h=i[0],f=u.paragraphStyle,_=u.bullet;u.paragraphStyle=h.paragraphStyle,u.bullet=h.bullet,h.paragraphStyle=f,h.bullet=_}l!==-1&&r.splice(l,1),r.push(...i),r.sort(gt("startIndex"))}}function Ci(t,e,s,n){const{sectionBreaks:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const c=r[o],{startIndex:l}=c;l>=n&&(c.startIndex+=s)}const i=e.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const c=i[o];c.startIndex+=n}r.push(...i),r.sort(gt("startIndex"))}}function Ys(t,e,s,n){const{customBlocks:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const c=r[o],{startIndex:l}=c;l>=n&&(c.startIndex+=s)}const i=e.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const c=i[o];c.startIndex+=n}r.push(...i),r.sort(gt("startIndex"))}}function we(t,e,s,n){const{tables:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const c=r[o],{startIndex:l,endIndex:u}=c;l>n?(c.startIndex+=s,c.endIndex+=s):u>=n-1&&(c.endIndex+=s)}const i=e.tables;if(i){for(let o=0,a=i.length;o<a;o++){const c=i[o];c.startIndex+=n,c.endIndex+=n}r.push(...i),r.sort(gt("startIndex"))}}function Si(t,e,s,n){const{customRanges:r}=t;if(r==null)return;for(let o=0,a=r.length;o<a;o++){const c=r[o],{startIndex:l,endIndex:u}=c;l>n?(c.startIndex+=s,c.endIndex+=s):u>=n-1&&(c.endIndex+=s)}const i=e.customRanges;if(i){for(let o=0,a=i.length;o<a;o++){const c=i[o];c.startIndex+=n,c.endIndex+=n}r.push(...i),r.sort(gt("startIndex"))}}function Ks(t,e,s){const{textRuns:n}=t,r=s,i=s+e,o=[];if(n){const a=[];for(let c=0,l=n.length;c<l;c++){const u=n[c],{st:h,ed:f}=u;if(r<=h&&i>=f){o.push({...u,st:h-r,ed:f-r});continue}else h<=r&&f>=i?(o.push({...u,st:r-r,ed:i-r}),u.ed-=e):r>=h&&r<f?(o.push({...u,st:r-r,ed:f-r}),u.ed=r):i>h&&i<=f?(o.push({...u,st:h-r,ed:i-r}),u.st=i-e,u.ed-=e):h>=i&&(u.st-=e,u.ed-=e);a.push(u)}t.textRuns=a}return o}function Xs(t,e,s){const{paragraphs:n}=t,r=s,i=s+e,o=[];if(n){const a=[];for(let c=0,l=n.length;c<l;c++){const u=n[c],{startIndex:h}=u;if(h>=r&&h<i){o.push({...u,startIndex:h-s});continue}else h>=i&&(u.startIndex-=e);a.push(u)}t.paragraphs=a}return o}function Qs(t,e,s){const{sectionBreaks:n}=t,r=s,i=s+e-1,o=[];if(n){const a=[];for(let c=0,l=n.length;c<l;c++){const u=n[c],{startIndex:h}=u;if(h>=r&&h<=i){o.push({...u,startIndex:h-s});continue}else h>i&&(u.startIndex-=e);a.push(u)}t.sectionBreaks=a}return o}function Zs(t,e,s){const{customBlocks:n}=t,r=s,i=s+e-1,o=[];if(n){const a=[];for(let c=0,l=n.length;c<l;c++){const u=n[c],{startIndex:h}=u;if(h>=r&&h<=i){o.push({...u,startIndex:h-s});continue}else h>i&&(u.startIndex-=e);a.push(u)}t.customBlocks=a}return o}function qs(t,e,s){const{tables:n}=t,r=s,i=s+e-1,o=[];if(n){const a=[];for(let c=0,l=n.length;c<l;c++){const u=n[c],{startIndex:h,endIndex:f}=u;if(r<=h&&i>=f){o.push({...u,startIndex:h-s,endIndex:f-s});continue}else if(h<=r&&f>=i){const _=Se(h,f,r,i);u.startIndex=_[0],u.endIndex=_[1]}else i<h&&(u.startIndex-=e,u.endIndex-=e);a.push(u)}t.tables=a}return o}function Js(t,e,s){const{customRanges:n}=t,r=s,i=s+e-1,o=[];if(n){const a=[];for(let c=0,l=n.length;c<l;c++){const u=n[c],{startIndex:h,endIndex:f}=u;if(r<=h&&i>=f){o.push({...u,startIndex:h-s,endIndex:f-s});continue}else if(h<=r&&f>=i){const _=Se(h,f,r,i);u.startIndex=_[0],u.endIndex=_[1]}else i<h&&(u.startIndex-=e,u.endIndex-=e);a.push(u)}t.customRanges=a}return o}function Ni(t,e,s){const{dataStream:n}=t,r=s,i=s+e,o=Ks(t,e,s),a=Xs(t,e,s),c=Qs(t,e,s),l=Zs(t,e,s),u=qs(t,e,s),h=Js(t,e,s);let f="";return n&&(t.dataStream=Ms(n,r,i),f=n.slice(r,i)),{dataStream:f,textRuns:o,paragraphs:a,sectionBreaks:c,customBlocks:l,tables:u,customRanges:h}}function bi(t,e,s,n){t.dataStream=Us(t.dataStream,n,e.dataStream),zs(t,e,s,n),Le(t,e,s,n),Ci(t,e,s,n),Ys(t,e,s,n),we(t,e,s,n),Si(t,e,s,n)}var ys=(t=>(t[t.character=0]="character",t[t.paragraph=1]="paragraph",t[t.table=2]="table",t[t.numbering=3]="numbering",t))(ys||{}),tn=(t=>(t[t.TAB=0]="TAB",t[t.SPACE=1]="SPACE",t[t.NOTHING=2]="NOTHING",t))(tn||{}),It=(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))(It||{}),q=(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))(q||{}),en=(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))(en||{}),sn=(t=>(t[t.DRAWING=0]="DRAWING",t[t.CUSTOM=1]="CUSTOM",t))(sn||{}),nn=(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))(nn||{}),rn=(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))(rn||{}),on=(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))(on||{}),an=(t=>(t[t.NORMAL=0]="NORMAL",t[t.TBRL=1]="TBRL",t[t.LRTBV=2]="LRTBV",t))(an||{}),ln=(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))(ln||{}),un=(t=>(t[t.BOTH_SIDES=0]="BOTH_SIDES",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.LARGEST=3]="LARGEST",t))(un||{}),cn=(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))(cn||{}),hn=(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))(hn||{}),dn=(t=>(t[t.AUTO=0]="AUTO",t[t.AT_LEAST=1]="AT_LEAST",t[t.EXACT=2]="EXACT",t))(dn||{}),_n=(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))(_n||{}),fn=(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))(fn||{}),gn=(t=>(t.EVENLY_DISTRIBUTED="0",t.FIXED_WIDTH="1",t))(gn||{}),En=(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))(En||{}),Rn=(t=>(t.NORMAL="normal",t.BOLD="bold",t.ITALIC="italic",t))(Rn||{}),mn=(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))(mn||{}),On=(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))(On||{}),An=(t=>(t[t.POINT=0]="POINT",t[t.LINE=1]="LINE",t[t.CHARACTER=2]="CHARACTER",t))(An||{}),In=(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))(In||{}),Cn=(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))(Cn||{}),Sn=(t=>(t[t.compressPunctuation=0]="compressPunctuation",t[t.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",t[t.doNotCompress=2]="doNotCompress",t))(Sn||{}),Nn=(t=>(t[t.PORTRAIT=0]="PORTRAIT",t[t.LANDSCAPE=1]="LANDSCAPE",t))(Nn||{}),$t=(t=>(t.BULLET_LIST="BULLET_LIST",t.ORDER_LIST="ORDER_LIST",t))($t||{});const Li={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:[{bulletAlignment:q.START,glyphFormat:" %0",textStyle:{fs:12},startNumber:0,glyphSymbol:"●",hanging:21,indentStart:21},{bulletAlignment:q.START,glyphFormat:" %1",textStyle:{fs:12},startNumber:0,glyphSymbol:"■",hanging:21,indentStart:42},{bulletAlignment:q.START,glyphFormat:" %1",textStyle:{fs:12},startNumber:0,glyphSymbol:"◆",hanging:21,indentStart:63}]},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:[{bulletAlignment:q.START,glyphFormat:" %1.",textStyle:{fs:12},startNumber:0,glyphType:It.DECIMAL,hanging:21,indentStart:21},{bulletAlignment:q.START,glyphFormat:" %1.%2)",textStyle:{fs:12},startNumber:0,glyphType:It.DECIMAL,hanging:21,indentStart:42},{bulletAlignment:q.START,glyphFormat:" %1.%2.%3.",textStyle:{fs:12},startNumber:0,glyphType:It.DECIMAL,hanging:21,indentStart:63}]}};function wi(t,e,s,n,r){const i=vi(t,e,s,n,r),o=Ti(t,e,s,n,r),a=Ui(t,e,s,n,r),c=Mi(t,e,s,n,r),l=Pi(t,e,s,n,r),u=xi(t,e,s,n,r);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:c,tables:l,customRanges:u}}function vi(t,e,s,n,r){const{textRuns:i}=t,{textRuns:o}=e;if(i==null||o==null)return;const a=Ks(t,s,n);if(r!==P.REPLACE){const c=Di(o,a,r);e.textRuns=c}return zs(t,e,s,n),a}function Di(t,e,s){if(e.length===0)return t;t=m.deepClone(t),e=m.deepClone(e);const n=[],r=t.length,i=e.length;let o=0,a=0,c=null;function l(){return c?(n.push(c),c=null,!0):!1}for(;o<r&&a<i;){const{st:_,ed:g,ts:E}=t[o],{st:R,ed:O,ts:A,sId:L}=e[a];let F;s===P.COVER?F={...A,...E}:F={...E,...A},g<R?(l()||n.push(t[o]),o++):O<_?(l()||n.push(e[a]),a++):(n.push({st:Math.min(_,R),ed:Math.max(_,R),ts:_<R?{...E}:{...A},sId:_<R?void 0:L}),n.push({st:Math.max(_,R),ed:Math.min(g,O),ts:F,sId:L}),g<O?(o++,e[a].st=g):(a++,t[o].st=O),c={st:Math.min(g,O),ed:Math.max(g,O),ts:g<O?{...A}:{...E},sId:g<O?L:void 0})}l();const u=n[n.length-1],h=t[r-1],f=e[i-1];return u.ed!==Math.max(h.ed,f.ed)&&(h.ed>f.ed?n.push(h):n.push(f)),js(n)}function Ti(t,e,s,n,r){const{paragraphs:i}=t,{paragraphs:o}=e;if(i==null||o==null)return;const a=Xs(t,s,n);if(r!==P.REPLACE){const c=[];for(const l of o){const{startIndex:u,paragraphStyle:h,bullet:f}=l;let _=[];for(const g of a){const{startIndex:E,paragraphStyle:R,bullet:O}=g;let A,L;if(r===P.COVER?(A={...R,...h},L={listId:"",listType:$t.BULLET_LIST,nestingLevel:0,textStyle:{},...O,...f}):(A={...h,...R},L={listId:"",listType:$t.BULLET_LIST,nestingLevel:0,textStyle:{},...f,...O}),u===E){_.push({startIndex:u,paragraphStyle:A,bullet:L});break}}c.push(..._),_=[]}e.paragraphs=c}return Le(t,e,s,n),a}function Ui(t,e,s,n,r){const{sectionBreaks:i}=t,{sectionBreaks:o}=e;if(i==null||o==null)return;const a=Qs(t,s,n);if(r!==P.REPLACE){const c=[];for(const l of o){const{startIndex:u}=l;let h=[];for(const f of a){const{startIndex:_}=f;if(u===_){r===P.COVER?h.push({...f,...l}):h.push({...l,...f});break}}c.push(...h),h=[]}e.sectionBreaks=c}return Le(t,e,s,n),a}function Mi(t,e,s,n,r){const{customBlocks:i}=t,{customBlocks:o}=e;if(i==null||o==null)return;const a=Zs(t,s,n);if(r!==P.REPLACE){const c=[];for(const l of o){const{startIndex:u}=l;let h=[];for(const f of a){const{startIndex:_}=f;if(u===_){r===P.COVER?h.push({...f,...l}):h.push({...l,...f});break}}c.push(...h),h=[]}e.customBlocks=c}return Ys(t,e,s,n),a}function Pi(t,e,s,n,r){const{tables:i}=t,{tables:o}=e;if(i==null||o==null)return;const a=qs(t,s,n);if(r!==P.REPLACE){const c=[];for(const l of o){const{startIndex:u,endIndex:h}=l;let f=[];for(const _ of a){const{startIndex:g,endIndex:E}=_;if(g>=u&&E<=h){r===P.COVER?f.push({..._,...l}):f.push({...l,..._});break}}c.push(...f),f=[]}e.tables=c}return we(t,e,s,n),a}function xi(t,e,s,n,r){const{customRanges:i}=t,{tables:o}=e;if(i==null||o==null)return;const a=Js(t,s,n);if(r!==P.REPLACE){const c=[];for(const l of o){const{startIndex:u,endIndex:h}=l;let f=[];for(const _ of a){const{startIndex:g,endIndex:E}=_;if(g>=u&&E<=h){r===P.COVER?f.push({..._,...l}):f.push({...l,..._});break}}c.push(...f),f=[]}e.customRanges=c}return we(t,e,s,n),a}const ve={id:"default_doc",documentStyle:{}};class pi{constructor(e){d(this,"snapshot");this.snapshot={...ve,...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:s}=this.snapshot;s.renderConfig==null?s.renderConfig=e:s.renderConfig={...s.renderConfig,...e}}updateDocumentDataMargin(e){const{t:s,l:n,b:r,r:i}=e,{documentStyle:o}=this.snapshot;s!=null&&(o.marginTop=s),n!=null&&(o.marginLeft=n),r!=null&&(o.marginBottom=r),i!=null&&(o.marginRight=i)}updateDocumentDataPageSize(e,s){const{documentStyle:n}=this.snapshot;if(!n.pageSize){e=e??1/0,s=s??1/0,n.pageSize={width:e,height:s};return}e!==void 0&&(n.pageSize.width=e),s!==void 0&&(n.pageSize.height=s)}updateDrawing(e,s){const{drawings:n}=this,{width:r,height:i,left:o,top:a}=s,c=n==null?void 0:n[e];if(!c)return;const l=c.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 pi{constructor(s){super(s);d(this,"_unitId");d(this,"headerModelMap",new Map);d(this,"footerModelMap",new Map);const n=6;this._unitId=this.snapshot.id??m.generateRandomId(n),this._initializeHeaderFooterModel()}dispose(){this.headerModelMap.forEach(s=>{s.dispose()}),this.footerModelMap.forEach(s=>{s.dispose()})}getRev(){return this.snapshot.rev??0}incrementRev(){this.snapshot.rev=this.getRev()+1}getSettings(){return this.snapshot.settings}reset(s){if(s.id&&s.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...ve,...s},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(s){if(s!=null){if(this.headerModelMap.has(s))return this.headerModelMap.get(s);if(this.footerModelMap.has(s))return this.footerModelMap.get(s)}return this}getUnitId(){return this._unitId}apply(s){const n=[],r=new us;return r.reset(),s.forEach(i=>{if(i=m.deepClone(i),i.t==="r"){const{coverType:o,body:a,len:c,segmentId:l}=i;if(a!=null){const u=this._updateApply(a,c,r.cursor,o,l);n.push({...i,t:"r",coverType:P.REPLACE,body:u})}else n.push({...i,t:"r"});r.moveCursor(c)}else if(i.t==="i"){const{body:o,len:a,segmentId:c,line:l}=i;this._insertApply(o,a,r.cursor,c),r.moveCursor(a),n.push({t:"d",len:a,line:l,segmentId:c})}else if(i.t==="d"){const{len:o,segmentId:a}=i,c=this._deleteApply(o,r.cursor,a);n.push({...i,t:"i",body:c})}else throw new Error(`Unknown mutation type for mutation: ${i}.`)}),n}_updateApply(s,n,r,i=P.COVER,o){if(s==null)throw new Error("updateBody is none");const a=this.snapshot,c=Tt(a,o);if(c==null)throw new Error("no body has changed");return wi(c,s,n,r,i)}_deleteApply(s,n,r){const i=this.snapshot,o=Tt(i,r);if(o==null)throw new Error("no body has changed");return s<=0?{dataStream:""}:Ni(o,s,n)}_insertApply(s,n,r,i){const o=this.snapshot,a=Tt(o,i);if(n!==0){if(a==null)throw new Error("no body has changed");bi(a,s,n,r)}}_initializeHeaderFooterModel(){const{headers:s,footers:n}=this.getSnapshot();if(s)for(const r in s){const i=s[r];this.headerModelMap.set(r,new dt(i))}if(n)for(const r in n){const i=n[r];this.footerModelMap.set(r,new dt(i))}}updateDocumentId(s){super.updateDocumentId(s),this._unitId=s}}var bn=(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))(bn||{});const Rt={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},Ln={id:"",sheetOrder:[],name:"",appVersion:"",locale:Yt.ZH_CN,styles:{},sheets:{},resources:[]},wn=1e3,vn=20,Dn=19,Tn=73,Un=46,Mn=20,kt={type:Ie.GRID,name:"Sheet1",id:"sheet-01",tabColor:"",hidden:I.FALSE,rowCount:wn,columnCount:vn,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Tn,defaultRowHeight:Dn,mergeData:[],hideRow:[],hideColumn:[],cellData:{},rowData:{},columnData:{},status:I.FALSE,showGridlines:I.TRUE,rowHeader:{width:Un,hidden:I.FALSE},columnHeader:{height:Mn,hidden:I.FALSE},selections:["A1"],rightToLeft:I.FALSE,pluginMeta:{}},Ut={ff:"Times New Roman",fs:14,it:I.FALSE,bl:I.FALSE,ul:{s:I.FALSE},st:{s:I.FALSE},ol:{s:I.FALSE},tr:{a:0,v:I.FALSE},td:St.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:rt.UNSPECIFIED,vt:at.UNSPECIFIED,tb:lt.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0}},Pn={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}};var xn=(t=>(t.ARRAY_CONVERTOR="ARRAY_CONVERTOR",t.MATRIX_CONVERTOR="MATRIX_CONVERTOR",t))(xn||{});class pn{constructor(e={}){d(this,"_styles");d(this,"_cacheMap",new Ws(1e5));this._styles=e,this._generateCacheMap()}each(e){return Object.entries(this._styles).forEach(e),this}search(e,s){if(this._cacheMap.has(s))return this._cacheMap.get(s);const n=this._getExistingStyleId(e);return n||"-1"}get(e){return typeof e!="string"?e:(e=String(e),this._styles[e])}add(e,s){const n=m.generateRandomId(6);return this._styles[n]=e,this._cacheMap.set(s,n),n}setValue(e){if(e==null)return;const s=JSON.stringify(e),n=this.search(e,s);return n!=="-1"?n:this.add(e,s)}toJSON(){return this._styles}getStyleByCell(e){let s;e&&m.isObject(e.s)?s=e.s:s=(e==null?void 0:e.s)&&this.get(e.s);const n=e==null?void 0:e.interceptorStyle;return n?{...s,...n}:s}_generateCacheMap(){const{_styles:e,_cacheMap:s}=this;for(const n in e){const r=JSON.stringify(e[n]);s.set(r,n)}}_getExistingStyleId(e){const{_styles:s}=this;for(const n in s)if(m.diffValue(s[n],e))return n;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 Gi(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 $i(t){if(t==null)return!0;const{v:e,f:s,si:n,p:r,s:i}=t;return!(!(e==null||typeof e=="string"&&e.length===0)||s!=null&&s.length>0||n!=null&&n.length>0||r!=null)}var De=(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))(De||{}),Fn=(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))(Fn||{}),Hn=(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))(Hn||{});class ki{constructor(e,s){d(this,"_columnData",{});this._config=e,this._columnData=s}getColumnData(){return this._columnData}getColVisible(e){const{_columnData:s}=this,n=s[e];return n?n.hd!==I.TRUE:!0}getHiddenCols(e=0,s=Y(this._columnData)-1){const n=[];let r=!1,i=-1;for(let o=e;o<=s;o++){const a=this.getColVisible(o);r&&a?(r=!1,n.push({rangeType:j.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!r&&!a&&(r=!0,i=o)}return r&&n.push({startRow:0,endRow:0,startColumn:i,endColumn:s,rangeType:j.COLUMN}),n}getColumnDatas(e,s){const n={};let r=0;for(let i=e;i<e+s;i++){const o=this.getColumnOrCreate(i);n[r]=o,r++}return n}getSize(){return Y(this._columnData)}getColumnWidth(e){const{_columnData:s}=this,n=this._config;let r=0;return r=(s[e]||{hd:I.FALSE,w:n.defaultColumnWidth}).w||n.defaultColumnWidth,r}getColumn(e){const s=this._columnData[e];if(s)return s}getColumnOrCreate(e){const{_columnData:s}=this,n=this._config,r=s[e];if(r)return r;const i={w:n.defaultColumnWidth,hd:I.FALSE};return this._columnData[e]=i,i}}function Dt(t,e){for(const s of e){const{ts:n={}}=s;if(n[t]==null)return I.FALSE;switch(t){case"bl":case"it":{if(n[t]===I.FALSE)return I.FALSE;break}case"ul":case"st":{if(n[t].s===I.FALSE)return I.FALSE;break}default:throw new Error(`unknown style key: ${t} in IStyleBase`)}}return I.TRUE}class _t{constructor(e,s,n){d(this,"_range");d(this,"_worksheet");this._deps=n,this._range=s,this._worksheet=e}static foreach(e,s){const{startRow:n,startColumn:r,endRow:i,endColumn:o}=e;for(let a=n;a<=i;a++)for(let c=r;c<=o;c++)s(a,c)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:e,endRow:s,startColumn:n,endColumn:r}=this._range,i=[];for(let o=e;o<=s;o++){const a=[];for(let c=n;c<=r;c++)a.push(this.getMatrix().getValue(o,c)||null);i.push(a)}return i}getMatrix(){const{startRow:e,endRow:s,startColumn:n,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),o=new V;for(let a=e;a<=s;a++)for(let c=n;c<=r;c++)o.setValue(a,c,i.getValue(a,c)||null);return o}getMatrixObject(){const{startRow:e,endRow:s,startColumn:n,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),o=new V;for(let a=e;a<=s;a++)for(let c=n;c<=r;c++)o.setValue(a-e,c-n,i.getValue(a,c)||{});return o}getA1Notation(){const{startRow:e,endRow:s,startColumn:n,endColumn:r}=this._range;let i,o;return n<r?(i=m.numToWord(n+1)+(e+1),o=m.numToWord(r+1)+(s+1)):(i=m.numToWord(r+1)+(s+1),o=m.numToWord(n+1)+(e+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const e=this._deps.getStyles();return this.getValues().map(s=>s.map(n=>{var i;const r=e.getStyleByCell(n);return((i=r==null?void 0:r.bg)==null?void 0:i.rgb)||Ut.bg.rgb}))}getCell(e,s){const{startRow:n,endRow:r,startColumn:i,endColumn:o}=this._range,a={startRow:n+e,endRow:n+e,startColumn:i+s,endColumn:i+s};return new _t(this._worksheet,a,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(e={}){return this.getObjectValues(e)[0][0]}getObjectValues(e={}){var a;const{startRow:s,endRow:n,startColumn:r,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(s,n,r,i).getData();if(e.isIncludeStyle){const c=this._deps.getStyles();for(let l=0;l<=n-s;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 h=o[l][u].s;h&&(o[l][u].s=c.get(h))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const e=this._deps.getStyles();return this.getValues().map(s=>s.map(n=>{var i;const r=e.getStyleByCell(n);return((i=r==null?void 0:r.cl)==null?void 0:i.rgb)||Ut.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var s,n;const{p:e}=this.getValue()??{};return e&&Array.isArray((s=e.body)==null?void 0:s.textRuns)?Dt("ul",(n=e.body)==null?void 0:n.textRuns)===I.TRUE?{s:I.TRUE}:{s:I.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var s,n;const{p:e}=this.getValue()??{};return e&&Array.isArray((s=e.body)==null?void 0:s.textRuns)?Dt("st",(n=e.body)==null?void 0:n.textRuns)===I.TRUE?{s:I.TRUE}:{s:I.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 s,n;const{p:e}=this.getValue()??{};return e&&Array.isArray((s=e.body)==null?void 0:s.textRuns)?Dt("it",(n=e.body)==null?void 0:n.textRuns)===I.TRUE?xt.ITALIC:xt.NORMAL:this.getFontStyles()[0][0]}getFontStyles(){return this._getStyles("it")}getFontWeight(){var s,n;const{p:e}=this.getValue()??{};return e&&Array.isArray((s=e.body)==null?void 0:s.textRuns)?Dt("bl",(n=e.body)==null?void 0:n.textRuns)===I.TRUE?pt.BOLD:pt.NORMAL:this.getFontWeights()[0][0]}getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:e,_worksheet:s}=this,{startRow:n,endRow:r}=e;let i=0;for(let o=0;o<=r-n;o++){const a=s.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:s}=this._range;return s-e+1}getNumRows(){const{startRow:e,endRow:s}=this._range;return s-e+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(e=>e.map(s=>(s==null?void 0:s.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(s=>s.map(n=>e.getStyleByCell(n)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:e,_worksheet:s}=this,{startColumn:n,endColumn:r}=e;let i=0;for(let o=0;o<=r-n;o++)i+=s.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){_t.foreach(this._range,e)}_getStyles(e){const s=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{const i=s&&s.getStyleByCell(r);return i&&i[e]||Ut[e]}))}}class Vi{constructor(e,s){d(this,"_rowData");this._config=e,this._rowData=s}getRowData(){return this._rowData}getRowDatas(e,s){const n={};let r=0;for(let i=e;i<e+s;i++){const o=this.getRowOrCreate(i);n[r]=o,r++}return n}getRowHeight(e,s=1){const{_rowData:n}=this,r=this._config;let i=0;for(let o=0;o<s;o++){const a=n[o+e]||{hd:I.FALSE,h:r.defaultRowHeight},{isAutoHeight:c,ah:l,h:u=r.defaultRowHeight}=a;i+=(c==null||c)&&typeof l=="number"?l:u}return i}getRow(e){return this._rowData[e]}getRowOrCreate(e){const{_rowData:s}=this,n=s[e];if(n)return n;const r=this._config,i={hd:I.FALSE,h:r.defaultRowHeight};return s[e]=i,i}getHiddenRows(e=0,s=Y(this._rowData)-1){const n=[];let r=!1,i=-1;for(let o=e;o<=s;o++){const a=this.getRowVisible(o);r&&a?(r=!1,n.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:j.ROW})):!r&&!a&&(r=!0,i=o)}return r&&n.push({startRow:i,endRow:s,startColumn:0,endColumn:0,rangeType:j.ROW}),n}getRowVisible(e){const s=this.getRow(e);return s?s.hd!==I.TRUE:!0}getSize(){return Y(this._rowData)}}class Bn 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(s,n){for(const r of this._cellContentInterceptors){const i=r.getCell(s,n);if(typeof i<"u")return i}return null}registerCellContentInterceptor(s){if(this._cellContentInterceptors.includes(s))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptors.push(s),v(()=>tt(this._cellContentInterceptors,s))}registerRowFilteredInterceptor(s){if(this._rowFilteredInterceptors.includes(s))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptors.push(s),v(()=>tt(this._rowFilteredInterceptors,s))}registerRowVisibleInterceptor(s){if(this._rowVisibleInterceptors.includes(s))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowVisibleInterceptors.push(s),v(()=>tt(this._rowVisibleInterceptors,s))}registerColVisibleInterceptor(s){if(this._colVisibleInterceptors.includes(s))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._colVisibleInterceptors.push(s),v(()=>tt(this._colVisibleInterceptors,s))}}class Nt{constructor(e,s){d(this,"_initialized");d(this,"_sheetId");d(this,"_snapshot");d(this,"_cellData");d(this,"_rowManager");d(this,"_columnManager");d(this,"_viewModel");this._styles=s;const n={...kt,mergeData:[],hideRow:[],hideColumn:[],cellData:{},rowData:{},columnData:{},rowHeader:{width:46,hidden:I.FALSE},columnHeader:{height:20,hidden:I.FALSE},selections:["A1"],rightToLeft:I.FALSE,pluginMeta:{},...e};this._snapshot=n;const{columnData:r,rowData:i,cellData:o}=this._snapshot;this._sheetId=this._snapshot.id??m.generateRandomId(6),this._initialized=!1,this._cellData=new V(o),this._rowManager=new Vi(this._snapshot,i),this._columnManager=new ki(this._snapshot,r),this._viewModel=new Bn}__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,s=m.deepClone(e);return new Nt(s,this._styles)}getMergeData(){return this._snapshot.mergeData}getMergedCells(e,s){const n=this._snapshot.mergeData,r=[];for(let i=0;i<n.length;i++){const o=n[i];ut.intersects({startRow:e,startColumn:s,endRow:e,endColumn:s},o)&&r.push(o)}return r.length?r:null}getMergedCell(e,s){const n=this._snapshot.mergeData;for(let r=0;r<n.length;r++){const i=n[r];if(ut.intersects({startRow:e,startColumn:s,endRow:e,endColumn:s},i))return i}return null}getCell(e,s){return e<0||s<0?null:this._viewModel.getCell(e,s)}getCellRaw(e,s){return this.getCellMatrix().getValue(e,s)}getMatrixWithMergedCells(e,s,n,r){const i=this.getCellMatrix(),o=this._snapshot.mergeData.filter(c=>ut.intersects({startRow:e,startColumn:s,endRow:n,endColumn:r},c)),a=new V;return he(e,n,s,r).forEach((c,l)=>{const u=i.getValue(c,l);u&&a.setValue(c,l,u)}),o.forEach(c=>{const{startColumn:l,startRow:u,endColumn:h,endRow:f}=c;he(u,f,l,h).forEach((_,g)=>{_===u&&g===l&&a.setValue(_,g,{...i.getValue(_,g),rowSpan:f-u+1,colSpan:h-l+1}),(_!==u||g!==l)&&a.realDeleteValue(_,g)})}),a}getRange(e,s,n,r){return typeof e=="object"?new _t(this,e,{getStyles:()=>this._styles}):new _t(this,{startRow:e,startColumn:s,endColumn:r||s,endRow:n||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:s}=e;return s}getMaxRows(){const{_snapshot:e}=this,{rowCount:s}=e;return s}getType(){const{_snapshot:e}=this,{type:s}=e;return s}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:s}=e;return s===0}getTabColor(){const{_snapshot:e}=this,{tabColor:s}=e;return s}getColumnWidth(e){return this.getColumnManager().getColumnWidth(e)}getRowHeight(e){return this.getRowManager().getRowHeight(e)}getRowVisible(e){return this.getRowManager().getRowVisible(e)}getHiddenRows(e,s){const n=this.getMaxColumns()-1,r=this._rowManager.getHiddenRows(e,s);return r.forEach(i=>i.endColumn=n),r}getColVisible(e){return this._columnManager.getColVisible(e)}getHiddenCols(e,s){const n=this.getMaxRows()-1,r=this._columnManager.getHiddenCols(e,s);return r.forEach(i=>i.endRow=n),r}isRightToLeft(){const{_snapshot:e}=this,{rightToLeft:s}=e;return s}getPluginMeta(e){return this._snapshot.pluginMeta[e]}setPluginMeta(e,s){this._snapshot.pluginMeta[e]=s}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 ji=Object.defineProperty,zi=Object.getOwnPropertyDescriptor,Yi=(t,e,s,n)=>{for(var r=n>1?void 0:n?zi(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&ji(e,s,r),r},Ki=(t,e)=>(s,n)=>e(s,n,t);function Xi(t,e){return`${t.getUnitId()}|${e.getSheetId()}`}exports.Workbook=class extends M{constructor(s={},n){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 Ps);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=n,this._snapshot=m.commonExtend(Ln,s);const{styles:r}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=m.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new pn(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(s){return typeof s=="string"||"startRow"in s||"row"in s}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(s,n,r){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[s])return!1;i[s]=r,o.splice(n,0,s);const a=new Nt(r,this._styles);return this._worksheets.set(s,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(s){const{sheetOrder:n}=this._snapshot;return n.findIndex(r=>r===s)}getRawActiveSheet(){const{sheetOrder:s}=this._snapshot;return s.find(r=>this._worksheets.get(r).getStatus()===I.TRUE)}getActiveSheet(){const{sheetOrder:s}=this._snapshot,n=this.getRawActiveSheet();return n?this._worksheets.get(n):this._worksheets.get(s[0])}__setActiveSheet(s){this._activeSheet$.next(s)}getActiveSheetIndex(){const{sheetOrder:s}=this._snapshot;return s.findIndex(n=>this._worksheets.get(n).getStatus()===1)}getSheetSize(){return this._snapshot.sheetOrder.length}flush(){}getSheets(){const{sheetOrder:s}=this._snapshot;return s.map(n=>this._worksheets.get(n))}getSheetIndex(s){const{sheetOrder:n}=this._snapshot;return n.findIndex(r=>s.getSheetId()===r)}getSheetBySheetName(s){const{sheetOrder:n}=this._snapshot,r=n.find(i=>this._worksheets.get(i).getName()===s);return this._worksheets.get(r)}getSheetBySheetId(s){return this._worksheets.get(s)}getSheetByIndex(s){const{sheetOrder:n}=this._snapshot;return this._worksheets.get(n[s])}getHiddenWorksheets(){return this.getSheets().filter(s=>s.getConfig().hidden===I.TRUE).map(s=>s.getConfig().id)}transformRangeType(s){if(typeof s=="string")return this._getCellRange(s);if(typeof s!="string"&&"row"in s){const n=s;return{sheetId:"",range:{startRow:n.row[0],startColumn:n.column[0],endRow:n.row[1],endColumn:n.column[1]}}}return typeof s!="string"&&"startRow"in s?{sheetId:"",range:s}:Rt}load(s){this._snapshot=s}_getCellRange(s){var u,h,f,_,g;let n="",r="";if(s.indexOf("!")>-1){const E=s.split("!");n=E[0],r=E[1],n=n.replace(/\\'/g,"'").replace(/''/g,"'"),n.substring(0,1)==="'"&&n.substring(n.length-1,1)==="'"&&(n=n.substring(1,n.length-1))}else r=s;if(r.indexOf(":")===-1){const E=parseInt(r.replace(/[^0-9]/g,""),10)-1,R=m.ABCatNum(r.replace(/[^A-Za-z]/g,""));return!Number.isNaN(E)&&!Number.isNaN(R)?{sheetId:n,range:{startRow:E,endRow:E,startColumn:R,endColumn:R}}:Rt}r=r.split(":");const i=[0,0],o=[0,0],a=((u=this.getSheetBySheetName(n))==null?void 0:u.getMaxRows())||((h=this.getActiveSheet())==null?void 0:h.getMaxRows()),c=((f=this.getSheetBySheetName(n))==null?void 0:f.getMaxColumns())||((_=this.getActiveSheet())==null?void 0:_.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]=m.ABCatNum(r[0].replace(/[^A-Za-z]/g,"")),o[1]=m.ABCatNum(r[1].replace(/[^A-Za-z]/g,"")),Number.isNaN(o[0])&&(o[0]=0),Number.isNaN(o[1])&&(o[1]=c),o[0]>o[1])?Rt:{sheetId:((g=this.getSheetBySheetName(n))==null?void 0:g.getSheetId())||"",range:{startRow:i[0],endRow:i[1],startColumn:o[0],endColumn:o[1]}}}_getDefaultWorkSheet(){const{_snapshot:s,_worksheets:n}=this,{sheets:r,sheetOrder:i}=s;m.isEmptyObject(r)&&(r[kt.id]=Object.assign(kt,{status:I.TRUE}));for(const o in r){const a=r[o];a.name=this._genName.sheetName(a.name);const c=new Nt(a,this._styles);n.set(o,c),i.includes(o)||i.push(o)}}};exports.Workbook=Yi([Ki(1,C.Inject(C.Injector))],exports.Workbook);class Te{constructor(e){d(this,"_snapshot");d(this,"_unitId");this._snapshot={...Pn,...e},this._unitId=this._snapshot.id??m.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 s=this.getPages();return s==null?void 0:s[e]}getElementsByPage(e){var s;return(s=this.getPage(e))==null?void 0:s.pageElements}getElement(e,s){var n;return(n=this.getElementsByPage(e))==null?void 0:n[s]}getPageSize(){return this._snapshot.pageSize}addPage(){return{id:"cover_1",pageType:De.SLIDE,zIndex:1,title:"cover",description:"this is first page, cover",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}}const de="FOCUSING_SHEET",_e="FOCUSING_DOC",fe="FOCUSING_SLIDE",Qi="FOCUSING_EDITOR_BUT_HIDDEN",Wn="FOCUSING_EDITOR",Zi="FOCUSING_EDITOR_INPUT_FORMULA",Gn="FOCUSING_FORMULA_EDITOR";var qi=Object.defineProperty,Ji=Object.getOwnPropertyDescriptor,yi=(t,e,s,n)=>{for(var r=n>1?void 0:n?Ji(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&qi(e,s,r),r},to=(t,e)=>(s,n)=>e(s,n,t),$n=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.DOC=1]="DOC",t[t.SHEET=2]="SHEET",t[t.SLIDE=3]="SLIDE",t))($n||{});const ft=C.createIdentifier("univer.current");let ge=class extends M{constructor(e,s){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=s}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,s){const n=this._docs.find(r=>r.getUnitId()===e);if(n!=null){const r=this._docs.indexOf(n);this._docs.splice(r,1)}this.addDoc(s)}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(s=>s.getUnitId()===e)}getUniverDocInstance(e){return this._docs.find(s=>s.getUnitId()===e)}getUniverSlideInstance(e){return this._slides.find(s=>s.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),[_e,de,fe].forEach(s=>this._contextService.setContextValue(s,!1)),this._focused instanceof exports.Workbook?this._contextService.setContextValue(de,!0):this._focused instanceof dt?this._contextService.setContextValue(_e,!0):this._focused instanceof Te&&this._contextService.setContextValue(fe,!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 s=this.getUniverDocInstance(e);if(s){const i=this._docs.indexOf(s);return this._docs.splice(i,1),this._docDisposed$.next(s),this.focusUniverInstance(null),!0}const n=this.getUniverSheetInstance(e);if(n){const i=this._sheets.indexOf(n);return this._sheets.splice(i,1),this._sheetDisposed$.next(n),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}};ge=yi([to(1,ct)],ge);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 Ve={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"},Mt=new Map;function Ue(t,e){return function(r){Me(t,e)}}function Me(t,e){Mt.has(t)||Mt.set(t,[]),Mt.get(t).push(e)}var eo=Object.defineProperty,so=Object.getOwnPropertyDescriptor,kn=(t,e,s,n)=>{for(var r=n>1?void 0:n?so(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&eo(e,s,r),r},Ee=(t,e)=>(s,n)=>e(s,n,t);exports.LifecycleService=class extends M{constructor(s){super();d(this,"_lifecycle$",new N.BehaviorSubject(w.Starting));d(this,"lifecycle$",this._lifecycle$.asObservable());this._logService=s,this._logService.log("[LifecycleService]",`lifecycle progressed to "${Ve[w.Starting]}".`)}get stage(){return this._lifecycle$.getValue()}set stage(s){if(s<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");s!==this.stage&&(this._logService.log("[LifecycleService]",`lifecycle progressed to "${Ve[s]}".`),this._lifecycle$.next(s))}subscribeWithPrevious(){return new N.Observable(s=>(this.stage===w.Starting||(this.stage===w.Ready?s.next(w.Starting):this.stage===w.Rendered?(s.next(w.Starting),s.next(w.Ready)):(s.next(w.Starting),s.next(w.Ready),s.next(w.Rendered))),this._lifecycle$.subscribe(s)))}};exports.LifecycleService=kn([Ee(0,ht)],exports.LifecycleService);let et=class extends M{constructor(e,s){super();d(this,"_started",!1);this._lifecycleService=e,this._injector=s}start(){this._started||(this._started=!0,this.disposeWithMe(v(this._lifecycleService.subscribeWithPrevious().subscribe(e=>this.initModulesOnStage(e)))))}initModulesOnStage(e){const s=Mt.get(e);s==null||s.forEach(n=>{this._injector.has(n)&&this._injector.get(n)})}};et=kn([Ee(0,C.Inject(exports.LifecycleService)),Ee(1,C.Inject(C.Injector))],et);function no(t,e){if(t)try{return t[e]?t[e]:e.split(".").reduce((s,n)=>s[n],t)}catch{return console.warn("Key %s not found",e),e}}class mt extends M{constructor(){super();d(this,"currentLocale",Yt.ZH_CN);d(this,"locales",null);d(this,"localeChanged$",new N.Subject);d(this,"t",s=>{if(!this.locales)throw new Error("Locale not initialized");return no(this.locales[this.currentLocale],s)??s});this.disposeWithMe(v(()=>this.localeChanged$.complete()))}load(s){this.locales=m.deepMerge(this.locales??{},s)}setLocale(s){this.currentLocale=s,this.localeChanged$.next()}getLocales(){var s;return(s=this.locales)==null?void 0:s[this.currentLocale]}getCurrentLocale(){return this.currentLocale}}const Pe=C.createIdentifier("resource-manager-service"),Vn=C.createIdentifier("ResourcePersistenceService");Me(w.Ready,Vn);var ro=Object.defineProperty,io=Object.getOwnPropertyDescriptor,oo=(t,e,s,n)=>{for(var r=n>1?void 0:n?io(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&ro(e,s,r),r},je=(t,e)=>(s,n)=>e(s,n,t);const xe=C.createIdentifier("univer.permission-service"),ze="PERMISSION";exports.PermissionService=class extends M{constructor(s,n){super();d(this,"_permissionPointMap",new Map);d(this,"deletePermissionPoint",(s,n)=>{const r=this._permissionPointMap.get(s);if(r){const i=r.get(n);i&&(i.complete(),this._permissionPointMap.delete(n))}});d(this,"addPermissionPoint",(s,n)=>{const r=this._permissionPointMap.get(s)||new Map;return r.has(n.id)?!1:(r.set(n.id,new N.BehaviorSubject(n)),this._permissionPointMap.set(s,r),!0)});d(this,"updatePermissionPoint",(s,n,r)=>{const i=this._permissionPointMap.get(s);if(!i)return;const o=i.get(n);if(o){const a=o.getValue();a.value=r,a.status=Ne.DONE,o.next(a)}});d(this,"getPermissionPoint",(s,n)=>{const r=this._permissionPointMap.get(s);if(!r)return;const i=r.get(n);if(i)return i.getValue()});this._resourceManagerService=s,this._univerInstanceService=n}_init(){this.disposeWithMe(v(this._univerInstanceService.sheetAdded$.subscribe(s=>{this._resourceManagerService.registerPluginResource(s.getUnitId(),ze,{onChange:(n,r)=>{r.forEach(i=>{this.getPermissionPoint(n,i.id)?this.updatePermissionPoint(n,i.id,i.value):this.addPermissionPoint(n,i)})},toJson:n=>this._toJson(n),parseJson:n=>this._parseJson(n)})}))),this.disposeWithMe(v(this._univerInstanceService.sheetDisposed$.subscribe(s=>{this._resourceManagerService.disposePluginResource(s.getUnitId(),ze)})))}_toJson(s){const n=this._permissionPointMap.get(s);let r=[];return n&&(r=[...n.keys()].reduce((i,o)=>{const a=n.get(o);return a&&i.push(a.getValue()),i},[])),JSON.stringify(r)}_parseJson(s){return JSON.parse(s)}composePermission$(s,n){const r=this._permissionPointMap.get(s),i=n.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(sr.map(o=>(o.every(a=>this._permissionPointMap.get(a.id)),o)))}composePermission(s,n){const r=this._permissionPointMap.get(s);return n.map(o=>{const a=r==null?void 0:r.get(o);if(!a)throw new Error(`${o} permissionPoint is not exist`);return a.getValue()})}};exports.PermissionService=oo([Ue(w.Starting,exports.PermissionService),je(0,C.Inject(Pe)),je(1,C.Inject(ft))],exports.PermissionService);const jn="univer.editable";class Pt extends Gs{constructor(s){super();d(this,"id",jn);d(this,"value",!0);d(this,"unitID");this.unitID=s}}var ao=Object.defineProperty,lo=Object.getOwnPropertyDescriptor,uo=(t,e,s,n)=>{for(var r=n>1?void 0:n?lo(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&ao(e,s,r),r},Ye=(t,e)=>(s,n)=>e(s,n,t);exports.UniverPermissionService=class extends M{constructor(e,s){super(),this._permissionService=e,this._univerInstanceService=s,this._init()}_init(){this._univerInstanceService.sheetAdded$.subscribe(e=>{const s=new Pt(e.getUnitId());this._permissionService.addPermissionPoint(e.getUnitId(),s)})}getEditable(e){let s=e;s||(s=this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId());const n=new Pt(s),r=this._permissionService.getPermissionPoint(s,n.id);return r==null?void 0:r.value}setEditable(e,s){const n=new Pt(e);this._permissionService.updatePermissionPoint(e,n.id,s)}};exports.UniverPermissionService=uo([Ue(w.Starting,exports.UniverPermissionService),Ye(0,C.Inject(xe)),Ye(1,C.Inject(ft))],exports.UniverPermissionService);class zn extends M{constructor(){super(...arguments);d(this,"_resourceMap",new Map);d(this,"_register$",new N.Subject);d(this,"register$",this._register$.asObservable())}getAllResource(s){const n=this._resourceMap.get(s);return n?[...n.keys()].reduce((r,i)=>{const o=n.get(i);return o&&r.push({unitID:s,resourceName:i,hook:o}),r},[]):[]}registerPluginResource(s,n,r){const i=this._resourceMap.get(s)||new Map;if(i.has(n))throw new Error("the pluginName is registered");return i.set(n,r),this._resourceMap.set(s,i),this._register$.next({unitID:s,resourceName:n,hook:r}),v(()=>i.delete(n))}disposePluginResource(s,n){const r=this._resourceMap.get(s);r==null||r.delete(n)}dispose(){this._register$.complete(),this._resourceMap.clear()}}class Re extends M{constructor(){super();d(this,"_currentTheme");d(this,"_currentTheme$",new N.BehaviorSubject({}));d(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(v(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(s){this._currentTheme=s,this._currentTheme$.next(s)}}const Yn="__defaultDocumentNormalEditorSpecialUnitId_20231006__",Kn="__defaultDocumentFormulaBarEditorSpecialUnitId_20231012__",co=`\r
|
|
11
|
-
`;var ho=Object.defineProperty,_o=Object.getOwnPropertyDescriptor,fo=(t,e,s,n)=>{for(var r=n>1?void 0:n?_o(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&ho(e,s,r),r},se=(t,e)=>(s,n)=>e(s,n,t);const Qt=C.createIdentifier("univer.undo-redo.service"),go=20;exports.LocalUndoRedoService=class extends M{constructor(s,n,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=s,this._commandService=n,this._contextService=r,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(Qn)),this.disposeWithMe(this._commandService.registerCommand(Zn)),this.disposeWithMe(v(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(v(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(s){const{unitID:n}=s,r=this._getRedoStack(n,!0),i=this._getUndoStack(n,!0);r.length=0,i.push(s),i.length>go&&i.splice(0,1),this._updateStatus()}clearUndoRedo(s){const n=this._getRedoStack(s);n&&(n.length=0);const r=this._getUndoStack(s);r&&(r.length=0),this._updateStatus()}pitchTopUndoElement(){const s=this._getUndoStackForFocused();return s.length?s[s.length-1]:null}pitchTopRedoElement(){const s=this._getRedoStackForFocused();return s.length?s[s.length-1]:null}popUndoToRedo(){const n=this._getUndoStackForFocused().pop();n&&(this._getRedoStackForFocused().push(n),this._updateStatus())}popRedoToUndo(){const n=this._getRedoStackForFocused().pop();n&&(this._getUndoStackForFocused().push(n),this._updateStatus())}_updateStatus(){var i,o;const s=this._getFocusedUniverInstanceId(),n=s&&((i=this._undoStacks.get(s))==null?void 0:i.length)||0,r=s&&((o=this._redoStacks.get(s))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:n,redos:r})}_getUndoStack(s,n=!1){let r=this._undoStacks.get(s);return!r&&n&&(r=[],this._undoStacks.set(s,r)),r||null}_getRedoStack(s,n=!1){let r=this._redoStacks.get(s);return!r&&n&&(r=[],this._redoStacks.set(s,r)),r||null}_getUndoStackForFocused(){const s=this._getFocusedUniverInstanceId();if(!s)throw new Error("No focused univer instance!");return this._getUndoStack(s,!0)}_getRedoStackForFocused(){const s=this._getFocusedUniverInstanceId();if(!s)throw new Error("No focused univer instance!");return this._getRedoStack(s,!0)}_getFocusedUniverInstanceId(){var n;let s="";return this._contextService.getContextValue(Gn)?s=Kn:this._contextService.getContextValue(Wn)?s=Yn:s=((n=this._univerInstanceService.getFocusedUniverInstance())==null?void 0:n.getUnitId())??"",s}};exports.LocalUndoRedoService=fo([se(0,ft),se(1,bt),se(2,ct)],exports.LocalUndoRedoService);class Xn{dispose(){}async dispatchToHandlers(){return!1}}const Qn=new class extends Xn{constructor(){super(...arguments);d(this,"type",zt.COMMAND);d(this,"id","univer.command.undo")}async handler(e){const s=e.get(Qt),n=s.pitchTopUndoElement();if(!n)return!1;const r=e.get(bt);return(n.undo?await n.undo(n.undoMutations):Ae(n.undoMutations,r))?(s.popUndoToRedo(),!0):!1}},Zn=new class extends Xn{constructor(){super(...arguments);d(this,"type",zt.COMMAND);d(this,"id","univer.command.redo")}async handler(e){const s=e.get(Qt),n=s.pitchTopRedoElement();if(!n)return!1;const r=e.get(bt);return(n.redo?await n.redo(n.redoMutations):Ae(n.redoMutations,r))?(s.popRedoToUndo(),!0):!1}};class Zt extends M{constructor(){super(...arguments);d(this,"_started",!1)}addPlugins(s){if(this._started){const n=s.map(([r,i])=>this._initPlugin(r,i));this._pluginsRunLifecycle(n,w.Starting),setTimeout(()=>this._takePluginsThroughLifecycle(n))}else{const n=s.map(([r,i])=>this._initPlugin(r,i));this._takePluginsThroughLifecycle(n),this._started=!0}}_takePluginsThroughLifecycle(s,n=!1){this.disposeWithMe(v(this._lifecycleService.subscribeWithPrevious().subscribe(r=>{n&&r===w.Starting||this._pluginsRunLifecycle(s,r)})))}_pluginsRunLifecycle(s,n){s.forEach(r=>{switch(n){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(n)}_initPlugin(s,n){return this._injector.createInstance(s,n)}}var Eo=Object.defineProperty,Ro=Object.getOwnPropertyDescriptor,mo=(t,e,s,n)=>{for(var r=n>1?void 0:n?Ro(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&Eo(e,s,r),r},ne=(t,e)=>(s,n)=>e(s,n,t);exports.UniverDoc=class extends Zt{constructor(e,s,n){super(),this._injector=e,this._lifecycleService=s,this._lifecycleInitializerService=n}createDoc(e){return this._injector.createInstance(dt,e)}};exports.UniverDoc=mo([ne(0,C.Inject(C.Injector)),ne(1,C.Inject(exports.LifecycleService)),ne(2,C.Inject(et))],exports.UniverDoc);var Oo=Object.defineProperty,Ao=Object.getOwnPropertyDescriptor,Io=(t,e,s,n)=>{for(var r=n>1?void 0:n?Ao(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&Oo(e,s,r),r},re=(t,e)=>(s,n)=>e(s,n,t);exports.UniverSheet=class extends Zt{constructor(e,s,n){super(),this._injector=e,this._lifecycleService=s,this._lifecycleInitializerService=n}createSheet(e){return this._injector.createInstance(exports.Workbook,e)}};exports.UniverSheet=Io([re(0,C.Inject(C.Injector)),re(1,C.Inject(exports.LifecycleService)),re(2,C.Inject(et))],exports.UniverSheet);var Co=Object.defineProperty,So=Object.getOwnPropertyDescriptor,No=(t,e,s,n)=>{for(var r=n>1?void 0:n?So(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&Co(e,s,r),r},ie=(t,e)=>(s,n)=>e(s,n,t);exports.UniverSlide=class extends Zt{constructor(e,s,n){super(),this._injector=e,this._lifecycleService=s,this._lifecycleInitializerService=n}createSlide(e){return this._injector.createInstance(Te,e)}};exports.UniverSlide=No([ie(0,C.Inject(C.Injector)),ie(1,C.Inject(exports.LifecycleService)),ie(2,C.Inject(et))],exports.UniverSlide);const bo=200;class Lo extends Zt{constructor(s={}){super();d(this,"_injector");d(this,"_univerPluginStore",new ir);d(this,"_univerPluginRegistry",new or);d(this,"_univerSheet",null);d(this,"_univerDoc",null);d(this,"_univerSlide",null);d(this,"_initLazyPluginsTimer");this._injector=this._initDependencies();const{theme:n,locale:r,locales:i,logLevel:o}=s;n&&this._injector.get(Re).setTheme(n),i&&this._injector.get(mt).load(i),r&&this._injector.get(mt).setLocale(r),o&&this._injector.get(ht).setLogLevel(o)}get _univerInstanceService(){return this._injector.get(ft)}get _lifecycleService(){return this._injector.get(exports.LifecycleService)}get _lifecycleInitializerService(){return this._injector.get(et)}__getInjector(){return this._injector}dispose(){this._injector.dispose()}setLocale(s){this._injector.get(mt).setLocale(s)}createUniverSheet(s){let n;const r=()=>{n=this._univerSheet.createSheet(s),this._univerInstanceService.addSheet(n)};if(this._univerSheet)r();else{this._tryProgressToStart();const i=this._univerSheet=this._injector.createInstance(exports.UniverSheet),o=this._univerPluginRegistry.getRegisterPlugins(D.Sheet).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(D.Sheet),i.addPlugins(o),r(),this._tryProgressToReady()}return n}createUniverDoc(s){let n;const r=()=>{n=this._univerDoc.createDoc(s),this._univerInstanceService.addDoc(n)};if(this._univerDoc)r();else{this._tryProgressToStart();const i=this._univerDoc=this._injector.createInstance(exports.UniverDoc),o=this._univerPluginRegistry.getRegisterPlugins(D.Doc).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(D.Doc),i.addPlugins(o),r(),this._tryProgressToReady()}return n}createUniverSlide(s){let n;const r=()=>{n=this._univerSlide.createSlide(s),this._univerInstanceService.addSlide(n)};if(this._univerSlide)r();else{this._tryProgressToStart();const i=this._univerSlide=this._injector.createInstance(exports.UniverSlide),o=this._univerPluginRegistry.getRegisterPlugins(D.Slide).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(D.Slide),i.addPlugins(o),r(),this._tryProgressToReady()}return n}_initDependencies(){return new C.Injector([[ft,{useFactory:s=>new ge({createUniverDoc:n=>this.createUniverDoc(n),createUniverSheet:n=>this.createUniverSheet(n),createUniverSlide:n=>this.createUniverSlide(n)},s),deps:[ct]}],[os],[mt],[Re],[exports.LifecycleService],[et],[xe,{useClass:exports.PermissionService}],[exports.UniverPermissionService],[ht,{useClass:rs,lazy:!0}],[bt,{useClass:exports.CommandService,lazy:!0}],[Qt,{useClass:exports.LocalUndoRedoService,lazy:!0}],[is,{useClass:Or}],[ct,{useClass:ss}],[ls,{useClass:as,lazy:!0}],[Pe,{useClass:zn,lazy:!0}]])}_tryProgressToStart(){this._started||(this._injector.get(et).start(),this._started=!0)}_tryProgressToReady(){this._injector.get(exports.LifecycleService).stage<w.Ready&&(this._injector.get(exports.LifecycleService).stage=w.Ready,this._univerPluginStore.forEachPlugin(n=>n.onReady()))}registerPlugin(s,n){if(s.type===D.Univer)this._registerUniverPlugin(s,n);else if(s.type===D.Sheet)this._registerSheetsPlugin(s,n);else if(s.type===D.Doc)this._registerDocsPlugin(s,n);else if(s.type===D.Slide)this._registerSlidesPlugin(s,n);else throw new Error(`Unimplemented plugin system for business: "${s.type}".`);if(this._started)return this._scheduleInitPluginAfterStarted()}_scheduleInitPluginAfterStarted(){this._initLazyPluginsTimer===void 0&&(this._initLazyPluginsTimer=setTimeout(()=>this._flushLazyPlugins(),bo))}_flushLazyPlugins(){this._initLazyPluginsTimer=void 0;const s=this._univerPluginRegistry.getRegisterPlugins(D.Univer);if(s.length){this._univerPluginRegistry.clearPluginsOfType(D.Univer);const n=s.map(r=>this._injector.createInstance(r.plugin,r.options));this._takePluginsThroughLifecycle(n)}if(this._univerSheet){const n=this._univerPluginRegistry.getRegisterPlugins(D.Sheet).map(r=>[r.plugin,r.options]);n.length&&(this._univerSheet.addPlugins(n),this._univerPluginRegistry.clearPluginsOfType(D.Sheet))}if(this._univerDoc){const n=this._univerPluginRegistry.getRegisterPlugins(D.Doc).map(r=>[r.plugin,r.options]);n.length&&(this._univerDoc.addPlugins(n),this._univerPluginRegistry.clearPluginsOfType(D.Doc))}if(this._univerSlide){const n=this._univerPluginRegistry.getRegisterPlugins(D.Slide).map(r=>[r.plugin,r.options]);n.length&&(this._univerSlide.addPlugins(n),this._univerPluginRegistry.clearPluginsOfType(D.Slide))}}_registerUniverPlugin(s,n){if(this._started)this._univerPluginRegistry.registerPlugin(s,n);else{const r=this._injector.createInstance(s,n);r.onStarting(this._injector),this._univerPluginStore.addPlugin(r)}}_registerSheetsPlugin(s,n){this._univerPluginRegistry.registerPlugin(s,n)}_registerDocsPlugin(s,n){this._univerPluginRegistry.registerPlugin(s,n)}_registerSlidesPlugin(s,n){this._univerPluginRegistry.registerPlugin(s,n)}}function wo(t){const e=new MessageChannel;let s=!1;return e.port1.onmessage=()=>{s||t()},e.port2.postMessage(null),()=>{s=!0}}class vo extends jt{add(e){if(!e)return null;const s=new Vt(e,this);return this._observers=[s],this._onObserverAdded&&this._onObserverAdded(s),s}makeObserverTopPriority(){}makeObserverBottomPriority(){}}const Do=C.createIdentifier("ILocalStorageService"),To=t=>`sheet_interceptor_${t}`,qn=t=>function(e,s){let n=-1;function r(i,o){if(i<=n)throw new Error("[SheetInterceptorService]: next() called multiple times!");return n=i,i===t.length?o:t[i].handler(o,s,r.bind(null,i+1))}return r(0,e)};class Uo{constructor(e){d(this,"_interceptorsByName",new Map);d(this,"_interceptorPoints");this._interceptorPoints=e}fetchThroughInterceptors(e){const s=e,n=this._interceptorsByName.get(s);return qn(n||[])}intercept(e,s){const n=e;this._interceptorsByName.has(n)||this._interceptorsByName.set(n,[]);const r=this._interceptorsByName.get(n);return r.push(s),this._interceptorsByName.set(n,r.sort((i,o)=>(o.priority??0)-(i.priority??0))),()=>tt(this._interceptorsByName.get(n),s)}getInterceptPoints(){return this._interceptorPoints}}const Ke=`'?\\[((?![\\/?:"<>|*\\\\]).)*\\]`,Mo=/[^0-9]/g,Po=/[^A-Za-z]/g;function Ct(t){const e=t[0]==="$",n=t.substring(1).indexOf("$")>-1;return e&&n?z.ALL:e?z.COLUMN:n?z.ROW:z.NONE}function xo(t){const e=t.split("!");e.length>1&&(t=e[e.length-1]);const s=t.split(":");return s.length>1?{startAbsoluteRefType:Ct(s[0]),endAbsoluteRefType:Ct(s[1])}:{startAbsoluteRefType:Ct(s[0])}}function Xe(t=z.NONE){let e="",s="";return t===z.ROW?e="$":t===z.COLUMN?s="$":t===z.ALL&&(e="$",s="$"),{rowAbsoluteString:e,columnAbsoluteString:s}}function qt(t){const{startColumn:e,startRow:s,endColumn:n,endRow:r,startAbsoluteRefType:i,endAbsoluteRefType:o}=t,a=Xe(i),c=Xe(o),l=`${a.columnAbsoluteString}${m.chatAtABC(e)}${a.rowAbsoluteString}${s+1}`,u=`${c.columnAbsoluteString}${m.chatAtABC(n)}${c.rowAbsoluteString}${r+1}`;return l===u?l:`${l}:${u}`}function Jn(t,e){return`${t}!${qt(e)}`}function yn(t,e,s){return`[${t}]${e}!${qt(s)}`}function po(t){const{unitId:e,sheetName:s,range:n}=t;return e!=null&&e.length>0&&s!=null&&s.length>0?yn(e,s,n):s!=null&&s.length>0?Jn(s,n):qt(n)}function oe(t){const e=parseInt(t.replace(Mo,""))-1,s=m.ABCatNum(t.replace(Po,"")),n=Ct(t);return{row:e,column:s,absoluteRefType:n}}function Fo(t){const e=new RegExp(Ke).exec(t);let s="";e!=null&&(s=e[0],t=t.replace(new RegExp(Ke,"g"),""));const n=t.indexOf("!");let r="",i="";n>-1?(r=t.substring(0,n),i=t.substring(n)):i=t;const o=i.indexOf(":");if(o===-1){const E=oe(i),R=E.row,O=E.column,A=E.absoluteRefType;return{unitId:s,sheetName:r,range:{startRow:R,startColumn:O,endRow:R,endColumn:O,startAbsoluteRefType:A,endAbsoluteRefType:A}}}const a=i.substring(0,o),c=i.substring(o+1),l=oe(a),u=oe(c),h=l.row,f=l.column,_=u.row,g=u.column;return{unitId:s,sheetName:r,range:{startRow:h,startColumn:f,endRow:_,endColumn:g,startAbsoluteRefType:l.absoluteRefType,endAbsoluteRefType:u.absoluteRefType}}}nr();exports.ABCToNumber=Ei;exports.ACTION_NAMES=bn;exports.AbsoluteRefType=z;exports.AlignTypeH=In;exports.AlignTypeV=Cn;exports.AutoFillSeries=ds;exports.BaselineOffset=Ft;exports.BlockType=sn;exports.BooleanNumber=I;exports.BorderStyleTypes=b;exports.BorderType=_s;exports.BulletAlignment=q;exports.COLORS=ae;exports.CellValueType=At;exports.Color=it;exports.ColorBuilder=Xt;exports.ColorKit=$;exports.ColorType=W;exports.ColumnSeparatorType=on;exports.CommandType=zt;exports.CommonHideTypes=fs;exports.ConditionType=gs;exports.ContentAlignment=En;exports.ContextService=ss;exports.CopyPasteType=Es;exports.CustomRangeType=en;exports.DEFAULT_CELL=Bi;exports.DEFAULT_DOC=ve;exports.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=Ar;exports.DEFAULT_EMPTY_DOCUMENT_VALUE=co;exports.DEFAULT_RANGE=Fi;exports.DEFAULT_RANGE_ARRAY=Rt;exports.DEFAULT_SELECTION=Hi;exports.DEFAULT_SLIDE=Pn;exports.DEFAULT_STYLES=Ut;exports.DEFAULT_WORKBOOK=Ln;exports.DEFAULT_WORKSHEET=kt;exports.DEFAULT_WORKSHEET_COLUMN_COUNT=vn;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Mn;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH=Tn;exports.DEFAULT_WORKSHEET_ROW_COUNT=wn;exports.DEFAULT_WORKSHEET_ROW_HEIGHT=Dn;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Un;exports.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=Kn;exports.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=Yn;exports.DashStyleType=_n;exports.DataStreamTreeNodeType=Vs;exports.DataStreamTreeTokenType=be;exports.DesktopLogService=rs;exports.DeveloperMetadataVisibility=Rs;exports.Dimension=ms;exports.Direction=Os;exports.Disposable=M;exports.DisposableCollection=es;exports.DocStyleType=ys;exports.DocumentDataModel=dt;exports.DocumentType=$n;exports.EXTENSION_NAMES=xn;exports.Entry=ue;exports.EntryIterator=Bs;exports.ErrorService=os;exports.EventState=ye;exports.FOCUSING_DOC=_e;exports.FOCUSING_EDITOR=Wn;exports.FOCUSING_EDITOR_BUT_HIDDEN=Qi;exports.FOCUSING_EDITOR_INPUT_FORMULA=Zi;exports.FOCUSING_FORMULA_EDITOR=Gn;exports.FOCUSING_SHEET=de;exports.FOCUSING_SLIDE=fe;exports.FloatingObjectManagerService=as;exports.FollowNumberWithType=tn;exports.FontItalic=xt;exports.FontStyleType=Rn;exports.FontWeight=pt;exports.FormatType=As;exports.GenName=Ps;exports.GlyphType=It;exports.GridType=nn;exports.HLSColor=ws;exports.HorizontalAlign=rt;exports.ICommandService=bt;exports.IConfigService=is;exports.IContextService=ct;exports.IFloatingObjectManagerService=ls;exports.ILocalStorageService=Do;exports.ILogService=ht;exports.IPermissionService=xe;exports.IResourceManagerService=Pe;exports.ISnapshotPersistenceService=Vn;exports.IUndoRedoService=Qt;exports.IUniverInstanceService=ft;exports.InterceptorManager=Uo;exports.InterpolationPointType=Is;exports.KeyIterator=Fs;exports.LRUHelper=Et;exports.LRUMap=Ws;exports.LifecycleStages=w;exports.LocaleService=mt;exports.LocaleType=Yt;exports.LogLevel=ns;exports.MemoryCursor=us;exports.NamedStyleType=hn;exports.NumberUnitType=An;exports.ObjectMatrix=V;exports.ObjectRelativeFromH=mn;exports.ObjectRelativeFromV=On;exports.Observable=jt;exports.ObservableHooks=vo;exports.Observer=Vt;exports.OnLifecycle=Ue;exports.PRESET_LIST_TYPE=Li;exports.PageElementType=Fn;exports.PageOrientType=Nn;exports.PageType=De;exports.ParagraphElementType=ln;exports.PermissionPoint=Gs;exports.PermissionStatus=Ne;exports.Plugin=Qe;exports.PluginType=D;exports.PositionedObjectLayoutType=cn;exports.PresetListType=$t;exports.ProtectionType=Cs;exports.RANGE_TYPE=j;exports.RGBA_PAREN=br;exports.RGB_PAREN=Nr;exports.Range=_t;exports.Rectangle=ut;exports.RedoCommand=Zn;exports.RefAlias=gi;exports.Registry=me;exports.RegistryAsMap=Oe;exports.RelativeDate=Ss;exports.RelativeSlideLink=Hn;exports.ResourceManagerService=zn;exports.RgbColor=Ht;exports.RxDisposable=dr;exports.SectionType=rn;exports.ShapeType=Ns;exports.SheetTypes=Ie;exports.SheetViewModel=Bn;exports.Slide=Te;exports.SpacingRule=dn;exports.Styles=pn;exports.THEME_COLORS=Ls;exports.TabStopAlignment=fn;exports.TextDecoration=bs;exports.TextDirection=St;exports.TextDirectionType=an;exports.ThemeColor=Bt;exports.ThemeColorType=p;exports.ThemeColors=Kt;exports.ThemeService=Re;exports.Tools=m;exports.UndoCommand=Qn;exports.Univer=Lo;exports.UniverEditablePermission=Pt;exports.UniverEditablePermissionPoint=jn;exports.UpdateDocsAttributeType=P;exports.ValueIterator=Hs;exports.VerticalAlign=at;exports.WidthType=gn;exports.Worksheet=Nt;exports.WrapStrategy=lt;exports.WrapTextType=un;exports.binarySearchArray=cs;exports.characterSpacingControlType=Sn;exports.checkParagraphHasBullet=Qr;exports.checkParagraphHasIndent=Zr;exports.checkParagraphHasIndentByStyle=Ts;exports.codeToBlob=Cr;exports.composeInterceptors=qn;exports.concatMatrixArray=ui;exports.createInterceptorKey=To;exports.createRowColIter=he;exports.datenum_local=ps;exports.dedupe=ar;exports.deepCompare=Ce;exports.deleteContent=Ms;exports.deserializeRangeWithSheet=Fo;exports.error=le;exports.fromObservable=hr;exports.generate=ii;exports.getAbsoluteRefTypeWitString=xo;exports.getAbsoluteRefTypeWithSingleString=Ct;exports.getArrayLength=Y;exports.getBorderStyleType=Kr;exports.getCellValueType=Gi;exports.getColorStyle=k;exports.getDocsUpdateBody=Tt;exports.getReverseDirection=Sr;exports.getTypeFromPermissionItemList=_i;exports.getWorksheetUID=Xi;exports.handleJsonToDom=zr;exports.handleStyleToString=Yr;exports.hashAlgorithm=ai;exports.horizontalLineSegmentsSubtraction=Se;exports.insertMatrixArray=li;exports.insertTextToContent=Us;exports.isEmptyCell=kr;exports.isFormulaId=jr;exports.isFormulaString=Vr;exports.isICellData=Wi;exports.isNullCell=$i;exports.isObserver=ts;exports.isRealNum=nt;exports.isSameStyleTextRun=Ds;exports.isValidRange=Xr;exports.makeCellRangeToRangeData=$r;exports.makeCellToSelection=Gr;exports.moveMatrixArray=ce;exports.numberToABC=mi;exports.numberToListABC=Oi;exports.orderSearchArray=hs;exports.remove=tt;exports.repeatStringNumTimes=ks;exports.requestImmediateMacroTask=wo;exports.runOnLifecycle=Me;exports.searchArray=Ir;exports.selectionToArray=fi;exports.sequence=qe;exports.sequenceAsync=Ze;exports.sequenceExecute=Ae;exports.sequenceExecuteAsync=mr;exports.serializeRange=qt;exports.serializeRangeToRefString=po;exports.serializeRangeWithSheet=Jn;exports.serializeRangeWithSpreadsheet=yn;exports.sliceMatrixArray=ci;exports.sortRules=Ai;exports.sortRulesByDesc=Ii;exports.sortRulesFactory=gt;exports.toDisposable=v;exports.update=oi;
|
|
9
|
+
*/(function(t){(function(e,s){t.exports?t.exports=s():e.numeral=s()})(qn,function(){var e,s,r="2.0.6",n={},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 c(l,u){this._input=l,this._value=u}return e=function(l){var u,h,f,_;if(e.isNumeral(l))u=l.value();else if(l===0||typeof l>"u")u=0;else if(l===null||s.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(h in n)if(_=typeof n[h].regexps.unformat=="function"?n[h].regexps.unformat():n[h].regexps.unformat,_&&l.match(_)){f=n[h].unformat;break}f=f||e._.stringToNumber,u=f(l)}else u=Number(l)||null;return new c(l,u)},e.version=r,e.isNumeral=function(l){return l instanceof c},e._=s={numberToFormat:function(l,u,h){var f=i[e.options.currentLocale],_=!1,g=!1,E=0,R="",O=1e12,A=1e9,L=1e6,F=1e3,x="",at=!1,H,X,U,$,yt,pe,K;if(l=l||0,X=Math.abs(l),e._.includes(u,"(")?(_=!0,u=u.replace(/[\(|\)]/g,"")):(e._.includes(u,"+")||e._.includes(u,"-"))&&(yt=e._.includes(u,"+")?u.indexOf("+"):l<0?u.indexOf("-"):-1,u=u.replace(/[\+|\-]/g,"")),e._.includes(u,"a")&&(H=u.match(/a(k|m|b|t)?/),H=H?H[1]:!1,e._.includes(u," a")&&(R=" "),u=u.replace(new RegExp(R+"a[kmbt]?"),""),X>=O&&!H||H==="t"?(R+=f.abbreviations.trillion,l=l/O):X<O&&X>=A&&!H||H==="b"?(R+=f.abbreviations.billion,l=l/A):X<A&&X>=L&&!H||H==="m"?(R+=f.abbreviations.million,l=l/L):(X<L&&X>=F&&!H||H==="k")&&(R+=f.abbreviations.thousand,l=l/F)),e._.includes(u,"[.]")&&(g=!0,u=u.replace("[.]",".")),U=l.toString().split(".")[0],$=u.split(".")[1],pe=u.indexOf(","),E=(u.split(".")[0].split(",")[0].match(/0/g)||[]).length,$?(e._.includes($,"[")?($=$.replace("]",""),$=$.split("["),x=e._.toFixed(l,$[0].length+$[1].length,h,$[1].length)):x=e._.toFixed(l,$.length,h),U=x.split(".")[0],e._.includes(x,".")?x=f.delimiters.decimal+x.split(".")[1]:x="",g&&Number(x.slice(1))===0&&(x="")):U=e._.toFixed(l,0,h),R&&!H&&Number(U)>=1e3&&R!==f.abbreviations.trillion)switch(U=String(Number(U)/1e3),R){case f.abbreviations.thousand:R=f.abbreviations.million;break;case f.abbreviations.million:R=f.abbreviations.billion;break;case f.abbreviations.billion:R=f.abbreviations.trillion;break}if(e._.includes(U,"-")&&(U=U.slice(1),at=!0),U.length<E)for(var Fe=E-U.length;Fe>0;Fe--)U="0"+U;return pe>-1&&(U=U.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),u.indexOf(".")===0&&(U=""),K=U+x+(R||""),_?K=(_&&at?"(":"")+K+(_&&at?")":""):yt>=0?K=yt===0?(at?"-":"+")+K:K+(at?"-":"+"):at&&(K="-"+K),K},stringToNumber:function(l){var u=i[a.currentLocale],h=l,f={thousand:3,million:6,billion:9,trillion:12},_,g,E;if(a.zeroFormat&&l===a.zeroFormat)g=0;else if(a.nullFormat&&l===a.nullFormat||!l.replace(/[^0-9]+/g,"").length)g=null;else{g=1,u.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(u.delimiters.decimal,"."));for(_ in f)if(E=new RegExp("[^a-zA-Z]"+u.abbreviations[_]+"(?:\\)|(\\"+u.currency.symbol+")?(?:\\))?)?$"),h.match(E)){g*=Math.pow(10,f[_]);break}g*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),g*=Number(l)}return g},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,u){return l.indexOf(u)!==-1},insert:function(l,u,h){return l.slice(0,h)+u+l.slice(h)},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 h=Object(l),f=h.length>>>0,_=0,g;if(arguments.length===3)g=arguments[2];else{for(;_<f&&!(_ in h);)_++;if(_>=f)throw new TypeError("Reduce of empty array with no initial value");g=h[_++]}for(;_<f;_++)_ in h&&(g=u(g,h[_],_,h));return g},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,h){var f=s.multiplier(h);return u>f?u:f},1)},toFixed:function(l,u,h,f){var _=l.toString().split("."),g=u-(f||0),E,R,O,A;return _.length===2?E=Math.min(Math.max(_[1].length,g),u):E=g,O=Math.pow(10,E),A=(h(l+"e+"+E)/O).toFixed(E),f>u-E&&(R=new RegExp("\\.?0{1,"+(f-(u-E))+"}$"),A=A.replace(R,"")),A}},e.options=a,e.formats=n,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,h){if(u=u.toLowerCase(),this[l+"s"][u])throw new TypeError(u+" "+l+" already registered.");return this[l+"s"][u]=h,h},e.validate=function(l,u){var h,f,_,g,E,R,O,A;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{O=e.localeData(u)}catch{O=e.localeData(e.locale())}return _=O.currency.symbol,E=O.abbreviations,h=O.delimiters.decimal,O.delimiters.thousands==="."?f="\\.":f=O.delimiters.thousands,A=l.match(/^[^\d]+/),A!==null&&(l=l.substr(1),A[0]!==_)||(A=l.match(/[^\d]+$/),A!==null&&(l=l.slice(0,-1),A[0]!==E.thousand&&A[0]!==E.million&&A[0]!==E.billion&&A[0]!==E.trillion))?!1:(R=new RegExp(f+"{2}"),l.match(/[^\d.,]/g)?!1:(g=l.split(h),g.length>2?!1:g.length<2?!!g[0].match(/^\d+.*\d$/)&&!g[0].match(R):g[0].length===1?!!g[0].match(/^\d+$/)&&!g[0].match(R)&&!!g[1].match(/^\d+$/):!!g[0].match(/^\d+.*\d$/)&&!g[0].match(R)&&!!g[1].match(/^\d+$/)))},e.fn=c.prototype={clone:function(){return e(this)},format:function(l,u){var h=this._value,f=l||a.defaultFormat,_,g,E;if(u=u||Math.round,h===0&&a.zeroFormat!==null)g=a.zeroFormat;else if(h===null&&a.nullFormat!==null)g=a.nullFormat;else{for(_ in n)if(f.match(n[_].regexps.format)){E=n[_].format;break}E=E||e._.numberToFormat,g=E(h,f,u)}return g},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var u=s.correctionFactor.call(null,this._value,l);function h(f,_,g,E){return f+Math.round(u*_)}return this._value=s.reduce([this._value,l],h,0)/u,this},subtract:function(l){var u=s.correctionFactor.call(null,this._value,l);function h(f,_,g,E){return f-Math.round(u*_)}return this._value=s.reduce([l],h,Math.round(this._value*u))/u,this},multiply:function(l){function u(h,f,_,g){var E=s.correctionFactor(h,f);return Math.round(h*E)*Math.round(f*E)/Math.round(E*E)}return this._value=s.reduce([this._value,l],u,1),this},divide:function(l){function u(h,f,_,g){var E=s.correctionFactor(h,f);return Math.round(h*E)/Math.round(f*E)}return this._value=s.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,h){var f=e._.includes(u," BPS")?" ":"",_;return l=l*1e4,u=u.replace(/\s?BPS/,""),_=e._.numberToFormat(l,u,h),e._.includes(_,")")?(_=_.split(""),_.splice(-1,0,f+"BPS"),_=_.join("")):_=_+f+"BPS",_},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"]},h=l.suffixes.concat(u.suffixes.filter(function(_){return l.suffixes.indexOf(_)<0})),f=h.join("|");f="("+f.replace("B","B(?!PS)")+")",e.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(_,g,E){var R,O=e._.includes(g,"ib")?u:l,A=e._.includes(g," b")||e._.includes(g," ib")?" ":"",L,F,x;for(g=g.replace(/\s?i?b/,""),L=0;L<=O.suffixes.length;L++)if(F=Math.pow(O.base,L),x=Math.pow(O.base,L+1),_===null||_===0||_>=F&&_<x){A+=O.suffixes[L],F>0&&(_=_/F);break}return R=e._.numberToFormat(_,g,E),R+A},unformat:function(_){var g=e._.stringToNumber(_),E,R;if(g){for(E=l.suffixes.length-1;E>=0;E--){if(e._.includes(_,l.suffixes[E])){R=Math.pow(l.base,E);break}if(e._.includes(_,u.suffixes[E])){R=Math.pow(u.base,E);break}}g*=R||1}return g}})}(),function(){e.register("format","currency",{regexps:{format:/(\$)/},format:function(l,u,h){var f=e.locales[e.options.currentLocale],_={before:u.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:u.match(/([\+|\-|\)|\s|\$]*)$/)[0]},g,E,R;for(u=u.replace(/\s?\$\s?/,""),g=e._.numberToFormat(l,u,h),l>=0?(_.before=_.before.replace(/[\-\(]/,""),_.after=_.after.replace(/[\-\)]/,"")):l<0&&!e._.includes(_.before,"-")&&!e._.includes(_.before,"(")&&(_.before="-"+_.before),R=0;R<_.before.length;R++)switch(E=_.before[R],E){case"$":g=e._.insert(g,f.currency.symbol,R);break;case" ":g=e._.insert(g," ",R+f.currency.symbol.length-1);break}for(R=_.after.length-1;R>=0;R--)switch(E=_.after[R],E){case"$":g=R===_.after.length-1?g+f.currency.symbol:e._.insert(g,f.currency.symbol,-(_.after.length-(1+R)));break;case" ":g=R===_.after.length-1?g+" ":e._.insert(g," ",-(_.after.length-(1+R)+f.currency.symbol.length-1));break}return g}})}(),function(){e.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,u,h){var f,_=typeof l=="number"&&!e._.isNaN(l)?l.toExponential():"0e+0",g=_.split("e");return u=u.replace(/e[\+|\-]{1}0/,""),f=e._.numberToFormat(Number(g[0]),u,h),f+"e"+g[1]},unformat:function(l){var u=e._.includes(l,"e+")?l.split("e+"):l.split("e-"),h=Number(u[0]),f=Number(u[1]);f=e._.includes(l,"e-")?f*=-1:f;function _(g,E,R,O){var A=e._.correctionFactor(g,E),L=g*A*(E*A)/(A*A);return L}return e._.reduce([h,Math.pow(10,f)],_,1)}})}(),function(){e.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,u,h){var f=e.locales[e.options.currentLocale],_,g=e._.includes(u," o")?" ":"";return u=u.replace(/\s?o/,""),g+=f.ordinal(l),_=e._.numberToFormat(l,u,h),_+g}})}(),function(){e.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,u,h){var f=e._.includes(u," %")?" ":"",_;return e.options.scalePercentBy100&&(l=l*100),u=u.replace(/\s?\%/,""),_=e._.numberToFormat(l,u,h),e._.includes(_,")")?(_=_.split(""),_.splice(-1,0,f+"%"),_=_.join("")):_=_+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,h){var f=Math.floor(l/60/60),_=Math.floor((l-f*60*60)/60),g=Math.round(l-f*60*60-_*60);return f+":"+(_<10?"0"+_:_)+":"+(g<10?"0"+g:g)},unformat:function(l){var u=l.split(":"),h=0;return u.length===3?(h=h+Number(u[0])*60*60,h=h+Number(u[1])*60,h=h+Number(u[2])):u.length===2&&(h=h+Number(u[0])*60,h=h+Number(u[1])),Number(h)}})}(),e})})(Ps);var Zn=Ps.exports;const st=Qn(Zn),ue={v:"#VALUE!",n:"#NAME?",na:"#N/A",r:"#REF!",d:"#DIV/0!",nm:"#NUM!",nl:"#NULL!",sp:"#SPILL!"};function Jn(t){let e=!1;for(const s in ue)if(t===ue[s]){e=!0;break}return e}function rt(t){return t===null||t.toString().replace(/\s/g,"")===""||typeof t=="boolean"?!1:!isNaN(t)}function yn(t){if(t===null||t.toString().length<5)return!1;if(e(t))return!0;return!1;function e(s){const r=/^(\d{4})-(\d{1,2})-(\d{1,2})(\s(\d{1,2}):(\d{1,2})(:(\d{1,2}))?)?$/,n=/^(\d{4})\/(\d{1,2})\/(\d{1,2})(\s(\d{1,2}):(\d{1,2})(:(\d{1,2}))?)?$/;if(!r.test(s)&&!n.test(s))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 Wt=new Date("2017-02-19T19:06:09.000Z");Number.isNaN(Wt.getFullYear())&&(Wt=new Date("2/19/17"));const ti=Wt.getFullYear()===2017;function ei(t,e){const s=new Date(t);if(ti)return e>0?s.setTime(s.getTime()+s.getTimezoneOffset()*60*1e3):e<0&&s.setTime(s.getTime()-s.getTimezoneOffset()*60*1e3),s;if(t instanceof Date)return t;if(Wt.getFullYear()===1917&&!Number.isNaN(s.getFullYear())){const i=s.getFullYear();return t.indexOf(`${i}`)>-1||s.setFullYear(s.getFullYear()+100),s}const r=t.match(/\d+/g)||["2017","2","19","0","0","0"];let n=new Date(+r[0],+r[1]-1,+r[2],+r[3]||0,+r[4]||0,+r[5]||0);return t.indexOf("Z")>-1&&(n=new Date(n.getTime()-n.getTimezoneOffset()*60*1e3)),n}const si=new Date(1900,2,1,0,0,0);function xs(t,e){let s=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());const r=Date.UTC(1899,11,31,0,0,0);return e?s-=1461*24*60*60*1e3:t>=si&&(s+=24*60*60*1e3),(s-r)/(24*60*60*1e3)}function ri(t){let e=null,s={},r=t;if(t===null)return null;if(/^-?[0-9]{1,}[,][0-9]{3}(.[0-9]{1,2})?$/.test(t)){e=t,r=Number(t.split(".")[0].replace(",",""));let n="#,##0";if(t.split(".")[1]){n="#,##0.";for(let i=0;i<t.split(".")[1].length;i++)n+=0}s={fa:n,t:"n"}}else if(t.toString().substr(0,1)==="'")e=t.toString().substr(1),s={fa:"@",t:"s"};else if(t.toString().toUpperCase()==="TRUE")e="TRUE",s={fa:"General",t:"b"},r=!0;else if(t.toString().toUpperCase()==="FALSE")e="FALSE",s={fa:"General",t:"b"},r=!1;else if(Jn(t))e=t.toString(),s={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(),s={fa:"@",t:"s"};else if(rt(t)&&Math.abs(parseFloat(t))>0&&(Math.abs(parseFloat(t))>=1e11||Math.abs(parseFloat(t))<1e-9)){r=st(t).value();const n=r.toExponential();if(n.indexOf(".")>-1){let i=n.split(".")[1].split("e")[0].length;i>5&&(i=5),s={fa:`#0.${new Array(i+1).join("0")}E+00`,t:"n"}}else s={fa:"#0.E+00",t:"n"};e=Q.format(s.fa,r)}else if(t.toString().indexOf("%")>-1){const n=t.toString().indexOf("%"),i=t.toString().substr(0,n),o=i.replace(/,/g,"");if(n===t.toString().length-1&&rt(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 h=a.split(",");for(let f=1;f<h.length;f++)if(h[f].length<3){u=!1;break}u?(s={fa:`#,##0.${new Array(l+1).join("0")}%`,t:"n"},r=st(t).value(),e=Q.format(s.fa,r)):(e=t.toString(),s={fa:"@",t:"s"})}else s={fa:`0.${new Array(l+1).join("0")}%`,t:"n"},r=st(t).value(),e=Q.format(s.fa,r)}else e=t.toString(),s={fa:"@",t:"s"};else if(i.indexOf(",")>-1){let a=!0;const c=i.split(",");for(let l=1;l<c.length;l++)if(c[l].length<3){a=!1;break}a?(s={fa:"#,##0%",t:"n"},r=st(t).value(),e=Q.format(s.fa,r)):(e=t.toString(),s={fa:"@",t:"s"})}else s={fa:"0%",t:"n"},r=st(t).value(),e=Q.format(s.fa,r);else e=t.toString(),s={fa:"@",t:"s"}}else if(t.toString().indexOf(".")>-1)if(t.toString().indexOf(".")===t.toString().lastIndexOf(".")){const n=t.toString().split(".")[0],i=t.toString().split(".")[1];let o=i.length;if(o>9&&(o=9),n.indexOf(",")>-1){let a=!0;const c=n.split(",");for(let l=1;l<c.length;l++)if(!rt(c[l])||c[l].length<3){a=!1;break}a?(s={fa:`#,##0.${new Array(o+1).join("0")}`,t:"n"},r=st(t).value(),e=Q.format(s.fa,r)):(e=t.toString(),s={fa:"@",t:"s"})}else rt(n)&&rt(i)?(s={fa:`0.${new Array(o+1).join("0")}`,t:"n"},r=st(t).value(),e=Q.format(s.fa,r)):(e=t.toString(),s={fa:"@",t:"s"})}else e=t.toString(),s={fa:"@",t:"s"};else rt(t)?(e=t.toString(),s={fa:"General",t:"n"},r=parseFloat(t)):yn(t)&&(t.toString().indexOf(".")>-1||t.toString().indexOf(":")>-1||t.toString().length<16)?(r=xs(ei(t.toString().replace(/-/g,"/"))),r.toString().indexOf(".")>-1?t.toString().length>18?s.fa="yyyy-MM-dd hh:mm:ss":t.toString().length>11?s.fa="yyyy-MM-dd hh:mm":s.fa="yyyy-MM-dd":s.fa="yyyy-MM-dd",s.t="d",e=Q.format(s.fa,r)):(e=t,s.fa="General",s.t="g");return[e,s,r]}const Q={format(t,e){}},ni=(t,e)=>{};function ii(t){let e=0;for(let s=0;s<t.length;s++)e=t.charCodeAt(s)+(e<<6)+(e<<16)-e;return e>>>0}class Et{static hasLength(e,s){return e.length===s}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 S=Symbol("newer"),M=Symbol("older");class ps{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[S],{done:!1,value:e.key}):{done:!0,value:void 0}}}class Fs{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[S],{done:!1,value:e.value}):{done:!0,value:void 0}}}class Hs{constructor(e){d(this,"entry");this.entry=e}[Symbol.iterator](){return this}next(){const e=this.entry;return e?(this.entry=e[S],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}}}var Fo,Ho;class ce{constructor(e,s){d(this,"key");d(this,"value");d(this,Fo);d(this,Ho);this.key=e,this.value=s,this[S]=void 0,this[M]=void 0}toJSON(){return{key:this.key,value:this.value}}}Fo=S,Ho=M;class Bs{constructor(...e){d(this,"_keymap");d(this,"size",0);d(this,"limit");d(this,"oldest");d(this,"newest");d(this,"_onShiftListeners",[]);if(Et.hasLength(e,1)){if(Et.isNumber(e[0])){const s=e[0];this._initialize(s,void 0);return}if(Et.isIterable(e[0])){const s=e[0];this._initialize(0,s);return}return}if(Et.hasLength(e,2)){const s=e[0],r=e[1];this._initialize(s,r)}}onShift(e){if(this._onShiftListeners.indexOf(e)===-1)return this._onShiftListeners.push(e),v(()=>tt(this._onShiftListeners,e));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(e,s){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=e,this._keymap=new Map,s&&(this.assign(s),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[S]&&(e===this.oldest&&(this.oldest=e[S]),e[S][M]=e[M]),e[M]&&(e[M][S]=e[S]),e[S]=void 0,e[M]=this.newest,this.newest&&(this.newest[S]=e),this.newest=e)}assign(e){let s,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const n=e[Symbol.iterator]();for(let i=n.next();!i.done;i=n.next()){const o=new ce(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),s?(s[S]=o,o[M]=s):this.oldest=o,s=o,r--===0)throw new Error("overflow")}this.newest=s,this.size=this._keymap.size}set(e,s){let r=this._keymap.get(e);return r?(r.value=s,this._markEntryAsUsed(r),this):(this._keymap.set(e,r=new ce(e,s)),this.newest?(this.newest[S]=r,r[M]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const e=this.oldest;if(e)return this.oldest&&this.oldest[S]?(this.oldest=this.oldest[S],this.oldest[M]=void 0):(this.oldest=void 0,this.newest=void 0),e[S]=e[M]=void 0,this._keymap.delete(e.key),--this.size,this._onShiftListeners.forEach(s=>s(e)),[e.key,e.value]}get(e){const s=this._keymap.get(e);if(s)return this._markEntryAsUsed(s),s.value}has(e){return this._keymap.has(e)}find(e){const s=this._keymap.get(e);return s?s.value:void 0}delete(e){const s=this._keymap.get(e);if(s)return this._keymap.delete(s.key),s[S]&&s[M]?(s[M][S]=s[S],s[S][M]=s[M]):s[S]?(s[S][M]=void 0,this.oldest=s[S]):s[M]?(s[M][S]=void 0,this.newest=s[M]):this.oldest=this.newest=void 0,this.size--,s.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new ps(this.oldest)}values(){return new Fs(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new Hs(this.oldest)}forEach(e,s){typeof s!="object"&&(s=this);let r=this.oldest;for(;r;)e.call(s,r.value,r.key,this),r=r[S]}toJSON(){const e=new Array(this.size);let s=0,r=this.oldest;for(;r;)e[s++]={key:r.key,value:r.value},r=r[S];return e}toString(){let e="",s=this.oldest;for(;s;)e+=`${String(s.key)}:${s.value}`,s=s[S],s&&(e+=" < ");return e}}function k(t){let e=0;const s=Object.keys(t);for(const r of s){const n=Number(r);e=Math.max(e,n)}return e+1}function oi(t,e,s){const r=k(s),n=s;for(let i=r-1;i>=t;i--)n[i+1]=n[i];n[t]=e}function ai(t,e,s){const r=t+e,n=k(s),i=s;let o=0;const a={};for(let u=t;u<r;u++){const h=i[u];h!==void 0&&(delete i[u],a[o]=h,o++)}const c=r-t,l=n;for(let u=r;u<l;u++)i[u]!==void 0&&(i[u-c]=i[u],delete i[u])}function li(t,e){const s=t,r=Object.keys(s),n=r.length,i=e,o=Object.keys(i),a=o.length,c={};let l=0;for(let u=0;u<n;u++,l++){const h=r[u];c[l]=s[h]}for(let u=0;u<a;u++,l++){const h=o[u];c[l]=i[h]}return c}function ui(t,e,s){const r=s;if(k(s)>0){const i={};let o=0;for(let a=t;a<e;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function he(t,e,s,r){const n=t>s;if(!n&&t+e>s)throw new Error("Invalid move operation");n?ci(t,e,s,r):hi(t,e,s,r)}function ci(t,e,s,r){const n=r,i=[];for(let o=t;o<t+e;o++)i.push(n[o]);for(let o=t-1;o>=s;o--){const a=n[o];n[o+e]=a,a==null&&delete n[o+e]}i.forEach((o,a)=>{n[s+a]=o})}function hi(t,e,s,r){const n=r,i=[];for(let o=t;o<t+e;o++)i.push(n[o]);for(let o=t+e;o<s;o++){const a=n[o];n[o-e]=a,a==null&&delete n[o-e]}i.forEach((o,a)=>{n[s+a-e]=o})}class j{constructor(e={}){d(this,"_matrix");this._setOriginValue(e)}static MakeObjectMatrixSize(e){return new j({[e-1]:{}})}getMatrix(){return this._matrix}forEach(e){const s=this._matrix,r=Object.keys(s);for(const n of r){const i=Number(n),o=s[i];if(e(i,o)===!1)return this}return this}forRow(e){const s=this._matrix,r=Object.keys(s);for(const n of r){const i=Number(n),o=s[i];if(e(i,Object.keys(o).map(c=>Number(c)))===!1)return this}return this}forValue(e){const s=this._matrix,r=Object.keys(s);for(const n of r){const i=Number(n),o=s[i],a=Object.keys(o);for(const c of a){const l=Number(c),u=o[Number(c)];if(e(i,l,u)===!1)return this}}return this}swapRow(e,s){const r=this._matrix[e],n=this._matrix[s];this._matrix[e]=n,this._matrix[s]=r}getRow(e){return this._matrix[e]}getRowOrCreate(e){let s=this.getRow(e);return s==null&&(s={},this._matrix[e]=s),s}reset(){this._setOriginValue({})}hasValue(){const e=this._matrix,s=Object.keys(e);if(s.length===0)return!1;for(const r of s){const n=Number(r),i=e[n];if(Object.keys(i).length>0)return!0}return!1}getValue(e,s){var r,n;return(n=(r=this._matrix)==null?void 0:r[e])==null?void 0:n[s]}setValue(e,s,r){const n=this.getRowOrCreate(e);n[s]=r}deleteValue(e,s){var r,n;(n=(r=this._matrix)==null?void 0:r[e])==null||delete n[s]}realDeleteValue(e,s){var r,n,i;if((n=(r=this._matrix)==null?void 0:r[e])==null||delete n[s],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,s){this._matrix[e]=s}moveRows(e,s,r){he(e,s,r,this._matrix)}moveColumns(e,s,r){this.forEach((n,i)=>{he(e,s,r,i)})}getFragment(e,s,r,n){const i=new j;let o=0;for(let a=e;a<=s;a++){const c={};let l=0;for(let u=r;u<=n;u++){const h=this.getValue(a,u);c[l]=h,l++}i.setRow(o,c),o++}return i}getSlice(e,s,r,n){const i=new j;for(let o=e;o<=s;o++)for(let a=r;a<=n;a++){const c=this.getValue(o,a);c&&i.setValue(o,a,m.deepClone(c))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return k(this._matrix)}getRange(){const r=this.getLength()-1;let n=0;const i=this.getLength();for(let o=0;o<i;o++){const a=this.getRow(o);if(a){const c=k(a)-1;n=c>n?c:n}}return{startRow:0,startColumn:0,endRow:r,endColumn:n}}toNativeArray(){const e=new Array;return this.forValue((s,r,n)=>{e.push(n)}),e}toArray(){const e=[];return this.forRow((s,r)=>{e[s]==null&&(e[s]=[]),r.forEach(n=>{e[s][n]=this.getValue(s,n)})}),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,s=0,r=!1,n=!1;const i=new j;return this.forEach((o,a)=>{r||(r=!0,e=o),Object.keys(a).forEach(c=>{const l=Number(c);n?l<s&&(s=l):(n=!0,s=l);const u=this.getValue(o,l);i.setValue(o-e,l-s,u)})}),i.getData()}getDataRange(){let e=0,s=0,r=0,n=!1,i=!1;this.forEach((a,c)=>{n||(n=!0,e=a);const l=k(c)-1;l>r&&(r=l),Object.keys(c).forEach(u=>{const h=Number(u);i?h<s&&(s=h):(i=!0,s=h)})});const o=e+this.getSizeOf()-1;return{startRow:e,startColumn:s,endRow:o,endColumn:r}}getDiscreteRanges(){const e=[];return this.forEach((s,r)=>{Object.keys(r).forEach(n=>{const i=Number(n);let o=!1;for(const a of e)if(s>=a.startRow&&s<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(s,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||e.push({startRow:s,endRow:s,startColumn:i,endColumn:i})})}),e}merge(e){this.forValue((s,r)=>{const n=e.getValue(s,r);n!=null&&this.setValue(s,r,n)})}_setOriginValue(e={}){this._matrix=e}}var Ne=(t=>(t.INIT="init",t.FETCHING="fetching",t.DONE="done",t))(Ne||{});class Ws{constructor(){d(this,"status","init")}}const di=t=>t.some(e=>e.status==="init")?"init":t.some(e=>e.status==="fetching")?"fetching":"done";var z=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN",t[t.ALL=3]="ALL",t))(z||{}),Y=(t=>(t[t.NONE=0]="NONE",t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN",t[t.ALL=3]="ALL",t))(Y||{});function _i(t){return[t.startRow,t.startColumn,t.endRow,t.endColumn]}const y=class y{static clone(e){return{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType}}static equals(e,s){return e.endRow===s.endRow&&e.endColumn===s.endColumn&&e.startRow===s.startRow&&e.startColumn===s.startColumn&&(e.rangeType===s.rangeType||e.rangeType===void 0&&s.rangeType===z.NORMAL||s.rangeType===void 0&&e.rangeType===z.NORMAL)}static intersects(e,s){const r=e.startRow,n=e.endRow,i=e.startColumn,o=e.endColumn,a=s.startRow,c=s.endRow,l=s.startColumn,u=s.endColumn,h=Math.abs(i+o-l-u),f=Math.abs(i-o)+Math.abs(l-u),_=Math.abs(r+n-a-c),g=Math.abs(r-n)+Math.abs(a-c);return h<=f&&_<=g}static getIntersects(e,s){const r=e.startRow,n=e.endRow,i=e.startColumn,o=e.endColumn,a=s.startRow,c=s.endRow,l=s.startColumn,u=s.endColumn;let h,f,_,g;if(a<=n)a>=r?f=a:f=r;else return null;if(c>=r)c>=n?g=n:g=c;else return null;if(l<=o)l>i?h=l:h=i;else return null;if(u>=i)u>=o?_=o:_=u;else return null;return{startRow:f,endRow:g,startColumn:h,endColumn:_,rangeType:z.NORMAL}}static contains(e,s){return e.startRow<=s.startRow&&e.endRow>=s.endRow&&e.startColumn<=s.startColumn&&e.endColumn>=s.endColumn}static realContain(e,s){return y.contains(e,s)&&(e.startRow<s.startRow||e.endRow>s.endRow||e.startColumn<s.startColumn||e.endColumn>s.endColumn)}static union(...e){return e.reduce((s,r)=>({startRow:Math.min(s.startRow,r.startRow),startColumn:Math.min(s.startColumn,r.startColumn),endRow:Math.max(s.endRow,r.endRow),endColumn:Math.max(s.endColumn,r.endColumn),rangeType:z.NORMAL}),e[0])}static subtract(e,s){if(s.startRow>=e.endRow||s.endRow<=e.startRow||s.startColumn>=e.endColumn||s.endColumn<=e.startColumn)return[e];const r=[];s.startRow>e.startRow&&r.push({startRow:e.startRow,startColumn:e.startColumn,endRow:s.startRow,endColumn:e.endColumn}),s.endRow<e.endRow&&r.push({startRow:s.endRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn});const n=Math.max(e.startRow,s.startRow),i=Math.min(e.endRow,s.endRow);return s.startColumn>e.startColumn&&r.push({startRow:n,startColumn:e.startColumn,endRow:i,endColumn:s.startColumn}),s.endColumn<e.endColumn&&r.push({startRow:n,startColumn:s.endColumn,endRow:i,endColumn:e.endColumn}),r}};d(y,"getRelativeRange",(e,s)=>({startRow:e.startRow-s.startRow,endRow:e.endRow-e.startRow,startColumn:e.startColumn-s.startColumn,endColumn:e.endColumn-e.startColumn})),d(y,"getPositionRange",(e,s)=>({startRow:e.startRow+s.startRow,endRow:e.endRow+e.startRow+s.startRow,startColumn:e.startColumn+s.startColumn,endColumn:e.endColumn+e.startColumn+s.startColumn})),d(y,"moveHorizontal",(e,s=0,r=0)=>({...e,startColumn:e.startColumn+s,endColumn:e.endColumn+s+r})),d(y,"moveVertical",(e,s=0,r=0)=>({...e,startRow:e.startRow+s,endRow:e.endRow+s+r})),d(y,"moveOffset",(e,s,r)=>({...e,startRow:e.startRow+r,endRow:e.endRow+r,startColumn:e.startColumn+s,endColumn:e.endColumn+s}));let ct=y;class fi{constructor(e,s){d(this,"_values",[]);d(this,"_keys",[]);d(this,"_keyMaps",new Map);this._values=e,this._keys=s,e.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(e){this._keys.forEach(s=>{const r=e[s],n=this._keyMaps.get(s)||new Map;n.set(r,e),this._keyMaps.set(s,n)})}getValue(e){for(let s=0;s<this._keys.length;s++){const r=this._keyMaps.get(this._keys[s]);if(r!=null&&r.has(e))return r.get(e)}return null}hasValue(e){for(let s=0;s<this._keys.length;s++){const r=this._keyMaps.get(this._keys[s]);if(r!=null&&r.has(e))return!0}return!1}addValue(e){this._values.push(e),this._initKeyMap(e)}setValue(e,s,r){const n=this.getValue(e);n&&Object.keys(n).includes(s)&&(n[s]=r)}deleteValue(e){const s=this.getValue(e);if(s){this._keys.forEach(n=>{const i=this._keyMaps.get(n),o=s[n];i==null||i.delete(o)});const r=this._values.findIndex(n=>n===s);this._values.splice(r,1)}}getValues(){return this._values}getKeyMap(e){var s;return[...((s=this._keyMaps.get(e))==null?void 0:s.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function de(t,e,s,r){return{forEach(n){for(let i=t;i<=e;i++)for(let o=s;o<=r;o++)n(i,o)}}}function gi(t){if(t==null||t.length===0)return NaN;const e=t.toLowerCase().split(""),s=e.length,r=o=>o.charCodeAt(0)-96;let n=0,i=0;for(let o=0;o<s;o++)i=r(e[o]),n+=i*26**(s-o-1);return n===0?NaN:n-1}const $t=65,$s=90,Ei=97;function Ri(t){const e=$s-$t+1;let s="";for(;t>=0;)s=String.fromCharCode(t%e+$t)+s,t=Math.floor(t/e)-1;return s}function Gs(t,e){let s="";for(;e>0;)s+=t,e--;return s}function mi(t,e=!1){const s=$s-$t+1;let r=Ei;e&&(r=$t);const n=String.fromCharCode(t%s+r),i=Math.floor(t/s)+1;return Gs(n,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 gt(t="index",e=1){return(s,r)=>s[t]>r[t]?e:s[t]===r[t]?0:-e}var ks=(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))(ks||{}),be=(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))(be||{});function Vs(t){const e=[];for(const s of t){const{st:r,ed:n}=s;if(r===n)continue;if(e.length===0){e.push(s);continue}const i=e.pop();Ds(s,i)&&m.hasIntersectionBetweenTwoRanges(i.st,i.ed,s.st,s.ed)?e.push({...s,st:i.st,ed:n}):e.push(i,s)}return e}function js(t,e,s,r){const{textRuns:n}=t;if(n==null)return;const i=[],o=n.length;let a=!1;const c=e.textRuns??[];if(c.length)for(let l=0,u=c.length;l<u;l++){const h=c[l];h.st+=r,h.ed+=r}for(let l=0;l<o;l++){const u=n[l],{st:h,ed:f}=u;if(f<r)i.push(u);else if(r>=h&&r<=f)if(a)u.st+=s,u.ed+=s,i.push(u);else{a=!0,u.ed+=s;const _=[];if(c.length){const g={...u,st:h,ed:c[0].st};_.push(g),_.push(...c);const E=c[c.length-1],R={...u,st:E.ed,ed:f+s};_.push(R)}else _.push(u);i.push(..._)}else u.st+=s,u.ed+=s,a||(a=!0,i.push(...c)),i.push(u)}a||(a=!0,i.push(...c)),t.textRuns=Vs(i)}function Le(t,e,s,r){const{paragraphs:n}=t;if(n==null)return;const{paragraphs:i,dataStream:o}=e,a=[];let c=-1;for(let u=0,h=n.length;u<h;u++){const f=n[u],{startIndex:_}=f;_>=r&&(f.startIndex+=s),c===-1&&_>=r&&(c=u),a.push(f.startIndex)}let l=-1;if(i){for(let u=0,h=i.length;u<h;u++){const f=i[u];f.startIndex+=r;const _=f.startIndex;l=a.indexOf(_)}if(o===be.PARAGRAPH&&i.length===1){const u=n[c],h=i[0],f=u.paragraphStyle,_=u.bullet;u.paragraphStyle=h.paragraphStyle,u.bullet=h.bullet,h.paragraphStyle=f,h.bullet=_}l!==-1&&n.splice(l,1),n.push(...i),n.sort(gt("startIndex"))}}function Ii(t,e,s,r){const{sectionBreaks:n}=t;if(n==null)return;for(let o=0,a=n.length;o<a;o++){const c=n[o],{startIndex:l}=c;l>=r&&(c.startIndex+=s)}const i=e.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const c=i[o];c.startIndex+=r}n.push(...i),n.sort(gt("startIndex"))}}function zs(t,e,s,r){const{customBlocks:n}=t;if(n==null)return;for(let o=0,a=n.length;o<a;o++){const c=n[o],{startIndex:l}=c;l>=r&&(c.startIndex+=s)}const i=e.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const c=i[o];c.startIndex+=r}n.push(...i),n.sort(gt("startIndex"))}}function we(t,e,s,r){const{tables:n}=t;if(n==null)return;for(let o=0,a=n.length;o<a;o++){const c=n[o],{startIndex:l,endIndex:u}=c;l>r?(c.startIndex+=s,c.endIndex+=s):u>=r-1&&(c.endIndex+=s)}const i=e.tables;if(i){for(let o=0,a=i.length;o<a;o++){const c=i[o];c.startIndex+=r,c.endIndex+=r}n.push(...i),n.sort(gt("startIndex"))}}function Ci(t,e,s,r){const{customRanges:n}=t;if(n==null)return;for(let o=0,a=n.length;o<a;o++){const c=n[o],{startIndex:l,endIndex:u}=c;l>r?(c.startIndex+=s,c.endIndex+=s):u>=r-1&&(c.endIndex+=s)}const i=e.customRanges;if(i){for(let o=0,a=i.length;o<a;o++){const c=i[o];c.startIndex+=r,c.endIndex+=r}n.push(...i),n.sort(gt("startIndex"))}}function Ys(t,e,s){const{textRuns:r}=t,n=s,i=s+e,o=[];if(r){const a=[];for(let c=0,l=r.length;c<l;c++){const u=r[c],{st:h,ed:f}=u;if(n<=h&&i>=f){o.push({...u,st:h-n,ed:f-n});continue}else h<=n&&f>=i?(o.push({...u,st:n-n,ed:i-n}),u.ed-=e):n>=h&&n<f?(o.push({...u,st:n-n,ed:f-n}),u.ed=n):i>h&&i<=f?(o.push({...u,st:h-n,ed:i-n}),u.st=i-e,u.ed-=e):h>=i&&(u.st-=e,u.ed-=e);a.push(u)}t.textRuns=a}return o}function Ks(t,e,s){const{paragraphs:r}=t,n=s,i=s+e,o=[];if(r){const a=[];for(let c=0,l=r.length;c<l;c++){const u=r[c],{startIndex:h}=u;if(h>=n&&h<i){o.push({...u,startIndex:h-s});continue}else h>=i&&(u.startIndex-=e);a.push(u)}t.paragraphs=a}return o}function Xs(t,e,s){const{sectionBreaks:r}=t,n=s,i=s+e-1,o=[];if(r){const a=[];for(let c=0,l=r.length;c<l;c++){const u=r[c],{startIndex:h}=u;if(h>=n&&h<=i){o.push({...u,startIndex:h-s});continue}else h>i&&(u.startIndex-=e);a.push(u)}t.sectionBreaks=a}return o}function qs(t,e,s){const{customBlocks:r}=t,n=s,i=s+e-1,o=[];if(r){const a=[];for(let c=0,l=r.length;c<l;c++){const u=r[c],{startIndex:h}=u;if(h>=n&&h<=i){o.push({...u,startIndex:h-s});continue}else h>i&&(u.startIndex-=e);a.push(u)}t.customBlocks=a}return o}function Qs(t,e,s){const{tables:r}=t,n=s,i=s+e-1,o=[];if(r){const a=[];for(let c=0,l=r.length;c<l;c++){const u=r[c],{startIndex:h,endIndex:f}=u;if(n<=h&&i>=f){o.push({...u,startIndex:h-s,endIndex:f-s});continue}else if(h<=n&&f>=i){const _=Se(h,f,n,i);u.startIndex=_[0],u.endIndex=_[1]}else i<h&&(u.startIndex-=e,u.endIndex-=e);a.push(u)}t.tables=a}return o}function Zs(t,e,s){const{customRanges:r}=t,n=s,i=s+e-1,o=[];if(r){const a=[];for(let c=0,l=r.length;c<l;c++){const u=r[c],{startIndex:h,endIndex:f}=u;if(n<=h&&i>=f){o.push({...u,startIndex:h-s,endIndex:f-s});continue}else if(h<=n&&f>=i){const _=Se(h,f,n,i);u.startIndex=_[0],u.endIndex=_[1]}else i<h&&(u.startIndex-=e,u.endIndex-=e);a.push(u)}t.customRanges=a}return o}function Si(t,e,s){const{dataStream:r}=t,n=s,i=s+e,o=Ys(t,e,s),a=Ks(t,e,s),c=Xs(t,e,s),l=qs(t,e,s),u=Qs(t,e,s),h=Zs(t,e,s);let f="";return r&&(t.dataStream=Ts(r,n,i),f=r.slice(n,i)),{dataStream:f,textRuns:o,paragraphs:a,sectionBreaks:c,customBlocks:l,tables:u,customRanges:h}}function Ni(t,e,s,r){t.dataStream=Us(t.dataStream,r,e.dataStream),js(t,e,s,r),Le(t,e,s,r),Ii(t,e,s,r),zs(t,e,s,r),we(t,e,s,r),Ci(t,e,s,r)}var Js=(t=>(t[t.character=0]="character",t[t.paragraph=1]="paragraph",t[t.table=2]="table",t[t.numbering=3]="numbering",t))(Js||{}),ys=(t=>(t[t.TAB=0]="TAB",t[t.SPACE=1]="SPACE",t[t.NOTHING=2]="NOTHING",t))(ys||{}),It=(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))(It||{}),Z=(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))(Z||{}),tr=(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))(tr||{}),er=(t=>(t[t.DRAWING=0]="DRAWING",t[t.CUSTOM=1]="CUSTOM",t))(er||{}),sr=(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))(sr||{}),rr=(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))(rr||{}),nr=(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))(nr||{}),ir=(t=>(t[t.NORMAL=0]="NORMAL",t[t.TBRL=1]="TBRL",t[t.LRTBV=2]="LRTBV",t))(ir||{}),or=(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))(or||{}),ar=(t=>(t[t.BOTH_SIDES=0]="BOTH_SIDES",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.LARGEST=3]="LARGEST",t))(ar||{}),lr=(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))(lr||{}),ur=(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))(ur||{}),cr=(t=>(t[t.AUTO=0]="AUTO",t[t.AT_LEAST=1]="AT_LEAST",t[t.EXACT=2]="EXACT",t))(cr||{}),hr=(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))(hr||{}),dr=(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))(dr||{}),_r=(t=>(t.EVENLY_DISTRIBUTED="0",t.FIXED_WIDTH="1",t))(_r||{}),fr=(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))(fr||{}),gr=(t=>(t.NORMAL="normal",t.BOLD="bold",t.ITALIC="italic",t))(gr||{}),Er=(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))(Er||{}),Rr=(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))(Rr||{}),mr=(t=>(t[t.POINT=0]="POINT",t[t.LINE=1]="LINE",t[t.CHARACTER=2]="CHARACTER",t))(mr||{}),Or=(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))(Or||{}),Ar=(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))(Ar||{}),Ir=(t=>(t[t.compressPunctuation=0]="compressPunctuation",t[t.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",t[t.doNotCompress=2]="doNotCompress",t))(Ir||{}),Cr=(t=>(t[t.PORTRAIT=0]="PORTRAIT",t[t.LANDSCAPE=1]="LANDSCAPE",t))(Cr||{}),Gt=(t=>(t.BULLET_LIST="BULLET_LIST",t.ORDER_LIST="ORDER_LIST",t))(Gt||{});const bi={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:[{bulletAlignment:Z.START,glyphFormat:" %0",textStyle:{fs:12},startNumber:0,glyphSymbol:"●",hanging:21,indentStart:21},{bulletAlignment:Z.START,glyphFormat:" %1",textStyle:{fs:12},startNumber:0,glyphSymbol:"■",hanging:21,indentStart:42},{bulletAlignment:Z.START,glyphFormat:" %1",textStyle:{fs:12},startNumber:0,glyphSymbol:"◆",hanging:21,indentStart:63}]},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:[{bulletAlignment:Z.START,glyphFormat:" %1.",textStyle:{fs:12},startNumber:0,glyphType:It.DECIMAL,hanging:21,indentStart:21},{bulletAlignment:Z.START,glyphFormat:" %1.%2)",textStyle:{fs:12},startNumber:0,glyphType:It.DECIMAL,hanging:21,indentStart:42},{bulletAlignment:Z.START,glyphFormat:" %1.%2.%3.",textStyle:{fs:12},startNumber:0,glyphType:It.DECIMAL,hanging:21,indentStart:63}]}};function Li(t,e,s,r,n){const i=wi(t,e,s,r,n),o=Di(t,e,s,r,n),a=Mi(t,e,s,r,n),c=Ui(t,e,s,r,n),l=Ti(t,e,s,r,n),u=Pi(t,e,s,r,n);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:c,tables:l,customRanges:u}}function wi(t,e,s,r,n){const{textRuns:i}=t,{textRuns:o}=e;if(i==null||o==null)return;const a=Ys(t,s,r);if(n!==P.REPLACE){const c=vi(o,a,n);e.textRuns=c}return js(t,e,s,r),a}function vi(t,e,s){if(e.length===0)return t;t=m.deepClone(t),e=m.deepClone(e);const r=[],n=t.length,i=e.length;let o=0,a=0,c=null;function l(){return c?(r.push(c),c=null,!0):!1}for(;o<n&&a<i;){const{st:_,ed:g,ts:E}=t[o],{st:R,ed:O,ts:A,sId:L}=e[a];let F;s===P.COVER?F={...A,...E}:F={...E,...A},g<R?(l()||r.push(t[o]),o++):O<_?(l()||r.push(e[a]),a++):(r.push({st:Math.min(_,R),ed:Math.max(_,R),ts:_<R?{...E}:{...A},sId:_<R?void 0:L}),r.push({st:Math.max(_,R),ed:Math.min(g,O),ts:F,sId:L}),g<O?(o++,e[a].st=g):(a++,t[o].st=O),c={st:Math.min(g,O),ed:Math.max(g,O),ts:g<O?{...A}:{...E},sId:g<O?L:void 0})}l();const u=r[r.length-1],h=t[n-1],f=e[i-1];return u.ed!==Math.max(h.ed,f.ed)&&(h.ed>f.ed?r.push(h):r.push(f)),Vs(r)}function Di(t,e,s,r,n){const{paragraphs:i}=t,{paragraphs:o}=e;if(i==null||o==null)return;const a=Ks(t,s,r);if(n!==P.REPLACE){const c=[];for(const l of o){const{startIndex:u,paragraphStyle:h,bullet:f}=l;let _=[];for(const g of a){const{startIndex:E,paragraphStyle:R,bullet:O}=g;let A,L;if(n===P.COVER?(A={...R,...h},L={listId:"",listType:Gt.BULLET_LIST,nestingLevel:0,textStyle:{},...O,...f}):(A={...h,...R},L={listId:"",listType:Gt.BULLET_LIST,nestingLevel:0,textStyle:{},...f,...O}),u===E){_.push({startIndex:u,paragraphStyle:A,bullet:L});break}}c.push(..._),_=[]}e.paragraphs=c}return Le(t,e,s,r),a}function Mi(t,e,s,r,n){const{sectionBreaks:i}=t,{sectionBreaks:o}=e;if(i==null||o==null)return;const a=Xs(t,s,r);if(n!==P.REPLACE){const c=[];for(const l of o){const{startIndex:u}=l;let h=[];for(const f of a){const{startIndex:_}=f;if(u===_){n===P.COVER?h.push({...f,...l}):h.push({...l,...f});break}}c.push(...h),h=[]}e.sectionBreaks=c}return Le(t,e,s,r),a}function Ui(t,e,s,r,n){const{customBlocks:i}=t,{customBlocks:o}=e;if(i==null||o==null)return;const a=qs(t,s,r);if(n!==P.REPLACE){const c=[];for(const l of o){const{startIndex:u}=l;let h=[];for(const f of a){const{startIndex:_}=f;if(u===_){n===P.COVER?h.push({...f,...l}):h.push({...l,...f});break}}c.push(...h),h=[]}e.customBlocks=c}return zs(t,e,s,r),a}function Ti(t,e,s,r,n){const{tables:i}=t,{tables:o}=e;if(i==null||o==null)return;const a=Qs(t,s,r);if(n!==P.REPLACE){const c=[];for(const l of o){const{startIndex:u,endIndex:h}=l;let f=[];for(const _ of a){const{startIndex:g,endIndex:E}=_;if(g>=u&&E<=h){n===P.COVER?f.push({..._,...l}):f.push({...l,..._});break}}c.push(...f),f=[]}e.tables=c}return we(t,e,s,r),a}function Pi(t,e,s,r,n){const{customRanges:i}=t,{tables:o}=e;if(i==null||o==null)return;const a=Zs(t,s,r);if(n!==P.REPLACE){const c=[];for(const l of o){const{startIndex:u,endIndex:h}=l;let f=[];for(const _ of a){const{startIndex:g,endIndex:E}=_;if(g>=u&&E<=h){n===P.COVER?f.push({..._,...l}):f.push({...l,..._});break}}c.push(...f),f=[]}e.customRanges=c}return we(t,e,s,r),a}const ve={id:"default_doc",documentStyle:{}};class xi{constructor(e){d(this,"snapshot");this.snapshot={...ve,...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:s}=this.snapshot;s.renderConfig==null?s.renderConfig=e:s.renderConfig={...s.renderConfig,...e}}updateDocumentDataMargin(e){const{t:s,l:r,b:n,r:i}=e,{documentStyle:o}=this.snapshot;s!=null&&(o.marginTop=s),r!=null&&(o.marginLeft=r),n!=null&&(o.marginBottom=n),i!=null&&(o.marginRight=i)}updateDocumentDataPageSize(e,s){const{documentStyle:r}=this.snapshot;if(!r.pageSize){e=e??1/0,s=s??1/0,r.pageSize={width:e,height:s};return}e!==void 0&&(r.pageSize.width=e),s!==void 0&&(r.pageSize.height=s)}updateDrawing(e,s){const{drawings:r}=this,{width:n,height:i,left:o,top:a}=s,c=r==null?void 0:r[e];if(!c)return;const l=c.objectTransform;l.size.width=n,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 xi{constructor(s){super(s);d(this,"_unitId");d(this,"headerModelMap",new Map);d(this,"footerModelMap",new Map);const r=6;this._unitId=this.snapshot.id??m.generateRandomId(r),this._initializeHeaderFooterModel()}dispose(){this.headerModelMap.forEach(s=>{s.dispose()}),this.footerModelMap.forEach(s=>{s.dispose()})}getRev(){return this.snapshot.rev??0}incrementRev(){this.snapshot.rev=this.getRev()+1}getSettings(){return this.snapshot.settings}reset(s){if(s.id&&s.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...ve,...s},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(s){if(s!=null){if(this.headerModelMap.has(s))return this.headerModelMap.get(s);if(this.footerModelMap.has(s))return this.footerModelMap.get(s)}return this}getUnitId(){return this._unitId}apply(s){const r=[],n=new us;return n.reset(),s.forEach(i=>{if(i=m.deepClone(i),i.t==="r"){const{coverType:o,body:a,len:c,segmentId:l}=i;if(a!=null){const u=this._updateApply(a,c,n.cursor,o,l);r.push({...i,t:"r",coverType:P.REPLACE,body:u})}else r.push({...i,t:"r"});n.moveCursor(c)}else if(i.t==="i"){const{body:o,len:a,segmentId:c,line:l}=i;this._insertApply(o,a,n.cursor,c),n.moveCursor(a),r.push({t:"d",len:a,line:l,segmentId:c})}else if(i.t==="d"){const{len:o,segmentId:a}=i,c=this._deleteApply(o,n.cursor,a);r.push({...i,t:"i",body:c})}else throw new Error(`Unknown mutation type for mutation: ${i}.`)}),r}_updateApply(s,r,n,i=P.COVER,o){if(s==null)throw new Error("updateBody is none");const a=this.snapshot,c=Mt(a,o);if(c==null)throw new Error("no body has changed");return Li(c,s,r,n,i)}_deleteApply(s,r,n){const i=this.snapshot,o=Mt(i,n);if(o==null)throw new Error("no body has changed");return s<=0?{dataStream:""}:Si(o,s,r)}_insertApply(s,r,n,i){const o=this.snapshot,a=Mt(o,i);if(r!==0){if(a==null)throw new Error("no body has changed");Ni(a,s,r,n)}}_initializeHeaderFooterModel(){const{headers:s,footers:r}=this.getSnapshot();if(s)for(const n in s){const i=s[n];this.headerModelMap.set(n,new dt(i))}if(r)for(const n in r){const i=r[n];this.footerModelMap.set(n,new dt(i))}}updateDocumentId(s){super.updateDocumentId(s),this._unitId=s}}const Rt={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},pi={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},Fi={startRow:0,startColumn:0,endRow:0,endColumn:0},Hi={row:0,column:0},Sr={id:"",sheetOrder:[],name:"",appVersion:"",locale:Kt.ZH_CN,styles:{},sheets:{},resources:[]},Nr=1e3,br=20,Lr=19,wr=73,vr=46,Dr=20,kt={type:Ie.GRID,name:"Sheet1",id:"sheet-01",tabColor:"",hidden:I.FALSE,rowCount:Nr,columnCount:br,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:wr,defaultRowHeight:Lr,mergeData:[],hideRow:[],hideColumn:[],cellData:{},rowData:{},columnData:{},status:I.FALSE,showGridlines:I.TRUE,rowHeader:{width:vr,hidden:I.FALSE},columnHeader:{height:Dr,hidden:I.FALSE},selections:["A1"],rightToLeft:I.FALSE,pluginMeta:{}},Ut={ff:"Times New Roman",fs:14,it:I.FALSE,bl:I.FALSE,ul:{s:I.FALSE},st:{s:I.FALSE},ol:{s:I.FALSE},tr:{a:0,v:I.FALSE},td:St.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:nt.UNSPECIFIED,vt:lt.UNSPECIFIED,tb:ut.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0}},Mr={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}};var Ur=(t=>(t.ARRAY_CONVERTOR="ARRAY_CONVERTOR",t.MATRIX_CONVERTOR="MATRIX_CONVERTOR",t))(Ur||{});class Tr{constructor(e={}){d(this,"_styles");d(this,"_cacheMap",new Bs(1e5));this._styles=e,this._generateCacheMap()}each(e){return Object.entries(this._styles).forEach(e),this}search(e,s){if(this._cacheMap.has(s))return this._cacheMap.get(s);const r=this._getExistingStyleId(e);return r||"-1"}get(e){return typeof e!="string"?e:(e=String(e),this._styles[e])}add(e,s){const r=m.generateRandomId(6);return this._styles[r]=e,this._cacheMap.set(s,r),r}setValue(e){if(e==null)return;const s=JSON.stringify(e),r=this.search(e,s);return r!=="-1"?r:this.add(e,s)}toJSON(){return this._styles}getStyleByCell(e){let s;e&&m.isObject(e.s)?s=e.s:s=(e==null?void 0:e.s)&&this.get(e.s);const r=e==null?void 0:e.interceptorStyle;return r?{...s,...r}:s}_generateCacheMap(){const{_styles:e,_cacheMap:s}=this;for(const r in e){const n=JSON.stringify(e[r]);s.set(n,r)}}_getExistingStyleId(e){const{_styles:s}=this;for(const r in s)if(m.diffValue(s[r],e))return r;return null}}function Bi(t){return t&&(t.s!==void 0||t.p!==void 0||t.v!==void 0)||t.f!==void 0||t.si!==void 0}function Wi(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 $i(t){if(t==null)return!0;const{v:e,f:s,si:r,p:n,s:i}=t;return!(!(e==null||typeof e=="string"&&e.length===0)||s!=null&&s.length>0||r!=null&&r.length>0||n!=null)}var De=(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))(De||{}),Pr=(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))(Pr||{}),xr=(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))(xr||{});class Gi{constructor(e,s){d(this,"_columnData",{});this._config=e,this._columnData=s}getColumnData(){return this._columnData}getColVisible(e){const{_columnData:s}=this,r=s[e];return r?r.hd!==I.TRUE:!0}getHiddenCols(e=0,s=k(this._columnData)-1){const r=[];let n=!1,i=-1;for(let o=e;o<=s;o++){const a=this.getColVisible(o);n&&a?(n=!1,r.push({rangeType:z.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!n&&!a&&(n=!0,i=o)}return n&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:s,rangeType:z.COLUMN}),r}getColumnDatas(e,s){const r={};let n=0;for(let i=e;i<e+s;i++){const o=this.getColumnOrCreate(i);r[n]=o,n++}return r}getSize(){return k(this._columnData)}getColumnWidth(e){const{_columnData:s}=this,r=this._config;let n=0;return n=(s[e]||{hd:I.FALSE,w:r.defaultColumnWidth}).w||r.defaultColumnWidth,n}getColumn(e){const s=this._columnData[e];if(s)return s}getColumnOrCreate(e){const{_columnData:s}=this,r=this._config,n=s[e];if(n)return n;const i={w:r.defaultColumnWidth,hd:I.FALSE};return this._columnData[e]=i,i}}function Dt(t,e){for(const s of e){const{ts:r={}}=s;if(r[t]==null)return I.FALSE;switch(t){case"bl":case"it":{if(r[t]===I.FALSE)return I.FALSE;break}case"ul":case"st":{if(r[t].s===I.FALSE)return I.FALSE;break}default:throw new Error(`unknown style key: ${t} in IStyleBase`)}}return I.TRUE}class _t{constructor(e,s,r){d(this,"_range");d(this,"_worksheet");this._deps=r,this._range=s,this._worksheet=e}static foreach(e,s){const{startRow:r,startColumn:n,endRow:i,endColumn:o}=e;for(let a=r;a<=i;a++)for(let c=n;c<=o;c++)s(a,c)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:e,endRow:s,startColumn:r,endColumn:n}=this._range,i=[];for(let o=e;o<=s;o++){const a=[];for(let c=r;c<=n;c++)a.push(this.getMatrix().getValue(o,c)||null);i.push(a)}return i}getMatrix(){const{startRow:e,endRow:s,startColumn:r,endColumn:n}=this._range,i=this._worksheet.getCellMatrix(),o=new j;for(let a=e;a<=s;a++)for(let c=r;c<=n;c++)o.setValue(a,c,i.getValue(a,c)||null);return o}getMatrixObject(){const{startRow:e,endRow:s,startColumn:r,endColumn:n}=this._range,i=this._worksheet.getCellMatrix(),o=new j;for(let a=e;a<=s;a++)for(let c=r;c<=n;c++)o.setValue(a-e,c-r,i.getValue(a,c)||{});return o}getA1Notation(){const{startRow:e,endRow:s,startColumn:r,endColumn:n}=this._range;let i,o;return r<n?(i=m.numToWord(r+1)+(e+1),o=m.numToWord(n+1)+(s+1)):(i=m.numToWord(n+1)+(s+1),o=m.numToWord(r+1)+(e+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const e=this._deps.getStyles();return this.getValues().map(s=>s.map(r=>{var i;const n=e.getStyleByCell(r);return((i=n==null?void 0:n.bg)==null?void 0:i.rgb)||Ut.bg.rgb}))}getCell(e,s){const{startRow:r,endRow:n,startColumn:i,endColumn:o}=this._range,a={startRow:r+e,endRow:r+e,startColumn:i+s,endColumn:i+s};return new _t(this._worksheet,a,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(e={}){return this.getObjectValues(e)[0][0]}getObjectValues(e={}){var a;const{startRow:s,endRow:r,startColumn:n,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(s,r,n,i).getData();if(e.isIncludeStyle){const c=this._deps.getStyles();for(let l=0;l<=r-s;l++)for(let u=0;u<=i-n;u++){if(o==null||((a=o==null?void 0:o[l])==null?void 0:a[u])==null)continue;const h=o[l][u].s;h&&(o[l][u].s=c.get(h))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const e=this._deps.getStyles();return this.getValues().map(s=>s.map(r=>{var i;const n=e.getStyleByCell(r);return((i=n==null?void 0:n.cl)==null?void 0:i.rgb)||Ut.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var s,r;const{p:e}=this.getValue()??{};return e&&Array.isArray((s=e.body)==null?void 0:s.textRuns)?Dt("ul",(r=e.body)==null?void 0:r.textRuns)===I.TRUE?{s:I.TRUE}:{s:I.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var s,r;const{p:e}=this.getValue()??{};return e&&Array.isArray((s=e.body)==null?void 0:s.textRuns)?Dt("st",(r=e.body)==null?void 0:r.textRuns)===I.TRUE?{s:I.TRUE}:{s:I.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 s,r;const{p:e}=this.getValue()??{};return e&&Array.isArray((s=e.body)==null?void 0:s.textRuns)?Dt("it",(r=e.body)==null?void 0:r.textRuns)===I.TRUE?xt.ITALIC:xt.NORMAL:this.getFontStyles()[0][0]}getFontStyles(){return this._getStyles("it")}getFontWeight(){var s,r;const{p:e}=this.getValue()??{};return e&&Array.isArray((s=e.body)==null?void 0:s.textRuns)?Dt("bl",(r=e.body)==null?void 0:r.textRuns)===I.TRUE?pt.BOLD:pt.NORMAL:this.getFontWeights()[0][0]}getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:e,_worksheet:s}=this,{startRow:r,endRow:n}=e;let i=0;for(let o=0;o<=n-r;o++){const a=s.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:s}=this._range;return s-e+1}getNumRows(){const{startRow:e,endRow:s}=this._range;return s-e+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(e=>e.map(s=>(s==null?void 0:s.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(s=>s.map(r=>e.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:e,_worksheet:s}=this,{startColumn:r,endColumn:n}=e;let i=0;for(let o=0;o<=n-r;o++)i+=s.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){_t.foreach(this._range,e)}_getStyles(e){const s=this._deps.getStyles();return this.getValues().map(r=>r.map(n=>{const i=s&&s.getStyleByCell(n);return i&&i[e]||Ut[e]}))}}class ki{constructor(e,s){d(this,"_rowData");this._config=e,this._rowData=s}getRowData(){return this._rowData}getRowDatas(e,s){const r={};let n=0;for(let i=e;i<e+s;i++){const o=this.getRowOrCreate(i);r[n]=o,n++}return r}getRowHeight(e,s=1){const{_rowData:r}=this,n=this._config;let i=0;for(let o=0;o<s;o++){const a=r[o+e]||{hd:I.FALSE,h:n.defaultRowHeight},{isAutoHeight:c,ah:l,h:u=n.defaultRowHeight}=a;i+=(c==null||c)&&typeof l=="number"?l:u}return i}getRow(e){return this._rowData[e]}getRowOrCreate(e){const{_rowData:s}=this,r=s[e];if(r)return r;const n=this._config,i={hd:I.FALSE,h:n.defaultRowHeight};return s[e]=i,i}getHiddenRows(e=0,s=k(this._rowData)-1){const r=[];let n=!1,i=-1;for(let o=e;o<=s;o++){const a=this.getRowVisible(o);n&&a?(n=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:z.ROW})):!n&&!a&&(n=!0,i=o)}return n&&r.push({startRow:i,endRow:s,startColumn:0,endColumn:0,rangeType:z.ROW}),r}getRowVisible(e){const s=this.getRow(e);return s?s.hd!==I.TRUE:!0}getSize(){return k(this._rowData)}}class pr extends T{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(s,r){for(const n of this._cellContentInterceptors){const i=n.getCell(s,r);if(typeof i<"u")return i}return null}registerCellContentInterceptor(s){if(this._cellContentInterceptors.includes(s))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptors.push(s),v(()=>tt(this._cellContentInterceptors,s))}registerRowFilteredInterceptor(s){if(this._rowFilteredInterceptors.includes(s))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptors.push(s),v(()=>tt(this._rowFilteredInterceptors,s))}registerRowVisibleInterceptor(s){if(this._rowVisibleInterceptors.includes(s))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowVisibleInterceptors.push(s),v(()=>tt(this._rowVisibleInterceptors,s))}registerColVisibleInterceptor(s){if(this._colVisibleInterceptors.includes(s))throw new Error("[SheetViewModel]: Interceptor already registered.");return this._colVisibleInterceptors.push(s),v(()=>tt(this._colVisibleInterceptors,s))}}class Nt{constructor(e,s){d(this,"_initialized");d(this,"_sheetId");d(this,"_snapshot");d(this,"_cellData");d(this,"_rowManager");d(this,"_columnManager");d(this,"_viewModel");this._styles=s;const r={...kt,mergeData:[],hideRow:[],hideColumn:[],cellData:{},rowData:{},columnData:{},rowHeader:{width:46,hidden:I.FALSE},columnHeader:{height:20,hidden:I.FALSE},selections:["A1"],rightToLeft:I.FALSE,pluginMeta:{},...e};this._snapshot=r;const{columnData:n,rowData:i,cellData:o}=this._snapshot;this._sheetId=this._snapshot.id??m.generateRandomId(6),this._initialized=!1,this._cellData=new j(o),this._rowManager=new ki(this._snapshot,i),this._columnManager=new Gi(this._snapshot,n),this._viewModel=new pr}__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,s=m.deepClone(e);return new Nt(s,this._styles)}getMergeData(){return this._snapshot.mergeData}getMergedCells(e,s){const r=this._snapshot.mergeData,n=[];for(let i=0;i<r.length;i++){const o=r[i];ct.intersects({startRow:e,startColumn:s,endRow:e,endColumn:s},o)&&n.push(o)}return n.length?n:null}getMergedCell(e,s){const r=this._snapshot.mergeData;for(let n=0;n<r.length;n++){const i=r[n];if(ct.intersects({startRow:e,startColumn:s,endRow:e,endColumn:s},i))return i}return null}getCell(e,s){return e<0||s<0?null:this._viewModel.getCell(e,s)}getCellRaw(e,s){return this.getCellMatrix().getValue(e,s)}getMatrixWithMergedCells(e,s,r,n){const i=this.getCellMatrix(),o=this._snapshot.mergeData.filter(c=>ct.intersects({startRow:e,startColumn:s,endRow:r,endColumn:n},c)),a=new j;return de(e,r,s,n).forEach((c,l)=>{const u=i.getValue(c,l);u&&a.setValue(c,l,u)}),o.forEach(c=>{const{startColumn:l,startRow:u,endColumn:h,endRow:f}=c;de(u,f,l,h).forEach((_,g)=>{_===u&&g===l&&a.setValue(_,g,{...i.getValue(_,g),rowSpan:f-u+1,colSpan:h-l+1}),(_!==u||g!==l)&&a.realDeleteValue(_,g)})}),a}getRange(e,s,r,n){return typeof e=="object"?new _t(this,e,{getStyles:()=>this._styles}):new _t(this,{startRow:e,startColumn:s,endColumn:n||s,endRow:r||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:s}=e;return s}getMaxRows(){const{_snapshot:e}=this,{rowCount:s}=e;return s}getType(){const{_snapshot:e}=this,{type:s}=e;return s}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:s}=e;return s===0}getTabColor(){const{_snapshot:e}=this,{tabColor:s}=e;return s}getColumnWidth(e){return this.getColumnManager().getColumnWidth(e)}getRowHeight(e){return this.getRowManager().getRowHeight(e)}getRowVisible(e){return this.getRowManager().getRowVisible(e)}getHiddenRows(e,s){const r=this.getMaxColumns()-1,n=this._rowManager.getHiddenRows(e,s);return n.forEach(i=>i.endColumn=r),n}getColVisible(e){return this._columnManager.getColVisible(e)}getHiddenCols(e,s){const r=this.getMaxRows()-1,n=this._columnManager.getHiddenCols(e,s);return n.forEach(i=>i.endRow=r),n}isRightToLeft(){const{_snapshot:e}=this,{rightToLeft:s}=e;return s}getPluginMeta(e){return this._snapshot.pluginMeta[e]}setPluginMeta(e,s){this._snapshot.pluginMeta[e]=s}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,ji=Object.getOwnPropertyDescriptor,zi=(t,e,s,r)=>{for(var n=r>1?void 0:r?ji(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(n=(r?o(e,s,n):o(n))||n);return r&&n&&Vi(e,s,n),n},Yi=(t,e)=>(s,r)=>e(s,r,t);function Ki(t,e){return`${t.getUnitId()}|${e.getSheetId()}`}exports.Workbook=class extends T{constructor(s={},r){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,"_activeSheet$",new N.BehaviorSubject(null));d(this,"activeSheet$",this._activeSheet$.asObservable());d(this,"_worksheets");d(this,"_styles");d(this,"_snapshot");d(this,"_unitId");d(this,"_count");this._log=r,this._snapshot=m.commonExtend(Sr,s);const{styles:n}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=m.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new Tr(n),this._count=1,this._worksheets=new Map,this._getDefaultWorkSheet()}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete()}save(){return m.deepClone(this._snapshot)}static isIRangeType(s){return typeof s=="string"||"startRow"in s||"row"in s}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(s,r,n){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[s])return!1;i[s]=n,o.splice(r,0,s);const a=new Nt(n,this._styles);return this._worksheets.set(s,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(s){const{sheetOrder:r}=this._snapshot;return r.findIndex(n=>n===s)}getRawActiveSheet(){const{sheetOrder:s}=this._snapshot;return s.find(n=>this._worksheets.get(n).getStatus()===I.TRUE)}getActiveSheet(){const{sheetOrder:s}=this._snapshot,r=this.getRawActiveSheet();return r?this._worksheets.get(r):this._worksheets.get(s[0])}__setActiveSheet(s){this._activeSheet$.next(s)}getActiveSheetIndex(){const{sheetOrder:s}=this._snapshot;return s.findIndex(r=>this._worksheets.get(r).getStatus()===1)}getSheetSize(){return this._snapshot.sheetOrder.length}flush(){}getSheets(){const{sheetOrder:s}=this._snapshot;return s.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:s}=this._snapshot,r=[];return s.forEach(n=>{const i=this._worksheets.get(n);i&&r.push(i.getName())}),r}getSheetIndex(s){const{sheetOrder:r}=this._snapshot;return r.findIndex(n=>s.getSheetId()===n)}getSheetBySheetName(s){const{sheetOrder:r}=this._snapshot,n=r.find(i=>this._worksheets.get(i).getName()===s);return this._worksheets.get(n)}getSheetBySheetId(s){return this._worksheets.get(s)}getSheetByIndex(s){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[s])}getHiddenWorksheets(){return this.getSheets().filter(s=>s.getConfig().hidden===I.TRUE).map(s=>s.getConfig().id)}transformRangeType(s){if(typeof s=="string")return this._getCellRange(s);if(typeof s!="string"&&"row"in s){const r=s;return{sheetId:"",range:{startRow:r.row[0],startColumn:r.column[0],endRow:r.row[1],endColumn:r.column[1]}}}return typeof s!="string"&&"startRow"in s?{sheetId:"",range:s}:Rt}load(s){this._snapshot=s}checkSheetName(s){return this.getSheetsName().includes(s)}uniqueSheetName(s="sheet1"){let r=s;for(;this.checkSheetName(r);)r=s+this._count,this._count++;return r}_getCellRange(s){var u,h,f,_,g;let r="",n="";if(s.indexOf("!")>-1){const E=s.split("!");r=E[0],n=E[1],r=r.replace(/\\'/g,"'").replace(/''/g,"'"),r.substring(0,1)==="'"&&r.substring(r.length-1,1)==="'"&&(r=r.substring(1,r.length-1))}else n=s;if(n.indexOf(":")===-1){const E=parseInt(n.replace(/[^0-9]/g,""),10)-1,R=m.ABCatNum(n.replace(/[^A-Za-z]/g,""));return!Number.isNaN(E)&&!Number.isNaN(R)?{sheetId:r,range:{startRow:E,endRow:E,startColumn:R,endColumn:R}}:Rt}n=n.split(":");const i=[0,0],o=[0,0],a=((u=this.getSheetBySheetName(r))==null?void 0:u.getMaxRows())||((h=this.getActiveSheet())==null?void 0:h.getMaxRows()),c=((f=this.getSheetBySheetName(r))==null?void 0:f.getMaxColumns())||((_=this.getActiveSheet())==null?void 0:_.getMaxColumns());return i[0]=parseInt(n[0].replace(/[^0-9]/g,""),10)-1,i[1]=parseInt(n[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]=m.ABCatNum(n[0].replace(/[^A-Za-z]/g,"")),o[1]=m.ABCatNum(n[1].replace(/[^A-Za-z]/g,"")),Number.isNaN(o[0])&&(o[0]=0),Number.isNaN(o[1])&&(o[1]=c),o[0]>o[1])?Rt:{sheetId:((g=this.getSheetBySheetName(r))==null?void 0:g.getSheetId())||"",range:{startRow:i[0],endRow:i[1],startColumn:o[0],endColumn:o[1]}}}_getDefaultWorkSheet(){const{_snapshot:s,_worksheets:r}=this,{sheets:n,sheetOrder:i}=s;m.isEmptyObject(n)&&(n[kt.id]=Object.assign(kt,{status:I.TRUE}));for(const o in n){const a=n[o],{name:c}=a;a.name=this.uniqueSheetName(c),a.name!==c&&this._log.warn(`The worksheet name ${c} is duplicated, we change it to ${a.name}`);const l=new Nt(a,this._styles);r.set(o,l),i.includes(o)||i.push(o)}}};exports.Workbook=zi([Yi(1,it)],exports.Workbook);class Me{constructor(e){d(this,"_snapshot");d(this,"_unitId");this._snapshot={...Mr,...e},this._unitId=this._snapshot.id??m.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 s=this.getPages();return s==null?void 0:s[e]}getElementsByPage(e){var s;return(s=this.getPage(e))==null?void 0:s.pageElements}getElement(e,s){var r;return(r=this.getElementsByPage(e))==null?void 0:r[s]}getPageSize(){return this._snapshot.pageSize}addPage(){return{id:"cover_1",pageType:De.SLIDE,zIndex:1,title:"cover",description:"this is first page, cover",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}}const Vt="FOCUSING_SHEET",_e="FOCUSING_DOC",fe="FOCUSING_SLIDE",Xi="FOCUSING_EDITOR_BUT_HIDDEN",Fr="FOCUSING_EDITOR",qi="FOCUSING_EDITOR_INPUT_FORMULA",Hr="FOCUSING_FORMULA_EDITOR";var Qi=Object.defineProperty,Zi=Object.getOwnPropertyDescriptor,Ji=(t,e,s,r)=>{for(var n=r>1?void 0:r?Zi(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(n=(r?o(e,s,n):o(n))||n);return r&&n&&Qi(e,s,n),n},yi=(t,e)=>(s,r)=>e(s,r,t),Br=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.DOC=1]="DOC",t[t.SHEET=2]="SHEET",t[t.SLIDE=3]="SLIDE",t))(Br||{});const ft=C.createIdentifier("univer.current");let ge=class extends T{constructor(e,s){super();d(this,"_focused",null);d(this,"_focused$",new N.BehaviorSubject(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=s}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,s){const r=this._docs.find(n=>n.getUnitId()===e);if(r!=null){const n=this._docs.indexOf(r);this._docs.splice(n,1)}this.addDoc(s)}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(s=>s.getUnitId()===e)}getUniverDocInstance(e){return this._docs.find(s=>s.getUnitId()===e)}getUniverSlideInstance(e){return this._slides.find(s=>s.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),[_e,Vt,fe].forEach(s=>this._contextService.setContextValue(s,!1)),this._focused instanceof exports.Workbook?this._contextService.setContextValue(Vt,!0):this._focused instanceof dt?this._contextService.setContextValue(_e,!0):this._focused instanceof Me&&this._contextService.setContextValue(fe,!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 s=this.getUniverDocInstance(e);if(s){const i=this._docs.indexOf(s);return this._docs.splice(i,1),this._docDisposed$.next(s),this.focusUniverInstance(null),!0}const r=this.getUniverSheetInstance(e);if(r){const i=this._sheets.indexOf(r);return this._sheets.splice(i,1),this._sheetDisposed$.next(r),this.focusUniverInstance(null),!0}const n=this.getUniverSlideInstance(e);if(n){const i=this._slides.indexOf(n);return this._slides.splice(i,1),this._slideDisposed$.next(n),this.focusUniverInstance(null),!0}return!1}};ge=Ji([yi(1,ht)],ge);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 Ve={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"},Tt=new Map;function Ue(t,e){return function(n){Te(t,e)}}function Te(t,e){Tt.has(t)||Tt.set(t,[]),Tt.get(t).push(e)}var to=Object.defineProperty,eo=Object.getOwnPropertyDescriptor,Wr=(t,e,s,r)=>{for(var n=r>1?void 0:r?eo(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(n=(r?o(e,s,n):o(n))||n);return r&&n&&to(e,s,n),n},Ee=(t,e)=>(s,r)=>e(s,r,t);exports.LifecycleService=class extends T{constructor(s){super();d(this,"_lifecycle$",new N.BehaviorSubject(w.Starting));d(this,"lifecycle$",this._lifecycle$.asObservable());this._logService=s,this._logService.log("[LifecycleService]",`lifecycle progressed to "${Ve[w.Starting]}".`)}get stage(){return this._lifecycle$.getValue()}set stage(s){if(s<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");s!==this.stage&&(this._logService.log("[LifecycleService]",`lifecycle progressed to "${Ve[s]}".`),this._lifecycle$.next(s))}subscribeWithPrevious(){return new N.Observable(s=>(this.stage===w.Starting||(this.stage===w.Ready?s.next(w.Starting):this.stage===w.Rendered?(s.next(w.Starting),s.next(w.Ready)):(s.next(w.Starting),s.next(w.Ready),s.next(w.Rendered))),this._lifecycle$.subscribe(s)))}};exports.LifecycleService=Wr([Ee(0,it)],exports.LifecycleService);let et=class extends T{constructor(e,s){super();d(this,"_started",!1);this._lifecycleService=e,this._injector=s}start(){this._started||(this._started=!0,this.disposeWithMe(v(this._lifecycleService.subscribeWithPrevious().subscribe(e=>this.initModulesOnStage(e)))))}initModulesOnStage(e){const s=Tt.get(e);s==null||s.forEach(r=>{this._injector.has(r)&&this._injector.get(r)})}};et=Wr([Ee(0,C.Inject(exports.LifecycleService)),Ee(1,C.Inject(C.Injector))],et);function so(t,e){if(t)try{return t[e]?t[e]:e.split(".").reduce((s,r)=>s[r],t)}catch{return console.warn("Key %s not found",e),e}}class mt extends T{constructor(){super();d(this,"currentLocale",Kt.ZH_CN);d(this,"locales",null);d(this,"localeChanged$",new N.Subject);d(this,"t",s=>{if(!this.locales)throw new Error("Locale not initialized");return so(this.locales[this.currentLocale],s)??s});this.disposeWithMe(v(()=>this.localeChanged$.complete()))}load(s){this.locales=m.deepMerge(this.locales??{},s)}setLocale(s){this.currentLocale=s,this.localeChanged$.next()}getLocales(){var s;return(s=this.locales)==null?void 0:s[this.currentLocale]}getCurrentLocale(){return this.currentLocale}}const Pe=C.createIdentifier("resource-manager-service"),$r=C.createIdentifier("ResourcePersistenceService");Te(w.Ready,$r);var ro=Object.defineProperty,no=Object.getOwnPropertyDescriptor,io=(t,e,s,r)=>{for(var n=r>1?void 0:r?no(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(n=(r?o(e,s,n):o(n))||n);return r&&n&&ro(e,s,n),n},je=(t,e)=>(s,r)=>e(s,r,t);const xe=C.createIdentifier("univer.permission-service"),ze="PERMISSION";exports.PermissionService=class extends T{constructor(s,r){super();d(this,"_permissionPointMap",new Map);d(this,"deletePermissionPoint",(s,r)=>{const n=this._permissionPointMap.get(s);if(n){const i=n.get(r);i&&(i.complete(),this._permissionPointMap.delete(r))}});d(this,"addPermissionPoint",(s,r)=>{const n=this._permissionPointMap.get(s)||new Map;return n.has(r.id)?!1:(n.set(r.id,new N.BehaviorSubject(r)),this._permissionPointMap.set(s,n),!0)});d(this,"updatePermissionPoint",(s,r,n)=>{const i=this._permissionPointMap.get(s);if(!i)return;const o=i.get(r);if(o){const a=o.getValue();a.value=n,a.status=Ne.DONE,o.next(a)}});d(this,"getPermissionPoint",(s,r)=>{const n=this._permissionPointMap.get(s);if(!n)return;const i=n.get(r);if(i)return i.getValue()});this._resourceManagerService=s,this._univerInstanceService=r}_init(){this.disposeWithMe(v(this._univerInstanceService.sheetAdded$.subscribe(s=>{this._resourceManagerService.registerPluginResource(s.getUnitId(),ze,{onChange:(r,n)=>{n.forEach(i=>{this.getPermissionPoint(r,i.id)?this.updatePermissionPoint(r,i.id,i.value):this.addPermissionPoint(r,i)})},toJson:r=>this._toJson(r),parseJson:r=>this._parseJson(r)})}))),this.disposeWithMe(v(this._univerInstanceService.sheetDisposed$.subscribe(s=>{this._resourceManagerService.disposePluginResource(s.getUnitId(),ze)})))}_toJson(s){const r=this._permissionPointMap.get(s);let n=[];return r&&(n=[...r.keys()].reduce((i,o)=>{const a=r.get(o);return a&&i.push(a.getValue()),i},[])),JSON.stringify(n)}_parseJson(s){return JSON.parse(s)}composePermission$(s,r){const n=this._permissionPointMap.get(s),i=r.map(o=>{const a=n==null?void 0:n.get(o);if(!a)throw new Error(`${o} permissionPoint is not exist`);return a.asObservable()});return N.combineLatest(i).pipe(yr.map(o=>(o.every(a=>this._permissionPointMap.get(a.id)),o)))}composePermission(s,r){const n=this._permissionPointMap.get(s);return r.map(o=>{const a=n==null?void 0:n.get(o);if(!a)throw new Error(`${o} permissionPoint is not exist`);return a.getValue()})}};exports.PermissionService=io([Ue(w.Starting,exports.PermissionService),je(0,C.Inject(Pe)),je(1,C.Inject(ft))],exports.PermissionService);const Gr="univer.editable";class Pt extends Ws{constructor(s){super();d(this,"id",Gr);d(this,"value",!0);d(this,"unitID");this.unitID=s}}var oo=Object.defineProperty,ao=Object.getOwnPropertyDescriptor,lo=(t,e,s,r)=>{for(var n=r>1?void 0:r?ao(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(n=(r?o(e,s,n):o(n))||n);return r&&n&&oo(e,s,n),n},Ye=(t,e)=>(s,r)=>e(s,r,t);exports.UniverPermissionService=class extends T{constructor(e,s){super(),this._permissionService=e,this._univerInstanceService=s,this._init()}_init(){this._univerInstanceService.sheetAdded$.subscribe(e=>{const s=new Pt(e.getUnitId());this._permissionService.addPermissionPoint(e.getUnitId(),s)})}getEditable(e){let s=e;s||(s=this._univerInstanceService.getCurrentUniverSheetInstance().getUnitId());const r=new Pt(s),n=this._permissionService.getPermissionPoint(s,r.id);return n==null?void 0:n.value}setEditable(e,s){const r=new Pt(e);this._permissionService.updatePermissionPoint(e,r.id,s)}};exports.UniverPermissionService=lo([Ue(w.Starting,exports.UniverPermissionService),Ye(0,C.Inject(xe)),Ye(1,C.Inject(ft))],exports.UniverPermissionService);class kr extends T{constructor(){super(...arguments);d(this,"_resourceMap",new Map);d(this,"_register$",new N.Subject);d(this,"register$",this._register$.asObservable())}getAllResource(s){const r=this._resourceMap.get(s);return r?[...r.keys()].reduce((n,i)=>{const o=r.get(i);return o&&n.push({unitID:s,resourceName:i,hook:o}),n},[]):[]}registerPluginResource(s,r,n){const i=this._resourceMap.get(s)||new Map;if(i.has(r))throw new Error("the pluginName is registered");return i.set(r,n),this._resourceMap.set(s,i),this._register$.next({unitID:s,resourceName:r,hook:n}),v(()=>i.delete(r))}disposePluginResource(s,r){const n=this._resourceMap.get(s);n==null||n.delete(r)}dispose(){this._register$.complete(),this._resourceMap.clear()}}class Re extends T{constructor(){super();d(this,"_currentTheme");d(this,"_currentTheme$",new N.BehaviorSubject({}));d(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(v(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(s){this._currentTheme=s,this._currentTheme$.next(s)}}const Vr="__defaultDocumentNormalEditorSpecialUnitId_20231006__",jr="__defaultDocumentFormulaBarEditorSpecialUnitId_20231012__",uo=`\r
|
|
11
|
+
`;var co=Object.defineProperty,ho=Object.getOwnPropertyDescriptor,_o=(t,e,s,r)=>{for(var n=r>1?void 0:r?ho(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(n=(r?o(e,s,n):o(n))||n);return r&&n&&co(e,s,n),n},re=(t,e)=>(s,r)=>e(s,r,t);const Qt=C.createIdentifier("univer.undo-redo.service"),fo=20;exports.LocalUndoRedoService=class extends T{constructor(s,r,n){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=s,this._commandService=r,this._contextService=n,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(Yr)),this.disposeWithMe(this._commandService.registerCommand(Kr)),this.disposeWithMe(v(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(v(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(s){const{unitID:r}=s,n=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);n.length=0,i.push(s),i.length>fo&&i.splice(0,1),this._updateStatus()}clearUndoRedo(s){const r=this._getRedoStack(s);r&&(r.length=0);const n=this._getUndoStack(s);n&&(n.length=0),this._updateStatus()}pitchTopUndoElement(){const s=this._getUndoStackForFocused();return s.length?s[s.length-1]:null}pitchTopRedoElement(){const s=this._getRedoStackForFocused();return s.length?s[s.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}_updateStatus(){var i,o;const s=this._getFocusedUniverInstanceId(),r=s&&((i=this._undoStacks.get(s))==null?void 0:i.length)||0,n=s&&((o=this._redoStacks.get(s))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:n})}_getUndoStack(s,r=!1){let n=this._undoStacks.get(s);return!n&&r&&(n=[],this._undoStacks.set(s,n)),n||null}_getRedoStack(s,r=!1){let n=this._redoStacks.get(s);return!n&&r&&(n=[],this._redoStacks.set(s,n)),n||null}_getUndoStackForFocused(){const s=this._getFocusedUniverInstanceId();if(!s)throw new Error("No focused univer instance!");return this._getUndoStack(s,!0)}_getRedoStackForFocused(){const s=this._getFocusedUniverInstanceId();if(!s)throw new Error("No focused univer instance!");return this._getRedoStack(s,!0)}_getFocusedUniverInstanceId(){var o,a;let s="";const r=this._contextService.getContextValue(Vt),n=this._contextService.getContextValue(Hr),i=this._contextService.getContextValue(Fr);return r?n?s=jr:i?s=Vr:s=((o=this._univerInstanceService.getFocusedUniverInstance())==null?void 0:o.getUnitId())??"":s=((a=this._univerInstanceService.getFocusedUniverInstance())==null?void 0:a.getUnitId())??"",s}};exports.LocalUndoRedoService=_o([re(0,ft),re(1,bt),re(2,ht)],exports.LocalUndoRedoService);class zr{dispose(){}async dispatchToHandlers(){return!1}}const Yr=new class extends zr{constructor(){super(...arguments);d(this,"type",Yt.COMMAND);d(this,"id","univer.command.undo")}async handler(e){const s=e.get(Qt),r=s.pitchTopUndoElement();if(!r)return!1;const n=e.get(bt);return(r.undo?await r.undo(r.undoMutations):Ae(r.undoMutations,n))?(s.popUndoToRedo(),!0):!1}},Kr=new class extends zr{constructor(){super(...arguments);d(this,"type",Yt.COMMAND);d(this,"id","univer.command.redo")}async handler(e){const s=e.get(Qt),r=s.pitchTopRedoElement();if(!r)return!1;const n=e.get(bt);return(r.redo?await r.redo(r.redoMutations):Ae(r.redoMutations,n))?(s.popRedoToUndo(),!0):!1}};class Zt extends T{constructor(){super(...arguments);d(this,"_started",!1)}addPlugins(s){if(this._started){const r=s.map(([n,i])=>this._initPlugin(n,i));this._pluginsRunLifecycle(r,w.Starting),setTimeout(()=>this._takePluginsThroughLifecycle(r))}else{const r=s.map(([n,i])=>this._initPlugin(n,i));this._takePluginsThroughLifecycle(r),this._started=!0}}_takePluginsThroughLifecycle(s,r=!1){this.disposeWithMe(v(this._lifecycleService.subscribeWithPrevious().subscribe(n=>{r&&n===w.Starting||this._pluginsRunLifecycle(s,n)})))}_pluginsRunLifecycle(s,r){s.forEach(n=>{switch(r){case w.Starting:n.onStarting(this._injector);break;case w.Ready:n.onReady();break;case w.Rendered:n.onRendered();break;case w.Steady:n.onSteady();break}}),this._lifecycleInitializerService.initModulesOnStage(r)}_initPlugin(s,r){return this._injector.createInstance(s,r)}}var go=Object.defineProperty,Eo=Object.getOwnPropertyDescriptor,Ro=(t,e,s,r)=>{for(var n=r>1?void 0:r?Eo(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(n=(r?o(e,s,n):o(n))||n);return r&&n&&go(e,s,n),n},ne=(t,e)=>(s,r)=>e(s,r,t);exports.UniverDoc=class extends Zt{constructor(e,s,r){super(),this._injector=e,this._lifecycleService=s,this._lifecycleInitializerService=r}createDoc(e){return this._injector.createInstance(dt,e)}};exports.UniverDoc=Ro([ne(0,C.Inject(C.Injector)),ne(1,C.Inject(exports.LifecycleService)),ne(2,C.Inject(et))],exports.UniverDoc);var mo=Object.defineProperty,Oo=Object.getOwnPropertyDescriptor,Ao=(t,e,s,r)=>{for(var n=r>1?void 0:r?Oo(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(n=(r?o(e,s,n):o(n))||n);return r&&n&&mo(e,s,n),n},ie=(t,e)=>(s,r)=>e(s,r,t);exports.UniverSheet=class extends Zt{constructor(e,s,r){super(),this._injector=e,this._lifecycleService=s,this._lifecycleInitializerService=r}createSheet(e){return this._injector.createInstance(exports.Workbook,e)}};exports.UniverSheet=Ao([ie(0,C.Inject(C.Injector)),ie(1,C.Inject(exports.LifecycleService)),ie(2,C.Inject(et))],exports.UniverSheet);var Io=Object.defineProperty,Co=Object.getOwnPropertyDescriptor,So=(t,e,s,r)=>{for(var n=r>1?void 0:r?Co(e,s):e,i=t.length-1,o;i>=0;i--)(o=t[i])&&(n=(r?o(e,s,n):o(n))||n);return r&&n&&Io(e,s,n),n},oe=(t,e)=>(s,r)=>e(s,r,t);exports.UniverSlide=class extends Zt{constructor(e,s,r){super(),this._injector=e,this._lifecycleService=s,this._lifecycleInitializerService=r}createSlide(e){return this._injector.createInstance(Me,e)}};exports.UniverSlide=So([oe(0,C.Inject(C.Injector)),oe(1,C.Inject(exports.LifecycleService)),oe(2,C.Inject(et))],exports.UniverSlide);const No=200;class bo extends Zt{constructor(s={}){super();d(this,"_injector");d(this,"_univerPluginStore",new sn);d(this,"_univerPluginRegistry",new rn);d(this,"_univerSheet",null);d(this,"_univerDoc",null);d(this,"_univerSlide",null);d(this,"_initLazyPluginsTimer");this._injector=this._initDependencies();const{theme:r,locale:n,locales:i,logLevel:o}=s;r&&this._injector.get(Re).setTheme(r),i&&this._injector.get(mt).load(i),n&&this._injector.get(mt).setLocale(n),o&&this._injector.get(it).setLogLevel(o)}get _univerInstanceService(){return this._injector.get(ft)}get _lifecycleService(){return this._injector.get(exports.LifecycleService)}get _lifecycleInitializerService(){return this._injector.get(et)}__getInjector(){return this._injector}dispose(){this._injector.dispose()}setLocale(s){this._injector.get(mt).setLocale(s)}createUniverSheet(s){let r;const n=()=>{r=this._univerSheet.createSheet(s),this._univerInstanceService.addSheet(r)};if(this._univerSheet)n();else{this._tryProgressToStart();const i=this._univerSheet=this._injector.createInstance(exports.UniverSheet),o=this._univerPluginRegistry.getRegisterPlugins(D.Sheet).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(D.Sheet),i.addPlugins(o),n(),this._tryProgressToReady()}return r}createUniverDoc(s){let r;const n=()=>{r=this._univerDoc.createDoc(s),this._univerInstanceService.addDoc(r)};if(this._univerDoc)n();else{this._tryProgressToStart();const i=this._univerDoc=this._injector.createInstance(exports.UniverDoc),o=this._univerPluginRegistry.getRegisterPlugins(D.Doc).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(D.Doc),i.addPlugins(o),n(),this._tryProgressToReady()}return r}createUniverSlide(s){let r;const n=()=>{r=this._univerSlide.createSlide(s),this._univerInstanceService.addSlide(r)};if(this._univerSlide)n();else{this._tryProgressToStart();const i=this._univerSlide=this._injector.createInstance(exports.UniverSlide),o=this._univerPluginRegistry.getRegisterPlugins(D.Slide).map(a=>[a.plugin,a.options]);this._univerPluginRegistry.clearPluginsOfType(D.Slide),i.addPlugins(o),n(),this._tryProgressToReady()}return r}_initDependencies(){return new C.Injector([[ft,{useFactory:s=>new ge({createUniverDoc:r=>this.createUniverDoc(r),createUniverSheet:r=>this.createUniverSheet(r),createUniverSlide:r=>this.createUniverSlide(r)},s),deps:[ht]}],[os],[mt],[Re],[exports.LifecycleService],[et],[xe,{useClass:exports.PermissionService}],[exports.UniverPermissionService],[it,{useClass:ns,lazy:!0}],[bt,{useClass:exports.CommandService,lazy:!0}],[Qt,{useClass:exports.LocalUndoRedoService,lazy:!0}],[is,{useClass:Rn}],[ht,{useClass:ss}],[ls,{useClass:as,lazy:!0}],[Pe,{useClass:kr,lazy:!0}]])}_tryProgressToStart(){this._started||(this._injector.get(et).start(),this._started=!0)}_tryProgressToReady(){this._injector.get(exports.LifecycleService).stage<w.Ready&&(this._injector.get(exports.LifecycleService).stage=w.Ready,this._univerPluginStore.forEachPlugin(r=>r.onReady()))}registerPlugin(s,r){if(s.type===D.Univer)this._registerUniverPlugin(s,r);else if(s.type===D.Sheet)this._registerSheetsPlugin(s,r);else if(s.type===D.Doc)this._registerDocsPlugin(s,r);else if(s.type===D.Slide)this._registerSlidesPlugin(s,r);else throw new Error(`Unimplemented plugin system for business: "${s.type}".`);if(this._started)return this._scheduleInitPluginAfterStarted()}_scheduleInitPluginAfterStarted(){this._initLazyPluginsTimer===void 0&&(this._initLazyPluginsTimer=setTimeout(()=>this._flushLazyPlugins(),No))}_flushLazyPlugins(){this._initLazyPluginsTimer=void 0;const s=this._univerPluginRegistry.getRegisterPlugins(D.Univer);if(s.length){this._univerPluginRegistry.clearPluginsOfType(D.Univer);const r=s.map(n=>this._injector.createInstance(n.plugin,n.options));this._takePluginsThroughLifecycle(r)}if(this._univerSheet){const r=this._univerPluginRegistry.getRegisterPlugins(D.Sheet).map(n=>[n.plugin,n.options]);r.length&&(this._univerSheet.addPlugins(r),this._univerPluginRegistry.clearPluginsOfType(D.Sheet))}if(this._univerDoc){const r=this._univerPluginRegistry.getRegisterPlugins(D.Doc).map(n=>[n.plugin,n.options]);r.length&&(this._univerDoc.addPlugins(r),this._univerPluginRegistry.clearPluginsOfType(D.Doc))}if(this._univerSlide){const r=this._univerPluginRegistry.getRegisterPlugins(D.Slide).map(n=>[n.plugin,n.options]);r.length&&(this._univerSlide.addPlugins(r),this._univerPluginRegistry.clearPluginsOfType(D.Slide))}}_registerUniverPlugin(s,r){if(this._started)this._univerPluginRegistry.registerPlugin(s,r);else{const n=this._injector.createInstance(s,r);n.onStarting(this._injector),this._univerPluginStore.addPlugin(n)}}_registerSheetsPlugin(s,r){this._univerPluginRegistry.registerPlugin(s,r)}_registerDocsPlugin(s,r){this._univerPluginRegistry.registerPlugin(s,r)}_registerSlidesPlugin(s,r){this._univerPluginRegistry.registerPlugin(s,r)}}function Lo(t){const e=new MessageChannel;let s=!1;return e.port1.onmessage=()=>{s||t()},e.port2.postMessage(null),()=>{s=!0}}class wo extends zt{add(e){if(!e)return null;const s=new jt(e,this);return this._observers=[s],this._onObserverAdded&&this._onObserverAdded(s),s}makeObserverTopPriority(){}makeObserverBottomPriority(){}}const vo=C.createIdentifier("ILocalStorageService"),Do=t=>`sheet_interceptor_${t}`,Xr=t=>function(e,s){let r=-1;function n(i,o){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");return r=i,i===t.length?o:t[i].handler(o,s,n.bind(null,i+1))}return n(0,e)};class Mo{constructor(e){d(this,"_interceptorsByName",new Map);d(this,"_interceptorPoints");this._interceptorPoints=e}fetchThroughInterceptors(e){const s=e,r=this._interceptorsByName.get(s);return Xr(r||[])}intercept(e,s){const r=e;this._interceptorsByName.has(r)||this._interceptorsByName.set(r,[]);const n=this._interceptorsByName.get(r);return n.push(s),this._interceptorsByName.set(r,n.sort((i,o)=>(o.priority??0)-(i.priority??0))),()=>tt(this._interceptorsByName.get(r),s)}getInterceptPoints(){return this._interceptorPoints}}const Ke=`'?\\[((?![\\/?:"<>|*\\\\]).)*\\]`,Uo=/[^0-9]/g,To=/[^A-Za-z]/g;function Ct(t){const e=t[0]==="$",r=t.substring(1).indexOf("$")>-1;return e&&r?Y.ALL:e?Y.COLUMN:r?Y.ROW:Y.NONE}function Po(t){const e=t.split("!");e.length>1&&(t=e[e.length-1]);const s=t.split(":");return s.length>1?{startAbsoluteRefType:Ct(s[0]),endAbsoluteRefType:Ct(s[1])}:{startAbsoluteRefType:Ct(s[0])}}function Xe(t=Y.NONE){let e="",s="";return t===Y.ROW?e="$":t===Y.COLUMN?s="$":t===Y.ALL&&(e="$",s="$"),{rowAbsoluteString:e,columnAbsoluteString:s}}function Jt(t){const{startColumn:e,startRow:s,endColumn:r,endRow:n,startAbsoluteRefType:i,endAbsoluteRefType:o}=t,a=Xe(i),c=Xe(o),l=`${a.columnAbsoluteString}${m.chatAtABC(e)}${a.rowAbsoluteString}${s+1}`,u=`${c.columnAbsoluteString}${m.chatAtABC(r)}${c.rowAbsoluteString}${n+1}`;return l===u?l:`${l}:${u}`}function qr(t,e){return`${t}!${Jt(e)}`}function Qr(t,e,s){return`[${t}]${e}!${Jt(s)}`}function xo(t){const{unitId:e,sheetName:s,range:r}=t;return e!=null&&e.length>0&&s!=null&&s.length>0?Qr(e,s,r):s!=null&&s.length>0?qr(s,r):Jt(r)}function ae(t){const e=parseInt(t.replace(Uo,""))-1,s=m.ABCatNum(t.replace(To,"")),r=Ct(t);return{row:e,column:s,absoluteRefType:r}}function po(t){const e=new RegExp(Ke).exec(t);let s="";e!=null&&(s=e[0],t=t.replace(new RegExp(Ke,"g"),""));const r=t.indexOf("!");let n="",i="";r>-1?(n=t.substring(0,r),i=t.substring(r)):i=t;const o=i.indexOf(":");if(o===-1){const E=ae(i),R=E.row,O=E.column,A=E.absoluteRefType;return{unitId:s,sheetName:n,range:{startRow:R,startColumn:O,endRow:R,endColumn:O,startAbsoluteRefType:A,endAbsoluteRefType:A}}}const a=i.substring(0,o),c=i.substring(o+1),l=ae(a),u=ae(c),h=l.row,f=l.column,_=u.row,g=u.column;return{unitId:s,sheetName:n,range:{startRow:h,startColumn:f,endRow:_,endColumn:g,startAbsoluteRefType:l.absoluteRefType,endAbsoluteRefType:u.absoluteRefType}}}tn();exports.ABCToNumber=gi;exports.AbsoluteRefType=Y;exports.AlignTypeH=Or;exports.AlignTypeV=Ar;exports.AutoFillSeries=ds;exports.BaselineOffset=Ft;exports.BlockType=er;exports.BooleanNumber=I;exports.BorderStyleTypes=b;exports.BorderType=_s;exports.BulletAlignment=Z;exports.COLORS=le;exports.CellValueType=At;exports.Color=ot;exports.ColorBuilder=qt;exports.ColorKit=G;exports.ColorType=W;exports.ColumnSeparatorType=nr;exports.CommandType=Yt;exports.CommonHideTypes=fs;exports.ConditionType=gs;exports.ContentAlignment=fr;exports.ContextService=ss;exports.CopyPasteType=Es;exports.CustomRangeType=tr;exports.DEFAULT_CELL=Hi;exports.DEFAULT_DOC=ve;exports.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=mn;exports.DEFAULT_EMPTY_DOCUMENT_VALUE=uo;exports.DEFAULT_RANGE=pi;exports.DEFAULT_RANGE_ARRAY=Rt;exports.DEFAULT_SELECTION=Fi;exports.DEFAULT_SLIDE=Mr;exports.DEFAULT_STYLES=Ut;exports.DEFAULT_WORKBOOK=Sr;exports.DEFAULT_WORKSHEET=kt;exports.DEFAULT_WORKSHEET_COLUMN_COUNT=br;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Dr;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH=wr;exports.DEFAULT_WORKSHEET_ROW_COUNT=Nr;exports.DEFAULT_WORKSHEET_ROW_HEIGHT=Lr;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=vr;exports.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=jr;exports.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=Vr;exports.DashStyleType=hr;exports.DataStreamTreeNodeType=ks;exports.DataStreamTreeTokenType=be;exports.DesktopLogService=ns;exports.DeveloperMetadataVisibility=Rs;exports.Dimension=ms;exports.Direction=Os;exports.Disposable=T;exports.DisposableCollection=es;exports.DocStyleType=Js;exports.DocumentDataModel=dt;exports.EXTENSION_NAMES=Ur;exports.Entry=ce;exports.EntryIterator=Hs;exports.ErrorService=os;exports.EventState=ye;exports.FOCUSING_DOC=_e;exports.FOCUSING_EDITOR=Fr;exports.FOCUSING_EDITOR_BUT_HIDDEN=Xi;exports.FOCUSING_EDITOR_INPUT_FORMULA=qi;exports.FOCUSING_FORMULA_EDITOR=Hr;exports.FOCUSING_SHEET=Vt;exports.FOCUSING_SLIDE=fe;exports.FloatingObjectManagerService=as;exports.FollowNumberWithType=ys;exports.FontItalic=xt;exports.FontStyleType=gr;exports.FontWeight=pt;exports.FormatType=As;exports.GlyphType=It;exports.GridType=sr;exports.HLSColor=ws;exports.HorizontalAlign=nt;exports.ICommandService=bt;exports.IConfigService=is;exports.IContextService=ht;exports.IFloatingObjectManagerService=ls;exports.ILocalStorageService=vo;exports.ILogService=it;exports.IPermissionService=xe;exports.IResourceManagerService=Pe;exports.ISnapshotPersistenceService=$r;exports.IUndoRedoService=Qt;exports.IUniverInstanceService=ft;exports.InterceptorManager=Mo;exports.InterpolationPointType=Is;exports.KeyIterator=ps;exports.LRUHelper=Et;exports.LRUMap=Bs;exports.LifecycleStages=w;exports.LocaleService=mt;exports.LocaleType=Kt;exports.LogLevel=rs;exports.MemoryCursor=us;exports.NamedStyleType=ur;exports.NumberUnitType=mr;exports.ObjectMatrix=j;exports.ObjectRelativeFromH=Er;exports.ObjectRelativeFromV=Rr;exports.Observable=zt;exports.ObservableHooks=wo;exports.Observer=jt;exports.OnLifecycle=Ue;exports.PRESET_LIST_TYPE=bi;exports.PageElementType=Pr;exports.PageOrientType=Cr;exports.PageType=De;exports.ParagraphElementType=or;exports.PermissionPoint=Ws;exports.PermissionStatus=Ne;exports.Plugin=qe;exports.PluginType=D;exports.PositionedObjectLayoutType=lr;exports.PresetListType=Gt;exports.ProtectionType=Cs;exports.RANGE_TYPE=z;exports.RGBA_PAREN=Sn;exports.RGB_PAREN=Cn;exports.Range=_t;exports.Rectangle=ct;exports.RedoCommand=Kr;exports.RefAlias=fi;exports.Registry=me;exports.RegistryAsMap=Oe;exports.RelativeDate=Ss;exports.RelativeSlideLink=xr;exports.ResourceManagerService=kr;exports.RgbColor=Ht;exports.RxDisposable=cn;exports.SectionType=rr;exports.ShapeType=Ns;exports.SheetTypes=Ie;exports.SheetViewModel=pr;exports.Slide=Me;exports.SpacingRule=cr;exports.Styles=Tr;exports.THEME_COLORS=Ls;exports.TabStopAlignment=dr;exports.TextDecoration=bs;exports.TextDirection=St;exports.TextDirectionType=ir;exports.ThemeColor=Bt;exports.ThemeColorType=p;exports.ThemeColors=Xt;exports.ThemeService=Re;exports.Tools=m;exports.UndoCommand=Yr;exports.Univer=bo;exports.UniverEditablePermission=Pt;exports.UniverEditablePermissionPoint=Gr;exports.UniverInstanceType=Br;exports.UpdateDocsAttributeType=P;exports.ValueIterator=Fs;exports.VerticalAlign=lt;exports.WidthType=_r;exports.Worksheet=Nt;exports.WrapStrategy=ut;exports.WrapTextType=ar;exports.binarySearchArray=cs;exports.characterSpacingControlType=Ir;exports.checkParagraphHasBullet=Kn;exports.checkParagraphHasIndent=Xn;exports.checkParagraphHasIndentByStyle=Ms;exports.codeToBlob=An;exports.composeInterceptors=Xr;exports.concatMatrixArray=li;exports.createInterceptorKey=Do;exports.createRowColIter=de;exports.datenum_local=xs;exports.dedupe=nn;exports.deepCompare=Ce;exports.deleteContent=Ts;exports.deserializeRangeWithSheet=po;exports.error=ue;exports.fromObservable=un;exports.generate=ri;exports.getAbsoluteRefTypeWitString=Po;exports.getAbsoluteRefTypeWithSingleString=Ct;exports.getArrayLength=k;exports.getBorderStyleType=zn;exports.getCellValueType=Wi;exports.getColorStyle=V;exports.getDocsUpdateBody=Mt;exports.getReverseDirection=In;exports.getTypeFromPermissionItemList=di;exports.getWorksheetUID=Ki;exports.handleJsonToDom=Vn;exports.handleStyleToString=jn;exports.hashAlgorithm=ii;exports.horizontalLineSegmentsSubtraction=Se;exports.insertMatrixArray=oi;exports.insertTextToContent=Us;exports.isEmptyCell=$n;exports.isFormulaId=kn;exports.isFormulaString=Gn;exports.isICellData=Bi;exports.isNullCell=$i;exports.isObserver=ts;exports.isRealNum=rt;exports.isSameStyleTextRun=Ds;exports.isValidRange=Yn;exports.makeCellRangeToRangeData=Wn;exports.makeCellToSelection=Bn;exports.moveMatrixArray=he;exports.numberToABC=Ri;exports.numberToListABC=mi;exports.orderSearchArray=hs;exports.remove=tt;exports.repeatStringNumTimes=Gs;exports.requestImmediateMacroTask=Lo;exports.runOnLifecycle=Te;exports.searchArray=On;exports.selectionToArray=_i;exports.sequence=Ze;exports.sequenceAsync=Qe;exports.sequenceExecute=Ae;exports.sequenceExecuteAsync=En;exports.serializeRange=Jt;exports.serializeRangeToRefString=xo;exports.serializeRangeWithSheet=qr;exports.serializeRangeWithSpreadsheet=Qr;exports.sliceMatrixArray=ui;exports.sortRules=Oi;exports.sortRulesByDesc=Ai;exports.sortRulesFactory=gt;exports.spliceArray=ai;exports.toDisposable=v;exports.update=ni;
|