@univerjs/core 0.21.1 → 0.22.0
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/README.md +22 -49
- package/lib/cjs/facade.js +8 -7
- package/lib/cjs/index.js +618 -571
- package/lib/es/facade.js +8 -7
- package/lib/es/index.js +618 -572
- package/lib/facade.js +8 -7
- package/lib/index.js +618 -572
- package/lib/types/docs/data-model/types.d.ts +17 -17
- package/lib/types/index.d.ts +1 -1
- package/lib/types/sheets/worksheet.d.ts +1 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +9 -9
- package/package.json +14 -10
package/lib/umd/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@wendellhu/redi`),require(`@univerjs/protocol`),require(`rxjs`),require(`rxjs/operators`),require(`@univerjs/themes`)):typeof define==`function`&&define.amd?define([`exports`,`@wendellhu/redi`,`@univerjs/protocol`,`rxjs`,`rxjs/operators`,`@univerjs/themes`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore={},e[`@wendellhu/redi`],e.UniverProtocol,e.rxjs,e.rxjs.operators,e.UniverThemes))})(this,function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=Object.create,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,f=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),p=(e,t)=>{let n={};for(var r in e)s(n,r,{get:e[r],enumerable:!0});return t||s(n,Symbol.toStringTag,{value:`Module`}),n},m=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=l(t),a=0,o=i.length,u;a<o;a++)u=i[a],!d.call(e,u)&&u!==n&&s(e,u,{get:(e=>t[e]).bind(null,u),enumerable:!(r=c(t,u))||r.enumerable});return e},h=(e,t,n)=>(n=e==null?{}:o(u(e)),m(t||!e||!e.__esModule?s(n,`default`,{value:e,enumerable:!0}):n,e));let g=typeof global<`u`?global:typeof self<`u`?self:window;function _(){let e=new Map,t=0;typeof g.requestIdleCallback!=`function`&&(g.requestIdleCallback=function(n){let r=Date.now(),i=++t,a=setTimeout(function(){e.delete(i);let t=Math.max(0,50-(Date.now()-r));n({didTimeout:t===0,timeRemaining(){return t}})},1);return e.set(i,a),i}),typeof g.cancelIdleCallback!=`function`&&(g.cancelIdleCallback=function(t){let n=e.get(t);n!==void 0&&(clearTimeout(n),e.delete(t))})}function v(){typeof g.Array.prototype.findLastIndex!=`function`&&(g.Array.prototype.findLastIndex=function(e,t){if(this==null)throw TypeError(`Array.prototype.findLastIndex called on null or undefined`);if(typeof e!=`function`)throw TypeError(`callback must be a function`);let n=this.length>>>0;for(let r=n-1;r>=0;r--)if(r in this&&e.call(t,this[r],r,this))return r;return-1}),typeof g.Array.prototype.findLast!=`function`&&(g.Array.prototype.findLast=function(e,t){let n=this.findLastIndex(e,t);return n===-1?void 0:this[n]})}function y(){typeof g.String.prototype.at!=`function`&&(g.String.prototype.at=function(e){if(this==null)throw TypeError(`String.prototype.at called on null or undefined`);let t=this.length;if(e<0&&(e=t+e),!(e<0||e>=t))return this.charAt(e)})}function b(){_(),v(),y()}function x(e,t){let n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function S(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function C(e,t){let n=new Set,r=[];for(let i of e){let e=t(i);n.has(e)||(n.add(e),r.push(i))}return r}function w(e,t){for(let n=e.length-1;n>-1;n--){let r=e[n];if(t(r,n))return r}return null}function T(e,t){if(e.length===0)return e;let n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function E(e,t){let n=new Map;return e.forEach(e=>{let r=t(e),i=n.get(r);n.has(r)||(i=[],n.set(r,i)),i.push(e)}),n}function D(e){return Array.isArray(e)?e:[e]}var O=f(((e,t)=>{var n=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process>`u`||process.domain===void 0)throw Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||n.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||n.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||n.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=n.DEFAULT_MAX_PENDING};n.DEFAULT_TIMEOUT=0,n.DEFAULT_MAX_OCCUPATION_TIME=0,n.DEFAULT_MAX_EXECUTION_TIME=0,n.DEFAULT_MAX_PENDING=1e3,n.prototype.acquire=function(e,t,n,r){if(Array.isArray(e))return this._acquireBatch(e,t,n,r);if(typeof t!=`function`)throw Error(`You must pass a function to execute`);var i=null,a=null,o=null;typeof n!=`function`&&(r=n,n=null,o=new this.Promise(function(e,t){i=e,a=t})),r=r||{};var s=!1,c=null,l=null,u=null,d=this,f=function(t,r,c){l&&(clearTimeout(l),l=null),u&&(clearTimeout(u),u=null),t&&(d.queues[e]&&d.queues[e].length===0&&delete d.queues[e],d.domainReentrant&&delete d.domains[e]),s||(o?r?a(r):i(c):typeof n==`function`&&n(r,c),s=!0),t&&d.queues[e]&&d.queues[e].length>0&&d.queues[e].shift()()},p=function(n){if(s)return f(n);c&&(clearTimeout(c),c=null),d.domainReentrant&&n&&(d.domains[e]=process.domain);var i=r.maxExecutionTime||d.maxExecutionTime;if(i&&(u=setTimeout(function(){d.queues[e]&&f(n,Error(`Maximum execution time is exceeded `+e))},i)),t.length===1){var a=!1;try{t(function(e,t){a||(a=!0,f(n,e,t))})}catch(e){a||(a=!0,f(n,e))}}else d._promiseTry(function(){return t()}).then(function(e){f(n,void 0,e)},function(e){f(n,e)})};d.domainReentrant&&process.domain&&(p=process.domain.bind(p));var m=r.maxPending||d.maxPending;if(!d.queues[e])d.queues[e]=[],p(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[e])p(!1);else if(d.queues[e].length>=m)f(!1,Error(`Too many pending tasks in queue `+e));else{var h=function(){p(!0)};r.skipQueue?d.queues[e].unshift(h):d.queues[e].push(h);var g=r.timeout||d.timeout;g&&(c=setTimeout(function(){c=null,f(!1,Error(`async-lock timed out in queue `+e))},g))}var _=r.maxOccupationTime||d.maxOccupationTime;if(_&&(l=setTimeout(function(){d.queues[e]&&f(!1,Error(`Maximum occupation time is exceeded in queue `+e))},_)),o)return o},n.prototype._acquireBatch=function(e,t,n,r){typeof n!=`function`&&(r=n,n=null);var i=this,a=function(e,t){return function(n){i.acquire(e,t,n,r)}},o=e.reduceRight(function(e,t){return a(t,e)},t);if(typeof n==`function`)o(n);else return new this.Promise(function(e,t){o.length===1?o(function(n,r){n?t(n):e(r)}):e(o())})},n.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},n.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(e){return this.Promise.reject(e)}},t.exports=n})),k=h(f(((e,t)=>{t.exports=O()}))());let A=new Set([`true`,`false`]);function j(e){return A.has(e.toLowerCase())}let M=`__INTERNAL_EDITOR__`,N=`${M}DOCS_NORMAL`,ee=`${M}DOCS_FORMULA_BAR`,te=`${M}ZEN_EDITOR`,ne=`${M}COMMENT_EDITOR`,re=Symbol(`AUTO_HEIGHT_FOR_MERGED_CELLS`);function ie(e){return`${M}${e}`}function P(e){return e.startsWith(M)}function ae(e){return e.startsWith(ne)}function oe(e,t){t.forEach(t=>e.add(t))}function se(e,t){t.forEach(([t])=>{e.has(t)&&e.get(t)})}function ce(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=Object.prototype.hasOwnProperty.bind(t);for(let r=0;r<n.length;r++){let a=n[r];if(!i(a)||e[a]!==t[a])return!1}return!0}var le=class extends Error{constructor(e){super(e),this.name=`CustomCommandExecutionError`}},ue=class extends le{constructor(){super(`Canceled by facade`),this.name=`CanceledError`}};function de(e,t=16){let n=0,r=null;return function(...i){let a=Date.now();a-n<t?(r&&clearTimeout(r),r=setTimeout(()=>{n=a,e.apply(this,i)},t)):(n=a,e.apply(this,i))}}function fe(e){"@babel/helpers - typeof";return fe=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},fe(e)}function pe(e,t){if(fe(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(fe(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function me(e){var t=pe(e,`string`);return fe(t)==`symbol`?t:t+``}function F(e,t,n){return(t=me(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let he=function(e){return e[e.Style=1]=`Style`,e[e.Value=2]=`Value`,e}({});function ge(e){return`sheet_interceptor_${e}`}let _e=e=>function(t,n){let r=-1,i=t;for(let t=0;t<=e.length;t++){if(t<=r)throw Error(`[SheetInterceptorService]: next() called multiple times!`);if(r=t,t===e.length)return i;let a=e[t],o=!1;if(i=a.handler(i,n,e=>(o=!0,e)),!o)break}return i};var ve=class{constructor(e){F(this,`_interceptorsByName`,new Map),F(this,`_interceptorPoints`,void 0),this._interceptorPoints=e}fetchThroughInterceptors(e,t){let n=e,r=this._interceptorsByName.get(n);return t&&(r=r.filter(t)),_e(r||[])}intercept(e,t){let n=e;this._interceptorsByName.has(n)||this._interceptorsByName.set(n,[]);let r=this._interceptorsByName.get(n);return r.push(t),this._interceptorsByName.set(n,r.sort((e,t)=>{var n,r;return((n=t.priority)==null?0:n)-((r=e.priority)==null?0:r)})),()=>x(this._interceptorsByName.get(n),t)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}};function ye(e){return`sheet_async_interceptor_${e}`}let be=e=>async function(t,n){let r=-1,i=t;for(let t=0;t<=e.length;t++){if(t<=r)throw Error(`[SheetInterceptorService]: next() called multiple times!`);if(r=t,t===e.length)return i;let a=e[t],o=!1;if(i=await a.handler(i,n,async e=>(o=!0,e)),!o)break}return i};var xe=class{constructor(e){F(this,`_asyncInterceptorsByName`,new Map),F(this,`_asyncInterceptorPoints`,void 0),this._asyncInterceptorPoints=e}fetchThroughAsyncInterceptors(e,t){let n=e,r=this._asyncInterceptorsByName.get(n);return t&&(r=r.filter(t)),be(r||[])}async interceptAsync(e,t){let n=e;this._asyncInterceptorsByName.has(n)||this._asyncInterceptorsByName.set(n,[]);let r=this._asyncInterceptorsByName.get(n);return r.push(t),this._asyncInterceptorsByName.set(n,r.sort((e,t)=>{var n,r;return((n=t.priority)==null?0:n)-((r=e.priority)==null?0:r)})),()=>x(this._asyncInterceptorsByName.get(n),t)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}};function Se(e){return e.map(e=>e/255)}function Ce(e){return e.map(e=>Math.round(e*255))}function we([e,t,n]){let r=Math.max(e,t,n),i=Math.min(e,t,n),a=(r+i)/2,o=0,s=0;if(r!==i){let c=r-i;switch(s=a>.5?c/(2-r-i):c/(r+i),r){case e:o=(t-n)/c+(t<n?6:0);break;case t:o=(n-e)/c+2;break;case n:o=(e-t)/c+4;break}o/=6}return[o,s,a]}function Te(e,t,n){let r=[e,t,n].map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4);return .2126*r[0]+.7152*r[1]+.0722*r[2]}function Ee(e,t){return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function De(e,t,n){let r,i,a;if(t===0)r=i=a=n;else{let o=(e,t,n)=>{let r=n;return r<0&&(r+=1),r>1&&--r,r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e},s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return[r,i,a]}let Oe={r:1,g:1,b:1},ke={r:0,g:0,b:0},Ae=Te(Oe.r,Oe.g,Oe.b),je=Te(ke.r,ke.g,ke.b);function Me(e){let t=Ee(Ae,Te(e[0],e[1],e[2])),n=we(e),r=1-n[2],i,a,o;do i=De(n[0],n[1],r),a=Te(i[0],i[1],i[2]),o=Ee(a,je),r+=.01;while(r<=1&&r>=0&&Math.abs(o-t)<.01);return i}function Ne(e){return Ce(Me(Se(e)))}let Pe=[[.333,-.667,-.667,0,1],[-.667,.333,-.667,0,1],[-.667,-.667,.333,0,1],[0,0,0,1,0]];function Fe(e){let t=e[0],n=e[1],r=e[2],i=[Pe[0][0]*t+Pe[0][1]*n+Pe[0][2]*r+Pe[0][4],Pe[1][0]*t+Pe[1][1]*n+Pe[1][2]*r+Pe[1][4],Pe[2][0]*t+Pe[2][1]*n+Pe[2][2]*r+Pe[2][4]];return i=i.map(e=>e>1?1:e<0?0:e),i}function Ie(e){return Ce(Fe(Se(e)))}var Le=typeof global==`object`&&global&&global.Object===Object&&global,Re=typeof self==`object`&&self&&self.Object===Object&&self,ze=Le||Re||Function(`return this`)(),Be=ze.Symbol,Ve=Object.prototype,He=Ve.hasOwnProperty,Ue=Ve.toString,We=Be?Be.toStringTag:void 0;function Ge(e){var t=He.call(e,We),n=e[We];try{e[We]=void 0;var r=!0}catch{}var i=Ue.call(e);return r&&(t?e[We]=n:delete e[We]),i}var Ke=Object.prototype.toString;function qe(e){return Ke.call(e)}var Je=`[object Null]`,Ye=`[object Undefined]`,Xe=Be?Be.toStringTag:void 0;function Ze(e){return e==null?e===void 0?Ye:Je:Xe&&Xe in Object(e)?Ge(e):qe(e)}function Qe(e){return typeof e==`object`&&!!e}var $e=`[object Symbol]`;function et(e){return typeof e==`symbol`||Qe(e)&&Ze(e)==$e}function tt(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var nt=Array.isArray,rt=1/0,it=Be?Be.prototype:void 0,at=it?it.toString:void 0;function ot(e){if(typeof e==`string`)return e;if(nt(e))return tt(e,ot)+``;if(et(e))return at?at.call(e):``;var t=e+``;return t==`0`&&1/e==-rt?`-0`:t}var st=/\s/;function ct(e){for(var t=e.length;t--&&st.test(e.charAt(t)););return t}var lt=/^\s+/;function ut(e){return e&&e.slice(0,ct(e)+1).replace(lt,``)}function dt(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var ft=NaN,pt=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,ht=/^0o[0-7]+$/i,gt=parseInt;function _t(e){if(typeof e==`number`)return e;if(et(e))return ft;if(dt(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=dt(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=ut(e);var n=mt.test(e);return n||ht.test(e)?gt(e.slice(2),n?2:8):pt.test(e)?ft:+e}function vt(e){return e}var yt=`[object AsyncFunction]`,bt=`[object Function]`,xt=`[object GeneratorFunction]`,St=`[object Proxy]`;function Ct(e){if(!dt(e))return!1;var t=Ze(e);return t==bt||t==xt||t==yt||t==St}var wt=ze[`__core-js_shared__`],Tt=function(){var e=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function Et(e){return!!Tt&&Tt in e}var Dt=Function.prototype.toString;function Ot(e){if(e!=null){try{return Dt.call(e)}catch{}try{return e+``}catch{}}return``}var kt=/[\\^$.*+?()[\]{}|]/g,At=/^\[object .+?Constructor\]$/,jt=Function.prototype,Mt=Object.prototype,Nt=jt.toString,Pt=Mt.hasOwnProperty,Ft=RegExp(`^`+Nt.call(Pt).replace(kt,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function It(e){return!dt(e)||Et(e)?!1:(Ct(e)?Ft:At).test(Ot(e))}function Lt(e,t){return e==null?void 0:e[t]}function Rt(e,t){var n=Lt(e,t);return It(n)?n:void 0}var zt=Object.create,Bt=function(){function e(){}return function(t){if(!dt(t))return{};if(zt)return zt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Vt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ht(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Ut=800,Wt=16,Gt=Date.now;function Kt(e){var t=0,n=0;return function(){var r=Gt(),i=Wt-(r-n);if(n=r,i>0){if(++t>=Ut)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function qt(e){return function(){return e}}var Jt=function(){try{var e=Rt(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Yt=Kt(Jt?function(e,t){return Jt(e,`toString`,{configurable:!0,enumerable:!1,value:qt(t),writable:!0})}:vt),Xt=9007199254740991,Zt=/^(?:0|[1-9]\d*)$/;function Qt(e,t){var n=typeof e;return t=t==null?Xt:t,!!t&&(n==`number`||n!=`symbol`&&Zt.test(e))&&e>-1&&e%1==0&&e<t}function $t(e,t,n){t==`__proto__`&&Jt?Jt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function en(e,t){return e===t||e!==e&&t!==t}var tn=Object.prototype.hasOwnProperty;function nn(e,t,n){var r=e[t];(!(tn.call(e,t)&&en(r,n))||n===void 0&&!(t in e))&&$t(e,t,n)}function rn(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?$t(n,s,c):nn(n,s,c)}return n}var an=Math.max;function on(e,t,n){return t=an(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=an(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Vt(e,this,s)}}function sn(e,t){return Yt(on(e,t,vt),e+``)}var cn=9007199254740991;function ln(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=cn}function un(e){return e!=null&&ln(e.length)&&!Ct(e)}function dn(e,t,n){if(!dt(n))return!1;var r=typeof t;return(r==`number`?un(n)&&Qt(t,n.length):r==`string`&&t in n)?en(n[t],e):!1}function fn(e){return sn(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&dn(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var pn=Object.prototype;function mn(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||pn)}function hn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var gn=`[object Arguments]`;function _n(e){return Qe(e)&&Ze(e)==gn}var vn=Object.prototype,yn=vn.hasOwnProperty,bn=vn.propertyIsEnumerable,xn=_n(function(){return arguments}())?_n:function(e){return Qe(e)&&yn.call(e,`callee`)&&!bn.call(e,`callee`)};function Sn(){return!1}var Cn=typeof e==`object`&&e&&!e.nodeType&&e,wn=Cn&&typeof module==`object`&&module&&!module.nodeType&&module,Tn=wn&&wn.exports===Cn?ze.Buffer:void 0,En=(Tn?Tn.isBuffer:void 0)||Sn,Dn=`[object Arguments]`,On=`[object Array]`,kn=`[object Boolean]`,An=`[object Date]`,jn=`[object Error]`,Mn=`[object Function]`,Nn=`[object Map]`,Pn=`[object Number]`,Fn=`[object Object]`,In=`[object RegExp]`,Ln=`[object Set]`,Rn=`[object String]`,zn=`[object WeakMap]`,Bn=`[object ArrayBuffer]`,Vn=`[object DataView]`,Hn=`[object Float32Array]`,Un=`[object Float64Array]`,Wn=`[object Int8Array]`,Gn=`[object Int16Array]`,Kn=`[object Int32Array]`,qn=`[object Uint8Array]`,Jn=`[object Uint8ClampedArray]`,Yn=`[object Uint16Array]`,Xn=`[object Uint32Array]`,I={};I[Hn]=I[Un]=I[Wn]=I[Gn]=I[Kn]=I[qn]=I[Jn]=I[Yn]=I[Xn]=!0,I[Dn]=I[On]=I[Bn]=I[kn]=I[Vn]=I[An]=I[jn]=I[Mn]=I[Nn]=I[Pn]=I[Fn]=I[In]=I[Ln]=I[Rn]=I[zn]=!1;function Zn(e){return Qe(e)&&ln(e.length)&&!!I[Ze(e)]}function Qn(e){return function(t){return e(t)}}var $n=typeof e==`object`&&e&&!e.nodeType&&e,er=$n&&typeof module==`object`&&module&&!module.nodeType&&module,tr=er&&er.exports===$n&&Le.process,nr=function(){try{return er&&er.require&&er.require(`util`).types||tr&&tr.binding&&tr.binding(`util`)}catch{}}(),rr=nr&&nr.isTypedArray,ir=rr?Qn(rr):Zn,ar=Object.prototype.hasOwnProperty;function or(e,t){var n=nt(e),r=!n&&xn(e),i=!n&&!r&&En(e),a=!n&&!r&&!i&&ir(e),o=n||r||i||a,s=o?hn(e.length,String):[],c=s.length;for(var l in e)(t||ar.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Qt(l,c)))&&s.push(l);return s}function sr(e,t){return function(n){return e(t(n))}}function cr(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var lr=Object.prototype.hasOwnProperty;function ur(e){if(!dt(e))return cr(e);var t=mn(e),n=[];for(var r in e)r==`constructor`&&(t||!lr.call(e,r))||n.push(r);return n}function dr(e){return un(e)?or(e,!0):ur(e)}var fr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pr=/^\w*$/;function mr(e,t){if(nt(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||et(e)?!0:pr.test(e)||!fr.test(e)||t!=null&&e in Object(t)}var hr=Rt(Object,`create`);function gr(){this.__data__=hr?hr(null):{},this.size=0}function _r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var vr=`__lodash_hash_undefined__`,yr=Object.prototype.hasOwnProperty;function br(e){var t=this.__data__;if(hr){var n=t[e];return n===vr?void 0:n}return yr.call(t,e)?t[e]:void 0}var xr=Object.prototype.hasOwnProperty;function Sr(e){var t=this.__data__;return hr?t[e]!==void 0:xr.call(t,e)}var Cr=`__lodash_hash_undefined__`;function wr(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=hr&&t===void 0?Cr:t,this}function Tr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Tr.prototype.clear=gr,Tr.prototype.delete=_r,Tr.prototype.get=br,Tr.prototype.has=Sr,Tr.prototype.set=wr;function Er(){this.__data__=[],this.size=0}function Dr(e,t){for(var n=e.length;n--;)if(en(e[n][0],t))return n;return-1}var Or=Array.prototype.splice;function kr(e){var t=this.__data__,n=Dr(t,e);return n<0?!1:(n==t.length-1?t.pop():Or.call(t,n,1),--this.size,!0)}function Ar(e){var t=this.__data__,n=Dr(t,e);return n<0?void 0:t[n][1]}function jr(e){return Dr(this.__data__,e)>-1}function Mr(e,t){var n=this.__data__,r=Dr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Nr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Nr.prototype.clear=Er,Nr.prototype.delete=kr,Nr.prototype.get=Ar,Nr.prototype.has=jr,Nr.prototype.set=Mr;var Pr=Rt(ze,`Map`);function Fr(){this.size=0,this.__data__={hash:new Tr,map:new(Pr||Nr),string:new Tr}}function Ir(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Lr(e,t){var n=e.__data__;return Ir(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Rr(e){var t=Lr(this,e).delete(e);return this.size-=+!!t,t}function zr(e){return Lr(this,e).get(e)}function Br(e){return Lr(this,e).has(e)}function Vr(e,t){var n=Lr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Hr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hr.prototype.clear=Fr,Hr.prototype.delete=Rr,Hr.prototype.get=zr,Hr.prototype.has=Br,Hr.prototype.set=Vr;var Ur=`Expected a function`;function Wr(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(Ur);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Wr.Cache||Hr),n}Wr.Cache=Hr;var Gr=500;function Kr(e){var t=Wr(e,function(e){return n.size===Gr&&n.clear(),e}),n=t.cache;return t}var qr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jr=/\\(\\)?/g,Yr=Kr(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(qr,function(e,n,r,i){t.push(r?i.replace(Jr,`$1`):n||e)}),t});function Xr(e){return e==null?``:ot(e)}function Zr(e,t){return nt(e)?e:mr(e,t)?[e]:Yr(Xr(e))}var Qr=1/0;function $r(e){if(typeof e==`string`||et(e))return e;var t=e+``;return t==`0`&&1/e==-Qr?`-0`:t}function ei(e,t){t=Zr(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[$r(t[n++])];return n&&n==r?e:void 0}function ti(e,t,n){var r=e==null?void 0:ei(e,t);return r===void 0?n:r}var ni=sr(Object.getPrototypeOf,Object),ri=`[object Object]`,ii=Function.prototype,ai=Object.prototype,oi=ii.toString,si=ai.hasOwnProperty,ci=oi.call(Object);function li(e){if(!Qe(e)||Ze(e)!=ri)return!1;var t=ni(e);if(t===null)return!0;var n=si.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&oi.call(n)==ci}function ui(){this.__data__=new Nr,this.size=0}function di(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function fi(e){return this.__data__.get(e)}function pi(e){return this.__data__.has(e)}var mi=200;function hi(e,t){var n=this.__data__;if(n instanceof Nr){var r=n.__data__;if(!Pr||r.length<mi-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Hr(r)}return n.set(e,t),this.size=n.size,this}function gi(e){this.size=(this.__data__=new Nr(e)).size}gi.prototype.clear=ui,gi.prototype.delete=di,gi.prototype.get=fi,gi.prototype.has=pi,gi.prototype.set=hi;var _i=typeof e==`object`&&e&&!e.nodeType&&e,vi=_i&&typeof module==`object`&&module&&!module.nodeType&&module,yi=vi&&vi.exports===_i?ze.Buffer:void 0,bi=yi?yi.allocUnsafe:void 0;function xi(e,t){if(t)return e.slice();var n=e.length,r=bi?bi(n):new e.constructor(n);return e.copy(r),r}var Si=ze.Uint8Array;function Ci(e){var t=new e.constructor(e.byteLength);return new Si(t).set(new Si(e)),t}function wi(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ti(e){return typeof e.constructor==`function`&&!mn(e)?Bt(ni(e)):{}}function Ei(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var Di=Ei(),Oi=function(){return ze.Date.now()},ki=`Expected a function`,Ai=Math.max,ji=Math.min;function Mi(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(ki);t=_t(t)||0,dt(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?Ai(_t(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?ji(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=Oi();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(Oi())}function x(){var e=Oi(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}function Ni(e,t,n){(n!==void 0&&!en(e[t],n)||n===void 0&&!(t in e))&&$t(e,t,n)}function Pi(e){return Qe(e)&&un(e)}function Fi(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}function Ii(e){return rn(e,dr(e))}function Li(e,t,n,r,i,a,o){var s=Fi(e,n),c=Fi(t,n),l=o.get(c);if(l){Ni(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=nt(c),p=!f&&En(c),m=!f&&!p&&ir(c);u=c,f||p||m?nt(s)?u=s:Pi(s)?u=Ht(s):p?(d=!1,u=xi(c,!0)):m?(d=!1,u=wi(c,!0)):u=[]:li(c)||xn(c)?(u=s,xn(s)?u=Ii(s):(!dt(s)||Ct(s))&&(u=Ti(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),Ni(e,n,u)}function Ri(e,t,n,r,i){e!==t&&Di(t,function(a,o){if(i||(i=new gi),dt(a))Li(e,t,o,n,Ri,r,i);else{var s=r?r(Fi(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),Ni(e,o,s)}},dr)}var zi=fn(function(e,t,n,r){Ri(e,t,n,r)}),Bi=fn(function(e,t,n){Ri(e,t,n)});function Vi(e,t,n,r){if(!dt(e))return e;t=Zr(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=$r(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=dt(u)?u:Qt(t[i+1])?[]:{})}nn(s,c,l),s=s[c]}return e}function Hi(e,t,n){return e==null?e:Vi(e,t,n)}var Ui=class{constructor(){F(this,`cursor`,0)}reset(){return this.cursor=0,this}moveCursor(e){this.cursor+=e}moveCursorTo(e){this.cursor=e}};function Wi(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function Gi(e){return/^-?\d+(\.\d+)?$/.test(e)}function Ki(e){return Gi(e)?Number(e)<=2**53-1:!1}function qi(e){return Number(e)>2**53-1||e.length>=18}var Ji=class e{constructor(){F(this,`_data`,[])}static create(){return new e}add(e){this._data.indexOf(e)>-1||this._data.push(e)}delete(e){let t=this._data.indexOf(e);this._data.splice(t,1)}getData(){return this._data}},Yi=class e{constructor(){F(this,`_data`,new Map)}static create(){return new e}add(e,t){this._data.has(e)||this._data.set(e,t)}delete(e){this._data.delete(e)}getData(){return this._data}};function Xi(e){let t=new MessageChannel,n=!1,r=()=>{n||e()};return t.port1.onmessage=r,t.port2.postMessage(null),()=>{n=!0,t.port1.onmessage=null,t.port1.close(),t.port2.close()}}async function Zi(e){for(let[t,n]of e.entries())try{if(!await n())return{index:t,result:!1}}catch(e){return{index:t,result:!1,error:e}}return{result:!0,index:-1}}function Qi(e){for(let[t,n]of e.entries())try{if(!n())return{index:t,result:!1}}catch(e){return{index:t,result:!1,error:e}}return{result:!0,index:-1}}function $i(e,t){return t.forEach(t=>e.add(t)),e}function ea(e){return e instanceof r.Subscription||e instanceof r.Subject||e&&`closed`in e&&e.unsubscribe!==void 0}function ta(e){let t=!1;return e?ea(e)?{dispose:()=>e.unsubscribe()}:typeof e==`function`?{dispose:()=>{t||(t=!0,e())}}:e:ta(()=>{})}var na=class{constructor(){F(this,`_disposables`,new Set)}add(e){let t=ta(e);return this._disposables.add(t),{dispose:(e=!1)=>{e||t.dispose(),this._disposables.delete(t)}}}dispose(){this._disposables.forEach(e=>{e.dispose()}),this._disposables.clear()}},ra=class{constructor(){F(this,`_disposed`,!1),F(this,`_collection`,new na)}disposeWithMe(e){return this._collection.add(e)}ensureNotDisposed(){if(this._disposed)throw Error(`[Disposable]: object is disposed!`)}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}},ia=class extends ra{constructor(...e){super(...e),F(this,`dispose$`,new r.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}},aa=class extends ra{constructor(e){super(),this._rootDisposable=e,F(this,`_ref`,0)}inc(){if(this._disposed)throw Error(`[RCDisposable]: should not ref to a disposed.`);this._ref+=1}dec(){--this._ref,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}},oa=class extends ra{};let sa=new Set(`ac.ad.ae.aero.af.ag.ai.al.am.ao.aq.ar.arpa.as.asia.at.au.aw.ax.az.ba.bb.bd.be.bf.bg.bh.bi.biz.bj.bm.bn.bo.br.bs.bt.bv.bw.by.bz.ca.cat.cc.cd.cf.cg.ch.ci.ck.cl.cm.cn.co.com.coop.cr.cu.cv.cw.cx.cy.cz.de.dj.dk.dm.do.dz.ec.edu.ee.eg.er.es.et.eu.fi.fj.fk.fm.fo.fr.ga.gb.gd.ge.gf.gg.gh.gi.gl.gm.gn.gov.gp.gq.gr.gs.gt.gu.gw.gy.hk.hm.hn.hr.ht.hu.id.ie.il.im.in.info.int.io.iq.ir.is.it.je.jm.jo.jobs.jp.ke.kg.kh.ki.km.kn.kp.kr.kw.ky.kz.la.lb.lc.li.lk.lr.ls.lt.lu.lv.ly.ma.mc.md.me.mg.mh.mil.mk.ml.mm.mn.mo.mobi.mp.mq.mr.ms.mt.mu.museum.mv.mw.mx.my.mz.na.name.nc.ne.net.nf.ng.ni.nl.no.np.nr.nu.nz.om.onion.org.pa.pe.pf.pg.ph.pk.pl.pm.pn.post.pr.pro.ps.pt.pw.py.qa.re.ro.rs.ru.rw.sa.sb.sc.sd.se.sg.sh.si.sj.sk.sl.sm.sn.so.sr.ss.st.su.sv.sx.sy.sz.tc.td.tel.tf.tg.th.tj.tk.tl.tm.tn.to.tr.tt.tv.tw.tz.ua.ug.uk.us.uy.uz.va.vc.ve.vg.vi.vn.vu.wf.ws.yt.za.zm.zw`.split(`.`)),ca=RegExp(`^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$`,`i`);function la(e){if(!Number.isNaN(+e))return!1;if(e.startsWith(`http://localhost:3002`)||e.startsWith(`localhost:3002`))return!0;if(ca.test(e)){if(ua(e))return!0;try{let t=new URL(fa(e)).hostname.split(`.`).pop();if(t&&sa.has(t))return!0}catch{return!1}}return!1}function ua(e){return/^[a-zA-Z]+:\/\//.test(e)}function da(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function fa(e){return ua(e)?e:da(e)?`mailto://${e}`:`https://${e}`}function pa(e,t){try{let n=new URL(t),r=n.pathname.endsWith(`/`)?n.pathname:`${n.pathname}/`,i=e.startsWith(`/`)?e.substring(1):e;return new URL(i,n.origin+r).toString()}catch(t){return console.error(`Error resolving URL with base URL:`,t),e}}let ma=e=>crypto.getRandomValues(new Uint8Array(e)),ha=(e,t,n)=>{let r=256-256%e.length;if(r===256){let r=e.length-1;return(i=t)=>{if(!i)return``;let a=``;for(;;){let t=n(i),o=i;for(;o--;)if(a+=e[t[o]&r],a.length>=i)return a}}}let i=Math.ceil(1.6*256*t/r);return(a=t)=>{if(!a)return``;let o=``;for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(o+=e[t[s]%e.length],o.length>=a))return o}}},ga=(e,t=21)=>ha(e,t|0,ma),_a=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[n[e]&63];return t};function va(e,t){return L.getValueType(e)===L.getValueType(t)?L.isArray(e)?ya(e,t):L.isObject(e)?ba(e,t):L.isDate(e)?e.getTime()===t.getTime():L.isRegExp(e)?e.toString()===t.toString():e===t:!1}function ya(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++){let r=e[n],i=t[n];if(!va(r,i))return!1}return!0}function ba(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n){if(!r.includes(i))return!1;let n=e[i],a=t[i];if(!va(n,a))return!1}return!0}var L=class e{static deleteNull(e){for(let t in e)(e[t]===null||e[t]===void 0)&&delete e[t];return e}static getSystemType(){let e=navigator.userAgent,t=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`&&!t&&!n)return`Unix`;if(String(navigator.platform).indexOf(`Linux`)>-1)return`Linux`;if(t){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(){let e=navigator.userAgent,t=e.indexOf(`Opera`)>-1,n=e.indexOf(`compatible`)>-1&&e.indexOf(`MSIE`)>-1&&!t,r=e.indexOf(`Trident`)>-1&&e.indexOf(`rv:11.0`)>-1,i=e.indexOf(`Edge`)>-1,a=e.indexOf(`Firefox`)>-1,o=e.indexOf(`Safari`)>-1&&e.indexOf(`Chrome`)===-1,s=e.indexOf(`Chrome`)>-1&&e.indexOf(`Safari`)>-1;if(n){RegExp(`MSIE (\\d+\\.\\d+);`).test(e);let t=Number.parseFloat(RegExp.$1);return t===7?`IE7`:t===8?`IE8`:t===9?`IE9`:t===10?`IE10`:`0`}return a?`FF`:t?`Opera`:o?`Safari`:s?`Chrome`:i?`Edge`:r?`IE11`:`Unknown browser`}static deepMerge(t,...n){n.forEach(e=>e&&a(e));function r(t,n){t.forEach((t,a)=>{if(e.isArray(t)){var o;let e=(o=n[a])==null?[]:o;n[a]=e,r(t,e);return}if(e.isObject(t)){var s;let e=(s=n[a])==null?{}:s;n[a]=e,i(t,e);return}n[a]=t})}function i(t,n){Object.keys(t).forEach(a=>{let o=t[a];if(e.isObject(o)){var s;let e=(s=n[a])==null?{}:s;n[a]=e,i(o,e);return}if(e.isArray(o)){var c;let e=(c=n[a])==null?[]:c;n[a]=e,r(o,e);return}n[a]=o})}function a(n){Object.keys(n).forEach(a=>{let o=n[a];if(e.isArray(o)){var s;let e=(s=t[a])==null?[]:s;t[a]=e,r(o,e);return}if(e.isObject(o)){var c;let e=(c=t[a])==null?{}:c;t[a]=e,i(o,e);return}t[a]=o})}return t}static diffValue(e,t){return va(e,t)}static deepClone(t){if(!this.isDefine(t))return t;if(this.isRegExp(t))return new RegExp(t);if(this.isDate(t))return new Date(t);if(this.isArray(t)){let n=[];return t.forEach((t,r)=>{n[r]=e.deepClone(t)}),n}if(this.isObject(t)){let n={};return Object.keys(t).forEach(r=>{let i=t[r];n[r]=e.deepClone(i)}),Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}return t}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 isPlainObject(e){return this.isDefine(e)?Object.getPrototypeOf(e)===Object.getPrototypeOf({}):!1}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(Number.parseFloat(e))&&isFinite(e)}static isObject(e){return this.getValueType(e)===`[object Object]`}static isEmptyObject(e){for(let t in e)return!1;return!0}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(e){return la(e)}static normalizeUrl(e){return fa(e)}static topLevelDomainCombiningString(){return[...sa].join(`|`)}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{let r=t[n];r==null?delete t[n]:e.removeNull(r)}),t}static numToWord(e){let t=``;for(;e>0;){let n=e%26;n=n===0?n=26:n,t=String.fromCharCode(96+n)+t,e=(e-n)/26}return t.toLocaleUpperCase()}static ABCatNum(e){if(e==null||e.length===0)return NaN;let t=e.toLowerCase().split(``),n=t.length,r=0,i=0;for(let e=0;e<n;e++)i=t[e].charCodeAt(0)-96,r+=i*26**(n-e-1);return r===0?NaN:r-1}static chatAtABC(e){let t=``;for(;e>=0;)t=String.fromCharCode(e%26+97)+t,e=Math.floor(e/26)-1;return t.toUpperCase()}static commonExtend(e,t){let n={};for(let t in e)n[t]=e[t];for(let e in t)t[e]!=null&&(n[e]=t[e]);return n}static hasIntersectionBetweenTwoRanges(e,t,n,r){return t>=n&&r>=e}static isStartValidPosition(e){return/^[A-Za-zА-Яа-яЁё_]/.test(e)}static isValidParameter(e){let t=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(e),n=e.length<=255;return!t&&n}static clamp(e,t,n){return Math.max(t,Math.min(n,e))}static now(){return performance&&performance.now?performance.now():Date.now()}};function xa(e=21,t){return t?ga(t,e)():_a(e)}function Sa(...e){let t={},n=e.length;for(let r=n-1;r>=0;r--){let n=e[r];if(n){let e=Object.keys(n);for(let r of e)t[r]===void 0&&(t[r]=n[r])}}return t}let Ca=()=>typeof process<`u`&&process.versions!=null&&process.versions.node!=null;function wa(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/\\\*/g,`.*`).replace(/\\\?/g,`.`);return RegExp(`^${t}$`,`i`)}let Ta=function(e){return e[e.DEFAULT_SERIES=0]=`DEFAULT_SERIES`,e[e.ALTERNATE_SERIES=1]=`ALTERNATE_SERIES`,e}({}),R=function(e){return e[e.NONE=0]=`NONE`,e[e.THIN=1]=`THIN`,e[e.HAIR=2]=`HAIR`,e[e.DOTTED=3]=`DOTTED`,e[e.DASHED=4]=`DASHED`,e[e.DASH_DOT=5]=`DASH_DOT`,e[e.DASH_DOT_DOT=6]=`DASH_DOT_DOT`,e[e.DOUBLE=7]=`DOUBLE`,e[e.MEDIUM=8]=`MEDIUM`,e[e.MEDIUM_DASHED=9]=`MEDIUM_DASHED`,e[e.MEDIUM_DASH_DOT=10]=`MEDIUM_DASH_DOT`,e[e.MEDIUM_DASH_DOT_DOT=11]=`MEDIUM_DASH_DOT_DOT`,e[e.SLANT_DASH_DOT=12]=`SLANT_DASH_DOT`,e[e.THICK=13]=`THICK`,e}({}),Ea=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e.NONE=`none`,e.ALL=`all`,e.OUTSIDE=`outside`,e.INSIDE=`inside`,e.HORIZONTAL=`horizontal`,e.VERTICAL=`vertical`,e.TLBR=`tlbr`,e.TLBC_TLMR=`tlbc_tlmr`,e.TLBR_TLBC_TLMR=`tlbr_tlbc_tlmr`,e.BLTR=`bl_tr`,e.MLTR_BCTR=`mltr_bctr`,e}({}),Da=function(e){return e[e.UNSUPPORTED=0]=`UNSUPPORTED`,e[e.RGB=1]=`RGB`,e[e.HEX=2]=`HEX`,e[e.THEME=3]=`THEME`,e}({}),Oa=function(e){return e[e.ON=0]=`ON`,e[e.OFF=1]=`OFF`,e}({}),ka=function(e){return e[e.PASTE_NORMAL=0]=`PASTE_NORMAL`,e[e.PASTE_NO_BORDERS=1]=`PASTE_NO_BORDERS`,e[e.PASTE_FORMAT=2]=`PASTE_FORMAT`,e[e.PASTE_FORMULA=3]=`PASTE_FORMULA`,e[e.PASTE_DATA_VALIDATION=4]=`PASTE_DATA_VALIDATION`,e[e.PASTE_VALUES=5]=`PASTE_VALUES`,e[e.PASTE_CONDITIONAL_FORMATTING=6]=`PASTE_CONDITIONAL_FORMATTING`,e[e.PASTE_COLUMN_WIDTHS=7]=`PASTE_COLUMN_WIDTHS`,e}({}),Aa=function(e){return e[e.LEFT=0]=`LEFT`,e[e.RIGHT=1]=`RIGHT`,e}({}),ja=function(e){return e[e.DOCUMENT=0]=`DOCUMENT`,e[e.PROJECT=1]=`PROJECT`,e}({}),Ma=function(e){return e[e.COLUMNS=0]=`COLUMNS`,e[e.ROWS=1]=`ROWS`,e}({}),Na=function(e){return e[e.UP=0]=`UP`,e[e.RIGHT=1]=`RIGHT`,e[e.DOWN=2]=`DOWN`,e[e.LEFT=3]=`LEFT`,e}({});function Pa(e){switch(e){case Na.LEFT:return Na.RIGHT;case Na.RIGHT:return Na.LEFT;case Na.UP:return Na.DOWN;case Na.DOWN:return Na.UP}}let Fa=function(e){return e[e.INTERPOLATION_POINT_TYPE_UNSPECIFIED=0]=`INTERPOLATION_POINT_TYPE_UNSPECIFIED`,e[e.MIN=1]=`MIN`,e[e.MAX=2]=`MAX`,e[e.NUMBER=3]=`NUMBER`,e[e.PERCENT=4]=`PERCENT`,e[e.PERCENTILE=5]=`PERCENTILE`,e}({}),Ia=function(e){return e.EN_US=`enUS`,e.FR_FR=`frFR`,e.ZH_CN=`zhCN`,e.RU_RU=`ruRU`,e.ZH_TW=`zhTW`,e.VI_VN=`viVN`,e.FA_IR=`faIR`,e.JA_JP=`jaJP`,e.KO_KR=`koKR`,e.ES_ES=`esES`,e.CA_ES=`caES`,e.SK_SK=`skSK`,e}({}),La=function(e){return e[e.PERSON=0]=`PERSON`,e[e.FILE=1]=`FILE`,e[e.DATE=2]=`DATE`,e[e.LOCATION=3]=`LOCATION`,e[e.EVENT=4]=`EVENT`,e}({}),Ra=function(e){return e[e.RANGE=0]=`RANGE`,e[e.SHEET=1]=`SHEET`,e}({}),za=function(e){return e[e.RELATIVE_DATE_UNSPECIFIED=0]=`RELATIVE_DATE_UNSPECIFIED`,e[e.PAST_YEAR=1]=`PAST_YEAR`,e[e.PAST_MONTH=2]=`PAST_MONTH`,e[e.PAST_WEEK=3]=`PAST_WEEK`,e[e.YESTERDAY=4]=`YESTERDAY`,e[e.TODAY=5]=`TODAY`,e[e.TOMORROW=6]=`TOMORROW`,e}({}),Ba=function(e){return e[e.GRID=0]=`GRID`,e[e.KANBAN=1]=`KANBAN`,e[e.GANTT=2]=`GANTT`,e}({}),Va=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.LEFT_TO_RIGHT=1]=`LEFT_TO_RIGHT`,e[e.RIGHT_TO_LEFT=2]=`RIGHT_TO_LEFT`,e}({}),Ha=function(e){return e[e.DASH=0]=`DASH`,e[e.DASH_DOT_DOT_HEAVY=1]=`DASH_DOT_DOT_HEAVY`,e[e.DASH_DOT_HEAVY=2]=`DASH_DOT_HEAVY`,e[e.DASHED_HEAVY=3]=`DASHED_HEAVY`,e[e.DASH_LONG=4]=`DASH_LONG`,e[e.DASH_LONG_HEAVY=5]=`DASH_LONG_HEAVY`,e[e.DOT_DASH=6]=`DOT_DASH`,e[e.DOT_DOT_DASH=7]=`DOT_DOT_DASH`,e[e.DOTTED=8]=`DOTTED`,e[e.DOTTED_HEAVY=9]=`DOTTED_HEAVY`,e[e.DOUBLE=10]=`DOUBLE`,e[e.NONE=11]=`NONE`,e[e.SINGLE=12]=`SINGLE`,e[e.THICK=13]=`THICK`,e[e.WAVE=14]=`WAVE`,e[e.WAVY_DOUBLE=15]=`WAVY_DOUBLE`,e[e.WAVY_HEAVY=16]=`WAVY_HEAVY`,e[e.WORDS=17]=`WORDS`,e}({}),Ua=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.LEFT=1]=`LEFT`,e[e.CENTER=2]=`CENTER`,e[e.RIGHT=3]=`RIGHT`,e[e.JUSTIFIED=4]=`JUSTIFIED`,e[e.BOTH=5]=`BOTH`,e[e.DISTRIBUTED=6]=`DISTRIBUTED`,e}({}),Wa=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TOP=1]=`TOP`,e[e.MIDDLE=2]=`MIDDLE`,e[e.BOTTOM=3]=`BOTTOM`,e}({}),Ga=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.OVERFLOW=1]=`OVERFLOW`,e[e.CLIP=2]=`CLIP`,e[e.WRAP=3]=`WRAP`,e}({}),Ka=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.ITALIC=1]=`ITALIC`,e}({}),qa=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.BOLD=1]=`BOLD`,e}({}),Ja=function(e){return e[e.NORMAL=1]=`NORMAL`,e[e.SUBSCRIPT=2]=`SUBSCRIPT`,e[e.SUPERSCRIPT=3]=`SUPERSCRIPT`,e}({}),z=function(e){return e[e.FALSE=0]=`FALSE`,e[e.TRUE=1]=`TRUE`,e}({}),Ya=function(e){return e[e.STRING=1]=`STRING`,e[e.NUMBER=2]=`NUMBER`,e[e.BOOLEAN=3]=`BOOLEAN`,e[e.FORCE_STRING=4]=`FORCE_STRING`,e}({}),Xa=function(e){return e[e.DARK1=0]=`DARK1`,e[e.LIGHT1=1]=`LIGHT1`,e[e.DARK2=2]=`DARK2`,e[e.LIGHT2=3]=`LIGHT2`,e[e.ACCENT1=4]=`ACCENT1`,e[e.ACCENT2=5]=`ACCENT2`,e[e.ACCENT3=6]=`ACCENT3`,e[e.ACCENT4=7]=`ACCENT4`,e[e.ACCENT5=8]=`ACCENT5`,e[e.ACCENT6=9]=`ACCENT6`,e[e.HYPERLINK=10]=`HYPERLINK`,e[e.FOLLOWED_HYPERLINK=11]=`FOLLOWED_HYPERLINK`,e}({}),Za=function(e){return e.OFFICE=`Office`,e.OFFICE_2007_2010=`Office 2007-2010`,e.GRAYSCALE=`Grayscale`,e.BLUE_WARM=`Blue Warm`,e.BLUE=`Blue`,e.BLUE_II=`Blue II`,e.BLUE_GREEN=`Blue Green`,e.GREEN=`Green`,e.GREEN_YELLOW=`Green Yellow`,e.YELLOW=`Yellow`,e.YELLOW_ORANGE=`Yellow Orange`,e.ORANGE=`Orange`,e.ORANGE_RED=`Orange Red`,e.RED_ORANGE=`Red Orange`,e.RED=`Red`,e.RED_VIOLET=`Red Violet`,e.VIOLET=`Violet`,e.VIOLET_II=`Violet II`,e.MEDIAN=`Median`,e.PAPER=`Paper`,e.MARQUEE=`Marquee`,e.SLIPSTREAM=`Slipstream`,e.Aspect=`Aspect`,e}({}),Qa=function(e){return e[e.character=0]=`character`,e[e.paragraph=1]=`paragraph`,e[e.table=2]=`table`,e[e.numbering=3]=`numbering`,e}({}),$a=function(e){return e[e.TAB=0]=`TAB`,e[e.SPACE=1]=`SPACE`,e[e.NOTHING=2]=`NOTHING`,e}({}),B=function(e){return e[e.BULLET=0]=`BULLET`,e[e.NONE=1]=`NONE`,e[e.DECIMAL=2]=`DECIMAL`,e[e.DECIMAL_ZERO=3]=`DECIMAL_ZERO`,e[e.UPPER_LETTER=4]=`UPPER_LETTER`,e[e.LOWER_LETTER=5]=`LOWER_LETTER`,e[e.UPPER_ROMAN=6]=`UPPER_ROMAN`,e[e.LOWER_ROMAN=7]=`LOWER_ROMAN`,e[e.ORDINAL=8]=`ORDINAL`,e[e.CARDINAL_TEXT=9]=`CARDINAL_TEXT`,e[e.ORDINAL_TEXT=10]=`ORDINAL_TEXT`,e[e.HEX=11]=`HEX`,e[e.CHICAGO=12]=`CHICAGO`,e[e.IDEOGRAPH_DIGITAL=13]=`IDEOGRAPH_DIGITAL`,e[e.JAPANESE_COUNTING=14]=`JAPANESE_COUNTING`,e[e.AIUEO=15]=`AIUEO`,e[e.IROHA=16]=`IROHA`,e[e.DECIMAL_FULL_WIDTH=17]=`DECIMAL_FULL_WIDTH`,e[e.DECIMAL_HALF_WIDTH=18]=`DECIMAL_HALF_WIDTH`,e[e.JAPANESE_LEGAL=19]=`JAPANESE_LEGAL`,e[e.JAPANESE_DIGITAL_TEN_THOUSAND=20]=`JAPANESE_DIGITAL_TEN_THOUSAND`,e[e.DECIMAL_ENCLOSED_CIRCLE=21]=`DECIMAL_ENCLOSED_CIRCLE`,e[e.DECIMAL_FULL_WIDTH2=22]=`DECIMAL_FULL_WIDTH2`,e[e.AIUEO_FULL_WIDTH=23]=`AIUEO_FULL_WIDTH`,e[e.IROHA_FULL_WIDTH=24]=`IROHA_FULL_WIDTH`,e[e.GANADA=25]=`GANADA`,e[e.CHOSUNG=26]=`CHOSUNG`,e[e.DECIMAL_ENCLOSED_FULLSTOP=27]=`DECIMAL_ENCLOSED_FULLSTOP`,e[e.DECIMAL_ENCLOSED_PAREN=28]=`DECIMAL_ENCLOSED_PAREN`,e[e.DECIMAL_ENCLOSED_CIRCLE_CHINESE=29]=`DECIMAL_ENCLOSED_CIRCLE_CHINESE`,e[e.IDEOGRAPH_ENCLOSED_CIRCLE=30]=`IDEOGRAPH_ENCLOSED_CIRCLE`,e[e.IDEOGRAPH_TRADITIONAL=31]=`IDEOGRAPH_TRADITIONAL`,e[e.IDEOGRAPH_ZODIAC=32]=`IDEOGRAPH_ZODIAC`,e[e.IDEOGRAPH_ZODIAC_TRADITIONAL=33]=`IDEOGRAPH_ZODIAC_TRADITIONAL`,e[e.TAIWANESE_COUNTING=34]=`TAIWANESE_COUNTING`,e[e.IDEOGRAPH_LEGAL_TRADITIONAL=35]=`IDEOGRAPH_LEGAL_TRADITIONAL`,e[e.TAIWANESE_COUNTING_THOUSAND=36]=`TAIWANESE_COUNTING_THOUSAND`,e[e.TAIWANESE_DIGITAL=37]=`TAIWANESE_DIGITAL`,e[e.CHINESE_COUNTING=38]=`CHINESE_COUNTING`,e[e.CHINESE_LEGAL_SIMPLIFIED=39]=`CHINESE_LEGAL_SIMPLIFIED`,e[e.CHINESE_COUNTING_THOUSAND=40]=`CHINESE_COUNTING_THOUSAND`,e[e.KOREAN_DIGITAL=41]=`KOREAN_DIGITAL`,e[e.KOREAN_COUNTING=42]=`KOREAN_COUNTING`,e[e.KOREAN_LEGAL=43]=`KOREAN_LEGAL`,e[e.KOREAN_DIGITAL2=44]=`KOREAN_DIGITAL2`,e[e.VIETNAMESE_COUNTING=45]=`VIETNAMESE_COUNTING`,e[e.RUSSIAN_LOWER=46]=`RUSSIAN_LOWER`,e[e.RUSSIAN_UPPER=47]=`RUSSIAN_UPPER`,e[e.NUMBER_IN_DASH=48]=`NUMBER_IN_DASH`,e[e.HEBREW1=49]=`HEBREW1`,e[e.HEBREW2=50]=`HEBREW2`,e[e.ARABIC_ALPHA=51]=`ARABIC_ALPHA`,e[e.ARABIC_ABJAD=52]=`ARABIC_ABJAD`,e[e.HINDI_VOWELS=53]=`HINDI_VOWELS`,e[e.HINDI_CONSONANTS=54]=`HINDI_CONSONANTS`,e[e.HINDI_NUMBERS=55]=`HINDI_NUMBERS`,e[e.HINDI_COUNTING=56]=`HINDI_COUNTING`,e[e.THAI_LETTERS=57]=`THAI_LETTERS`,e[e.THAI_NUMBERS=58]=`THAI_NUMBERS`,e[e.THAI_COUNTING=59]=`THAI_COUNTING`,e[e.CUSTOM=60]=`CUSTOM`,e}({}),eo=function(e){return e[e.BULLET_ALIGNMENT_UNSPECIFIED=0]=`BULLET_ALIGNMENT_UNSPECIFIED`,e[e.START=1]=`START`,e[e.CENTER=2]=`CENTER`,e[e.END=3]=`END`,e[e.BOTH=4]=`BOTH`,e}({}),to=function(e){return e[e.HYPERLINK=0]=`HYPERLINK`,e[e.FIELD=1]=`FIELD`,e[e.SDT=2]=`SDT`,e[e.BOOKMARK=3]=`BOOKMARK`,e[e.COMMENT=4]=`COMMENT`,e[e.CUSTOM=5]=`CUSTOM`,e[e.MENTION=6]=`MENTION`,e[e.UNI_FORMULA=7]=`UNI_FORMULA`,e[e.DELTED=9999]=`DELTED`,e}({}),no=function(e){return e[e.COMMENT=0]=`COMMENT`,e[e.DELETED=9999]=`DELETED`,e}({}),ro=function(e){return e[e.DRAWING=0]=`DRAWING`,e[e.CUSTOM=1]=`CUSTOM`,e}({}),io=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRADITIONAL=1]=`TRADITIONAL`,e[e.MODERN=2]=`MODERN`,e}({}),ao=function(e){return e[e.DEFAULT=0]=`DEFAULT`,e[e.LINES=1]=`LINES`,e[e.LINES_AND_CHARS=2]=`LINES_AND_CHARS`,e[e.SNAP_TO_CHARS=3]=`SNAP_TO_CHARS`,e}({}),oo=function(e){return e[e.SECTION_TYPE_UNSPECIFIED=0]=`SECTION_TYPE_UNSPECIFIED`,e[e.CONTINUOUS=1]=`CONTINUOUS`,e[e.NEXT_PAGE=2]=`NEXT_PAGE`,e[e.EVEN_PAGE=3]=`EVEN_PAGE`,e[e.ODD_PAGE=4]=`ODD_PAGE`,e}({}),so=function(e){return e[e.COLUMN_SEPARATOR_STYLE_UNSPECIFIED=0]=`COLUMN_SEPARATOR_STYLE_UNSPECIFIED`,e[e.NONE=1]=`NONE`,e[e.BETWEEN_EACH_COLUMN=2]=`BETWEEN_EACH_COLUMN`,e}({}),co=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.TBRL=1]=`TBRL`,e[e.LRTBV=2]=`LRTBV`,e}({}),lo=function(e){return e[e.TEXT_RUN=0]=`TEXT_RUN`,e[e.AUTO_TEXT=1]=`AUTO_TEXT`,e[e.PAGE_BREAK=2]=`PAGE_BREAK`,e[e.COLUMN_BREAK=3]=`COLUMN_BREAK`,e[e.FOOT_NOTE_REFERENCE=4]=`FOOT_NOTE_REFERENCE`,e[e.HORIZONTAL_RULE=5]=`HORIZONTAL_RULE`,e[e.EQUATION=6]=`EQUATION`,e[e.DRAWING=7]=`DRAWING`,e[e.PERSON=8]=`PERSON`,e[e.RICH_LINK=9]=`RICH_LINK`,e}({}),uo=function(e){return e[e.BOTH_SIDES=0]=`BOTH_SIDES`,e[e.LEFT=1]=`LEFT`,e[e.RIGHT=2]=`RIGHT`,e[e.LARGEST=3]=`LARGEST`,e}({}),fo=function(e){return e[e.INLINE=0]=`INLINE`,e[e.WRAP_NONE=1]=`WRAP_NONE`,e[e.WRAP_POLYGON=2]=`WRAP_POLYGON`,e[e.WRAP_SQUARE=3]=`WRAP_SQUARE`,e[e.WRAP_THROUGH=4]=`WRAP_THROUGH`,e[e.WRAP_TIGHT=5]=`WRAP_TIGHT`,e[e.WRAP_TOP_AND_BOTTOM=6]=`WRAP_TOP_AND_BOTTOM`,e}({}),po=function(e){return e[e.NAMED_STYLE_TYPE_UNSPECIFIED=0]=`NAMED_STYLE_TYPE_UNSPECIFIED`,e[e.NORMAL_TEXT=1]=`NORMAL_TEXT`,e[e.TITLE=2]=`TITLE`,e[e.SUBTITLE=3]=`SUBTITLE`,e[e.HEADING_1=4]=`HEADING_1`,e[e.HEADING_2=5]=`HEADING_2`,e[e.HEADING_3=6]=`HEADING_3`,e[e.HEADING_4=7]=`HEADING_4`,e[e.HEADING_5=8]=`HEADING_5`,e}({}),mo=function(e){return e[e.AUTO=0]=`AUTO`,e[e.AT_LEAST=1]=`AT_LEAST`,e[e.EXACT=2]=`EXACT`,e}({}),ho=function(e){return e[e.DASH_STYLE_UNSPECIFIED=0]=`DASH_STYLE_UNSPECIFIED`,e[e.SOLID=1]=`SOLID`,e[e.DOT=2]=`DOT`,e[e.DASH=3]=`DASH`,e}({}),go=function(e){return e[e.TAB_STOP_ALIGNMENT_UNSPECIFIED=0]=`TAB_STOP_ALIGNMENT_UNSPECIFIED`,e[e.START=1]=`START`,e[e.CENTER=2]=`CENTER`,e[e.END=3]=`END`,e}({}),_o=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.SPECIFIED=1]=`SPECIFIED`,e}({}),vo=function(e){return e[e.START=0]=`START`,e[e.CENTER=1]=`CENTER`,e[e.END=2]=`END`,e}({}),yo=function(e){return e[e.AUTO_FIT=0]=`AUTO_FIT`,e[e.FIXED=1]=`FIXED`,e}({}),bo=function(e){return e[e.NONE=0]=`NONE`,e[e.WRAP=1]=`WRAP`,e}({}),xo=function(e){return e[e.AUTO=0]=`AUTO`,e[e.AT_LEAST=1]=`AT_LEAST`,e[e.EXACT=2]=`EXACT`,e}({}),So=function(e){return e[e.CONTENT_ALIGNMENT_UNSPECIFIED=0]=`CONTENT_ALIGNMENT_UNSPECIFIED`,e[e.BOTH=1]=`BOTH`,e[e.TOP=2]=`TOP`,e[e.CENTER=3]=`CENTER`,e[e.BOTTOM=4]=`BOTTOM`,e}({}),Co=function(e){return e.NORMAL=`normal`,e.BOLD=`bold`,e.ITALIC=`italic`,e}({}),wo=function(e){return e[e.PAGE=0]=`PAGE`,e[e.COLUMN=1]=`COLUMN`,e[e.CHARACTER=2]=`CHARACTER`,e[e.MARGIN=3]=`MARGIN`,e[e.INSIDE_MARGIN=4]=`INSIDE_MARGIN`,e[e.OUTSIDE_MARGIN=5]=`OUTSIDE_MARGIN`,e[e.LEFT_MARGIN=6]=`LEFT_MARGIN`,e[e.RIGHT_MARGIN=7]=`RIGHT_MARGIN`,e}({}),To=function(e){return e[e.PAGE=0]=`PAGE`,e[e.PARAGRAPH=1]=`PARAGRAPH`,e[e.LINE=2]=`LINE`,e[e.MARGIN=3]=`MARGIN`,e[e.TOP_MARGIN=4]=`TOP_MARGIN`,e[e.BOTTOM_MARGIN=5]=`BOTTOM_MARGIN`,e[e.INSIDE_MARGIN=6]=`INSIDE_MARGIN`,e[e.OUTSIDE_MARGIN=7]=`OUTSIDE_MARGIN`,e}({}),Eo=function(e){return e[e.POINT=0]=`POINT`,e[e.LINE=1]=`LINE`,e[e.CHARACTER=2]=`CHARACTER`,e[e.PIXEL=3]=`PIXEL`,e[e.PERCENT=4]=`PERCENT`,e}({}),Do=function(e){return e[e.CENTER=0]=`CENTER`,e[e.INSIDE=1]=`INSIDE`,e[e.LEFT=2]=`LEFT`,e[e.OUTSIDE=3]=`OUTSIDE`,e[e.RIGHT=4]=`RIGHT`,e[e.BOTH=5]=`BOTH`,e[e.DISTRIBUTE=6]=`DISTRIBUTE`,e}({}),Oo=function(e){return e[e.BOTTOM=0]=`BOTTOM`,e[e.CENTER=1]=`CENTER`,e[e.INSIDE=2]=`INSIDE`,e[e.OUTSIDE=3]=`OUTSIDE`,e[e.TOP=4]=`TOP`,e}({}),ko=function(e){return e[e.compressPunctuation=0]=`compressPunctuation`,e[e.compressPunctuationAndJapaneseKana=1]=`compressPunctuationAndJapaneseKana`,e[e.doNotCompress=2]=`doNotCompress`,e}({}),Ao=function(e){return e[e.PORTRAIT=0]=`PORTRAIT`,e[e.LANDSCAPE=1]=`LANDSCAPE`,e}({}),V=function(e){return e.Letter=`Letter`,e.Tabloid=`Tabloid`,e.Legal=`Legal`,e.Statement=`Statement`,e.Executive=`Executive`,e.Folio=`Folio`,e.A3=`A3`,e.A4=`A4`,e.A5=`A5`,e.B4=`B4`,e.B5=`B5`,e}({}),jo=[V.A3,V.A4,V.A5,V.B4,V.B5,V.Letter,V.Tabloid,V.Legal,V.Statement,V.Executive,V.Folio],Mo=function(e){return e[e.forward=0]=`forward`,e[e.backward=1]=`backward`,e[e.front=2]=`front`,e[e.back=3]=`back`,e}({}),No=function(e){return e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e[e.DRAWING_IMAGE=0]=`DRAWING_IMAGE`,e[e.DRAWING_SHAPE=1]=`DRAWING_SHAPE`,e[e.DRAWING_CHART=2]=`DRAWING_CHART`,e[e.DRAWING_TABLE=3]=`DRAWING_TABLE`,e[e.DRAWING_SMART_ART=4]=`DRAWING_SMART_ART`,e[e.DRAWING_VIDEO=5]=`DRAWING_VIDEO`,e[e.DRAWING_GROUP=6]=`DRAWING_GROUP`,e[e.DRAWING_UNIT=7]=`DRAWING_UNIT`,e[e.DRAWING_DOM=8]=`DRAWING_DOM`,e}({});function Po(){return e=>e}let Fo=Po()([`s`,`c`,`cl`,`t`]),Io=Po()([`rgb`,`th`]),Lo=Po()([`s`,`cl`]),Ro=Po()([`t`,`r`,`b`,`l`,`tl_br`,`tl_bc`,`tl_mr`,`bl_tr`,`ml_tr`,`bc_tr`]),zo=Po()([`a`,`v`]),Bo=Po()([`t`,`r`,`b`,`l`]),Vo=Po()([`ff`,`fs`,`it`,`bl`,`ul`,`bbl`,`st`,`ol`,`bg`,`bd`,`cl`,`va`,`n`,`tr`,`td`,`ht`,`vt`,`tb`,`pd`]);function Ho(e=xa(6),t=Ia.EN_US,n=``){return{id:e,locale:t,title:n,tableSource:{},drawings:{},drawingsOrder:[],headers:{},footers:{},body:{dataStream:`\r
|
|
2
|
-
`,textRuns:[],customBlocks:[],tables:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:595/.75,height:842/.75},documentFlavor:io.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:z.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:`#ccc`}},autoHyphenation:z.TRUE,doNotHyphenateCaps:z.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:``,defaultFooterId:``,evenPageHeaderId:``,evenPageFooterId:``,firstPageHeaderId:``,firstPageFooterId:``,evenAndOddHeaders:z.FALSE,useFirstPageHeaderFooter:z.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var Uo=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){if(Array.isArray(t))return!1;for(let n in e)if(!r(e[n],t[n]))return!1;for(let n in t)if(e[n]===void 0)return!1;return!0}function n(e,t){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1;return!0}function r(e,r){return e===r?!0:e===null||r===null||typeof e!=`object`||typeof r!=`object`?!1:Array.isArray(e)?n(e,r):t(e,r)}e.default=r})),Wo=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){if(e===null)return null;if(Array.isArray(e))return e.map(t);if(typeof e==`object`){let n={};for(let r in e)n[r]=t(e[r]);return n}else return e}e.default=t})),Go=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.eachChildOf=e.advancer=e.readCursor=e.writeCursor=e.WriteCursor=e.ReadCursor=e.isValidPathItem=void 0;function t(e,t){if(!e)throw Error(t)}let n=e=>typeof e==`object`&&!!e&&!Array.isArray(e),r=(e,t)=>typeof e==typeof t?e>t:typeof e==`string`&&typeof t==`number`;function i(e,t){for(let n in e){let r=n;t.write(r,e[r])}}e.isValidPathItem=e=>typeof e==`number`||typeof e==`string`&&e!==`__proto__`;var a=class{constructor(e=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=e}ascend(){t(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(t(this.idx>0),this.idx--,n(this.container[this.idx])&&this.idx--)}getPath(){let e=[],t=this.container,r=this.parents.length-1,i=this.idx;for(;i>=0;)e.unshift(t[i]),i===0?(i=this.indexes[r*2],t=this.parents[r--]):i-=n(t[i-1])?2:1;return e}},o=class e extends a{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return t(this.container!=null,`Invalid call to getKey before cursor descended`),this.container[this.idx]}getComponent(){let e;return this.container&&this.container.length>this.idx+1&&n(e=this.container[this.idx+1])?e:null}descendFirst(){let e=this.idx+1;if(!this.container||e>=this.container.length||n(this.container[e])&&e+1>=this.container.length)return!1;n(this.container[e])&&e++;let t=this.container[e];return Array.isArray(t)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(e),this.idx=0,this.container=t):this.idx=e,!0}nextSibling(){if(t(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;let e=this.indexes[this.indexes.length-1]+1,n=this.parents[this.parents.length-1];return e>=n.length?!1:(t(!isNaN(e)),this.indexes[this.indexes.length-1]=e,this.container=n[e],!0)}_init(e,t,n,r){this.container=e,this.idx=t,this.parents=n.slice(),this.indexes=r.slice()}clone(){let t=new e;return t._init(this.container,this.idx,this.parents,this.indexes),t}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(e,t){let n=this.getComponent();n&&t(n,e);for(let n of this)e&&e.descend(n),this.traverse(e,t),e&&e.ascend()}eachPick(e,t){this.traverse(e,(e,n)=>{e.p!=null&&t(e.p,n)})}eachDrop(e,t){this.traverse(e,(e,n)=>{e.d!=null&&t(e.d,n)})}};e.ReadCursor=o;var s=class extends a{constructor(e=null){super(e),this.pendingDescent=[],this._op=e}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let e=0;e<this.pendingDescent.length;e++){let i=this.pendingDescent[e],a=this.idx+1;if(a<this.container.length&&n(this.container[a])&&a++,t(a===this.container.length||!n(this.container[a])),a===this.container.length)this.container.push(i),this.idx=a;else if(this.container[a]===i)this.idx=a;else{if(!Array.isArray(this.container[a])){let e=this.container.splice(a,this.container.length-a);this.container.push(e),this.lcIdx>-1&&(this.lcIdx=a)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(i,this.container[this.lcIdx][0])),a=this.lcIdx+1,this.lcIdx=-1);a<this.container.length&&r(i,this.container[a][0]);)a++;if(this.indexes.push(a),this.idx=0,a<this.container.length&&this.container[a][0]===i)this.container=this.container[a];else{let e=[i];this.container.splice(a,0,e),this.container=e}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();let e=this.idx+1;if(e<this.container.length&&n(this.container[e]))return this.container[e];{let t={};return this.container.splice(e,0,t),t}}write(e,n){let r=this.getComponent();t(r[e]==null||r[e]===n,`Internal consistency error: Overwritten component. File a bug`),r[e]=n}get(){return this._op}descend(t){if(!e.isValidPathItem(t))throw Error(`Invalid JSON key`);this.pendingDescent.push(t)}descendPath(e){return this.pendingDescent.push(...e),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(e,n=i){if(e===null)return;if(t(Array.isArray(e)),e===this._op)throw Error(`Cannot merge into my own tree`);let r=this.lcIdx,a=this.parents.length,o=0;for(let t=0;t<e.length;t++){let r=e[t];typeof r==`string`||typeof r==`number`?(o++,this.descend(r)):Array.isArray(r)?this.mergeTree(r,n):typeof r==`object`&&n(r,this)}for(;o--;)this.ascend();this.lcIdx=this.parents.length===a?r:-1}at(e,t){this.descendPath(e),t(this);for(let t=0;t<e.length;t++)this.ascend();return this}writeAtPath(e,t,n){return this.at(e,()=>this.write(t,n)),this.reset(),this}writeMove(e,t,n=0){return this.writeAtPath(e,`p`,n).writeAtPath(t,`d`,n)}getPath(){let e=super.getPath();return e.push(...this.pendingDescent),e}};e.WriteCursor=s,e.writeCursor=()=>new s,e.readCursor=e=>new o(e);function c(e,t,n){let i,a;a=i=e?e.descendFirst():!1;function o(i){let o;for(;a;){let s=o=e.getKey();if(i!=null){let n=!1;if(t&&typeof s==`number`&&(o=t(s,e.getComponent()),o<0&&(o=~o,n=!0)),r(o,i))return null;if(o===i&&!n)return e}n&&typeof o==`number`&&n(o,e.getComponent()),a=e.nextSibling()}return null}return o.end=()=>{i&&e.ascend()},o}e.advancer=c;function l(e,t,n){let i,a,o,s;for(i=a=e&&e.descendFirst(),o=s=t&&t.descendFirst();i||o;){let a=i?e.getKey():null,s=o?t.getKey():null;a!==null&&s!==null&&(r(s,a)?s=null:a!==s&&(a=null)),n(a==null?s:a,a==null?null:e,s==null?null:t),a!=null&&i&&(i=e.nextSibling()),s!=null&&o&&(o=t.nextSibling())}a&&e.ascend(),s&&t.ascend()}e.eachChildOf=l})),Ko=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ConflictType=void 0,(function(e){e[e.RM_UNEXPECTED_CONTENT=1]=`RM_UNEXPECTED_CONTENT`,e[e.DROP_COLLISION=2]=`DROP_COLLISION`,e[e.BLACKHOLE=3]=`BLACKHOLE`})(e.ConflictType||(e.ConflictType={}))})),qo=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.uniToStrPos=e.strPosToUni=void 0,e.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){let t=e.charCodeAt(r);t>=55296&&t<=57343&&(n++,r++)}if(r!==t)throw Error(`Invalid offset - splits unicode bytes`);return r-n},e.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){let t=e.charCodeAt(n);n+=t>=55296&&t<=57343?2:1}return n}})),Jo=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;let t=qo(),n=t=>{if(!Array.isArray(t))throw Error(`Op must be an array of components`);let n=null;for(let r=0;r<t.length;r++){let i=t[r];switch(typeof i){case`object`:if(typeof i.d!=`number`&&typeof i.d!=`string`)throw Error(`Delete must be number or string`);if(e.dlen(i.d)<=0)throw Error(`Deletes must not be empty`);break;case`string`:if(!(i.length>0))throw Error(`Inserts cannot be empty`);break;case`number`:if(!(i>0))throw Error(`Skip components must be >0`);if(typeof n==`number`)throw Error(`Adjacent skip components should be combined`);break}n=i}if(typeof n==`number`)throw Error(`Op has a trailing skip`)};function r(n,r){let i=0,a=0;for(let o=0;o<n.length;o++){let s=n[o];switch(r(s,i,a),typeof s){case`object`:i+=e.dlen(s.d);break;case`string`:a+=t.strPosToUni(s);break;case`number`:i+=s,a+=s;break}}}e.eachOp=r;function i(e,t){let n=[],i=s(n);return r(e,(e,n,r)=>{i(t(e,n,r))}),d(n)}let a=e=>e,o=e=>i(e,a);e.dlen=e=>typeof e==`number`?e:t.strPosToUni(e);let s=t=>n=>{if(!(!n||n.d===0||n.d===``))if(t.length===0)t.push(n);else if(typeof n==typeof t[t.length-1])if(typeof n==`object`){let r=t[t.length-1];r.d=typeof r.d==`string`&&typeof n.d==`string`?r.d+n.d:e.dlen(r.d)+e.dlen(n.d)}else t[t.length-1]+=n;else t.push(n)},c=e=>typeof e==`number`?e:typeof e==`string`?t.strPosToUni(e):typeof e.d==`number`?e.d:t.strPosToUni(e.d);e.uniSlice=(e,n,r)=>{let i=t.uniToStrPos(e,n),a=r==null?1/0:t.uniToStrPos(e,r);return e.slice(i,a)};let l=(t,n,r)=>typeof t==`number`?r==null?t-n:Math.min(t,r)-n:e.uniSlice(t,n,r),u=n=>{let r=0,i=0;return{take:(a,o)=>{if(r===n.length)return a===-1?null:a;let s=n[r],c;if(typeof s==`number`)return a===-1||s-i<=a?(c=s-i,++r,i=0,c):(i+=a,a);if(typeof s==`string`){if(a===-1||o===`i`||t.strPosToUni(s.slice(i))<=a)return c=s.slice(i),++r,i=0,c;{let e=i+t.uniToStrPos(s.slice(i),a);return c=s.slice(i,e),i=e,c}}else if(a===-1||o===`d`||e.dlen(s.d)-i<=a)return c={d:l(s.d,i)},++r,i=0,c;else{let e=l(s.d,i,i+a);return i+=a,{d:e}}},peek:()=>n[r]}},d=e=>(e.length>0&&typeof e[e.length-1]==`number`&&e.pop(),e);function f(r,i,a){if(a!==`left`&&a!==`right`)throw Error(`side (`+a+`) must be 'left' or 'right'`);n(r),n(i);let o=[],l=s(o),{take:f,peek:p}=u(r);for(let n=0;n<i.length;n++){let r=i[n],o,s;switch(typeof r){case`number`:for(o=r;o>0;)s=f(o,`i`),l(s),typeof s!=`string`&&(o-=c(s));break;case`string`:a===`left`&&typeof p()==`string`&&l(f(-1)),l(t.strPosToUni(r));break;case`object`:for(o=e.dlen(r.d);o>0;)switch(s=f(o,`i`),typeof s){case`number`:o-=s;break;case`string`:l(s);break;case`object`:o-=e.dlen(s.d)}break}}let m;for(;m=f(-1);)l(m);return d(o)}function p(r,i){n(r),n(i);let a=[],o=s(a),{take:f}=u(r);for(let n=0;n<i.length;n++){let r=i[n],a,s;switch(typeof r){case`number`:for(a=r;a>0;)s=f(a,`d`),o(s),typeof s!=`object`&&(a-=c(s));break;case`string`:o(r);break;case`object`:a=e.dlen(r.d);let n=0;for(;n<a;)switch(s=f(a-n,`d`),typeof s){case`number`:o({d:l(r.d,n,n+s)}),n+=s;break;case`string`:n+=t.strPosToUni(s);break;case`object`:o(s)}break}}let p;for(;p=f(-1);)o(p);return d(a)}let m=(n,r)=>{let i=0;for(let a=0;a<r.length&&n>i;a++){let o=r[a];switch(typeof o){case`number`:i+=o;break;case`string`:let r=t.strPosToUni(o);i+=r,n+=r;break;case`object`:n-=Math.min(e.dlen(o.d),n-i);break}}return n},h=(e,t)=>typeof e==`number`?m(e,t):e.map(e=>m(e,t));function g(e,t,n){return i(e,(e,r)=>typeof e==`object`&&typeof e.d==`number`?{d:n.slice(t,r,r+e.d)}:e)}function _(e){return i(e,e=>{switch(typeof e){case`object`:if(typeof e.d==`number`)throw Error(`Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.`);return e.d;case`string`:return{d:e};case`number`:return e}})}function v(e){return i(e,e=>typeof e==`object`&&typeof e.d==`string`?{d:t.strPosToUni(e.d)}:e)}function y(e){let t=!0;return r(e,e=>{typeof e==`object`&&typeof e.d==`number`&&(t=!1)}),t}function b(t){return{name:`text-unicode`,uri:`http://sharejs.org/types/text-unicode`,trim:d,normalize:o,checkOp:n,create(e=``){if(typeof e!=`string`)throw Error(`Initial data must be a string`);return t.create(e)},apply(r,i){n(i);let a=t.builder(r);for(let t=0;t<i.length;t++){let n=i[t];switch(typeof n){case`number`:a.skip(n);break;case`string`:a.append(n);break;case`object`:a.del(e.dlen(n.d));break}}return a.build()},transform:f,compose:p,transformPosition:m,transformSelection:h,isInvertible:y,makeInvertible(e,n){return g(e,n,t)},stripInvertible:v,invert:_,invertWithDoc(e,n){return _(g(e,n,t))},isNoop:e=>e.length===0}}e.default=b})),Yo=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Jo(),n=qo();function r(e,r){return{get:e,getLength(){return e().length},insert(t,i,a){return r([n.strPosToUni(e(),t),i],a)},remove(t,i,a){return r([n.strPosToUni(e(),t),{d:i}],a)},_onOp(e){t.eachOp(e,(e,n,r)=>{switch(typeof e){case`string`:this.onInsert&&this.onInsert(r,e);break;case`object`:let n=t.dlen(e.d);this.onRemove&&this.onRemove(r,n)}})},onInsert:null,onRemove:null}}e.default=r,r.provides={text:!0}})),Xo=f((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)Object.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.type=e.remove=e.insert=void 0;let a=qo(),o=r(Jo()),s=i(Yo()),c={create(e){return e},toString(e){return e},builder(e){if(typeof e!=`string`)throw Error(`Invalid document snapshot: `+e);let t=[];return{skip(n){let r=a.uniToStrPos(e,n);if(r>e.length)throw Error(`The op is too long for this document`);t.push(e.slice(0,r)),e=e.slice(r)},append(e){t.push(e)},del(t){e=e.slice(a.uniToStrPos(e,t))},build(){return t.join(``)+e}}},slice:o.uniSlice},l=o.default(c);e.type=Object.assign(Object.assign({},l),{api:s.default}),e.insert=(e,t)=>t.length===0?[]:e===0?[t]:[e,t],e.remove=(e,t)=>o.dlen(t)===0?[]:e===0?[{d:t}]:[e,{d:t}];var u=Jo();Object.defineProperty(e,`makeType`,{enumerable:!0,get:function(){return u.default}})})),Zo=f((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;let n=t(Uo()),r=t(Wo()),i=Go(),a=Ko(),o=()=>{};function s(e,t){if(!e)throw Error(t)}let c=!1;e.type={name:`json1`,uri:`http://sharejs.org/types/JSONv1`,readCursor:i.readCursor,writeCursor:i.writeCursor,create:e=>e,isNoop:e=>e==null,setDebug(e){c=e,o.quiet=!e},registerSubtype:y,checkValidOp:D,normalize:O,apply:k,transformPosition:A,compose:j,tryTransform:re,transform:P,makeInvertible:ee,invert:M,invertWithDoc:te,RM_UNEXPECTED_CONTENT:a.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:a.ConflictType.DROP_COLLISION,BLACKHOLE:a.ConflictType.BLACKHOLE,transformNoConflict:(e,t,n)=>se(()=>!0,e,t,n),typeAllowingConflictsPred:t=>Object.assign(Object.assign({},e.type),{transform:(e,n,r)=>se(t,e,n,r)})};let l=e=>e?e.getComponent():null;function u(e){return e&&typeof e==`object`&&!Array.isArray(e)}let d=e=>Array.isArray(e)?e.slice():typeof e==`object`&&e?Object.assign({},e):e,f=e=>e&&(e.p!=null||e.r!==void 0),p=e=>e&&(e.d!=null||e.i!==void 0);function m(e,t){return s(e!=null),typeof t==`number`?(s(Array.isArray(e),`Invalid key - child is not an array`),(e=e.slice()).splice(t,1)):(s(u(e),`Invalid key - child is not an object`),delete(e=Object.assign({},e))[t]),e}function h(e,t,n){return typeof t==`number`?(s(e!=null,`Container is missing for key`),s(Array.isArray(e),`Cannot use numerical key for object container`),s(e.length>=t,`Cannot insert into out of bounds index`),e.splice(t,0,n)):(s(u(e),`Cannot insert into missing item`),s(e[t]===void 0,`Trying to overwrite value at key. Your op needs to remove it first`),e[t]=n),n}e.removeOp=(e,t=!0)=>i.writeCursor().writeAtPath(e,`r`,t).get(),e.moveOp=(e,t)=>i.writeCursor().writeMove(e,t).get(),e.insertOp=(e,t)=>i.writeCursor().writeAtPath(e,`i`,t).get(),e.replaceOp=(e,t,n)=>i.writeCursor().at(e,e=>{e.write(`r`,t),e.write(`i`,n)}).get(),e.editOp=(e,t,n,r=!1)=>i.writeCursor().at(e,e=>w(e,t,n,r)).get();let g=(e,t)=>e!=null&&(typeof t==`number`?Array.isArray(e):typeof e==`object`),_=(e,t)=>g(e,t)?e[t]:void 0,v={};function y(e){let t=e.type?e.type:e;t.name&&(v[t.name]=t),t.uri&&(v[t.uri]=t)}let b=e=>{let t=v[e];if(t)return t;throw Error(`Missing type: `+e)};y(Xo());let x=(e,t)=>e+t;y({name:`number`,apply:x,compose:x,invert:e=>-e,transform:e=>e});let S=e=>e==null?null:e.et?b(e.et):e.es?v[`text-unicode`]:e.ena==null?null:v.number,C=e=>e.es?e.es:e.ena==null?e.e:e.ena,w=(e,t,n,r=!1)=>{let[i,a]=typeof t==`string`?[b(t),t]:[t,t.name];!r&&i.isNoop&&i.isNoop(n)||(a===`number`?e.write(`ena`,n):a===`text-unicode`?e.write(`es`,n):(e.write(`et`,a),e.write(`e`,n)))};function T(e){s(typeof e==`number`),s(e>=0),s(e===(0|e))}function E(e){typeof e==`number`?T(e):s(typeof e==`string`)}function D(e){if(e===null)return;let t=new Set,n=new Set,r=e=>{let r=!0,i=!1;for(let a in e){let o=e[a];if(r=!1,s(a===`p`||a===`r`||a===`d`||a===`i`||a===`e`||a===`es`||a===`ena`||a===`et`,`Invalid component item '`+a+`'`),a===`p`)T(o),s(!t.has(o)),t.add(o),s(e.r===void 0);else if(a===`d`)T(o),s(!n.has(o)),n.add(o),s(e.i===void 0);else if(a===`e`||a===`es`||a===`ena`){s(!i),i=!0;let t=S(e);s(t,`Missing type in edit`),t.checkValidOp&&t.checkValidOp(C(e))}}s(!r)},a=(e,t,n)=>{if(!Array.isArray(e))throw Error(`Op must be null or a list`);if(e.length===0)throw Error(`Empty descent`);t||E(e[0]);let o=1,c=0,l=0;for(let t=0;t<e.length;t++){let u=e[t];if(s(u!=null),Array.isArray(u)){let e=a(u,!1,n);if(c){let t=typeof l,n=typeof e;t===n?s(l<e,`descent keys are not in order`):s(t===`number`&&n===`string`)}l=e,c++,o=3}else typeof u==`object`?(s(o===1,`Prev not scalar - instead ${o}`),r(u),o=2):(s(o!==3),E(u),s(i.isValidPathItem(u),`Invalid path key`),o=1)}return s(c!==1,`Operation makes multiple descents. Remove some []`),s(o===2||o===3),e[0]};a(e,!0,!1),s(t.size===n.size,`Mismatched picks and drops in op`);for(let e=0;e<t.size;e++)s(t.has(e)),s(n.has(e))}function O(e){let t=0,n=[],r=i.writeCursor();return r.mergeTree(e,(e,r)=>{let i=S(e);if(i){let t=C(e);w(r,i,i.normalize?i.normalize(t):t)}for(let i of[`r`,`p`,`i`,`d`])if(e[i]!==void 0){let o=i===`p`||i===`d`?(a=e[i],n[a]==null&&(n[a]=t++),n[a]):e[i];r.write(i,o)}var a}),r.get()}function k(e,t){if(o.quiet=!c,D(t),t===null)return e;let n=[];return function e(t,r){let i=t,a=0,o={root:t},c=0,l=o,u=`root`;function f(){for(;c<a;c++){let e=r[c];typeof e!=`object`&&(s(g(l,u)),l=l[u]=d(l[u]),u=e)}}for(;a<r.length;a++){let t=r[a];if(Array.isArray(t)){let n=e(i,t);n!==i&&n!==void 0&&(f(),i=l[u]=n)}else if(typeof t==`object`){t.d==null?t.i!==void 0&&(f(),i=h(l,u,t.i)):(f(),i=h(l,u,n[t.d]));let e=S(t);if(e)f(),i=l[u]=e.apply(i,C(t));else if(t.e!==void 0)throw Error(`Subtype `+t.et+` undefined`)}else i=_(i,t)}return o.root}(e=function e(t,r){let i=[],a=0;for(;a<r.length;a++){let e=r[a];if(Array.isArray(e))break;typeof e!=`object`&&(i.push(t),t=_(t,e))}for(let n=r.length-1;n>=a;n--)t=e(t,r[n]);for(--a;a>=0;a--){let e=r[a];if(typeof e!=`object`){let n=i.pop();t=t===_(n,e)?n:t===void 0?m(n,e):(c=e,l=t,(o=d(o=n))[c]=l,o)}else f(e)&&(s(t!==void 0,`Cannot pick up or remove undefined`),e.p!=null&&(n[e.p]=t),t=void 0)}var o,c,l;return t}(e,t),t)}function A(e,t){e=e.slice(),D(t);let n=i.readCursor(t),r,a,o=!1,s=[];for(let t=0;;t++){let c=e[t],l=n.getComponent();if(l&&(l.r===void 0?l.p!=null&&(o=!1,r=l.p,a=t):o=!0),t>=e.length)break;let u=0,d=i.advancer(n,void 0,(e,t)=>{f(t)&&u++});s.unshift(d);let p=d(c);if(typeof c==`number`&&(e[t]-=u),!p)break}if(s.forEach(e=>e.end()),o)return null;let c=()=>{let t=0;if(r!=null){let r=n.getPath();t=r.length,e=r.concat(e.slice(a))}for(;t<e.length;t++){let r=e[t],a=l(n),o=S(a);if(o){let n=C(a);o.transformPosition&&(e[t]=o.transformPosition(e[t],n));break}let s=0,c=i.advancer(n,(e,t)=>p(t)?~(e-s):e-s,(e,t)=>{p(t)&&s++})(r);if(typeof r==`number`&&(e[t]+=s),!c)break}};return r==null?c():n.eachDrop(null,e=>{e===r&&c()}),e}function j(e,t){if(D(e),D(t),e==null)return t;if(t==null)return e;let n=0,r=i.readCursor(e),a=i.readCursor(t),o=i.writeCursor(),c=[],u=[],d=[],m=[],h=[],g=[],_=new Set;r.traverse(null,e=>{e.p!=null&&(d[e.p]=r.clone())}),a.traverse(null,e=>{e.d!=null&&(m[e.d]=a.clone())});let v=i.writeCursor();return function e(t,r,a,o,v,y,b,x){s(r||a);let T=l(r),E=l(a),D=!!E&&E.r!==void 0,O=!!T&&T.i!==void 0,k=T?T.d:null,A=E?E.p:null,j=(y||D)&&A==null;if(A!=null)o=m[A],b=u[A]=new i.WriteCursor;else if(E&&E.r!==void 0)o=null;else{let e=l(o);e&&e.d!=null&&(o=null)}let M=l(o);if(k!=null)if(t=d[k],x=c[k]=new i.WriteCursor,j)y&&!D&&x.write(`r`,!0);else{let e=h[k]=n++;b.write(`d`,e)}else if(T&&T.i!==void 0)t=null;else{let e=l(t);e&&e.p!=null&&(t=null)}let N;O?(s(v===void 0),N=T.i):N=v;let ee=(A==null?!O||y||D:N===void 0)?null:b.getComponent();if(A!=null){if(!(v!==void 0||O)){let e=k==null?n++:h[k];g[A]=e,x.write(`p`,e)}}else D&&(O||v!==void 0||(E.r,x.write(`r`,E.r)));let te=j?null:S(T),ne=S(M);if((te||ne)&&(te&&te.name,ne&&ne.name),te&&ne){s(te===ne);let e=C(T),t=C(M),n=te.compose(e,t);w(b,te,n),_.add(M)}else te?w(b,te,C(T)):ne&&(w(b,ne,C(M)),_.add(M));let re=typeof N==`object`&&!!N,ie=!1,P=0,ae=0,oe=0,se=0,ce=0,le=i.advancer(o,(e,t)=>p(t)?se-e-1:e-se,(e,t)=>{p(t)&&se++}),ue=i.advancer(t,(e,t)=>f(t)?P-e-1:e-P,(e,t)=>{f(t)&&P++});if(i.eachChildOf(r,a,(t,n,r)=>{let i,a,o=t,c=t,u=t;if(typeof t==`number`){let e=t+oe;a=le(e),c=e+se;let d=t+ae;i=ue(d),p(l(a))&&(i=null),o=d+P,u=t+ce,s(o>=0,`p1PickKey is negative`),s(c>=0,`p2DropKey is negative`);let m=p(l(n)),h=f(l(r));(m||h&&!j)&&ce--,m&&ae--,h&&oe--}else i=ue(t),a=le(t);x.descend(o),b.descend(c);let d=re&&!p(l(n))?N[u]:void 0,m=e(i,n,r,a,d,j,b,x);var h,g,_;re&&!j?d!==m&&(ie||(N=Array.isArray(N)?N.slice():Object.assign({},N),ie=!0),h=N,_=m,typeof(g=u)==`number`?(s(Array.isArray(h)),s(g<h.length)):(s(!Array.isArray(h)),s(h[g]!==void 0)),_===void 0?typeof g==`number`?h.splice(g,1):delete h[g]:h[g]=_):s(m===void 0),b.ascend(),x.ascend()}),ue.end(),le.end(),ee!=null)ee.i=N;else if(!y&&!D&&A==null)return N}(r,r.clone(),a,a.clone(),void 0,!1,o,v),o.reset(),o.mergeTree(v.get()),o.reset(),o.get(),c.map(e=>e.get()),u.map(e=>e.get()),r.traverse(o,(e,t)=>{let n=e.p;if(n!=null){let e=h[n];e!=null&&t.write(`p`,e);let r=c[n];r&&r.get(),r&&t.mergeTree(r.get())}else e.r!==void 0&&t.write(`r`,e.r)}),o.reset(),o.get(),a.traverse(o,(e,t)=>{let n=e.d;if(n!=null){let e=g[n];e!=null&&t.write(`d`,e);let r=u[n];r&&t.mergeTree(r.get())}else e.i!==void 0&&t.write(`i`,e.i);let r=S(e);r&&!_.has(e)&&w(t,r,C(e))}),o.get()}function M(e){if(e==null)return null;let t=new i.ReadCursor(e),n=new i.WriteCursor,r,a=[],o=[];return function e(t,n,i){let o=t.getComponent(),s,c=!1;if(o){o.p!=null&&(n.write(`d`,o.p),a[o.p]=t.clone()),o.r!==void 0&&n.write(`i`,o.r),o.d!=null&&(n.write(`p`,o.d),i=void 0),o.i!==void 0&&(i=s=o.i);let e=S(o);e&&(i===void 0?(r||(r=new Set),r.add(o)):(C(o),i=e.apply(i,C(o)),c=!0))}let l=0;for(let r of t){n.descend(r);let a=typeof r==`number`?r-l:r,o=_(i,a);p(t.getComponent())&&l++;let s=e(t,n,o);if(i!==void 0&&s!==void 0){if(c||(c=!0,i=d(i)),!g(i,a))throw Error(`Cannot modify child - invalid operation`);i[a]=s}n.ascend()}if(s===void 0)return c?i:void 0;n.write(`r`,i)}(t,n,void 0),r&&(n.reset(),function e(t,n,s){let c=n.getComponent();if(c){let e=c.d;if(e!=null&&(t=a[e],s=o[e]=i.writeCursor()),r.has(c)){let e=S(c);if(!e.invert)throw Error(`Cannot invert subtype ${e.name}`);w(s,e,e.invert(C(c)))}}let l=0,u=0,d=i.advancer(t,(e,t)=>f(t)?l-e-1:e-l,(e,t)=>{f(t)&&l++});for(let t of n)if(typeof t==`number`){let r=t-u,i=d(r),a=r+l;s.descend(a),e(i,n,s),p(n.getComponent())&&u++,s.ascend()}else s.descend(t),e(d(t),n,s),s.ascend();d.end()}(t.clone(),t,n),o.length&&(n.reset(),t.traverse(n,(e,t)=>{let n=e.p;if(n!=null){let e=o[n];e&&e.get(),e&&t.mergeTree(e.get())}}))),n.get()}let N=(e,t)=>e.some(e=>typeof e==`object`&&(Array.isArray(e)?N(e,t):t(e)));function ee(e,t){if(e==null||!N(e,e=>{var t;return e.r!==void 0||((t=S(e))==null?void 0:t.makeInvertible)!=null}))return e;let n=new i.ReadCursor(e),a=new i.WriteCursor,o=!1,c=[],l=[],u=(e,t,n)=>{let i=e.getComponent(),a=!1;if(i){i.d!=null&&t.write(`d`,i.d),i.i!==void 0&&t.write(`i`,i.i);let r=i.p;if(r!=null&&(c[r]=e.clone(),s(n!==void 0,`Operation picks up at an invalid key`),l[r]=n,t.write(`p`,i.p)),i.r!==void 0&&n===void 0)throw Error(`Invalid doc / op in makeInvertible: removed item missing from doc`);let a=S(i);a&&(a.makeInvertible?o=!0:w(t,a,C(i),!0))}let f=0;for(let r of e){t.descend(r);let i=typeof r==`number`?r-f:r,o=_(n,i),s=u(e,t,o);o!==s&&(a||(a=!0,n=d(n)),s===void 0?(n=m(n,i),typeof r==`number`&&f++):n[i]=s),t.ascend()}return i&&(i.r===void 0?i.p!=null&&(n=void 0):(t.write(`r`,r.default(n)),n=void 0)),n};return u(n,a,t),a.get(),o&&(a.reset(),function e(t,n,r,a,o){let s=n.getComponent();if(s){s.i===void 0?s.d!=null&&(a=l[s.d],t=c[s.d],o=!1,s.d):(a=s.i,o=!0);let e=S(s);if(e&&e.makeInvertible){let t=C(s);w(r,e,e.makeInvertible(t,a),!0)}}let u=0,d=0,m=i.advancer(t,(e,t)=>f(t)?u-e-1:e-u,(e,t)=>{f(t)&&u++});for(let t of n)if(typeof t==`number`){let i=t-d,s=m(i),c=i+u,l=_(a,o?i:c);r.descend(t),e(s,n,r,l,o),p(n.getComponent())&&d++,r.ascend()}else{let i=_(a,t);r.descend(t),e(m(t),n,r,i,o),r.ascend()}m.end()}(n.clone(),n,a,t,!1)),a.get()}function te(e,t){return M(ee(e,t))}let ne=e=>{if(e==null)return null;let t=e.slice();for(let n=0;n<e.length;n++){let e=t[n];Array.isArray(e)&&(t[n]=ne(e))}return t};function re(t,u,d){s(d===`left`||d===`right`,`Direction must be left or right`);let m=d===`left`?0:1;if(o.quiet=!c,o.prefix=0,u==null)return{ok:!0,result:t};D(t),D(u);let h=null,g=[],_=[],v=[],y=[],b=[],x=[],T=[],E=[],O=[],k=[],A=[],j=[],M=[],N=[],ee=[],te=0,re=i.readCursor(t),ie=i.readCursor(u),P=i.writeCursor();if(function e(t,n=null,r){let a=l(n);a&&(a.r===void 0?a.p!=null&&(r=null,x[a.p]=t.clone()):r=n.clone());let o=t.getComponent(),s;o&&(s=o.p)!=null&&(b[s]=n?n.clone():null,v[s]=t.clone(),r&&(k[s]=!0,O[s]=r),a&&a.p!=null&&(N[s]=a.p));let c=i.advancer(n);for(let n of t)e(t,c(n),r);c.end()}(ie,re,null),function t(n,r,o,s,c){let u=o.getComponent(),d,p=!1;u&&((d=u.d)==null?u.i!==void 0&&(n=r=null,p=!0,c&&h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(c.getPath()),op2:e.insertOp(o.getPath(),u.i)})):(y[d]=o.clone(),s!=null&&(ee[s]==null&&(ee[s]=[]),ee[s].push(d)),k[d],n=b[d]||null,r=v[d]||null,k[d]?(c&&(A[d]=!0),c=O[d]||null):!c||m!==1&&N[d]!=null||h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(c.getPath()),op2:e.moveOp(r.getPath(),o.getPath())}),p=!0));let g=l(n);g&&(g.r===void 0?g.p!=null&&(g.p,s=g.p,c=null):c=n.clone());let _=S(u);_&&c&&h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(c.getPath()),op2:e.editOp(o.getPath(),_,C(u),!0)});let x=0,w=0,T=i.advancer(r,(e,t)=>f(t)?x-e-1:e-x,(e,t)=>{f(t)&&x++}),E=i.advancer(n);for(let e of o)if(typeof e==`number`){let n=e-w,r=T(n);w+=+t(E(n+x),r,o,s,c)}else{let n=T(e);t(E(e),n,o,s,c)}return T.end(),E.end(),p}(re,ie,ie.clone(),null,null),y.map(e=>e&&e.get()),h)return{ok:!1,conflict:h};A.map(e=>!!e);let ae=[],oe=null;(function e(t,n,r,a,o){let c=!1,u=l(n);if(f(u)){let e=u.p;e==null?(r=null,o=n.clone()):(r=y[e],a=j[e]=i.writeCursor(),c=!0,o=null)}else p(l(r))&&(r=null);let d=t.getComponent();if(d){let e=d.p;e==null?d.r!==void 0&&(o||a.write(`r`,!0),(o||c)&&(oe==null&&(oe=new Set),oe.add(d))):(o&&(E[e]=o),ae[e]=o||m===1&&c?null:a.getComponent(),g[e]=t.clone(),r&&(T[e]=r.clone()))}let h=0,_=0,v=i.advancer(n,void 0,(e,t)=>{f(t)&&h++}),b=i.advancer(r,(e,t)=>p(t)?~(e-_):e-_,(e,t)=>{p(t)&&_++});if(t)for(let n of t)if(typeof n==`string`){let r=v(n),i=b(n);a.descend(n),e(t,r,i,a,o),a.ascend()}else{let r=v(n),i=n-h,c=f(l(r))?null:b(i),u=i+_;s(u>=0),a.descend(u),e(t,r,c,a,o),a.ascend()}v.end(),b.end()})(re,ie,ie.clone(),P,null),P.reset();let se=[];if(function t(o,c,u,b,D,O){s(c);let A=c.getComponent(),j=l(b),ee=!1,ne=(t,n,r)=>t?e.moveOp(t.getPath(),n.getPath()):e.insertOp(n.getPath(),r.i);if(p(A)){let t=A.d;t!=null&&(_[t]=c.clone());let i=t==null?null:ae[t],s=!1;if(A.i!==void 0||t!=null&&i){let o;j&&(j.i!==void 0||(o=j.d)!=null&&!k[o])&&(s=o==null?n.default(j.i,A.i):t!=null&&t===N[o],s||o!=null&&m!==1&&N[o]!=null||h==null&&(h={type:a.ConflictType.DROP_COLLISION,op1:ne(t==null?null:g[t],c,A),op2:ne(o==null?null:v[o],b,j)})),s||(O?h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:ne(t==null?null:g[t],c,A),op2:e.removeOp(O.getPath())}):(t==null?D.write(`i`,r.default(A.i)):(se[te]=t,D.write(`d`,i.p=te++)),ee=!0))}else if(t!=null&&!i){let e=E[t];e&&(O=e.clone())}t==null?A.i!==void 0&&(o=u=null,s||(b=null)):(o=g[t],u=x[t],b=T[t])}else f(l(o))&&(o=u=b=null);let re=l(o),ie=l(u);if(f(ie)){let e=ie.p;ie.r!==void 0&&(!re||re.r===void 0)||k[e]?(b=null,O=u.clone()):e!=null&&(b=y[e],m!==1&&N[e]!=null||((D=M[e])||(D=M[e]=i.writeCursor()),D.reset(),O=null))}else !p(A)&&p(j)&&(b=null);j=b==null?null:b.getComponent();let P=S(A);if(P){let t=C(A);if(O)h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(c.getPath(),P,t,!0),op2:e.removeOp(O.getPath())});else{let e=S(j),n;if(e){if(P!==e)throw Error(`Transforming incompatible types`);let r=C(j);n=P.transform(t,r,d)}else n=r.default(t);w(D,P,n)}}let ce=0,le=0,ue=0,de=0,fe=0,pe=0,me=o!=null&&o.descendFirst(),F=me,he=i.advancer(u,void 0,(e,t)=>{f(t)&&ue++}),ge=b!=null&&b.descendFirst(),_e=ge;for(let e of c)if(typeof e==`number`){let n,r=p(c.getComponent()),i=e-le;{let e;for(;me&&typeof(e=o.getKey())==`number`;){e+=ce;let t=o.getComponent(),n=f(t);if(e>i||e===i&&(!n||m===0&&r))break;if(n){ce--;let e=t.p;ae[e],N.includes(e),t.d,l(M[t.d]),f(l(M[t.d])),(t.r===void 0||oe&&oe.has(t))&&(e==null||!ae[e]||m!==1&&N.includes(e))||fe--}me=o.nextSibling()}n=me&&e===i?o:null}let a=i-ce,u=he(a),d=a-ue,h=null;{let e,t;for(;ge&&typeof(e=b.getKey())==`number`;){t=e-de;let n=b.getComponent(),i=p(n);if(t>d)break;if(t===d){if(!i){h=b;break}{if(m===0&&r){h=b;break}let e=u&&f(u.getComponent());if(m===0&&e)break}}if(i){let e=n.d;k[e],N[e],n.i===void 0&&(k[e]||N[e]!=null&&m!==1)?(k[e]||N[e]!=null&&m===0)&&(de++,pe--):de++}ge=b.nextSibling()}}let g=d+de+fe+pe;s(g>=0,`trying to descend to a negative index`),D.descend(g),r&&(n=u=h=null,le++),t(n,c,u,h,D,O)&&pe++,D.ascend()}else{let n;for(;me&&(n=o.getKey(),typeof n!=`string`||!(n>e||n===e));)me=o.nextSibling();let r=me&&n===e?o:null,i=he(e),a;for(;ge&&(a=b.getKey(),typeof a!=`string`||!(a>e||a===e));)ge=b.nextSibling();let s=ge&&a===e?b:null;D.descend(e),t(r,c,i,s,D,O),D.ascend()}return he.end(),F&&o.ascend(),_e&&b.ascend(),ee}(re,re.clone(),ie,ie.clone(),P,null),h)return{ok:!1,conflict:h};P.reset();let ce=(e,t,n)=>e.traverse(t,(t,r)=>{t.d!=null&&n(t.d,e,r)});(k.length||j.length)&&(ce(ie,P,(e,t,n)=>{k[e]&&!A[e]&&n.write(`r`,!0),j[e]&&n.mergeTree(j[e].get())}),P.reset());let le=[],ue=[];if((M.length||k.length)&&!h){let e=i.readCursor(ne(P.get()));if(ce(e,null,(e,t)=>{le[e]=t.clone()}),M.forEach(e=>{e&&ce(i.readCursor(e.get()),null,(e,t)=>{le[e]=t.clone()})}),function e(t,n,r,a,s,c){o.prefix++;let u=l(n);if(u&&f(u))if(u.p!=null){s=u;let e=u.p;le[e].getPath(),r=le[e],a=ue[e]=i.writeCursor()}else u.r!==void 0&&(r=null,c=!0);else p(l(r))&&(r=null);let d=t.getComponent();if(d){let e;if((e=d.d)!=null){let t=M[e];t&&(t.get(),a.mergeTree(t.get()),r=i.readCursor(t.get()))}}let m=0,h=0,g=i.advancer(n,void 0,(e,t)=>{f(t)&&m--}),_=i.advancer(r,(e,t)=>p(t)?-(e-h)-1:e-h,(e,t)=>{p(t)&&h++});for(let n of t)if(typeof n==`number`){let r=g(n),i=n+m,o=_(i),l=i+h;a.descend(l),e(t,r,o,a,s,c),a.ascend()}else a.descend(n),e(t,g(n),_(n),a,s,c),a.ascend();g.end(),_.end()}(ie,e,e.clone(),P,null,!1),P.reset(),h)return{ok:!1,conflict:h};if(P.get(),ue.length){let e=ue.map(e=>e?e.get():null);if(ce(i.readCursor(ne(P.get())),P,(t,n,r)=>{let i=e[t];i&&(r.mergeTree(i),e[t]=null)}),e.find(e=>e)){let t=i.writeCursor(),n=i.writeCursor(),r=0,o=0;e.forEach(e=>{e!=null&&ce(i.readCursor(e),null,e=>{let i=se[e];t.writeMove(g[i].getPath(),_[i].getPath(),r++);let a=ee[i];a&&a.forEach(e=>{k[e]||m!==1&&N[e]!=null||n.writeMove(v[e].getPath(),y[e].getPath(),o++)})})}),h={type:a.ConflictType.BLACKHOLE,op1:t.get(),op2:n.get()}}}}return h?{ok:!1,conflict:h}:{ok:!0,result:P.get()}}let ie=e=>{let t=Error(`Transform detected write conflict`);throw t.conflict=e,t.type=t.name=`writeConflict`,t};function P(e,t,n){let r=re(e,t,n);if(r.ok)return r.result;ie(r.conflict)}let ae=e=>{let t=i.writeCursor();return i.readCursor(e).traverse(t,(e,t)=>{(p(e)||S(e))&&t.write(`r`,!0)}),t.get()},oe=(e,t)=>{let{type:n,op1:r,op2:o}=e;switch(n){case a.ConflictType.DROP_COLLISION:return t===`left`?[null,ae(o)]:[ae(r),null];case a.ConflictType.RM_UNEXPECTED_CONTENT:let e=!1;return i.readCursor(r).traverse(null,t=>{t.r!==void 0&&(e=!0)}),e?[null,ae(o)]:[ae(r),null];case a.ConflictType.BLACKHOLE:return[ae(r),ae(o)];default:throw Error(`Unrecognised conflict: `+n)}};function se(e,t,n,r){let i=null;for(;;){let a=re(t,n,r);if(a.ok)return j(i,a.result);{let{conflict:o}=a;e(o)||ie(o);let[s,c]=oe(o,r);t=j(O(t),s),n=j(O(n),c),i=j(i,c)}}}})),Qo=h(f((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!n.hasOwnProperty(r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Zo(),e);var r=Go();Object.defineProperty(e,`ReadCursor`,{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,`WriteCursor`,{enumerable:!0,get:function(){return r.WriteCursor}});var i=Ko();Object.defineProperty(e,`ConflictType`,{enumerable:!0,get:function(){return i.ConflictType}})}))());let H=function(e){return e[e.COVER=0]=`COVER`,e[e.REPLACE=1]=`REPLACE`,e}({}),U=function(e){return e.RETAIN=`r`,e.INSERT=`i`,e.DELETE=`d`,e}({}),$o=(0,t.createIdentifier)(`univer.config-service`);var es=class{constructor(){F(this,`_configChanged$`,new r.Subject),F(this,`configChanged$`,this._configChanged$.asObservable()),F(this,`_config`,new Map)}dispose(){this._config.clear(),this._configChanged$.complete()}getConfig(e){return this._config.get(e)}setConfig(e,t,n){var r;let{merge:i=!1}=n||{},a=(r=this._config.get(e))==null?{}:r;a=i?Bi(a,t):t,this._config.set(e,a),this._configChanged$.next({[e]:a})}deleteConfig(e){return this._config.delete(e)}subscribeConfigValue$(e){return new r.Observable(t=>{Object.prototype.hasOwnProperty.call(this._config,e)&&t.next(this._config.get(e));let n=this.configChanged$.pipe((0,r.filter)(t=>Object.prototype.hasOwnProperty.call(t,e))).subscribe(n=>t.next(n[e]));return()=>n.unsubscribe()})}};let ts=(0,t.createIdentifier)(`univer.context-service`);var ns=class extends ra{constructor(...e){super(...e),F(this,`_contextChanged$`,new r.Subject),F(this,`contextChanged$`,this._contextChanged$.asObservable()),F(this,`_contextMap`,new Map)}dispose(){super.dispose(),this._contextChanged$.complete(),this._contextMap.clear()}getContextValue(e){var t;return(t=this._contextMap.get(e))==null?!1:t}setContextValue(e,t){this._contextMap.set(e,t),this._contextChanged$.next({[e]:t})}subscribeContextValue$(e){return new r.Observable(t=>{let n=this._contextChanged$.pipe((0,r.filter)(t=>t[e]!==void 0)).subscribe(n=>t.next(n[e]));return this._contextMap.has(e)&&t.next(this._contextMap.get(e)),()=>n.unsubscribe()})}};let rs=function(e){return e[e.SILENT=0]=`SILENT`,e[e.ERROR=1]=`ERROR`,e[e.WARN=2]=`WARN`,e[e.INFO=3]=`INFO`,e[e.VERBOSE=4]=`VERBOSE`,e}({}),is=(0,t.createIdentifier)(`univer.log`);var as=class extends ra{constructor(...e){super(...e),F(this,`_logLevel`,rs.INFO),F(this,`_deduction`,new Set)}dispose(){super.dispose(),this._logLevel=rs.INFO,this._deduction.clear()}debug(...e){this._logLevel>=rs.VERBOSE&&this._log(console.debug,...e)}log(...e){this._logLevel>=rs.INFO&&this._log(console.log,...e)}warn(...e){this._logLevel>=rs.WARN&&this._log(console.warn,...e)}error(...e){this._logLevel>=rs.ERROR&&this._log(console.error,...e)}deprecate(...e){this._logLevel>=rs.WARN&&this._logWithDeduplication(console.error,...e)}setLogLevel(e){this._logLevel=e}_log(e,...t){let n=t[0];/^\[(.*?)\]/g.test(n)?e(`\x1B[97;104m${n}\x1B[0m`,...t.slice(1)):e(...t)}_logWithDeduplication(e,...t){let n=os(...t);this._deduction.has(n)||(this._deduction.add(n),this._log(e,...t))}};function os(...e){return e.map(e=>JSON.stringify(e)).join(``)}function W(e,t){return function(n,r){t(n,r,e)}}function ss(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let cs=`command.logExecution`,ls=function(e){return e[e.COMMAND=0]=`COMMAND`,e[e.OPERATION=1]=`OPERATION`,e[e.MUTATION=2]=`MUTATION`,e}({}),us=(0,t.createIdentifier)(`univer.core.command-service`);var ds=class{constructor(){F(this,`_commands`,new Map),F(this,`_commandTypes`,new Map)}registerCommand(e){if(this._commands.has(e.id))throw Error(`[CommandRegistry]: command "${e.id}" has been registered before.`);return this._commands.set(e.id,e),this._commandTypes.set(e.id,e.type),ta(()=>{this.unregisterCommand(e.id)})}unregisterCommand(e){this._commands.delete(e),this._commandTypes.delete(e)}hasCommand(e){return this._commands.has(e)}getCommand(e){return this._commands.has(e)?[this._commands.get(e)]:null}getCommandType(e){return this._commandTypes.get(e)}};let fs={id:`nil`,type:ls.COMMAND,handler:()=>!0},ps=class extends ra{constructor(e,t,n){super(),this._injector=e,this._logService=t,this._configService=n,F(this,`_commandRegistry`,void 0),F(this,`_beforeCommandExecutionListeners`,[]),F(this,`_commandExecutedListeners`,[]),F(this,`_collabMutationListeners`,[]),F(this,`_multiCommandDisposables`,new Map),F(this,`_commandExecutingLevel`,0),F(this,`_commandExecutionStack`,[]),this._commandRegistry=new ds,this.registerCommand(fs)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0,this._collabMutationListeners.length=0}disposed(){return this._disposed}hasCommand(e){return this._commandRegistry.hasCommand(e)}registerCommand(e){return this._commandRegistry.registerCommand(e)}unregisterCommand(e){var t;this._commandRegistry.unregisterCommand(e),(t=this._multiCommandDisposables.get(e))==null||t.dispose()}registerMultipleCommand(e){return this._registerMultiCommand(e)}beforeCommandExecuted(e){if(this._beforeCommandExecutionListeners.indexOf(e)===-1)return this._beforeCommandExecutionListeners.push(e),ta(()=>{let t=this._beforeCommandExecutionListeners.indexOf(e);this._beforeCommandExecutionListeners.splice(t,1)});throw Error(`[CommandService]: could not add a listener twice.`)}onCommandExecuted(e){if(this._commandExecutedListeners.indexOf(e)===-1)return this._commandExecutedListeners.push(e),ta(()=>{let t=this._commandExecutedListeners.indexOf(e);this._commandExecutedListeners.splice(t,1)});throw Error(`[CommandService]: could not add a listener twice.`)}onMutationExecutedForCollab(e){if(this._collabMutationListeners.indexOf(e)===-1)return this._collabMutationListeners.push(e),ta(()=>{let t=this._collabMutationListeners.indexOf(e);this._collabMutationListeners.splice(t,1)});throw Error(`[CommandService]: could not add a collab mutation listener twice.`)}async executeCommand(e,t,n){try{let r=this._commandRegistry.getCommand(e);if(r){let[e]=r,i={id:e.id,type:e.type,params:t},a=this._pushCommandExecutionStack(i),o=n==null?{}:n;this._beforeCommandExecutionListeners.forEach(e=>e(i,o));let s=await this._execute(e,t,o);return o.syncOnly||this._commandExecutedListeners.forEach(e=>e(i,o)),e.type===ls.MUTATION&&this._collabMutationListeners.forEach(e=>e(i,o)),a.dispose(),s}throw Error(`[CommandService]: command "${e}" is not registered.`)}catch(e){if(e instanceof le)return!1;throw e}}syncExecuteCommand(e,t,n){try{let i=this._commandRegistry.getCommand(e);if(i){let[e]=i,a={id:e.id,type:e.type,params:t};if(e.type===ls.MUTATION){let e=w(this._commandExecutionStack,e=>e.type===ls.COMMAND);if(e){var r;a.params=(r=a.params)==null?{}:r,a.params.trigger=e.id}}let o=this._pushCommandExecutionStack(a),s=n==null?{}:n;this._beforeCommandExecutionListeners.forEach(e=>e(a,s));let c=this._syncExecute(e,t,s);return s.syncOnly||this._commandExecutedListeners.forEach(e=>e(a,s)),e.type===ls.MUTATION&&this._collabMutationListeners.forEach(e=>e(a,s)),o.dispose(),c}throw Error(`[CommandService]: command "${e}" is not registered.`)}catch(e){if(e instanceof le)return!1;throw e}}_pushCommandExecutionStack(e){return this._commandExecutionStack.push(e),ta(()=>x(this._commandExecutionStack,e))}_registerMultiCommand(e){let t=this._commandRegistry.getCommand(e.id),n;if(!t){n=new ms(e.id);let t=new na;t.add(this._commandRegistry.registerCommand(n)),t.add(ta(()=>{this._multiCommandDisposables.delete(e.id)})),this._multiCommandDisposables.set(e.id,t)}else if(t[0].multi!==!0)throw Error(`Command has registered as a single command.`);else n=t[0];let r=n.registerImplementation(e);return ta(()=>{if(r.dispose(),!n.hasImplementations()){var t;(t=this._multiCommandDisposables.get(e.id))==null||t.dispose()}})}async _execute(e,t,n){if(n!=null&&n.syncOnly)return!0;this._configService.getConfig(`command.logExecution`)!==!1&&this._logService.debug(`[CommandService]`,`${`|-`.repeat(Math.max(this._commandExecutingLevel,0))}executing command "${e.id}"`),this._commandExecutingLevel++;let r;try{r=await this._injector.invoke(e.handler,t,n),this._commandExecutingLevel--}catch(e){throw r=!1,this._commandExecutingLevel=0,e}return r}_syncExecute(e,t,n){if(n!=null&&n.syncOnly)return!0;this._configService.getConfig(`command.logExecution`)!==!1&&this._logService.debug(`[CommandService]`,`${`|-`.repeat(Math.max(0,this._commandExecutingLevel))}executing command "${e.id}".`),this._commandExecutingLevel++;let r;try{if(r=this._injector.invoke(e.handler,t,n),r instanceof Promise)throw TypeError(`[CommandService]: Command handler should not return a promise.`);this._commandExecutingLevel--}catch(e){throw r=!1,this._commandExecutingLevel=0,e}return r}};ps=ss([W(0,(0,t.Inject)(t.Injector)),W(1,is),W(2,$o)],ps);var ms=class{constructor(e){this.id=e,F(this,`name`,void 0),F(this,`multi`,!0),F(this,`type`,ls.COMMAND),F(this,`priority`,0),F(this,`_implementations`,[]),F(this,`handler`,async(e,n)=>{if(!this._implementations.length)return!1;let r=e.get(is),i=e.get(ts),a=e.get(t.Injector);for(let e of this._implementations){let t=e.command.preconditions;if((!t||t&&t(i))&&(r.debug(`[MultiCommand]`,`executing implementation "${e.command.name}".`),await a.invoke(e.command.handler,n)))return!0}return!1}),this.name=e}registerImplementation(e){let t={command:e};return this._implementations.push(t),this._implementations.sort((e,t)=>t.command.priority-e.command.priority),ta(()=>{let e=this._implementations.indexOf(t);this._implementations.splice(e,1)})}hasImplementations(){return this._implementations.length>0}};function hs(e,t,n){return Qi(e.map(e=>()=>t.syncExecuteCommand(e.id,e.params,n)))}function gs(e,t,n){return Zi(e.map(e=>()=>t.executeCommand(e.id,e.params,n)))}function _s(e){return new r.Observable(t=>{let n=e((...e)=>t.next(e));return()=>n==null?void 0:n.dispose()})}function vs(e){return function(t){return new r.Observable(n=>(t.subscribe({next:t=>{n.next(t),e(t)&&n.complete()},complete:()=>n.complete(),error:e=>n.error(e)}),()=>n.unsubscribe()))}}function ys(e=0){return t=>{let n=[];return t.pipe((0,r.tap)(e=>n.push(e)),(0,r.debounceTime)(e),(0,r.map)(()=>n),(0,r.tap)(()=>n=[]))}}function bs(e){let t=new r.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe((0,r.take)(1))}function xs(e,t){let n=new r.BehaviorSubject(t);return e.subscribe(n),n}let Ss=e=>new Promise(t=>{(0,r.merge)(_s(e.onCommandExecuted.bind(e)).pipe((0,i.filter)(([e])=>e.type===ls.MUTATION)),(0,r.timer)(300)).pipe((0,i.debounceTime)(16),(0,i.first)()).subscribe(()=>{t()})});function Cs(e,t){let n=0,r=e.length-1;if(t<e[0])return 0;if(t>=e[e.length-1])return e.length-1;for(;n<=r;){if(e[n]===t){for(;n<e.length&&e[n]===t;)n++;return n}if(t>e[n]&&t<e[n+1])return n+1;if(e[r]===t){for(;r<e.length&&e[r]===t;)r++;return r}if(t>e[r-1]&&t<e[r])return r;n++,r--}return-1}function ws(e,t){let n=0,r=e.length-1;for(;n<=r;){let i=Math.floor((r+n)/2);if(t<e[i]&&(i===0||t>=e[i-1]))return i;if(t>=e[i])n=i+1;else if(t<e[i])r=i-1;else return-1}return-1}function Ts(e,t){let n=0,r=e.length;for(;n<r;){let i=Math.floor((n+r)/2);e[i]<=t?n=i+1:r=i}return n<e.length?n:e.length-1}function Es(e,t,n=!1){let r=e.length-1;if(t<0||t<e[0])return 0;if(r=e.length<40||t<=e[20]||t>=e[r-20]?Cs(e,t):Ts(e,t),n){let t=e[r];return e.indexOf(t)}return r}function Ds(e){let t=new Blob([e],{type:`text/javascript`});return window.URL.createObjectURL(t)}function Os(e,t){if(t==null||e==null)return!0;let{left:n=0,top:r=0,height:i=0,width:a=0,angle:o=0}=t,{left:s=0,top:c=0,height:l=0,width:u=0,angle:d=0}=e,f=u,p=l,m=a,h=i;return Math.abs(s-n)>2||Math.abs(c-r)>2||Math.abs(f-m)>2||Math.abs(p-h)>2||Math.abs(d-o)>1}let ks={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],darkyellow:[139,128,0],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]};var As=class e{static mix(t,n,r){var i,a;r=Math.min(1,Math.max(0,r));let o=new e(t).toRgb(),s=new e(n).toRgb(),c=(i=o.a)==null?1:i,l=(a=s.a)==null?1:a;return new e({r:(s.r-o.r)*r+o.r,g:(s.g-o.g)*r+o.g,b:(s.b-o.b)*r+o.b,a:(l-c)*r+c})}static getContrastRatio(t,n){let r=new e(t).getLuminance(),i=new e(n).getLuminance();return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}constructor(t){if(F(this,`_color`,void 0),F(this,`_rgbColor`,void 0),F(this,`_isValid`,!1),t==null){this._setNullColor();return}if(t instanceof e){this._color={...t._color},this._rgbColor={...t._rgbColor};return}let n=Ns(t);if(n==null){this._setNullColor();return}this._color=n;let r=Rs(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){let{r:e,g:t,b:n,a:r=1}=this.toRgb(),i=r<1;return`rgb${i?`a`:``}(${e},${t},${n}${i?`,${r}`:``})`}toString(){return this.toRgbString()}toHexString(e){let{r:t,g:n,b:r,a:i=1}=this.toRgb(),a=i<1,o=[js(Math.round(t).toString(16)),js(Math.round(n).toString(16)),js(Math.round(r).toString(16)),js(Math.round(i*255).toString(16))];return e&&o[0][0]===o[0][1]&&o[1][0]===o[1][1]&&o[2][0]===o[2][1]&&o[3][0]===o[3][1]?a?`#${o[0][0]}${o[1][0]}${o[2][0]}${o[3][0]}`:`#${o[0][0]}${o[1][0]}${o[2][0]}`:a?`#${o[0]}${o[1]}${o[2]}${o[3]}`:`#${o[0]}${o[1]}${o[2]}`}toHsv(){return Us(this.toRgb())}toHsl(){return Hs(this.toRgb())}lighten(t=10){let n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new e(n)}darken(t=10){let n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new e(n)}setAlpha(t){return new e({...this._rgbColor,a:t})}getLuminance(){let{r:e,g:t,b:n}=this.toRgb();return e=Ms(e),t=Ms(t),n=Ms(n),Number((.2126*e+.7152*t+.0722*n).toFixed(3))}getBrightness(){let{r:e,g:t,b:n}=this.toRgb();return(e*299+t*587+n*114)/1e3}getAlpha(){var e;return(e=this._color.a)==null?1:e}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}}};let js=e=>e.length===1?`0${e}`:e,Ms=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),Ns=e=>{if(Gs(e)){if(`r`in e){let t={r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)};return e.a!==void 0&&(t.a=e.a),t}if(`l`in e){let t={h:Math.round(e.h),s:e.s,l:e.l};return e.a!==void 0&&(t.a=e.a),t}let t={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(t.a=e.a),t}let t=e.trim().toLowerCase();if(ks[t]){let e=ks[t],n={r:Math.round(e[0]),g:Math.round(e[1]),b:Math.round(e[2])};return n.a=e[3]||1,n}if(t.startsWith(`#`))return Ps(t);if(t.startsWith(`rgb`))return Fs(t);if(t.startsWith(`hsl`))return Is(t);if(t.startsWith(`hsv`))return Ls(t)},Ps=e=>{let t=e.substring(1),n=RegExp(`.{1,${t.length>=6?2:1}}`,`g`),r=t.match(n);if(!r||r.length<3)throw Error(`The color '${e}' is illegal hex color`);r[0].length===1&&(r=r.map(e=>e+e));let i={r:Number.parseInt(r[0],16),g:Number.parseInt(r[1],16),b:Number.parseInt(r[2],16)};return r.length>3&&(i.a=Number.parseInt(r[3],16)/255),i},Fs=e=>{let t=e.indexOf(`(`);if(t===-1)throw Error(`The color '${e}' is illegal rgb color`);let n=e.substring(t+1,e.length-1).split(`,`);if(n.length<3)throw Error(`The color '${e}' is illegal rgb color`);let r={r:Number.parseInt(n[0],10),g:Number.parseInt(n[1],10),b:Number.parseInt(n[2],10)};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Is=e=>{let t=e.indexOf(`(`);if(t===-1)throw Error(`The color '${e}' is illegal hsl color`);let n=e.substring(t+1,e.length-1).split(`,`);if(n.length<3)throw Error(`The color '${e}' is illegal hsl color`);let r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),l:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Ls=e=>{let t=e.indexOf(`(`);if(t===-1)throw Error(`The color '${e}' is illegal hsv color`);let n=e.substring(t+1,e.length-1).split(`,`);if(n.length<3)throw Error(`The color '${e}' is illegal hsv color`);let r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),v:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Rs=e=>{let t=Ns(e);if(t!=null)return`r`in t?t:`l`in t?Bs(t):Vs(t)},zs=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),Bs=e=>{let{h:t,s:n,l:r}=e;t/=360,n/=100,r/=100;let i=0,a=0,o=0;if(n===0)i=a=o=r;else{let e=r<.5?r*(1+n):r+n-r*n,s=2*r-e;i=zs(s,e,t+1/3),a=zs(s,e,t),o=zs(s,e,t-1/3)}let s={r:Math.round(i*255),g:Math.round(a*255),b:Math.round(o*255)};return e.a!==void 0&&(s.a=e.a),s},Vs=e=>{let{h:t,s:n,v:r}=e;t=t/360*6,n/=100,r/=100;let i=Math.floor(t),a=t-i,o=r*(1-n),s=r*(1-a*n),c=r*(1-(1-a)*n),l=i%6,u=[r,s,o,o,c,r][l],d=[c,r,r,s,o,o][l],f=[o,o,c,r,r,s][l],p={r:u*255,g:d*255,b:f*255};return e.a!==void 0&&(p.a=e.a),p},Hs=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;let i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c;if(i===a)s=c=0;else{let e=i-a;switch(c=o>.5?e/(2-i-a):e/(i+a),i){case t:s=(n-r)/e+(n<r?6:0);break;case n:s=(r-t)/e+2;break;default:s=(t-n)/e+4;break}s/=6}let l={h:Math.round(s*360),s:Math.round(c*100),l:Math.round(o*100)};return e.a!==void 0&&(l.a=e.a),l},Us=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;let i=Math.max(t,n,r),a=Math.min(t,n,r),o,s=i,c=i-a,l=i===0?0:c/i;if(i===a)o=0;else{switch(i){case t:o=(n-r)/c+(n<r?6:0);break;case n:o=(r-t)/c+2;break;default:o=(t-n)/c+4;break}o/=6}let u={h:Math.round(o*360),s:Math.round(l*100),v:Math.round(s*100)};return e.a!==void 0&&(u.a=e.a),u},Ws=e=>e==null,Gs=e=>!Ws(e)&&typeof e==`object`;function Ks(e){return!!(/^#(?:[0]{3}|[0]{6})\b/.test(e)||/^rgb\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*\)$/.test(e)||/^rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e)||/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*\)$/.test(e)||/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e))}function qs(e){return!!(/^#(?:[Ff]{3}|[Ff]{6})\b/.test(e)||/^rgb\s*\(\s*255\s*,\s*255\s*,\s*255\s*\)$/.test(e)||/^rgba\s*\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e)||/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*\)$/.test(e)||/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e))}function Js(e){return e&&(e.s!==void 0||e.p!==void 0||e.v!==void 0||e.t!==void 0||e.f!==void 0||e.si!==void 0||e.custom!==void 0)}function Ys(e){if(e.t!==void 0)return e.t;if(typeof e.v==`string`)return Ya.STRING;if(typeof e.v==`number`)return Ya.NUMBER;if(typeof e.v==`boolean`)return Ya.BOOLEAN}function Xs(e){if(e==null)return!0;let{v:t,f:n,si:r,p:i,custom:a}=e;return!(!(t==null||typeof t==`string`&&t.length===0)||n!=null&&n.length>0||r!=null&&r.length>0||i!=null||a!=null)}function Zs(e){return e!=null&&(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)}let G=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.ROW=1]=`ROW`,e[e.COLUMN=2]=`COLUMN`,e[e.ALL=3]=`ALL`,e}({}),K=function(e){return e[e.NONE=0]=`NONE`,e[e.ROW=1]=`ROW`,e[e.COLUMN=2]=`COLUMN`,e[e.ALL=3]=`ALL`,e}({});function Qs(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}let $s=function(e){return e.NONE=`none`,e.BACKWARD=`backward`,e.FORWARD=`forward`,e}({}),ec=function(e){return e.RECT=`RECT`,e.TEXT=`TEXT`,e}({});function tc(e,t,n){let r=!1,i=!1,a=e,o=t,s=e,c=t;if(n==null)return{actualRow:e,actualColumn:t,isMergedMainCell:i,isMerged:r,endRow:a,endColumn:o,startRow:s,startColumn:c};for(let l=0;l<n.length;l++){let{startRow:u,endRow:d,startColumn:f,endColumn:p}=n[l];if(e===u&&t===f){a=d,o=p,s=u,c=f,i=!0;break}if(e>=u&&e<=d&&t>=f&&t<=p){a=d,o=p,s=u,c=f,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:i,isMerged:r,endRow:a,endColumn:o,startRow:s,startColumn:c}}let nc=function(e){return e.Raw=`raw`,e.Intercepted=`intercepted`,e.Both=`both`,e}({}),rc={[Za.OFFICE]:{[Xa.ACCENT1]:`#4472C4`,[Xa.ACCENT2]:`#ED7D31`,[Xa.ACCENT3]:`#A5A5A5`,[Xa.ACCENT4]:`#70AD47`,[Xa.ACCENT5]:`#5B9BD5`,[Xa.ACCENT6]:`#70AD47`,[Xa.DARK1]:`#000000`,[Xa.DARK2]:`#44546A`,[Xa.LIGHT1]:`#FFFFFF`,[Xa.LIGHT2]:`#E7E6E6`,[Xa.HYPERLINK]:`#0563C1`,[Xa.FOLLOWED_HYPERLINK]:`#954F72`}},ic=`general`,ac=`hash`,oc=`zero`,sc=`qmark`,cc=`slash`,lc=`group`,uc=`scale`,dc=`comma`,fc=`break`,pc=`text`,mc=`plus`,hc=`minus`,gc=`point`,_c=`space`,vc=`percent`,yc=`digit`,bc=`calendar`,xc=`error`,Sc=`datetime`,Cc=`duration`,wc=`condition`,Tc=`dbnum`,Ec=`natnum`,Dc=`locale`,Oc=`color`,kc=`modifier`,Ac=`ampm`,jc=`escaped`,Mc=`string`,Nc=`skip`,Pc=`fill`,Fc=`paren`,Ic=`char`,Lc=`#000000.#FFFFFF.#FF0000.#00FF00.#0000FF.#FFFF00.#FF00FF.#00FFFF.#800000.#008000.#000080.#808000.#800080.#008080.#C0C0C0.#808080.#9999FF.#993366.#FFFFCC.#CCFFFF.#660066.#FF8080.#0066CC.#CCCCFF.#000080.#FF00FF.#FFFF00.#00FFFF.#800080.#800000.#008080.#0000FF.#00CCFF.#CCFFFF.#CCFFCC.#FFFF99.#99CCFF.#FF99CC.#CC99FF.#FFCC99.#3366FF.#33CCCC.#99CC00.#FFCC00.#FF9900.#FF6600.#666699.#969696.#003366.#339966.#003300.#333300.#993300.#993366.#333399.#333333`.split(`.`),Rc=`¤.$.£.¥.֏.؋.৳.฿.៛.₡.₦.₩.₪.₫.€.₭.₮.₱.₲.₴.₸.₹.₺.₼.₽.₾.₿`.split(`.`),zc=RegExp(`[`+Rc.join(``)+`]`);var Bc=Object.freeze({1078:`af`,1052:`sq`,1118:`am`,5121:`ar_DZ`,15361:`ar_BH`,3073:`ar_EG`,2049:`ar_IQ`,11265:`ar_JO`,13313:`ar_KW`,12289:`ar_LB`,4097:`ar_LY`,6145:`ar_MA`,8193:`ar_OM`,16385:`ar_QA`,1025:`ar_SA`,10241:`ar_SY`,7169:`ar_TN`,14337:`ar_AE`,9217:`ar_YE`,1067:`hy`,1101:`as`,2092:`az_AZ`,1068:`az_AZ`,1069:`eu`,1059:`be`,2117:`bn`,1093:`bn_IN`,5146:`bs`,1026:`bg`,1109:`my`,1027:`ca`,2052:`zh_CN`,3076:`zh_HK`,5124:`zh_MO`,4100:`zh_SG`,1028:`zh_TW`,1050:`hr`,1029:`cs`,1030:`da`,1125:`dv`,2067:`nl_BE`,1043:`nl_NL`,1126:`bin`,3081:`en_AU`,10249:`en_BZ`,4105:`en_CA`,9225:`en_CB`,2057:`en_GB`,16393:`en_IN`,6153:`en_IE`,8201:`en_JM`,5129:`en_NZ`,13321:`en_PH`,7177:`en_ZA`,11273:`en_TT`,1033:`en_US`,12297:`en_ZW`,1061:`et`,1071:`mk`,1080:`fo`,1065:`fa`,1124:`fil`,1035:`fi`,2060:`fr_BE`,11276:`fr_CM`,3084:`fr_CA`,9228:`fr_CG`,12300:`fr_CI`,1036:`fr_FR`,5132:`fr_LU`,13324:`fr_ML`,6156:`fr_MC`,14348:`fr_MA`,10252:`fr_SN`,4108:`fr_CH`,7180:`fr`,1122:`fy_NL`,2108:`gd_IE`,1084:`gd`,1110:`gl`,1079:`ka`,3079:`de_AT`,1031:`de_DE`,5127:`de_LI`,4103:`de_LU`,2055:`de_CH`,1032:`el`,1140:`gn`,1095:`gu`,1279:`en`,1037:`he`,1081:`hi`,1038:`hu`,1039:`is`,1136:`ig_NG`,1057:`id`,1040:`it_IT`,2064:`it_CH`,1041:`ja`,1099:`kn`,1120:`ks`,1087:`kk`,1107:`km`,1111:`kok`,1042:`ko`,1088:`ky`,1108:`lo`,1142:`la`,1062:`lv`,1063:`lt`,2110:`ms_BN`,1086:`ms_MY`,1100:`ml`,1082:`mt`,1112:`mni`,1153:`mi`,1102:`mr`,1104:`mn`,2128:`mn`,1121:`ne`,1044:`no_NO`,2068:`no_NO`,1096:`or`,1045:`pl`,1046:`pt_BR`,2070:`pt_PT`,1094:`pa`,1047:`rm`,2072:`ro_MO`,1048:`ro_RO`,1049:`ru`,2073:`ru_MO`,1083:`se`,1103:`sa`,3098:`sr_SP`,2074:`sr_SP`,1072:`st`,1074:`tn`,1113:`sd`,1115:`si`,1051:`sk`,1060:`sl`,1143:`so`,1070:`sb`,11274:`es_AR`,16394:`es_BO`,13322:`es_CL`,9226:`es_CO`,5130:`es_CR`,7178:`es_DO`,12298:`es_EC`,17418:`es_SV`,4106:`es_GT`,18442:`es_HN`,2058:`es_MX`,19466:`es_NI`,6154:`es_PA`,15370:`es_PY`,10250:`es_PE`,20490:`es_PR`,1034:`es_ES`,14346:`es_UY`,8202:`es_VE`,1089:`sw`,2077:`sv_FI`,1053:`sv_SE`,1114:`syc`,1064:`tg`,1097:`ta`,1092:`tt`,1098:`te`,1054:`th`,1105:`bo`,1073:`ts`,1055:`tr`,1090:`tk`,1058:`uk`,1056:`ur`,2115:`uz_UZ`,1091:`uz_UZ`,1075:`ve`,1066:`vi`,1106:`cy`,1076:`xh`,1085:`yi`,1077:`zu`});let Vc=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,Hc={},q=(e,t=``)=>e.replace(/~/g,t).split(`;`),J=(e,t=0,n=0)=>(e.mmm||(e.mmm=t<1?e.mmmm.concat():e.mmmm.map(e=>{let n=e.slice(0,t%10);return n+(t<10||e===n?``:`.`)})),e.ddd||(e.ddd=n<1?e.dddd.concat():e.dddd.map(e=>{let t=e.slice(0,n%10);return t+(n<10||e===t?``:`.`)})),!e.mmm6&&e.mmmm6&&(e.mmm6=e.mmmm6),e),Uc={group:`\xA0`,decimal:`.`,positive:`+`,negative:`-`,percent:`%`,exponent:`E`,nan:`NaN`,infinity:`∞`,ampm:q(`AM;PM`),mmmm6:q(`Muharram;Safar;Rabiʻ I;Rabiʻ II;Jumada I;Jumada II;Rajab;Shaʻban;Ramadan;Shawwal;Dhuʻl-Qiʻdah;Dhuʻl-Hijjah`),mmm6:q(`Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhuʻl-Q.;Dhuʻl-H.`),mmmm:q(`January;February;March;April;May;June;July;August;September;October;November;December`),mmm:q(`Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec`),dddd:q(`Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday`),ddd:q(`Sun;Mon;Tue;Wed;Thu;Fri;Sat`),bool:q(`TRUE;FALSE`),preferMDY:!1};function Wc(e){let t=Vc.exec(e);if(!t)throw SyntaxError(`Malformed locale: ${e}`);return{lang:t[1]+(t[2]?`_`+t[2]:``),language:t[1],territory:t[2]||``}}function Gc(e){if(typeof e==`number`)return Bc[e&65535]||null;let t=parseInt(e,16);return isFinite(t)&&Bc[t&65535]?Bc[t&65535]||null:Vc.test(e)?e:null}function Kc(e){let t=Gc(e),n=null;if(t){let e=Wc(t);n=Hc[e.lang]||Hc[e.language]||null}return n}function qc(e){return Object.assign({},Uc,e)}function Y(e,t){let n=typeof t==`object`?t:Wc(t);return Hc[n.lang]=qc(e),n.language!==n.lang&&!Hc[n.language]&&(Hc[n.language]=qc(e)),Hc[n.lang]}let Jc=qc({group:`,`,preferMDY:!0});Jc.isDefault=!0,Y({group:`,`,ampm:q(`上午;下午`),mmmm:q(`一月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月`),mmm:q(`1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月`),dddd:q(`~日;~一;~二;~三;~四;~五;~六`,`星期`),ddd:q(`周日;周一;周二;周三;周四;周五;周六`)},`zh_CN`);let Yc={group:`,`,ampm:q(`上午;下午`),mmmm:q(`1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月`),mmm:q(`1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月`),dddd:q(`~日;~一;~二;~三;~四;~五;~六`,`星期`),ddd:q(`周日;周一;周二;周三;周四;周五;周六`)};Y({...Yc,nan:`非數值`,dddd:q(`~日;~一;~二;~三;~四;~五;~六`,`星期`)},`zh_TW`),Y({...Yc,dddd:q(`~日;~一;~二;~三;~四;~五;~六`,`星期`)},`zh_HK`),Y({...Yc,ampm:q(`午前;午後`),dddd:q(`日~;月~;火~;水~;木~;金~;土~`,`曜日`),ddd:q(`日;月;火;水;木;金;土`)},`ja`),Y({group:`,`,ampm:q(`오전;오후`),mmmm:q(`1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월`),mmm:q(`1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월`),dddd:q(`일요일;월요일;화요일;수요일;목요일;금요일;토요일`),ddd:q(`일;월;화;수;목;금;토`)},`ko`),Y({group:`,`,ampm:q(`ก่อนเที่ยง;หลังเที่ยง`),mmmm:q(`มกร~;กุมภาพันธ์;มีน~;เมษายน;พฤษภ~;มิถุนายน;กรกฎ~;สิงห~;กันยายน;ตุล~;พฤศจิกายน;ธันว~`,`าคม`),mmm:q(`ม.ค.;ก.พ.;มี.ค.;เม.ย.;พ.ค.;มิ.ย.;ก.ค.;ส.ค.;ก.ย.;ต.ค.;พ.ย.;ธ.ค.`),dddd:q(`วันอาทิตย์;วันจันทร์;วันอังคาร;วันพุธ;วันพฤหัสบดี;วันศุกร์;วันเสาร์`),ddd:q(`อา.;จ.;อ.;พ.;พฤ.;ศ.;ส.`)},`th`),Y(J({decimal:`,`,ampm:q(`dop.;odp.`),mmmm:q(`ledna;února;března;dubna;května;června;července;srpna;září;října;listopadu;prosince`),mmm:q(`I;II;III;IV;V;VI;VII;VIII;IX;X;XI;XII`),dddd:q(`neděle;pondělí;úterý;středa;čtvrtek;pátek;sobota`),bool:q(`PRAVDA;NEPRAVDA`)},-1,2),`cs`),Y(J({group:`.`,decimal:`,`,mmmm:q(`januar;februar;marts;april;maj;juni;juli;august;september;oktober;november;december`),dddd:q(`søn~;man~;tirs~;ons~;tors~;fre~;lør~`,`dag`),bool:q(`SAND;FALSK`)},13,13),`da`),Y(J({group:`.`,decimal:`,`,ampm:q(`a.m.;p.m.`),mmmm:q(`januari;februari;maart;april;mei;juni;juli;augustus;september;oktober;november;december`),mmm:q(`jan.;feb.;mrt.;apr.;mei;jun.;jul.;aug.;sep.;okt.;nov.;dec.`),dddd:q(`zondag;maandag;dinsdag;woensdag;donderdag;vrijdag;zaterdag`),bool:q(`WAAR;ONWAAR`)},-1,2),`nl`),Y({group:`,`,preferMDY:!0},`en`),Y({group:`,`,preferMDY:!0},`en_US`),Y({group:`,`},`en_AU`),Y({group:`,`},`en_CA`),Y({group:`,`},`en_GB`),Y({group:`,`,mmm:q(`Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sept;Oct;Nov;Dec`)},`en_IE`),Y(J({decimal:`,`,nan:`epäluku`,ampm:q(`ap.;ip.`),mmmm:q(`tammi~;helmi~;maalis~;huhti~;touko~;kesä~;heinä~;elo~;syys~;loka~;marras~;joulu~`,`kuuta`),mmm:q(`tammik.;helmik.;maalisk.;huhtik.;toukok.;kesäk.;heinäk.;elok.;syysk.;lokak.;marrask.;jouluk.`),dddd:q(`sunnun~;maanan~;tiis~;keskiviikkona;tors~;perjan~;lauan~`,`taina`),bool:q(`TOSI;EPÄTOSI`)},-1,2),`fi`);let Xc=J({group:` `,decimal:`,`,mmmm:q(`janvier;février;mars;avril;mai;juin;juillet;août;septembre;octobre;novembre;décembre`),mmm:q(`janv.;févr.;mars;avr.;mai;juin;juil.;août;sept.;oct.;nov.;déc.`),dddd:q(`~manche;lun~;mar~;mercre~;jeu~;vendre~;same~`,`di`),bool:q(`VRAI;FAUX`)},-1,13);Y({...Xc},`fr`),Y({...Xc,mmm:q(`janv.;févr.;mars;avr.;mai;juin;juill.;août;sept.;oct.;nov.;déc.`)},`fr_CA`),Y({group:`'`,decimal:`.`,...Xc},`fr_CH`);let Zc=J({mmmm:q(`Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember`),mmm:q(`Jan.;Feb.;März;Apr.;Mai;Juni;Juli;Aug.;Sept.;Okt.;Nov.;Dez.`),dddd:q(`Sonn~;Mon~;Diens~;Mittwoch;Donners~;Frei~;Sams~`,`tag`),bool:q(`WAHR;FALSCH`)},-1,12);Y({group:`.`,decimal:`,`,...Zc},`de`),Y({group:`'`,decimal:`.`,...Zc},`de_CH`),Y(J({group:`.`,decimal:`,`,ampm:q(`π.μ.;μ.μ.`),mmmm:q(`Ιανουαρ~;Φεβρουαρ~;Μαρτ~;Απριλ~;Μαΐου;Ιουν~;Ιουλ~;Αυγούστου;Σεπτεμβρ~;Οκτωβρ~;Νοεμβρ~;Δεκεμβρ~`,`ίου`),mmm:q(`Ιαν;Φεβ;Μαρ;Απρ;Μαΐ;Ιουν;Ιουλ;Αυγ;Σεπ;Οκτ;Νοε;Δεκ`),dddd:q(`Κυριακή;Δευτέρα;Τρίτη;Τετάρτη;Πέμπτη;Παρασκευή;Σάββατο`)},-1,3),`el`),Y({decimal:`,`,ampm:q(`de.;du.`),mmmm:q(`január;február;március;április;május;június;július;augusztus;szeptember;október;november;december`),mmm:q(`jan.;febr.;márc.;ápr.;máj.;jún.;júl.;aug.;szept.;okt.;nov.;dec.`),dddd:q(`vasárnap;hétfő;kedd;szerda;csütörtök;péntek;szombat`),ddd:q(`V;H;K;Sze;Cs;P;Szo`),bool:q(`IGAZ;HAMIS`)},`hu`),Y(J({group:`.`,decimal:`,`,ampm:q(`f.h.;e.h.`),mmmm:q(`janúar;febrúar;mars;apríl;maí;júní;júlí;ágúst;september;október;nóvember;desember`),dddd:q(`sunnu~;mánu~;þriðju~;miðviku~;fimmtu~;föstu~;laugar~`,`dagur`)},13,13),`is`),Y(J({group:`.`,decimal:`,`,mmmm:q(`Januari;Februari;Maret;April;Mei;Juni;Juli;Agustus;September;Oktober;November;Desember`),dddd:q(`Minggu;Senin;Selasa;Rabu;Kamis;Jumat;Sabtu`)},3,3),`id`);let Qc=J({mmmm:q(`gennaio;febbraio;marzo;aprile;maggio;giugno;luglio;agosto;settembre;ottobre;novembre;dicembre`),dddd:q(`domenica;lunedì;martedì;mercoledì;giovedì;venerdì;sabato`),bool:q(`VERO;FALSO`)},3,3);Y({group:`.`,decimal:`,`,...Qc},`it`),Y({group:`'`,decimal:`.`,...Qc},`it_CH`);let $c={decimal:`,`,ampm:q(`a.m.;p.m.`),mmmm:q(`januar;februar;mars;april;mai;juni;juli;august;september;oktober;november;desember`),mmm:q(`jan.;feb.;mar.;apr.;mai;jun.;jul.;aug.;sep.;okt.;nov.;des.`),dddd:q(`søn~;man~;tirs~;ons~;tors~;fre~;lør~`,`dag`),bool:q(`SANN;USANN`)};Y(J({...$c},-1,13),`nb`),Y(J({...$c},-1,13),`no`),Y(J({decimal:`,`,mmmm:q(`stycznia;lutego;marca;kwietnia;maja;czerwca;lipca;sierpnia;września;października;listopada;grudnia`),dddd:q(`niedziela;poniedziałek;wtorek;środa;czwartek;piątek;sobota`),ddd:q(`niedz.;pon.;wt.;śr.;czw.;pt.;sob.`),bool:q(`PRAWDA;FAŁSZ`)},3,-1),`pl`);let el={group:`.`,decimal:`,`,mmmm:q(`janeiro;fevereiro;março;abril;maio;junho;julho;agosto;setembro;outubro;novembro;dezembro`),dddd:q(`domingo;segunda-feira;terça-feira;quarta-feira;quinta-feira;sexta-feira;sábado`),bool:q(`VERDADEIRO;FALSO`)};Y(J(el,13,13),`pt`),Y(J(el,13,13),`pt_BR`),Y({decimal:`,`,nan:`не\xA0число`,mmmm:q(`января;февраля;марта;апреля;мая;июня;июля;августа;сентября;октября;ноября;декабря`),mmm:q(`янв.;февр.;мар.;апр.;мая;июн.;июл.;авг.;сент.;окт.;нояб.;дек.`),dddd:q(`воскресенье;понедельник;вторник;среда;четверг;пятница;суббота`),ddd:q(`вс;пн;вт;ср;чт;пт;сб`),mmmm6:q(`рамадан;шавваль;зуль-каада;зуль-хиджжа;мухаррам;раби-уль-авваль;раби-уль-ахир;джумад-уль-авваль;джумад-уль-ахир;раджаб;шаабан;рамадан`),mmm6:q(`рам.;шав.;зуль-к.;зуль-х.;мух.;раб. I;раб. II;джум. I;джум. II;радж.;шааб.;рам.`),bool:q(`ИСТИНА;ЛОЖЬ`)},`ru`),Y(J({decimal:`,`,mmmm:q(`januára;februára;marca;apríla;mája;júna;júla;augusta;septembra;októbra;novembra;decembra`),dddd:q(`nedeľa;pondelok;utorok;streda;štvrtok;piatok;sobota`)},3,2),`sk`);let tl={group:`.`,decimal:`,`,ampm:q(`a.\xA0m.;p.\xA0m.`),mmmm:q(`enero;febrero;marzo;abril;mayo;junio;julio;agosto;septiem~;octu~;noviem~;diciem~`,`bre`),mmm:q(`ene;feb;mar;abr;may;jun;jul;ago;sept;oct;nov;dic`),dddd:q(`domingo;lunes;martes;miércoles;jueves;viernes;sábado`),ddd:q(`dom;lun;mar;mié;jue;vie;sáb`),bool:q(`VERDADERO;FALSO`)},nl=q(`ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic`),rl=q(`ene.;feb.;mar.;abr.;may.;jun.;jul.;ago.;sept.;oct.;nov.;dic.`);Y({...tl},`es`),Y({...tl},`es_AR`),Y({...tl},`es_BO`),Y({...tl},`es_CL`),Y({...tl},`es_CO`),Y({...tl},`es_EC`),Y({...tl,mmm:nl,ampm:q(`a.m.;p.m.`)},`es_MX`),Y({...tl,mmm:rl},`es_PY`),Y({...tl,mmm:rl},`es_UY`),Y({...tl,mmm:rl,mmmm:q(`enero;febrero;marzo;abril;mayo;junio;julio;agosto;setiembre;octubre;noviembre;diciembre`)},`es_VE`),Y({decimal:`,`,ampm:q(`fm;em`),mmmm:q(`januari;februari;mars;april;maj;juni;juli;augusti;september;oktober;november;december`),mmm:q(`jan.;feb.;mars;apr.;maj;juni;juli;aug.;sep.;okt.;nov.;dec.`),dddd:q(`sön~;mån~;tis~;ons~;tors~;fre~;lör~`,`dag`),ddd:q(`sön;mån;tis;ons;tors;fre;lör`)},`sv`),Y(J({group:`.`,decimal:`,`,ampm:q(`ÖÖ;ÖS`),mmmm:q(`Ocak;Şubat;Mart;Nisan;Mayıs;Haziran;Temmuz;Ağustos;Eylül;Ekim;Kasım;Aralık`),mmm:q(`Oca;Şub;Mar;Nis;May;Haz;Tem;Ağu;Eyl;Eki;Kas;Ara`),dddd:q(`Pazar;Pazartesi;Salı;Çarşamba;Perşembe;Cuma;Cumartesi`),ddd:q(`Paz;Pzt;Sal;Çar;Per;Cum;Cmt`),bool:q(`DOĞRU;YANLIŞ`)},3,-1),`tr`),Y({group:`,`,ampm:q(`yb;yh`),mmmm:q(`Ionawr;Chwefror;Mawrth;Ebrill;Mai;Mehefin;Gorffennaf;Awst;Medi;Hydref;Tachwedd;Rhagfyr`),mmm:q(`Ion;Chwef;Maw;Ebr;Mai;Meh;Gorff;Awst;Medi;Hyd;Tach;Rhag`),dddd:q(`Dydd Sul;Dydd Llun;Dydd Mawrth;Dydd Mercher;Dydd Iau;Dydd Gwener;Dydd Sadwrn`),ddd:q(`Sul;Llun;Maw;Mer;Iau;Gwen;Sad`)},`cy`),Y({group:`.`,decimal:`,`,mmmm:q(`yanvar;fevral;mart;aprel;may;iyun;iyul;avqust;sentyabr;oktyabr;noyabr;dekabr`),mmm:q(`yan;fev;mar;apr;may;iyn;iyl;avq;sen;okt;noy;dek`),dddd:q(`bazar;bazar ertəsi;çərşənbə axşamı;çərşənbə;cümə axşamı;cümə;şənbə`),ddd:q(`B.;B.e.;Ç.a.;Ç.;C.a.;C.;Ş.`)},`az`),Y(J({decimal:`,`,mmmm:q(`студзеня;лютага;сакавіка;красавіка;мая;чэрвеня;ліпеня;жніўня;верасня;кастрычніка;лістапада;снежня`),dddd:q(`нядзеля;панядзелак;аўторак;серада;чацвер;пятніца;субота`),ddd:q(`нд;пн;аў;ср;чц;пт;сб`)},3,-1),`be`),Y({decimal:`,`,ampm:q(`пр.об.;сл.об.`),mmmm:q(`януари;февруари;март;април;май;юни;юли;август;септември;октомври;ноември;декември`),mmm:q(`яну;фев;март;апр;май;юни;юли;авг;сеп;окт;ное;дек`),dddd:q(`неделя;понеделник;вторник;сряда;четвъртък;петък;събота`),ddd:q(`нд;пн;вт;ср;чт;пт;сб`),bool:q(`ИСТИНА;ЛОЖЬ`)},`bg`),Y({group:`.`,decimal:`,`,mmmm:q(`de gener;de febrer;de març;d’abril;de maig;de juny;de juliol;d’agost;de setembre;d’octubre;de novembre;de desembre`),mmm:q(`de gen.;de febr.;de març;d’abr.;de maig;de juny;de jul.;d’ag.;de set.;d’oct.;de nov.;de des.`),dddd:q(`diumenge;dilluns;dimarts;dimecres;dijous;divendres;dissabte`),ddd:q(`dg.;dl.;dt.;dc.;dj.;dv.;ds.`),ampm:q(`a.\xA0m.;p.\xA0m.`)},`ca`),Y(J({group:`,`,decimal:`.`,mmmm:q(`Enero;Pebrero;Marso;Abril;Mayo;Hunyo;Hulyo;Agosto;Setyembre;Oktubre;Nobyembre;Disyembre`),dddd:q(`Linggo;Lunes;Martes;Miyerkules;Huwebes;Biyernes;Sabado`)},3,3),`fil`),Y({group:`,`,decimal:`.`,mmmm:q(`જાન્યુઆરી;ફેબ્રુઆરી;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટેમ્બર;ઑક્ટોબર;નવેમ્બર;ડિસેમ્બર`),mmm:q(`જાન્યુ;ફેબ્રુ;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટે;ઑક્ટો;નવે;ડિસે`),dddd:q(`રવિ~;સોમ~;મંગળ~;બુધ~;ગુરુ~;શુક્ર~;શનિ~`,`વાર`),ddd:q(`રવિ;સોમ;મંગળ;બુધ;ગુરુ;શુક્ર;શનિ`)},`gu`),Y({group:`,`,decimal:`.`,ampm:q(`לפנה״צ;אחה״צ`),dddd:q(`~ראשון;~שני;~שלישי;~רביעי;~חמישי;~שישי;~שבת`,`יום `),ddd:q(`~א׳;~ב׳;~ג׳;~ד׳;~ה׳;~ו׳;שבת`,`יום `),mmmm:q(`ינואר;פברואר;מרץ;אפריל;מאי;יוני;יולי;אוגוסט;ספטמבר;אוקטובר;נובמבר;דצמבר`),mmm:q(`ינו׳;פבר׳;מרץ;אפר׳;מאי;יוני;יולי;אוג׳;ספט׳;אוק׳;נוב׳;דצמ׳`),mmmm6:q(`רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע אל־אוול;רביע א־ת׳אני;ג׳ומאדא אל־אולא;ג׳ומאדא א־ת׳אניה;רג׳ב;שעבאן;רמדאן`),mmm6:q(`רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע א׳;רביע ב׳;ג׳ומאדא א׳;ג׳ומאדא ב׳;רג׳ב;שעבאן;רמדאן`)},`he`),Y(J({group:`.`,decimal:`,`,mmmm:q(`siječnja;veljače;ožujka;travnja;svibnja;lipnja;srpnja;kolovoza;rujna;listopada;studenoga;prosinca`),mmm:q(`sij;velj;ožu;tra;svi;lip;srp;kol;ruj;lis;stu;pro`),dddd:q(`nedjelja;ponedjeljak;utorak;srijeda;četvrtak;petak;subota`)},-1,3),`hr`),Y({decimal:`,`,mmmm:q(`հունվարի;փետրվարի;մարտի;ապրիլի;մայիսի;հունիսի;հուլիսի;օգոստոսի;սեպտեմբերի;հոկտեմբերի;նոյեմբերի;դեկտեմբերի`),mmm:q(`հնվ;փտվ;մրտ;ապր;մյս;հնս;հլս;օգս;սեպ;հոկ;նոյ;դեկ`),dddd:q(`կիրակի;երկուշաբթի;երեքշաբթի;չորեքշաբթի;հինգշաբթի;ուրբաթ;շաբաթ`),ddd:q(`կիր;երկ;երք;չրք;հնգ;ուր;շբթ`)},`hy`),Y(J({decimal:`,`,mmmm:q(`იანვარი;თებერვალი;მარტი;აპრილი;მაისი;ივნისი;ივლისი;აგვისტო;სექტემბერი;ოქტომბერი;ნოემბერი;დეკემბერი`),dddd:q(`კვირა;ორშაბათი;სამშაბათი;ოთხშაბათი;ხუთშაბათი;პარასკევი;შაბათი`)},3,3),`ka`),Y(J({decimal:`,`,mmmm:q(`қаңтар;ақпан;наурыз;сәуір;мамыр;маусым;шілде;тамыз;қыркүйек;қазан;қараша;желтоқсан`),dddd:q(`жексенбі;дүйсенбі;сейсенбі;сәрсенбі;бейсенбі;жұма;сенбі`),ddd:q(`жс;дс;сс;ср;бс;жм;сб`)},13,-1),`kk`),Y({group:`,`,mmmm:q(`ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿಲ್;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂಬರ್;ಅಕ್ಟೋಬರ್;ನವೆಂಬರ್;ಡಿಸೆಂಬರ್`),mmm:q(`ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿ;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂ;ಅಕ್ಟೋ;ನವೆಂ;ಡಿಸೆಂ`),dddd:q(`ಭಾನು~;ಸೋಮ~;ಮಂಗಳ~;ಬುಧ~;ಗುರು~;ಶುಕ್ರ~;ಶನಿ~`,`ವಾರ`),ddd:q(`ಭಾನು;ಸೋಮ;ಮಂಗಳ;ಬುಧ;ಗುರು;ಶುಕ್ರ;ಶನಿ`),ampm:q(`ಪೂರ್ವಾಹ್ನ;ಅಪರಾಹ್ನ`)},`kn`),Y({decimal:`,`,mmmm:q(`sausio;vasario;kovo;balandžio;gegužės;birželio;liepos;rugpjūčio;rugsėjo;spalio;lapkričio;gruodžio`),mmm:q(`saus.;vas.;kov.;bal.;geg.;birž.;liep.;rugp.;rugs.;spal.;lapkr.;gruod.`),dddd:q(`sekmadienis;pirmadienis;antradienis;trečiadienis;ketvirtadienis;penktadienis;šeštadienis`),ddd:q(`sk;pr;an;tr;kt;pn;št`),ampm:q(`priešpiet;popiet`)},`lt`),Y({decimal:`,`,mmmm:q(`janvāris;februāris;marts;aprīlis;maijs;jūnijs;jūlijs;augusts;septembris;oktobris;novembris;decembris`),mmm:q(`janv.;febr.;marts;apr.;maijs;jūn.;jūl.;aug.;sept.;okt.;nov.;dec.`),dddd:q(`svētdiena;pirmdiena;otrdiena;trešdiena;ceturtdiena;piektdiena;sestdiena`),ddd:q(`svētd.;pirmd.;otrd.;trešd.;ceturtd.;piektd.;sestd.`),ampm:q(`priekšpusdienā;pēcpusdienā`)},`lv`),Y({group:`,`,decimal:`.`,mmmm:q(`ജനുവരി;ഫെബ്രുവരി;മാർച്ച്;ഏപ്രിൽ;മേയ്;ജൂൺ;ജൂലൈ;ഓഗസ്റ്റ്;സെപ്റ്റംബർ;ഒക്ടോബർ;നവംബർ;ഡിസംബർ`),mmm:q(`ജനു;ഫെബ്രു;മാർ;ഏപ്രി;മേയ്;ജൂൺ;ജൂലൈ;ഓഗ;സെപ്റ്റം;ഒക്ടോ;നവം;ഡിസം`),dddd:q(`ഞായറാഴ്ച;തിങ്കളാഴ്ച;ചൊവ്വാഴ്ച;ബുധനാഴ്ച;വ്യാഴാഴ്ച;വെള്ളിയാഴ്ച;ശനിയാഴ്ച`),ddd:q(`ഞായർ;തിങ്കൾ;ചൊവ്വ;ബുധൻ;വ്യാഴം;വെള്ളി;ശനി`)},`ml`),Y({group:`,`,decimal:`.`,mmmm:q(`нэгдүгээ~;хоёрдугаа~;гуравдугаа~;дөрөвдүгээ~;тавдугаа~;зургаадугаа~;долоодугаа~;наймдугаа~;есдүгээ~;аравдугаа~;арван нэгдүгээ~;арван хоёрдугаа~`,`р сар`),mmm:q(`1~;2~;3~;4~;5~;6~;7~;8~;9~;10~;11~;12~`,`-р сар`),dddd:q(`ням;даваа;мягмар;лхагва;пүрэв;баасан;бямба`),ddd:q(`Ня;Да;Мя;Лх;Пү;Ба;Бя`),ampm:q(`ү.ө.;ү.х.`)},`mn`),Y({group:`,`,decimal:`.`,mmmm:q(`जानेवारी;फेब्रुवारी;मार्च;एप्रिल;मे;जून;जुलै;ऑगस्ट;सप्टेंबर;ऑक्टोबर;नोव्हेंबर;डिसेंबर`),mmm:q(`जाने;फेब्रु;मार्च;एप्रि;मे;जून;जुलै;ऑग;सप्टें;ऑक्टो;नोव्हें;डिसें`),dddd:q(`रविवार;सोमवार;मंगळवार;बुधवार;गुरुवार;शुक्रवार;शनिवार`),ddd:q(`रवि;सोम;मंगळ;बुध;गुरु;शुक्र;शनि`)},`mr`),Y(J({group:`,`,decimal:`.`,mmmm:q(`ဇန်နဝါရီ;ဖေဖော်ဝါရီ;မတ်;ဧပြီ;မေ;ဇွန်;ဇူလိုင်;ဩဂုတ်;စက်တင်ဘာ;အောက်တိုဘာ;နိုဝင်ဘာ;ဒီဇင်ဘာ`),mmm:q(`ဇန်;ဖေ;မတ်;ဧ;မေ;ဇွန်;ဇူ;ဩ;စက်;အောက်;နို;ဒီ`),dddd:q(`တနင်္ဂနွေ;တနင်္လာ;အင်္ဂါ;ဗုဒ္ဓဟူး;ကြာသပတေး;သောကြာ;စနေ`),ampm:q(`နံနက်;ညနေ`)},-1,0),`my`),Y({group:`,`,decimal:`.`,mmmm:q(`ਜਨਵਰੀ;ਫ਼ਰਵਰੀ;ਮਾਰਚ;ਅਪ੍ਰੈਲ;ਮਈ;ਜੂਨ;ਜੁਲਾਈ;ਅਗਸਤ;ਸਤੰਬਰ;ਅਕਤੂਬਰ;ਨਵੰਬਰ;ਦਸੰਬਰ`),mmm:q(`ਜਨ;ਫ਼ਰ;ਮਾਰਚ;ਅਪ੍ਰੈ;ਮਈ;ਜੂਨ;ਜੁਲਾ;ਅਗ;ਸਤੰ;ਅਕਤੂ;ਨਵੰ;ਦਸੰ`),dddd:q(`ਐਤਵਾਰ;ਸੋਮਵਾਰ;ਮੰਗਲਵਾਰ;ਬੁੱਧਵਾਰ;ਵੀਰਵਾਰ;ਸ਼ੁੱਕਰਵਾਰ;ਸ਼ਨਿੱਚਰਵਾਰ`),ddd:q(`ਐਤ;ਸੋਮ;ਮੰਗਲ;ਬੁੱਧ;ਵੀਰ;ਸ਼ੁੱਕਰ;ਸ਼ਨਿੱਚਰ`),ampm:q(`ਪੂ.ਦੁ.;ਬਾ.ਦੁ.`)},`pa`),Y({group:`.`,decimal:`,`,mmmm:q(`ianuarie;februarie;martie;aprilie;mai;iunie;iulie;august;septem~;octom~;noiem~;decem~`,`brie`),mmm:q(`ian.;feb.;mar.;apr.;mai;iun.;iul.;aug.;sept.;oct.;nov.;dec.`),dddd:q(`duminică;luni;marți;miercuri;joi;vineri;sâmbătă`),ddd:q(`dum.;lun.;mar.;mie.;joi;vin.;sâm.`),ampm:q(`a.m.;p.m.`)},`ro`),Y(J({group:`.`,decimal:`,`,mmmm:q(`januar;februar;marec;april;maj;junij;julij;avgust;september;oktober;november;december`),mmm:q(`jan.;feb.;mar.;apr.;maj;jun.;jul.;avg.;sep.;okt.;nov.;dec.`),dddd:q(`nedelja;ponedeljek;torek;sreda;četrtek;petek;sobota`),ampm:q(`dop.;pop.`)},-1,13),`sl`),Y(J({group:`.`,decimal:`,`,mmmm:q(`јануар;фебруар;март;април;мај;јун;јул;август;септембар;октобар;новембар;децембар`),dddd:q(`недеља;понедељак;уторак;среда;четвртак;петак;субота`)},3,3),`sr`),Y({group:`,`,decimal:`.`,mmmm:q(`ஜனவரி;பிப்ரவரி;மார்ச்;ஏப்ரல்;மே;ஜூன்;ஜூலை;ஆகஸ்ட்;செப்டம்பர்;அக்டோபர்;நவம்பர்;டிசம்பர்`),mmm:q(`ஜன.;பிப்.;மார்.;ஏப்.;மே;ஜூன்;ஜூலை;ஆக.;செப்.;அக்.;நவ.;டிச.`),dddd:q(`ஞாயிறு;திங்கள்;செவ்வாய்;புதன்;வியாழன்;வெள்ளி;சனி`),ddd:q(`ஞாயி.;திங்.;செவ்.;புத.;வியா.;வெள்.;சனி`)},`ta`),Y({group:`,`,decimal:`.`,mmmm:q(`జనవరి;ఫిబ్రవరి;మార్చి;ఏప్రిల్;మే;జూన్;జులై;ఆగస్టు;సెప్టెంబర్;అక్టోబర్;నవంబర్;డిసెంబర్`),mmm:q(`జన;ఫిబ్ర;మార్చి;ఏప్రి;మే;జూన్;జులై;ఆగ;సెప్టెం;అక్టో;నవం;డిసెం`),dddd:q(`ఆదివారం;సోమవారం;మంగళవారం;బుధవారం;గురువారం;శుక్రవారం;శనివారం`),ddd:q(`ఆది;సోమ;మంగళ;బుధ;గురు;శుక్ర;శని`)},`te`),Y({decimal:`,`,mmmm:q(`січня;лютого;березня;квітня;травня;червня;липня;серпня;вересня;жовтня;листопада;грудня`),mmm:q(`січ.;лют.;бер.;квіт.;трав.;черв.;лип.;серп.;вер.;жовт.;лист.;груд.`),dddd:q(`неділю;понеділок;вівторок;середу;четвер;пʼятницю;суботу`),ddd:q(`нд;пн;вт;ср;чт;пт;сб`),ampm:q(`дп;пп`)},`uk`),Y({group:`.`,decimal:`,`,mmmm:q(`~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12`,`tháng `),mmm:q(`~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12`,`thg `),dddd:q(`Chủ Nhật;Thứ Hai;Thứ Ba;Thứ Tư;Thứ Năm;Thứ Sáu;Thứ Bảy`),ddd:q(`CN;Th 2;Th 3;Th 4;Th 5;Th 6;Th 7`),ampm:q(`SA;CH`)},`vi`),Y(J({group:`٬`,decimal:`٫`,ampm:q(`ص;م`),mmmm:q(`يناير;فبراير;مارس;أبريل;مايو;يونيو;يوليو;أغسطس;سبتمبر;أكتوبر;نوفمبر;ديسمبر`),dddd:q(`الأحد;الاثنين;الثلاثاء;الأربعاء;الخميس;الجمعة;السبت`),mmmm6:q(`رمضان;شوال;ذو القعدة;ذو الحجة;محرم;ربيع الأول;ربيع الآخرة;جمادى الأولى;جمادى الآخرة;رجب;شعبان;رمضان`)},0,0),`ar`),Y({group:`,`,decimal:`.`,mmmm:q(`জানুয়ারী;ফেব্রুয়ারী;মার্চ;এপ্রিল;মে;জুন;জুলাই;আগস্ট;সেপ্টেম্বর;অক্টোবর;নভেম্বর;ডিসেম্বর`),mmm:q(`জানু;ফেব;মার্চ;এপ্রি;মে;জুন;জুল;আগ;সেপ্টেঃ;অক্টোঃ;নভেঃ;ডিসেঃ`),dddd:q(`রবিবার;সোমবার;মঙ্গলবার;বুধবার;বৃহস্পতিবার;শুক্রবার;শনিবার`),ddd:q(`রবি;সোম;মঙ্গল;বুধ;বৃহস্পতি;শুক্র;শনি`)},`bn`),Y({group:`,`,decimal:`.`,mmmm:q(`जनवरी;फ़रवरी;मार्च;अप्रैल;मई;जून;जुलाई;अगस्त;सितंबर;अक्तूबर;नवंबर;दिसंबर`),mmm:q(`जन॰;फ़र॰;मार्च;अप्रैल;मई;जून;जुल॰;अग॰;सित॰;अक्तू॰;नव॰;दिस॰`),dddd:q(`रविवार;सोमवार;मंगलवार;बुधवार;गुरुवार;शुक्रवार;शनिवार`),ddd:q(`रवि;सोम;मंगल;बुध;गुरु;शुक्र;शनि`),ampm:q(`am;pm`)},`hi`);let il={overflow:`######`,dateErrorThrows:!1,dateErrorNumber:!0,bigintErrorNumber:!1,dateSpanLarge:!0,leap1900:!0,nbsp:!1,throws:!0,invalid:`######`,locale:``,ignoreTimezone:!1,grouping:[3,3],indexColors:!0,skipChar:``,repeatChar:``};function al(e,t=0){if(typeof e!=`number`)return e;if(e<0)return-al(-e,t);if(t){let n=10**t||1;return al(e*n,0)/n}return Math.round(e)}function ol(e,t=2,n=2){let r=e<0?-1:1,i=10**(t||2),a=10**(n||2),o=Math.abs(e),s=0,c=0,l=0,u=1,d,f;if(e=o,e%1==0)f=[e*r,1];else if(e<1e-19)f=[r,0x8ac7230489e80000];else if(e>0x8ac7230489e80000)f=[0x8ac7230489e80000*r,1];else{do if(o=1/(o-Math.floor(o)),d=u,u=u*Math.floor(o)+s,s=d,c=l,l=Math.floor(e*u+.5),l>=i||u>=a)return[r*c,s];while(Math.abs(e-l/u)>=1e-13&&o!==Math.floor(o));f=[r*l,u]}return f}let sl=Math.floor;function cl(e,t=!0){if(t&&e>=0){if(e===0)return[1900,1,0];if(e===60)return[1900,2,29];if(e<60)return[1900,e<32?1:2,(e-1)%31+1]}let n=e+68569+2415019,r=sl(4*n/146097);n-=sl((146097*r+3)/4);let i=sl(4e3*(n+1)/1461001);n=n-sl(1461*i/4)+31;let a=sl(80*n/2447),o=n-sl(2447*a/80);n=sl(a/11);let s=a+2-12*n;return[100*(r-49)+i+n|0,s|0,o|0]}function ll(e){return cl(e+1462)}function ul(e){if(e===60)throw Error(`#VALUE!`);if(e<=1)return[1317,8,29];if(e<60)return[1317,e<32?9:10,1+(e-2)%30];let t=10631/30,n=8.01/60,r=e+466935,i=sl(r/10631);r-=10631*i;let a=sl((r-n)/t);r-=sl(a*t+n);let o=sl((r+28.5001)/29.5);return o===13?[30*i+a,12,30]:[30*i+a,o,r-sl(29.5001*o-29)]}function dl(e,t=0,n=!0){let r=sl(e);return t===6?ul(r):t===-1?ll(r):cl(r,n)}let fl=Math.floor,pl=86400;function ml(e,t){let n=null;if(Array.isArray(e)){let[t,r,i,a,o,s]=e;n=Date.UTC(t,r==null?0:r-1,i==null?1:i,a||0,o||0,s||0)}else if(e instanceof Date&&(n=e*1,!(t!=null&&t.ignoreTimezone))){let t=new Date;t.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setUTCHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n=t*1}if(n!=null&&isFinite(n)){let e=n/864e5;return e-(e<=-25509?-25568:-25569)}return null}function hl(e,t){let n=e|0,r=pl*(e-n),i=fl(r);r-i>.9999&&(i+=1,i===pl&&(i=0,n+=1));let a=i<0?pl+i:i,[o,s,c]=dl(e,0,t==null?void 0:t.leap1900);return[o,s,c,fl(a/60/60)%60,fl(a/60)%60,fl(a)%60]}let gl=`!d-m-y.!d-m-Y.!j-m-y.!j-m-Y.!d-n-y.!d-n-Y.!j-n-y.!j-n-Y.?m-d-y.?m-d-Y.?m-j-y.?m-j-Y.?n-d-y.?n-d-Y.?n-j-y.?n-j-Y.d-M-y.d-M-Y.j-M-y.j-M-Y.M-d-y.M-d-Y.M-j-y.M-j-Y.d-F-y.d-F-Y.F-d-y.F-d-Y.F-j-y.F-j-Y.j-F-y.j-F-Y.y-F-d.y-F-j.y-M-d.y-M-j.Y-F-d.Y-F-j.Y-M-d.Y-m-d.Y-M-j.Y-m-j.Y-n-d.Y-n-j.j-F.j-M.d-F.d-M.n-d.n-j.n-Y.m-d.m-j.m-Y.M-Y.M-y.F-y.F-Y.Y-M.Y-n.Y-m.Y-F.Y-M`.split(`.`),_l={j:`d`,d:`d`,D:`ddd`,l:`dddd`,n:`m`,m:`m`,M:`mmm`,F:`mmmm`,y:`yy`,Y:`yyyy`},vl={j:`dd`,d:`dd`,D:`ddd`,l:`dddd`,n:`mm`,m:`mm`,M:`mmm`,F:`mmmm`,y:`yy`,Y:`yyyy`},yl={},bl={};function xl(e,t,n=1){if(e){let r=e[0],i=e.slice(1);r===`!`?xl(i,t,4):r===`?`?xl(i,t,2):(t[r]=t[r]||{},xl(i,t[r],n))}else t.$=n}function Sl(e,t){xl(e,t),xl(e+` x`,t),xl(e+` l`,t),xl(e+` l x`,t),xl(`l `+e,t),xl(`l `+e+` x`,t),xl(e+` D`,t),xl(e+` D x`,t),xl(`D `+e,t),xl(`D `+e+` x`,t)}gl.forEach(e=>{e.startsWith(`?`)||Sl(e,yl),e.startsWith(`!`)||Sl(e,bl)});let Cl=new Date().getUTCFullYear(),wl={".":[`,`,`\xA0`,` `,`'`,`٬`],",":[`.`,`\xA0`,` `,`'`,`٬`],"٫":[`.`,`\xA0`,` `,`'`,`٬`]},Tl=e=>(e==null?void 0:e.length)===1&&e>=`0`&&e<=`9`;function El(e,t={}){let n=Kc(t.locale||``)||Jc,r=n.decimal,i=[...wl[r]||[`'`,`٬`]];!i.includes(n.group)&&n.group!==` `&&n.group!==r&&i.push(n.group);let a=``,o=``,s=1,c=``,l=!1,u=!1,d=!1,f=!1,p=!1,m=null,h=!1,g=0,_=[` `,`\xA0`,` `,`+`,`%`,`(`,`-`].concat(Rc);for(;_.includes(e[g]);){let t=e[g];if(t===`-`){if(l||u)return null;l=!0,s=-1}else if(zc.test(t)){if(p)return null;p=!0,m=t}else if(t===`(`){if(u||l)return null;u=!0,s=-1}else if(t===`%`){if(f)return null;f=!0}g++}let v=!1,y;if(e[g]===r||Tl(e[g]))for(;g<e.length;){let t=e[g];if(!y&&i.includes(t))y=t;else if(!(y&&y===t))if(t===r){if(v)break;a+=`.`,v=!0}else if(Tl(t))a+=t;else break;g++}if(e[g]===`e`||e[g]===`E`){o+=e[g],g++,(e[g]===`+`||e[g]===`-`)&&(o+=e[g],g++);let t=g;for(;Tl(e[g]);)o+=e[g],g++;if(t===g)return null}let b=[` `,`\xA0`,` `,`%`,`$`,`)`].concat(Rc);for(;b.includes(e[g]);){let t=e[g];if(zc.test(t)){if(p)return null;p=!0,m=t,h=!0}else if(t===`)`){if(d||!u)return null;d=!0}else if(t===`%`){if(f)return null;f=!0}g++}if(g!==e.length)return null;let x=parseFloat(a+o);if(!isFinite(x))return null;if(o){if(f||p)return null;c=`0.00E+00`}else if(f){if(p)return null;c=a.includes(`.`)?`0.00%`:`0%`,x*=.01}else if(p){let e=a.includes(`.`)?`#,##0.00`:`#,##0`;c=h?e+m:m+e}else y&&(c=a.includes(`.`)?`#,##0.00`:`#,##0`);let S={v:x*s};return c&&(S.z=c),S}function Dl(e,t,n){if(n<1||t<1||t>12)return!1;if(t===2){if(n>(e%4==0&&e%100!=0||e%400==0||e===1900?29:28))return!1}else if((t===4||t===6||t===9||t===11)&&n>30||(t===1||t===3||t===5||t===7||t===8||t===10||t===12)&&n>31)return!1;return!0}let Ol=(e,t,n=!1)=>{for(let r of t)if(e.startsWith(r[0])){let t=r[0].length;return n&&(r[2]===`D`||r[2]===`M`)&&e[t]===`.`&&t++,[e.slice(0,t),r]}return[``,null]},kl=(e,t,n,r)=>{let i=n.path||``,a=Object.keys(t);for(let o of a){let a;if(t[o]){if(o===`$`||o===`€`)e||(a=n);else if(o===`-`){let s=/^(\s*([./-]|,\s)\s*|\s+)/.exec(e);if(s){let c=s[1]===`-`||s[1]===`/`||s[1]===`.`?s[1]:` `;if(!n.sep||n.sep===c){let l=s[0].replace(/\s+/g,` `);a=kl(e.slice(s[0].length),t[o],{...n,sep:c,path:i+l},r)}}}else if(o===` `){let s=/^[,.]?\s+/.exec(e);if(s){let c=s[0].replace(/\s+/g,` `);a=kl(e.slice(s[0].length),t[o],{...n,path:i+c},r)}}else if(o===`j`||o===`d`){let s=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(e);s&&(a=kl(e.slice(s[0].length),t[o],{...n,day:s[0],path:i+o},r))}else if(o===`n`||o===`m`){let s=/^(0?[1-9]|1[012])\b/.exec(e);s&&(a=kl(e.slice(s[0].length),t[o],{...n,month:+s[0],_mon:s[0],path:i+o},r))}else if(o===`F`||o===`M`){let[s,c]=Ol(e,r.mon,r.mp);(c==null?void 0:c[2])===o&&(a=kl(e.slice(s.length),t[o],{...n,month:c[1],_mon:s,path:i+o},r))}else if(o===`l`||o===`D`){let[s,c]=Ol(e,r.day,r.dp);(c==null?void 0:c[2])===o&&(a=kl(e.slice(s.length),t[o],{...n,path:i+o},r))}else if(o===`y`){let s=/^\d\d\b/.exec(e);if(s){let c=+s[0]>=30?+s[0]+1900:+s[0]+2e3;a=kl(e.slice(s[0].length),t[o],{...n,year:c,path:i+o},r)}}else if(o===`Y`){let s=/^\d\d\d\d\b/.exec(e);s&&(a=kl(e.slice(s[0].length),t[o],{...n,year:+s[0],path:i+o},r))}else if(o===`x`){let s=Pl(e,{locale:r.locale});s&&(a=kl(``,t[o],{...n,time:s.v,tf:s.z,path:i+o},r))}else throw Error(`Unknown date token "${o}"`);if(a&&Dl(n.year||1916,n.month||1,n.day?+n.day:1))return a}}},Al=e=>e.replace(/\s+/g,` `).trim().replace(/’/,`'`).replace(/\.$/,``).toLowerCase(),jl=(e,t)=>{let n=e.map((e,n)=>[Al(e),n+1,t]);return n.sort((e,t)=>t[0].length-e[0].length),n};function Ml(e,t={}){let n=Kc(t.locale||``)||Jc,r={mon:jl(n.mmmm,`F`).concat(jl(n.mmm,`M`)),mp:n.mmm[0].at(-1)===`.`,day:jl(n.dddd,`l`).concat(jl(n.ddd,`D`)),dp:n.ddd[0].at(-1)===`.`,locale:t.locale},i=kl(Al(e),n.preferMDY?bl:yl,{path:``},r);if(i){var a;if(i.sep===`.`&&i.path.length===3)return null;let e=+((a=i.year)==null?Cl:a);i.day||(i.day=1);let t=-1/0;if(e<1900)return null;e<=1900&&i.month<=2?t=25568:e<1e4&&(t=25569);let n=Date.UTC(e,i.month-1,i.day)/864e5+t+(i.time||0);if(n>=0&&n<=2958465){let e=i._mon[0]===`0`||i.day[0]===`0`||i._mon.length===2&&i.day.length===2;return{v:n,z:i.path.replace(/[jdlDnmMFyYx]/g,t=>t===`x`?i.tf||``:(e?vl[t]:_l[t])||t)}}}return null}let Nl=e=>e.replace(/\s+/g,``).trim().replace(/\./g,``).toLowerCase();function Pl(e,t={}){let n=Kc(t.locale||``)||Jc,r=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?=\s*[^\s\d]|$)/.exec(e),i=``;if(r){let t=Nl(e.slice(r[0].length));if(t===Nl(n.ampm[0])||t===`a`||t===`am`)i=`a`;else if(t===Nl(n.ampm[1])||t===`p`||t===`pm`)i=`p`;else if(t===`:`)r[3]||(r[3]=`0`),r[2]||(r[2]=`0`);else if(t)return null}if(r){let[,e,t,n,a]=r;if(a&&!n||!i&&!t&&!n)return null;let o=(e||0)*1;if(i){if(o>=13)return null;i===`a`?o===12&&(o=0):i===`p`&&o!==12&&(o+=12)}let s=(t||0)*1,c=(n||0)*1,l=(a||0)*1;return{v:(o*60*60+s*60+c+l)/(3600*24),z:(e.length===2?`hh`:`h`)+`:mm`+(n?`:ss`:``)+(i?` AM/PM`:``)}}return null}function Fl(e,t={}){let n=Kc(t.locale||``)||Jc,r=e.trim().toLowerCase(),i=n.bool[0].toLowerCase();if(r===`true`||r===i)return{v:!0};let a=n.bool[1].toLowerCase();return r===`false`||r===a?{v:!1}:null}function Il(e,t){var n,r,i;return(n=(r=(i=El(e,t))==null?Ml(e,t):i)==null?Pl(e,t):r)==null?Fl(e,t):n}function Ll(e,t,n){return t[n+`_max`]=e.length,t[n+`_min`]=e.replace(/#/g,``).length,t}function Rl(e,t){typeof e==`string`?t.push({type:`string`,value:e}):t.push(e)}function zl(e,t){let n=e==null?void 0:e.type;return n===`hash`||n===`zero`||n===`qmark`||n===`digit`&&t===`den`}function Bl(e){let t=[],n={scale:1,percent:!1,text:!1,date:0,date_eval:!1,date_system:1,sec_decimals:0,general:!1,clock:24,int_pattern:[],frac_pattern:[],man_pattern:[],den_pattern:[],num_pattern:[],tokens:t},r=`int`,i=null,a=[],o,s=!1,c=-1,l=!1,u=``,d=!1;for(;++c<e.length&&!l;){var f;let h=e[c],g=h.type||`error`;if(u+=h.raw,g===`general`)n.general=!0,Rl(h,t);else if(zl(h,r)){let e=n[r+`_pattern`];zl(o,r)||(o==null?void 0:o.type)===`group`?(e.push((e.pop()||``)+h.value),i.num+=h.value):(e.push(h.value),i={type:r,num:h.value},Rl(i,t))}else if(g===`paren`)h.value===`(`&&(n.parens=!0),Rl(h.value,t);else if(g===`digit`)Rl(h.value,t);else if(g===`slash`)if(d=!0,n[r+`_pattern`].length){if(!i)throw SyntaxError(`Format pattern is missing a numerator`);n.fractions=!0,n.num_pattern.push(n[r+`_pattern`].pop()),i.type=`num`,r=`den`,Rl({type:`div`},t)}else Rl(h.value,t);else if(g===`comma`)Rl(`,`,t);else if(g===`scale`)n.scale=.001**h.raw.length;else if(g===`group`){if(r===`int`&&(n.grouping=!0),r===`den`)throw SyntaxError(`Cannot group denominator digits`)}else if(g===`space`)Rl(h,t);else if(g===`break`){l=!0;break}else if(g===`text`)n.text=!0,Rl(h,t);else if(g===`plus`||g===`minus`)Rl(h,t);else if(g===`duration`){let e=h.value.toLowerCase(),r=e[0],i={type:``,size:0,date:1,pad:e.length};r===`h`?(i.size=16,i.type=`hour-elap`):r===`m`?(i.size=32,i.type=`min-elap`):(i.size=64,i.type=`sec-elap`),n.date|=i.size,a.push(i),Rl(i,t)}else if(n.date&&g===`point`&&((f=e[c+1])==null?void 0:f.type)===`zero`){var p,m;let r=1;c++;let i=`0`;((p=e[c+1])==null?void 0:p.type)===`zero`&&(i+=`0`,r=2,c++),((m=e[c+1])==null?void 0:m.type)===`zero`&&(i+=`0`,r=3,c++),u+=i;let a=[64,128,256,512][r];n.date|=a,n.date_eval=!0,n.sec_decimals=Math.max(n.sec_decimals,r),Rl({type:`subsec`,size:a,decimals:r,date:1},t)}else if(g===`calendar`)s||(h.value===`B2`||h.value===`b2`?n.date_system=6:n.date_system=1);else if(g===`datetime`){let e={type:``,size:0,date:1},r=h.value.toLowerCase(),i=r[0];if(r===`y`||r===`yy`)e.size=2,e.type=`year-short`;else if(i===`y`||i===`e`)e.size=2,e.type=`year`;else if(r===`b`||r===`bb`)e.size=2,e.type=`b-year-short`;else if(i===`b`)e.size=2,e.type=`b-year`;else if(r===`d`||r===`dd`)e.size=8,e.type=`day`,e.pad=/dd/.test(r);else if(r===`ddd`||r===`aaa`)e.size=8,e.type=`weekday-short`;else if(i===`d`||i===`a`)e.size=8,e.type=`weekday`;else if(i===`h`)e.size=16,e.type=`hour`,e.pad=/hh/i.test(r);else if(i===`m`){r.length===3?(e.size=4,e.type=`monthname-short`):r.length===5?(e.size=4,e.type=`monthname-single`):r.length>=4&&(e.size=4,e.type=`monthname`);let t=a[a.length-1];!e.type&&t&&!t.used&&t.size&80&&(t.used=!0,e.size=32,e.type=`min`,e.pad=/mm/.test(r)),e.type||(e.size=4,e.type=`month`,e.pad=/mm/.test(r),e.indeterminate=!0)}else if(i===`s`){e.size=64,e.type=`sec`,e.pad=/ss/.test(r);let t=a[a.length-1];t&&t.size&32?e.used=!0:t!=null&&t.indeterminate&&(delete t.indeterminate,t.size=32,t.type=`min`,e.used=!0)}n.date|=e.size,n.date_eval=!0,a.push(e),Rl(e,t)}else if(g===`ampm`)n.clock=12,n.date|=16,n.date_eval=!0,h.short=h.value===`A/P`,Rl(h,t);else if(g===`string`||g===`escaped`||g===`char`)Rl(h.value,t);else if(g===`condition`)n.condition=[h.value[0],parseFloat(h.value[1])];else if(g===`locale`){let e=h.value.split(`-`),r=e.length<2?``:e.slice(1).join(`-`),i=e[0];i&&Rl(i,t);let a=Gc(r);a&&(n.locale=a);let o=parseInt(r,16);isFinite(o)&&o&16711680&&(o>>16&255)==6&&(n.date_system=6),s=!0}else if(g===`color`){let e,t=h.value.toLowerCase();(e=/^color\s*(\d+)$/i.exec(t))&&(t=parseInt(e[1],10)),n.color=t}else if(g===`percent`)n.scale=100,n.percent=!0,Rl(`%`,t);else if(g===`point`)Rl(h,t),n.date||(n.dec_fractions=!0,r=`frac`);else if(g===`exp`)n.exponential=!0,n.exp_plus=h.value.includes(`+`),r=`man`,Rl({type:`exp`,plus:n.exp_plus},t);else if(g===`skip`)Rl(h,t);else if(g===`fill`)Rl(h,t);else if(!(g===`dbnum`||g===`natnum`))throw SyntaxError(g===`error`?`Illegal character: ${u}`:`Unknown token ${g} in ${u}`);o=h}if(n.tokensUsed=c,n.pattern=u,/^((?:\[[^\]]+\])+)(;|$)/.test(n.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(n.pattern)&&Rl({type:`text`},t),n.fractions&&n.dec_fractions||n.grouping&&!n.int_pattern.length||n.fractions&&n.exponential||n.fractions&&n.den_pattern.length*n.num_pattern.length===0||d&&!n.fractions&&!n.date||n.exponential&&(n.int_pattern.length||n.frac_pattern.length)*n.man_pattern.length===0)throw SyntaxError(`Invalid pattern: ${u}`);let h=n.int_pattern.join(``),g=n.man_pattern.join(``),_=n.frac_pattern.join(``);Ll(h,n,`int`);let v=0;for(let e=0;e<h.length;e++){let t=h[h.length-1-e];/^[0-9?]/.test(t)&&(v=e+1)}n.int_min=v,Ll(_,n,`frac`),Ll(g,n,`man`);let y=n.num_pattern.join(``),b=n.den_pattern[0]||``;if(b.includes(`?`)||y.includes(`?`)?(b=b.replace(/\d/g,`?`),b=b.replace(/#$/g,`?`),Ll(y,n,`num`),Ll(b,n,`den`),y=y.replace(/#$/g,`?`)):(Ll(y,n,`num`),Ll(b,n,`den`)),n.int_p=h,n.man_p=g,n.num_p=y,n.den_p=b,n.den_pattern.length&&(n.denominator=parseInt(n.den_pattern.join(``).replace(/\D/g,``),10)),n.integer=!!h.length,!n.integer&&!n.exponential&&_.length){let e=n.tokens.findIndex(e=>e.type===`point`);n.tokens.splice(e,0,{type:`int`,value:`#`}),n.integer=!0,n.int_pattern=[`#`],n.int_p=`#`}if(n.fractions)for(let e=0;e<t.length-1;e++){let n=t[e];if(n.type!==`string`&&n.type!==`space`)continue;let r=t[e+1].type;r===`num`?n.rule=`num+int`:r===`div`?n.rule=`num`:r===`den`&&(n.rule=`den`)}return n.grouping&&n.int_pattern.length>1&&(n.grouping=!1),n}function Vl(e){if(e===0)return e;let t=Math.ceil(Math.log10(e<0?-e:e)),n=10**(16-Math.floor(t));return isFinite(n)?Math.round(e*n)/n:0}function Hl(e,t=0){let n=Math.floor(Math.log10(e));return t>1?Math.floor(n/t)*t:n}function Ul(e,t=1){return t<-300?parseFloat(e.toExponential().split(`e`)[0]):e*10**-t}let Wl={total:1,sign:0,period:0,int:1,frac:0};function Gl(e,t=!0){let n=Math.abs(e);if(!n)return Wl;let r=t&&e<0?1:0,i=Math.floor(n),a=Math.floor(Math.log10(n)+1),o=0,s=0;if(i!==n){o=1;let e=String(al(n*10**-a,15)),t=e.length,r=!0,i=0;for(;i<=e.length;){if(e[i]===`.`){t--;break}else e[i]===`0`&&r?t--:r=!1;i++}s=t-a,s<0&&(s=0,o=0)}return{total:r+Math.max(a,1)+o+s,digits:Math.max(a,0)+s,sign:r,period:o,int:Math.max(a,1),frac:s}}let Kl=(e,t)=>e.replace(/\./,t.decimal),ql=(e,t,n)=>{let r=Math.abs(t),i;return i=e===1?e:al(e,5),[Kl(i+``,n),n.exponent,t<0?n.negative:n.positive,r<10?`0`:``,r]};function Jl(e,t,n,r){let i=n|0;if(typeof n==`string`)e.push(n);else if(n===i)e.push(Math.abs(i));else{let t=Math.abs(n),i=Hl(t),a=Ul(t,i);a===10&&(a=1,i++);let o=Gl(t);if(i>=-4&&i<=-1){let n=t.toPrecision(10+i).replace(/\.?0+$/,``);e.push(Kl(n,r))}else if(i===10){let n=t.toFixed(10).slice(0,12).replace(/\.$/,``);e.push(Kl(n,r))}else if(Math.abs(i)<=9)if(o.total<=11){let n=al(t,9).toFixed(o.frac);e.push(Kl(n,r))}else i===9?e.push(Math.floor(t)):i>=0&&i<9?e.push(Kl(String(al(t,9-i)),r)):e.push(...ql(a,i,r));else o.total>=12?e.push(...ql(a,i,r)):e.push(Kl(al(t,9).toFixed(o.frac),r))}return e}function Yl(e,t=!1){return e===`0`?`0`:e===`?`?t?`\xA0`:` `:``}let Xl=86400,Zl=(e,t,n)=>n?e<-694324||t>=35830291:e<0||t>=2958466;function Ql(e,t,n,r){var i,a;let o=``,s=``,c=``,l=``,u=``,d=``,f=0,p=0;if(typeof e==`bigint`){if(e<=2**53-1&&e>=-(2**53-1))e=Number(e);else return n.bigintErrorNumber?String(e):n.overflow;p=e}else p=Math.trunc(e);let m=0,h=0,g=1,_=0,v=0,y=0,b=0,x=0,S=0,C=r||Jc;if(!t.text&&isFinite(t.scale)&&t.scale!==1&&(e=Vl(e*t.scale)),t.exponential){let n=Math.abs(e);n&&(f=Hl(n,t.int_max)),e&&!t.integer&&f++,n=Ul(n,f),t.int_max===1&&al(n,t.frac_max)===10&&(n=1,f++),e=e<0?-n:n,o+=Math.abs(f)}if(t.integer){let n=Math.abs(al(e,t.fractions?1:t.frac_max));d+=n<1?``:Math.floor(n)}let w=(i=n.grouping[0])==null?3:i,T=(a=n.grouping[1])==null?w:a;t.dec_fractions&&(u=String(al(e,t.frac_max)).split(`.`)[1]||``);let E=!t.error&&(t.num_p.includes(`0`)||t.den_p.includes(`0`)),D=E;if(t.fractions){D=E||!!(e%1);let n=Math.abs(t.integer?e%1:e);if(n)if(D=!0,t.denominator&&isFinite(t.denominator))l+=t.denominator,c+=al(n*t.denominator),c===`0`&&(c=``,l=``,D=E);else{let e=ol(n,1/0,t.den_max);c+=e[0],l+=e[1],t.integer&&c===`0`&&(c=``,l=``,D=E)}else !e&&!t.integer&&(D=!0,c=`0`,l=`1`);t.integer&&!D&&!Math.trunc(e)&&(d=`0`)}if(t.date){p=Math.trunc(e);let r=Xl*(e-p);if(m=Math.floor(r),S=r-m,Math.abs(S)<1e-6?S=0:S>.9999&&(S=0,m+=1,m===Xl&&(m=0,p+=1)),S){let e=t.date&512||t.date&256||t.date&128;(e===512&&S>.9995||e===256&&S>.995||e===128&&S>.95||!e&&S>=.5)&&(m++,S=0)}if(p||t.date_system){let r=dl(e,t.date_system,n.leap1900);h=r[0],g=r[1],_=r[2]}if(m){let e=m<0?Xl+m:m;x=Math.floor(e)%60,b=Math.floor(e/60)%60,y=Math.floor(e/60/60)%60}if(v=(6+p)%7,t.date_eval&&Zl(e,p+m/Xl,n.dateSpanLarge)){if(n.dateErrorThrows)throw Error(`Date out of bounds`);return n.dateErrorNumber?Jl(e<0?[C.negative]:[],{},e,C).join(``):n.overflow}}let O=Yl(`?`,n.nbsp);f<0?s=`-`:t.exp_plus&&(s=`+`);let k=[],A=(e,t,r,i)=>{let a=!i&&e.length>t.length?r.length+e.length-t.length:r.length;e.length<t.length&&(i+=e.length-t.length);for(let t=0;t<a;t++)k.push(e[t+i]||Yl(r[t],n.nbsp));return a},j=!1,M={int:0,frac:0,man:0,num:0,den:0};for(let i=0,a=t.tokens.length;i<a;i++){let a=t.tokens[i],f=a.type,E=a.num?a.num.length:0;if(f===`string`)a.rule?a.rule===`num`?D?k.push(a.value.replace(/ /g,O)):(t.num_min>0||t.den_min>0)&&k.push(a.value.replace(/./g,O)):a.rule===`num+int`?D&&d?k.push(a.value.replace(/ /g,O)):t.den_min>0&&(d||t.num_min)&&k.push(a.value.replace(/./g,O)):a.rule===`den`&&(D?k.push(a.value.replace(/ /g,O)):(t.den_min>0||t.den_min>0)&&k.push(a.value.replace(/./g,O))):k.push(a.value.replace(/ /g,O));else if(f===`space`)a.rule===`num+int`?(D||t.num_min||t.den_min)&&(d||t.num_min)&&k.push(O):k.push(O);else if(f===`error`)k.push(n.invalid);else if(f===`point`)k.push(t.date?a.value:C.decimal);else if(f===`general`)Jl(k,t,e,C);else if(f===`exp`)k.push(C.exponent);else if(f===`minus`)a.volatile&&t.date||a.volatile&&(e>=0||typeof e!=`number`)||(a.volatile&&!t.fractions&&(t.integer||t.dec_fractions)?(e<0&&d&&d!==`0`||u)&&k.push(C.negative):k.push(C.negative));else if(f===`plus`)k.push(C.positive);else if(f===`text`)k.push(e);else if(f===`fill`)n.fillChar&&k.push(n.fillChar,a.value);else if(f===`skip`)n.skipChar?k.push(n.skipChar,a.value):k.push(n.nbsp?`\xA0`:` `);else if(f===`div`)D?k.push(`/`):t.num_min>0||t.den_min>0?k.push(O):k.push(Yl(`#`,n.nbsp));else if(f===`int`)if(t.int_pattern.length===1){let e=t.int_p,r=Math.max(t.int_min,d.length),i=``;for(let a=r;a>0;a--){let r=d.charAt(d.length-a),o=r?``:e.charAt(e.length-a)||e[0],s=``;if(t.grouping){let e=a-1-w;e>=0&&!(e%T)&&(s=r||o===`0`?C.group:Yl(`?`,n.nbsp))}i+=(r||Yl(o,n.nbsp))+s}k.push(i)}else M.int+=A(d,t.int_p,a.num,M.int);else if(f===`frac`){let e=M.frac;for(let t=0;t<E;t++)k.push(u[t+e]||Yl(a.num[t],n.nbsp));M.frac+=E}else if(f===`man`)!M[f]&&!M.man&&k.push(s),M.man+=A(o,t.man_p,a.num,M.man);else if(f===`num`)M.num+=A(c,t.num_p,a.num,M.num);else if(f===`den`){let e=M.den;for(let t=0;t<E;t++){let r=l[t+e];if(!r){let e=a.num[t];`123456789`.includes(e)||j&&e===`0`?(j=!0,r=n.nbsp?`\xA0`:` `):r=!j&&t===E-1&&e===`0`&&!l?`1`:Yl(e,n.nbsp)}k.push(r)}M.den+=E}else if(f===`year`)h<0&&k.push(C.negative),k.push(String(Math.abs(h)).padStart(4,`0`));else if(f===`year-short`){let e=h%100;k.push(e<10?`0`:``,e)}else if(f===`month`)k.push(a.pad&&g<10?`0`:``,g);else if(f===`monthname-single`)t.date_system===6?k.push(C.mmmm6[g-1].charAt(0)):k.push(C.mmmm[g-1].charAt(0));else if(f===`monthname-short`)t.date_system===6?k.push(C.mmm6[g-1]):k.push(C.mmm[g-1]);else if(f===`monthname`)t.date_system===6?k.push(C.mmmm6[g-1]):k.push(C.mmmm[g-1]);else if(a.type===`weekday-short`)k.push(C.ddd[v]);else if(f===`weekday`)k.push(C.dddd[v]);else if(f===`day`)k.push(a.pad&&_<10?`0`:``,_);else if(f===`hour`){let e=y%t.clock||(t.clock<24?t.clock:0);k.push(a.pad&&e<10?`0`:``,e)}else if(f===`min`)k.push(a.pad&&b<10?`0`:``,b);else if(f===`sec`)k.push(a.pad&&x<10?`0`:``,x);else if(f===`subsec`){k.push(C.decimal);let e=S.toFixed(t.sec_decimals);k.push(e.slice(2,2+a.decimals))}else if(f===`ampm`){let e=y<12?0:1;a.short&&!r?k.push(`AP`[e]):k.push(C.ampm[e])}else if(f===`hour-elap`){e<0&&k.push(C.negative);let t=p*24+Math.floor(Math.abs(m)/3600);k.push(String(Math.abs(t)).padStart(a.pad,`0`))}else if(f===`min-elap`){e<0&&k.push(C.negative);let t=p*1440+Math.floor(Math.abs(m)/60);k.push(String(Math.abs(t)).padStart(a.pad,`0`))}else if(f===`sec-elap`){e<0&&k.push(C.negative);let t=p*Xl+Math.abs(m);k.push(String(Math.abs(t)).padStart(a.pad,`0`))}else if(f===`b-year`)k.push(h+543);else if(f===`b-year-short`){let e=(h+543)%100;k.push(e<10?`0`:``,e)}}return k.join(``)}let $l=Bl([{type:pc,value:`@`,raw:`@`}]);function eu(e,t){for(let n=0;n<3;n++){let r=t[n];if(r){let t;if(r.condition){let n=r.condition[0],i=r.condition[1];n===`=`?t=e===i:n===`>`?t=e>i:n===`<`?t=e<i:n===`>=`?t=e>=i:n===`<=`?t=e<=i:n===`<>`&&(t=e!==i)}else t=!0;if(t)return r}}}function tu(e,t,n){let r=t.partitions,i=r[3],a=null;return(typeof e==`number`||typeof e==`bigint`)&&isFinite(e)&&(i=eu(e,r)),i!=null&&i.color&&(a=i.color),a&&typeof a==`number`&&n.indexColors&&(a=Lc[a-1]||`#000`),a}function nu(e,t,n){let r=t.partitions,i=Kc(t.locale||n.locale),a=r[3]?r[3]:$l;if(typeof e==`boolean`&&(e=(i||Jc).bool[+!e]),e==null)return``;let o=typeof e==`bigint`;if(typeof e!=`number`&&!o)return Ql(e,a,n,i);if(!o&&!isFinite(e)){let t=i||Jc;return isNaN(e)?t.nan:(e<0?t.negative:``)+t.infinity}let s=eu(e,r);return s?Ql(e,s,n,i):n.overflow}function ru(e){var t,n,r,i;return!!((t=e[0])!=null&&t.percent||(n=e[1])!=null&&n.percent||(r=e[2])!=null&&r.percent||(i=e[3])!=null&&i.percent)}function iu(e){var t,n,r,i;return!!((t=e[0])!=null&&t.date||(n=e[1])!=null&&n.date||(r=e[2])!=null&&r.date||(i=e[3])!=null&&i.date)}function au(e){let[t,n,r,i]=e;return!!((!t||t.generated)&&(!n||n.generated)&&(!r||r.generated)&&i!=null&&i.text&&!i.generated)}let ou={text:15,datetime:10.8,date:10.8,time:10.8,percent:10.6,currency:10.4,grouped:10.2,scientific:6,number:4,fraction:2,general:0,error:0},su=[[`DMY`,1],[`DM`,2],[`MY`,3],[`MDY`,4],[`MD`,5],[`hmsa`,6],[`hma`,7],[`hms`,8],[`hm`,9]];function cu(e,t=null){var n;let[r,i]=e,a=r.frac_max,o={type:`general`,isDate:iu(e),isText:au(e),isPercent:ru(e),maxDecimals:r.general?9:a,scale:(n=r.scale)==null?1:n,color:0,parentheses:0,grouped:+!!r.grouping},s=!o.isDate&&!o.isText&&!r.error&&r.tokens.some(e=>e.type===`string`&&(t?e.value===t:zc.test(e.value))),c=`G`,l=a>=0?Math.min(15,a):``,u=``,d=``;if(i!=null&&i.color&&(d=`-`,o.color=1),r.parens&&(u=`()`,o.parentheses=1),s)c=`C`,o.type=`currency`;else if(r.error)o.type=`error`,o.maxDecimals=0;else if(o.isDate){let e=0,t=0,n=``;r.tokens.forEach(r=>{let i=r.type;/^(b-)?year/.test(i)?(n+=`Y`,t++):i.startsWith(`month`)?(n+=`M`,t++):/^(week)?day/.test(i)?(n+=`D`,t++):(i===`hour`||i===`min`||i===`sec`||i===`ampm`)&&(n+=i[0],e++)}),o.type=`date`,t&&e?o.type=`datetime`:!t&&e&&(o.type=`time`);let i=su.find(e=>n.startsWith(e[0]));c=i?`D`:`G`,l=i?i[1]:``}else o.isText?(c=`G`,o.type=`text`,l=``,o.maxDecimals=0):r.general?(c=`G`,o.type=`general`,l=``):r.fractions?(c=`G`,o.type=`fraction`,l=``):r.exponential?(c=`S`,o.type=`scientific`):o.isPercent?(c=`P`,o.type=`percent`):r.grouping?(c=`,`,o.type=`grouped`):(r.int_max||a)&&(c=`F`,o.type=`number`);return o.code=c+l+d+u,o.level=ou[o.type],Object.freeze(o)}function lu(e){let[t]=e;return{year:!!(t.date&2),month:!!(t.date&4),day:!!(t.date&8),hours:!!(t.date&16),minutes:!!(t.date&32),seconds:!!(t.date&64),clockType:t.clock===12?12:24}}let uu=[[ic,/^General/i,0],[ac,/^#/,0],[oc,/^0/,0],[sc,/^\?/,0],[cc,/^\//,0],[fc,/^;/,0],[pc,/^@/,0],[mc,/^\+/,0],[hc,/^-/,0],[gc,/^\./,0],[_c,/^ /,0],[vc,/^%/,0],[yc,/^[1-9]/,0],[bc,/^(?:B[12])/i,0],[xc,/^B$/,0],[Sc,/^(?:[hH]+|[mM]+|[sS]+|[yY]+|[bB]+|[dD]+|[gG]+|[aA]{3,}|e+)/,0],[Cc,/^(?:\[(h+|m+|s+)\])/i,1],[wc,/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/,[1,2]],[Tc,/^\[(DBNum[0-4]?\d)\]/i,1],[Ec,/^\[(NatNum[0-4]?\d)\]/i,1],[Dc,/^\[\$([^\]]+)\]/,1],[Oc,/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*\d+)\]/i,1],[kc,/^\[([^\]]+)\]/,1],[Ac,/^(?:AM\/PM|am\/pm|A\/P)/,0],[jc,/^\\(.)/,1],[Mc,/^"([^"]*?)"/,1],[Nc,/^_(\\.|.)/,1],[`exp`,/^[Ee]([+-])/,1],[Pc,/^\*(\\.|.)/,1],[Fc,/^[()]/,0],[xc,/^[EÈÉÊËèéêëĒēĔĕĖėĘęĚěȄȅȆȇȨȩNnÑñŃńŅņŇňǸǹ["*/\\_]/,0],[Ic,/^./,0]],du=e=>{let t=(e||`\0`).charCodeAt(0);return t===63||t===35||t>=48&&t<=57};function fu(e){let t=0,n=[],r=[];for(;t<e.length;){let i=e.slice(t),a=0,o=/^(,+)(.)?/.exec(i);if(o){let i=o[1];a=i.length;let s=e[t-1]||``,c=!1,l=!1;du(s)?(c=!0,l=!0):s===`.`&&(l=!0);let u=o[2]||``;if(c&&(!u||u===`;`)&&(c=!1),l&&du(u)&&(l=!1),c&&!l)n.push({type:lc,value:`,`,raw:i});else if(!c&&l)n.push({type:uc,value:`,`,raw:i});else if(c&&l){let e={type:uc,value:`,`,raw:i};n.push(e),r.push(e)}else n.push({type:dc,value:`,`,raw:i})}else{let e;for(let[t,r,o]of uu){let s=r.exec(i);if(s){e={type:t,value:Array.isArray(o)?o.map(e=>s[e]):s[o||0],raw:s[0]},n.push(e),a=s[0].length;break}}r.length&&e.raw===`;`&&(r.length=0),r.length&&du(e.raw)&&(r.forEach(e=>e.type=lc),r.length=0)}if(!a){let e=i[0];a=1,n.push({type:Ic,value:e,raw:e})}t+=a}return n}let pu=e=>{var t;let[n,r]=(t=e.condition)==null?[]:t;r<0&&(n===`<`||n===`<=`||n===`=`)||r===0&&n===`<`||e.tokens.unshift({type:`minus`,volatile:!0})},mu=(e,t=null)=>{let n={};for(let t in e)Array.isArray(e[t])?n[t]=[...e[t]]:n[t]=e[t];return t&&n.tokens.unshift(t),n.generated=!0,n};function hu(e){let t=[],n=!1,r,i=null,a=0,o=!1,s=0,c=0,l=fu(e);do{var u;if(o=Bl(l),(o.date||o.general)&&(o.int_pattern.length||o.frac_pattern.length||o.scale!==1||o.text))throw Error(`Illegal format`);if(o.condition&&(c++,n=!0),o.text){if(i)throw Error(`Unexpected partition`);i=o}o.locale&&(r=Gc(o.locale)),t.push(o),a=+(((u=l[o.tokensUsed])==null?void 0:u.type)===`break`),l=l.slice(o.tokensUsed+a),s++}while(a&&s<4&&c<3);if(a)throw Error(`Unexpected partition`);if(c>2)throw Error(`Unexpected condition`);let d=t[3];if(d&&(d.int_pattern.length||d.frac_pattern.length||d.date))throw Error(`Unexpected partition`);if(n){t[0].condition||(t[0].condition=[`>`,0]);let e=t.length;if(e===1&&(t[1]=Bl(fu(`General`)),t[1].generated=!0),e<3){let e=t[0],n=t[1];if(pu(e),n.condition)pu(n);else{let t=e.condition;(t[0]===`=`||t[1]>=0&&(t[0]===`>`||t[0]===`>=`))&&n.tokens.unshift({type:`minus`,volatile:!0})}}else t.forEach(pu)}else{if(t.length<4&&i)for(let e=0,n=t.length;e<n;e++)t[e]===i&&t.splice(e,1);if(t.length<1&&i&&(t[0]=Bl(fu(`General`)),t[0].generated=!0),t.length<2&&t.push(mu(t[0],{type:`minus`,volatile:!0})),t.length<3&&t.push(mu(t[0])),t.length<4)if(i)t.push(i);else{let e=Bl(fu(`@`));e.generated=!0,t.push(e)}t[0].condition=[`>`,0],t[1].condition=[`<`,0],t[2].condition=null}return{pattern:e,partitions:t,locale:r}}var gu=p({addLocale:()=>Y,dateFromSerial:()=>hl,dateToSerial:()=>ml,dec2frac:()=>ol,format:()=>yu,formatColor:()=>bu,getFormatDateInfo:()=>Eu,getFormatInfo:()=>Tu,getLocale:()=>Kc,isDateFormat:()=>xu,isPercentFormat:()=>Su,isTextFormat:()=>Cu,isValidFormat:()=>wu,parseBool:()=>Fl,parseDate:()=>Ml,parseLocale:()=>Wc,parseNumber:()=>El,parseTime:()=>Pl,parseValue:()=>Il,round:()=>al,tokenTypes:()=>Du,tokenize:()=>fu});let _u=Object.create({});function vu(e,t=!1){e||(e=`General`);let n=_u[e];if(!n)try{n=hu(e),_u[e]=n}catch(r){if(t)throw r;let i={tokens:[{type:`error`}],error:r.message};n={pattern:e,partitions:[i,i,i,i],error:r.message,locale:null}}return n}function yu(e,t,n={}){var r;let i=Object.assign({},il,n),a=vu(e,i.throws);return nu((r=ml(t,i))==null?t:r,a,i)}function bu(e,t,n){var r;let i=Object.assign({},il,n),a=vu(e,i.throws);return tu((r=ml(t,i))==null?t:r,a,i)}function xu(e){return iu(vu(e,!1).partitions)}function Su(e){return ru(vu(e,!1).partitions)}function Cu(e){return au(vu(e,!1).partitions)}function wu(e){try{return vu(e,!0),!0}catch{return!1}}function Tu(e,t={}){let n=vu(e,!1);return n.info||(n.info=cu(n.partitions,t==null?void 0:t.currency)),n.info}function Eu(e){let t=vu(e,!1);return t.dateInfo||(t.dateInfo=lu(t.partitions)),t.dateInfo}let Du=Object.freeze({AMPM:Ac,BREAK:fc,CALENDAR:bc,CHAR:Ic,COLOR:Oc,COMMA:dc,CONDITION:wc,DATETIME:Sc,DBNUM:Tc,DIGIT:yc,DURATION:Cc,ERROR:xc,ESCAPED:jc,EXP:`exp`,FILL:Pc,GENERAL:ic,GROUP:lc,HASH:ac,LOCALE:Dc,MINUS:hc,MODIFIER:kc,NATNUM:Ec,PAREN:Fc,PERCENT:vc,PLUS:mc,POINT:gc,QMARK:sc,SCALE:uc,SKIP:Nc,SLASH:cc,SPACE:_c,STRING:Mc,TEXT:pc,ZERO:oc});function Ou(e){return e===`@@@`||e===`@`}function ku(e){return e==null||e===`General`}let Au=(e,t)=>{if(e&&!t||!e&&t)return!1;let n=e=>{let t=fu(e),n=``,r=!1,i=!1;for(let e of t){if(e.type===Du.POINT){r=!0;continue}if(!(i&&e.type===Du.MINUS)&&e.type!==Du.SKIP){if(e.type===Du.COLOR){i=!0;continue}else i=!1;r&&e.type===Du.ZERO||(r=!1,r||(n+=e.value||``))}}return n};return n(e)===n(t)},ju=new Set([`m d`]),Mu=new Set([`h:mm AM/PM`,`hh:mm AM/PM`]),Nu=new Set([`$`,`¥`,`₽`,`₫`,`NT$`,`€`,`₩`,`﷼`]),Pu=e=>{var t,n;let r=(t=(n=Ml(e))==null?Pl(e):n)==null?El(e):t;if(!r)return null;let{z:i}=r;if(i){if(ju.has(i)||Mu.has(i)&&!/\s(A|AM|P|PM)$/i.test(e))return null;if(i.includes(`#,##0`)){if(/[.,]$/.test(e))return null;let t=e.replace(RegExp(`^[${[...Nu].join(``)}]+`),``).trim();if(t.includes(`,`)&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(t))return null}}return r};function Fu(e,t){let n={};for(let r in e){let i=Number(r),a=e[i];for(let e in a){let r=Number(e),o=a[r],s=t(i,r,o);s!==void 0&&(n[i]?n[i][r]=s:n[i]={[r]:s})}}return n}function Iu(e){let t=0,n=Object.keys(e);for(let e of n){let n=Number(e);t=Math.max(t,n)}return t+1}let Lu=e=>e==null||typeof e==`object`&&Object.keys(e).length===0;function Ru(e,t,n){let r=Iu(n),i=n;for(let t=r-1;t>=e;t--)Lu(i[t])?delete i[t+1]:i[t+1]=i[t];Lu(t)||(i[e]=t)}function zu(e,t,n){let r=Object.keys(n).reduce((e,t)=>Math.max(e,Number.parseInt(t)),0)+1;for(let i=e;i<r;i++)i<e+t?delete n[i]:n[i]!==void 0&&(n[i-t]=n[i],delete n[i])}function Bu(e,t){let n=e,r=Object.keys(n),i=r.length,a=t,o=Object.keys(a),s=o.length,c={},l=0;for(let e=0;e<i;e++,l++)c[l]=n[r[e]];for(let e=0;e<s;e++,l++)c[l]=a[o[e]];return c}function Vu(e,t,n){let r=n;if(Iu(n)>0){let n={},i=0;for(let a=e;a<=t;a++)r[a]&&(n[i]=r[a],i++);return n}return{}}function Hu(e,t,n,r){let i=e>n;if(!i&&e+t>n)throw Error(`Invalid move operation`);i?Uu(e,t,n,r):Wu(e,t,n,r)}function Uu(e,t,n,r){let i=r,a=[];for(let n=e;n<e+t;n++)a.push(i[n]);for(let r=e-1;r>=n;r--){let e=i[r];i[r+t]=e,e===void 0&&delete i[r+t]}a.forEach((e,t)=>{i[n+t]=e,e===void 0&&delete i[n+t]})}function Wu(e,t,n,r){let i=r,a=[];for(let n=e;n<e+t;n++)a.push(i[n]);for(let r=e+t;r<n;r++){let e=i[r];i[r-t]=e,e===void 0&&delete i[r-t]}a.forEach((e,r)=>{i[n+r-t]=e,e===void 0&&delete i[n+r-t]})}var Gu=class e{constructor(e={}){F(this,`_matrix`,void 0),this._setOriginValue(e)}static MakeObjectMatrixSize(t){return new e({[t-1]:{}})}getMatrix(){return this._matrix}forEach(e){let t=this._matrix,n=Object.keys(t);for(let r of n){let n=Number(r),i=t[n];if(e(n,i)===!1)return this}return this}forRow(e){let t=this._matrix,n=Object.keys(t);for(let r of n){let n=Number(r),i=t[n];if(e(n,Object.keys(i).map(e=>Number(e)))===!1)return this}return this}forValue(e){let t=this._matrix;for(let n in t){let r=Number(n),i=t[r];if(i)for(let t in i){let n=Number(t),a=i[n];if(e(r,n,a)===!1)return this}}return this}swapRow(e,t){let n=this._matrix[e],r=this._matrix[t];this._matrix[e]=r,this._matrix[t]=n}getRow(e){return this._matrix[e]}getRowOrCreate(e){let t=this.getRow(e);return t==null&&(t={},this._matrix[e]=t),t}reset(){this._setOriginValue({})}hasValue(){let e=this._matrix,t=Object.keys(e);if(t.length===0)return!1;for(let n of t){let t=e[Number(n)];if(Object.keys(t).length>0)return!0}return!1}getValue(e,t){var n;return(n=this._matrix)==null||(n=n[e])==null?void 0:n[t]}setValue(e,t,n){let r=this.getRowOrCreate(e);r[t]=n}deleteValue(e,t){var n;(n=this._matrix)==null||(n=n[e])==null||delete n[t]}realDeleteValue(e,t){var n;if((n=this._matrix)==null||(n=n[e])==null||delete n[t],this.getRow(e)){let t=this.getRow(e);if(t==null)return;if(Object.keys(t).length===0){var r;(r=this._matrix)==null||delete r[e]}}}setRow(e,t){this._matrix[e]=t}moveRows(e,t,n){Hu(e,t,n,this._matrix)}moveColumns(e,t,n){this.forEach((r,i)=>{Hu(e,t,n,i)})}insertRows(e,t){let n=Object.keys(this._matrix);for(let r=n.length-1;r>=0;r--){let i=Number(n[r]);if(i>=e){let e=this._matrix[i];delete this._matrix[i],this._matrix[i+t]=e}}}insertColumns(e,t){let n=Object.keys(this._matrix);for(let r=0;r<n.length;r++){let i=Number(n[r]),a=this._matrix[i],o=Object.keys(a);for(let n=o.length-1;n>=0;n--){let r=Number(o[n]);if(r>=e){let e=a[r];delete a[r],a[r+t]=e}}}}removeRows(e,t){zu(e,t,this._matrix)}removeColumns(e,t){this.forEach((n,r)=>{r&&zu(e,t,r)})}getFragment(t,n,r,i){let a=new e,o=0;for(let e=t;e<=n;e++){let t={},n=0;for(let a=r;a<=i;a++)t[n]=this.getValue(e,a),n++;a.setRow(o,t),o++}return a}getSlice(t,n,r,i){let a=new e;for(let e=t;e<=n;e++)for(let t=r;t<=i;t++){let n=this.getValue(e,t);n&&a.setValue(e,t,L.deepClone(n))}return a}getSliceDataAndCellCountByRows(t,n){let r=new e,i=0;for(let e=t;e<=n;e++){let t=this.getRow(e);t&&(r.setRow(e,t),i+=Object.keys(t).length)}return{sliceData:r,cellCount:i}}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Iu(this._matrix)}getRange(){let e=this.getLength()-1,t=0,n=this.getLength();for(let e=0;e<n;e++){let n=this.getRow(e);if(n){let e=Iu(n)-1;t=e>t?e:t}}return{startRow:0,startColumn:0,endRow:e,endColumn:t}}getRealRange(){let e=Object.keys(this._matrix),t=e.length,n=t>0?Number(e[0]):0,r=t>0?Number(e[t-1]):0,i=-1/0,a=0;for(let t of e){let e=this.getRow(Number(t));if(e){let t=Object.keys(e);if(t.length>0){let e=Number(t[0]),n=Number(t[t.length-1]);(i===-1/0||e<i)&&(i=e),n>a&&(a=n)}}}return i===-1/0&&(i=0),{startRow:n,endRow:r,startColumn:i,endColumn:a}}getRealRowRange(){let e=Object.keys(this._matrix),t=e.length;return{startRow:t>0?Number(e[0]):0,endRow:t>0?Number(e[t-1]):0}}toNativeArray(){let e=[];return this.forValue((t,n,r)=>{e.push(r)}),e}toArray(){let e=[];return this.forRow((t,n)=>{e[t]==null&&(e[t]=[]),n.forEach(n=>{e[t][n]=this.getValue(t,n)})}),e}toFullArray(){let{endColumn:e,endRow:t}=this.getRange(),n=[];for(let r=0;r<=t;r++){let t=Array(e+1).fill(void 0);n.push(t)}return this.forValue((e,t,r)=>{n[e][t]=r}),n}toJSON(){return this._matrix}clone(){let e=JSON.stringify(this._matrix);return JSON.parse(e)}getData(){let e=JSON.stringify(this._matrix);return JSON.parse(e)}getArrayData(){let t=0,n=0,r=!1,i=!1,a=new e;return this.forEach((e,o)=>{r||(r=!0,t=e),Object.keys(o).forEach(r=>{let o=Number(r);i?o<n&&(n=o):(i=!0,n=o);let s=this.getValue(e,o);a.setValue(e-t,o-n,s)})}),a.getData()}getStartEndScope(){let e=-1,t=-1,n=-1,r=-1,i=Object.keys(this._matrix);i.length>0&&(e=+i[0],t=+i[i.length-1]);for(let e of i){let t=Object.keys(this._matrix[e]);t.length>0&&(n=n===-1?+t[0]:Math.min(n,+t[0]),r=Math.max(r,+t[t.length-1]))}return{startRow:e,endRow:t,startColumn:n,endColumn:r}}getDataRange(){let e=0,t=0,n=0,r=-1,i=!1,a=!1;return this.forEach((o,s)=>{if(i||(i=!0,e=o),s==null)return;let c=Iu(s)-1;c>n&&(n=c),Object.keys(s).forEach(e=>{let n=Number(e);a?n<t&&(t=n):(a=!0,t=n)}),o>r&&(r=o)}),{startRow:e,startColumn:t,endRow:r,endColumn:n}}getDiscreteRanges(){let e=[];return this.forEach((t,n)=>{Object.keys(n).forEach(n=>{let r=Number(n),i=!1;for(let n of e)if(t>=n.startRow&&t<=n.endRow+1&&r>=n.startColumn&&r<=n.endColumn+1){n.endRow=Math.max(t,n.endRow),n.endColumn=Math.max(r,n.endColumn),i=!0;break}i||e.push({startRow:t,endRow:t,startColumn:r,endColumn:r})})}),e}merge(e){this.forValue((t,n)=>{let r=e.getValue(t,n);r!=null&&this.setValue(t,n,r)})}concatRows(e){let t=e.getMatrix();for(let e in t){let n=Number(e);this.setRow(n,t[n])}}_setOriginValue(e={}){this._matrix=e}};function Ku(e){let{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:i,mergeInfo:a}=e,{startY:o,endY:s,startX:c,endX:l}=e,u=t,d=n,f=t,p=n;if(r&&a){let{startRow:e,startColumn:t,endRow:n,endColumn:r,startY:i,endY:m,startX:h,endX:g}=a;u=e,d=t,f=n,p=r,o=i,s=m,c=h,l=g}return i&&(o=a.startY,s=a.endY,c=a.startX,l=a.endX,f=a.endRow,p=a.endColumn),{startRow:u,startColumn:d,endRow:f,endColumn:p,startY:o,endY:s,startX:c,endX:l}}let qu=Ku;function Ju(e){if(!e)return;let{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:i,startRow:a,startColumn:o,endRow:s,endColumn:c}=e,l=t,u=n,d=t,f=n;return(r||i)&&(l=a,u=o,d=s,f=c),{startRow:l,startColumn:u,endRow:d,endColumn:f}}function Yu(e){var t;return!e||((e==null||(t=e.v)==null?void 0:t.toString())||``).length===0&&!e.p}function Xu(e){return Yu(e)&&(e==null?void 0:e.coverable)!==!1}function Zu(e){if(e){if(e.rgb)return new As(e.rgb).toHexString();if(e.th!=null){var t;let n=(t=rc[Za.OFFICE])==null?void 0:t[e.th];if(n)return new As(n).toRgbString()}}return null}function Qu(e){return L.isString(e)&&e.substring(0,1)===`=`&&e.length>1}function $u(e){return L.isString(e)&&e.length>0}function ed(e,t=!1){let n=``,r=new Map([[`ff`,()=>{e.ff&&(n+=`font-family: ${e.ff}; `)}],[`fs`,()=>{if(e.fs){let t=e.fs;e.va&&(t/=2),n+=`font-size: ${t}pt; `}}],[`it`,()=>{e.it&&(n+=`font-style: italic; `)}],[`bl`,()=>{e.bl&&(n+=`font-weight: bold; `)}],[`ul`,()=>{var t;(t=e.ul)!=null&&t.s&&(n.indexOf(`text-decoration-line`)>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(e,t)=>`${t} underline`):n+=`text-decoration: underline; `,e.ul.cl&&n.indexOf(`text-decoration-color`)===-1&&(n+=`text-decoration-color: ${Zu(e.ul.cl)}; `),e.ul.t&&n.indexOf(`text-decoration-style`)===-1&&(n+=`text-decoration-style: ${e.ul.t} `))}],[`st`,()=>{var t;(t=e.st)!=null&&t.s&&(n.indexOf(`text-decoration-line`)>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(e,t)=>`${t} line-through`):n+=`text-decoration-line: line-through; `,e.st.cl&&n.indexOf(`text-decoration-color`)===-1&&(n+=`text-decoration-color: ${Zu(e.st.cl)}; `),e.st.t&&n.indexOf(`text-decoration-style`)===-1&&(n+=`text-decoration-style: ${e.st.t} `))}],[`ol`,()=>{var t;(t=e.ol)!=null&&t.s&&(n.indexOf(`text-decoration-line`)>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(e,t)=>`${t} overline`):n+=`text-decoration-line: overline; `,e.ol.cl&&n.indexOf(`text-decoration-color`)===-1&&(n+=`text-decoration-color: ${Zu(e.ol.cl)}; `),e.ol.t&&n.indexOf(`text-decoration-style`)===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],[`bg`,()=>{e.bg&&(n+=`background: ${Zu(e.bg)}; `)}],[`bd`,()=>{var t,r,i,a;if((t=e.bd)!=null&&t.b){var o,s;n+=`border-bottom: ${td((o=e.bd)==null?void 0:o.b.s)} ${(s=Zu(e.bd.b.cl))==null?``:s}; `}if((r=e.bd)!=null&&r.t){var c,l;n+=`border-top: ${td((c=e.bd)==null?void 0:c.t.s)} ${(l=Zu(e.bd.t.cl))==null?``:l}; `}if((i=e.bd)!=null&&i.r){var u,d;n+=`border-right: ${td((u=e.bd)==null?void 0:u.r.s)} ${(d=Zu(e.bd.r.cl))==null?``:d}; `}if((a=e.bd)!=null&&a.l){var f,p;n+=`border-left: ${td((f=e.bd)==null?void 0:f.l.s)} ${(p=Zu(e.bd.l.cl))==null?``:p}; `}}],[`cl`,()=>{e.cl&&(n+=`color: ${Zu(e.cl)}; `)}],[`va`,()=>{e.va===Ja.SUBSCRIPT?n+=`vertical-align: sub; `:e.va===Ja.SUPERSCRIPT&&(n+=`vertical-align: super; `)}],[`td`,()=>{e.td===Va.LEFT_TO_RIGHT?n+=`direction: ltr; `:e.td===Va.RIGHT_TO_LEFT&&(n+=`direction: rtl; `)}],[`tr`,()=>{if(e.tr){var t,r,i;n+=`--data-rotate: (${(t=e.tr)==null?void 0:t.a}deg${(r=e.tr)!=null&&r.v?` ,${(i=e.tr)==null?void 0:i.v}`:``});`}}],[`ht`,()=>{e.ht===Ua.LEFT?n+=`text-align: left; `:e.ht===Ua.RIGHT?n+=`text-align: right; `:e.ht===Ua.CENTER?n+=`text-align: center; `:e.ht===Ua.JUSTIFIED&&(n+=`text-align: justify; `)}],[`vt`,()=>{e.vt===Wa.BOTTOM?n+=`vertical-align: bottom; `:e.vt===Wa.TOP?n+=`vertical-align: top; `:e.vt===Wa.MIDDLE&&(n+=`vertical-align: middle; `)}],[`tb`,()=>{e.tb===Ga.CLIP?n+=`white-space: nowrap; overflow-x: hidden; `:e.tb===Ga.WRAP&&(n+=`white-space: normal;`)}],[`pd`,()=>{var t,r,i,a,o,s,c,l;let u=`${(t=e.pd)==null?void 0:t.b}pt`,d=`${(r=e.pd)==null?void 0:r.t}pt`,f=`${(i=e.pd)==null?void 0:i.l}pt`,p=`${(a=e.pd)==null?void 0:a.r}pt`;(o=e.pd)!=null&&o.b&&(n+=`padding-bottom: ${u}; `),(s=e.pd)!=null&&s.t&&(n+=`padding-top: ${d}; `),(c=e.pd)!=null&&c.l&&(n+=`padding-left: ${f}; `),(l=e.pd)!=null&&l.r&&(n+=`padding-right: ${p}; `)}]]),i=[`bd`,`tr`,`tb`];for(let n in e){var a;t&&i.includes(n)||(a=r.get(n))==null||a()}return n}function td(e){let t=``;return e===R.NONE?t=`none`:e===R.THIN?t=`0.5pt solid`:e===R.HAIR?t=`0.5pt double`:e===R.DOTTED?t=`0.5pt dotted`:e===R.DASHED||e===R.DASH_DOT?t=`0.5pt dashed`:e===R.DASH_DOT_DOT?t=`0.5pt dotted`:e===R.DOUBLE?t=`0.5pt double`:e===R.MEDIUM?t=`1pt solid`:e===R.MEDIUM_DASHED||e===R.MEDIUM_DASH_DOT?t=`1pt dashed`:e===R.MEDIUM_DASH_DOT_DOT?t=`1pt dotted`:e===R.SLANT_DASH_DOT?t=`0.5pt dashed`:e===R.THICK&&(t=`1.5pt solid`),t}function nd(e){let t=0;if(e=e.trim(),e===`none`)t=R.NONE;else if(e===`0.5pt solid`)t=R.THIN;else if(e===`0.5pt double`)t=R.HAIR;else if(e===`0.5pt dotted`)t=R.DOTTED;else if(e===`0.5pt dashed`)t=R.DASHED;else if(e===`1pt solid`)t=R.MEDIUM;else if(e===`1pt dashed`)t=R.MEDIUM_DASHED;else if(e===`1pt dotted`)t=R.MEDIUM_DASH_DOT_DOT;else if(e===`1.5pt solid`)t=R.THICK;else if(!e.includes(`none`))t=R.THIN;else return R.NONE;return t}function rd(e,t){let n=e.body;if(t){let{headers:r,footers:i}=e;r!=null&&r[t]?n=r[t].body:i!=null&&i[t]&&(n=i[t].body)}return n}function id(e,t){let{startRow:n,endRow:r,startColumn:i,endColumn:a,rangeType:o}=e;if(n<0||i<0||r<0||a<0||!(Number.isNaN(n)&&Number.isNaN(r))&&o===G.COLUMN||!(Number.isNaN(i)&&Number.isNaN(a))&&o===G.ROW||o!==G.ROW&&o!==G.COLUMN&&(Number.isNaN(i)||Number.isNaN(n)||Number.isNaN(a)||Number.isNaN(r)))return!1;if(t){let e=t.getRowCount(),n=t.getColumnCount();if(r>=e||a>=n)return!1}return!0}function ad(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function od(e){if(Qu(e))return{f:e,v:null,p:null};if(Zs(e)){if(typeof e==`string`){let t=Pu(e);if(t&&t.z)return{v:t.v,p:null,f:null,s:{n:{pattern:t.z||`General`}}}}return{v:e,p:null,f:null}}return Js(e),e}function sd(e,t){let n=new Gu,{startRow:r,startColumn:i,endRow:a,endColumn:o}=t;if(L.isArray(e))for(let t=0;t<=a-r;t++)for(let a=0;a<=o-i;a++)n.setValue(t+r,a+i,od(e[t][a]));else new Gu(e).forValue((e,t,r)=>{n.setValue(e,t,od(r))});return n.getMatrix()}function cd(e,t){return Object.prototype.toString.call(e)===Object.prototype.toString.call(t)?Object.prototype.toString.call(e)===`[object Object]`||Object.prototype.toString.call(e)===`[object Array]`?Object.keys(e).length===Object.keys(t).length?Object.keys(e).every(n=>cd(e[n],t[n])):!1:e===t:!1}function ld(e,t){let n=e.ts||{},r=t.ts||{};return e.sId===t.sId?cd(n,r):!1}function ud(e,t){return t.some(t=>e.indexOf(t)>-1)}let dd=1e3*1,fd=60*dd,pd=60*fd;24*pd;let md=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],hd=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],gd=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],_d=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],vd=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],yd={L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`,l:`M/D/YYYY`,ll:`MMM D, YYYY`,lll:`MMM D, YYYY h:mm A`,llll:`ddd, MMM D, YYYY h:mm A`},bd={millisecond:`millisecond`,milliseconds:`millisecond`,ms:`millisecond`,second:`second`,seconds:`second`,s:`second`,minute:`minute`,minutes:`minute`,m:`minute`,hour:`hour`,hours:`hour`,h:`hour`,day:`day`,days:`day`,d:`day`,week:`week`,weeks:`week`,w:`week`,month:`month`,months:`month`,M:`month`,year:`year`,years:`year`,y:`year`};var xd=class e{constructor(e,t){this._date=e,this._isUTC=t}isValid(){return!Number.isNaN(this._date.getTime())}format(e=`YYYY-MM-DDTHH:mm:ssZ`){return this.isValid()?Id(this._date,e,this._isUTC):`Invalid Date`}valueOf(){return this._date.getTime()}toDate(){return new Date(this.valueOf())}_clone(){return new e(this.toDate(),this._isUTC)}add(t,n=`millisecond`){let r=Dd(n);return!this.isValid()||!r||!Number.isFinite(t)?this._clone():new e(Ad(this._date,t,r,this._isUTC),this._isUTC)}subtract(e,t=`millisecond`){return this.add(-e,t)}startOf(t){let n=Dd(t);return!n||!this.isValid()?this._clone():new e(jd(this._date,n,this._isUTC),this._isUTC)}endOf(e){let t=Dd(e);return!t||!this.isValid()||t===`millisecond`?this._clone():this.startOf(t).add(1,t).subtract(1,`millisecond`)}utc(){return new e(this.toDate(),!0)}local(){return new e(this.toDate(),!1)}weekday(e){let t=(Cd(this._date,this._isUTC).dayOfWeek-0+7)%7;return e===void 0?t:this.add(e-t,`day`)}week(e){let t=Md(this._date,this._isUTC);return e===void 0?t:this.add((e-t)*7,`day`)}};function Sd(e,t=2){return String(Math.abs(e)).padStart(t,`0`)}function Cd(e,t){return t?{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),millisecond:e.getUTCMilliseconds(),dayOfWeek:e.getUTCDay()}:{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),millisecond:e.getMilliseconds(),dayOfWeek:e.getDay()}}function wd(e,t){return e instanceof xd?e.toDate():e===void 0?new Date:e===null?new Date(NaN):e instanceof Date?new Date(e.getTime()):typeof e==`number`?new Date(e):typeof e==`string`?Ed(e,t):new Date(NaN)}function Td(e,t,n,r,i,a,o,s){let c=s?new Date(Date.UTC(e,t-1,n,r,i,a,o)):new Date(e,t-1,n,r,i,a,o),l=Cd(c,s);return l.year!==e||l.month!==t||l.day!==n||l.hour!==r||l.minute!==i||l.second!==a?new Date(NaN):c}function Ed(e,t){let n=e.trim();if(!n)return new Date(NaN);let r=n.match(/^(\d{4})年(\d{1,2})月(\d{1,2})日(?:\s+(\d{1,2})(?::(\d{1,2})(?::(\d{1,2}))?)?)?$/);if(r){let[,e,n,i,a=`0`,o=`0`,s=`0`]=r;return Td(Number(e),Number(n),Number(i),Number(a),Number(o),Number(s),0,t)}let i=n.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})(?:[ T](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:\.(\d{1,3}))?)?)?)?$/);if(i){let[,e,n,r,a=`0`,o=`0`,s=`0`,c=`0`]=i;return Td(Number(e),Number(n),Number(r),Number(a),Number(o),Number(s),Number(c),t)}return/^-?\d+(\.\d+)?$/.test(n)?new Date(Number(n)):new Date(n)}function Dd(e){var t;return(t=bd[e])==null?bd[String(e).toLowerCase()]:t}function Od(e,t,n){return n?new Date(Date.UTC(e,t,0)).getUTCDate():new Date(e,t,0).getDate()}function kd(e,t,n,r){let i=new Date(e.getTime());if(t){switch(n){case`year`:i.setUTCFullYear(r);break;case`month`:i.setUTCMonth(r);break;case`day`:i.setUTCDate(r);break;case`hour`:i.setUTCHours(r);break;case`minute`:i.setUTCMinutes(r);break;case`second`:i.setUTCSeconds(r);break;case`millisecond`:i.setUTCMilliseconds(r);break}return i}switch(n){case`year`:i.setFullYear(r);break;case`month`:i.setMonth(r);break;case`day`:i.setDate(r);break;case`hour`:i.setHours(r);break;case`minute`:i.setMinutes(r);break;case`second`:i.setSeconds(r);break;case`millisecond`:i.setMilliseconds(r);break}return i}function Ad(e,t,n,r){switch(n){case`millisecond`:return new Date(e.getTime()+t);case`second`:return new Date(e.getTime()+t*dd);case`minute`:return new Date(e.getTime()+t*fd);case`hour`:return new Date(e.getTime()+t*pd);case`day`:return kd(e,r,`day`,(r?e.getUTCDate():e.getDate())+t);case`week`:return kd(e,r,`day`,(r?e.getUTCDate():e.getDate())+t*7);case`month`:{let n=Cd(e,r),i=Td(n.year,n.month,1,n.hour,n.minute,n.second,n.millisecond,r),a=kd(i,r,`month`,(r?i.getUTCMonth():i.getMonth())+t),o=Cd(a,r),s=Od(o.year,o.month,r);return kd(a,r,`day`,Math.min(n.day,s))}case`year`:return Ad(e,t*12,`month`,r)}}function jd(e,t,n){let r=Cd(e,n);switch(t){case`year`:return Td(r.year,1,1,0,0,0,0,n);case`month`:return Td(r.year,r.month,1,0,0,0,0,n);case`week`:{let e=(r.dayOfWeek-0+7)%7,t=Td(r.year,r.month,r.day,0,0,0,0,n);return kd(t,n,`day`,(n?t.getUTCDate():t.getDate())-e)}case`day`:return Td(r.year,r.month,r.day,0,0,0,0,n);case`hour`:return Td(r.year,r.month,r.day,r.hour,0,0,0,n);case`minute`:return Td(r.year,r.month,r.day,r.hour,r.minute,0,0,n);case`second`:return Td(r.year,r.month,r.day,r.hour,r.minute,r.second,0,n);default:return new Date(e.getTime())}}function Md(e,t){let n=jd(e,`week`,t),r=jd(jd(e,`year`,t),`week`,t);return Math.floor((n.getTime()-r.getTime())/864e5/7)+1}function Nd(e,t,n=!1){if(t)return n?`+0000`:`+00:00`;let r=-e.getTimezoneOffset(),i=r>=0?`+`:`-`,a=Math.abs(r),o=Sd(Math.floor(a/60),2),s=Sd(a%60,2);return n?`${i}${o}${s}`:`${i}${o}:${s}`}function Pd(e){let t=e%100;if(t>=11&&t<=13)return`${e}th`;switch(e%10){case 1:return`${e}st`;case 2:return`${e}nd`;case 3:return`${e}rd`;default:return`${e}th`}}function Fd(e){return e.replace(/LLLL|LLL|LL|L|llll|lll|ll|l/g,e=>{var t;return(t=yd[e])==null?e:t})}function Id(e,t,n){let r=Cd(e,n),i=r.hour%12,a=i===0?12:i,o=Math.ceil(r.month/3),s={YYYY:String(r.year),YY:Sd(r.year%100,2),MMMM:md[r.month-1],MMM:hd[r.month-1],MM:Sd(r.month,2),M:String(r.month),DD:Sd(r.day,2),D:String(r.day),Do:Pd(r.day),dddd:gd[r.dayOfWeek],ddd:_d[r.dayOfWeek],dd:vd[r.dayOfWeek],d:String(r.dayOfWeek),HH:Sd(r.hour,2),H:String(r.hour),hh:Sd(a,2),h:String(a),mm:Sd(r.minute,2),m:String(r.minute),ss:Sd(r.second,2),s:String(r.second),SSS:Sd(r.millisecond,3),A:r.hour>=12?`PM`:`AM`,a:r.hour>=12?`pm`:`am`,Q:String(o),Qo:Pd(o),X:String(Math.floor(e.getTime()/1e3)),x:String(e.getTime()),Z:Nd(e,n,!1),ZZ:Nd(e,n,!0)},c=[];return Fd(t.replace(/\[([^\]]+)]/g,(e,t)=>`\u0000${c.push(t)-1}\u0000`)).replace(/YYYY|YY|MMMM|MMM|MM|M|DD|Do|D|dddd|ddd|dd|d|HH|H|hh|h|mm|m|ss|s|SSS|A|a|Qo|Q|X|x|ZZ|Z/g,e=>{var t;return(t=s[e])==null?e:t}).replace(/\u0000(\d+)\u0000/g,(e,t)=>{var n;return(n=c[Number(t)])==null?``:n})}function Ld(e){return new xd(wd(e,!1),!1)}let Rd=Object.assign(Ld,{utc:e=>new xd(wd(e,!0),!0),isDateKit:e=>e instanceof xd,unix:e=>Ld(e*1e3)});function zd(e,t,n,r){if(e>t)throw Error(`a1 should be less than a2`);if(n>r)throw Error(`b1 should be less than b2`);if(t<n||r<e)return[e,t];if(n<=e&&r>=t)return[];let i=r-n+1;return e<n&&t>r?[e,t-i]:n<=e&&r<t?[r+1-i,t-i]:n>e&&r>=t?[e,n-1]:[e,t]}function Bd(e){if(e==null)return!1;let t=e.bullet;return(t==null?void 0:t.listId)!=null}function Vd(e){if(e==null)return!1;let t=e.paragraphStyle;return Hd(t)}function Hd(e){var t;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((t=e.hanging)==null?void 0:t.v)===0)}function Ud(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Wd(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}function Gd(e){if(e==null||typeof e==`boolean`)return!1;if(typeof e==`number`)return!isNaN(e);if(typeof e==`string`){let t=e.trim();return t===``?!1:!isNaN(Number(t))}return!1}function Kd(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+(t<<6)+(t<<16)-t;return t>>>0}function qd(e){if(e.length===0)return[];let t=e.slice().sort((e,t)=>(Array.isArray(e)?e[0]:e)-(Array.isArray(t)?t[0]:t)),n=[],r=Array.isArray(t[0])?t[0][0]:t[0],i=r;for(let e=1;e<t.length;e++){let a=t[e],o,s;Array.isArray(a)?(o=a[0],s=a[1]):(o=a,s=a),o<=i+1?i=Math.max(i,s):(n.push([r,i]),r=o,i=s)}return n.push([r,i]),n}function Jd(e){if(e.length===0)return[];let t=e.slice().sort((e,t)=>e[0]-t[0]),n=[],[r,i]=t[0];for(let e=1;e<t.length;e++){let[a,o]=t[e];a<=i+1?i=Math.max(i,o):(n.push([r,i]),r=a,i=o)}return n.push([r,i]),n}function Yd(...e){let t;return t=e.length===1&&Array.isArray(e[0])?e[0]:e,Bi({},...t)}let Xd,Zd,Qd,$d,X=Symbol(`newer`),ef=Symbol(`older`);Xd=Symbol.iterator;var tf=class{constructor(e){F(this,`entry`,void 0),this.entry=e}[Xd](){return this}next(){let e=this.entry;return e?(this.entry=e[X],{done:!1,value:e.key}):{done:!0,value:void 0}}};Zd=Symbol.iterator;var nf=class{constructor(e){F(this,`entry`,void 0),this.entry=e}[Zd](){return this}next(){let e=this.entry;return e?(this.entry=e[X],{done:!1,value:e.value}):{done:!0,value:void 0}}};Qd=Symbol.iterator;var rf=class{constructor(e){F(this,`entry`,void 0),this.entry=e}[Qd](){return this}next(){let e=this.entry;return e?(this.entry=e[X],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}}},af=class{constructor(e,t){F(this,`key`,void 0),F(this,`value`,void 0),F(this,X,void 0),F(this,ef,void 0),this.key=e,this.value=t,this[X]=void 0,this[ef]=void 0}toJSON(){return{key:this.key,value:this.value}}};$d=Symbol.iterator;var of=class{onShift(e){if(this._onShiftListeners.indexOf(e)===-1)return this._onShiftListeners.push(e),ta(()=>x(this._onShiftListeners,e));throw Error(`[LRUMap]: the listener has been registered!`)}constructor(...e){if(F(this,`_keymap`,void 0),F(this,`size`,0),F(this,`limit`,void 0),F(this,`oldest`,void 0),F(this,`newest`,void 0),F(this,`_onShiftListeners`,[]),sf.hasLength(e,1)){if(sf.isNumber(e[0])){let t=e[0];this._initialize(t,void 0);return}if(sf.isIterable(e[0])){let t=e[0];this._initialize(0,t);return}return}if(sf.hasLength(e,2)){let t=e[0],n=e[1];this._initialize(t,n)}}_initialize(e,t){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=e,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[X]&&(e===this.oldest&&(this.oldest=e[X]),e[X][ef]=e[ef]),e[ef]&&(e[ef][X]=e[X]),e[X]=void 0,e[ef]=this.newest,this.newest&&(this.newest[X]=e),this.newest=e)}assign(e){let t,n=this.limit||Number.MAX_VALUE;this._keymap.clear();let r=e[Symbol.iterator]();for(let e=r.next();!e.done;e=r.next()){let r=new af(e.value[0],e.value[1]);if(this._keymap.set(r.key,r),t?(t[X]=r,r[ef]=t):this.oldest=r,t=r,n--===0)throw Error(`overflow`)}this.newest=t,this.size=this._keymap.size}set(e,t){let n=this._keymap.get(e);return n?(n.value=t,this._markEntryAsUsed(n),this):(this._keymap.set(e,n=new af(e,t)),this.newest?(this.newest[X]=n,n[ef]=this.newest):this.oldest=n,this.newest=n,++this.size,this.size>this.limit&&this.shift(),this)}shift(){let e=this.oldest;if(e)return this.oldest&&this.oldest[X]?(this.oldest=this.oldest[X],this.oldest[ef]=void 0):(this.oldest=void 0,this.newest=void 0),e[X]=e[ef]=void 0,this._keymap.delete(e.key),--this.size,this._onShiftListeners.forEach(t=>t(e)),[e.key,e.value]}get(e){let t=this._keymap.get(e);if(t)return this._markEntryAsUsed(t),t.value}has(e){return this._keymap.has(e)}find(e){let t=this._keymap.get(e);return t?t.value:void 0}delete(e){let t=this._keymap.get(e);if(t)return this._keymap.delete(t.key),t[X]&&t[ef]?(t[ef][X]=t[X],t[X][ef]=t[ef]):t[X]?(t[X][ef]=void 0,this.oldest=t[X]):t[ef]?(t[ef][X]=void 0,this.newest=t[ef]):this.oldest=this.newest=void 0,this.size--,t.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new tf(this.oldest)}values(){return new nf(this.oldest)}entries(){return this[Symbol.iterator]()}[$d](){return new rf(this.oldest)}forEach(e,t){typeof t!=`object`&&(t=this);let n=this.oldest;for(;n;)e.call(t,n.value,n.key,this),n=n[X]}toJSON(){let e=Array(this.size),t=0,n=this.oldest;for(;n;)e[t++]={key:n.key,value:n.value},n=n[X];return e}toString(){let e=``,t=this.oldest;for(;t;)e+=`${String(t.key)}:${t.value}`,t=t[X],t&&(e+=` < `);return e}},sf=class{static hasLength(e,t){return e.length===t}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]`}};function cf(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<65||r>90)return-1;t=t*26+(r-64)}return t}let lf=1048576,uf=16384,df={sheetId:``,range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},ff={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},pf={startRow:0,startColumn:0,endRow:0,endColumn:0},mf={row:0,column:0},hf={ff:`Arial`,fs:11,it:z.FALSE,bl:z.FALSE,ul:{s:z.FALSE},st:{s:z.FALSE},ol:{s:z.FALSE},tr:{a:0,v:z.FALSE},td:Va.UNSPECIFIED,cl:{rgb:`#000000`},bg:{rgb:`#fff`},ht:Ua.UNSPECIFIED,vt:Wa.UNSPECIFIED,tb:Ga.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null,bd:{b:null,l:null,r:null,t:null}},gf=[N,te,ee],_f={[po.HEADING_1]:{fs:20,bl:1},[po.HEADING_2]:{fs:18,bl:1},[po.HEADING_3]:{fs:16,bl:1},[po.HEADING_4]:{fs:14,bl:1},[po.HEADING_5]:{fs:12,bl:1},[po.NORMAL_TEXT]:null,[po.TITLE]:{fs:26,bl:1},[po.SUBTITLE]:{fs:15,cl:{rgb:`#999999`}},[po.NAMED_STYLE_TYPE_UNSPECIFIED]:null},vf={[po.HEADING_1]:{spaceAbove:{v:20},spaceBelow:{v:10}},[po.HEADING_2]:{spaceAbove:{v:18},spaceBelow:{v:10}},[po.HEADING_3]:{spaceAbove:{v:16},spaceBelow:{v:10}},[po.HEADING_4]:{spaceAbove:{v:14},spaceBelow:{v:8}},[po.HEADING_5]:{spaceAbove:{v:12},spaceBelow:{v:8}},[po.NORMAL_TEXT]:{spaceAbove:{v:0},spaceBelow:{v:0}},[po.TITLE]:{spaceAbove:{v:0},spaceBelow:{v:7}},[po.SUBTITLE]:{spaceAbove:{v:0},spaceBelow:{v:16}},[po.NAMED_STYLE_TYPE_UNSPECIFIED]:null},yf=function(e){return e.ARRAY_CONVERTOR=`ARRAY_CONVERTOR`,e.MATRIX_CONVERTOR=`MATRIX_CONVERTOR`,e}({}),bf={[V.A3]:{width:1123,height:1587},[V.A4]:{width:794,height:1124},[V.A5]:{width:559,height:794},[V.B4]:{width:944,height:1344},[V.B5]:{width:665,height:944},[V.Executive]:{width:696,height:1008},[V.Folio]:{width:816,height:1248},[V.Legal]:{width:816,height:1344},[V.Letter]:{width:816,height:1056},[V.Statement]:{width:528,height:816},[V.Tabloid]:{width:1056,height:1632}};function xf(e,t){let{textRuns:n=[]}=t,r=0;for(let t of n){let{ts:n={},st:i,ed:a}=t;if(n[e]==null)return z.FALSE;switch(e){case`bl`:case`it`:if(n[e]===z.FALSE)return z.FALSE;break;case`ul`:case`st`:if(n[e].s===z.FALSE)return z.FALSE;break;default:throw Error(`unknown style key: ${e} in IStyleBase`)}r+=a-i}return t.dataStream.indexOf(`\r
|
|
3
|
-
`)===r?z.TRUE:z.FALSE}var Sf=class e{constructor(e,t,n){this._deps=n,F(this,`_range`,void 0),F(this,`_worksheet`,void 0),this._range=t,this._worksheet=e}static foreach(e,t){let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e;for(let e=n;e<=i;e++)for(let n=r;n<=a;n++)t(e,n)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i=[];for(let a=e;a<=t;a++){let e=[];for(let t=n;t<=r;t++)e.push(this.getMatrix().getValue(a,t)||null);i.push(e)}return i}getMatrix(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),a=new Gu;for(let o=e;o<=t;o++)for(let e=n;e<=r;e++)a.setValue(o,e,i.getValue(o,e)||null);return a}getMatrixObject(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),a=new Gu;for(let o=e;o<=t;o++)for(let t=n;t<=r;t++)a.setValue(o-e,t-n,i.getValue(o,t)||{});return a}getA1Notation(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i,a;return n<r?(i=L.numToWord(n+1)+(e+1),a=L.numToWord(r+1)+(t+1)):(i=L.numToWord(r+1)+(t+1),a=L.numToWord(n+1)+(e+1)),i===a?`${i}`:`${i}:${a}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){let e=this._deps.getStyles();return this.getValues().map(t=>t.map(t=>{var n;let r=e.getStyleByCell(t);return(r==null||(n=r.bg)==null?void 0:n.rgb)||hf.bg.rgb}))}getCell(t,n){let{startRow:r,startColumn:i}=this._range,a={startRow:r+t,endRow:r+t,startColumn:i+n,endColumn:i+n};return new e(this._worksheet,a,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(e={}){return this.getObjectValues(e)[0][0]}getObjectValues(e={}){let{startRow:t,endRow:n,startColumn:r,endColumn:i}=this._range,a=this._worksheet.getCellMatrix().getFragment(t,n,r,i).getData();if(e.isIncludeStyle){let e=this._deps.getStyles();for(let s=0;s<=n-t;s++)for(let t=0;t<=i-r;t++){var o;if(a==null||(a==null||(o=a[s])==null?void 0:o[t])==null)continue;let n=a[s][t].s;n&&(a[s][t].s=e.get(n))}}return a}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){let e=this._deps.getStyles();return this.getValues().map(t=>t.map(t=>{var n;let r=e.getStyleByCell(t);return(r==null||(n=r.cl)==null?void 0:n.rgb)||hf.cl.rgb}))}getFontFamilies(){return this._getStyles(`ff`)}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles(`ul`)}getUnderline(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?xf(`ul`,n.body)===z.TRUE?{s:z.TRUE}:{s:z.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles(`ol`)}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?xf(`st`,n.body)===z.TRUE?{s:z.TRUE}:{s:z.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles(`st`)}getFontSize(){var e,t;let n=((e=this.getValue())==null?void 0:e.p)||{};return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0&&n.body.textRuns.some(e=>{var t;return(e==null||(t=e.ts)==null?void 0:t.fs)!=null})?Math.max(...n.body.textRuns.map(e=>{var t;return(e==null||(t=e.ts)==null?void 0:t.fs)||0})):this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles(`fs`)}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles(`bd`)}getFontStyle(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?xf(`it`,n.body)===z.TRUE?Ka.ITALIC:Ka.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles(`it`)}getFontWeight(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?xf(`bl`,n.body)===z.TRUE?qa.BOLD:qa.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles(`bl`)}getGridId(){return this._worksheet.getSheetId()}getHeight(){let{_range:e,_worksheet:t}=this,{startRow:n,endRow:r}=e,i=0;for(let e=0;e<=r-n;e++){let n=t.getRowHeight(e);i+=n}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles(`ht`)}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){let{startColumn:e,endColumn:t}=this._range;return t-e+1}getNumRows(){let{startRow:e,endRow:t}=this._range;return t-e+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(e=>e.map(e=>(e==null?void 0:e.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(){let e=this._deps.getStyles();return this.getValues().map(t=>t.map(t=>e.getStyleByCell(t)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles(`vt`)}getWidth(){let{_range:e,_worksheet:t}=this,{startColumn:n,endColumn:r}=e,i=0;for(let e=0;e<=r-n;e++)i+=t.getColumnWidth(e);return i}getWrap(){return this.getWrapStrategy()===Ga.WRAP?z.TRUE:z.FALSE}getWrapStrategies(){return this._getStyles(`tb`)}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){e.foreach(this._range,t)}_getStyles(e){let t=this._deps.getStyles();return this.getValues().map(n=>n.map(n=>{let r=t&&t.getStyleByCell(n);return r&&r[e]||hf[e]}))}};F(Sf,`transformRange`,(e,t)=>{let n=t.getMaxColumns()-1,r=t.getMaxRows()-1;return e.rangeType===G.ALL?{startColumn:0,startRow:0,endColumn:n,endRow:r}:e.rangeType===G.COLUMN?{startRow:0,endRow:r,startColumn:e.startColumn,endColumn:e.endColumn}:e.rangeType===G.ROW?{startColumn:0,endColumn:n,startRow:e.startRow,endRow:e.endRow}:{startColumn:e.startColumn,endColumn:Math.min(e.endColumn,n),startRow:e.startRow,endRow:Math.min(e.endRow,r)}});function Cf(e,t,n=0,r=e.length-1,i=Tf){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);Cf(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(wf(e,n,t),i(e[r],a)>0&&wf(e,n,r);o<s;){for(wf(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?wf(e,n,s):(s++,wf(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function wf(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Tf(e,t){return e<t?-1:+(e>t)}var Ef=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,n=[];if(!Rf(e,t))return n;let r=this.toBBox,i=[];for(;t;){for(let a=0;a<t.children.length;a++){let o=t.children[a],s=t.leaf?r(o):o;Rf(e,s)&&(t.leaf?n.push(o):Lf(e,s)?this._all(o,n):i.push(o))}t=i.pop()}return n}collides(e){let t=this.data;if(!Rf(e,t))return!1;let n=[];for(;t;){for(let r=0;r<t.children.length;r++){let i=t.children[r],a=t.leaf?this.toBBox(i):i;if(Rf(e,a)){if(t.leaf||Lf(e,a))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=zf([]),this}remove(e,t){if(!e)return this;let n=this.data,r=this.toBBox(e),i=[],a=[],o,s,c;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],o=a.pop(),c=!0),n.leaf){let r=Df(e,n.children,t);if(r!==-1)return n.children.splice(r,1),i.push(n),this._condense(i),this}!c&&!n.leaf&&Lf(n,r)?(i.push(n),a.push(o),o=0,s=n,n=n.children[0]):s?(o++,n=s.children[o],c=!1):n=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){let i=n-t+1,a=this._maxEntries,o;if(i<=a)return o=zf(e.slice(t,n+1)),Of(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/a**(r-1))),o=zf([]),o.leaf=!1,o.height=r;let s=Math.ceil(i/a),c=s*Math.ceil(Math.sqrt(a));Bf(e,t,n,c,this.compareMinX);for(let i=t;i<=n;i+=c){let t=Math.min(i+c-1,n);Bf(e,i,t,s,this.compareMinY);for(let n=i;n<=t;n+=s){let i=Math.min(n+s-1,t);o.children.push(this._build(e,n,i,r-1))}}return Of(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!(t.leaf||r.length-1===n);){let n=1/0,r=1/0,i;for(let a=0;a<t.children.length;a++){let o=t.children[a],s=Nf(o),c=Ff(e,o)-s;c<r?(r=c,n=s<n?s:n,i=o):c===r&&s<n&&(n=s,i=o)}t=i||t.children[0]}return t}_insert(e,t,n){let r=n?e:this.toBBox(e),i=[],a=this._chooseSubtree(r,this.data,t,i);for(a.children.push(e),Af(a,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){let n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);let a=this._chooseSplitIndex(n,i,r),o=zf(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,Of(n,this.toBBox),Of(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(n,o)}_splitRoot(e,t){this.data=zf([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Of(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,a=1/0;for(let o=t;o<=n-t;o++){let t=kf(e,0,o,this.toBBox),s=kf(e,o,n,this.toBBox),c=If(t,s),l=Nf(t)+Nf(s);c<i?(i=c,r=o,a=l<a?l:a):c===i&&l<a&&(a=l,r=o)}return r||n-t}_chooseSplitAxis(e,t,n){let r=e.leaf?this.compareMinX:jf,i=e.leaf?this.compareMinY:Mf;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);let i=this.toBBox,a=kf(e,0,t,i),o=kf(e,n-t,n,i),s=Pf(a)+Pf(o);for(let r=t;r<n-t;r++){let t=e.children[r];Af(a,e.leaf?i(t):t),s+=Pf(a)}for(let r=n-t-1;r>=t;r--){let t=e.children[r];Af(o,e.leaf?i(t):t),s+=Pf(o)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)Af(t[r],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():Of(e[t],this.toBBox)}};function Df(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function Of(e,t){kf(e,0,e.children.length,t,e)}function kf(e,t,n,r,i){i||(i=zf(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let a=t;a<n;a++){let t=e.children[a];Af(i,e.leaf?r(t):t)}return i}function Af(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function jf(e,t){return e.minX-t.minX}function Mf(e,t){return e.minY-t.minY}function Nf(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Pf(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Ff(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function If(e,t){let n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function Lf(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Rf(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function zf(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Bf(e,t,n,r,i){let a=[t,n];for(;a.length;){if(n=a.pop(),t=a.pop(),n-t<=r)continue;let o=t+Math.ceil((n-t)/r/2)*r;Cf(e,o,t,n,i),a.push(t,o,o,n)}}function Vf(e,t,n,r=!1){if(t===0&&n===0)return e;let i={...e},a=i.startAbsoluteRefType||K.NONE,o=i.endAbsoluteRefType||K.NONE,s=i.rangeType||G.NORMAL;if(!r&&a===K.ALL&&o===K.ALL)return i;let c=Hf(i.startRow,n,i.startColumn,t,s),l=Hf(i.endRow,n,i.endColumn,t,s);return r||a===K.NONE&&o===K.NONE?i={...i,startRow:c.row,startColumn:c.column,endRow:l.row,endColumn:l.column}:(a===K.NONE?i={...i,startRow:c.row,startColumn:c.column}:a===K.COLUMN?i={...i,startRow:c.row}:a===K.ROW&&(i={...i,startColumn:c.column}),o===K.NONE?i={...i,endRow:l.row,endColumn:l.column}:o===K.COLUMN?i={...i,endRow:l.row}:o===K.ROW&&(i={...i,endColumn:l.column}),i)}function Hf(e,t,n,r,i){return i===G.NORMAL?{row:e+t,column:n+r}:i===G.ROW?{row:e+t,column:n}:i===G.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function Uf(e){let t=new Set,n=new Set;for(let r of e)t.add(r.startColumn),t.add(r.endColumn+1),n.add(r.startRow),n.add(r.endRow+1);let r=Array.from(t).sort((e,t)=>e-t),i=Array.from(n).sort((e,t)=>e-t);e.sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn);let a=[];for(let t=0;t<i.length-1;t++)for(let n=0;n<r.length-1;n++){let o=r[n],s=r[n+1]-1,c=i[t],l=i[t+1]-1;for(let t of e){if(t.startRow>l)break;if(t.startRow<=c&&t.endRow>=l&&t.startColumn<=o&&t.endColumn>=s){a.push({startColumn:o,endColumn:s,startRow:c,endRow:l});break}}}return a}function Wf(e){e.sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn);let t={};for(let n of e)t[n.startRow]||(t[n.startRow]=[]),t[n.startRow].push(n);let n=[];for(let e in t){let r=t[+e];r.sort((e,t)=>e.startColumn-t.startColumn);let i=r[0];for(let e=1;e<r.length;e++){let t=r[e];t.startColumn<=i.endColumn+1&&t.startRow===i.startRow&&t.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,t.endColumn):(n.push(i),i=t)}n.push(i)}return n}function Gf(e){e.sort((e,t)=>e.startColumn-t.startColumn||e.startRow-t.startRow);let t={};for(let n of e)t[n.startColumn]||(t[n.startColumn]=[]),t[n.startColumn].push(n);let n=[];for(let e in t){let r=t[+e];r.sort((e,t)=>e.startRow-t.startRow);let i=r[0];for(let e=1;e<r.length;e++){let t=r[e];t.startRow<=i.endRow+1&&t.startColumn===i.startColumn&&t.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,t.endRow):(n.push(i),i=t)}n.push(i)}return n}function Kf(e){return Gf(Wf(Uf(e)))}function qf(e,t){let n=[];return e.forEach(e=>{n.push(...Qf.subtract(e,t))}),Qf.mergeRanges(n)}function Jf(e,t){let n=Yf(e.startRow,e.endRow,t.startRow,t.endRow),r=Yf(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;let[i,a]=n,[o,s]=r;return{startRow:i,endRow:a,startColumn:o,endColumn:s,rangeType:Xf(e.rangeType,t.rangeType,i,a,o,s)}}function Yf(e,t,n,r){let i=isNaN(e)?-1/0:e,a=isNaN(t)?1/0:t,o=isNaN(n)?-1/0:n,s=isNaN(r)?1/0:r,c=Math.max(i,o),l=Math.min(a,s);return c<=l?[c===-1/0?NaN:c,l===1/0?NaN:l]:null}function Xf(e,t,n,r,i,a){let o=e===void 0?Zf(n,r,i,a):e,s=t===void 0?Zf(n,r,i,a):t;return o===G.ALL||s===G.ALL?o===s?o:o===G.ALL?s:o:o===s?o:(o===G.NORMAL||G.NORMAL,G.NORMAL)}function Zf(e,t,n,r){let i=!isNaN(e)&&!isNaN(t),a=!isNaN(n)&&!isNaN(r);return i&&a?G.NORMAL:i?G.ROW:a?G.COLUMN:G.ALL}var Qf=class e{static clone(e){return e.rangeType===void 0?{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn}:{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType}}static equals(e,t){return e==null||t==null?!1:e.endRow===t.endRow&&e.endColumn===t.endColumn&&e.startRow===t.startRow&&e.startColumn===t.startColumn&&(e.rangeType===t.rangeType||e.rangeType===void 0&&t.rangeType===G.NORMAL||t.rangeType===void 0&&e.rangeType===G.NORMAL)}static simpleRangesIntersect(e,t){let{startRow:n,endRow:r,startColumn:i,endColumn:a}=e,{startRow:o,endRow:s,startColumn:c,endColumn:l}=t;return n<=s&&r>=o&&i<=l&&a>=c}static intersects(e,t){if(e.rangeType===G.ROW&&t.rangeType===G.COLUMN||e.rangeType===G.COLUMN&&t.rangeType===G.ROW)return!0;if(e.rangeType===G.ROW&&t.rangeType===G.ROW)return e.startRow<=t.endRow&&e.endRow>=t.startRow;if(e.rangeType===G.COLUMN&&t.rangeType===G.COLUMN)return e.startColumn<=t.endColumn&&e.endColumn>=t.startColumn;let n=Number.isNaN(e.startRow)?0:e.startRow,r=Number.isNaN(e.endRow)?lf-1:e.endRow,i=Number.isNaN(e.startColumn)?0:e.startColumn,a=Number.isNaN(e.endColumn)?uf-1:e.endColumn,o=Number.isNaN(t.startRow)?0:t.startRow,s=Number.isNaN(t.endRow)?lf-1:t.endRow,c=Number.isNaN(t.startColumn)?0:t.startColumn,l=Number.isNaN(t.endColumn)?uf-1:t.endColumn,u=Math.abs(i+a-c-l),d=Math.abs(i-a)+Math.abs(c-l),f=Math.abs(n+r-o-s),p=Math.abs(n-r)+Math.abs(o-s);return u<=d&&f<=p}static doAnyRangesIntersect(e,t){let n=new Ef;return n.load(e.map(e=>({minX:e.startColumn,minY:e.startRow,maxX:e.endColumn,maxY:e.endRow}))),t.some(e=>n.search({minX:e.startColumn,minY:e.startRow,maxX:e.endColumn,maxY:e.endRow}).length>0)}static getIntersects(e,t){let n=e.startRow,r=e.endRow,i=e.startColumn,a=e.endColumn,o=t.startRow,s=t.endRow,c=t.startColumn,l=t.endColumn,u,d,f,p;if(o<=r)d=o>=n?o:n;else return null;if(s>=n)p=s>=r?r:s;else return null;if(c<=a)u=c>i?c:i;else return null;if(l>=i)f=l>=a?a:l;else return null;return{startRow:d,endRow:p,startColumn:u,endColumn:f,rangeType:G.NORMAL}}static contains(e,t){return e.startRow<=t.startRow&&e.endRow>=t.endRow&&e.startColumn<=t.startColumn&&e.endColumn>=t.endColumn}static realContain(t,n){return e.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...e){return e.reduce((e,t)=>({startRow:Math.min(e.startRow,t.startRow),startColumn:Math.min(e.startColumn,t.startColumn),endRow:Math.max(e.endRow,t.endRow),endColumn:Math.max(e.endColumn,t.endColumn),rangeType:G.NORMAL}),e[0])}static realUnion(...t){let n=t.some(e=>e.rangeType===G.COLUMN),r=t.some(e=>e.rangeType===G.ROW),i=e.union(...t);return{startColumn:r?NaN:i.startColumn,endColumn:r?NaN:i.endColumn,startRow:n?NaN:i.startRow,endRow:n?NaN:i.endRow,rangeType:r?G.ROW:n?G.COLUMN:G.NORMAL}}static subtract(e,t){if(t.startRow>e.endRow||t.endRow<e.startRow||t.startColumn>e.endColumn||t.endColumn<e.startColumn)return[e];let n=[];t.startRow>=e.startRow&&n.push({startRow:e.startRow,startColumn:e.startColumn,endRow:t.startRow-1,endColumn:e.endColumn}),t.endRow<=e.endRow&&n.push({startRow:t.endRow+1,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn});let r=Math.max(e.startRow,t.startRow),i=Math.min(e.endRow,t.endRow);return t.startColumn>=e.startColumn&&n.push({startRow:r,startColumn:e.startColumn,endRow:i,endColumn:t.startColumn-1}),t.endColumn<=e.endColumn&&n.push({startRow:r,startColumn:t.endColumn+1,endRow:i,endColumn:e.endColumn}),n.filter(e=>e.startRow<=e.endRow&&e.startColumn<=e.endColumn)}static mergeRanges(e){return Kf(e)}static splitIntoGrid(e){return Uf(e)}static subtractMulti(e,t){if(!t.length)return e;let n=e;return t.forEach(e=>{n=qf(n,e)}),n}static hasIntersectionBetweenTwoRect(e,t){return!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)}static getIntersectionBetweenTwoRect(e,t){let n=Math.max(e.left,t.left),r=Math.min(e.right,t.right),i=Math.max(e.top,t.top),a=Math.min(e.bottom,t.bottom);return r<=n||a<=i?null:{left:n,right:r,top:i,bottom:a,width:r-n,height:a-i}}static sort(e){return e.sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn)}};F(Qf,`getRelativeRange`,(e,t)=>({startRow:e.startRow-t.startRow,endRow:e.endRow-e.startRow,startColumn:e.startColumn-t.startColumn,endColumn:e.endColumn-e.startColumn})),F(Qf,`getPositionRange`,(e,t,n)=>({...n||{},startRow:n&&[K.ROW,K.ALL].includes(n.startAbsoluteRefType||0)?n.startRow:e.startRow+t.startRow,endRow:n&&[K.ROW,K.ALL].includes(n.endAbsoluteRefType||0)?n.endRow:e.endRow+e.startRow+t.startRow,startColumn:n&&[K.COLUMN,K.ALL].includes(n.startAbsoluteRefType||0)?n.startColumn:e.startColumn+t.startColumn,endColumn:n&&[K.COLUMN,K.ALL].includes(n.endAbsoluteRefType||0)?n.endColumn:e.endColumn+e.startColumn+t.startColumn})),F(Qf,`moveHorizontal`,(e,t=0,n=0)=>({...e,startColumn:e.startColumn+t,endColumn:e.endColumn+t+n})),F(Qf,`moveVertical`,(e,t=0,n=0)=>({...e,startRow:e.startRow+t,endRow:e.endRow+t+n})),F(Qf,`moveOffset`,(e,t,n)=>{let r={...e};switch(e.startAbsoluteRefType){case K.ROW:r.startColumn+=t;break;case K.COLUMN:r.startRow+=n;break;case K.ALL:break;case K.NONE:default:r.startRow+=n,r.startColumn+=t;break}switch(e.endAbsoluteRefType){case K.ROW:r.endColumn+=t;break;case K.COLUMN:r.endRow+=n;break;case K.ALL:break;case K.NONE:default:r.endRow+=n,r.endColumn+=t;break}return r});function $f(e,t){if(e.length===0||e[0].length===0)return null;let n=Array(e[0].length).fill(0),r=0,i=null;for(let a=0;a<e.length;a++){for(let r=0;r<e[0].length;r++)n[r]=t(e[a][r])?n[r]+1:0;let o=ep(n);o.area>r&&(r=o.area,i={startColumn:o.start,startRow:a-o.height+1,endColumn:o.end,endRow:a})}return i}function ep(e){let t=[],n=0,r={area:0,height:0,start:0,end:0},i=0;for(;i<e.length;)if(t.length===0||e[i]>=e[t[t.length-1]])t.push(i++);else{let a=e[t.pop()],o=t.length===0?i:i-t[t.length-1]-1;a*o>n&&(n=a*o,r={area:n,height:a,start:t.length===0?0:t[t.length-1]+1,end:i-1})}for(;t.length>0;){let a=e[t.pop()],o=t.length===0?i:i-t[t.length-1]-1;a*o>n&&(n=a*o,r={area:n,height:a,start:t.length===0?0:t[t.length-1]+1,end:i-1})}return r}function tp(e,t){Sf.foreach(t,(t,n)=>{e[t][n]=void 0})}function np(e,t){let n=e.toFullArray(),r=[];for(;;){let e=$f(n,t);if(!e)break;r.push(e),tp(n,e)}return r}var rp=class{constructor(e,t){F(this,`_values`,[]),F(this,`_keys`,[]),F(this,`_keyMaps`,new Map),this._values=e,this._keys=t,e.forEach(e=>{this._initKeyMap(e)})}_initKeyMap(e){this._keys.forEach(t=>{let n=e[t],r=this._keyMaps.get(t)||new Map;r.set(n,e),this._keyMaps.set(t,r)})}getValue(e,t){let n=t||this._keys;for(let t=0;t<n.length;t++){let r=this._keyMaps.get(n[t]);if(r!=null&&r.has(e))return r.get(e)}return null}hasValue(e){for(let t=0;t<this._keys.length;t++){let n=this._keyMaps.get(this._keys[t]);if(n!=null&&n.has(e))return!0}return!1}addValue(e){this._values.push(e),this._initKeyMap(e)}setValue(e,t,n){let r=this.getValue(e);r&&Object.keys(r).includes(t)&&(r[t]=n)}deleteValue(e,t){let n=this.getValue(e,t);if(n){this._keys.forEach(e=>{let t=this._keyMaps.get(e),r=n[e];t==null||t.delete(r)});let e=this._values.findIndex(e=>e===n);this._values.splice(e,1)}}getValues(){return this._values}getKeyMap(e){var t;return[...((t=this._keyMaps.get(e))==null?void 0:t.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}};function ip(e,t,n,r){return{forEach(i){for(let a=e;a<=t;a++)for(let e=n;e<=r;e++)i(a,e)}}}function ap(e){if(e==null||e.length===0)return NaN;let t=e.toLowerCase().split(``),n=t.length,r=e=>e.charCodeAt(0)-96,i=0,a=0;for(let e=0;e<n;e++)a=r(t[e]),i+=a*26**(n-e-1);return i===0?NaN:i-1}function op(e){let t=``;for(;e>=0;)t=String.fromCharCode(e%26+65)+t,e=Math.floor(e/26)-1;return t}function sp(e,t){let n=``;for(;t>0;)n+=e,t--;return n}function cp(e,t=!1){let n=97;return t&&(n=65),sp(String.fromCharCode(e%26+n),Math.floor(e/26)+1)}function lp(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function up(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function dp(e=`index`,t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}function fp(e,t=!1){let n=[];for(let r of e){let{st:e,ed:i,ts:a}=r;if(r.sId===void 0&&delete r.sId,e===i||!t&&L.isEmptyObject(a)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}let o=n.pop();ld(r,o)&&L.hasIntersectionBetweenTwoRanges(o.st,o.ed,r.st,r.ed)?n.push({...r,st:o.st,ed:i}):n.push(o,r)}return n}function pp(e,t,n,r){var i;let{textRuns:a}=e;if(a==null)return;let o=[],s=a.length,c=!1,l=(i=t.textRuns)==null?[]:i;if(l.length)for(let e of l)e.st+=r,e.ed+=r;for(let e=0;e<s;e++){let t=a[e],{st:i,ed:s}=t;if(s<=r)o.push(t);else if(r>i&&r<s){c=!0;let e={...t,ed:r};o.push(e),l.length&&o.push(...l);let i={...t,st:r+n,ed:s+n};o.push(i)}else t.st+=n,t.ed+=n,c||(c=!0,o.push(...l)),o.push(t)}c||(c=!0,o.push(...l)),e.textRuns=fp(o)}function mp(e,t,n,r){let{paragraphs:i}=e;if(i==null)return;let{paragraphs:a}=t,o=[],s=-1;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n),s===-1&&a>=r&&(s=e),o.push(t.startIndex)}let c=-1;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r;let n=t.startIndex;c=o.indexOf(n)}c!==-1&&i.splice(c,1),i.push(...a),i.sort(dp(`startIndex`))}}function hp(e,t,n,r){let{sectionBreaks:i}=e;if(i==null)return;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n)}let a=t.sectionBreaks;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r}i.push(...a),i.sort(dp(`startIndex`))}}function gp(e,t,n,r){let{customBlocks:i=[]}=e;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n)}let a=t.customBlocks;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r}i.push(...a),i.sort(dp(`startIndex`))}i.length&&!e.customBlocks&&(e.customBlocks=i)}function _p(e,t,n,r){let{tables:i}=e;if(i==null)return;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a,endIndex:o}=t;a>r?(t.startIndex+=n,t.endIndex+=n):o>r&&(t.endIndex+=n)}let a=t.tables;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r,t.endIndex+=r}i.push(...a),i.sort(dp(`startIndex`))}}let vp=e=>e.split(`$`)[0];function yp(e){if(e.length<=1)return e;e.sort((e,t)=>e.startIndex-t.startIndex);let t=[],n={...e[0]};n.rangeId=vp(n.rangeId);for(let r=1;r<e.length;r++){let i=e[r];i.rangeId=vp(i.rangeId),i.rangeId===n.rangeId&&ce(n.properties,i.properties)&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}t.push(n);let r=Object.create(null);for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.rangeId;r[i]?(n.rangeId=`${i}\$${r[i]}`,r[i]=r[i]+1):r[i]=1}return t}function bp(e,t){let n=e.findIndex(e=>e.startIndex<t&&e.endIndex>=t),r=e[n];r&&e.splice(n,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:t-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:t,endIndex:r.endIndex,properties:{...r.properties}})}function xp(e){if(e.length<=1)return e;e.sort((e,t)=>e.startIndex-t.startIndex);let t=[],n={...e[0]};for(let r=1;r<e.length;r++){let i=e[r];i.id===n.id&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}return t.push(n),t}function Sp(e,t){e.filter(e=>e.startIndex<t&&e.endIndex>=t).forEach(n=>{let r=e.indexOf(n);e.splice(r,1,{id:n.id,type:n.type,startIndex:n.startIndex,endIndex:t-1},{id:n.id,type:n.type,startIndex:t,endIndex:n.endIndex})})}function Cp(e,t,n,r){e.customRanges||(e.customRanges=[]);let{customRanges:i}=e;bp(i,r);for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n,t.endIndex+=n)}let a=[];if(t.customRanges){for(let e=0,n=t.customRanges.length;e<n;e++){let n=t.customRanges[e];n.startIndex+=r,n.endIndex+=r,a.push(n)}i.push(...a)}e.customRanges=yp(i)}function wp(e,t,n,r){e.customDecorations||(e.customDecorations=[]);let{customDecorations:i}=e;Sp(i,r);for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n,t.endIndex+=n)}let a=[];if(t.customDecorations){for(let e=0,n=t.customDecorations.length;e<n;e++){let n=t.customDecorations[e];n.startIndex+=r,n.endIndex+=r,a.push(n)}i.push(...a)}e.customDecorations=xp(i)}function Tp(e,t,n){let{textRuns:r}=e,i=n,a=n+t,o=[];if(r){let n=[];for(let e=0,s=r.length;e<s;e++){let s=r[e],{st:c,ed:l}=s;if(i<=c&&a>=l){o.push({...s,st:c-i,ed:l-i});continue}else c<=i&&l>=a?(o.push({...s,st:i-i,ed:a-i}),s.ed-=t):i>=c&&i<l?(o.push({...s,st:i-i,ed:l-i}),s.ed=i):a>c&&a<=l?(o.push({...s,st:c-i,ed:a-i}),s.st=a-t,s.ed-=t):c>=a&&(s.st-=t,s.ed-=t);n.push(s)}e.textRuns=n}return o.length===0&&o.push({st:0,ed:t,ts:{}}),o}function Ep(e,t,n){let{paragraphs:r}=e,i=n,a=n+t,o=[],s=null,c=!1;if(r){let l=[];for(let e=0,u=r.length;e<u;e++){let u=r[e],{startIndex:d}=u;if(d>=i&&d<a){o.push({...u,startIndex:d-n}),c=!0;continue}else d>=a&&(u.startIndex-=t);l.push(u),s==null&&c&&(s=u)}e.paragraphs=l}return o}function Dp(e,t,n){let{sectionBreaks:r}=e,i=n,a=n+t-1,o=[];if(r){let s=[];for(let e=0,c=r.length;e<c;e++){let c=r[e],{startIndex:l}=c;if(l>=i&&l<=a){o.push({...c,startIndex:l-n});continue}else l>a&&(c.startIndex-=t);s.push(c)}e.sectionBreaks=s}return o}function Op(e,t,n){let{customBlocks:r=[]}=e,i=n,a=n+t-1,o=[];if(r){let s=[];for(let e=0,c=r.length;e<c;e++){let c=r[e],{startIndex:l}=c;if(l>=i&&l<=a){o.push({...c,startIndex:l-n});continue}else l>a&&(c.startIndex-=t);s.push(c)}e.customBlocks=s}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function kp(e,t,n){let{tables:r}=e,i=n,a=n+t-1,o=[];if(r){let s=[];for(let e=0,c=r.length;e<c;e++){let c=r[e],{startIndex:l,endIndex:u}=c;if(i<=l&&a>=u){o.push({...c,startIndex:l-n,endIndex:u-n});continue}else if(l<=i&&u>=a){let e=zd(l,u,i,a);if(e.length===0||(c.startIndex=e[0],c.endIndex=e[1],c.startIndex===c.endIndex))continue}else a<l&&(c.startIndex-=t,c.endIndex-=t);s.push(c)}e.tables=s}return o}function Ap(e,t,n){let{customRanges:r}=e,i=n,a=n+t-1,o=[];if(r){let n=[];for(let e=0,s=r.length;e<s;e++){let s=r[e],{startIndex:c,endIndex:l}=s;if(c>=i&&l<=a){o.push(s);continue}else if(Math.max(i,c)<=Math.min(a,l)){let e=zd(c,l,i,a);if(e.length===0)continue;s.startIndex=e[0],s.endIndex=e[1]}else a<c&&(s.startIndex-=t,s.endIndex-=t);n.push(s)}e.customRanges=yp(n)}return o}function jp(e,t,n,r=!0){let{customDecorations:i}=e,a=n,o=n+t-1,s=[];if(i){let n=[];for(let e=0,c=i.length;e<c;e++){let c=i[e],{startIndex:l,endIndex:u}=c;if(l>=a&&u<=o){s.push(c);continue}else if(Math.max(a,l)<=Math.min(o,u)){let e=zd(l,u,a,o);if(e.length===0)continue;c.startIndex=e[0],c.endIndex=e[1]}else o<l&&r&&(c.startIndex-=t,c.endIndex-=t);n.push(c)}e.customDecorations=n}return s}let Mp=function(e){return e.ORDER_LIST_QUICK_1=`1.`,e.ORDER_LIST_QUICK_2=`a)`,e.ORDER_LIST_QUICK_3=`a.`,e.ORDER_LIST_QUICK_4=`i.`,e.ORDER_LIST_QUICK_5=`A.`,e.ORDER_LIST_QUICK_6=`I.`,e.ORDER_LIST_QUICK_7=`01.`,e.BULLET_LIST=`*`,e}({}),Z=function(e){return e.BULLET_LIST=`BULLET_LIST`,e.BULLET_LIST_1=`BULLET_LIST_1`,e.BULLET_LIST_2=`BULLET_LIST_2`,e.BULLET_LIST_3=`BULLET_LIST_3`,e.BULLET_LIST_4=`BULLET_LIST_4`,e.BULLET_LIST_5=`BULLET_LIST_5`,e.ORDER_LIST=`ORDER_LIST`,e.ORDER_LIST_1=`ORDER_LIST_1`,e.ORDER_LIST_2=`ORDER_LIST_2`,e.ORDER_LIST_3=`ORDER_LIST_3`,e.ORDER_LIST_4=`ORDER_LIST_4`,e.ORDER_LIST_5=`ORDER_LIST_5`,e.ORDER_LIST_QUICK_2=`ORDER_LIST_QUICK_2`,e.ORDER_LIST_QUICK_3=`ORDER_LIST_QUICK_3`,e.ORDER_LIST_QUICK_4=`ORDER_LIST_QUICK_4`,e.ORDER_LIST_QUICK_5=`ORDER_LIST_QUICK_5`,e.ORDER_LIST_QUICK_6=`ORDER_LIST_QUICK_6`,e.CHECK_LIST=`CHECK_LIST`,e.CHECK_LIST_CHECKED=`CHECK_LIST_CHECKED`,e}({}),Np={"a)":{glyphFormat:`%1)`,glyphType:B.DECIMAL},"1.":{glyphFormat:`%1.`,glyphType:B.DECIMAL},"a.":{glyphFormat:`%1.`,glyphType:B.LOWER_LETTER},"A.":{glyphFormat:`%1.`,glyphType:B.UPPER_LETTER},"i.":{glyphFormat:`%1.`,glyphType:B.LOWER_ROMAN},"I.":{glyphFormat:`%1.`,glyphType:B.UPPER_LETTER}},Pp=e=>[...e,...e,...e].map((e,t)=>({glyphFormat:` %${t+1}`,glyphSymbol:e,bulletAlignment:eo.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),Fp=e=>e.map((e,t)=>({...e,bulletAlignment:eo.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),Ip=(e,t)=>Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:eo.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),Lp={[Z.BULLET_LIST]:{listType:Z.BULLET_LIST,nestingLevel:Pp([`●`,`○`,`■`])},[Z.BULLET_LIST_1]:{listType:Z.BULLET_LIST,nestingLevel:Pp([`❖`,`➢`,`■`])},[Z.BULLET_LIST_2]:{listType:Z.BULLET_LIST,nestingLevel:Pp([`✔`,`●`,`◆`])},[Z.BULLET_LIST_3]:{listType:Z.BULLET_LIST,nestingLevel:Pp([`■`,`◆`,`○`])},[Z.BULLET_LIST_4]:{listType:Z.BULLET_LIST,nestingLevel:Pp([`✧`,`○`,`■`])},[Z.BULLET_LIST_5]:{listType:Z.BULLET_LIST,nestingLevel:Pp([`➢`,`○`,`◆`])},[Z.ORDER_LIST]:{listType:Z.ORDER_LIST,nestingLevel:Fp([{glyphFormat:`%1.`,glyphType:B.DECIMAL},{glyphFormat:`%2.`,glyphType:B.LOWER_LETTER},{glyphFormat:`%3.`,glyphType:B.LOWER_ROMAN},{glyphFormat:`%4.`,glyphType:B.DECIMAL},{glyphFormat:`%5.`,glyphType:B.LOWER_LETTER},{glyphFormat:`%6.`,glyphType:B.LOWER_ROMAN},{glyphFormat:`%7.`,glyphType:B.DECIMAL},{glyphFormat:`%8.`,glyphType:B.LOWER_LETTER},{glyphFormat:`%9.`,glyphType:B.LOWER_ROMAN}])},[Z.ORDER_LIST_1]:{listType:Z.ORDER_LIST,nestingLevel:Fp([{glyphFormat:`%1)`,glyphType:B.DECIMAL},{glyphFormat:`%2)`,glyphType:B.LOWER_LETTER},{glyphFormat:`%3)`,glyphType:B.LOWER_ROMAN},{glyphFormat:`%4)`,glyphType:B.DECIMAL},{glyphFormat:`%5)`,glyphType:B.LOWER_LETTER},{glyphFormat:`%6)`,glyphType:B.LOWER_ROMAN},{glyphFormat:`%7)`,glyphType:B.DECIMAL},{glyphFormat:`%8)`,glyphType:B.LOWER_LETTER},{glyphFormat:`%9)`,glyphType:B.LOWER_ROMAN}])},[Z.ORDER_LIST_2]:{listType:Z.ORDER_LIST,nestingLevel:Fp([`%1.`,`%1.%2.`,`%1.%2.%3.`,`%1.%2.%3.%4.`,`%1.%2.%3.%4.%5.`,`%1.%2.%3.%4.%5.%6.`,`%1.%2.%3.%4.%5.%6.%7.`].map(e=>({glyphFormat:e,glyphType:B.DECIMAL})))},[Z.ORDER_LIST_3]:{listType:Z.ORDER_LIST,nestingLevel:Fp([{glyphFormat:`%1.`,glyphType:B.UPPER_LETTER},{glyphFormat:`%2.`,glyphType:B.LOWER_LETTER},{glyphFormat:`%3.`,glyphType:B.LOWER_ROMAN},{glyphFormat:`%4.`,glyphType:B.UPPER_LETTER},{glyphFormat:`%5.`,glyphType:B.LOWER_LETTER},{glyphFormat:`%6.`,glyphType:B.LOWER_ROMAN},{glyphFormat:`%7.`,glyphType:B.UPPER_LETTER},{glyphFormat:`%8.`,glyphType:B.LOWER_LETTER},{glyphFormat:`%9.`,glyphType:B.LOWER_ROMAN}])},[Z.ORDER_LIST_4]:{listType:Z.ORDER_LIST,nestingLevel:Fp([{glyphFormat:`%1.`,glyphType:B.UPPER_LETTER},{glyphFormat:`%2.`,glyphType:B.DECIMAL},{glyphFormat:`%3.`,glyphType:B.LOWER_ROMAN},{glyphFormat:`%4.`,glyphType:B.UPPER_LETTER},{glyphFormat:`%5.`,glyphType:B.DECIMAL},{glyphFormat:`%6.`,glyphType:B.LOWER_ROMAN},{glyphFormat:`%7.`,glyphType:B.UPPER_LETTER},{glyphFormat:`%8.`,glyphType:B.DECIMAL},{glyphFormat:`%9.`,glyphType:B.LOWER_ROMAN}])},[Z.ORDER_LIST_5]:{listType:Z.ORDER_LIST,nestingLevel:Fp([{glyphFormat:`%1.`,glyphType:B.DECIMAL_ZERO},{glyphFormat:`%2.`,glyphType:B.LOWER_LETTER},{glyphFormat:`%3.`,glyphType:B.LOWER_ROMAN},{glyphFormat:`%4.`,glyphType:B.DECIMAL_ZERO},{glyphFormat:`%5.`,glyphType:B.LOWER_LETTER},{glyphFormat:`%6.`,glyphType:B.LOWER_ROMAN},{glyphFormat:`%7.`,glyphType:B.DECIMAL_ZERO},{glyphFormat:`%8.`,glyphType:B.LOWER_LETTER},{glyphFormat:`%9.`,glyphType:B.LOWER_ROMAN}])},[Z.CHECK_LIST]:{listType:Z.CHECK_LIST,nestingLevel:Ip(`☐`)},[Z.CHECK_LIST_CHECKED]:{listType:Z.CHECK_LIST_CHECKED,nestingLevel:Ip(`☑`,{st:{s:z.TRUE}})}},Rp=e=>{let{glyphFormat:t,glyphType:n}=e,r=L.deepClone(Lp[Z.ORDER_LIST]);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},zp={[Z.ORDER_LIST_QUICK_2]:Rp(Np[Mp.ORDER_LIST_QUICK_2]),[Z.ORDER_LIST_QUICK_3]:Rp(Np[Mp.ORDER_LIST_QUICK_3]),[Z.ORDER_LIST_QUICK_4]:Rp(Np[Mp.ORDER_LIST_QUICK_4]),[Z.ORDER_LIST_QUICK_6]:Rp(Np[Mp.ORDER_LIST_QUICK_6])};Object.assign(Lp,zp);let Bp={[Mp.ORDER_LIST_QUICK_1]:Z.ORDER_LIST,[Mp.ORDER_LIST_QUICK_2]:Z.ORDER_LIST_QUICK_2,[Mp.ORDER_LIST_QUICK_3]:Z.ORDER_LIST_QUICK_3,[Mp.ORDER_LIST_QUICK_4]:Z.ORDER_LIST_QUICK_4,[Mp.ORDER_LIST_QUICK_5]:Z.ORDER_LIST_3,[Mp.ORDER_LIST_QUICK_6]:Z.ORDER_LIST_QUICK_6,[Mp.ORDER_LIST_QUICK_7]:Z.ORDER_LIST_5,[Mp.BULLET_LIST]:Z.BULLET_LIST};function Vp(e,t,n,r,i){return{dataStream:``,textRuns:Hp(e,t,n,r,i),paragraphs:Wp(e,t,n,r,i),sectionBreaks:Gp(e,t,n,r,i),customBlocks:Kp(e,t,n,r,i),tables:qp(e,t,n,r,i),customRanges:Jp(e,t,n,r,i),customDecorations:Yp(e,t,n,r,i)}}function Hp(e,t,n,r,i){let{textRuns:a}=e,{textRuns:o}=t;if(a==null||o==null)return;let s=Tp(e,n,r);return i!==H.REPLACE&&(t.textRuns=Up(o,s,i)),pp(e,t,n,r),s}function Up(e,t,n){if(t.length===0)return e;e=L.deepClone(e),t=L.deepClone(t);let r=[],i=e.length,a=t.length,o=0,s=0,c=null;function l(){return c?(r.push(c),c=null,!0):!1}for(;o<i&&s<a;){let{st:i,ed:a,ts:u}=e[o],{st:d,ed:f,ts:p,sId:m}=t[s],h;if(h=n===H.COVER?{...p,...u}:{...u},a<d)l()||r.push(e[o]),o++;else if(f<i)l()||r.push(t[s]),s++;else{let n={st:Math.min(i,d),ed:Math.max(i,d),ts:i<d?{...u}:{...p},sId:i<d?void 0:m};n.ed>n.st&&r.push(n),r.push({st:Math.max(i,d),ed:Math.min(a,f),ts:h,sId:m}),a<f?(o++,t[s].st=a,t[s].st===t[s].ed&&s++):(s++,e[o].st=f,e[o].st===e[o].ed&&o++);let l={st:Math.min(a,f),ed:Math.max(a,f),ts:a<f?{...p}:{...u},sId:a<f?m:void 0};c=l.ed>l.st?l:null}}l();let u=r[r.length-1],d=e[i-1],f=t[a-1];return u&&u.ed!==Math.max(d.ed,f.ed)&&(d.ed>f.ed?r.push(d):r.push(f)),fp(r)}function Wp(e,t,n,r,i){let{paragraphs:a}=e,{paragraphs:o}=t;if(a==null||o==null)return;let s=Ep(e,n,r);if(i!==H.REPLACE){let e=[];for(let t of o){let{startIndex:n,paragraphStyle:r,bullet:a}=t,o=[];for(let e of s){let{startIndex:t,paragraphStyle:s,bullet:c}=e,l,u;if(i===H.COVER?(l={...s,...r},u={listId:``,listType:Z.BULLET_LIST,nestingLevel:0,textStyle:{},...c,...a}):(l={...r,...s},u={listId:``,listType:Z.BULLET_LIST,nestingLevel:0,textStyle:{},...a,...c}),n===t){o.push({startIndex:n,paragraphStyle:l,bullet:u});break}}e.push(...o),o=[]}t.paragraphs=e}return mp(e,t,n,r),s}function Gp(e,t,n,r,i){let{sectionBreaks:a}=e,{sectionBreaks:o}=t;if(a==null||o==null)return;let s=Dp(e,n,r);if(i!==H.REPLACE){let e=[];for(let t of o){let{startIndex:n}=t,r=[];for(let e of s){let{startIndex:a}=e;if(n===a){i===H.COVER?r.push({...e,...t}):r.push({...t,...e});break}}e.push(...r),r=[]}t.sectionBreaks=e}return hp(e,t,n,r),s}function Kp(e,t,n,r,i){let{customBlocks:a=[]}=e,{customBlocks:o}=t;if(a==null||o==null)return;let s=Op(e,n,r);if(i!==H.REPLACE){let e=[];for(let t of o){let{startIndex:n}=t,r=[];for(let e of s){let{startIndex:a}=e;if(n===a){i===H.COVER?r.push({...e,...t}):r.push({...t,...e});break}}e.push(...r),r=[]}t.customBlocks=e}return gp(e,t,n,r),a.length&&!e.customBlocks&&(e.customBlocks=a),s}function qp(e,t,n,r,i){let{tables:a}=e,{tables:o}=t;if(a==null||o==null)return;let s=kp(e,n,r);if(i!==H.REPLACE){let e=[];for(let t of o){let{startIndex:n,endIndex:r}=t,a=[];for(let e of s){let{startIndex:o,endIndex:s}=e;if(o>=n&&s<=r){i===H.COVER?a.push({...e,...t}):a.push({...t,...e});break}}e.push(...a),a=[]}t.tables=e}return _p(e,t,n,r),s}function Jp(e,t,n,r,i){e.customRanges||(e.customRanges=[]),bp(e.customRanges,r),bp(e.customRanges,r+n);let a=r,o=r+n-1,{customRanges:s}=t,c=[],l=new Map;return e.customRanges.forEach(e=>{let{startIndex:t,endIndex:n}=e;t>=a&&n<=o?l.set(e.rangeId,e):c.push(e)}),s?(s.forEach(e=>{let{startIndex:t,endIndex:n}=e;c.push({...e,startIndex:t+r,endIndex:n+r})}),e.customRanges=yp(c),[]):[]}function Yp(e,t,n,r,i){e.customDecorations||(e.customDecorations=[]),Sp(e.customDecorations,r),Sp(e.customDecorations,r+n);let a=[],{customDecorations:o}=e,{customDecorations:s=[]}=t;if(i===H.REPLACE){for(let e=0;e<o.length;e++){let t=o[e],{startIndex:i,endIndex:s}=t;i>=r&&s<=r+n-1&&a.push(t)}s.forEach(e=>{let{startIndex:t,endIndex:n}=e;o.push({...e,startIndex:t+r,endIndex:n+r})})}else for(let e of s){let{id:t}=e;if(e.type===no.DELETED){let e=o.filter(e=>e.id===t);e.length&&a.push(...e)}else o.push({...e,startIndex:e.startIndex+r,endIndex:e.endIndex+r})}for(let e of a){let{id:t}=e,n=o.findIndex(e=>e.id===t);n!==-1&&o.splice(n,1)}return e.customDecorations=xp(o),a}let Xp=function(e){return e[e.copy=0]=`copy`,e[e.cut=1]=`cut`,e}({});function Zp(e,t,n,r=!0){let{textRuns:i}=e;if(i){let e=[];for(let r of i){let i=L.deepClone(r),{st:a,ed:o}=i;L.hasIntersectionBetweenTwoRanges(a,o,t,n)&&(t>=a&&t<=o?e.push({...i,st:t,ed:Math.min(n,o)}):n>=a&&n<=o?e.push({...i,st:Math.max(t,a),ed:n}):e.push(i))}return fp(e.map(e=>{let{st:n,ed:r}=e;return{...e,st:n-t,ed:r-t}}))}else if(r)return[{st:0,ed:n-t,ts:{}}]}function Qp(e,t,n){let{tables:r=[]}=e,i=[];for(let e of r){let r=L.deepClone(e),{startIndex:a,endIndex:o}=r;a>=t&&o<=n&&i.push({...r,startIndex:a-t,endIndex:o-t})}return i}function $p(e,t,n){let{paragraphs:r=[]}=e,i=[];for(let e of r){let{startIndex:r}=e;if(r>=t&&r<n){let t=L.deepClone(e);i.push(t)}}if(i.length)return i.map(e=>({...e,startIndex:e.startIndex-t}))}function em(e,t,n){let{sectionBreaks:r=[]}=e,i=[];for(let e of r){let{startIndex:r}=e;r>=t&&r<=n&&i.push(L.deepClone(e))}if(i.length)return i.map(e=>({...e,startIndex:e.startIndex-t}))}function tm(e,t,n){let{customBlocks:r=[]}=e,i=[];for(let e of r){let{startIndex:r}=e;r>=t&&r<n&&i.push(L.deepClone(e))}if(i.length)return i.map(e=>({...e,startIndex:e.startIndex-t}))}function nm(e,t,n,r=!0,i=Xp.cut){let{dataStream:a}=e,o={dataStream:a.slice(t,n)};o.textRuns=Zp(e,t,n,r);let s=Qp(e,t,n);if(s.length&&(o.tables=s),o.paragraphs=$p(e,t,n),i===Xp.cut){let i=am(e,t,n);i?o.customDecorations=i:r&&(o.customDecorations=[])}let{customRanges:c}=im(e,t,n);return c?o.customRanges=c:r&&(o.customRanges=[]),o.customBlocks=tm(e,t,n),o}function rm(e){let{dataStream:t,textRuns:n,paragraphs:r,customRanges:i,customDecorations:a,tables:o}=e,s=0,c=0;i==null||i.forEach(e=>{e.startIndex<0&&(s=Math.max(s,-e.startIndex)),e.endIndex>t.length-1&&(c=Math.max(c,e.endIndex-t.length+1))});let l=`${t}`;return n&&(n[0]&&(n[0].st=n[0].st-s),n[n.length-1]&&(n[n.length-1].ed=n[n.length-1].ed+c)),n==null||n.forEach(e=>{e.st+=s,e.ed+=s}),r==null||r.forEach(e=>{e.startIndex+=s}),i==null||i.forEach(e=>{e.startIndex+=s,e.endIndex+=s}),a==null||a.forEach(e=>{e.startIndex+=s,e.endIndex+=c}),o==null||o.forEach(e=>{e.startIndex+=s,e.endIndex+=c}),{...e,dataStream:l,textRuns:n,paragraphs:r,customRanges:i,customDecorations:a,tables:o}}function im(e,t,n){if(e.customRanges==null)return{};let{customRanges:r}=e;return{customRanges:r.filter(e=>Math.max(e.startIndex,t)<=Math.min(e.endIndex,n-1)).map(e=>({...e,startIndex:Math.max(e.startIndex,t),endIndex:Math.min(e.endIndex,n-1)})).map(e=>({...e,startIndex:e.startIndex-t,endIndex:e.endIndex-t})),leftOffset:0,rightOffset:0}}function am(e,t,n){if(e.customDecorations==null)return;let{customDecorations:r=[]}=e,i=[];return r.forEach(e=>{if(Math.max(e.startIndex,t)<=Math.min(e.endIndex,n-1)){let r=L.deepClone(e);i.push({...r,startIndex:Math.max(r.startIndex-t,0),endIndex:Math.min(r.endIndex,n-1)-t})}}),i}function om(e,t,n){return e==null||t==null?e==null?t:e:Up(e,t,n)}function sm(e,t,n){if(e==null||t==null)return e==null?t:e;if(t.length===0||e.length===0)return e;if(t.length>1||e.length>1)throw Error(`Cannot cover multiple customRanges`);return n===H.REPLACE?[{...e[0]}]:[{...t[0],...e[0]}]}function cm(e,t,n){return t.length===0||e.length===0||n===H.REPLACE?e:[...e,...t.filter(t=>!e.some(e=>t.id===e.id))]}function lm(e,t,n=H.COVER){if(t.dataStream!==``)throw Error(`Cannot compose other body with non-empty dataStream`);let r={dataStream:e.dataStream},{textRuns:i,paragraphs:a=[],customRanges:o,customDecorations:s=[]}=e,{textRuns:c,paragraphs:l=[],customRanges:u,customDecorations:d=[]}=t;r.textRuns=om(c,i,n),r.customRanges=sm(u,o,n);let f=cm(d,s,n);f.length&&(r.customDecorations=f);let p=[],m=0,h=0;for(;m<a.length&&h<l.length;){let e=a[m],t=l[h],{startIndex:n}=e,{startIndex:r}=t;n===r?(p.push(L.deepMerge(e,t)),m++,h++):n<r?(p.push(L.deepClone(e)),m++):(p.push(L.deepClone(t)),h++)}return m<a.length&&p.push(...a.slice(m)),h<l.length&&p.push(...l.slice(h)),p.length&&(r.paragraphs=p),r}function um(e){let{body:t}=e;if(t==null)return!0;let{textRuns:n,paragraphs:r,customRanges:i,customBlocks:a,customDecorations:o,tables:s}=t;return n==null&&r==null&&i==null&&a==null&&o==null&&s==null}var dm=class{constructor(e){this._actions=e,F(this,`_index`,0),F(this,`_offset`,0)}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);let t=this._actions[this._index];if(t){let n=this._offset,r=t.len;return e>=r-n?(e=r-n,this._index+=1,this._offset=0):this._offset+=e,t.t===U.DELETE||t.t===U.RETAIN&&t.body==null?L.deepClone({...t,len:e}):L.deepClone({...t,len:e,body:nm(t.body,n,n+e,!1)})}else return{t:U.RETAIN,len:1/0}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:1/0}peekType(){let e=this._actions[this._index];return e?e.t:U.RETAIN}rest(){if(!this.hasNext())return[];if(this._offset===0)return this._actions.slice(this._index);{let e=this._offset,t=this._index,n=this.next(),r=this._actions.slice(this._index);return this._offset=e,this._index=t,[n].concat(r)}}};function fm(e,t,n){let{dataStream:r}=e,i=n,a=n+t,o=Tp(e,t,n),s=Ep(e,t,n),c=Dp(e,t,n),l=Op(e,t,n),u=kp(e,t,n),d=Ap(e,t,n),f=jp(e,t,n),p=``;return r&&(e.dataStream=Wd(r,i,a),p=r.slice(i,a)),{dataStream:p,textRuns:o,paragraphs:s,sectionBreaks:c,customBlocks:l,tables:u,customRanges:d,customDecorations:f}}function pm(e,t,n,r){e.dataStream=Ud(e.dataStream,r,t.dataStream),pp(e,t,n,r),mp(e,t,n,r),hp(e,t,n,r),gp(e,t,n,r),_p(e,t,n,r),Cp(e,t,n,r),wp(e,t,n,r)}function mm(e,t,n,r,i=H.COVER){return Vp(e,t,n,r,i)}function hm(e,t,n){return t<=0?{dataStream:``}:fm(e,t,n)}function gm(e,t,n,r){n!==0&&pm(e,t,n,r)}function _m(e,t){let n=new Ui;return n.reset(),t.forEach(t=>{let r=L.deepClone(t);switch(r.t){case U.RETAIN:{let{coverType:t,body:i,len:a}=r;i!=null&&mm(e,i,a,n.cursor,t),n.moveCursor(a);break}case U.INSERT:{let{body:t,len:i}=r;gm(e,t,i,n.cursor),n.moveCursor(i);break}case U.DELETE:{let{len:t}=r;hm(e,t,n.cursor);break}default:throw Error(`Unknown action type for action: ${r}.`)}}),e}var vm=function(e){return e[e.COVER=0]=`COVER`,e[e.COVER_ONLY_NOT_EXISTED=1]=`COVER_ONLY_NOT_EXISTED`,e}(vm||{});function ym(e,t,n,r,i){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=L.deepClone(t),e=L.deepClone(e);let a=[],o=t.length,s=e.length,c=0,l=0,u=null;function d(){return u?(a.push(u),u=null,!0):!1}for(;c<o&&l<s;){let{st:o,ed:s,ts:f}=t[c],{st:p,ed:m,ts:h,sId:g}=e[l],_={};if(i===vm.COVER)_={...f},n===H.COVER&&r===H.REPLACE&&h&&(_=Object.assign({},h,_));else if(_={...f},n===H.REPLACE){if(r===H.REPLACE)_={...h};else if(f&&h){let e=Object.keys(f);for(let t of e)h[t]&&delete _[t]}}else if(r===H.REPLACE){if(h){let e=Object.keys(h);for(let t of e)h[t]!==void 0&&(_[t]=h[t])}}else if(h){let e=Object.keys(h);for(let t of e)_[t]!==void 0&&delete _[t]}if(s<p)d()||a.push(t[c]),c++;else if(m<o)d()||a.push(e[l]),l++;else{let n={st:Math.min(o,p),ed:Math.max(o,p),ts:o<p?{...f}:{...h},sId:o<p?void 0:g};n.ed>n.st&&a.push(),a.push({st:Math.max(o,p),ed:Math.min(s,m),ts:_,sId:g}),s<m?(c++,e[l].st=s,e[l].st===e[l].ed&&l++):(l++,t[c].st=m,t[c].st===t[c].ed&&c++);let r={st:Math.min(s,m),ed:Math.max(s,m),ts:s<m?{...h}:{...f},sId:s<m?g:void 0};u=r.ed>r.st?r:null}}d();let f=a[a.length-1],p=t[o-1],m=e[s-1];return f.ed!==Math.max(p.ed,m.ed)&&(p.ed>m.ed?a.push(p):a.push(m)),fp(a,!0)}function bm(e,t,n,r,i){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];if(e.length>1||t.length>1)throw Error(`CustomRanges is only supported transform for length one now.`);let a=e[0],o=t[0];if(n===H.REPLACE)return i===vm.COVER_ONLY_NOT_EXISTED?[L.deepClone(a)]:[L.deepClone(o)];if(r===H.REPLACE){let e=L.deepClone(o);return i===vm.COVER_ONLY_NOT_EXISTED&&Object.assign(e,L.deepClone(a)),[e]}else{let e=L.deepClone(o);return i===vm.COVER_ONLY_NOT_EXISTED&&Object.assign(e,L.deepClone(a)),[e]}}function xm(e,t,n,r,i){let a={startIndex:t.startIndex};if(t.paragraphStyle&&(a.paragraphStyle=L.deepClone(t.paragraphStyle),e.paragraphStyle)){if(n===H.REPLACE)if(r===H.REPLACE)i===vm.COVER_ONLY_NOT_EXISTED&&(a.paragraphStyle={...e.paragraphStyle});else if(i===vm.COVER_ONLY_NOT_EXISTED){let t=Object.keys(e.paragraphStyle);for(let n of t)e.paragraphStyle[n]!==void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else{let t=Object.keys(e.paragraphStyle);for(let n of t)a.paragraphStyle[n]===void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else if(r===H.REPLACE)if(i===vm.COVER_ONLY_NOT_EXISTED){let t=Object.keys(e.paragraphStyle);for(let n of t)e.paragraphStyle[n]!==void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else{let t=Object.keys(e.paragraphStyle);for(let n of t)a.paragraphStyle[n]===void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else if(i===vm.COVER_ONLY_NOT_EXISTED){let t=Object.keys(e.paragraphStyle);for(let e of t)a.paragraphStyle[e]&&delete a.paragraphStyle[e]}}return n===H.REPLACE&&r===H.REPLACE?a.bullet=i===vm.COVER_ONLY_NOT_EXISTED?L.deepClone(e.bullet):L.deepClone(t.bullet):e.bullet===void 0?a.bullet=L.deepClone(t.bullet):n===H.REPLACE||r===H.REPLACE?a.bullet=i===vm.COVER&&t.bullet?L.deepClone(t.bullet):L.deepClone(e.bullet):i===vm.COVER&&t.bullet!==void 0&&(a.bullet=L.deepClone(t.bullet)),a}function Sm(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return L.deepClone(t);let n=[];for(let r of t){let{id:t,type:i}=r,a=!1;for(let o of e)if(o.id===t){(o.type===no.DELETED||i===no.DELETED)&&(a=!0,n.push({...r,type:no.DELETED}));break}a||n.push(r)}return n}function Cm(e,t,n=!1){let{body:r,coverType:i=H.COVER}=e,{body:a,coverType:o=H.COVER}=t;if(r==null||r.dataStream!==``||a==null||a.dataStream!==``)throw Error(`Data stream is not supported in retain transform.`);let s={dataStream:``},c=o,{textRuns:l,paragraphs:u=[],customRanges:d,customDecorations:f}=r,{textRuns:p,paragraphs:m=[],customRanges:h,customDecorations:g}=a,_=ym(l,p,i,o,n?vm.COVER_ONLY_NOT_EXISTED:vm.COVER);_&&(s.textRuns=_);let v=bm(d,h,i,o,n?vm.COVER_ONLY_NOT_EXISTED:vm.COVER);v&&(s.customRanges=v);let y=Sm(f,g);y&&(s.customDecorations=y);let b=[],x=0,S=0;for(;x<u.length&&S<m.length;){let e=u[x],t=m[S],{startIndex:r}=e,{startIndex:a}=t;if(r===a){let a={startIndex:r};a=n?xm(e,t,i,o,vm.COVER_ONLY_NOT_EXISTED):xm(e,t,i,o,vm.COVER),b.push(a),x++,S++}else r<a?x++:(b.push(L.deepClone(t)),S++)}return S<m.length&&b.push(...m.slice(S)),b.length&&(s.paragraphs=b),{coverType:c,body:s}}function wm(e){return Object.keys(e).length===1}var Q=class e{constructor(){F(this,`_actions`,[])}static apply(e,t){return _m(e,t)}static compose(t,n){let r=new dm(t),i=new dm(n),a=new e;for(;r.hasNext()||i.hasNext();)if(i.peekType()===U.INSERT)a.push(i.next());else if(r.peekType()===U.DELETE)a.push(r.next());else{let e=Math.min(r.peekLength(),i.peekLength()),t=r.next(e),n=i.next(e);if(t.t===U.INSERT&&n.t===U.RETAIN)n.body==null?a.push(t):a.push({...t,body:lm(t.body,n.body,n.coverType)});else if(t.t===U.RETAIN&&n.t===U.RETAIN)if(t.body==null&&n.body==null)a.push(t.len===1/0?n:t);else if(t.body&&n.body){let e=t.coverType===H.REPLACE||n.coverType===H.REPLACE?H.REPLACE:H.COVER;a.push({...t,t:U.RETAIN,coverType:e,body:lm(t.body,n.body,n.coverType)})}else a.push(t.body?t:n);else t.t===U.RETAIN&&n.t===U.DELETE?a.push(n):t.t===U.INSERT&&(n.t,U.DELETE)}return a.trimEndUselessRetainAction(),a.serialize()}static transform(e,t,n=`right`){return this._transform(t,e,n===`left`?`right`:`left`)}static _transform(t,n,r=`right`){let i=new dm(t),a=new dm(n),o=new e;for(;i.hasNext()||a.hasNext();)if(i.peekType()===U.INSERT&&(r===`left`||a.peekType()!==U.INSERT)){let e=i.next();o.retain(e.len)}else if(a.peekType()===U.INSERT)o.push(a.next());else{let e=Math.min(i.peekLength(),a.peekLength()),t=i.next(e),n=a.next(e);if(t.t===U.DELETE)continue;if(n.t===U.DELETE){o.push(n);continue}if(t.body==null||n.body==null)o.push(n);else{let{coverType:e,body:i}=Cm(t,n,r===`left`);o.push({...n,t:U.RETAIN,coverType:e,body:i})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(e,t,n=!1){let r=new dm(e),i=0;for(;r.hasNext()&&i<=t;){let e=r.peekLength(),a=r.peekType();if(r.next(),a===U.DELETE){t-=Math.min(e,t-i);continue}else a===U.INSERT&&(i<t||!n)&&(t+=e);i+=e}return t}static isNoop(e){return e.length===0}static invert(e){let t=[];for(let n of e)if(n.t===U.INSERT)t.push({t:U.DELETE,len:n.len,body:n.body});else if(n.t===U.DELETE){if(n.body==null)throw Error(`Can not invert DELETE action without body property, makeInvertible must be called first.`);t.push({t:U.INSERT,body:n.body,len:n.len})}else if(n.body!=null){if(n.oldBody==null)throw Error(`Can not invert RETAIN action without oldBody property, makeInvertible must be called first.`);t.push({t:U.RETAIN,body:n.oldBody,oldBody:n.body,len:n.len,coverType:H.REPLACE})}else t.push(n);return t}static makeInvertible(e,t){let n=[],r=0;for(let i of e){if(i.t===U.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){let e=nm(t,r,r+i.len,!1);i.len=e.dataStream.length,i.body=e}if(i.t===U.RETAIN&&i.body!=null){let e=nm(t,r,r+i.len,!0);i.oldBody={...e,dataStream:``},i.len=e.dataStream.length}n.push(i),i.t!==U.INSERT&&(r+=i.len)}return n}insert(e,t){let n={t:U.INSERT,body:t,len:e};return this.push(n),this}retain(e,t,n){let r={t:U.RETAIN,len:e};return t!=null&&(r.body=t),n!=null&&(r.coverType=n),this.push(r),this}delete(e){let t={t:U.DELETE,len:e};return this.push(t),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...e){if(e.length>1){for(let t of e)this.push(t);return this}let t=this._actions.length,n=this._actions[t-1],r=L.deepClone(e[0]);if(r.t===U.RETAIN&&r.len===0&&r.body==null)return this;if(typeof n==`object`){if(n.t===U.DELETE&&r.t===U.DELETE)return n.len+=r.len,this;if(n.t===U.DELETE&&r.t===U.INSERT&&(--t,n=this._actions[t-1],n==null))return this._actions.unshift(r),this;if(n.t===U.RETAIN&&r.t===U.RETAIN&&n.body==null&&r.body==null)return n.len+=r.len,this;if(n.t===U.INSERT&&wm(n.body)&&r.t===U.INSERT&&wm(r.body))return n.len+=r.len,n.body.dataStream+=r.body.dataStream,this}return t===this._actions.length?this._actions.push(r):this._actions.splice(t,0,r),this}trimEndUselessRetainAction(){let e=this._actions[this._actions.length-1];for(;e&&e.t===U.RETAIN&&um(e);)this._actions.pop(),e=this._actions[this._actions.length-1];return this}};F(Q,`id`,`text-x`),F(Q,`uri`,`https://github.com/dream-num/univer#text-x`),Object.defineProperty(Q,`name`,{value:`text-x`});var Tm=class e{static registerSubtype(e){var t;e==null||this._subTypes.has(e.name)&&((t=this._subTypes.get(e.name))==null?void 0:t.id)!==Q.id||(this._subTypes.set(e.name,e),Qo.type.registerSubtype(e))}static apply(e,t){if(!Qo.type.isNoop(t))return Qo.type.apply(e,t)}static compose(e,t){return Qo.type.compose(e,t)}static transform(e,t,n){return Qo.type.transform(e,t,n)}static transformPosition(e,t,n=`right`){return e&&e.length===2&&e[0]===`body`&&e[1].et===Q.name?Q.transformPosition(e[1].e,t,n===`left`):t}static invertWithDoc(e,t){return Qo.type.invertWithDoc(e,t)}static isNoop(e){return Qo.type.isNoop(e)}static getInstance(){return this._instance==null&&(this._instance=new e),this._instance}removeOp(e,t){return Qo.removeOp(e,t)}moveOp(e,t){return Qo.moveOp(e,t)}insertOp(e,t){return Qo.insertOp(e,t)}replaceOp(e,t,n){return Qo.replaceOp(e,t,n)}editOp(e,t=[`body`]){return Qo.editOp(t,Q.name,e)}};F(Tm,`uri`,`https://github.com/dream-num/univer#json-x`),F(Tm,`_subTypes`,new Map),F(Tm,`_instance`,null),Tm.registerSubtype(Q);let Em=function(e){return e.PARAGRAPH=`PARAGRAPH`,e.SECTION_BREAK=`SECTION_BREAK`,e.TABLE=`TABLE`,e.TABLE_ROW=`TABLE_ROW`,e.TABLE_CELL=`TABLE_CELL`,e.CUSTOM_BLOCK=`CUSTOM_BLOCK`,e}({}),Dm=function(e){return e.PARAGRAPH=`\r`,e.SECTION_BREAK=`
|
|
4
|
-
`,e.TABLE_START=``,e.TABLE_ROW_START=`\x1B`,e.TABLE_CELL_START=``,e.TABLE_CELL_END=``,e.TABLE_ROW_END=``,e.TABLE_END=``,e.CUSTOM_RANGE_START=``,e.CUSTOM_RANGE_END=``,e.COLUMN_BREAK=`\v`,e.PAGE_BREAK=`\f`,e.DOCS_END=`\0`,e.TAB=` `,e.CUSTOM_BLOCK=`\b`,e.LETTER=``,e.SPACE=` `,e}({});function
|
|
5
|
-
`)?e.slice(0,-2):e;return km.reduce((e,t)=>e.replaceAll(t,``),t)},jm=e=>e?Am(e).replaceAll(`\r`,``)===``:!0,Mm=e=>{let t=e.replace(/\n/g,`\r`),n=[],r=[],i=0,a=``,o=(o,s=!0)=>{let c=t.slice(i,o);if(L.isLegalUrl(c)){let t=xa(),l=`${c}`,u={startIndex:i,endIndex:i+l.length-1,rangeId:t,rangeType:to.HYPERLINK,properties:{url:e}};r.push(u),a+=l,i=o+1,s&&(a+=`\r`,n.push({startIndex:o}))}else a+=t.slice(i,o+1),i=o+1,s&&n.push({startIndex:o})},s=0;for(let e=0;e<t.length;e++)t[e]===`\r`&&(o(e),s=e);return(s!==t.length-1||t.length===1)&&o(t.length,!1),{dataStream:a,paragraphs:n,customRanges:r}},Nm={id:`default_doc`,documentStyle:{}};var Pm=class extends oa{getUnitId(){throw Error(`Method not implemented.`)}constructor(e){var t;super(),F(this,`type`,n.UniverType.UNIVER_DOC),F(this,`_name$`,new r.BehaviorSubject(``)),F(this,`name$`,this._name$.asObservable()),F(this,`snapshot`,void 0),this.snapshot={...Nm,...e},this._name$.next((t=this.snapshot.title)==null?`No Title`:t)}getRev(){var e;return(e=this.snapshot.rev)==null?1:e}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(e){this.snapshot.rev=e}setName(e){this.snapshot.title=e,this._name$.next(e)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var e;return((e=this.snapshot.settings)==null?void 0:e.zoomRatio)||1}resetDrawing(e,t){this.snapshot.drawings=e,this.snapshot.drawingsOrder=t}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var e;let t=(e=this.snapshot.lists)==null?{}:e;return{...Lp,...t}}updateDocumentId(e){this.snapshot.id=e}updateDocumentRenderConfig(e){let{documentStyle:t}=this.snapshot;t.renderConfig==null?t.renderConfig=e:t.renderConfig={...t.renderConfig,...e}}getDocumentStyle(){return this.snapshot.documentStyle}updateDocumentStyle(e){this.snapshot.documentStyle==null?this.snapshot.documentStyle=e:this.snapshot.documentStyle={...this.snapshot.documentStyle,...e}}updateDocumentDataMargin(e){let{t,l:n,b:r,r:i}=e,{documentStyle:a}=this.snapshot;t!=null&&(a.marginTop=t),n!=null&&(a.marginLeft=n),r!=null&&(a.marginBottom=r),i!=null&&(a.marginRight=i)}updateDocumentDataPageSize(e,t){let{documentStyle:n}=this.snapshot;if(!n.pageSize){n.pageSize={width:e==null?1/0:e,height:t==null?1/0:t};return}e!==void 0&&(n.pageSize.width=e),t!==void 0&&(n.pageSize.height=t)}updateDrawing(e,t){let{drawings:n}=this,{width:r,height:i,left:a,top:o}=t,s=n==null?void 0:n[e];if(!s)return;let c=s.docTransform;c.size.width=r,c.size.height=i,c.positionH.posOffset=a,c.positionV.posOffset=o}setZoomRatio(e=1){this.snapshot.settings?this.snapshot.settings.zoomRatio=e:this.snapshot.settings={zoomRatio:e}}setDisabled(e){this.snapshot.disabled=e}getDisabled(){return this.snapshot.disabled}getTitle(){return this.snapshot.title}},Fm=class e extends Pm{constructor(e){var t,n;super(L.isEmptyObject(e)?Ho():e),F(this,`_unitId`,void 0),F(this,`headerModelMap`,new Map),F(this,`footerModelMap`,new Map),F(this,`change$`,new r.BehaviorSubject(0)),this._unitId=(t=this.snapshot.id)==null?xa(6):t,this._initializeHeaderFooterModel(),this._name$.next((n=this.snapshot.title)==null?``:n)}dispose(){super.dispose(),this.headerModelMap.forEach(e=>{e.dispose()}),this.footerModelMap.forEach(e=>{e.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var e;return(e=this.snapshot.body)==null?void 0:e.customRanges}getCustomDecorations(){var e;return(e=this.snapshot.body)==null?void 0:e.customDecorations}getSettings(){return this.snapshot.settings}reset(e){if(e.id&&e.id!==this._unitId)throw Error(`Cannot reset a document model with a different unit id!`);this.snapshot={...Nm,...e},this._initializeHeaderFooterModel(),this.change$.next(this.change$.value+1)}getSelfOrHeaderFooterModel(e){if(e!=null){if(this.headerModelMap.has(e))return this.headerModelMap.get(e);if(this.footerModelMap.has(e))return this.footerModelMap.get(e)}return this}getUnitId(){return this._unitId}apply(e){if(!Tm.isNoop(e))return this.snapshot=Tm.apply(this.snapshot,e),e!=null&&e.some(e=>Array.isArray(e)&&((e==null?void 0:e[0])===`headers`||(e==null?void 0:e[0])===`footers`))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.change$.next(this.change$.value+1),this.snapshot}sliceBody(e,t,n=Xp.copy){let r=this.getBody();if(r!=null)return nm(r,e,t,!1,n)}_initializeHeaderFooterModel(){let{headers:t,footers:n}=this.getSnapshot();if(t)for(let n in t){let r=t[n];this.headerModelMap.set(n,new e(r)),this.headerModelMap.get(n).updateDocumentId(this.getUnitId())}if(n)for(let t in n){let r=n[t];this.footerModelMap.set(t,new e(r)),this.footerModelMap.get(t).updateDocumentId(this.getUnitId())}}updateDocumentId(e){super.updateDocumentId(e),this._unitId=e}getPlainText(){var e,t;return Am((e=(t=this.getBody())==null?void 0:t.dataStream)==null?``:e)}};function Im(e){let{ranges:t,id:n,type:r}=e,i=new Q,a=0;for(let e=0;e<t.length;e++){let{startOffset:o,endOffset:s}=t[e];o>0&&i.push({t:U.RETAIN,len:o-a}),i.push({t:U.RETAIN,body:{dataStream:``,customDecorations:[{id:n,type:r,startIndex:0,endIndex:s-o-1}]},len:s-o}),a=s}return i}function Lm(e){var t;let{id:n,segmentId:r,documentDataModel:i}=e,a=i==null?void 0:i.getBody();if(!i||!a)return!1;let o=(t=i.getSelfOrHeaderFooterModel(r))==null||(t=t.getBody())==null||(t=t.customDecorations)==null?void 0:t.find(e=>e.id===n);if(!o)return!1;let s=new Q,{startIndex:c,endIndex:l}=o,u=l-c+1;return s.push({t:U.RETAIN,len:c}),s.push({t:U.RETAIN,len:u,body:{dataStream:``,customDecorations:[{startIndex:0,endIndex:u-1,id:n,type:no.DELETED}]}}),s}function Rm(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function zm(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):Rm(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function Bm(e){return{...L.deepClone(e),rangeId:xa()}}function Vm(e,t){let n=[],r=e[0];for(let i of t)i<e[0]||i>e[1]||(r<i&&n.push([r,i-1]),r=i+1);return r<=e[1]&&n.push([r,e[1]]),n}function Hm(e,t,n,r){let i=[];for(let a=0,o=n.length;a<o;a++){let o=n[a];if((r===void 0||o.rangeType===r)&&Math.max(o.startIndex,e)<=Math.min(o.endIndex,t)&&i.push({...o}),o.startIndex>t)break}return i}function Um(e,t){var n,r,i,a,o;let s=Hm(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(n=t.customRanges)==null?[]:n),c=Math.min(e.startOffset,(r=(i=s[0])==null?void 0:i.startIndex)==null?1/0:r),l=Math.max(e.endOffset,((a=(o=s[s.length-1])==null?void 0:o.endIndex)==null?-1/0:a)+1);return{startOffset:c,endOffset:l,collapsed:c===l}}var Wm=h(f(((e,t)=>{var n=-1,r=1,i=0;function a(e,t,n,r,a){if(e===t)return e?[[i,e]]:[];if(n!=null){var s=D(e,t,n);if(s)return s}var c=l(e,t),u=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=d(e,t);var f=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var m=o(e,t);return u&&m.unshift([i,u]),f&&m.push([i,f]),b(m,a),r&&p(m),m}function o(e,t){var o;if(!e)return[[r,t]];if(!t)return[[n,e]];var c=e.length>t.length?e:t,l=e.length>t.length?t:e,u=c.indexOf(l);if(u!==-1)return o=[[r,c.substring(0,u)],[i,l],[r,c.substring(u+l.length)]],e.length>t.length&&(o[0][0]=o[2][0]=n),o;if(l.length===1)return[[n,e],[r,t]];var d=f(e,t);if(d){var p=d[0],m=d[1],h=d[2],g=d[3],_=d[4],v=a(p,h),y=a(m,g);return v.concat([[i,_]],y)}return s(e,t)}function s(e,t){for(var i=e.length,a=t.length,o=Math.ceil((i+a)/2),s=o,l=2*o,u=Array(l),d=Array(l),f=0;f<l;f++)u[f]=-1,d[f]=-1;u[s+1]=0,d[s+1]=0;for(var p=i-a,m=p%2!=0,h=0,g=0,_=0,v=0,y=0;y<o;y++){for(var b=-y+h;b<=y-g;b+=2){for(var x=s+b,S=b===-y||b!==y&&u[x-1]<u[x+1]?u[x+1]:u[x-1]+1,C=S-b;S<i&&C<a&&e.charAt(S)===t.charAt(C);)S++,C++;if(u[x]=S,S>i)g+=2;else if(C>a)h+=2;else if(m){var w=s+p-b;if(w>=0&&w<l&&d[w]!==-1){var T=i-d[w];if(S>=T)return c(e,t,S,C)}}}for(var E=-y+_;E<=y-v;E+=2){for(var w=s+E,T=E===-y||E!==y&&d[w-1]<d[w+1]?d[w+1]:d[w-1]+1,D=T-E;T<i&&D<a&&e.charAt(i-T-1)===t.charAt(a-D-1);)T++,D++;if(d[w]=T,T>i)v+=2;else if(D>a)_+=2;else if(!m){var x=s+p-E;if(x>=0&&x<l&&u[x]!==-1){var S=u[x],C=s+S-x;if(T=i-T,S>=T)return c(e,t,S,C)}}}}return[[n,e],[r,t]]}function c(e,t,n,r){var i=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=a(i,o),u=a(s,c);return l.concat(u)}function l(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return x(e.charCodeAt(i-1))&&i--,i}function u(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}}function d(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return S(e.charCodeAt(e.length-i))&&i--,i}function f(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;function i(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),i=-1,a=``,o,s,c,u;(i=t.indexOf(r,i+1))!==-1;){var f=l(e.substring(n),t.substring(i)),p=d(e.substring(0,n),t.substring(0,i));a.length<p+f&&(a=t.substring(i-p,i)+t.substring(i,i+f),o=e.substring(0,n-p),s=e.substring(n+f),c=t.substring(0,i-p),u=t.substring(i+f))}return a.length*2>=e.length?[o,s,c,u,a]:null}var a=i(n,r,Math.ceil(n.length/4)),o=i(n,r,Math.ceil(n.length/2)),s;if(!a&&!o)return null;s=o?a&&a[4].length>o[4].length?a:o:a;var c,u,f,p;e.length>t.length?(c=s[0],u=s[1],f=s[2],p=s[3]):(f=s[0],p=s[1],c=s[2],u=s[3]);var m=s[4];return[c,u,f,p,m]}function p(e){for(var t=!1,a=[],o=0,s=null,c=0,l=0,d=0,f=0,p=0;c<e.length;)e[c][0]==i?(a[o++]=c,l=f,d=p,f=0,p=0,s=e[c][1]):(e[c][0]==r?f+=e[c][1].length:p+=e[c][1].length,s&&s.length<=Math.max(l,d)&&s.length<=Math.max(f,p)&&(e.splice(a[o-1],0,[n,s]),e[a[o-1]+1][0]=r,o--,o--,c=o>0?a[o-1]:-1,l=0,d=0,f=0,p=0,s=null,t=!0)),c++;for(t&&b(e),y(e),c=1;c<e.length;){if(e[c-1][0]==n&&e[c][0]==r){var m=e[c-1][1],h=e[c][1],g=u(m,h),_=u(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(c,0,[i,h.substring(0,g)]),e[c-1][1]=m.substring(0,m.length-g),e[c+1][1]=h.substring(g),c++):(_>=m.length/2||_>=h.length/2)&&(e.splice(c,0,[i,m.substring(0,_)]),e[c-1][0]=r,e[c-1][1]=h.substring(0,h.length-_),e[c+1][0]=n,e[c+1][1]=m.substring(_),c++),c++}c++}}var m=/[^a-zA-Z0-9]/,h=/\s/,g=/[\r\n]/,_=/\n\r?\n$/,v=/^\r?\n\r?\n/;function y(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),i=n.match(m),a=r.match(m),o=i&&n.match(h),s=a&&r.match(h),c=o&&n.match(g),l=s&&r.match(g),u=c&&e.match(_),d=l&&t.match(v);return u||d?5:c||l?4:i&&!o&&s?3:o||s?2:i||a?1:0}for(var n=1;n<e.length-1;){if(e[n-1][0]==i&&e[n+1][0]==i){var r=e[n-1][1],a=e[n][1],o=e[n+1][1],s=d(r,a);if(s){var c=a.substring(a.length-s);r=r.substring(0,r.length-s),a=c+a.substring(0,a.length-s),o=c+o}for(var l=r,u=a,f=o,p=t(r,a)+t(a,o);a.charAt(0)===o.charAt(0);){r+=a.charAt(0),a=a.substring(1)+o.charAt(0),o=o.substring(1);var y=t(r,a)+t(a,o);y>=p&&(p=y,l=r,u=a,f=o)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=u,f?e[n+1][1]=f:(e.splice(n+1,1),n--))}n++}}function b(e,t){e.push([i,``]);for(var a=0,o=0,s=0,c=``,u=``,f;a<e.length;){if(a<e.length-1&&!e[a][1]){e.splice(a,1);continue}switch(e[a][0]){case r:s++,u+=e[a][1],a++;break;case n:o++,c+=e[a][1],a++;break;case i:var p=a-s-o-1;if(t){if(p>=0&&w(e[p][1])){var m=e[p][1].slice(-1);if(e[p][1]=e[p][1].slice(0,-1),c=m+c,u=m+u,!e[p][1]){e.splice(p,1),a--;var h=p-1;e[h]&&e[h][0]===r&&(s++,u=e[h][1]+u,h--),e[h]&&e[h][0]===n&&(o++,c=e[h][1]+c,h--),p=h}}if(C(e[a][1])){var m=e[a][1].charAt(0);e[a][1]=e[a][1].slice(1),c+=m,u+=m}}if(a<e.length-1&&!e[a][1]){e.splice(a,1);break}if(c.length>0||u.length>0){c.length>0&&u.length>0&&(f=l(u,c),f!==0&&(p>=0?e[p][1]+=u.substring(0,f):(e.splice(0,0,[i,u.substring(0,f)]),a++),u=u.substring(f),c=c.substring(f)),f=d(u,c),f!==0&&(e[a][1]=u.substring(u.length-f)+e[a][1],u=u.substring(0,u.length-f),c=c.substring(0,c.length-f)));var g=s+o;c.length===0&&u.length===0?(e.splice(a-g,g),a-=g):c.length===0?(e.splice(a-g,g,[r,u]),a=a-g+1):u.length===0?(e.splice(a-g,g,[n,c]),a=a-g+1):(e.splice(a-g,g,[n,c],[r,u]),a=a-g+2)}a!==0&&e[a-1][0]===i?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,s=0,o=0,c=``,u=``;break}}e[e.length-1][1]===``&&e.pop();var _=!1;for(a=1;a<e.length-1;)e[a-1][0]===i&&e[a+1][0]===i&&(e[a][1].substring(e[a][1].length-e[a-1][1].length)===e[a-1][1]?(e[a][1]=e[a-1][1]+e[a][1].substring(0,e[a][1].length-e[a-1][1].length),e[a+1][1]=e[a-1][1]+e[a+1][1],e.splice(a-1,1),_=!0):e[a][1].substring(0,e[a+1][1].length)==e[a+1][1]&&(e[a-1][1]+=e[a+1][1],e[a][1]=e[a][1].substring(e[a+1][1].length)+e[a+1][1],e.splice(a+1,1),_=!0)),a++;_&&b(e,t)}function x(e){return e>=55296&&e<=56319}function S(e){return e>=56320&&e<=57343}function C(e){return S(e.charCodeAt(0))}function w(e){return x(e.charCodeAt(e.length-1))}function T(e){for(var t=[],n=0;n<e.length;n++)e[n][1].length>0&&t.push(e[n]);return t}function E(e,t,a,o){return w(e)||C(o)?null:T([[i,e],[n,t],[r,a],[i,o]])}function D(e,t,n){var r=typeof n==`number`?{index:n,length:0}:n.oldRange,i=typeof n==`number`?null:n.newRange,a=e.length,o=t.length;if(r.length===0&&(i===null||i.length===0)){var s=r.index,c=e.slice(0,s),l=e.slice(s),u=i?i.index:null;editBefore:{var d=s+o-a;if(u!==null&&u!==d||d<0||d>o)break editBefore;var f=t.slice(0,d),p=t.slice(d);if(p!==l)break editBefore;var m=Math.min(s,d),h=c.slice(0,m),g=f.slice(0,m);if(h!==g)break editBefore;var _=c.slice(m),v=f.slice(m);return E(h,_,v,l)}editAfter:{if(u!==null&&u!==s)break editAfter;var y=s,f=t.slice(0,y),p=t.slice(y);if(f!==c)break editAfter;var b=Math.min(a-y,o-y),x=l.slice(l.length-b),S=p.slice(p.length-b);if(x!==S)break editAfter;var _=l.slice(0,l.length-b),v=p.slice(0,p.length-b);return E(c,_,v,x)}}if(r.length>0&&i&&i.length===0)replaceRange:{var h=e.slice(0,r.index),x=e.slice(r.index+r.length),m=h.length,b=x.length;if(o<m+b)break replaceRange;var g=t.slice(0,m),S=t.slice(o-b);if(h!==g||x!==S)break replaceRange;var _=e.slice(m,a-b),v=t.slice(m,o-b);return E(h,_,v,x)}return null}function O(e,t,n,r){return a(e,t,n,r,!0)}O.INSERT=r,O.DELETE=n,O.EQUAL=i,t.exports=O}))());function Gm(e){var t,n;let{rangeId:r,segmentId:i,documentDataModel:a,insert:o}=e,s=(t=a.getSelfOrHeaderFooterModel(i).getBody())==null||(t=t.customRanges)==null?void 0:t.find(e=>e.rangeId===r);if(!s)return!1;let{startIndex:c,endIndex:l}=s,u=new Q,d=l-c+1;u.push({t:U.RETAIN,len:c}),u.push({t:U.RETAIN,len:d,body:{dataStream:``,customRanges:[]}}),o&&u.push({t:U.INSERT,body:o,len:o.dataStream.length});let f=l+1+((n=o==null?void 0:o.dataStream.length)==null?0:n);return u.selections=[{startOffset:f,endOffset:f,collapsed:!0}],u}function Km(e){let{ranges:t,rangeId:n,rangeType:r,wholeEntity:i,properties:a,body:o}=e,s=0,c=new Q,l=!1;return t.forEach(e=>{var t,u,d;let f=Um(e,o);if(!f||!o)return!1;let{startOffset:p,endOffset:m}=f,h=(t=o.customRanges)==null?[]:t,g=(e,t,o)=>{var l,u,d,f;let p=Hm(e,t,h,r),m=Math.min((l=(u=p[0])==null?void 0:u.startIndex)==null?1/0:l,e),g=Math.max((d=(f=p[p.length-1])==null?void 0:f.endIndex)==null?-1/0:d,t),_={rangeId:o?`${n}$${o}`:n,rangeType:r,startIndex:0,endIndex:g-m,wholeEntity:i,properties:{...a}};c.push({t:U.RETAIN,len:m-s}),c.push({t:U.RETAIN,len:g-m+1,body:{dataStream:``,customRanges:[_]},coverType:H.COVER}),s=g+1},_=((u=o.paragraphs)==null?[]:u).filter(e=>e.startIndex<m&&e.startIndex>p),v=((d=o.customBlocks)==null?[]:d).filter(e=>e.startIndex<m&&e.startIndex>p);Vm([p,m-1],[..._.map(e=>e.startIndex),...v.map(e=>e.startIndex)]).forEach(([e,t],n)=>g(e,t,n)),l=!0,c.selections=[{startOffset:f.endOffset,endOffset:f.endOffset,collapsed:!0}]}),l?c:!1}function qm(e,t,n=0,r=null,i=!0){e.sort((e,t)=>e.startOffset-t.startOffset);let a=[],{paragraphs:o=[]}=t,s=o==null?void 0:o.find(t=>t.startIndex>=e[0].startOffset&&t.startIndex<e[0].endOffset),c=n;if(e.forEach(e=>{let{startOffset:t,endOffset:n}=e;t>c&&(a.push({t:U.RETAIN,len:t-c}),c=t),c<n&&(a.push({t:U.DELETE,len:n-c}),c=n)}),r&&a.push({t:U.INSERT,body:r,len:r.dataStream.length}),s&&i){let t=o.find(t=>t.startIndex-n>=e[e.length-1].endOffset-1);t&&(t.startIndex>c&&(a.push({t:U.RETAIN,len:t.startIndex-c}),c=t.startIndex),a.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[{...t,startIndex:0,bullet:s==null?void 0:s.bullet}]},coverType:H.REPLACE}))}return a}function Jm(e,t,n=0){let r=[],i=n;return e.forEach(e=>{let{startOffset:n,endOffset:a}=e;n>i&&(r.push({t:U.RETAIN,len:n-i}),i=n),a>i&&(r.push({t:U.RETAIN,len:a-i,body:{...L.deepClone(t),dataStream:``}}),i=a)}),r}let Ym=e=>{var t;let{selection:n,body:r,doc:i}=e,a=n.segmentId,o=(t=i.getSelfOrHeaderFooterModel(a))==null?void 0:t.getBody();if(!o)return!1;let s=n.collapsed?null:nm(o,n.startOffset,n.endOffset),c=(0,Wm.default)(s?s.dataStream:``,r.dataStream),l=0,u=c.map(([e,t])=>{switch(e){case 0:{let e={t:U.RETAIN,body:{...nm(r,l,l+t.length,!1),dataStream:``},len:t.length};return l+=t.length,e}case 1:{let e={t:U.INSERT,body:nm(r,l,l+t.length),len:t.length};return l+=t.length,e}default:return{t:U.DELETE,len:t.length}}}),d=new Q;return d.push({t:U.RETAIN,len:n.startOffset}),d.push(...u),d};function Xm(e,t){return!!((e==null?void 0:e.length)===(t==null?void 0:t.length)&&e!=null&&e.every((e,n)=>JSON.stringify(e)===JSON.stringify(t==null?void 0:t[n])))}let Zm=e=>{var t;let{selection:n,body:r,doc:i,themeService:a}=e,o=n.segmentId,s=(t=i.getSelfOrHeaderFooterModel(o))==null?void 0:t.getBody();if(!s)return!1;let c=n.collapsed?null:nm(s,n.startOffset,n.endOffset),l=(0,Wm.default)(c?c.dataStream:``,r.dataStream),u=0,d=l.map(([e,t])=>{switch(e){case 0:{let e=Zp(r,u,u+t.length,!1),n=Zp(c,u,u+t.length,!1),i={t:U.RETAIN,body:Xm(e,n)?void 0:{textRuns:e==null?void 0:e.map(e=>{var t,n,r,i;return{...e,ts:{...e.ts,cl:!((t=e.ts)==null||(t=t.cl)==null||(t=t.rgb)==null)&&t.includes(`.`)?{rgb:a.getColorFromTheme((n=(r=e.ts)==null||(r=r.cl)==null?void 0:r.rgb)==null?``:n)}:(i=e.ts)==null?void 0:i.cl}}}),dataStream:``},len:t.length};return u+=t.length,i}case 1:{let e={t:U.INSERT,body:nm(r,u,u+t.length),len:t.length};return u+=t.length,e}default:return{t:U.DELETE,len:t.length}}});if(d.every(e=>e.t===U.RETAIN&&!e.body))return!1;let f=new Q;return f.push({t:U.RETAIN,len:n.startOffset}),f.push(...d),f};function Qm(e,t){let n=[],{customBlocks:r=[]}=e;for(let e of t){let{startOffset:t,endOffset:i}=e;if(!(t==null||i==null))for(let e of r){let{startIndex:r}=e;r>=t&&r<i&&n.push(e.blockId)}}return n}function $m(e,t=``){if(!t)return[`body`];let{headers:n,footers:r}=e.getSnapshot();if(n==null&&r==null)throw Error(`Document data model must have headers or footers when update by segment id`);if((n==null?void 0:n[t])!=null)return[`headers`,t,`body`];if((r==null?void 0:r[t])!=null)return[`footers`,t,`body`];throw Error(`Segment id not found in headers or footers`)}let eh=e=>{var t,n;let{selection:r,documentDataModel:i,drawings:a}=e,{collapsed:o,startOffset:s,segmentId:c}=r,l=new Q,u=Tm.getInstance(),d=[],f=i.getSelfOrHeaderFooterModel(c).getBody();if(!f)return!1;let p=(t=(n=i.getSnapshot().drawingsOrder)==null?void 0:n.length)==null?0:t,m=0;if(o)s>0&&l.push({t:U.RETAIN,len:s});else{var h,g;let e=qm([r],f,0,null,!1);l.push(...e);let t=Qm(f,[r]),n=(h=i.getDrawings())==null?{}:h,a=(g=i.getDrawingsOrder())==null?[]:g,o=t.sort((e,t)=>a.indexOf(e)>a.indexOf(t)?-1:+(a.indexOf(e)<a.indexOf(t)));if(o.length>0)for(let e of o){let t=n[e],r=a.indexOf(e);if(t==null||r<0)continue;let i=u.removeOp([`drawings`,e],t),o=u.removeOp([`drawingsOrder`,r],e);d.push(i),d.push(o),m++}}l.push({t:U.INSERT,body:{dataStream:`\b`.repeat(a.length),customBlocks:a.map((e,t)=>({startIndex:t,blockId:e.drawingId}))},len:a.length});let _=$m(i,c),v=u.editOp(l.serialize(),_);d.push(v);for(let e of a){let{drawingId:t}=e,n=u.insertOp([`drawings`,t],e),r=u.insertOp([`drawingsOrder`,p-m],t);d.push(n),d.push(r)}return d.reduce((e,t)=>Tm.compose(e,t),null)};function th(e,t){if(t===void 0)return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function nh(e){let{startOffset:t,endOffset:n,collapsed:r}=e;return{startOffset:Math.min(t,n),endOffset:Math.max(t,n),collapsed:r}}function rh(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}function ih(e,t,n,r){let{startOffset:i,endOffset:a}=e,o=r==null?sh(t,n):r,s=[],c=-1;for(let e=0;e<o.length;e++){let t=o[e],{startIndex:n}=t;(i>c&&i<=n||a>c&&a<=n||n>=i&&n<=a)&&s.push(t),c=n}return s}function ah(e,t,n){let r=[],i=sh(t,n);for(let a of e){let e=ih(a,t,n,i);r.push(...e)}return r}let oh=[Dm.PARAGRAPH,Dm.TABLE_START,Dm.TABLE_END,Dm.TABLE_ROW_START,Dm.TABLE_CELL_START,Dm.TABLE_CELL_END];function sh(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r],{startIndex:a}=i,o=a-1;for(;!oh.includes(t[o])&&o>=0;)o--;n.push({...i,paragraphStart:o+1,paragraphEnd:i.startIndex})}return n}let ch=e=>{var t,n;let{paragraphs:r,segmentId:i,document:a}=e,o=e.listType,s=(t=(n=a.getSelfOrHeaderFooterModel(i).getBody())==null?void 0:n.paragraphs)==null?[]:t,c=r.every(e=>{var t;return((t=e.bullet)==null?void 0:t.listType.indexOf(o))===0}),l=xa(6);if(r.length===1){let e=s.indexOf(r[0]),t=s[e-1],n=s[e+1];t&&t.bullet&&t.bullet.listType.indexOf(o)===0?(l=t.bullet.listId,o!==Z.CHECK_LIST&&(o=t.bullet.listType)):n&&n.bullet&&n.bullet.listType.indexOf(o)===0&&(l=n.bullet.listId,o!==Z.CHECK_LIST&&(o=n.bullet.listType))}let u=new Ui;u.reset();let d=new Q;for(let e of r){var f;let{startIndex:t,paragraphStyle:n={},bullet:r}=e;d.push({t:U.RETAIN,len:t-u.cursor}),d.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[c?{paragraphStyle:n,startIndex:0}:{startIndex:0,paragraphStyle:{...n},bullet:{nestingLevel:(f=r==null?void 0:r.nestingLevel)==null?0:f,textStyle:{fs:20},listType:o,listId:l}}]},coverType:H.REPLACE}),u.moveCursorTo(t+1)}return d},lh=e=>{var t;let{paragraphIndex:n,segmentId:r,document:i}=e,a=(t=i.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:t.paragraphs;if(a==null)return!1;let o=a.find(e=>e.startIndex===n);if(!(o!=null&&o.bullet)||o.bullet.listType.indexOf(Z.CHECK_LIST)===-1)return!1;let s=new Ui;s.reset();let c=new Q,{startIndex:l,paragraphStyle:u={}}=o,d=o.bullet.listType===Z.CHECK_LIST?Z.CHECK_LIST_CHECKED:Z.CHECK_LIST;return c.push({t:U.RETAIN,len:l-s.cursor}),c.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[{...o,paragraphStyle:u,startIndex:0,bullet:{...o.bullet,listType:d}}]},coverType:H.REPLACE}),s.moveCursorTo(l+1),c},uh=e=>{var t;let{paragraphs:n,listType:r,segmentId:i,document:a}=e;if(((t=a.getSelfOrHeaderFooterModel(i).getBody())==null?void 0:t.paragraphs)==null)return!1;let o=xa(6),s=new Ui;s.reset();let c=new Q;for(let e of n){var l;let{startIndex:t,paragraphStyle:n={},bullet:i}=e;c.push({t:U.RETAIN,len:t-s.cursor}),c.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[{startIndex:0,paragraphStyle:n,bullet:{nestingLevel:(l=i==null?void 0:i.nestingLevel)==null?0:l,textStyle:(i==null?void 0:i.listType)===r?i.textStyle:{fs:20},listType:r,listId:o}}]},coverType:H.REPLACE}),s.moveCursorTo(t+1)}return c};function dh(e,t){return t.some(t=>e.startIndex>t.startIndex&&e.startIndex<t.endIndex)}let fh=e=>{var t,n,r;let{paragraphs:i,document:a,type:o}=e,s=new Ui;s.reset();let c=new Q,l=(t=a.getSnapshot().lists)==null?{}:t,u=(n=(r=a.getBody())==null?void 0:r.tables)==null?[]:n,d={...Lp,...l};for(let e of i){let{startIndex:t,paragraphStyle:n={},bullet:r}=e,i=dh(e,u);if(c.push({t:U.RETAIN,len:t-s.cursor}),r){let e=d[r.listType].nestingLevel.length-1;i&&(e=Math.min(e,2)),c.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[{startIndex:0,paragraphStyle:{...n},bullet:{...r,nestingLevel:Math.max(Math.min(r.nestingLevel+o,e),0)}}]},coverType:H.REPLACE})}else c.push({t:U.RETAIN,len:1});s.moveCursorTo(t+1)}return c},ph=e=>{var t,n,r,i;let{textRanges:a,segmentId:o,document:s,style:c,paragraphTextRun:l,cursor:u,deleteLen:d,textX:f}=e,p=s.getSelfOrHeaderFooterModel(o),m=ah(a,(t=(n=p.getBody())==null?void 0:n.paragraphs)==null?[]:t,(r=(i=p.getBody())==null?void 0:i.dataStream)==null?``:r),h=new Ui;u&&h.moveCursorTo(u);let g=f==null?new Q:f;m.sort((e,t)=>e.startIndex-t.startIndex);let _=Math.max(0,m[0].paragraphStart-1);_>h.cursor&&(g.push({t:U.RETAIN,len:_-h.cursor}),h.moveCursorTo(_)),d&&g.push({t:U.DELETE,len:d});for(let e of m){let{startIndex:t,paragraphStyle:n={}}=e,r=t-h.cursor;g.push({t:U.RETAIN,len:r,...l?{body:{dataStream:``,textRuns:[{ts:l,st:0,ed:r}]},coverType:H.REPLACE}:null}),g.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[{startIndex:0,paragraphStyle:{...n,...c}}]},coverType:H.REPLACE}),h.moveCursorTo(t+1)}return g};var mh=class{};F(mh,`customRange`,{add:Km,delete:Gm,copyCustomRange:Bm,getCustomRangesInterestsWithSelection:zm,isIntersecting:Rm}),F(mh,`customDecoration`,{add:Im,delete:Lm}),F(mh,`selection`,{replace:Ym,makeSelection:th,normalizeSelection:nh,delete:qm,replaceTextRuns:Zm,retain:Jm}),F(mh,`range`,{isIntersects:rh,getParagraphsInRange:ih,getParagraphsInRanges:ah}),F(mh,`transform`,{getPlainText:Am,fromPlainText:Mm,isEmptyDocument:jm}),F(mh,`paragraph`,{bullet:{set:uh,switch:ch,toggleChecklist:lh,changeNestLevel:fh},style:{set:ph},util:{transform:sh,getParagraphsInRange:ih,getParagraphsInRanges:ah}}),F(mh,`drawing`,{add:eh});function hh(e,t,n,r){if(t===``)return e;let i=new Fm({id:`mock-id`,body:e,documentStyle:{}}),a=t.length,o;for(;(o=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){let e=new Q,t=Tm.getInstance();if(o>0&&e.retain(o),n.length>0){var s;let t=i.sliceBody(o,o+a),r={dataStream:n};Array.isArray(t==null?void 0:t.textRuns)&&t.textRuns.length&&(r.textRuns=[{...t.textRuns[0],st:0,ed:n.length}]),!(t==null||(s=t.customRanges)==null)&&s.length&&(r.customRanges=[{...t.customRanges[0],startIndex:0,endIndex:n.length-1}]),e.insert(n.length,r)}e.delete(a),i.apply(t.editOp(e.serialize()))}let c=i.getBody();return i.dispose(),c}function gh(e){if(e.customRanges||(e.customRanges=[]),!e.paragraphs){e.paragraphs=[];for(let t=0;t<e.dataStream.length;t++)e.dataStream[t]===`\r`&&e.paragraphs.push({startIndex:t})}return e.customBlocks||(e.customBlocks=[]),e.textRuns||(e.textRuns=[]),e.customDecorations||(e.customDecorations=[]),e.sectionBreaks||(e.sectionBreaks=[]),e.tables||(e.tables=[]),e}function _h(e){var t;return e.body=gh((t=e.body)==null?{dataStream:``}:t),e.drawingsOrder||(e.drawingsOrder=[]),e.drawings||(e.drawings={}),e.documentStyle||(e.documentStyle={}),e}var vh=class e{static create(t={}){return new e(t)}constructor(e={}){F(this,`_style`,void 0),this._style=e}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===z.TRUE}get bold(){return this._style.bl===z.TRUE}get underline(){return this._style.ul&&bh.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&bh.create(this._style.bbl)}get strikethrough(){return this._style.st&&bh.create(this._style.st)}get overline(){return this._style.ol&&bh.create(this._style.ol)}get background(){return this._style.bg}get border(){return this._style.bd}get color(){return this._style.cl}get verticalAlign(){return this._style.va}get numberFormat(){return this._style.n}copy(){return yh.create(L.deepClone(this._style))}getValue(){return{...this._style}}},yh=class e extends vh{static create(t={}){return new e(t)}constructor(e={}){super(e)}setFontFamily(e){return this._style.ff=e,this}setFontSize(e){return this._style.fs=e,this}setItalic(e){return this._style.it=+!!e,this}setBold(e){return this._style.bl=+!!e,this}setUnderline(e){return this._style.ul=e.build(),this}setBottomBorderLine(e){return this._style.bbl=e.build(),this}setStrikethrough(e){return this._style.st=e.build(),this}setOverline(e){return this._style.ol=e.build(),this}setBackground(e){return this._style.bg=e,this}setBorder(e){return this._style.bd=e,this}setColor(e){return this._style.cl=e,this}setVerticalAlign(e){return this._style.va=e,this}copy(){return e.create(L.deepClone(this._style))}build(){return this.getValue()}},bh=class e{static create(t={s:1}){return new e(t)}constructor(e={s:1}){F(this,`_decoration`,void 0),this._decoration=e}get show(){return this._decoration.s===z.TRUE}get followFontColor(){return this._decoration.c===z.TRUE}get color(){return this._decoration.cl}get type(){return this._decoration.t}setShow(e){return this._decoration.s=+!!e,this}setFollowFontColor(e){return this._decoration.c=+!!e,this}setColor(e){return this._decoration.cl=e,this}setLineType(e){return this._decoration.t=e,this}copy(){return e.create(L.deepClone(this._decoration))}build(){return{...this._decoration}}},xh=class e{static create(t={}){return new e(t)}constructor(e={}){F(this,`_style`,void 0),this._style=e}get indentFirstLine(){return this._style.indentFirstLine}get hanging(){return this._style.hanging}get indentStart(){return this._style.indentStart}get tabStops(){return this._style.tabStops}get indentEnd(){return this._style.indentEnd}get textStyle(){return this._style.textStyle}get headingId(){return this._style.headingId}get namedStyleType(){return this._style.namedStyleType}get horizontalAlign(){return this._style.horizontalAlign}get lineSpacing(){return this._style.lineSpacing}get direction(){return this._style.direction}get spacingRule(){return this._style.spacingRule}get snapToGrid(){return this._style.snapToGrid}get spaceAbove(){return this._style.spaceAbove}get spaceBelow(){return this._style.spaceBelow}get borderBetween(){return this._style.borderBetween}get borderTop(){return this._style.borderTop}get borderBottom(){return this._style.borderBottom}get borderLeft(){return this._style.borderLeft}get borderRight(){return this._style.borderRight}get keepLines(){return this._style.keepLines===z.TRUE}get keepNext(){return this._style.keepNext===z.TRUE}get wordWrap(){return this._style.wordWrap===z.TRUE}get widowControl(){return this._style.widowControl===z.TRUE}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===z.TRUE}copy(){return Sh.create(L.deepClone(this._style))}getValue(){return this._style}},Sh=class e extends xh{static create(t={}){return new e(t)}constructor(e={}){super(e)}setIndentFirstLine(e){return this._style.indentFirstLine=e,this}setHanging(e){return this._style.hanging=e,this}setIndentStart(e){return this._style.indentStart=e,this}setTabStops(e){return this._style.tabStops=e,this}setIndentEnd(e){return this._style.indentEnd=e,this}setTextStyle(e){return this._style.textStyle=e,this}setHeadingId(e){return this._style.headingId=e,this}setNamedStyleType(e){return this._style.namedStyleType=e,this}setHorizontalAlign(e){return this._style.horizontalAlign=e,this}setLineSpacing(e){return this._style.lineSpacing=e,this}setDirection(e){return this._style.direction=e,this}setSpacingRule(e){return this._style.spacingRule=e,this}setSnapToGrid(e){return this._style.snapToGrid=+!!e,this}setSpaceAbove(e){return this._style.spaceAbove=e,this}setSpaceBelow(e){return this._style.spaceBelow=e,this}setBorderBetween(e){return this._style.borderBetween=e,this}setBorderTop(e){return this._style.borderTop=e,this}setBorderBottom(e){return this._style.borderBottom=e,this}setBorderLeft(e){return this._style.borderLeft=e,this}setBorderRight(e){return this._style.borderRight=e,this}setKeepLines(e){return this._style.keepLines=+!!e,this}setKeepNext(e){return this._style.keepNext=+!!e,this}setWordWrap(e){return this._style.wordWrap=+!!e,this}setWidowControl(e){return this._style.widowControl=+!!e,this}setShading(e){return this._style.shading=e,this}setSuppressHyphenation(e){return this._style.suppressHyphenation=+!!e,this}copy(){return e.create(L.deepClone(this._style))}build(){return this.getValue()}},Ch=class e{static create(t){return new e(t)}static createByBody(t){return new e({body:t,id:`d`,documentStyle:{}})}constructor(e){if(F(this,`_data`,void 0),!e.body)throw Error(`Invalid document data, body is required`);this._data=_h(e)}copy(){return wh.create(L.deepClone(this._data))}slice(e,t){let{body:n,...r}=this._data;return wh.create({...L.deepClone(r),body:nm(n,e,t)})}toPlainText(){var e,t;return mh.transform.getPlainText((e=(t=this._data.body)==null?void 0:t.dataStream)==null?``:e).replaceAll(`\r`,`
|
|
6
|
-
`)}getParagraphStyle(){var e;return
|
|
7
|
-
`,customBlocks:[],customRanges:[],paragraphs:[{startIndex:0}],textRuns:[],tables:[],sectionBreaks:[]}})}static create(t){return new e(t==null?e.newEmptyData():t)}constructor(e){super(e),F(this,`_doc`,void 0),this._doc=new Fm(e)}insertText(e,t,n){var r,i;let a=((r=(i=this._data.body)==null?void 0:i.dataStream.length)==null?2:r)-2,o,s;if(typeof e==`string`?o=e:(a=Math.min(e,a),o=t),s=typeof t==`object`?t instanceof yh?t.build():t:n instanceof yh?n.build():n,!o)return this;let c={dataStream:o,textRuns:s?[{ts:s,st:a,ed:a+o.length}]:[]},l=mh.selection.replace({doc:this._doc,selection:{startOffset:a,endOffset:a,collapsed:!0},body:c});if(!l)throw Error(`Insert text failed, please check.`);return Q.apply(this._doc.getBody(),l.serialize()),this}insertRichText(e,t){var n,r;let i=((n=(r=this._data.body)==null?void 0:r.dataStream.length)==null?2:n)-2,a;typeof e==`object`?a=e instanceof Ch?e.getData():e:(i=Math.min(e,i),a=t instanceof Ch?t.getData():t);let o=mh.selection.replace({doc:this._doc,selection:{startOffset:i,endOffset:i,collapsed:!0},body:a.body});if(!o)throw Error(`Insert text failed, please check.`);return Q.apply(this._doc.getBody(),o.serialize()),this}delete(e,t){if(t!==void 0){if(!t)return this;let n=mh.selection.delete([{startOffset:e,endOffset:e+t,collapsed:!0}],this._data.body);Q.apply(this._doc.getBody(),n)}return this}setStyle(e,t,n){let r={dataStream:``,textRuns:[{ts:n instanceof yh?n.build():n,st:0,ed:t-e}]},i=mh.selection.retain([{startOffset:e,endOffset:t,collapsed:!0}],r);return Q.apply(this._doc.getBody(),i),this}setLink(e,t,n){let r=mh.customRange.add({rangeType:to.HYPERLINK,rangeId:xa(),properties:{url:n},ranges:[{startOffset:e,endOffset:t,collapsed:!1}],body:this._data.body});if(!r)throw Error(`Insert text failed, please check.`);return Q.apply(this._doc.getBody(),r.serialize()),this}cancelLink(e,t){if(typeof e==`string`){let t=mh.customRange.delete({rangeId:e,documentDataModel:this._doc});if(!t)throw Error(`Insert text failed, please check.`);Q.apply(this._doc.getBody(),t.serialize())}else this.slice(e,t).getLinks().forEach(e=>{let t=mh.customRange.delete({rangeId:e.rangeId,documentDataModel:this._doc});if(!t)throw Error(`Insert text failed, please check.`);Q.apply(this._doc.getBody(),t.serialize())});return this}updateLink(e,t){var n;let r=(n=this._data.body)==null||(n=n.customRanges)==null?void 0:n.find(t=>t.rangeId===e);if(!r)throw Error(`Link not found`);return r.properties.url=t,this}insertParagraph(e,t){let n,r;if(typeof e==`object`){var i,a;n={dataStream:`\r`,paragraphs:[{startIndex:0,paragraphStyle:e.build()}]},r=((i=(a=this._data.body)==null?void 0:a.dataStream.length)==null?2:i)-2}else r=e,n={dataStream:`\r`,paragraphs:[{startIndex:0,paragraphStyle:t==null?void 0:t.build()}]};return this.insertRichText(r,Ch.create({body:n,id:`d`,documentStyle:{}})),this}insertLink(t,n,r){let i=``,a=``;typeof t==`string`?(i=t,a=n):(i=n,a=r);let o=e.createByBody({dataStream:i,customRanges:[{rangeType:to.HYPERLINK,rangeId:xa(),properties:{url:a},startIndex:0,endIndex:i.length-1}]});return typeof t==`number`?this.insertRichText(t,o):this.insertRichText(o)}},Th=class{constructor(){F(this,`skipNextObservers`,!1),F(this,`lastReturnValue`,void 0),F(this,`isStopPropagation`,!1)}stopPropagation(){this.isStopPropagation=!0}},Eh=class extends r.Subject{constructor(...e){super(...e),F(this,`_sortedObservers`,[])}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(e){let t;t=typeof e==`function`?{next:([t,n])=>e(t,n)}:e;let n=super.subscribe(t);return this._sortedObservers.push(t),this._sortedObservers.sort((e,t)=>{var n,r;return((n=e.priority)==null?0:n)-((r=t.priority)==null?0:r)}),n.add(()=>this._sortedObservers=this._sortedObservers.filter(e=>e!==t)),n}clearObservers(){this._sortedObservers.forEach(e=>{var t;return(t=e.complete)==null?void 0:t.call(e)}),this._sortedObservers.length=0}emitEvent(e){if(!this.closed){let n=new Th;n.lastReturnValue=e;for(let r of this._sortedObservers){var t;if(n.lastReturnValue=(t=r.next)==null?void 0:t.call(r,[e,n]),n.skipNextObservers)return{handled:!0,lastReturnValue:n.lastReturnValue,stopPropagation:n.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:n.lastReturnValue,stopPropagation:n.isStopPropagation}}throw Error(`[EventSubject]: cannot emit event on a closed subject.`)}};function Dh(e){return new r.Observable(t=>{let n=e.subscribeEvent(e=>{t.next(e)});return()=>n.unsubscribe()})}let Oh=(0,t.createIdentifier)(`core.resource-manager.service`),kh={[n.UnitRole.Editor]:`Editor`,[n.UnitRole.Owner]:`Owner`,[n.UnitRole.Reader]:`Reader`,[n.UnitRole.UNRECOGNIZED]:`UNRECOGNIZED`},Ah=e=>e?{userID:`${kh[e]}_${xa(8)}`,name:kh[e],avatar:``}:{userID:``,name:``,avatar:``,anonymous:!0,canBindAnonymous:!1},jh=(e,t)=>e.startsWith(kh[t]);var Mh=class extends ra{constructor(...e){super(...e),F(this,`_model`,new Map),F(this,`_userChange$`,new r.Subject),F(this,`userChange$`,this._userChange$.asObservable()),F(this,`_currentUser$`,new r.BehaviorSubject(Ah())),F(this,`currentUser$`,this._currentUser$.asObservable())}dispose(){super.dispose(),this._model.clear(),this._userChange$.complete(),this._currentUser$.complete()}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(e){this.addUser(e),this._currentUser$.next(e)}addUser(e){this._model.set(e.userID,e),this._userChange$.next({type:`add`,user:e})}getUser(e,t){let n=this._model.get(e);if(n)return n;t&&t()}delete(e){let t=this.getUser(e);this._model.delete(e),t&&this._userChange$.next({type:`delete`,user:t})}clear(){this._model.clear(),this._userChange$.next({type:`clear`})}list(){return Array.from(this._model.values())}};let Nh=class{constructor(e,t){this._resourceManagerService=e,this._userManagerService=t,F(this,`_permissionMap`,new Map([])),F(this,`_permissionOverrides`,new Map),F(this,`_cfgEnableObjInherit`,!1),this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){let e=this._userManagerService.getCurrentUser();e&&e.userID||this._userManagerService.setCurrentUser(Ah(n.UnitRole.Owner))}_getRole(e){let t=this._userManagerService.getCurrentUser();return t?jh(t.userID,e):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:e=>{let t=[...this._permissionMap.keys()].reduce((e,t)=>(e[t]=this._permissionMap.get(t),e),{});return JSON.stringify(t)},parseJson:e=>JSON.parse(e),pluginName:`SHEET_AuthzIoMockService_PLUGIN`,businesses:[n.UniverType.UNIVER_SHEET,n.UniverType.UNIVER_DOC,n.UniverType.UNIVER_SLIDE],onLoad:(e,t)=>{for(let e in t)this._permissionMap.set(e,t[e])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(e){let t=xa(8),{objectType:r,selectRangeObject:i,worksheetObject:a}=e,o=i||a,s={objectType:r,unitID:(o==null?void 0:o.unitID)||``,name:(o==null?void 0:o.name)||``,strategies:[{action:6,role:n.UnitRole.Owner},{action:16,role:n.UnitRole.Owner},{action:17,role:n.UnitRole.Owner},{action:18,role:n.UnitRole.Owner},{action:19,role:n.UnitRole.Owner},{action:33,role:n.UnitRole.Owner},{action:34,role:n.UnitRole.Owner},{action:35,role:n.UnitRole.Owner},{action:36,role:n.UnitRole.Owner},{action:37,role:n.UnitRole.Owner},{action:38,role:n.UnitRole.Owner},{action:39,role:n.UnitRole.Owner},{action:40,role:n.UnitRole.Owner}],selectRangeObject:i};return this._permissionMap.set(t,s),t}async allowed(e){let{objectID:t,actions:r}=e,i=this._permissionMap.get(t);return i?r.map(e=>{let r=`${t}:${e}`;if(this._permissionOverrides.has(r))return{action:e,allowed:this._permissionOverrides.get(r)};let a=i.strategies.find(t=>t.action===e);return a?{action:e,allowed:this._getRole(a.role)}:{action:e,allowed:this._getRole(n.UnitRole.Owner)||this._getRole(n.UnitRole.Editor)}}):r.map(e=>({action:e,allowed:this._getRole(n.UnitRole.Owner)||this._getRole(n.UnitRole.Editor)}))}async batchAllowed(e){let t=await Promise.all(e.map(e=>this.allowed(e)));return e.map((e,n)=>({unitID:e.unitID,objectID:e.objectID,actions:t[n]}))}async list(e){let t=[],r=[{action:6,role:n.UnitRole.Owner},{action:16,role:n.UnitRole.Owner},{action:17,role:n.UnitRole.Owner},{action:18,role:n.UnitRole.Owner},{action:19,role:n.UnitRole.Owner},{action:33,role:n.UnitRole.Owner},{action:34,role:n.UnitRole.Owner},{action:35,role:n.UnitRole.Owner},{action:36,role:n.UnitRole.Owner},{action:37,role:n.UnitRole.Owner},{action:38,role:n.UnitRole.Owner},{action:39,role:n.UnitRole.Owner},{action:40,role:n.UnitRole.Owner}];return e.objectIDs.forEach(i=>{let a=this._permissionMap.get(i),o=(a==null?void 0:a.strategies)||r,s={objectID:i,unitID:e.unitID,objectType:(a==null?void 0:a.objectType)||3,name:(a==null?void 0:a.name)||``,shareOn:!1,shareRole:n.UnitRole.Owner,shareScope:-1,scope:{read:n.ObjectScope.AllCollaborator,edit:n.ObjectScope.AllCollaborator},creator:Ah(n.UnitRole.Owner),strategies:o.map(e=>({action:e.action,role:e.role})),actions:e.actions.map(e=>{let t=`${i}:${e}`;if(this._permissionOverrides.has(t))return{action:e,allowed:this._permissionOverrides.get(t)};let r=o.find(t=>t.action===e);return r?{action:e,allowed:this._getRole(r.role)}:{action:e,allowed:this._getRole(n.UnitRole.Owner)||this._getRole(n.UnitRole.Editor)}})};t.push(s)}),t}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(e){let{objectID:t,strategies:r}=e,i=this._permissionMap.get(t);i&&r&&(i.strategies=r.map(e=>({action:e.action,role:e.role})),this._permissionMap.set(t,i),r.forEach(e=>{e.role===n.UnitRole.Reader?this.setPermissionOverride(t,e.action,!1):(e.role===n.UnitRole.Owner||e.role===n.UnitRole.Editor)&&this.clearPermissionOverride(t,e.action)}))}setPermissionOverride(e,t,n){let r=`${e}:${t}`;this._permissionOverrides.set(r,n)}clearPermissionOverride(e,t){let n=`${e}:${t}`;this._permissionOverrides.delete(n)}clearAllOverrides(e){let t=[];this._permissionOverrides.forEach((n,r)=>{r.startsWith(`${e}:`)&&t.push(r)}),t.forEach(e=>this._permissionOverrides.delete(e))}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(e){}setCfgEnableObjInherit(e){this._cfgEnableObjInherit=e}getCfgEnableObjInherit(){return this._cfgEnableObjInherit}};Nh=ss([W(0,Oh),W(1,(0,t.Inject)(Mh))],Nh);let Ph=(0,t.createIdentifier)(`IAuthzIoIoService`),Fh=(0,t.createIdentifier)(`univer.confirm-service`);var Ih=class{constructor(){F(this,`confirmOptions$`,new r.Subject)}dispose(){this.confirmOptions$.complete()}open(e){throw Error(`This is not implemented in the test service!`)}confirm(e){return Promise.resolve(!0)}close(e){throw Error(`This is not implemented in the test service!`)}};let Lh=`FOCUSING_UNIT`,Rh=`FOCUSING_SHEET`,zh=`FOCUSING_DOC`,Bh=`FOCUSING_SLIDE`,Vh=`EDITOR_ACTIVATED`,Hh=`FOCUSING_FX_BAR_EDITOR`;var Uh=class extends ra{constructor(...e){super(...e),F(this,`_error$`,new r.Subject),F(this,`error$`,this._error$.asObservable())}dispose(){this._error$.complete()}emit(e){this._error$.next({errorKey:e})}};let Wh=function(e){return e.URL=`URL`,e.UUID=`UUID`,e.BASE64=`BASE64`,e}({}),Gh=function(e){return e.SUCCUSS=`0`,e.ERROR_EXCEED_SIZE=`1`,e.ERROR_IMAGE_TYPE=`2`,e.ERROR_UPLOAD_COUNT_LIMIT=`3`,e.ERROR_IMAGE=`4`,e}({}),Kh=(0,t.createIdentifier)(`core.image-io.service`),qh=(0,t.createIdentifier)(`core.url-image.service`);var Jh=`@univerjs/core`,Yh=`0.21.1`;function Xh(e=``,t=Ia.ZH_CN,n=``){return{id:e,sheetOrder:[],name:n,appVersion:Yh,locale:t,styles:{},sheets:{},resources:[]}}var Zh=class{constructor(e={}){F(this,`_styles`,void 0),F(this,`_cacheMap`,new of(1e5)),this._styles=e,this._generateCacheMap()}each(e){return Object.entries(this._styles).forEach(e),this}search(e,t){return this._cacheMap.has(t)?this._cacheMap.get(t):this._getExistingStyleId(e)||`-1`}get(e){return typeof e==`string`?(e=String(e),this._styles[e]):e}add(e,t){let n=xa(6);return this._styles[n]=e,this._cacheMap.set(t,n),n}setValue(e){if(e==null)return;let t=JSON.stringify(e),n=this.search(e,t);return n===`-1`?this.add(e,t):n}addCustomStyle(e,t){t!=null&&(this._styles[e]=t,this._cacheMap.set(JSON.stringify(t),e))}remove(e){let t=this._styles[e];t&&(delete this._styles[e],this._cacheMap.delete(JSON.stringify(t)))}toJSON(){return this._styles}getStyleByCell(e){let t;t=e&&L.isObject(e.s)?e.s:(e==null?void 0:e.s)&&this.get(e.s);let n=e==null?void 0:e.interceptorStyle;return n?{...t,...n}:t}_generateCacheMap(){let{_styles:e,_cacheMap:t}=this;for(let n in e){let r=JSON.stringify(e[n]);t.set(r,n)}}_getExistingStyleId(e){let{_styles:t}=this;for(let n in t)if(L.diffValue(t[n],e))return n;return null}};let Qh=(e,t)=>t.length===e.length&&!e.some(e=>t.some(t=>!Qf.equals(t,e))),$h=(e,t)=>t.length===e.length&&e.every((e,n)=>{let r=t[n];return r.unitId===e.unitId&&r.sheetId===e.sheetId&&Qf.equals(e.range,r.range)}),eg={t:0,b:2,l:2,r:2},tg=e=>({sbr:.6,sbo:e,spr:.6,spo:e});function ng(e,t,n={}){let r=e.length,{textRotation:i,paddingData:a,horizontalAlign:o=Ua.UNSPECIFIED,verticalAlign:s=Wa.UNSPECIFIED,wrapStrategy:c=Ga.UNSPECIFIED,cellValueType:l}=n,{t:u,r:d,b:f,l:p}=a||eg,{vertexAngle:m,centerAngle:h}=ug(i);return new Fm({id:`d`,body:{dataStream:`${e}\r
|
|
8
|
-
`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:1/0,height:1/0},marginTop:u,marginBottom:f,marginRight:d,marginLeft:p,renderConfig:{horizontalAlign:o,verticalAlign:s,centerAngle:h,vertexAngle:m,wrapStrategy:c,cellValueType:l}},drawings:{},drawingsOrder:[]})}function rg(e){if(!e)return{};let{tr:t,td:n,ht:r,vt:i,tb:a,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:i,wrapStrategy:a,paddingData:o}}function ig(e){if(!e)return{};let{ff:t,fs:n,it:r,bl:i,ul:a,st:o,ol:s,cl:c}=e,l={};return t&&(l.ff=t),n&&(l.fs=n),r&&(l.it=r),i&&(l.bl=i),a&&(l.ul=a),o&&(l.st=o),s&&(l.ol=s),c&&(l.cl=c),l}function ag(e,t,n){var r;let i=e.getBody();if((r=i.customRanges)!=null&&r.some(e=>e.rangeType===to.HYPERLINK))return;let a=mh.customRange.add({ranges:[{startOffset:0,endOffset:i.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:to.HYPERLINK,body:i,properties:{url:t,refId:n}});a&&Q.apply(i,a.serialize())}function og(e){return e!=null}function sg(){return{p:null,s:null,v:null,t:null,f:null,si:null,ref:null,xf:null}}function cg(e){let t=hf.ff,n=hf.fs;if(!e){let e=`${n}pt ${t}`;return{fontCache:e,fontString:e,fontSize:n,originFontSize:n,fontFamily:t}}let r=Co.ITALIC;(e.it===0||e.it===void 0)&&(r=Co.NORMAL);let i=Co.BOLD;(e.bl===0||e.bl===void 0)&&(i=Co.NORMAL);let a=n;e.fs&&(a=Math.ceil(e.fs));let o=t;if(e.ff){let n=e.ff;n=n.replace(/"/g,``).replace(/'/g,``),n.indexOf(` `)>-1&&(n=`"${n}"`),n==null&&(n=t),o=n}let{va:s}=e,c=a;if(s===Ja.SUBSCRIPT||s===Ja.SUPERSCRIPT){let{sbr:e,spr:t}=lg(o,c);c*=s===Ja.SUBSCRIPT?e:t}let l=`${r} ${i} ${c}pt ${o}`;return{fontCache:l,fontString:`${l}, "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif `,fontSize:c,originFontSize:a,fontFamily:o}}function lg(e,t){return tg(t)}function ug(e){let{a:t=0,v:n=z.FALSE}=e||{a:0,v:z.FALSE},r=0,i=t;return n===z.TRUE&&(r=90,i=90),{centerAngle:r,vertexAngle:i}}function dg(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e)){let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=dg(e[r]);return n}let t={},n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r];t[i]=dg(e[i])}return t}function fg(e){if(e==null)return e;let t={};return e.p!==void 0&&(t.p=e.p===null?null:dg(e.p)),e.s!==void 0&&(e.s===null||typeof e.s==`string`?t.s=e.s:t.s=dg(e.s)),e.v!==void 0&&(t.v=e.v),e.t!==void 0&&(t.t=e.t),e.f!==void 0&&(t.f=e.f),e.ref!==void 0&&(t.ref=e.ref),e.xf!==void 0&&(t.xf=e.xf),e.si!==void 0&&(t.si=e.si),e.custom!==void 0&&(t.custom=e.custom===null?null:dg(e.custom)),t}function pg(e){if(e==null)return e;let t={};return e.p!==void 0&&(t.p=e.p===null?null:dg(e.p)),e.s!==void 0&&(e.s===null||typeof e.s==`string`?t.s=e.s:t.s=dg(e.s)),e.v!==void 0&&(t.v=e.v),e.t!==void 0&&(t.t=e.t),e.f!==void 0&&(t.f=e.f),e.ref!==void 0&&(t.ref=e.ref),e.xf!==void 0&&(t.xf=e.xf),e.si!==void 0&&(t.si=e.si),e.custom!==void 0&&(t.custom=e.custom===null?null:dg(e.custom)),e.rowSpan!==void 0&&(t.rowSpan=e.rowSpan),e.colSpan!==void 0&&(t.colSpan=e.colSpan),e.displayV!==void 0&&(t.displayV=e.displayV),t}function mg(e){let t={},n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r],a=Number(i),o=e[a];if(o===void 0)continue;let s={},c=Object.keys(o);for(let e=0,t=c.length;e<t;e++){let t=c[e],n=Number(t),r=o[n];r!=null&&(s[n]=fg(r))}t[a]=s}return t}function hg(e){let t={},n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r],a=Number(i),o=e[a];if(o===void 0)continue;let s={};`h`in o&&o.h!==void 0&&(s.h=o.h),`ia`in o&&o.ia!==void 0&&(s.ia=o.ia),`ah`in o&&o.ah!==void 0&&(s.ah=o.ah),`hd`in o&&o.hd!==void 0&&(s.hd=o.hd),`w`in o&&o.w!==void 0&&(s.w=o.w),`s`in o&&o.s!==void 0&&(o.s===null||typeof o.s==`string`?s.s=o.s:s.s=dg(o.s)),`custom`in o&&o.custom!==void 0&&(s.custom=o.custom===null?null:dg(o.custom)),t[a]=s}return t}function gg(e){let t=e.length,n=Array(t);for(let r=0;r<t;r++){let t=e[r];n[r]={startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType,startAbsoluteRefType:t.startAbsoluteRefType,endAbsoluteRefType:t.endAbsoluteRefType}}return n}function _g(e){let t={id:e.id,name:e.name,tabColor:e.tabColor,hidden:e.hidden,rowCount:e.rowCount,columnCount:e.columnCount,zoomRatio:e.zoomRatio,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,defaultColumnWidth:e.defaultColumnWidth,defaultRowHeight:e.defaultRowHeight,showGridlines:e.showGridlines,rightToLeft:e.rightToLeft,freeze:{xSplit:e.freeze.xSplit,ySplit:e.freeze.ySplit,startRow:e.freeze.startRow,startColumn:e.freeze.startColumn},rowHeader:{width:e.rowHeader.width,hidden:e.rowHeader.hidden},columnHeader:{height:e.columnHeader.height,hidden:e.columnHeader.hidden},mergeData:gg(e.mergeData),cellData:mg(e.cellData),rowData:hg(e.rowData),columnData:hg(e.columnData)};return e.gridlinesColor!==void 0&&(t.gridlinesColor=e.gridlinesColor),e.defaultStyle!==void 0&&(e.defaultStyle===null||typeof e.defaultStyle==`string`?t.defaultStyle=e.defaultStyle:t.defaultStyle=dg(e.defaultStyle)),e.custom!==void 0&&(t.custom=e.custom===null?null:dg(e.custom)),t}var vg=class{constructor(e,t){this._config=e,F(this,`_columnData`,{}),this._columnData=t}getColumnData(){return this._columnData}getColVisible(e){let{_columnData:t}=this,n=t[e];return n?n.hd!==z.TRUE:!0}getColumnStyle(e){var t;return(t=this._columnData[e])==null?void 0:t.s}setColumnStyle(e,t){let n=this.getColumnOrCreate(e);n.s=t}getHiddenCols(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getColVisible(a);r&&e?(r=!1,n.push({rangeType:G.COLUMN,startColumn:i,endColumn:a-1,startRow:0,endRow:0})):!r&&!e&&(r=!0,i=a)}return r&&n.push({startRow:0,endRow:0,startColumn:i,endColumn:t,rangeType:G.COLUMN}),n}getVisibleCols(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getColVisible(a);r&&!e?(r=!1,n.push({rangeType:G.COLUMN,startColumn:i,endColumn:a-1,startRow:0,endRow:0})):!r&&e&&(r=!0,i=a)}return r&&n.push({startRow:0,endRow:0,startColumn:i,endColumn:t,rangeType:G.COLUMN}),n}getColumnDatas(e,t){let n={},r=0;for(let i=e;i<e+t;i++){let e=this.getColumn(i);n[r]=e==null?{w:this._config.defaultColumnWidth,hd:z.FALSE}:e,r++}return n}getSize(){return Iu(this._columnData)}getColumnWidth(e){var t,n;return(t=(n=this._columnData[e])==null?void 0:n.w)==null?this._config.defaultColumnWidth:t}setColumnWidth(e,t){let n=this._columnData[e];t===this._config.defaultColumnWidth?n&&(delete n.w,Object.keys(n).length===0&&delete this._columnData[e]):this._columnData[e]=n?{...n,w:t}:{w:t}}getColumn(e){return this._columnData[e]}insertColumnsWithData(e,t,n){let r=t-e+1,i=Object.keys(this._columnData);for(let t=i.length-1;t>=0;t--){let n=Number(i[t]);n>=e&&(this._columnData[n+r]=this._columnData[n],delete this._columnData[n])}for(let r=e;r<=t;r++){let t=n==null?void 0:n[r-e];t!=null&&Object.keys(t).length>0&&(this._columnData[r]={...t})}}removeColumn(e){delete this._columnData[e]}getColumnOrCreate(e){let{_columnData:t}=this,n=t[e];if(n)return n;let r={};return this._columnData[e]=r,r}setCustomMetadata(e,t){let n=this.getColumn(e);n&&(n.custom=t)}getCustomMetadata(e){var t;return(t=this.getColumn(e))==null?void 0:t.custom}},yg=class{constructor(e,t,n){this._config=e,this._viewModel=t,F(this,`_rowData`,void 0),this._rowData=n}getRowData(){return this._rowData}getRowStyle(e){var t;return(t=this._rowData[e])==null?void 0:t.s}setRowStyle(e,t){let n=this.getRowOrCreate(e);n.s=t}getRowDatas(e,t){let n={},r=0;for(let i=e;i<e+t;i++){let e=this.getRow(i);n[r]=e==null?{h:this._config.defaultRowHeight,hd:z.FALSE}:e,r++}return n}getRowHeight(e,t=1){let{_rowData:n}=this,r=this._config,i=0;for(let a=0;a<t;a++){let{ia:t,ah:o,h:s=r.defaultRowHeight}=n[a+e]||{hd:z.FALSE,h:r.defaultRowHeight};i+=(t==null||t===z.TRUE)&&typeof o==`number`?o:s}return i}setRowHeight(e,t){let n=this._rowData[e];if(t===this._config.defaultRowHeight)n&&(delete n.h,Object.keys(n).length===0&&delete this._rowData[e]);else{let r=Math.min(t,2e3);this._rowData[e]=n?{...n,h:r}:{h:r}}}getRow(e){return this._rowData[e]}insertRowsWithData(e,t,n){let r=t-e+1,i=Object.keys(this._rowData);for(let t=i.length-1;t>=0;t--){let n=Number(i[t]);n>=e&&(this._rowData[n+r]=this._rowData[n],delete this._rowData[n])}for(let r=e;r<=t;r++){let t=n==null?void 0:n[r-e];t!=null&&Object.keys(t).length>0&&(this._rowData[r]={...t})}}removeRow(e){delete this._rowData[e]}getRowOrCreate(e){let{_rowData:t}=this,n=t[e];if(n)return n;let r={};return t[e]=r,r}getHiddenRows(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getRowRawVisible(a);r&&e?(r=!1,n.push({startRow:i,endRow:a-1,startColumn:0,endColumn:0,rangeType:G.ROW})):!r&&!e&&(r=!0,i=a)}return r&&n.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:G.ROW}),n}getVisibleRows(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getRowRawVisible(a);r&&!e?(r=!1,n.push({startRow:i,endRow:a-1,startColumn:0,endColumn:0,rangeType:G.ROW})):!r&&e&&(r=!0,i=a)}return r&&n.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:G.ROW}),n}getRowRawVisible(e){let t=this.getRow(e);return t?t.hd!==z.TRUE:!0}getSize(){return Iu(this._rowData)}setCustomMetadata(e,t){let n=this.getRow(e);n&&(n.custom=t)}getCustomMetadata(e){var t;return(t=this.getRow(e))==null?void 0:t.custom}};let bg=1e3;function xg(e){let t={name:`Sheet1`,id:`sheet-01`,tabColor:``,hidden:z.FALSE,rowCount:bg,columnCount:20,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:88,defaultRowHeight:24,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:z.TRUE,rowHeader:{width:46,hidden:z.FALSE},columnHeader:{height:20,hidden:z.FALSE},rightToLeft:z.FALSE};return Object.keys(t).forEach(n=>{let r=n;e[r]===void 0&&(e[r]=t[r])}),e}var Sg=class extends ra{constructor(e){super(),F(this,`_cellCache`,new Map),F(this,`_rowCache`,new Map),F(this,`_columnCache`,new Map),F(this,`_hasRow`,!1),F(this,`_hasColumn`,!1),F(this,`_hasAll`,!1),F(this,`_allIndex`,-1),F(this,`_mergeData`,void 0),F(this,`_rangeMap`,new of(5e4)),this._init(e.concat())}_init(e){this._mergeData=e,this._createCache(e)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(e){let t=0;for(let n of e){let{rangeType:e}=n;e===G.ROW?this._createRowCache(n,t):e===G.COLUMN?this._createColumnCache(n,t):e===G.ALL?this._createCellAllCache(t):this._createCellCache(n,t),t++}}rebuild(e){this._clearCache(),this._init(e.concat())}_createRowCache(e,t){let{startRow:n,endRow:r}=e;for(let e=n;e<=r;e++)this._rowCache.set(e,t),this._hasRow=!0}_createColumnCache(e,t){let{startColumn:n,endColumn:r}=e;for(let e=n;e<=r;e++)this._columnCache.set(e,t),this._hasColumn=!0}_createCellAllCache(e){this._hasAll=!0,this._allIndex=e}_createCellCache(e,t){for(let n=e.startRow;n<=e.endRow;n++){let r=this._cellCache.get(n);r==null&&(r=new Map,this._cellCache.set(n,r));for(let n=e.startColumn;n<=e.endColumn;n++)r.set(n,t)}}add(e){this._mergeData.push(e),this._clearCache(),this._createCache(this._mergeData)}remove(e,t){let n=this._getMergeDataIndex(e,t);n!==-1&&(this._mergeData.splice(n,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(e,t){let n=this._getMergeDataIndex(e,t);return n===-1?null:this._mergeData[n]}getMergeDataIndex(e,t){return this._getMergeDataIndex(e,t)}isRowContainsMergedCell(e){return this._hasAll||!L.isEmptyObject(this._columnCache)?!0:this._mergeData.some(t=>t.startRow<=e&&e<=t.endRow)}isColumnContainsMergedCell(e){return this._hasAll||!L.isEmptyObject(this._rowCache)?!0:this._mergeData.some(t=>t.startColumn<=e&&e<=t.endColumn)}getMergedCellRange(e,t,n,r){let i=[],a=`${e}-${t}-${n}-${r}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let o=0,s=[];for(let a of this._mergeData||[])Qf.intersects(a,{startRow:e,endRow:n,startColumn:t,endColumn:r})&&(i.push({...a}),s.push(o)),o++;return this._rangeMap.set(a,s),i}_getRangeFromCache(e){let t=this._rangeMap.get(e)||[],n=[];for(let e of t)n.push({...this._mergeData[e]});return n}_getMergeDataIndex(e,t){var n;if(this._hasAll)return this._allIndex;if(this._hasRow){let t=this._rowCache.get(e);if(t!==void 0)return t}if(this._hasColumn){let e=this._columnCache.get(t);if(e!==void 0)return e}let r=(n=this._cellCache.get(e))==null?void 0:n.get(t);return r===void 0?-1:r}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}},Cg=class extends ra{constructor(e){super(),this.getRawCell=e,F(this,`_cellContentInterceptor`,null),F(this,`_rowFilteredInterceptor`,null)}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(e,t,n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(e,t,he.Value|he.Style,n,r):this.getRawCell(e,t)}getCellValueOnly(e,t){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(e,t,he.Value):this.getRawCell(e,t)}getCellStyleOnly(e,t){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(e,t,he.Style):this.getRawCell(e,t)}getRowFiltered(e){var t,n;return(t=(n=this._rowFilteredInterceptor)==null?void 0:n.getRowFiltered(e))==null?!1:t}registerCellContentInterceptor(e){if(this._cellContentInterceptor)throw Error(`[SheetViewModel]: Interceptor already registered.`);return this._cellContentInterceptor=e,ta(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(e){if(this._rowFilteredInterceptor)throw Error(`[SheetViewModel]: Interceptor already registered.`);return this._rowFilteredInterceptor=e,ta(()=>this._rowFilteredInterceptor=null)}};let wg={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};var Tg=class e{constructor(e,t,n){var r;this.unitId=e,this._styles=n,F(this,`_sheetId`,void 0),F(this,`_snapshot`,void 0),F(this,`_cellData`,void 0),F(this,`_rowManager`,void 0),F(this,`_columnManager`,void 0),F(this,`_viewModel`,void 0),F(this,`_spanModel`,void 0),F(this,`_isRowStylePrecedeColumnStyle`,!0),F(this,`_getCellHeight`,void 0),this._snapshot=xg(t);let{columnData:i,rowData:a,cellData:o}=this._snapshot;this._sheetId=(r=this._snapshot.id)==null?xa(6):r,this._cellData=new Gu(o),this._viewModel=new Cg((e,t)=>this.getCellRaw(e,t)),this._rowManager=new yg(this._snapshot,this._viewModel,a),this._columnManager=new vg(this._snapshot,i),this._spanModel=new Sg(this._snapshot.mergeData)}__interceptViewModel(e){e(this._viewModel)}__registerGetCellHeight(e){return this._getCellHeight=e,ta(()=>{this._getCellHeight=null})}getSnapshot(){return this._snapshot}getCellHeight(e,t){return this._getCellHeight?this._getCellHeight(e,t):this.getRowHeight(e)}setMergeData(e){this._snapshot.mergeData=e,this.getSpanModel().rebuild(e)}getSpanModel(){return this._spanModel}setIsRowStylePrecedeColumnStyle(e){this._isRowStylePrecedeColumnStyle=e}getStyleDataByHash(e){return{...this._styles.get(e)}}setStyleData(e){return this._styles.setValue(e)}getColumnStyle(e,t=!1){return t?this._columnManager.getColumnStyle(e):this._styles.get(this._columnManager.getColumnStyle(e))}setColumnStyle(e,t){this._columnManager.setColumnStyle(e,t)}getRowStyle(e,t=!1){return t?this._rowManager.getRowStyle(e):this._styles.get(this._rowManager.getRowStyle(e))}setRowStyle(e,t){this._rowManager.setRowStyle(e,t)}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){let e=this._snapshot.defaultStyle;return this._styles.get(e)}setDefaultCellStyle(e){this._snapshot.defaultStyle=e}getCellStyle(e,t){let n=this.getCell(e,t);if(n){let e=n.s;return typeof e==`string`?this._styles.get(e):e}return null}getComposedCellStyle(e,t,n){let r=this.getDefaultCellStyleInternal(),i=this.getRowStyle(e),a=this.getColumnStyle(t),o=this.getCell(e,t),s=this._styles.getStyleByCell(o);return(n==null?this._isRowStylePrecedeColumnStyle:n)?Sa(r,a,i,o==null?void 0:o.themeStyle,s):Sa(r,i,a,o==null?void 0:o.themeStyle,s)}getComposedCellStyleByCellData(e,t,n,r){let i=this.getDefaultCellStyleInternal(),a=this.getRowStyle(e),o=this.getColumnStyle(t),s=this._styles.getStyleByCell(n);return(r==null?this._isRowStylePrecedeColumnStyle:r)?Sa(i,o,a,n==null?void 0:n.themeStyle,s):Sa(i,a,o,n==null?void 0:n.themeStyle,s)}getComposedCellStyleWithoutSelf(e,t,n,r){let i=n===void 0?this.getComposedCellStyle(e,t,r):this.getComposedCellStyleByCellData(e,t,n,r),a=this.getCellRaw(e,t);if(!a||!a.s)return i;let o=typeof a.s==`string`?this._styles.get(a.s):a.s;if(!o)return i;for(let e in o)e in i&&delete i[e];return i}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){let e=this.getCellMatrix(),t=this.getMergeData(),n=-1,r=-1,i=-1,a=-1,o=!1,s=!1;return e.forEach((t,c)=>{Object.keys(c).forEach(c=>{let l=+c,u=e.getValue(t,l),d=u!=null&&u.s?this._styles.get(u.s):null,f=(d==null?void 0:d.bd)&&(d.bd.b||d.bd.l||d.bd.r||d.bd.t||d.bd.bc_tr||d.bd.bl_tr||d.bd.ml_tr||d.bd.tl_bc||d.bd.tl_br||d.bd.tl_mr);(u&&(u.v!==null&&u.v!==void 0&&u.v!==``||u.p)||d!=null&&d.bg||f)&&(o?n=Math.min(n,t):(n=t,o=!0),r=Math.max(r,t),s?i=Math.min(i,l):(s=!0,i=l),a=Math.max(a,l))})}),t.forEach(e=>{o?n=Math.min(n,e.startRow):(n=e.startRow,o=!0),r=Math.max(r,e.endRow),s?i=Math.min(i,e.startColumn):(i=e.startColumn,o=!0),a=Math.max(a,e.endColumn)}),!o||!s?null:{startColumn:i,startRow:n,endColumn:a,endRow:r}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){let{_snapshot:t}=this,n=_g(t);return new e(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(e,t){return this._spanModel.getMergedCell(e,t)}getMergedCellRange(e,t,n,r){return this._spanModel.getMergedCellRange(e,t,n,r)}isRowContainsMergedCell(e){return this._spanModel.isRowContainsMergedCell(e)}isColumnContainsMergedCell(e){return this._spanModel.isColumnContainsMergedCell(e)}getCellInfoInMergeData(e,t){let n=this.getMergedCell(e,t),r=!1,i=!1,a=e,o=t,s=e,c=t;if(n){let{startRow:l,endRow:u,startColumn:d,endColumn:f}=n;e===l&&t===d?(a=u,o=f,s=l,c=d,i=!0):e>=l&&e<=u&&t>=d&&t<=f&&(a=u,o=f,s=l,c=d,r=!0)}return{actualRow:e,actualColumn:t,isMergedMainCell:i,isMerged:r,endRow:a,endColumn:o,startRow:s,startColumn:c}}getCell(e,t){return e<0||t<0?null:this._viewModel.getCell(e,t)}getCellValueOnly(e,t){return e<0||t<0?null:this._viewModel.getCellValueOnly(e,t)}getCellStyleOnly(e,t){return e<0||t<0?null:this._viewModel.getCellStyleOnly(e,t)}getCellRaw(e,t){return this.getCellMatrix().getValue(e,t)}getCellWithFilteredInterceptors(e,t,n,r){return this._viewModel.getCell(e,t,n,r)}getRowFiltered(e){return this._viewModel.getRowFiltered(e)}getRangeFilterRows(e){let t=[];for(let n=e.startRow;n<=e.endRow;n++)this.getRowFiltered(n)&&t.push(n);return t}getMatrixWithMergedCells(e,t,n,r,i=nc.Raw){let a=this.getCellMatrix(),o=this._spanModel.getMergedCellRange(e,t,n,r),s=new Gu;return ip(e,n,t,r).forEach((e,t)=>{let n;if(i===nc.Raw)n=this.getCellRaw(e,t);else if(i===nc.Intercepted)n=this.getCell(e,t);else if(i===nc.Both){let i=this.getCellRaw(e,t);if(i){var r;n={...i};let a=(r=this.getCell(e,t))==null?void 0:r.v;og(a)&&n&&(n.displayV=String(a))}}n&&s.setValue(e,t,n)}),o.forEach(e=>{let{startColumn:t,startRow:n,endColumn:r,endRow:i}=e;ip(n,i,t,r).forEach((e,o)=>{e===n&&o===t&&s.setValue(e,o,{...a.getValue(e,o),rowSpan:i-n+1,colSpan:r-t+1}),(e!==n||o!==t)&&s.realDeleteValue(e,o)})}),s}getRange(e,t,n,r){return typeof e==`object`?new Sf(this,e,{getStyles:()=>this._styles}):new Sf(this,{startRow:e,startColumn:t,endColumn:r||t,endRow:n||e},{getStyles:()=>this._styles})}getScrollLeftTopFromSnapshot(){return{scrollLeft:this._snapshot.scrollLeft,scrollTop:this._snapshot.scrollTop}}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){let{_snapshot:e}=this,{columnCount:t}=e;return t}getMaxRows(){let{_snapshot:e}=this,{rowCount:t}=e;return t}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(){let{_snapshot:e}=this,{showGridlines:t}=e;return t===0}getGridlinesColor(){return this.getConfig().gridlinesColor}getTabColor(){let{_snapshot:e}=this,{tabColor:t}=e;return t}getColumnWidth(e){return this.getColumnManager().getColumnWidth(e)}getRowHeight(e){return this._viewModel.getRowFiltered(e)?0:this.getRowManager().getRowHeight(e)}isRowFiltered(e){return this._viewModel.getRowFiltered(e)}getRowVisible(e){return!this.isRowFiltered(e)&&this.getRowRawVisible(e)}getRowRawVisible(e){return this.getRowManager().getRowRawVisible(e)}getHiddenRows(e,t){let n=this.getMaxColumns()-1,r=this._rowManager.getHiddenRows(e,t);return r.forEach(e=>e.endColumn=n),r}getColVisible(e){return this._columnManager.getColVisible(e)}getHiddenCols(e,t){let n=this.getMaxRows()-1,r=this._columnManager.getHiddenCols(e,t);return r.forEach(e=>e.endRow=n),r}getVisibleRows(){let e=this.getRowCount();return this._rowManager.getVisibleRows(0,e-1)}getVisibleCols(){let e=this.getColumnCount();return this._columnManager.getVisibleCols(0,e-1)}isRightToLeft(){let{_snapshot:e}=this,{rightToLeft:t}=e;return t}getLastRowWithContent(){return this._cellData.getRealRowRange().endRow}getLastColumnWithContent(){return this.getDataRealRange().endColumn}getDataRealRange(){return this._cellData.getRealRange()}getDataRangeScope(){return this._cellData.getStartEndScope()}cellHasValue(e){return e&&(e.v!==void 0||e.f!==void 0||e.p!==void 0)}iterateByRow(e,t=!0){let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e,o=this;return{[Symbol.iterator]:()=>{let e=n,s=r;return{next(){for(;;){if(s>a&&(e+=1,s=r),e>i)return{done:!0,value:void 0};let n=o.getCell(e,s),c=!n,l=o.getMergedCell(e,s);if(l){if(e!==l.startRow||s!==l.startColumn){s=l.endColumn+1;continue}if(c&&t){s=l.endColumn+1;continue}let r={row:e,col:s,value:n};return r.colSpan=l.endColumn-l.startColumn+1,r.rowSpan=l.endRow-l.startRow+1,s=l.endColumn+1,{done:!1,value:r}}if(c&&t)s+=1;else{let t={row:e,col:s,value:n};return s+=1,{done:!1,value:t}}}}}}}}iterateByColumn(e,t=!0,n=!0){let{startRow:r,startColumn:i,endRow:a,endColumn:o}=e,s=this;return{[Symbol.iterator]:()=>{let e=r,c=i;return{next(){for(;;){if(e>a&&(c+=1,e=r),c>o)return{done:!0,value:void 0};let i=s.getMergedCell(e,c);if(i){let r=e!==i.startRow,a=r||c!==i.startColumn;if(n&&a||!n&&r){e=i.endRow+1;continue}let o=s.getCell(i.startRow,i.startColumn);if(!o&&t){e=i.endRow+1;continue}let l={row:e,col:i.startColumn,value:o};return l.colSpan=i.endColumn-i.startColumn+1,l.rowSpan=i.endRow-i.startRow+1,e=i.endRow+1,{done:!1,value:l}}let l=s.getCell(e,c);if(!l&&t)e+=1;else{let t={row:e,col:c,value:l};return e+=1,{done:!1,value:t}}}}}}}}getCellDocumentModel(e,t,n=wg){var r;if(!e)return;let{isDeepClone:i,displayRawFormula:a,ignoreTextRotation:o}={...wg,...n},s,c=`document`,l=rg(t),u=o?hf.tr:l.textRotation||hf.tr,d=l.horizontalAlign||hf.ht,f=l.verticalAlign||hf.vt,p=l.wrapStrategy||hf.tb,m=l.paddingData||eg;if(e.f&&a)s=ng(e.f.toString(),{},{verticalAlign:f}),d=hf.ht;else if(e.p){let{centerAngle:t,vertexAngle:n}=ug(u);s=this._updateConfigAndGetDocumentModel(i?L.deepClone(e.p):e.p,d,m,{horizontalAlign:d,verticalAlign:f,centerAngle:t,vertexAngle:n,wrapStrategy:p,zeroWidthParagraphBreak:1})}else if(e.v!=null){let n=ig(t);c=cg(n).fontCache;let r=Eg(e);e.t===Ya.FORCE_STRING&&a&&(r=`'${r}`),s=ng(r,n,{...l,textRotation:u,cellValueType:e.t})}return s&&e.linkUrl&&e.linkId&&ag(s,e.linkUrl,e.linkId),{documentModel:s,fontString:c,textRotation:u,wrapStrategy:p,verticalAlign:f,horizontalAlign:d,paddingData:m,fill:t==null||(r=t.bg)==null?void 0:r.rgb}}_updateConfigAndGetDocumentModel(e,t,n,r){var i,a,o,s,c;if(!r||!((i=e.body)!=null&&i.dataStream))return;e.documentStyle||(e.documentStyle={}),e.documentStyle.marginTop=(a=n.t)==null?0:a,e.documentStyle.marginBottom=(o=n.b)==null?2:o,e.documentStyle.marginLeft=(s=n.l)==null?2:s,e.documentStyle.marginRight=(c=n.r)==null?2:c,e.documentStyle.pageSize={width:1/0,height:1/0},e.documentStyle.renderConfig={...e.documentStyle.renderConfig,...r};let l=e.body.paragraphs||[];for(let e of l)e.paragraphStyle||(e.paragraphStyle={}),e.paragraphStyle.horizontalAlign=t;return new Fm(e)}getBlankCellDocumentModel(e,t,n){let r=this.getComposedCellStyleByCellData(t,n,e),i=ig(r),a=this.getCellDocumentModel(e,r,{ignoreTextRotation:!0});if(a!=null)return a.documentModel==null&&(a.documentModel=ng(``,i)),a;let o=`document`,s=hf.tr,c=hf.ht,l=hf.vt,u=hf.tb,d=eg;return o=cg({}).fontCache,{documentModel:ng(``,i),fontString:o,textRotation:s,wrapStrategy:u,verticalAlign:l,horizontalAlign:c,paddingData:d}}getCellDocumentModelWithFormula(e,t,n){let r=this.getComposedCellStyleByCellData(t,n,e);return this.getCellDocumentModel(e,r,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(e){this._snapshot.custom=e}};function Eg(e){var t;if(!e)return``;let n=(t=e.p)==null||(t=t.body)==null?void 0:t.dataStream;if(n)return mh.transform.getPlainText(n);let r=e.v;return typeof r==`string`?e.t===Ya.BOOLEAN?r.toUpperCase():r.replace(/[\r\n]/g,``):typeof r==`number`?e.t===Ya.BOOLEAN?r?`TRUE`:`FALSE`:r.toString():typeof r==`boolean`?r?`TRUE`:`FALSE`:``}function Dg(e){if(e===null)return``;if(e!=null&&e.p){let t=e==null?void 0:e.p.body;if(t==null)return``;let n=t.dataStream;return mh.transform.getPlainText(n)}return e==null?void 0:e.v}function Og(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}let kg=class extends oa{get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(e){return typeof e==`string`||`startRow`in e||`row`in e}constructor(e={},t){super(),this._logService=t,F(this,`type`,n.UniverType.UNIVER_SHEET),F(this,`_sheetCreated$`,new r.Subject),F(this,`sheetCreated$`,this._sheetCreated$.asObservable()),F(this,`_sheetDisposed$`,new r.Subject),F(this,`sheetDisposed$`,this._sheetDisposed$.asObservable()),F(this,`_activeSheet$`,new r.BehaviorSubject(null)),F(this,`activeSheet$`,this._activeSheet$.asObservable()),F(this,`_worksheets`,void 0),F(this,`_styles`,void 0),F(this,`_snapshot`,void 0),F(this,`_unitId`,void 0),F(this,`_count`,void 0),F(this,`_name$`,void 0),F(this,`name$`,void 0);let i=Xh();L.isEmptyObject(e)?this._snapshot=i:this._snapshot=L.commonExtend(i,e);let{styles:a}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=xa(6)),this._unitId=this._snapshot.id,this._styles=new Zh(a),this._count=1,this._worksheets=new Map,this._name$=new r.BehaviorSubject(e.name||``),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete(),Array.from(this._worksheets.keys()).forEach(e=>{this._removeSheet(e)})}save(){return L.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(e){this._name$.next(e),this._snapshot.name=e}getUnitId(){return this._unitId}getRev(){var e;return(e=this._snapshot.rev)==null?1:e}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(e){this._snapshot.rev=e}addWorksheet(e,t,n){let{sheets:r,sheetOrder:i}=this._snapshot;if(r[e])return!1;r[e]=n,i.splice(t,0,e),this.ensureSheetOrderUnique();let a=new Tg(this._unitId,n,this._styles);return this._worksheets.set(e,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}ensureSheetOrderUnique(){let e=new Set,t=[];for(let n of this._snapshot.sheetOrder)e.has(n)||(e.add(n),t.push(n));this._snapshot.sheetOrder=t,e.clear()}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}addStyles(e){Object.entries(e).forEach(([e,t])=>{this._styles.addCustomStyle(e,t)})}removeStyles(e){e.forEach(e=>{this._styles.remove(e)})}getConfig(){return this._snapshot}getIndexBySheetId(e){let{sheetOrder:t}=this._snapshot;return t.findIndex(t=>t===e)}getActiveSheet(e){if(!this._activeSheet&&e===void 0)throw Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){let e=this._activeSheet;if(e)return e;let t=this._snapshot.sheetOrder;for(let e=0,n=t.length;e<n;e++){let n=this._worksheets.get(t[e]);if(n&&n.isSheetHidden()!==z.TRUE)return this.setActiveSheet(n),n}let n=this._worksheets.get(t[0]);return this.setActiveSheet(n),n}setActiveSheet(e){this._activeSheet$.next(e)}_removeSheet(e){let t=this._worksheets.get(e);return t?(this._worksheets.delete(e),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(e),1),this.ensureSheetOrderUnique(),this._sheetDisposed$.next(t),!0):!1}removeSheet(e){let t=this._removeSheet(e);return t&&delete this._snapshot.sheets[e],t}getActiveSheetIndex(){let{sheetOrder:e}=this._snapshot;return e.findIndex(e=>this._worksheets.get(e)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){let{sheetOrder:e}=this._snapshot;return e.map(e=>this._worksheets.get(e))}getSheetsName(){let{sheetOrder:e}=this._snapshot,t=[];return e.forEach(e=>{let n=this._worksheets.get(e);n&&t.push(n.getName())}),t}getSheetIndex(e){let{sheetOrder:t}=this._snapshot;return t.findIndex(t=>e.getSheetId()===t)}getSheetBySheetName(e){let{sheetOrder:t}=this._snapshot,n=t.find(t=>this._worksheets.get(t).getName()===e);return this._worksheets.get(n)}getSheetBySheetId(e){return this._worksheets.get(e)}getSheetByIndex(e){let{sheetOrder:t}=this._snapshot;return this._worksheets.get(t[e])}getHiddenWorksheets(){return this.getSheets().filter(e=>e.getConfig().hidden===z.TRUE).map(e=>e.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(e=>e.getConfig().hidden!==z.TRUE).map(e=>e.getConfig().id)}load(e){this._snapshot=e}checkSheetName(e){return this.getSheetsName().some(t=>t.toLowerCase()===e.toLowerCase())}uniqueSheetName(e=`Sheet1`){let t=e;for(;this.checkSheetName(t);)t=e+this._count,this._count++;return t}generateNewSheetName(e){let t=e+this._count;for(;this.checkSheetName(t);)t=e+this._count,this._count++;return t}_parseWorksheetSnapshots(){let{_snapshot:e,_worksheets:t}=this,{sheets:n,sheetOrder:r}=e;if(L.isEmptyObject(n)){let e=xa();n[e]={id:e}}for(let e in n){let i=n[e],{name:a}=i;i.name=this.uniqueSheetName(a),i.name!==a&&this._logService.debug(`[Workbook]`,`The worksheet name ${a} is duplicated, we changed it to ${i.name}. Please fix the problem in your snapshot.`);let o=new Tg(this._unitId,i,this._styles);t.set(e,o),r.includes(e)||r.push(e)}this.ensureSheetOrderUnique(),this.ensureActiveSheet()}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(e){this._snapshot.custom=e}};kg=ss([W(1,is)],kg);let Ag=(0,t.createIdentifier)(`univer.current`),jg=class extends ra{constructor(e,t,n){super(),this._injector=e,this._contextService=t,this._logService=n,F(this,`_unitsByType`,new Map),F(this,`_createHandler`,void 0),F(this,`_ctorByType`,new Map),F(this,`_currentUnits`,new Map),F(this,`_currentUnits$`,new r.BehaviorSubject(this._currentUnits)),F(this,`currentUnits$`,this._currentUnits$.asObservable()),F(this,`_unitAdded$`,new r.Subject),F(this,`unitAdded$`,this._unitAdded$.asObservable()),F(this,`_unitDisposed$`,new r.Subject),F(this,`unitDisposed$`,this._unitDisposed$.asObservable()),F(this,`_focused$`,new r.BehaviorSubject(null)),F(this,`focused$`,this._focused$.asObservable())}dispose(){super.dispose(),this._focused$.complete(),this._currentUnits$.complete(),this._unitAdded$.complete(),this._currentUnits.forEach(e=>e==null?void 0:e.dispose()),this._currentUnits.clear(),this._unitsByType.clear()}__setCreateHandler(e){this._createHandler=e}createUnit(e,t,n){return this._createHandler(e,t,this._ctorByType.get(e),n)}registerCtorForType(e,t){return this._ctorByType.set(e,t),{dispose:()=>{this._ctorByType.delete(e)}}}__getCtorByType(e){return this._ctorByType.get(e)}getCurrentTypeOfUnit$(e){return this.currentUnits$.pipe((0,r.map)(t=>{var n;return(n=t.get(e))==null?null:n}),(0,r.distinctUntilChanged)())}getCurrentUnitForType(e){return this._currentUnits.get(e)}getCurrentUnitOfType(e){return this.getCurrentUnitForType(e)}setCurrentUnitForType(e){let t=this._getUnitById(e);if(!t)throw Error(`[UniverInstanceService]: no document with unitId ${e}!`);this._currentUnits.set(t[1],t[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(e){return this._unitAdded$.pipe((0,r.filter)(t=>t.unit.type===e))}__addUnit(e,t){var n;this._logService.debug(`[UniverInstanceService]: Adding unit with id ${e.getUnitId()}`);let r=e.type;this._unitsByType.has(r)||this._unitsByType.set(r,[]);let i=this._unitsByType.get(r),a=e.getUnitId();if(i.findIndex(e=>e.getUnitId()===a)!==-1)throw Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${a}.`);i.push(e),this._unitAdded$.next({unit:e,options:t}),((n=t==null?void 0:t.makeCurrent)==null||n)&&this.setCurrentUnitForType(e.getUnitId())}getTypeOfUnitDisposed$(e){return this.unitDisposed$.pipe((0,r.filter)(t=>t.type===e))}getUnit(e,t){var n;let r=(n=this._getUnitById(e))==null?void 0:n[0];return t&&(r==null?void 0:r.type)!==t?null:r}getCurrentUniverDocInstance(){return this.getCurrentUnitForType(n.UniverType.UNIVER_DOC)}getUniverDocInstance(e){return this.getUnit(e,n.UniverType.UNIVER_DOC)}getUniverSheetInstance(e){return this.getUnit(e,n.UniverType.UNIVER_SHEET)}getAllUnitsForType(e){var t;return(t=this._unitsByType.get(e))==null?[]:t}changeDoc(e,t){let r=this.getAllUnitsForType(n.UniverType.UNIVER_DOC),i=r.find(t=>t.getUnitId()===e);if(i!=null){let e=r.indexOf(i);r.splice(e,1)}this.__addUnit(t)}get focused(){var e;let t=this._focused$.getValue();return t?(e=this._getUnitById(t))==null?void 0:e[0]:null}focusUnit(e){var t;this._focused$.next(e),this.focused instanceof kg?(this._contextService.setContextValue(Lh,!0),this._contextService.setContextValue(zh,!1),this._contextService.setContextValue(Rh,!0),this._contextService.setContextValue(Bh,!1),this.setCurrentUnitForType(e)):this.focused instanceof Fm?(this._contextService.setContextValue(Lh,!0),this._contextService.setContextValue(zh,!0),this._contextService.setContextValue(Rh,!1),this._contextService.setContextValue(Bh,!1),this.setCurrentUnitForType(e)):((t=this.focused)==null?void 0:t.type)===n.UniverType.UNIVER_SLIDE?(this._contextService.setContextValue(Lh,!0),this._contextService.setContextValue(zh,!1),this._contextService.setContextValue(Rh,!1),this._contextService.setContextValue(Bh,!0),this.setCurrentUnitForType(e)):(this._contextService.setContextValue(Lh,!1),this._contextService.setContextValue(zh,!1),this._contextService.setContextValue(Rh,!1),this._contextService.setContextValue(Bh,!1))}getFocusedUnit(){return this.focused}getUnitType(e){let t=this._getUnitById(e);return t?t[1]:n.UniverType.UNRECOGNIZED}disposeUnit(e){this._logService.debug(`[UniverInstanceService]: Disposing unit with id ${e}`);let t=this._getUnitById(e);if(!t)return this._logService.debug(`[UniverInstanceService]: No unit found with id ${e}`),!1;let[n,r]=t,i=this._unitsByType.get(r),a=i.indexOf(n);return i.splice(a,1),this._tryResetCurrentOnRemoval(e,r),this._tryResetFocusOnRemoval(e),this._unitDisposed$.next(n),n.dispose(),!0}_tryResetCurrentOnRemoval(e,t){let n=this.getCurrentUnitForType(t);(n==null?void 0:n.getUnitId())===e&&(this._currentUnits.set(t,null),this._currentUnits$.next(this._currentUnits))}_tryResetFocusOnRemoval(e){var t;((t=this.focused)==null?void 0:t.getUnitId())===e&&this._focused$.next(null)}_getUnitById(e){for(let[t,n]of this._unitsByType){let r=n.find(t=>t.getUnitId()===e);if(r)return[r,t]}}};jg=ss([W(0,(0,t.Inject)(t.Injector)),W(1,ts),W(2,(0,t.Inject)(is))],jg);let $=function(e){return e[e.Starting=0]=`Starting`,e[e.Ready=1]=`Ready`,e[e.Rendered=2]=`Rendered`,e[e.Steady=3]=`Steady`,e}({}),Mg={[$.Starting]:`Starting`,[$.Ready]:`Ready`,[$.Rendered]:`Rendered`,[$.Steady]:`Steady`};var Ng=class extends Error{constructor(e){super(`[LifecycleService]: lifecycle stage "${Mg[e]}" will never be reached!`),this.name=`LifecycleUnreachableError`}};let Pg=class extends ra{constructor(e){super(),this._logService=e,F(this,`_lifecycle$`,new r.BehaviorSubject($.Starting)),F(this,`lifecycle$`,this._lifecycle$.asObservable()),F(this,`_lock`,!1),this._reportProgress($.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(e){if(this._lock)throw Error(`[LifecycleService]: cannot set new stage when related logic is all handled!`);if(e<this.stage)throw Error(`[LifecycleService]: lifecycle stage cannot go backward!`);e!==this.stage&&(this._lock=!0,this._reportProgress(e),this._lifecycle$.next(e),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}onStage(e){return(0,r.firstValueFrom)(this.lifecycle$.pipe((0,r.filter)(t=>t>=e),vs(t=>t===e),(0,r.map)(()=>void 0))).catch(t=>t.name===`EmptyError`?Promise.reject(new Ng(e)):Promise.reject(t))}subscribeWithPrevious(){return(0,r.merge)(Fg(this.stage),this._lifecycle$.pipe((0,r.skip)(1))).pipe(vs(e=>e===$.Steady))}_reportProgress(e){this._logService.debug(`[LifecycleService]`,`lifecycle progressed to "${Mg[e]}".`)}};Pg=ss([W(0,is)],Pg);function Fg(e){switch(e){case $.Starting:return(0,r.of)($.Starting);case $.Ready:return(0,r.of)($.Starting,$.Ready);case $.Rendered:return(0,r.of)($.Starting,$.Ready,$.Rendered);default:return(0,r.of)($.Starting,$.Ready,$.Rendered,$.Steady)}}let Ig=(0,t.createIdentifier)(`ILocalStorageService`);var Lg=class extends ra{get _currentLocale(){return this._currentLocale$.value}constructor(){super(),F(this,`_currentLocale$`,new r.BehaviorSubject(Ia.ZH_CN)),F(this,`currentLocale$`,this._currentLocale$.asObservable()),F(this,`_locales`,null),F(this,`localeChanged$`,new r.Subject),F(this,`t`,(e,...t)=>{if(!this._locales)throw Error(`[LocaleService]: Locale not initialized`);let n=e.split(`.`),r=this.resolveKeyPath(this._locales[this._currentLocale],n);if(typeof r==`string`){let e=r;return t.forEach((t,n)=>{e=e.replace(`{${n}}`,t)}),e}else return e}),this.disposeWithMe(ta(()=>{this._locales=null,this._currentLocale$.complete(),this.localeChanged$.complete()}))}load(e){var t;this._locales=Bi((t=this._locales)==null?{}:t,e)}setLocale(e){this._currentLocale$.next(e),this.localeChanged$.next()}getLocales(){var e;return(e=this._locales)==null?void 0:e[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(e,t){let n=t.shift();if(n&&e&&n in e){let r=e[n];return t.length>0&&(typeof r==`object`||Array.isArray(r))?this.resolveKeyPath(r,t):r}return null}};let Rg=class{constructor(e){this._userManagerService=e}async list(e){return{list:[{type:La.PERSON,mentions:[{objectType:La.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:`PEOPLE`}],page:e.page,size:e.size,total:1}}};Rg=ss([W(0,(0,t.Inject)(Mh))],Rg);let zg=(0,t.createIdentifier)(`univer.service.mention-io`),Bg=function(e){return e.INIT=`init`,e.FETCHING=`fetching`,e.DONE=`done`,e}({}),Vg=(0,t.createIdentifier)(`univer.permission-service`);var Hg=class extends ra{constructor(...e){super(...e),F(this,`_permissionPointMap`,new Map),F(this,`_permissionPointUpdate$`,new r.Subject),F(this,`permissionPointUpdate$`,this._permissionPointUpdate$.asObservable()),F(this,`_showComponents`,!0)}setShowComponents(e){this._showComponents=e}getShowComponents(){return this._showComponents}deletePermissionPoint(e){let t=this._permissionPointMap.get(e);t&&(t.complete(),this._permissionPointMap.delete(e))}addPermissionPoint(e){let t=e instanceof r.BehaviorSubject,n=t?e.getValue():e;return n.id?this._permissionPointMap.get(n.id)?(console.warn(`${n.id} PermissionPoint already exists`),!1):(this._permissionPointMap.set(n.id,t?e:new r.BehaviorSubject(n)),this._permissionPointUpdate$.next(n),!0):!1}updatePermissionPoint(e,t){let n=this._permissionPointMap.get(e);if(!n)return;let r=n.getValue();r.value=t,r.status=Bg.DONE,n.next(r),this._permissionPointUpdate$.next(r)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(e){let t=this._permissionPointMap.get(e);if(t)return t.getValue()}getPermissionPoint$(e){let t=this._permissionPointMap.get(e);if(t)return t}composePermission$(e){return(0,r.combineLatest)(e.map(e=>{var t;let n=(t=this._permissionPointMap)==null?void 0:t.get(e);if(!n)throw Error(`[PermissionService]: ${e} permissionPoint does not exist!`);return n.asObservable()})).pipe((0,i.map)(e=>e))}composePermission(e){return e.map(e=>{var t;let n=(t=this._permissionPointMap)==null?void 0:t.get(e);if(!n)throw Error(`[PermissionService]: ${e} permissionPoint does not exist!`);return n.getValue()})}getAllPermissionPoint(){let e=new Map;return this._permissionPointMap.forEach((t,n)=>{e.set(n,t)}),e}};function Ug(e,t){if(!t)return e;let n=[];for(let r of e){let e=t.find(([e])=>e===r[0]);if(e){if(e[1]===null)continue;n.push([r[0],e[1]])}else n.push(r)}return n}let Wg=Symbol(`DependentOn`);var Gg=class extends ra{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUnitType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}};F(Gg,`pluginName`,void 0),F(Gg,`packageName`,Jh),F(Gg,`version`,Yh),F(Gg,`type`,n.UniverType.UNIVER_UNKNOWN);var Kg=class{constructor(){F(this,`_plugins`,[])}addPlugin(e){this._plugins.push(e)}removePlugins(){let e=this._plugins.slice();return this._plugins.length=0,e}forEachPlugin(e){this._plugins.forEach(e)}};function qg(...e){return function(t){t[Wg]=e}}let Jg=class{constructor(e,t,r){this._injector=e,this._lifecycleService=t,this._logService=r,F(this,`_pluginRegistry`,new Map),F(this,`_pluginStore`,new Kg),F(this,`_seenPlugins`,new Set),F(this,`_loadedPlugins`,new Set),F(this,`_loadedPluginTypes`,new Set([n.UniverType.UNIVER_UNKNOWN])),F(this,`_flushTimerByType`,new Map)}dispose(){this._pluginStore.removePlugins().forEach(e=>e.dispose()),this._flushTimerByType.forEach(e=>clearTimeout(e))}registerPlugin(e,t){this._assertPluginValid(e);let r={plugin:e,options:t};this._pluginRegistry.set(e.pluginName,r),this._logService.debug(`[PluginService]`,`Plugin "${e.pluginName}" registered.`);let{type:i}=e;this._loadedPluginTypes.has(i)&&(i===n.UniverType.UNIVER_UNKNOWN?this._loadFromPlugins([r]):this._flushType(i))}startPluginsForType(e){this._loadedPluginTypes.has(e)||this._loadPluginsForType(e)}_loadPluginsForType(e){let t=Array.from(this._pluginRegistry.keys()),n=[];t.forEach(t=>{let r=this._pluginRegistry.get(t);r.plugin.type===e&&n.push(r)}),this._loadFromPlugins(n),this._loadedPluginTypes.add(e)}_assertPluginValid(e){let{type:t,pluginName:r,packageName:i,version:a}=e;if(t===n.UniverType.UNRECOGNIZED)throw Error(`[PluginService]: invalid plugin type for ${e.name}. Please assign a "type" to your plugin.`);if(!r)throw Error(`[PluginService]: no plugin name for ${e.name}. Please assign a "pluginName" to your plugin.`);if(a&&a!==Gg.version)throw Error(`[PluginService]: package "${i==null?`UNKNOWN`:i}" version mismatch. Plugin version is "${a}" but @univerjs/core version is "${Gg.version}". Please make sure all @univerjs packages use the same version.`);if(this._seenPlugins.has(r))throw Error(`[PluginService]: duplicated plugin name for "${r}". Maybe a plugin that dependents on "${r} has already registered it. In that case please register "${r}" before the that plugin.`);this._seenPlugins.add(e.pluginName)}_flushType(e){this._flushTimerByType.get(e)===void 0&&this._flushTimerByType.set(e,setTimeout(()=>{this._loadPluginsForType(e),this._flushTimerByType.delete(e)},4))}_loadFromPlugins(e){let t=[],r=new Set,i=e=>{let{plugin:a}=e,{pluginName:o}=a;if(this._loadedPlugins.has(o)||r.has(o))return;r.add(o),this._pluginRegistry.delete(o);let s=a[Wg];s&&s.forEach(e=>{let t=this._pluginRegistry.get(e.pluginName);if(t)i(t);else if(!this._seenPlugins.has(e.pluginName)&&!r.has(e.pluginName)){if(a.type===n.UniverType.UNIVER_UNKNOWN&&e.type!==n.UniverType.UNIVER_UNKNOWN)throw Error(`[PluginService]: cannot register a plugin with Univer type that depends on a plugin with other type. The dependent is ${a.pluginName} and the dependency is ${e.pluginName}.`);a.type!==e.type&&e.type!==n.UniverType.UNIVER_UNKNOWN&&this._logService.debug(`[PluginService]`,`Plugin "${o}" depends on "${e.pluginName}" which has different type.`),this._logService.debug(`[PluginService]`,`Plugin "${o}" depends on "${e.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._assertPluginValid(e),i({plugin:e,options:void 0})}}),t.push(e)};e.forEach(e=>i(e));let a=t.map(e=>this._initPlugin(e.plugin,e.options));this._pluginsRunLifecycle(a)}_pluginsRunLifecycle(e){let t=this._lifecycleService.stage;if(Fg(t).subscribe(t=>this._runStage(e,t)),t!==$.Steady){let t=this._lifecycleService.lifecycle$.pipe((0,r.skip)(1)).subscribe(n=>{this._runStage(e,n),n===$.Steady&&t.unsubscribe()})}}_runStage(e,t){e.forEach(e=>{switch(t){case $.Starting:e.onStarting();break;case $.Ready:e.onReady();break;case $.Rendered:e.onRendered();break;case $.Steady:e.onSteady();break}})}_initPlugin(e,t){let n=this._injector.createInstance(e,t);return this._pluginStore.addPlugin(n),this._loadedPlugins.add(e.pluginName),this._logService.debug(`[PluginService]`,`Plugin "${n.getPluginName()}" loaded.`),n}};Jg=ss([W(0,(0,t.Inject)(t.Injector)),W(1,(0,t.Inject)(Pg)),W(2,is)],Jg);let Yg=(0,t.createIdentifier)(`resource-loader-service`),Xg=class extends ra{constructor(e){super(),this._logService=e,F(this,`_resourceMap`,new Map),F(this,`_register$`,new r.Subject),F(this,`register$`,this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(e,t){return t?this.getResourcesByType(e,t):this.getAllResourceHooks().map(t=>{let n=t.toJson(e);return{name:t.pluginName,data:n}})}getResourcesByType(e,t){return this.getAllResourceHooks().filter(e=>e.businesses.includes(t)).map(t=>{let n=t.toJson(e);return{name:t.pluginName,data:n}})}registerPluginResource(e){let t=e.pluginName;if(this._resourceMap.has(t))throw Error(`the pluginName is registered {${t}}`);return this._resourceMap.set(t,e),this._register$.next(e),ta(()=>this._resourceMap.delete(t))}disposePluginResource(e){this._resourceMap.delete(e)}loadResources(e,t){this.getAllResourceHooks().forEach(n=>{var r;let i=t==null||(r=t.find(e=>e.name===n.pluginName))==null?void 0:r.data;if(i)try{let t=n.parseJson(i);n.onLoad(e,t)}catch(e){this._logService.error(`[ResourceManagerService]`,`loadResources error`,e)}})}unloadResources(e,t){this.getAllResourceHooks().filter(e=>e.businesses.includes(t)).forEach(t=>{t.onUnLoad(e)})}dispose(){this._register$.complete(),this._resourceMap.clear()}};Xg=ss([W(0,is)],Xg);var Zg=class extends ra{get darkMode(){return this._darkMode$.getValue()}constructor(){super(),F(this,`_darkMode$`,new r.BehaviorSubject(!1)),F(this,`darkMode$`,this._darkMode$.asObservable()),F(this,`_validColorCache`,new Map),F(this,`_currentTheme`,a.defaultTheme),F(this,`_currentTheme$`,new r.BehaviorSubject(this._currentTheme)),F(this,`currentTheme$`,this._currentTheme$.asObservable()),this.disposeWithMe(ta(()=>{this._currentTheme=a.defaultTheme,this._currentTheme$.complete(),this._darkMode$.complete()}))}isValidThemeColor(e){if(this._validColorCache.has(e))return this._validColorCache.get(e);let t=!1,n=e.split(`.`);if(n.length===1)t=e in a.defaultTheme;else if(n.length===2){let[e,r]=n;t=e in a.defaultTheme&&r in this._currentTheme[e]}return this._validColorCache.set(e,t),t}getCurrentTheme(){return this._currentTheme}setTheme(e){this._currentTheme=e,this._currentTheme$.next(e)}setDarkMode(e){this._darkMode$.next(e)}getColorFromTheme(e){return ti(this._currentTheme,e)}},Qg=function(e){return e[e.WAITING=0]=`WAITING`,e[e.CREATED=1]=`CREATED`,e}(Qg||{});let $g=(0,t.createIdentifier)(`univer.undo-redo.service`);var e_=class{dispose(){}async dispatchToHandlers(){return!1}};let t_=`univer.command.redo`,n_=`univer.command.undo`,r_=new class extends e_{constructor(...e){super(...e),F(this,`type`,ls.COMMAND),F(this,`id`,n_)}handler(e){let t=e.get($g),n=t.pitchTopUndoElement();if(!n)return!1;let r=e.get(us);return hs(n.undoMutations,r)?(t.popUndoToRedo(),!0):!1}},i_=new class extends e_{constructor(...e){super(...e),F(this,`type`,ls.COMMAND),F(this,`id`,t_)}handler(e){let t=e.get($g),n=t.pitchTopRedoElement();if(!n)return!1;let r=e.get(us);return hs(n.redoMutations,r)?(t.popRedoToUndo(),!0):!1}},a_=class extends ra{constructor(e,t,n){super(),this._univerInstanceService=e,this._commandService=t,this._contextService=n,F(this,`undoRedoStatus$`,void 0),F(this,`_undoRedoStatus$`,new r.BehaviorSubject({undos:0,redos:0})),F(this,`_undoStacks`,new Map),F(this,`_redoStacks`,new Map),F(this,`_batchingStatus`,new Map),this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(r_)),this.disposeWithMe(this._commandService.registerCommand(i_)),this.disposeWithMe(ta(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(ta(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(e){let{unitID:t}=e,n=this._getRedoStack(t,!0),r=this._getUndoStack(t,!0);if(n.length=0,this._batchingStatus.has(e.unitID)){let t=this._batchingStatus.get(e.unitID),n=this._pitchUndoElement(e.unitID);t===Qg.WAITING||!n?(i(e),this._batchingStatus.set(e.unitID,Qg.CREATED)):this._tryBatchingElements(n,e)}else i(e);function i(e){r.push(e),r.length>20&&r.splice(0,1)}this._updateStatus()}clearUndoRedo(e){let t=this._getRedoStack(e);t&&(t.length=0);let n=this._getUndoStack(e);n&&(n.length=0),this._updateStatus()}pitchTopUndoElement(){let e=this._getFocusedUnitId();return this._pitchUndoElement(e)}pitchTopRedoElement(){let e=this._getFocusedUnitId();return this._pitchRedoElement(e)}_pitchUndoElement(e){let t=this._getUndoStack(e);return t!=null&&t.length?t[t.length-1]:null}_pitchRedoElement(e){let t=this._getRedoStack(e);return t!=null&&t.length?t[t.length-1]:null}popUndoToRedo(){let e=this._getUndoStackForFocused().pop();e&&(e.redoMutations.length>0&&this._getRedoStackForFocused().push(e),this._updateStatus())}popRedoToUndo(){let e=this._getRedoStackForFocused().pop();e&&(this._getUndoStackForFocused().push(e),this._updateStatus())}rollback(e,t){let n=t||this._getFocusedUnitId(),r=this._getUndoStack(n),i=r==null?void 0:r[(r==null?void 0:r.length)-1];i&&i.id===e&&(r.pop(),hs(i.undoMutations,this._commandService))}__tempBatchingUndoRedo(e){if(this._batchingStatus.has(e))throw Error(`[LocalUndoRedoService]: cannot batching undo redo twice at the same time!`);return this._batchingStatus.set(e,Qg.WAITING),ta(()=>this._batchingStatus.delete(e))}_updateStatus(){var e,t;let n=this._getFocusedUnitId(),r=n&&((e=this._undoStacks.get(n))==null?void 0:e.length)||0,i=n&&((t=this._redoStacks.get(n))==null?void 0:t.length)||0;this._undoRedoStatus$.next({undos:r,redos:i})}_getUndoStack(e,t=!1){let n=this._undoStacks.get(e);return!n&&t&&(n=[],this._undoStacks.set(e,n)),n||null}_getRedoStack(e,t=!1){let n=this._redoStacks.get(e);return!n&&t&&(n=[],this._redoStacks.set(e,n)),n||null}_getUndoStackForFocused(){let e=this._getFocusedUnitId();if(!e)throw Error(`No focused univer instance!`);return this._getUndoStack(e,!0)}_getRedoStackForFocused(){let e=this._getFocusedUnitId();if(!e)throw Error(`No focused univer instance!`);return this._getRedoStack(e,!0)}_tryBatchingElements(e,t){e.redoMutations.push(...t.redoMutations),e.undoMutations.push(...t.undoMutations)}_getFocusedUnitId(){let e=``,t=this._contextService.getContextValue(Rh),n=this._contextService.getContextValue(Hh),r=this._contextService.getContextValue(Vh);if(t)if(n)e=ee;else if(r)e=N;else{var i,a;e=(i=(a=this._univerInstanceService.getFocusedUnit())==null?void 0:a.getUnitId())==null?``:i}else{var o,s;e=(o=(s=this._univerInstanceService.getFocusedUnit())==null?void 0:s.getUnitId())==null?``:o}return e}};a_=ss([W(0,Ag),W(1,us),W(2,ts)],a_);var o_=class{constructor(e,t=1e3){this._injector=e,F(this,`_imageCacheMap`,void 0),this._imageCacheMap=new of(t)}_getImageCacheKey(e,t){return`${e}-${t}`}getImage(e,t,n,r){let i=this._getImageCacheKey(e,t);return this._imageCacheMap.get(i)||((async()=>{let a=new Image,o=this._injector.has(Kh)?this._injector.get(Kh):null,s=this._injector.has(qh)?this._injector.get(qh):null;if(e===Wh.UUID)try{a.src=await(o==null?void 0:o.getImage(t))||``}catch(e){console.error(e)}else if(e===Wh.URL)try{a.src=await(s==null?void 0:s.getImage(t))||t}catch{a.src=t}else a.src=t;a.onload=()=>{a.removeAttribute(`data-error`),n==null||n()},a.onerror=()=>{a.setAttribute(`data-error`,`true`),r==null||r()},this._imageCacheMap.set(i,a)})(),null)}};function s_(e){return!(e.length===0||e.length>31||e.startsWith(`'`)||e.endsWith(`'`)||/[:\\\/\?\*\[\]]/.test(e))}function c_(e,t){return!(!e||e.length===0||e.length>255||t.has(e)||/[ :\\\/\?\*\[\]]/.test(e)||!/^[\p{L}_]/u.test(e)||/^\$?[A-Za-z]{1,3}\$?[0-9]+$/.test(e)||/^[rR]\d+[cC]\d+$/.test(e)||/^\d+$/.test(e))}let l_=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var u_=class e{static from(t){if(!(t instanceof ArrayBuffer))throw Error(`Data must be an instance of ArrayBuffer.`);let[n,r]=new Uint8Array(t,0,2);if(n!==219)throw Error(`Data does not appear to be in a KDBush format.`);let i=r>>4;if(i!==1)throw Error(`Got v${i} data when expected v1.`);let a=l_[r&15];if(!a)throw Error(`Unrecognized array type.`);let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,o,a,t)}constructor(e,t=64,n=Float64Array,r){if(isNaN(e)||e<0)throw Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let i=l_.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return d_(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],c=[];for(;s.length;){let l=s.pop()||0,u=s.pop()||0,d=s.pop()||0;if(u-d<=o){for(let o=d;o<=u;o++){let s=a[2*o],l=a[2*o+1];s>=e&&s<=n&&l>=t&&l<=r&&c.push(i[o])}continue}let f=d+u>>1,p=a[2*f],m=a[2*f+1];p>=e&&p<=n&&m>=t&&m<=r&&c.push(i[f]),(l===0?e<=p:t<=m)&&(s.push(d),s.push(f-1),s.push(1-l)),(l===0?n>=p:r>=m)&&(s.push(f+1),s.push(u),s.push(1-l))}return c}within(e,t,n){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:r,coords:i,nodeSize:a}=this,o=[0,r.length-1,0],s=[],c=n*n;for(;o.length;){let l=o.pop()||0,u=o.pop()||0,d=o.pop()||0;if(u-d<=a){for(let n=d;n<=u;n++)h_(i[2*n],i[2*n+1],e,t)<=c&&s.push(r[n]);continue}let f=d+u>>1,p=i[2*f],m=i[2*f+1];h_(p,m,e,t)<=c&&s.push(r[f]),(l===0?e-n<=p:t-n<=m)&&(o.push(d),o.push(f-1),o.push(1-l)),(l===0?e+n>=p:t+n>=m)&&(o.push(f+1),o.push(u),o.push(1-l))}return s}};function d_(e,t,n,r,i,a){if(i-r<=n)return;let o=r+i>>1;f_(e,t,o,r,i,a),d_(e,t,n,r,o-1,1-a),d_(e,t,n,o+1,i,1-a)}function f_(e,t,n,r,i,a){for(;i>r;){if(i-r>600){let o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);f_(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}let o=t[2*n+a],s=r,c=i;for(p_(e,t,r,n),t[2*i+a]>o&&p_(e,t,r,i);s<c;){for(p_(e,t,s,c),s++,c--;t[2*s+a]<o;)s++;for(;t[2*c+a]>o;)c--}t[2*r+a]===o?p_(e,t,r,c):(c++,p_(e,t,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function p_(e,t,n,r){m_(e,n,r),m_(t,2*n,2*r),m_(t,2*n+1,2*r+1)}function m_(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function h_(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}var g_=class{constructor(e=!1){this._enableOneCellCache=e,F(this,`_tree`,new Map),F(this,`_oneCellCache`,new Map),F(this,`_kdTree`,new Map)}dispose(){this.clear()}getTree(e,t){return this._tree.has(e)||this._tree.set(e,new Map),this._tree.get(e).has(t)||this._tree.get(e).set(t,new Ef),this._tree.get(e).get(t)}_getOneCellCache(e,t,n,r){return this._oneCellCache.has(e)||this._oneCellCache.set(e,new Map),this._oneCellCache.get(e).has(t)||this._oneCellCache.get(e).set(t,new Map),this._oneCellCache.get(e).get(t).has(n)||this._oneCellCache.get(e).get(t).set(n,new Map),this._oneCellCache.get(e).get(t).get(n).has(r)||this._oneCellCache.get(e).get(t).get(n).set(r,new Set),this._oneCellCache.get(e).get(t).get(n).get(r)}_removeOneCellCache(e,t,n,r,i){let a=this._oneCellCache.get(e);if(!a)return;let o=a.get(t);if(!o)return;let s=o.get(n);if(!s)return;let c=s.get(r);c&&c.delete(i)}_removeCellCacheByRange(e){let{unitId:t,sheetId:n,range:r,id:i}=e,a=this._oneCellCache.get(t);if(!a)return;let o=a.get(n);if(!o)return;let{startRow:s,startColumn:c,endRow:l,endColumn:u}=r;for(let e=s;e<=l;e++){let t=o.get(e);if(t)for(let e=c;e<=u;e++){let n=t.get(e);n&&n.delete(i)}}}_insertOneCellCache(e,t,n,r,i){this._getOneCellCache(e,t,n,r).add(i)}_getRdTreeItems(e){let t=[];for(let[n,r]of e)for(let[e,i]of r)t.push({x:e,y:n,ids:i});return t}_searchByOneCellCache(e){var t;let{unitId:n,sheetId:r,range:i}=e,{startRow:a,startColumn:o,endRow:s,endColumn:c}=i,l=(t=this._kdTree.get(n))==null?void 0:t.get(r);if(!l)return[];let{tree:u,items:d}=l,f=u.range(o,a,c,s),p=[];for(let e of f){let t=d[e];p.push(...Array.from(t.ids))}return p}openKdTree(){for(let[t,n]of this._oneCellCache){this._kdTree.has(t)||this._kdTree.set(t,new Map);for(let[r,i]of n){var e;let n=this._getRdTreeItems(i),a=new u_(n.length);(e=this._kdTree.get(t))==null||e.set(r,{tree:a,items:n});for(let e of n)a.add(e.x,e.y);a.finish()}}}closeKdTree(){for(let[t,n]of this._oneCellCache)for(let[r,i]of n){var e;(e=this._kdTree.get(t))==null||e.set(r,void 0)}}insert(e){let{unitId:t,sheetId:n,range:r,id:i}=e;if(!t||t.length===0)return;let{startRow:a,endRow:o,startColumn:s,endColumn:c}=r;if(this._enableOneCellCache&&a===o&&s===c){this._insertOneCellCache(t,n,a,s,i);return}let l=this.getTree(t,n);Number.isNaN(a)&&(a=0),Number.isNaN(s)&&(s=0),Number.isNaN(o)&&(o=1/0),Number.isNaN(c)&&(c=1/0),l.insert({minX:s,minY:a,maxX:c,maxY:o,id:i})}bulkInsert(e){for(let t of e)this.insert(t)}*searchGenerator(e){var t;let{unitId:n,sheetId:r,range:i}=e;if(this._enableOneCellCache){let t=this._searchByOneCellCache(e);for(let e of t)yield e}let a=(t=this._tree.get(n))==null?void 0:t.get(r);if(!a)return;let o=a.search({minX:i.startColumn,minY:i.startRow,maxX:i.endColumn,maxY:i.endRow});for(let e of o)yield e.id}bulkSearch(e,t){let n=new Set;for(let r of e)for(let e of this.searchGenerator(r))(t==null?void 0:t.has(e))!==!0&&n.add(e);return n}removeById(e,t){if(t){var n,r;(n=this._tree.get(e))==null||n.delete(t),(r=this._oneCellCache.get(e))==null||r.delete(t)}else this._tree.delete(e),this._oneCellCache.delete(e)}_removeRTreeItem(e){let{unitId:t,sheetId:n,range:r,id:i}=e,a=this.getTree(t,n),o=a.search({minX:r.startColumn,minY:r.startRow,maxX:r.endColumn,maxY:r.endRow});for(let e=0;e<o.length;e++)o[e].id===i&&a.remove(o[e])}remove(e){let{unitId:t,sheetId:n,range:r,id:i}=e,{startRow:a,startColumn:o,endRow:s,endColumn:c}=r;this._enableOneCellCache?a===s&&o===c?this._removeOneCellCache(t,n,r.startRow,r.startColumn,i):(this._removeCellCacheByRange(e),this._removeRTreeItem(e)):this._removeRTreeItem(e)}bulkRemove(e){for(let t of e)this.remove(t)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){let e={};return this._tree.forEach((t,n)=>{e[n]={},t.forEach((t,r)=>{e[n][r]=t.toJSON()})}),e}fromJSON(e){this._tree.clear();for(let t in e){this._tree.set(t,new Map);for(let n in e[t]){let r=new Ef;r.fromJSON(e[t][n]),this._tree.get(t).set(n,r)}}}};function __(e){return new Promise(t=>setTimeout(t,e))}function v_(e=1){return new Promise(t=>{let n=0,r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}let y_=class extends ra{constructor(e){super(),this._localeService=e,F(this,`_fontLocale`,void 0),F(this,`_dirty`,!0),this._localeInitial()}get dirty(){return this._dirty}getFontLocale(){return this._fontLocale}makeDirty(e){this._dirty=e}dispose(){super.dispose(),this._fontLocale=null}_localeInitial(){}};y_=ss([W(0,(0,t.Inject)(Lg))],y_);function b_(e={}){let t={defaultBackgroundColor:`rgba(24, 119, 242, 0.08)`,defaultStripeColor:`rgba(24, 119, 242, 0.25)`,rowGaps:{1:{size:6},3:{size:10,color:`rgba(245, 158, 11, 0.14)`},6:{size:14,color:`rgba(16, 185, 129, 0.12)`,stripeColor:`rgba(5, 150, 105, 0.35)`}},colGaps:{1:{size:5},2:{size:8,stripeColor:`rgba(59, 130, 246, 0.35)`},4:{size:12,color:`rgba(244, 63, 94, 0.12)`,stripeColor:`rgba(225, 29, 72, 0.30)`}}};return{...t,...e,rowGaps:{...t.rowGaps,...e.rowGaps},colGaps:{...t.colGaps,...e.colGaps}}}let x_=class extends y_{constructor(e,t,n,r,i,a){super(n),this.worksheet=e,this._styles=t,this._contextService=r,this._configService=i,this._injector=a,F(this,`_worksheetData`,void 0),F(this,`_renderRawFormula`,!1),F(this,`_cellData`,void 0),F(this,`_imageCacheMap`,void 0),F(this,`_skipAutoHeightForMergedCells`,!0),F(this,`_rowTotalHeight`,0),F(this,`_columnTotalWidth`,0),F(this,`_rowHeaderWidth`,0),F(this,`_columnHeaderHeight`,0),F(this,`_rowHeightAccumulation`,[]),F(this,`_columnWidthAccumulation`,[]),F(this,`_marginTop`,0),F(this,`_marginLeft`,0),F(this,`_gapConfig`,{}),F(this,`_scaleX`,1),F(this,`_scaleY`,1),F(this,`_scrollX`,0),F(this,`_scrollY`,0),this._worksheetData=this.worksheet.getConfig(),this._cellData=this.worksheet.getCellMatrix(),this._imageCacheMap=new o_(this._injector),this.initConfig()}initConfig(){var e,t;this._skipAutoHeightForMergedCells=!((e=this._configService.getConfig(re))!=null&&e),this.worksheet.setIsRowStylePrecedeColumnStyle((t=this._configService.getConfig(`isRowStylePrecedeColumnStyle`))==null?!1:t)}resetCache(){}getWorksheetConfig(){return this._worksheetData}getLocation(){return[this.worksheet.getUnitId(),this.worksheet.getSheetId()]}set columnHeaderHeight(e){this._columnHeaderHeight=e,this._worksheetData.columnHeader.height=e}set rowHeaderWidth(e){this._rowHeaderWidth=e,this._worksheetData.rowHeader.width=e}get rowHeightAccumulation(){return this._rowHeightAccumulation}get rowTotalHeight(){return this._rowTotalHeight}get columnWidthAccumulation(){return this._columnWidthAccumulation}get columnTotalWidth(){return this._columnTotalWidth}get rowHeaderWidth(){return this._rowHeaderWidth}get columnHeaderHeight(){return this._columnHeaderHeight}setMarginLeft(e){this._marginLeft=e}setMarginTop(e){this._marginTop=e}setScale(e,t){this._updateLayout(),this._scaleX=e,this._scaleY=t||e,this._updateLayout()}setScroll(e,t){L.isDefine(e)&&(this._scrollX=e),L.isDefine(t)&&(this._scrollY=t)}get scrollX(){return this._scrollX}get scrollY(){return this._scrollY}get scaleX(){return this._scaleX}get scaleY(){return this._scaleY}get rowHeaderWidthAndMarginLeft(){return this.rowHeaderWidth+this._marginLeft}get columnHeaderHeightAndMarginTop(){return this.columnHeaderHeight+this._marginTop}get imageCacheMap(){return this._imageCacheMap}get gapConfig(){return this._gapConfig}setGapConfig(e){this._gapConfig=this._fillDefaultGapThemeColors(e),this.makeDirty(!0),this._updateLayout()}_fillDefaultGapThemeColors(e){var t,n;if(e.defaultBackgroundColor&&e.defaultStripeColor)return e;let{r,g:i,b:a}=new As(this._injector.get(Zg).getColorFromTheme(`primary.500`)).toRgb();return{...e,defaultBackgroundColor:(t=e.defaultBackgroundColor)==null?`rgba(${r}, ${i}, ${a}, 0.08)`:t,defaultStripeColor:(n=e.defaultStripeColor)==null?`rgba(${r}, ${i}, ${a}, 0.25)`:n}}getRowGapSize(e){var t,n;return(t=(n=this._gapConfig.rowGaps)==null||(n=n[e])==null?void 0:n.size)==null?0:t}getColGapSize(e){var t,n;return(t=(n=this._gapConfig.colGaps)==null||(n=n[e])==null?void 0:n.size)==null?0:t}getGapSizeGetter(){if(!(!this._gapConfig.rowGaps&&!this._gapConfig.colGaps))return{row:e=>this.getRowGapSize(e),col:e=>this.getColGapSize(e)}}getRowGapAtPosition(e){let{rowGaps:t}=this._gapConfig;if(!t)return-1;for(let a of Object.keys(t)){var n,r,i;let o=Number(a),s=(n=(r=t[o])==null?void 0:r.size)==null?0:n;if(s<=0)continue;let c=(i=this._rowHeightAccumulation[o-1])==null?0:i,l=c+s;if(e>=c&&e<l)return o}return-1}getColGapAtPosition(e){let{colGaps:t}=this._gapConfig;if(!t)return-1;for(let a of Object.keys(t)){var n,r,i;let o=Number(a),s=(n=(r=t[o])==null?void 0:r.size)==null?0:n;if(s<=0)continue;let c=(i=this._columnWidthAccumulation[o-1])==null?0:i,l=c+s;if(e>=c&&e<l)return o}return-1}_generateRowMatrixCache(e,t,n){let r=0,i=[],a=t;for(let t=0;t<e;t++){var o,s;let e=n;if(this.worksheet.getRowFiltered(t))e=0;else if(a[t]!=null){let r=a[t];if(!r)continue;let{h:i=n,ah:o,ia:s}=r;e=(s==null||s===z.TRUE)&&typeof o==`number`&&o>0?o:i,r.hd===z.TRUE&&(e=0)}let c=(o=(s=this._gapConfig.rowGaps)==null||(s=s[t])==null?void 0:s.size)==null?0:o;r+=c,r+=e,i.push(r)}return{rowTotalHeight:r,rowHeightAccumulation:i}}_generateColumnMatrixCache(e,t,n){let r=0,i=[],a=t;for(let t=0;t<e;t++){var o,s;let e=n;if(a[t]!=null){let n=a[t];if(!n)continue;n.w!=null&&(e=n.w),n.hd===z.TRUE&&(e=0)}let c=(o=(s=this._gapConfig.colGaps)==null||(s=s[t])==null?void 0:s.size)==null?0:o;r+=c,r+=e,i.push(r)}return{columnTotalWidth:r,columnWidthAccumulation:i}}intersectMergeRange(e,t){return!!this.worksheet.getMergedCell(e,t)}_getOverflowBound(e,t,n,r,i=Ua.LEFT){let a=0;if(t>n){let o=this._columnWidthAccumulation.length-1;for(let s=t;s>=n;s--){let n=s;if(!Xu(this.worksheet.getCell(e,n))&&n!==t||this.intersectMergeRange(e,n))return n===t?n:n+1>o?o:n+1;let{startX:c,endX:l}=C_(e,n,this.rowHeightAccumulation,this.columnWidthAccumulation,void 0,this.getGapSizeGetter());if(i===Ua.CENTER&&n===t?a+=(l-c)/2:a+=l-c,r<a)return n}return t}for(let o=t;o<=n;o++){let n=o;if(!Xu(this.worksheet.getCell(e,n))&&n!==t||this.intersectMergeRange(e,n))return n===t?n:n-1<0?0:n-1;let{startX:s,endX:c}=C_(e,n,this.rowHeightAccumulation,this.columnWidthAccumulation,void 0,this.getGapSizeGetter());if(i===Ua.CENTER&&n===t?a+=(c-s)/2:a+=c-s,r<a)return n}return n}_updateLayout(){if(!this.dirty)return;let{rowData:e,columnData:t,defaultRowHeight:n,defaultColumnWidth:r,rowCount:i,columnCount:a,rowHeader:o,columnHeader:s}=this._worksheetData,{rowTotalHeight:c,rowHeightAccumulation:l}=this._generateRowMatrixCache(i,e,n),{columnTotalWidth:u,columnWidthAccumulation:d}=this._generateColumnMatrixCache(a,t,r);this._rowHeaderWidth=o.hidden===z.TRUE?0:this._dynamicallyUpdateRowHeaderWidth(o),this._columnHeaderHeight=s.hidden===z.TRUE?0:s.height,this._rowTotalHeight=c,this._rowHeightAccumulation=l,this._columnTotalWidth=u,this._columnWidthAccumulation=d,this.makeDirty(!1)}calculate(){return this.resetCache(),this._updateLayout(),this}resetRangeCache(e){}_dynamicallyUpdateRowHeaderWidth(e){let t=`${this.worksheet.getRowCount()}`.length*8;return Math.max(e.width,t)}_hasUnMergedCellInRow(e,t,n){if(!this.worksheet.getMergeData())return!1;for(let r=t;r<=n;r++){let{isMerged:t,isMergedMainCell:n}=this.worksheet.getCellInfoInMergeData(e,r);if(!t&&!n)return!0}return!1}expandRangeByMerge(e,t){let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e,o=this._worksheetData.mergeData;if(!o)return{startRow:n,startColumn:r,endRow:i,endColumn:a};let s=!0,c=new Gu,l=0,u=null;for(;s;){s=!1;for(let e=0;e<o.length;e++){let{startRow:t,startColumn:d,endRow:f,endColumn:p}=o[e];if(c.getValue(t,d))continue;let m={startColumn:r,startRow:n,endColumn:a,endRow:i},h={startColumn:d,startRow:t,endColumn:p,endRow:f};Jf(m,h)&&(n=Math.min(n,t),r=Math.min(r,d),i=Math.max(i,f),a=Math.max(a,p),c.setValue(t,d,!0),s=!0,l++,u=h)}}return t&&l===1&&Qf.contains(u,e)?{startRow:u.startRow,startColumn:u.startColumn,endRow:u.startRow,endColumn:u.startColumn}:{startRow:n,startColumn:r,endRow:i,endColumn:a}}getColumnCount(){return this._columnWidthAccumulation.length}getRowCount(){return this._rowHeightAccumulation.length}_getCellMergeInfo(e,t){return this.worksheet.getCellInfoInMergeData(e,t)}getNoMergeCellWithCoordByIndex(e,t,n=!0){let{rowHeightAccumulation:r,columnWidthAccumulation:i,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:o}=this,{startY:s,endY:c,startX:l,endX:u}=C_(e,t,r,i,void 0,this.getGapSizeGetter());return n&&(s+=o,c+=o,l+=a,u+=a),{startY:s,endY:c,startX:l,endX:u}}getRowIndexByOffsetY(e,t,n,r){let{rowHeightAccumulation:i}=this;e=T_(e,t,n,this.columnHeaderHeightAndMarginTop);let a=Es(i,e,r==null?void 0:r.firstMatch);if(r!=null&&r.closeFirst){var o;Math.abs(i[a]-e)<Math.abs(e-((o=i[a-1])==null?0:o))&&(a+=1)}return a}getColumnIndexByOffsetX(e,t,n,r){let i=w_(e,t,n,this.rowHeaderWidthAndMarginLeft),{columnWidthAccumulation:a}=this,o=Es(a,i,r==null?void 0:r.firstMatch);if(r!=null&&r.closeFirst){var s;Math.abs(a[o]-i)<Math.abs(i-((s=a[o-1])==null?0:s))&&(o+=1)}return o}getCellIndexByOffset(e,t,n,r,i,a){return{row:this.getRowIndexByOffsetY(t,r,i,a),column:this.getColumnIndexByOffsetX(e,n,i,a)}}getCellByOffset(e,t,n,r,i){var a;let o=(a=this)==null?void 0:a.getCellIndexByOffset(e,t,n,r,i,{firstMatch:!0});return o?this.worksheet.getCellInfoInMergeData(o.row,o.column):null}getCellWithCoordByIndex(e,t,n=!0){var r;let{rowHeightAccumulation:i,columnWidthAccumulation:a,rowHeaderWidthAndMarginLeft:o,columnHeaderHeightAndMarginTop:s}=this,c=C_(e,t,i,a,(r=this.worksheet)==null?void 0:r.getCellInfoInMergeData(e,t),this.getGapSizeGetter()),{isMerged:l,isMergedMainCell:u}=c,{startY:d,endY:f,startX:p,endX:m,mergeInfo:h}=c,g=o,_=s;return n===!1&&(g=0,_=0),d+=_,f+=_,p+=g,m+=g,h.startY+=_,h.endY+=_,h.startX+=g,h.endX+=g,{actualRow:e,actualColumn:t,startX:p,startY:d,endX:m,endY:f,isMerged:l,isMergedMainCell:u,mergeInfo:h}}getCellWithCoordByOffset(e,t,n,r,i,a){let{row:o,column:s}=this.getCellIndexByOffset(e,t,n,r,i,a);return this.getCellWithCoordByIndex(o,s)}getOffsetByColumn(e){let{columnWidthAccumulation:t,rowHeaderWidthAndMarginLeft:n}=this,r=t.length-1,i=t[e];return i==null?e<0?n:t[r]+n:i+n}getOffsetByRow(e){let{rowHeightAccumulation:t,columnHeaderHeightAndMarginTop:n}=this,r=t.length-1,i=t[e];return i==null?e<0?n:t[r]+n:i+n}getOffsetRelativeToRowCol(e,t){let n=Es(this.columnWidthAccumulation,e),r=e-((this._columnWidthAccumulation[n-1]||0)+this.getColGapSize(n)),i=Es(this.rowHeightAccumulation,t);return{row:i,column:n,columnOffset:r,rowOffset:t-((this._rowHeightAccumulation[i-1]||0)+this.getRowGapSize(i))}}getCellIndexAndOffsetByPosition(e,t){let{actualRow:n,actualColumn:r,startX:i,startY:a}=this.getCellWithCoordByOffset(e,t,this._scaleX,this._scaleY,{x:this._scrollX,y:this._scrollY});return{row:n,rowOffset:t-a,column:r,columnOffset:e-i}}_updateConfigAndGetDocumentModel(e,t,n,r){var i,a,o,s,c;if(!r||!((i=e.body)!=null&&i.dataStream))return;e.documentStyle||(e.documentStyle={}),e.documentStyle.marginTop=(a=n.t)==null?0:a,e.documentStyle.marginBottom=(o=n.b)==null?2:o,e.documentStyle.marginLeft=(s=n.l)==null?2:s,e.documentStyle.marginRight=(c=n.r)==null?2:c,e.documentStyle.pageSize={width:1/0,height:1/0},e.documentStyle.renderConfig={...e.documentStyle.renderConfig,...r};let l=e.body.paragraphs||[];for(let e of l)e.paragraphStyle||(e.paragraphStyle={}),e.paragraphStyle.horizontalAlign=t;return new Fm(e)}dispose(){super.dispose(),this._rowHeightAccumulation=[],this._columnWidthAccumulation=[],this._rowTotalHeight=0,this._columnTotalWidth=0,this._rowHeaderWidth=0,this._columnHeaderHeight=0,this._worksheetData=null,this._cellData=null,this._styles=null,this.worksheet=null}};x_=ss([W(2,(0,t.Inject)(Lg)),W(3,ts),W(4,$o),W(5,(0,t.Inject)(t.Injector))],x_);function S_(e,t,n,r,i=0,a=0){let o=e-1,s=t-1,c=(n[o]||0)+i,l=n[e];l==null&&(l=n[n.length-1]);let u=(r[s]||0)+a,d=r[t];return d==null&&(d=r[r.length-1]),{startY:c,endY:l,startX:u,endX:d}}function C_(e,t,n,r,i,a){var o,s;e=L.clamp(e,0,n.length-1),t=L.clamp(t,0,r.length-1);let{startY:c,endY:l,startX:u,endX:d}=S_(e,t,n,r,(o=a==null?void 0:a.row(e))==null?0:o,(s=a==null?void 0:a.col(t))==null?0:s);if(!i)return{startY:c,endY:l,startX:u,endX:d,isMerged:!1,isMergedMainCell:!1,actualRow:e,actualColumn:t,mergeInfo:{startY:c,endY:l,startX:u,endX:d,startRow:e,startColumn:t,endRow:e,endColumn:t}};let{isMerged:f,isMergedMainCell:p,startRow:m,startColumn:h,endRow:g,endColumn:_}=i,v={startRow:m,startColumn:h,endRow:g,endColumn:_,startY:c,endY:l,startX:u,endX:d},y=n.length-1,b=r.length-1;if(f&&m!==-1&&h!==-1){var x,S;let e=(x=a==null?void 0:a.row(m))==null?0:x,t=(S=a==null?void 0:a.col(h))==null?0:S,i=(n[m-1]||0)+e,o=n[g]||n[y],s=(r[h-1]||0)+t,c=r[_]||r[b];v={...v,startY:i,endY:o,startX:s,endX:c}}else if(!f&&g!==-1&&_!==-1){let e=n[g]||n[y],t=r[_]||r[b];v={...v,startY:c,endY:e,startX:u,endX:t}}return{isMerged:f,isMergedMainCell:p,actualRow:e,actualColumn:t,startY:c,endY:l,startX:u,endX:d,mergeInfo:v}}function w_(e,t,n,r){let{x:i}=n;return e/t+i-r}function T_(e,t,n,r){let{y:i}=n;return e=e/t+i-r,e}let E_=[`script`,`style`,`meta`,`comment`,`link`],D_=function(e){return e[e.INFO=0]=`INFO`,e[e.STOP=1]=`STOP`,e[e.WARNING=2]=`WARNING`,e}({}),O_=function(e){return e[e.DISABLED=0]=`DISABLED`,e[e.FULL_ALPHA=1]=`FULL_ALPHA`,e[e.FULL_HANGUL=2]=`FULL_HANGUL`,e[e.FULL_KATAKANA=3]=`FULL_KATAKANA`,e[e.HALF_ALPHA=4]=`HALF_ALPHA`,e[e.HALF_HANGUL=5]=`HALF_HANGUL`,e[e.HALF_KATAKANA=6]=`HALF_KATAKANA`,e[e.HIRAGANA=7]=`HIRAGANA`,e[e.NO_CONTROL=8]=`NO_CONTROL`,e[e.OFF=9]=`OFF`,e[e.ON=10]=`ON`,e}({}),k_=function(e){return e.BETWEEN=`between`,e.EQUAL=`equal`,e.GREATER_THAN=`greaterThan`,e.GREATER_THAN_OR_EQUAL=`greaterThanOrEqual`,e.LESS_THAN=`lessThan`,e.LESS_THAN_OR_EQUAL=`lessThanOrEqual`,e.NOT_BETWEEN=`notBetween`,e.NOT_EQUAL=`notEqual`,e}({}),A_=function(e){return e[e.TEXT=0]=`TEXT`,e[e.ARROW=1]=`ARROW`,e[e.CUSTOM=2]=`CUSTOM`,e}({}),j_=function(e){return e.VALID=`valid`,e.INVALID=`invalid`,e.VALIDATING=`validating`,e}({}),M_=function(e){return e.CUSTOM=`custom`,e.LIST=`list`,e.LIST_MULTIPLE=`listMultiple`,e.NONE=`none`,e.TEXT_LENGTH=`textLength`,e.DATE=`date`,e.TIME=`time`,e.WHOLE=`whole`,e.DECIMAL=`decimal`,e.CHECKBOX=`checkbox`,e.ANY=`any`,e}({}),N_=class extends ra{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){let e=e=>{e.businesses.forEach(t=>{switch(t){case n.UniverType.UNRECOGNIZED:case n.UniverType.UNIVER_UNKNOWN:case n.UniverType.UNIVER_SLIDE:case n.UniverType.UNIVER_DOC:this._univerInstanceService.getAllUnitsForType(n.UniverType.UNIVER_DOC).forEach(t=>{let n=(t.getSnapshot().resources||[]).find(t=>t.name===e.pluginName);if(n)try{let r=e.parseJson(n.data);e.onLoad(t.getUnitId(),r)}catch{console.error(`Load Document{${t.getUnitId()}} Resources{${e.pluginName}} Data Error.`)}});break;case n.UniverType.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(n.UniverType.UNIVER_SHEET).forEach(t=>{let n=(t.getSnapshot().resources||[]).find(t=>t.name===e.pluginName);if(n)try{let r=e.parseJson(n.data);e.onLoad(t.getUnitId(),r)}catch{console.error(`Load Workbook{${t.getUnitId()}} Resources{${e.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(t=>e(t)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(t=>e(t))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(n.UniverType.UNIVER_SHEET).subscribe(e=>{let{unit:t}=e;this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(n.UniverType.UNIVER_DOC).subscribe(e=>{let{unit:t}=e;P(t.getUnitId())||this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(n.UniverType.UNIVER_SHEET).subscribe(e=>{this._resourceManagerService.unloadResources(e.getUnitId(),n.UniverType.UNIVER_SHEET)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(n.UniverType.UNIVER_DOC).subscribe(e=>{this._resourceManagerService.unloadResources(e.getUnitId(),n.UniverType.UNIVER_DOC)}))}saveUnit(e){let t=this._univerInstanceService.getUnit(e);if(!t)return null;let n=this._resourceManagerService.getResources(e,t.type),r=L.deepClone(t.getSnapshot());return r.resources=n,r}};N_=ss([W(0,(0,t.Inject)(Oh)),W(1,(0,t.Inject)(Ag))],N_);var P_=class extends oa{constructor(...e){super(...e),F(this,`type`,void 0),F(this,`name$`,void 0)}getUnitId(){throw Error(`Method not implemented.`)}setName(e){throw Error(`Method not implemented.`)}getSnapshot(){throw Error(`Method not implemented.`)}getRev(){throw Error(`Method not implemented.`)}incrementRev(){throw Error(`Method not implemented.`)}setRev(e){throw Error(`Method not implemented.`)}},F_=class{get _univerInstanceService(){return this._injector.get(Ag)}get _pluginService(){return this._injector.get(Jg)}constructor(e={},t){F(this,`_startedTypes`,new Set),F(this,`_injector`,void 0),F(this,`_disposingCallbacks`,new na);let n=this._injector=I_(t,e==null?void 0:e.override),{theme:r,darkMode:i,locale:a,locales:o,logLevel:s,logCommandExecution:c}=e;r&&this._injector.get(Zg).setTheme(r),i&&this._injector.get(Zg).setDarkMode(i),o&&this._injector.get(Lg).load(o),a&&this._injector.get(Lg).setLocale(a),s&&this._injector.get(is).setLogLevel(s),c!==void 0&&this._injector.get($o).setConfig(cs,c),this._init(n)}__getInjector(){return this._injector}onDispose(e){let t=this._disposingCallbacks.add(ta(e));return ta(()=>t.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(e){this._injector.get(Lg).setLocale(e)}createUnit(e,t){return this._univerInstanceService.createUnit(e,t)}_init(e){this._univerInstanceService.registerCtorForType(n.UniverType.UNIVER_SHEET,kg),this._univerInstanceService.registerCtorForType(n.UniverType.UNIVER_DOC,Fm),this._univerInstanceService.registerCtorForType(n.UniverType.UNIVER_SLIDE,P_);let t=e.get(Ag);t.__setCreateHandler((n,r,i,a)=>{var o;let s=!this._startedTypes.has(n);s&&(this._pluginService.startPluginsForType(n),this._startedTypes.add(n));let c=(o=t.__getCtorByType(n))==null?i:o;if(!c)throw Error(`[Univer]: No constructor registered for unit type ${n}.`);let l=e.createInstance(c,r);return t.__addUnit(l,a),s&&this._tryProgressToReady(),l})}_tryProgressToReady(){this._injector.get(Pg).stage<$.Ready&&(this._injector.get(Pg).stage=$.Ready)}registerPlugin(e,t){this._pluginService.registerPlugin(e,t)}registerPlugins(e){e.forEach(e=>{let[t,n]=e;this._pluginService.registerPlugin(t,n)})}};function I_(e,n){let r=Ug([[Uh],[Lg],[Zg],[Pg],[Jg],[Mh],[Ag,{useClass:jg}],[Vg,{useClass:Hg}],[is,{useClass:as,lazy:!0}],[us,{useClass:ps}],[$g,{useClass:a_,lazy:!0}],[$o,{useClass:es}],[ts,{useClass:ns}],[Oh,{useClass:Xg,lazy:!0}],[Yg,{useClass:N_,lazy:!0}],[Ph,{useClass:Nh}],[zg,{useClass:Rg,lazy:!0}]],n),i=e?e.createChild(r):new t.Injector(r);return se(i,[[Mh],[Yg]]),i}b(),e.ABCToNumber=ap,e.AUTO_HEIGHT_FOR_MERGED_CELLS=re,e.AbsoluteRefType=K,e.ActionIterator=dm,e.AlignTypeH=Do,e.AlignTypeV=Oo,e.ArrangeTypeEnum=Mo,e.AsyncInterceptorManager=xe,e.AsyncLock=k.default,Object.defineProperty(e,`AuthzIoLocalService`,{enumerable:!0,get:function(){return Nh}}),e.AutoFillSeries=Ta,e.BORDER_KEYS=Ro,e.BORDER_STYLE_KEYS=Lo,e.BaselineOffset=Ja,e.BlockType=ro,e.BooleanNumber=z,e.BorderStyleTypes=R,e.BorderType=Ea,e.BuildTextUtils=mh,e.BulletAlignment=eo,e.COLORS=ks,e.COLOR_STYLE_KEYS=Io,e.COMMAND_LOG_EXECUTION_CONFIG_KEY=cs,e.CanceledError=ue,e.CellModeEnum=nc,e.CellValueType=Ya,e.ColorKit=As,e.ColorType=Da,e.ColumnSeparatorType=so,Object.defineProperty(e,`CommandService`,{enumerable:!0,get:function(){return ps}}),e.CommandType=ls,e.CommonHideTypes=Oa,e.ConfigService=es,e.ContextService=ns,e.CopyPasteType=ka,e.CustomCommandExecutionError=le,e.CustomDecorationType=no,e.CustomRangeType=to,e.DEFAULT_CELL=mf,e.DEFAULT_DOC=Nm,e.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=`__default_document_sub_component_id20231101__`,e.DEFAULT_EMPTY_DOCUMENT_VALUE=`\r
|
|
9
|
-
`,e.DEFAULT_NUMBER_FORMAT=`General`,e.DEFAULT_RANGE=ff,e.DEFAULT_RANGE_ARRAY=df,e.DEFAULT_SELECTION=pf,e.DEFAULT_STYLES=hf,e.DEFAULT_TEXT_FORMAT=`@@@`,e.DEFAULT_TEXT_FORMAT_EXCEL=`@`,e.DEFAULT_WORKSHEET_COLUMN_COUNT=20,e.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=`DEFAULT_WORKSHEET_COLUMN_COUNT`,e.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=20,e.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=`DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT`,e.DEFAULT_WORKSHEET_COLUMN_WIDTH=88,e.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=`DEFAULT_WORKSHEET_COLUMN_WIDTH`,e.DEFAULT_WORKSHEET_ROW_COUNT=bg,e.DEFAULT_WORKSHEET_ROW_COUNT_KEY=`DEFAULT_WORKSHEET_ROW_COUNT`,e.DEFAULT_WORKSHEET_ROW_HEIGHT=24,e.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=`DEFAULT_WORKSHEET_ROW_HEIGHT`,e.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=46,e.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=`DEFAULT_WORKSHEET_ROW_TITLE_WIDTH`,e.DOCS_COMMENT_EDITOR_UNIT_ID_KEY=ne,e.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=ee,e.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=N,e.DOCS_ZEN_EDITOR_UNIT_ID_KEY=te,e.DOC_DRAWING_PRINTING_COMPONENT_KEY=`univer-docs-drawing-printing`,e.DOC_RANGE_TYPE=ec,e.DashStyleType=ho,e.DataStreamTreeNodeType=Em,e.DataStreamTreeTokenType=Dm,e.DataValidationErrorStyle=D_,e.DataValidationImeMode=O_,e.DataValidationOperator=k_,e.DataValidationRenderMode=A_,e.DataValidationStatus=j_,e.DataValidationType=M_,e.DeleteDirection=Aa,e.DependentOn=qg,e.DesktopLogService=as,e.DeveloperMetadataVisibility=ja,e.Dimension=Ma,e.Direction=Na,e.Disposable=ra,e.DisposableCollection=na,e.DocStyleType=Qa,e.DocumentDataModel=Fm,e.DocumentFlavor=io,e.DrawingTypeEnum=No,e.EDITOR_ACTIVATED=Vh,e.EXTENSION_NAMES=yf,e.ErrorService=Uh,e.EventState=Th,e.EventSubject=Eh,e.FOCUSING_COMMENT_EDITOR=`FOCUSING_COMMENT_EDITOR`,e.FOCUSING_COMMON_DRAWINGS=`FOCUSING_COMMON_DRAWINGS`,e.FOCUSING_DOC=zh,e.FOCUSING_EDITOR_BUT_HIDDEN=`FOCUSING_EDITOR_BUT_HIDDEN`,e.FOCUSING_EDITOR_INPUT_FORMULA=`FOCUSING_EDITOR_INPUT_FORMULA`,e.FOCUSING_EDITOR_STANDALONE=`FOCUSING_EDITOR_INPUT_FORMULA`,e.FOCUSING_FX_BAR_EDITOR=Hh,e.FOCUSING_PANEL_EDITOR=`FOCUSING_PANEL_EDITOR`,e.FOCUSING_SHAPE_TEXT_EDITOR=`FOCUSING_SHAPE_TEXT_EDITOR`,e.FOCUSING_SHEET=Rh,e.FOCUSING_SLIDE=Bh,e.FOCUSING_UNIT=Lh,e.FOCUSING_UNIVER_EDITOR=`FOCUSING_UNIVER_EDITOR`,e.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=`FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE`,e.FORMULA_EDITOR_ACTIVATED=`FORMULA_EDITOR_ACTIVATED`,e.FollowNumberWithType=$a,e.FontItalic=Ka,e.FontStyleType=Co,e.FontWeight=qa,e.GridType=ao,e.HorizontalAlign=Ua,e.IAuthzIoService=Ph,e.ICommandService=us,e.IConfigService=$o,e.IConfirmService=Fh,e.IContextService=ts,e.IImageIoService=Kh,e.ILocalStorageService=Ig,e.ILogService=is,e.IMentionIOService=zg,e.IPermissionService=Vg,e.IResourceLoaderService=Yg,e.IResourceManagerService=Oh,e.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=`isRowStylePrecedeColumnStyle`,e.IURLImageService=qh,e.IUndoRedoService=$g,e.IUniverInstanceService=Ag,e.ImageCacheMap=o_,e.ImageSourceType=Wh,e.ImageUploadStatusType=Gh,Object.defineProperty(e,`Inject`,{enumerable:!0,get:function(){return t.Inject}}),Object.defineProperty(e,`InjectSelf`,{enumerable:!0,get:function(){return t.InjectSelf}}),Object.defineProperty(e,`Injector`,{enumerable:!0,get:function(){return t.Injector}}),e.InterceptorEffectEnum=he,e.InterceptorManager=ve,e.InterpolationPointType=Fa,Object.defineProperty(e,`JSON1`,{enumerable:!0,get:function(){return Qo}}),e.JSONX=Tm,e.LRUHelper=sf,e.LRUMap=of,Object.defineProperty(e,`LifecycleService`,{enumerable:!0,get:function(){return Pg}}),e.LifecycleStages=$,e.LifecycleUnreachableError=Ng,e.ListGlyphType=B,Object.defineProperty(e,`LocalUndoRedoService`,{enumerable:!0,get:function(){return a_}}),e.LocaleService=Lg,e.LocaleType=Ia,e.LogLevel=rs,Object.defineProperty(e,`LookUp`,{enumerable:!0,get:function(){return t.LookUp}}),e.MAX_COLUMN_COUNT=uf,e.MAX_ROW_COUNT=lf,e.MOVE_BUFFER_VALUE=2,Object.defineProperty(e,`Many`,{enumerable:!0,get:function(){return t.Many}}),e.MemoryCursor=Ui,Object.defineProperty(e,`MentionIOLocalService`,{enumerable:!0,get:function(){return Rg}}),e.MentionType=La,e.NAMED_STYLE_MAP=_f,e.NAMED_STYLE_SPACE_MAP=vf,e.NamedStyleType=po,e.NilCommand=fs,e.NumberUnitType=Eo,e.ObjectMatrix=Gu,e.ObjectRelativeFromH=wo,e.ObjectRelativeFromV=To,Object.defineProperty(e,`Optional`,{enumerable:!0,get:function(){return t.Optional}}),e.PADDING_KEYS=Bo,e.PAGE_SIZE=bf,e.PAPER_TYPES=jo,e.PRESET_LIST_TYPE=Lp,e.PRINT_CHART_COMPONENT_KEY=`univer-sheets-chart-print-chart`,e.PageOrientType=Ao,e.PaperType=V,e.ParagraphElementType=lo,e.ParagraphStyleBuilder=Sh,e.ParagraphStyleValue=xh,e.PermissionService=Hg,e.PermissionStatus=Bg,e.Plugin=Gg,Object.defineProperty(e,`PluginService`,{enumerable:!0,get:function(){return Jg}}),e.PositionedObjectLayoutType=fo,e.PresetListType=Z,e.ProtectionType=Ra,Object.defineProperty(e,`Quantity`,{enumerable:!0,get:function(){return t.Quantity}}),e.QuickListType=Mp,e.QuickListTypeMap=Bp,e.RANGE_DIRECTION=$s,e.RANGE_TYPE=G,e.RBush=Ef,e.RCDisposable=aa,e.RGBA_PAREN=`rgba(`,e.RGB_PAREN=`rgb(`,e.ROTATE_BUFFER_VALUE=1,e.RTree=g_,e.Range=Sf,e.Rectangle=Qf,Object.defineProperty(e,`RediError`,{enumerable:!0,get:function(){return t.RediError}}),e.RedoCommand=i_,e.RedoCommandId=t_,e.RefAlias=rp,e.Registry=Ji,e.RegistryAsMap=Yi,e.RelativeDate=za,Object.defineProperty(e,`ResourceManagerService`,{enumerable:!0,get:function(){return Xg}}),e.RichTextBuilder=wh,e.RichTextValue=Ch,e.RxDisposable=ia,e.SHEET_EDITOR_UNITS=gf,e.STYLE_KEYS=Vo,e.SectionType=oo,Object.defineProperty(e,`Self`,{enumerable:!0,get:function(){return t.Self}}),Object.defineProperty(e,`SheetSkeleton`,{enumerable:!0,get:function(){return x_}}),e.SheetTypes=Ba,e.SheetViewModel=Cg,Object.defineProperty(e,`Skeleton`,{enumerable:!0,get:function(){return y_}}),Object.defineProperty(e,`SkipSelf`,{enumerable:!0,get:function(){return t.SkipSelf}}),e.SliceBodyType=Xp,e.SpacingRule=mo,e.Styles=Zh,e.TEXT_DECORATION_KEYS=Fo,e.TEXT_ROTATION_KEYS=zo,e.THEME_COLORS=rc,e.TabStopAlignment=go,e.TableAlignmentType=vo,e.TableLayoutType=yo,e.TableRowHeightRule=xo,e.TableSizeType=_o,e.TableTextWrapType=bo,e.TestConfirmService=Ih,e.TextDecoration=Ha,e.TextDecorationBuilder=bh,e.TextDirection=Va,e.TextDirectionType=co,e.TextStyleBuilder=yh,e.TextStyleValue=vh,e.TextX=Q,e.TextXActionType=U,e.ThemeColorType=Xa,e.ThemeColors=Za,e.ThemeService=Zg,e.Tools=L,e.UndoCommand=r_,e.UndoCommandId=n_,e.UnitModel=oa,e.Univer=F_,Object.defineProperty(e,`UniverInstanceService`,{enumerable:!0,get:function(){return jg}}),e.UniverInstanceType=n.UniverType,e.UpdateDocsAttributeType=H,e.UserManagerService=Mh,e.VerticalAlign=Wa,e.VerticalAlignmentType=So,Object.defineProperty(e,`WithNew`,{enumerable:!0,get:function(){return t.WithNew}}),Object.defineProperty(e,`Workbook`,{enumerable:!0,get:function(){return kg}}),e.Worksheet=Tg,e.WrapStrategy=Ga,e.WrapTextType=uo,e.addLinkToDocumentModel=ag,e.afterInitApply=Ss,e.afterTime=bs,e.awaitTime=__,e.binSearchFirstGreaterThanTarget=Ts,e.binarySearchArray=ws,e.bufferDebounceTime=ys,e.cellToRange=ad,e.characterSpacingControlType=ko,e.checkForSubstrings=ud,e.checkIfMove=Os,e.checkParagraphHasBullet=Bd,e.checkParagraphHasIndent=Vd,e.checkParagraphHasIndentByStyle=Hd,e.cloneCellData=fg,e.cloneCellDataMatrix=mg,e.cloneCellDataWithSpanAndDisplay=pg,e.cloneValue=dg,e.cloneWorksheetData=_g,e.codeToBlob=Ds,e.columnLabelToNumber=cf,e.composeBody=lm,e.composeInterceptors=_e,e.composeStyles=Sa,e.concatMatrixArray=Bu,e.convertCellToRange=Ku,e.convertObservableToBehaviorSubject=xs,e.covertCellValue=od,e.covertCellValues=sd,e.createAsyncInterceptorKey=ye,e.createDefaultUser=Ah,e.createDocumentModelWithStyle=ng,Object.defineProperty(e,`createIdentifier`,{enumerable:!0,get:function(){return t.createIdentifier}}),e.createInterceptorKey=ge,e.createInternalEditorID=ie,e.createREGEXFromWildChar=wa,e.createRowColIter=ip,e.createSheetGapTestConfig=b_,e.customNameCharacterCheck=c_,e.dateKit=Rd,e.debounce=Mi,e.dedupe=S,e.dedupeBy=C,e.deepCompare=cd,e.delayAnimationFrame=v_,e.deleteContent=Wd,e.extractPureTextFromCell=Eg,Object.defineProperty(e,`forwardRef`,{enumerable:!0,get:function(){return t.forwardRef}}),e.fromCallback=_s,e.fromEventSubject=Dh,e.generateIntervalsByPoints=qd,e.generateRandomId=xa,e.get=ti,e.getArrayLength=Iu,e.getBodySlice=nm,e.getBorderStyleType=nd,e.getCellCoordByIndexSimple=S_,e.getCellInfoInMergeData=tc,e.getCellValueType=Ys,e.getCellWithCoordByIndexCore=C_,e.getColorStyle=Zu,e.getCustomBlockSlice=tm,e.getCustomDecorationSlice=am,e.getCustomRangeSlice=im,e.getDocsUpdateBody=rd,e.getEmptyCell=sg,e.getIntersectRange=Jf,e.getNumfmtParseValueFilter=Pu,e.getOriginCellValue=Dg,e.getParagraphsSlice=$p,e.getPlainText=Am,e.getReverseDirection=Pa,e.getSectionBreakSlice=em,e.getTableSlice=Qp,e.getTextRunSlice=Zp,e.getTransformOffsetX=w_,e.getTransformOffsetY=T_,e.getWorksheetUID=Og,e.groupBy=E,e.handleStyleToString=ed,e.hashAlgorithm=Kd,e.horizontalLineSegmentsSubtraction=zd,e.insertMatrixArray=Ru,e.insertTextToContent=Ud,e.invertColorByHSL=Ne,e.invertColorByMatrix=Ie,Object.defineProperty(e,`isAsyncDependencyItem`,{enumerable:!0,get:function(){return t.isAsyncDependencyItem}}),Object.defineProperty(e,`isAsyncHook`,{enumerable:!0,get:function(){return t.isAsyncHook}}),e.isBlackColor=Ks,e.isBooleanString=j,e.isCellCoverable=Xu,e.isCellV=Zs,Object.defineProperty(e,`isClassDependencyItem`,{enumerable:!0,get:function(){return t.isClassDependencyItem}}),e.isCommentEditorID=ae,Object.defineProperty(e,`isCtor`,{enumerable:!0,get:function(){return t.isCtor}}),e.isDefaultFormat=ku,Object.defineProperty(e,`isDisposable`,{enumerable:!0,get:function(){return t.isDisposable}}),e.isEmptyCell=Yu,Object.defineProperty(e,`isFactoryDependencyItem`,{enumerable:!0,get:function(){return t.isFactoryDependencyItem}}),e.isFormulaId=$u,e.isFormulaString=Qu,e.isICellData=Js,e.isInternalEditorID=P,e.isNodeEnv=Ca,e.isNotNullOrUndefined=og,e.isNullCell=Xs,e.isNumeric=Gi,e.isPatternEqualWithoutDecimal=Au,e.isRangesEqual=Qh,e.isRealNum=Gd,e.isSafeNumeric=Ki,e.isSameStyleTextRun=ld,e.isTextFormat=Ou,e.isUnitRangesEqual=$h,e.isValidRange=id,Object.defineProperty(e,`isValueDependencyItem`,{enumerable:!0,get:function(){return t.isValueDependencyItem}}),e.isWhiteColor=qs,e.makeArray=D,e.makeCellRangeToRangeData=Ju,e.makeCellToSelection=qu,e.makeCustomRangeStream=Om,e.mapObjectMatrix=Fu,e.merge=Bi,e.mergeIntervals=Jd,e.mergeLocales=Yd,e.mergeOverrideWithDependencies=Ug,e.mergeSets=$i,e.mergeWith=zi,e.mergeWorksheetSnapshotWithDefault=xg,e.mixinClass=Wi,e.moveMatrixArray=Hu,e.moveRangeByOffset=Vf,e.nameCharacterCheck=s_,e.normalizeBody=rm,e.normalizeTextRuns=fp,e.numberToABC=op,e.numberToListABC=cp,Object.defineProperty(e,`numfmt`,{enumerable:!0,get:function(){return gu}}),e.queryObjectMatrix=np,e.registerDependencies=oe,e.remove=x,e.repeatStringNumTimes=sp,e.replaceInDocumentBody=hh,e.requestImmediateMacroTask=Xi,e.resolveWithBasePath=pa,e.rotate=T,e.searchArray=Es,e.searchInOrderedArray=Cs,e.selectionToArray=Qs,e.sequence=Qi,e.sequenceAsync=Zi,e.sequenceExecute=hs,e.sequenceExecuteAsync=gs,e.set=Hi,Object.defineProperty(e,`setDependencies`,{enumerable:!0,get:function(){return t.setDependencies}}),e.shallowEqual=ce,e.skipParseTagNames=E_,e.sliceMatrixArray=Vu,e.sortRules=lp,e.sortRulesByDesc=up,e.sortRulesFactory=dp,e.spliceArray=zu,e.splitIntoGrid=Uf,e.takeAfter=vs,Object.defineProperty(e,`textDiff`,{enumerable:!0,get:function(){return Wm.default}}),e.throttle=de,e.toDisposable=ta,e.touchDependencies=se,e.updateAttributeByDelete=fm,e.updateAttributeByInsert=pm,e.willLoseNumericPrecision=qi});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@wendellhu/redi`),require(`@univerjs/protocol`),require(`rxjs`),require(`rxjs/operators`),require(`@univerjs/themes`)):typeof define==`function`&&define.amd?define([`exports`,`@wendellhu/redi`,`@univerjs/protocol`,`rxjs`,`rxjs/operators`,`@univerjs/themes`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore={},e[`@wendellhu/redi`],e.UniverProtocol,e.rxjs,e.rxjs.operators,e.UniverThemes))})(this,function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=Object.create,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,f=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),p=(e,t)=>{let n={};for(var r in e)s(n,r,{get:e[r],enumerable:!0});return t||s(n,Symbol.toStringTag,{value:`Module`}),n},m=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=l(t),a=0,o=i.length,u;a<o;a++)u=i[a],!d.call(e,u)&&u!==n&&s(e,u,{get:(e=>t[e]).bind(null,u),enumerable:!(r=c(t,u))||r.enumerable});return e},h=(e,t,n)=>(n=e==null?{}:o(u(e)),m(t||!e||!e.__esModule?s(n,`default`,{value:e,enumerable:!0}):n,e));let g=typeof global<`u`?global:typeof self<`u`?self:window;function _(){let e=new Map,t=0;typeof g.requestIdleCallback!=`function`&&(g.requestIdleCallback=function(n){let r=Date.now(),i=++t,a=setTimeout(function(){e.delete(i);let t=Math.max(0,50-(Date.now()-r));n({didTimeout:t===0,timeRemaining(){return t}})},1);return e.set(i,a),i}),typeof g.cancelIdleCallback!=`function`&&(g.cancelIdleCallback=function(t){let n=e.get(t);n!==void 0&&(clearTimeout(n),e.delete(t))})}function v(){typeof g.Array.prototype.findLastIndex!=`function`&&(g.Array.prototype.findLastIndex=function(e,t){if(this==null)throw TypeError(`Array.prototype.findLastIndex called on null or undefined`);if(typeof e!=`function`)throw TypeError(`callback must be a function`);let n=this.length>>>0;for(let r=n-1;r>=0;r--)if(r in this&&e.call(t,this[r],r,this))return r;return-1}),typeof g.Array.prototype.findLast!=`function`&&(g.Array.prototype.findLast=function(e,t){let n=this.findLastIndex(e,t);return n===-1?void 0:this[n]})}function y(){typeof g.String.prototype.at!=`function`&&(g.String.prototype.at=function(e){if(this==null)throw TypeError(`String.prototype.at called on null or undefined`);let t=this.length;if(e<0&&(e=t+e),!(e<0||e>=t))return this.charAt(e)})}function b(){_(),v(),y()}function x(e,t){let n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function S(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function C(e,t){let n=new Set,r=[];for(let i of e){let e=t(i);n.has(e)||(n.add(e),r.push(i))}return r}function w(e,t){for(let n=e.length-1;n>-1;n--){let r=e[n];if(t(r,n))return r}return null}function T(e,t){if(e.length===0)return e;let n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function E(e,t){let n=new Map;return e.forEach(e=>{let r=t(e),i=n.get(r);n.has(r)||(i=[],n.set(r,i)),i.push(e)}),n}function D(e){return Array.isArray(e)?e:[e]}var O=f(((e,t)=>{var n=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process>`u`||process.domain===void 0)throw Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||n.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||n.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||n.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=n.DEFAULT_MAX_PENDING};n.DEFAULT_TIMEOUT=0,n.DEFAULT_MAX_OCCUPATION_TIME=0,n.DEFAULT_MAX_EXECUTION_TIME=0,n.DEFAULT_MAX_PENDING=1e3,n.prototype.acquire=function(e,t,n,r){if(Array.isArray(e))return this._acquireBatch(e,t,n,r);if(typeof t!=`function`)throw Error(`You must pass a function to execute`);var i=null,a=null,o=null;typeof n!=`function`&&(r=n,n=null,o=new this.Promise(function(e,t){i=e,a=t})),r=r||{};var s=!1,c=null,l=null,u=null,d=this,f=function(t,r,c){l&&(clearTimeout(l),l=null),u&&(clearTimeout(u),u=null),t&&(d.queues[e]&&d.queues[e].length===0&&delete d.queues[e],d.domainReentrant&&delete d.domains[e]),s||(o?r?a(r):i(c):typeof n==`function`&&n(r,c),s=!0),t&&d.queues[e]&&d.queues[e].length>0&&d.queues[e].shift()()},p=function(n){if(s)return f(n);c&&(clearTimeout(c),c=null),d.domainReentrant&&n&&(d.domains[e]=process.domain);var i=r.maxExecutionTime||d.maxExecutionTime;if(i&&(u=setTimeout(function(){d.queues[e]&&f(n,Error(`Maximum execution time is exceeded `+e))},i)),t.length===1){var a=!1;try{t(function(e,t){a||(a=!0,f(n,e,t))})}catch(e){a||(a=!0,f(n,e))}}else d._promiseTry(function(){return t()}).then(function(e){f(n,void 0,e)},function(e){f(n,e)})};d.domainReentrant&&process.domain&&(p=process.domain.bind(p));var m=r.maxPending||d.maxPending;if(!d.queues[e])d.queues[e]=[],p(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[e])p(!1);else if(d.queues[e].length>=m)f(!1,Error(`Too many pending tasks in queue `+e));else{var h=function(){p(!0)};r.skipQueue?d.queues[e].unshift(h):d.queues[e].push(h);var g=r.timeout||d.timeout;g&&(c=setTimeout(function(){c=null,f(!1,Error(`async-lock timed out in queue `+e))},g))}var _=r.maxOccupationTime||d.maxOccupationTime;if(_&&(l=setTimeout(function(){d.queues[e]&&f(!1,Error(`Maximum occupation time is exceeded in queue `+e))},_)),o)return o},n.prototype._acquireBatch=function(e,t,n,r){typeof n!=`function`&&(r=n,n=null);var i=this,a=function(e,t){return function(n){i.acquire(e,t,n,r)}},o=e.reduceRight(function(e,t){return a(t,e)},t);if(typeof n==`function`)o(n);else return new this.Promise(function(e,t){o.length===1?o(function(n,r){n?t(n):e(r)}):e(o())})},n.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},n.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(e){return this.Promise.reject(e)}},t.exports=n})),k=h(f(((e,t)=>{t.exports=O()}))());let A=new Set([`true`,`false`]);function j(e){return A.has(e.toLowerCase())}let M=`__INTERNAL_EDITOR__`,N=`${M}DOCS_NORMAL`,ee=`${M}DOCS_FORMULA_BAR`,P=`${M}ZEN_EDITOR`,F=`${M}COMMENT_EDITOR`,te=Symbol(`AUTO_HEIGHT_FOR_MERGED_CELLS`);function I(e){return`${M}${e}`}function L(e){return e.startsWith(M)}function ne(e){return e.startsWith(F)}function re(e,t){t.forEach(t=>e.add(t))}function ie(e,t){t.forEach(([t])=>{e.has(t)&&e.get(t)})}function ae(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=Object.prototype.hasOwnProperty.bind(t);for(let r=0;r<n.length;r++){let a=n[r];if(!i(a)||e[a]!==t[a])return!1}return!0}var oe=class extends Error{constructor(e){super(e),this.name=`CustomCommandExecutionError`}},se=class extends oe{constructor(){super(`Canceled by facade`),this.name=`CanceledError`}};function ce(e,t=16){let n=0,r=null;return function(...i){let a=Date.now();a-n<t?(r&&clearTimeout(r),r=setTimeout(()=>{n=a,e.apply(this,i)},t)):(n=a,e.apply(this,i))}}function le(e){"@babel/helpers - typeof";return le=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},le(e)}function ue(e,t){if(le(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(le(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function de(e){var t=ue(e,`string`);return le(t)==`symbol`?t:t+``}function R(e,t,n){return(t=de(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let fe=function(e){return e[e.Style=1]=`Style`,e[e.Value=2]=`Value`,e}({});function pe(e){return`sheet_interceptor_${e}`}let me=e=>function(t,n){let r=-1,i=t;for(let t=0;t<=e.length;t++){if(t<=r)throw Error(`[SheetInterceptorService]: next() called multiple times!`);if(r=t,t===e.length)return i;let a=e[t],o=!1;if(i=a.handler(i,n,e=>(o=!0,e)),!o)break}return i};var he=class{constructor(e){R(this,`_interceptorsByName`,new Map),R(this,`_interceptorPoints`,void 0),this._interceptorPoints=e}fetchThroughInterceptors(e,t){let n=e,r=this._interceptorsByName.get(n);return t&&(r=r.filter(t)),me(r||[])}intercept(e,t){let n=e;this._interceptorsByName.has(n)||this._interceptorsByName.set(n,[]);let r=this._interceptorsByName.get(n);return r.push(t),this._interceptorsByName.set(n,r.sort((e,t)=>{var n,r;return((n=t.priority)==null?0:n)-((r=e.priority)==null?0:r)})),()=>x(this._interceptorsByName.get(n),t)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}};function ge(e){return`sheet_async_interceptor_${e}`}let _e=e=>async function(t,n){let r=-1,i=t;for(let t=0;t<=e.length;t++){if(t<=r)throw Error(`[SheetInterceptorService]: next() called multiple times!`);if(r=t,t===e.length)return i;let a=e[t],o=!1;if(i=await a.handler(i,n,async e=>(o=!0,e)),!o)break}return i};var ve=class{constructor(e){R(this,`_asyncInterceptorsByName`,new Map),R(this,`_asyncInterceptorPoints`,void 0),this._asyncInterceptorPoints=e}fetchThroughAsyncInterceptors(e,t){let n=e,r=this._asyncInterceptorsByName.get(n);return t&&(r=r.filter(t)),_e(r||[])}async interceptAsync(e,t){let n=e;this._asyncInterceptorsByName.has(n)||this._asyncInterceptorsByName.set(n,[]);let r=this._asyncInterceptorsByName.get(n);return r.push(t),this._asyncInterceptorsByName.set(n,r.sort((e,t)=>{var n,r;return((n=t.priority)==null?0:n)-((r=e.priority)==null?0:r)})),()=>x(this._asyncInterceptorsByName.get(n),t)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}};function ye(e){return e.map(e=>e/255)}function be(e){return e.map(e=>Math.round(e*255))}function xe([e,t,n]){let r=Math.max(e,t,n),i=Math.min(e,t,n),a=(r+i)/2,o=0,s=0;if(r!==i){let c=r-i;switch(s=a>.5?c/(2-r-i):c/(r+i),r){case e:o=(t-n)/c+(t<n?6:0);break;case t:o=(n-e)/c+2;break;case n:o=(e-t)/c+4;break}o/=6}return[o,s,a]}function Se(e,t,n){let r=[e,t,n].map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4);return .2126*r[0]+.7152*r[1]+.0722*r[2]}function Ce(e,t){return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function we(e,t,n){let r,i,a;if(t===0)r=i=a=n;else{let o=(e,t,n)=>{let r=n;return r<0&&(r+=1),r>1&&--r,r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e},s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return[r,i,a]}let Te={r:1,g:1,b:1},Ee={r:0,g:0,b:0},De=Se(Te.r,Te.g,Te.b),Oe=Se(Ee.r,Ee.g,Ee.b);function ke(e){let t=Ce(De,Se(e[0],e[1],e[2])),n=xe(e),r=1-n[2],i,a,o;do i=we(n[0],n[1],r),a=Se(i[0],i[1],i[2]),o=Ce(a,Oe),r+=.01;while(r<=1&&r>=0&&Math.abs(o-t)<.01);return i}function Ae(e){return be(ke(ye(e)))}let je=[[.333,-.667,-.667,0,1],[-.667,.333,-.667,0,1],[-.667,-.667,.333,0,1],[0,0,0,1,0]];function Me(e){let t=e[0],n=e[1],r=e[2],i=[je[0][0]*t+je[0][1]*n+je[0][2]*r+je[0][4],je[1][0]*t+je[1][1]*n+je[1][2]*r+je[1][4],je[2][0]*t+je[2][1]*n+je[2][2]*r+je[2][4]];return i=i.map(e=>e>1?1:e<0?0:e),i}function Ne(e){return be(Me(ye(e)))}var Pe=typeof global==`object`&&global&&global.Object===Object&&global,Fe=typeof self==`object`&&self&&self.Object===Object&&self,Ie=Pe||Fe||Function(`return this`)(),Le=Ie.Symbol,Re=Object.prototype,ze=Re.hasOwnProperty,Be=Re.toString,Ve=Le?Le.toStringTag:void 0;function He(e){var t=ze.call(e,Ve),n=e[Ve];try{e[Ve]=void 0;var r=!0}catch{}var i=Be.call(e);return r&&(t?e[Ve]=n:delete e[Ve]),i}var Ue=Object.prototype.toString;function We(e){return Ue.call(e)}var Ge=`[object Null]`,Ke=`[object Undefined]`,qe=Le?Le.toStringTag:void 0;function Je(e){return e==null?e===void 0?Ke:Ge:qe&&qe in Object(e)?He(e):We(e)}function Ye(e){return typeof e==`object`&&!!e}var Xe=`[object Symbol]`;function Ze(e){return typeof e==`symbol`||Ye(e)&&Je(e)==Xe}function Qe(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var $e=Array.isArray,et=1/0,tt=Le?Le.prototype:void 0,nt=tt?tt.toString:void 0;function rt(e){if(typeof e==`string`)return e;if($e(e))return Qe(e,rt)+``;if(Ze(e))return nt?nt.call(e):``;var t=e+``;return t==`0`&&1/e==-et?`-0`:t}var it=/\s/;function at(e){for(var t=e.length;t--&&it.test(e.charAt(t)););return t}var ot=/^\s+/;function st(e){return e&&e.slice(0,at(e)+1).replace(ot,``)}function ct(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var lt=NaN,ut=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,ft=/^0o[0-7]+$/i,pt=parseInt;function mt(e){if(typeof e==`number`)return e;if(Ze(e))return lt;if(ct(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=ct(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=st(e);var n=dt.test(e);return n||ft.test(e)?pt(e.slice(2),n?2:8):ut.test(e)?lt:+e}function ht(e){return e}var gt=`[object AsyncFunction]`,_t=`[object Function]`,vt=`[object GeneratorFunction]`,yt=`[object Proxy]`;function bt(e){if(!ct(e))return!1;var t=Je(e);return t==_t||t==vt||t==gt||t==yt}var xt=Ie[`__core-js_shared__`],St=function(){var e=/[^.]+$/.exec(xt&&xt.keys&&xt.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function Ct(e){return!!St&&St in e}var wt=Function.prototype.toString;function Tt(e){if(e!=null){try{return wt.call(e)}catch{}try{return e+``}catch{}}return``}var Et=/[\\^$.*+?()[\]{}|]/g,Dt=/^\[object .+?Constructor\]$/,Ot=Function.prototype,kt=Object.prototype,At=Ot.toString,jt=kt.hasOwnProperty,Mt=RegExp(`^`+At.call(jt).replace(Et,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function Nt(e){return!ct(e)||Ct(e)?!1:(bt(e)?Mt:Dt).test(Tt(e))}function Pt(e,t){return e==null?void 0:e[t]}function Ft(e,t){var n=Pt(e,t);return Nt(n)?n:void 0}var It=Object.create,Lt=function(){function e(){}return function(t){if(!ct(t))return{};if(It)return It(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Rt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function zt(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Bt=800,Vt=16,Ht=Date.now;function Ut(e){var t=0,n=0;return function(){var r=Ht(),i=Vt-(r-n);if(n=r,i>0){if(++t>=Bt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Wt(e){return function(){return e}}var Gt=function(){try{var e=Ft(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Kt=Ut(Gt?function(e,t){return Gt(e,`toString`,{configurable:!0,enumerable:!1,value:Wt(t),writable:!0})}:ht),qt=9007199254740991,Jt=/^(?:0|[1-9]\d*)$/;function Yt(e,t){var n=typeof e;return t=t==null?qt:t,!!t&&(n==`number`||n!=`symbol`&&Jt.test(e))&&e>-1&&e%1==0&&e<t}function Xt(e,t,n){t==`__proto__`&&Gt?Gt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Zt(e,t){return e===t||e!==e&&t!==t}var Qt=Object.prototype.hasOwnProperty;function $t(e,t,n){var r=e[t];(!(Qt.call(e,t)&&Zt(r,n))||n===void 0&&!(t in e))&&Xt(e,t,n)}function en(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Xt(n,s,c):$t(n,s,c)}return n}var tn=Math.max;function nn(e,t,n){return t=tn(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=tn(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Rt(e,this,s)}}function rn(e,t){return Kt(nn(e,t,ht),e+``)}var an=9007199254740991;function on(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=an}function sn(e){return e!=null&&on(e.length)&&!bt(e)}function cn(e,t,n){if(!ct(n))return!1;var r=typeof t;return(r==`number`?sn(n)&&Yt(t,n.length):r==`string`&&t in n)?Zt(n[t],e):!1}function ln(e){return rn(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&cn(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var un=Object.prototype;function dn(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||un)}function fn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var pn=`[object Arguments]`;function mn(e){return Ye(e)&&Je(e)==pn}var hn=Object.prototype,gn=hn.hasOwnProperty,_n=hn.propertyIsEnumerable,vn=mn(function(){return arguments}())?mn:function(e){return Ye(e)&&gn.call(e,`callee`)&&!_n.call(e,`callee`)};function yn(){return!1}var bn=typeof e==`object`&&e&&!e.nodeType&&e,xn=bn&&typeof module==`object`&&module&&!module.nodeType&&module,Sn=xn&&xn.exports===bn?Ie.Buffer:void 0,Cn=(Sn?Sn.isBuffer:void 0)||yn,wn=`[object Arguments]`,Tn=`[object Array]`,En=`[object Boolean]`,Dn=`[object Date]`,On=`[object Error]`,kn=`[object Function]`,An=`[object Map]`,jn=`[object Number]`,Mn=`[object Object]`,Nn=`[object RegExp]`,Pn=`[object Set]`,Fn=`[object String]`,In=`[object WeakMap]`,Ln=`[object ArrayBuffer]`,Rn=`[object DataView]`,zn=`[object Float32Array]`,Bn=`[object Float64Array]`,Vn=`[object Int8Array]`,Hn=`[object Int16Array]`,Un=`[object Int32Array]`,Wn=`[object Uint8Array]`,Gn=`[object Uint8ClampedArray]`,Kn=`[object Uint16Array]`,qn=`[object Uint32Array]`,z={};z[zn]=z[Bn]=z[Vn]=z[Hn]=z[Un]=z[Wn]=z[Gn]=z[Kn]=z[qn]=!0,z[wn]=z[Tn]=z[Ln]=z[En]=z[Rn]=z[Dn]=z[On]=z[kn]=z[An]=z[jn]=z[Mn]=z[Nn]=z[Pn]=z[Fn]=z[In]=!1;function Jn(e){return Ye(e)&&on(e.length)&&!!z[Je(e)]}function Yn(e){return function(t){return e(t)}}var Xn=typeof e==`object`&&e&&!e.nodeType&&e,Zn=Xn&&typeof module==`object`&&module&&!module.nodeType&&module,Qn=Zn&&Zn.exports===Xn&&Pe.process,$n=function(){try{return Zn&&Zn.require&&Zn.require(`util`).types||Qn&&Qn.binding&&Qn.binding(`util`)}catch{}}(),er=$n&&$n.isTypedArray,tr=er?Yn(er):Jn,nr=Object.prototype.hasOwnProperty;function rr(e,t){var n=$e(e),r=!n&&vn(e),i=!n&&!r&&Cn(e),a=!n&&!r&&!i&&tr(e),o=n||r||i||a,s=o?fn(e.length,String):[],c=s.length;for(var l in e)(t||nr.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Yt(l,c)))&&s.push(l);return s}function ir(e,t){return function(n){return e(t(n))}}function ar(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var or=Object.prototype.hasOwnProperty;function sr(e){if(!ct(e))return ar(e);var t=dn(e),n=[];for(var r in e)r==`constructor`&&(t||!or.call(e,r))||n.push(r);return n}function cr(e){return sn(e)?rr(e,!0):sr(e)}var lr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ur=/^\w*$/;function dr(e,t){if($e(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Ze(e)?!0:ur.test(e)||!lr.test(e)||t!=null&&e in Object(t)}var fr=Ft(Object,`create`);function pr(){this.__data__=fr?fr(null):{},this.size=0}function mr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var hr=`__lodash_hash_undefined__`,gr=Object.prototype.hasOwnProperty;function _r(e){var t=this.__data__;if(fr){var n=t[e];return n===hr?void 0:n}return gr.call(t,e)?t[e]:void 0}var vr=Object.prototype.hasOwnProperty;function yr(e){var t=this.__data__;return fr?t[e]!==void 0:vr.call(t,e)}var br=`__lodash_hash_undefined__`;function xr(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=fr&&t===void 0?br:t,this}function Sr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Sr.prototype.clear=pr,Sr.prototype.delete=mr,Sr.prototype.get=_r,Sr.prototype.has=yr,Sr.prototype.set=xr;function Cr(){this.__data__=[],this.size=0}function wr(e,t){for(var n=e.length;n--;)if(Zt(e[n][0],t))return n;return-1}var Tr=Array.prototype.splice;function Er(e){var t=this.__data__,n=wr(t,e);return n<0?!1:(n==t.length-1?t.pop():Tr.call(t,n,1),--this.size,!0)}function Dr(e){var t=this.__data__,n=wr(t,e);return n<0?void 0:t[n][1]}function Or(e){return wr(this.__data__,e)>-1}function kr(e,t){var n=this.__data__,r=wr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Ar(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ar.prototype.clear=Cr,Ar.prototype.delete=Er,Ar.prototype.get=Dr,Ar.prototype.has=Or,Ar.prototype.set=kr;var jr=Ft(Ie,`Map`);function Mr(){this.size=0,this.__data__={hash:new Sr,map:new(jr||Ar),string:new Sr}}function Nr(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Pr(e,t){var n=e.__data__;return Nr(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Fr(e){var t=Pr(this,e).delete(e);return this.size-=+!!t,t}function Ir(e){return Pr(this,e).get(e)}function Lr(e){return Pr(this,e).has(e)}function Rr(e,t){var n=Pr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function zr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zr.prototype.clear=Mr,zr.prototype.delete=Fr,zr.prototype.get=Ir,zr.prototype.has=Lr,zr.prototype.set=Rr;var Br=`Expected a function`;function Vr(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(Br);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Vr.Cache||zr),n}Vr.Cache=zr;var Hr=500;function Ur(e){var t=Vr(e,function(e){return n.size===Hr&&n.clear(),e}),n=t.cache;return t}var Wr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gr=/\\(\\)?/g,Kr=Ur(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Wr,function(e,n,r,i){t.push(r?i.replace(Gr,`$1`):n||e)}),t});function qr(e){return e==null?``:rt(e)}function Jr(e,t){return $e(e)?e:dr(e,t)?[e]:Kr(qr(e))}var Yr=1/0;function Xr(e){if(typeof e==`string`||Ze(e))return e;var t=e+``;return t==`0`&&1/e==-Yr?`-0`:t}function Zr(e,t){t=Jr(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Xr(t[n++])];return n&&n==r?e:void 0}function Qr(e,t,n){var r=e==null?void 0:Zr(e,t);return r===void 0?n:r}var $r=ir(Object.getPrototypeOf,Object),ei=`[object Object]`,ti=Function.prototype,ni=Object.prototype,ri=ti.toString,ii=ni.hasOwnProperty,ai=ri.call(Object);function oi(e){if(!Ye(e)||Je(e)!=ei)return!1;var t=$r(e);if(t===null)return!0;var n=ii.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&ri.call(n)==ai}function si(){this.__data__=new Ar,this.size=0}function ci(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function li(e){return this.__data__.get(e)}function ui(e){return this.__data__.has(e)}var di=200;function fi(e,t){var n=this.__data__;if(n instanceof Ar){var r=n.__data__;if(!jr||r.length<di-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new zr(r)}return n.set(e,t),this.size=n.size,this}function pi(e){var t=this.__data__=new Ar(e);this.size=t.size}pi.prototype.clear=si,pi.prototype.delete=ci,pi.prototype.get=li,pi.prototype.has=ui,pi.prototype.set=fi;var mi=typeof e==`object`&&e&&!e.nodeType&&e,hi=mi&&typeof module==`object`&&module&&!module.nodeType&&module,gi=hi&&hi.exports===mi?Ie.Buffer:void 0,_i=gi?gi.allocUnsafe:void 0;function vi(e,t){if(t)return e.slice();var n=e.length,r=_i?_i(n):new e.constructor(n);return e.copy(r),r}var yi=Ie.Uint8Array;function bi(e){var t=new e.constructor(e.byteLength);return new yi(t).set(new yi(e)),t}function xi(e,t){var n=t?bi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Si(e){return typeof e.constructor==`function`&&!dn(e)?Lt($r(e)):{}}function Ci(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var wi=Ci(),Ti=function(){return Ie.Date.now()},Ei=`Expected a function`,Di=Math.max,Oi=Math.min;function ki(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(Ei);t=mt(t)||0,ct(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?Di(mt(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?Oi(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=Ti();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(Ti())}function x(){var e=Ti(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}function Ai(e,t,n){(n!==void 0&&!Zt(e[t],n)||n===void 0&&!(t in e))&&Xt(e,t,n)}function ji(e){return Ye(e)&&sn(e)}function Mi(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}function Ni(e){return en(e,cr(e))}function Pi(e,t,n,r,i,a,o){var s=Mi(e,n),c=Mi(t,n),l=o.get(c);if(l){Ai(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=$e(c),p=!f&&Cn(c),m=!f&&!p&&tr(c);u=c,f||p||m?$e(s)?u=s:ji(s)?u=zt(s):p?(d=!1,u=vi(c,!0)):m?(d=!1,u=xi(c,!0)):u=[]:oi(c)||vn(c)?(u=s,vn(s)?u=Ni(s):(!ct(s)||bt(s))&&(u=Si(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),Ai(e,n,u)}function Fi(e,t,n,r,i){e!==t&&wi(t,function(a,o){if(i||(i=new pi),ct(a))Pi(e,t,o,n,Fi,r,i);else{var s=r?r(Mi(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),Ai(e,o,s)}},cr)}var Ii=ln(function(e,t,n,r){Fi(e,t,n,r)}),Li=ln(function(e,t,n){Fi(e,t,n)});function Ri(e,t,n,r){if(!ct(e))return e;t=Jr(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=Xr(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=ct(u)?u:Yt(t[i+1])?[]:{})}$t(s,c,l),s=s[c]}return e}function zi(e,t,n){return e==null?e:Ri(e,t,n)}var Bi=class{constructor(){R(this,`cursor`,0)}reset(){return this.cursor=0,this}moveCursor(e){this.cursor+=e}moveCursorTo(e){this.cursor=e}};function Vi(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function Hi(e){return/^-?\d+(\.\d+)?$/.test(e)}function Ui(e){return Hi(e)?Number(e)<=2**53-1:!1}function Wi(e){return Number(e)>2**53-1||e.length>=18}var Gi=class e{constructor(){R(this,`_data`,[])}static create(){return new e}add(e){this._data.indexOf(e)>-1||this._data.push(e)}delete(e){let t=this._data.indexOf(e);this._data.splice(t,1)}getData(){return this._data}},Ki=class e{constructor(){R(this,`_data`,new Map)}static create(){return new e}add(e,t){this._data.has(e)||this._data.set(e,t)}delete(e){this._data.delete(e)}getData(){return this._data}};function qi(e){let t=new MessageChannel,n=!1,r=()=>{n||e()};return t.port1.onmessage=r,t.port2.postMessage(null),()=>{n=!0,t.port1.onmessage=null,t.port1.close(),t.port2.close()}}async function Ji(e){for(let[t,n]of e.entries())try{if(!await n())return{index:t,result:!1}}catch(e){return{index:t,result:!1,error:e}}return{result:!0,index:-1}}function Yi(e){for(let[t,n]of e.entries())try{if(!n())return{index:t,result:!1}}catch(e){return{index:t,result:!1,error:e}}return{result:!0,index:-1}}function Xi(e,t){return t.forEach(t=>e.add(t)),e}function Zi(e){return e instanceof r.Subscription||e instanceof r.Subject||e&&`closed`in e&&e.unsubscribe!==void 0}function B(e){let t=!1;return e?Zi(e)?{dispose:()=>e.unsubscribe()}:typeof e==`function`?{dispose:()=>{t||(t=!0,e())}}:e:B(()=>{})}var Qi=class{constructor(){R(this,`_disposables`,new Set)}add(e){let t=B(e);return this._disposables.add(t),{dispose:(e=!1)=>{e||t.dispose(),this._disposables.delete(t)}}}dispose(){this._disposables.forEach(e=>{e.dispose()}),this._disposables.clear()}},V=class{constructor(){R(this,`_disposed`,!1),R(this,`_collection`,new Qi)}disposeWithMe(e){return this._collection.add(e)}ensureNotDisposed(){if(this._disposed)throw Error(`[Disposable]: object is disposed!`)}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}},$i=class extends V{constructor(...e){super(...e),R(this,`dispose$`,new r.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}},ea=class extends V{constructor(e){super(),this._rootDisposable=e,R(this,`_ref`,0)}inc(){if(this._disposed)throw Error(`[RCDisposable]: should not ref to a disposed.`);this._ref+=1}dec(){--this._ref,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}},ta=class extends V{};let na=new Set(`ac.ad.ae.aero.af.ag.ai.al.am.ao.aq.ar.arpa.as.asia.at.au.aw.ax.az.ba.bb.bd.be.bf.bg.bh.bi.biz.bj.bm.bn.bo.br.bs.bt.bv.bw.by.bz.ca.cat.cc.cd.cf.cg.ch.ci.ck.cl.cm.cn.co.com.coop.cr.cu.cv.cw.cx.cy.cz.de.dj.dk.dm.do.dz.ec.edu.ee.eg.er.es.et.eu.fi.fj.fk.fm.fo.fr.ga.gb.gd.ge.gf.gg.gh.gi.gl.gm.gn.gov.gp.gq.gr.gs.gt.gu.gw.gy.hk.hm.hn.hr.ht.hu.id.ie.il.im.in.info.int.io.iq.ir.is.it.je.jm.jo.jobs.jp.ke.kg.kh.ki.km.kn.kp.kr.kw.ky.kz.la.lb.lc.li.lk.lr.ls.lt.lu.lv.ly.ma.mc.md.me.mg.mh.mil.mk.ml.mm.mn.mo.mobi.mp.mq.mr.ms.mt.mu.museum.mv.mw.mx.my.mz.na.name.nc.ne.net.nf.ng.ni.nl.no.np.nr.nu.nz.om.onion.org.pa.pe.pf.pg.ph.pk.pl.pm.pn.post.pr.pro.ps.pt.pw.py.qa.re.ro.rs.ru.rw.sa.sb.sc.sd.se.sg.sh.si.sj.sk.sl.sm.sn.so.sr.ss.st.su.sv.sx.sy.sz.tc.td.tel.tf.tg.th.tj.tk.tl.tm.tn.to.tr.tt.tv.tw.tz.ua.ug.uk.us.uy.uz.va.vc.ve.vg.vi.vn.vu.wf.ws.yt.za.zm.zw`.split(`.`)),ra=RegExp(`^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$`,`i`);function ia(e){if(!Number.isNaN(+e))return!1;if(e.startsWith(`http://localhost:3002`)||e.startsWith(`localhost:3002`))return!0;if(ra.test(e)){if(aa(e))return!0;try{let t=new URL(sa(e)).hostname.split(`.`).pop();if(t&&na.has(t))return!0}catch{return!1}}return!1}function aa(e){return/^[a-zA-Z]+:\/\//.test(e)}function oa(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function sa(e){return aa(e)?e:oa(e)?`mailto://${e}`:`https://${e}`}function ca(e,t){try{let n=new URL(t),r=n.pathname.endsWith(`/`)?n.pathname:`${n.pathname}/`,i=e.startsWith(`/`)?e.substring(1):e;return new URL(i,n.origin+r).toString()}catch(t){return console.error(`Error resolving URL with base URL:`,t),e}}let la=e=>crypto.getRandomValues(new Uint8Array(e)),ua=(e,t,n)=>{let r=256-256%e.length;if(r===256){let r=e.length-1;return(i=t)=>{if(!i)return``;let a=``;for(;;){let t=n(i),o=i;for(;o--;)if(a+=e[t[o]&r],a.length>=i)return a}}}let i=Math.ceil(1.6*256*t/r);return(a=t)=>{if(!a)return``;let o=``;for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(o+=e[t[s]%e.length],o.length>=a))return o}}},da=(e,t=21)=>ua(e,t|0,la),fa=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[n[e]&63];return t};function pa(e,t){return H.getValueType(e)===H.getValueType(t)?H.isArray(e)?ma(e,t):H.isObject(e)?ha(e,t):H.isDate(e)?e.getTime()===t.getTime():H.isRegExp(e)?e.toString()===t.toString():e===t:!1}function ma(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++){let r=e[n],i=t[n];if(!pa(r,i))return!1}return!0}function ha(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n){if(!r.includes(i))return!1;let n=e[i],a=t[i];if(!pa(n,a))return!1}return!0}var H=class e{static deleteNull(e){for(let t in e)(e[t]===null||e[t]===void 0)&&delete e[t];return e}static getSystemType(){let e=navigator.userAgent,t=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`&&!t&&!n)return`Unix`;if(String(navigator.platform).indexOf(`Linux`)>-1)return`Linux`;if(t){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(){let e=navigator.userAgent,t=e.indexOf(`Opera`)>-1,n=e.indexOf(`compatible`)>-1&&e.indexOf(`MSIE`)>-1&&!t,r=e.indexOf(`Trident`)>-1&&e.indexOf(`rv:11.0`)>-1,i=e.indexOf(`Edge`)>-1,a=e.indexOf(`Firefox`)>-1,o=e.indexOf(`Safari`)>-1&&e.indexOf(`Chrome`)===-1,s=e.indexOf(`Chrome`)>-1&&e.indexOf(`Safari`)>-1;if(n){RegExp(`MSIE (\\d+\\.\\d+);`).test(e);let t=Number.parseFloat(RegExp.$1);return t===7?`IE7`:t===8?`IE8`:t===9?`IE9`:t===10?`IE10`:`0`}return a?`FF`:t?`Opera`:o?`Safari`:s?`Chrome`:i?`Edge`:r?`IE11`:`Unknown browser`}static deepMerge(t,...n){n.forEach(e=>e&&a(e));function r(t,n){t.forEach((t,a)=>{if(e.isArray(t)){var o;let e=(o=n[a])==null?[]:o;n[a]=e,r(t,e);return}if(e.isObject(t)){var s;let e=(s=n[a])==null?{}:s;n[a]=e,i(t,e);return}n[a]=t})}function i(t,n){Object.keys(t).forEach(a=>{let o=t[a];if(e.isObject(o)){var s;let e=(s=n[a])==null?{}:s;n[a]=e,i(o,e);return}if(e.isArray(o)){var c;let e=(c=n[a])==null?[]:c;n[a]=e,r(o,e);return}n[a]=o})}function a(n){Object.keys(n).forEach(a=>{let o=n[a];if(e.isArray(o)){var s;let e=(s=t[a])==null?[]:s;t[a]=e,r(o,e);return}if(e.isObject(o)){var c;let e=(c=t[a])==null?{}:c;t[a]=e,i(o,e);return}t[a]=o})}return t}static diffValue(e,t){return pa(e,t)}static deepClone(t){if(!this.isDefine(t))return t;if(this.isRegExp(t))return new RegExp(t);if(this.isDate(t))return new Date(t);if(this.isArray(t)){let n=[];return t.forEach((t,r)=>{n[r]=e.deepClone(t)}),n}if(this.isObject(t)){let n={};return Object.keys(t).forEach(r=>{let i=t[r];n[r]=e.deepClone(i)}),Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}return t}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 isPlainObject(e){return this.isDefine(e)?Object.getPrototypeOf(e)===Object.getPrototypeOf({}):!1}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(Number.parseFloat(e))&&isFinite(e)}static isObject(e){return this.getValueType(e)===`[object Object]`}static isEmptyObject(e){for(let t in e)return!1;return!0}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(e){return ia(e)}static normalizeUrl(e){return sa(e)}static topLevelDomainCombiningString(){return[...na].join(`|`)}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{let r=t[n];r==null?delete t[n]:e.removeNull(r)}),t}static numToWord(e){let t=``;for(;e>0;){let n=e%26;n=n===0?n=26:n,t=String.fromCharCode(96+n)+t,e=(e-n)/26}return t.toLocaleUpperCase()}static ABCatNum(e){if(e==null||e.length===0)return NaN;let t=e.toLowerCase().split(``),n=t.length,r=0,i=0;for(let e=0;e<n;e++)i=t[e].charCodeAt(0)-96,r+=i*26**(n-e-1);return r===0?NaN:r-1}static chatAtABC(e){let t=``;for(;e>=0;)t=String.fromCharCode(e%26+97)+t,e=Math.floor(e/26)-1;return t.toUpperCase()}static commonExtend(e,t){let n={};for(let t in e)n[t]=e[t];for(let e in t)t[e]!=null&&(n[e]=t[e]);return n}static hasIntersectionBetweenTwoRanges(e,t,n,r){return t>=n&&r>=e}static isStartValidPosition(e){return/^[A-Za-zА-Яа-яЁё_]/.test(e)}static isValidParameter(e){let t=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(e),n=e.length<=255;return!t&&n}static clamp(e,t,n){return Math.max(t,Math.min(n,e))}static now(){return performance&&performance.now?performance.now():Date.now()}};function U(e=21,t){return t?da(t,e)():fa(e)}function ga(...e){let t={},n=e.length;for(let r=n-1;r>=0;r--){let n=e[r];if(n){let e=Object.keys(n);for(let r of e)t[r]===void 0&&(t[r]=n[r])}}return t}let _a=()=>typeof process<`u`&&process.versions!=null&&process.versions.node!=null;function va(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/\\\*/g,`.*`).replace(/\\\?/g,`.`);return RegExp(`^${t}$`,`i`)}let ya=function(e){return e[e.DEFAULT_SERIES=0]=`DEFAULT_SERIES`,e[e.ALTERNATE_SERIES=1]=`ALTERNATE_SERIES`,e}({}),ba=function(e){return e[e.NONE=0]=`NONE`,e[e.THIN=1]=`THIN`,e[e.HAIR=2]=`HAIR`,e[e.DOTTED=3]=`DOTTED`,e[e.DASHED=4]=`DASHED`,e[e.DASH_DOT=5]=`DASH_DOT`,e[e.DASH_DOT_DOT=6]=`DASH_DOT_DOT`,e[e.DOUBLE=7]=`DOUBLE`,e[e.MEDIUM=8]=`MEDIUM`,e[e.MEDIUM_DASHED=9]=`MEDIUM_DASHED`,e[e.MEDIUM_DASH_DOT=10]=`MEDIUM_DASH_DOT`,e[e.MEDIUM_DASH_DOT_DOT=11]=`MEDIUM_DASH_DOT_DOT`,e[e.SLANT_DASH_DOT=12]=`SLANT_DASH_DOT`,e[e.THICK=13]=`THICK`,e}({}),xa=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e.NONE=`none`,e.ALL=`all`,e.OUTSIDE=`outside`,e.INSIDE=`inside`,e.HORIZONTAL=`horizontal`,e.VERTICAL=`vertical`,e.TLBR=`tlbr`,e.TLBC_TLMR=`tlbc_tlmr`,e.TLBR_TLBC_TLMR=`tlbr_tlbc_tlmr`,e.BLTR=`bl_tr`,e.MLTR_BCTR=`mltr_bctr`,e}({}),Sa=function(e){return e[e.UNSUPPORTED=0]=`UNSUPPORTED`,e[e.RGB=1]=`RGB`,e[e.HEX=2]=`HEX`,e[e.THEME=3]=`THEME`,e}({}),Ca=function(e){return e[e.ON=0]=`ON`,e[e.OFF=1]=`OFF`,e}({}),wa=function(e){return e[e.PASTE_NORMAL=0]=`PASTE_NORMAL`,e[e.PASTE_NO_BORDERS=1]=`PASTE_NO_BORDERS`,e[e.PASTE_FORMAT=2]=`PASTE_FORMAT`,e[e.PASTE_FORMULA=3]=`PASTE_FORMULA`,e[e.PASTE_DATA_VALIDATION=4]=`PASTE_DATA_VALIDATION`,e[e.PASTE_VALUES=5]=`PASTE_VALUES`,e[e.PASTE_CONDITIONAL_FORMATTING=6]=`PASTE_CONDITIONAL_FORMATTING`,e[e.PASTE_COLUMN_WIDTHS=7]=`PASTE_COLUMN_WIDTHS`,e}({}),Ta=function(e){return e[e.LEFT=0]=`LEFT`,e[e.RIGHT=1]=`RIGHT`,e}({}),Ea=function(e){return e[e.DOCUMENT=0]=`DOCUMENT`,e[e.PROJECT=1]=`PROJECT`,e}({}),Da=function(e){return e[e.COLUMNS=0]=`COLUMNS`,e[e.ROWS=1]=`ROWS`,e}({}),Oa=function(e){return e[e.UP=0]=`UP`,e[e.RIGHT=1]=`RIGHT`,e[e.DOWN=2]=`DOWN`,e[e.LEFT=3]=`LEFT`,e}({});function ka(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}let Aa=function(e){return e[e.INTERPOLATION_POINT_TYPE_UNSPECIFIED=0]=`INTERPOLATION_POINT_TYPE_UNSPECIFIED`,e[e.MIN=1]=`MIN`,e[e.MAX=2]=`MAX`,e[e.NUMBER=3]=`NUMBER`,e[e.PERCENT=4]=`PERCENT`,e[e.PERCENTILE=5]=`PERCENTILE`,e}({}),ja=function(e){return e.EN_US=`enUS`,e.FR_FR=`frFR`,e.ZH_CN=`zhCN`,e.RU_RU=`ruRU`,e.ZH_TW=`zhTW`,e.VI_VN=`viVN`,e.FA_IR=`faIR`,e.JA_JP=`jaJP`,e.KO_KR=`koKR`,e.ES_ES=`esES`,e.CA_ES=`caES`,e.SK_SK=`skSK`,e}({}),Ma=function(e){return e[e.PERSON=0]=`PERSON`,e[e.FILE=1]=`FILE`,e[e.DATE=2]=`DATE`,e[e.LOCATION=3]=`LOCATION`,e[e.EVENT=4]=`EVENT`,e}({}),Na=function(e){return e[e.RANGE=0]=`RANGE`,e[e.SHEET=1]=`SHEET`,e}({}),Pa=function(e){return e[e.RELATIVE_DATE_UNSPECIFIED=0]=`RELATIVE_DATE_UNSPECIFIED`,e[e.PAST_YEAR=1]=`PAST_YEAR`,e[e.PAST_MONTH=2]=`PAST_MONTH`,e[e.PAST_WEEK=3]=`PAST_WEEK`,e[e.YESTERDAY=4]=`YESTERDAY`,e[e.TODAY=5]=`TODAY`,e[e.TOMORROW=6]=`TOMORROW`,e}({}),Fa=function(e){return e[e.GRID=0]=`GRID`,e[e.KANBAN=1]=`KANBAN`,e[e.GANTT=2]=`GANTT`,e}({}),Ia=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.LEFT_TO_RIGHT=1]=`LEFT_TO_RIGHT`,e[e.RIGHT_TO_LEFT=2]=`RIGHT_TO_LEFT`,e}({}),La=function(e){return e[e.DASH=0]=`DASH`,e[e.DASH_DOT_DOT_HEAVY=1]=`DASH_DOT_DOT_HEAVY`,e[e.DASH_DOT_HEAVY=2]=`DASH_DOT_HEAVY`,e[e.DASHED_HEAVY=3]=`DASHED_HEAVY`,e[e.DASH_LONG=4]=`DASH_LONG`,e[e.DASH_LONG_HEAVY=5]=`DASH_LONG_HEAVY`,e[e.DOT_DASH=6]=`DOT_DASH`,e[e.DOT_DOT_DASH=7]=`DOT_DOT_DASH`,e[e.DOTTED=8]=`DOTTED`,e[e.DOTTED_HEAVY=9]=`DOTTED_HEAVY`,e[e.DOUBLE=10]=`DOUBLE`,e[e.NONE=11]=`NONE`,e[e.SINGLE=12]=`SINGLE`,e[e.THICK=13]=`THICK`,e[e.WAVE=14]=`WAVE`,e[e.WAVY_DOUBLE=15]=`WAVY_DOUBLE`,e[e.WAVY_HEAVY=16]=`WAVY_HEAVY`,e[e.WORDS=17]=`WORDS`,e}({}),Ra=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.LEFT=1]=`LEFT`,e[e.CENTER=2]=`CENTER`,e[e.RIGHT=3]=`RIGHT`,e[e.JUSTIFIED=4]=`JUSTIFIED`,e[e.BOTH=5]=`BOTH`,e[e.DISTRIBUTED=6]=`DISTRIBUTED`,e}({}),za=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TOP=1]=`TOP`,e[e.MIDDLE=2]=`MIDDLE`,e[e.BOTTOM=3]=`BOTTOM`,e}({}),Ba=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.OVERFLOW=1]=`OVERFLOW`,e[e.CLIP=2]=`CLIP`,e[e.WRAP=3]=`WRAP`,e}({}),Va=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.ITALIC=1]=`ITALIC`,e}({}),Ha=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.BOLD=1]=`BOLD`,e}({}),Ua=function(e){return e[e.NORMAL=1]=`NORMAL`,e[e.SUBSCRIPT=2]=`SUBSCRIPT`,e[e.SUPERSCRIPT=3]=`SUPERSCRIPT`,e}({}),Wa=function(e){return e[e.FALSE=0]=`FALSE`,e[e.TRUE=1]=`TRUE`,e}({}),Ga=function(e){return e[e.STRING=1]=`STRING`,e[e.NUMBER=2]=`NUMBER`,e[e.BOOLEAN=3]=`BOOLEAN`,e[e.FORCE_STRING=4]=`FORCE_STRING`,e}({}),Ka=function(e){return e[e.DARK1=0]=`DARK1`,e[e.LIGHT1=1]=`LIGHT1`,e[e.DARK2=2]=`DARK2`,e[e.LIGHT2=3]=`LIGHT2`,e[e.ACCENT1=4]=`ACCENT1`,e[e.ACCENT2=5]=`ACCENT2`,e[e.ACCENT3=6]=`ACCENT3`,e[e.ACCENT4=7]=`ACCENT4`,e[e.ACCENT5=8]=`ACCENT5`,e[e.ACCENT6=9]=`ACCENT6`,e[e.HYPERLINK=10]=`HYPERLINK`,e[e.FOLLOWED_HYPERLINK=11]=`FOLLOWED_HYPERLINK`,e}({}),qa=function(e){return e.OFFICE=`Office`,e.OFFICE_2007_2010=`Office 2007-2010`,e.GRAYSCALE=`Grayscale`,e.BLUE_WARM=`Blue Warm`,e.BLUE=`Blue`,e.BLUE_II=`Blue II`,e.BLUE_GREEN=`Blue Green`,e.GREEN=`Green`,e.GREEN_YELLOW=`Green Yellow`,e.YELLOW=`Yellow`,e.YELLOW_ORANGE=`Yellow Orange`,e.ORANGE=`Orange`,e.ORANGE_RED=`Orange Red`,e.RED_ORANGE=`Red Orange`,e.RED=`Red`,e.RED_VIOLET=`Red Violet`,e.VIOLET=`Violet`,e.VIOLET_II=`Violet II`,e.MEDIAN=`Median`,e.PAPER=`Paper`,e.MARQUEE=`Marquee`,e.SLIPSTREAM=`Slipstream`,e.Aspect=`Aspect`,e}({}),Ja=function(e){return e[e.character=0]=`character`,e[e.paragraph=1]=`paragraph`,e[e.table=2]=`table`,e[e.numbering=3]=`numbering`,e}({}),Ya=function(e){return e[e.TAB=0]=`TAB`,e[e.SPACE=1]=`SPACE`,e[e.NOTHING=2]=`NOTHING`,e}({}),Xa=function(e){return e[e.BULLET=0]=`BULLET`,e[e.NONE=1]=`NONE`,e[e.DECIMAL=2]=`DECIMAL`,e[e.DECIMAL_ZERO=3]=`DECIMAL_ZERO`,e[e.UPPER_LETTER=4]=`UPPER_LETTER`,e[e.LOWER_LETTER=5]=`LOWER_LETTER`,e[e.UPPER_ROMAN=6]=`UPPER_ROMAN`,e[e.LOWER_ROMAN=7]=`LOWER_ROMAN`,e[e.ORDINAL=8]=`ORDINAL`,e[e.CARDINAL_TEXT=9]=`CARDINAL_TEXT`,e[e.ORDINAL_TEXT=10]=`ORDINAL_TEXT`,e[e.HEX=11]=`HEX`,e[e.CHICAGO=12]=`CHICAGO`,e[e.IDEOGRAPH_DIGITAL=13]=`IDEOGRAPH_DIGITAL`,e[e.JAPANESE_COUNTING=14]=`JAPANESE_COUNTING`,e[e.AIUEO=15]=`AIUEO`,e[e.IROHA=16]=`IROHA`,e[e.DECIMAL_FULL_WIDTH=17]=`DECIMAL_FULL_WIDTH`,e[e.DECIMAL_HALF_WIDTH=18]=`DECIMAL_HALF_WIDTH`,e[e.JAPANESE_LEGAL=19]=`JAPANESE_LEGAL`,e[e.JAPANESE_DIGITAL_TEN_THOUSAND=20]=`JAPANESE_DIGITAL_TEN_THOUSAND`,e[e.DECIMAL_ENCLOSED_CIRCLE=21]=`DECIMAL_ENCLOSED_CIRCLE`,e[e.DECIMAL_FULL_WIDTH2=22]=`DECIMAL_FULL_WIDTH2`,e[e.AIUEO_FULL_WIDTH=23]=`AIUEO_FULL_WIDTH`,e[e.IROHA_FULL_WIDTH=24]=`IROHA_FULL_WIDTH`,e[e.GANADA=25]=`GANADA`,e[e.CHOSUNG=26]=`CHOSUNG`,e[e.DECIMAL_ENCLOSED_FULLSTOP=27]=`DECIMAL_ENCLOSED_FULLSTOP`,e[e.DECIMAL_ENCLOSED_PAREN=28]=`DECIMAL_ENCLOSED_PAREN`,e[e.DECIMAL_ENCLOSED_CIRCLE_CHINESE=29]=`DECIMAL_ENCLOSED_CIRCLE_CHINESE`,e[e.IDEOGRAPH_ENCLOSED_CIRCLE=30]=`IDEOGRAPH_ENCLOSED_CIRCLE`,e[e.IDEOGRAPH_TRADITIONAL=31]=`IDEOGRAPH_TRADITIONAL`,e[e.IDEOGRAPH_ZODIAC=32]=`IDEOGRAPH_ZODIAC`,e[e.IDEOGRAPH_ZODIAC_TRADITIONAL=33]=`IDEOGRAPH_ZODIAC_TRADITIONAL`,e[e.TAIWANESE_COUNTING=34]=`TAIWANESE_COUNTING`,e[e.IDEOGRAPH_LEGAL_TRADITIONAL=35]=`IDEOGRAPH_LEGAL_TRADITIONAL`,e[e.TAIWANESE_COUNTING_THOUSAND=36]=`TAIWANESE_COUNTING_THOUSAND`,e[e.TAIWANESE_DIGITAL=37]=`TAIWANESE_DIGITAL`,e[e.CHINESE_COUNTING=38]=`CHINESE_COUNTING`,e[e.CHINESE_LEGAL_SIMPLIFIED=39]=`CHINESE_LEGAL_SIMPLIFIED`,e[e.CHINESE_COUNTING_THOUSAND=40]=`CHINESE_COUNTING_THOUSAND`,e[e.KOREAN_DIGITAL=41]=`KOREAN_DIGITAL`,e[e.KOREAN_COUNTING=42]=`KOREAN_COUNTING`,e[e.KOREAN_LEGAL=43]=`KOREAN_LEGAL`,e[e.KOREAN_DIGITAL2=44]=`KOREAN_DIGITAL2`,e[e.VIETNAMESE_COUNTING=45]=`VIETNAMESE_COUNTING`,e[e.RUSSIAN_LOWER=46]=`RUSSIAN_LOWER`,e[e.RUSSIAN_UPPER=47]=`RUSSIAN_UPPER`,e[e.NUMBER_IN_DASH=48]=`NUMBER_IN_DASH`,e[e.HEBREW1=49]=`HEBREW1`,e[e.HEBREW2=50]=`HEBREW2`,e[e.ARABIC_ALPHA=51]=`ARABIC_ALPHA`,e[e.ARABIC_ABJAD=52]=`ARABIC_ABJAD`,e[e.HINDI_VOWELS=53]=`HINDI_VOWELS`,e[e.HINDI_CONSONANTS=54]=`HINDI_CONSONANTS`,e[e.HINDI_NUMBERS=55]=`HINDI_NUMBERS`,e[e.HINDI_COUNTING=56]=`HINDI_COUNTING`,e[e.THAI_LETTERS=57]=`THAI_LETTERS`,e[e.THAI_NUMBERS=58]=`THAI_NUMBERS`,e[e.THAI_COUNTING=59]=`THAI_COUNTING`,e[e.CUSTOM=60]=`CUSTOM`,e}({}),Za=function(e){return e[e.BULLET_ALIGNMENT_UNSPECIFIED=0]=`BULLET_ALIGNMENT_UNSPECIFIED`,e[e.START=1]=`START`,e[e.CENTER=2]=`CENTER`,e[e.END=3]=`END`,e[e.BOTH=4]=`BOTH`,e}({}),Qa=function(e){return e[e.HYPERLINK=0]=`HYPERLINK`,e[e.FIELD=1]=`FIELD`,e[e.SDT=2]=`SDT`,e[e.BOOKMARK=3]=`BOOKMARK`,e[e.COMMENT=4]=`COMMENT`,e[e.CUSTOM=5]=`CUSTOM`,e[e.MENTION=6]=`MENTION`,e[e.UNI_FORMULA=7]=`UNI_FORMULA`,e[e.DELTED=9999]=`DELTED`,e}({}),$a=function(e){return e[e.COMMENT=0]=`COMMENT`,e[e.DELETED=9999]=`DELETED`,e}({}),eo=function(e){return e[e.DRAWING=0]=`DRAWING`,e[e.CUSTOM=1]=`CUSTOM`,e}({}),to=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRADITIONAL=1]=`TRADITIONAL`,e[e.MODERN=2]=`MODERN`,e}({}),no=function(e){return e[e.DEFAULT=0]=`DEFAULT`,e[e.LINES=1]=`LINES`,e[e.LINES_AND_CHARS=2]=`LINES_AND_CHARS`,e[e.SNAP_TO_CHARS=3]=`SNAP_TO_CHARS`,e}({}),ro=function(e){return e[e.SECTION_TYPE_UNSPECIFIED=0]=`SECTION_TYPE_UNSPECIFIED`,e[e.CONTINUOUS=1]=`CONTINUOUS`,e[e.NEXT_PAGE=2]=`NEXT_PAGE`,e[e.EVEN_PAGE=3]=`EVEN_PAGE`,e[e.ODD_PAGE=4]=`ODD_PAGE`,e}({}),io=function(e){return e[e.COLUMN_SEPARATOR_STYLE_UNSPECIFIED=0]=`COLUMN_SEPARATOR_STYLE_UNSPECIFIED`,e[e.NONE=1]=`NONE`,e[e.BETWEEN_EACH_COLUMN=2]=`BETWEEN_EACH_COLUMN`,e}({}),ao=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.TBRL=1]=`TBRL`,e[e.LRTBV=2]=`LRTBV`,e}({}),oo=function(e){return e[e.TEXT_RUN=0]=`TEXT_RUN`,e[e.AUTO_TEXT=1]=`AUTO_TEXT`,e[e.PAGE_BREAK=2]=`PAGE_BREAK`,e[e.COLUMN_BREAK=3]=`COLUMN_BREAK`,e[e.FOOT_NOTE_REFERENCE=4]=`FOOT_NOTE_REFERENCE`,e[e.HORIZONTAL_RULE=5]=`HORIZONTAL_RULE`,e[e.EQUATION=6]=`EQUATION`,e[e.DRAWING=7]=`DRAWING`,e[e.PERSON=8]=`PERSON`,e[e.RICH_LINK=9]=`RICH_LINK`,e}({}),so=function(e){return e[e.BOTH_SIDES=0]=`BOTH_SIDES`,e[e.LEFT=1]=`LEFT`,e[e.RIGHT=2]=`RIGHT`,e[e.LARGEST=3]=`LARGEST`,e}({}),co=function(e){return e[e.INLINE=0]=`INLINE`,e[e.WRAP_NONE=1]=`WRAP_NONE`,e[e.WRAP_POLYGON=2]=`WRAP_POLYGON`,e[e.WRAP_SQUARE=3]=`WRAP_SQUARE`,e[e.WRAP_THROUGH=4]=`WRAP_THROUGH`,e[e.WRAP_TIGHT=5]=`WRAP_TIGHT`,e[e.WRAP_TOP_AND_BOTTOM=6]=`WRAP_TOP_AND_BOTTOM`,e}({}),lo=function(e){return e[e.NAMED_STYLE_TYPE_UNSPECIFIED=0]=`NAMED_STYLE_TYPE_UNSPECIFIED`,e[e.NORMAL_TEXT=1]=`NORMAL_TEXT`,e[e.TITLE=2]=`TITLE`,e[e.SUBTITLE=3]=`SUBTITLE`,e[e.HEADING_1=4]=`HEADING_1`,e[e.HEADING_2=5]=`HEADING_2`,e[e.HEADING_3=6]=`HEADING_3`,e[e.HEADING_4=7]=`HEADING_4`,e[e.HEADING_5=8]=`HEADING_5`,e}({}),uo=function(e){return e[e.AUTO=0]=`AUTO`,e[e.AT_LEAST=1]=`AT_LEAST`,e[e.EXACT=2]=`EXACT`,e}({}),fo=function(e){return e[e.DASH_STYLE_UNSPECIFIED=0]=`DASH_STYLE_UNSPECIFIED`,e[e.SOLID=1]=`SOLID`,e[e.DOT=2]=`DOT`,e[e.DASH=3]=`DASH`,e}({}),po=function(e){return e[e.TAB_STOP_ALIGNMENT_UNSPECIFIED=0]=`TAB_STOP_ALIGNMENT_UNSPECIFIED`,e[e.START=1]=`START`,e[e.CENTER=2]=`CENTER`,e[e.END=3]=`END`,e}({}),mo=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.SPECIFIED=1]=`SPECIFIED`,e}({}),ho=function(e){return e[e.START=0]=`START`,e[e.CENTER=1]=`CENTER`,e[e.END=2]=`END`,e}({}),go=function(e){return e[e.AUTO_FIT=0]=`AUTO_FIT`,e[e.FIXED=1]=`FIXED`,e}({}),_o=function(e){return e[e.NONE=0]=`NONE`,e[e.WRAP=1]=`WRAP`,e}({}),vo=function(e){return e[e.AUTO=0]=`AUTO`,e[e.AT_LEAST=1]=`AT_LEAST`,e[e.EXACT=2]=`EXACT`,e}({}),yo=function(e){return e[e.CONTENT_ALIGNMENT_UNSPECIFIED=0]=`CONTENT_ALIGNMENT_UNSPECIFIED`,e[e.BOTH=1]=`BOTH`,e[e.TOP=2]=`TOP`,e[e.CENTER=3]=`CENTER`,e[e.BOTTOM=4]=`BOTTOM`,e}({}),bo=function(e){return e.NORMAL=`normal`,e.BOLD=`bold`,e.ITALIC=`italic`,e}({}),xo=function(e){return e[e.PAGE=0]=`PAGE`,e[e.COLUMN=1]=`COLUMN`,e[e.CHARACTER=2]=`CHARACTER`,e[e.MARGIN=3]=`MARGIN`,e[e.INSIDE_MARGIN=4]=`INSIDE_MARGIN`,e[e.OUTSIDE_MARGIN=5]=`OUTSIDE_MARGIN`,e[e.LEFT_MARGIN=6]=`LEFT_MARGIN`,e[e.RIGHT_MARGIN=7]=`RIGHT_MARGIN`,e}({}),So=function(e){return e[e.PAGE=0]=`PAGE`,e[e.PARAGRAPH=1]=`PARAGRAPH`,e[e.LINE=2]=`LINE`,e[e.MARGIN=3]=`MARGIN`,e[e.TOP_MARGIN=4]=`TOP_MARGIN`,e[e.BOTTOM_MARGIN=5]=`BOTTOM_MARGIN`,e[e.INSIDE_MARGIN=6]=`INSIDE_MARGIN`,e[e.OUTSIDE_MARGIN=7]=`OUTSIDE_MARGIN`,e}({}),Co=function(e){return e[e.POINT=0]=`POINT`,e[e.LINE=1]=`LINE`,e[e.CHARACTER=2]=`CHARACTER`,e[e.PIXEL=3]=`PIXEL`,e[e.PERCENT=4]=`PERCENT`,e}({}),wo=function(e){return e[e.CENTER=0]=`CENTER`,e[e.INSIDE=1]=`INSIDE`,e[e.LEFT=2]=`LEFT`,e[e.OUTSIDE=3]=`OUTSIDE`,e[e.RIGHT=4]=`RIGHT`,e[e.BOTH=5]=`BOTH`,e[e.DISTRIBUTE=6]=`DISTRIBUTE`,e}({}),To=function(e){return e[e.BOTTOM=0]=`BOTTOM`,e[e.CENTER=1]=`CENTER`,e[e.INSIDE=2]=`INSIDE`,e[e.OUTSIDE=3]=`OUTSIDE`,e[e.TOP=4]=`TOP`,e}({}),Eo=function(e){return e[e.compressPunctuation=0]=`compressPunctuation`,e[e.compressPunctuationAndJapaneseKana=1]=`compressPunctuationAndJapaneseKana`,e[e.doNotCompress=2]=`doNotCompress`,e}({}),Do=function(e){return e[e.PORTRAIT=0]=`PORTRAIT`,e[e.LANDSCAPE=1]=`LANDSCAPE`,e}({}),Oo=function(e){return e.Letter=`Letter`,e.Tabloid=`Tabloid`,e.Legal=`Legal`,e.Statement=`Statement`,e.Executive=`Executive`,e.Folio=`Folio`,e.A3=`A3`,e.A4=`A4`,e.A5=`A5`,e.B4=`B4`,e.B5=`B5`,e}({}),ko=[`A3`,`A4`,`A5`,`B4`,`B5`,`Letter`,`Tabloid`,`Legal`,`Statement`,`Executive`,`Folio`],Ao=function(e){return e[e.forward=0]=`forward`,e[e.backward=1]=`backward`,e[e.front=2]=`front`,e[e.back=3]=`back`,e}({}),jo=function(e){return e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e[e.DRAWING_IMAGE=0]=`DRAWING_IMAGE`,e[e.DRAWING_SHAPE=1]=`DRAWING_SHAPE`,e[e.DRAWING_CHART=2]=`DRAWING_CHART`,e[e.DRAWING_TABLE=3]=`DRAWING_TABLE`,e[e.DRAWING_SMART_ART=4]=`DRAWING_SMART_ART`,e[e.DRAWING_VIDEO=5]=`DRAWING_VIDEO`,e[e.DRAWING_GROUP=6]=`DRAWING_GROUP`,e[e.DRAWING_UNIT=7]=`DRAWING_UNIT`,e[e.DRAWING_DOM=8]=`DRAWING_DOM`,e}({});function Mo(){return e=>e}let No=Mo()([`s`,`c`,`cl`,`t`]),Po=Mo()([`rgb`,`th`]),Fo=Mo()([`s`,`cl`]),Io=Mo()([`t`,`r`,`b`,`l`,`tl_br`,`tl_bc`,`tl_mr`,`bl_tr`,`ml_tr`,`bc_tr`]),Lo=Mo()([`a`,`v`]),Ro=Mo()([`t`,`r`,`b`,`l`]),zo=Mo()([`ff`,`fs`,`it`,`bl`,`ul`,`bbl`,`st`,`ol`,`bg`,`bd`,`cl`,`va`,`n`,`tr`,`td`,`ht`,`vt`,`tb`,`pd`]);function Bo(e=U(6),t=`enUS`,n=``){return{id:e,locale:t,title:n,tableSource:{},drawings:{},drawingsOrder:[],headers:{},footers:{},body:{dataStream:`\r
|
|
2
|
+
`,textRuns:[],customBlocks:[],tables:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:595/.75,height:842/.75},documentFlavor:1,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:0,vertexAngle:0,centerAngle:0,background:{rgb:`#ccc`}},autoHyphenation:1,doNotHyphenateCaps:0,consecutiveHyphenLimit:2,defaultHeaderId:``,defaultFooterId:``,evenPageHeaderId:``,evenPageFooterId:``,firstPageHeaderId:``,firstPageFooterId:``,evenAndOddHeaders:0,useFirstPageHeaderFooter:0,marginHeader:30,marginFooter:30},settings:{}}}var Vo=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){if(Array.isArray(t))return!1;for(let n in e)if(!r(e[n],t[n]))return!1;for(let n in t)if(e[n]===void 0)return!1;return!0}function n(e,t){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1;return!0}function r(e,r){return e===r?!0:e===null||r===null||typeof e!=`object`||typeof r!=`object`?!1:Array.isArray(e)?n(e,r):t(e,r)}e.default=r})),Ho=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){if(e===null)return null;if(Array.isArray(e))return e.map(t);if(typeof e==`object`){let n={};for(let r in e)n[r]=t(e[r]);return n}else return e}e.default=t})),Uo=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.eachChildOf=e.advancer=e.readCursor=e.writeCursor=e.WriteCursor=e.ReadCursor=e.isValidPathItem=void 0;function t(e,t){if(!e)throw Error(t)}let n=e=>typeof e==`object`&&!!e&&!Array.isArray(e),r=(e,t)=>typeof e==typeof t?e>t:typeof e==`string`&&typeof t==`number`;function i(e,t){for(let n in e){let r=n;t.write(r,e[r])}}e.isValidPathItem=e=>typeof e==`number`||typeof e==`string`&&e!==`__proto__`;var a=class{constructor(e=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=e}ascend(){t(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(t(this.idx>0),this.idx--,n(this.container[this.idx])&&this.idx--)}getPath(){let e=[],t=this.container,r=this.parents.length-1,i=this.idx;for(;i>=0;)e.unshift(t[i]),i===0?(i=this.indexes[r*2],t=this.parents[r--]):i-=n(t[i-1])?2:1;return e}},o=class e extends a{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return t(this.container!=null,`Invalid call to getKey before cursor descended`),this.container[this.idx]}getComponent(){let e;return this.container&&this.container.length>this.idx+1&&n(e=this.container[this.idx+1])?e:null}descendFirst(){let e=this.idx+1;if(!this.container||e>=this.container.length||n(this.container[e])&&e+1>=this.container.length)return!1;n(this.container[e])&&e++;let t=this.container[e];return Array.isArray(t)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(e),this.idx=0,this.container=t):this.idx=e,!0}nextSibling(){if(t(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;let e=this.indexes[this.indexes.length-1]+1,n=this.parents[this.parents.length-1];return e>=n.length?!1:(t(!isNaN(e)),this.indexes[this.indexes.length-1]=e,this.container=n[e],!0)}_init(e,t,n,r){this.container=e,this.idx=t,this.parents=n.slice(),this.indexes=r.slice()}clone(){let t=new e;return t._init(this.container,this.idx,this.parents,this.indexes),t}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(e,t){let n=this.getComponent();n&&t(n,e);for(let n of this)e&&e.descend(n),this.traverse(e,t),e&&e.ascend()}eachPick(e,t){this.traverse(e,(e,n)=>{e.p!=null&&t(e.p,n)})}eachDrop(e,t){this.traverse(e,(e,n)=>{e.d!=null&&t(e.d,n)})}};e.ReadCursor=o;var s=class extends a{constructor(e=null){super(e),this.pendingDescent=[],this._op=e}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let e=0;e<this.pendingDescent.length;e++){let i=this.pendingDescent[e],a=this.idx+1;if(a<this.container.length&&n(this.container[a])&&a++,t(a===this.container.length||!n(this.container[a])),a===this.container.length)this.container.push(i),this.idx=a;else if(this.container[a]===i)this.idx=a;else{if(!Array.isArray(this.container[a])){let e=this.container.splice(a,this.container.length-a);this.container.push(e),this.lcIdx>-1&&(this.lcIdx=a)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(i,this.container[this.lcIdx][0])),a=this.lcIdx+1,this.lcIdx=-1);a<this.container.length&&r(i,this.container[a][0]);)a++;if(this.indexes.push(a),this.idx=0,a<this.container.length&&this.container[a][0]===i)this.container=this.container[a];else{let e=[i];this.container.splice(a,0,e),this.container=e}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();let e=this.idx+1;if(e<this.container.length&&n(this.container[e]))return this.container[e];{let t={};return this.container.splice(e,0,t),t}}write(e,n){let r=this.getComponent();t(r[e]==null||r[e]===n,`Internal consistency error: Overwritten component. File a bug`),r[e]=n}get(){return this._op}descend(t){if(!e.isValidPathItem(t))throw Error(`Invalid JSON key`);this.pendingDescent.push(t)}descendPath(e){return this.pendingDescent.push(...e),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(e,n=i){if(e===null)return;if(t(Array.isArray(e)),e===this._op)throw Error(`Cannot merge into my own tree`);let r=this.lcIdx,a=this.parents.length,o=0;for(let t=0;t<e.length;t++){let r=e[t];typeof r==`string`||typeof r==`number`?(o++,this.descend(r)):Array.isArray(r)?this.mergeTree(r,n):typeof r==`object`&&n(r,this)}for(;o--;)this.ascend();this.lcIdx=this.parents.length===a?r:-1}at(e,t){this.descendPath(e),t(this);for(let t=0;t<e.length;t++)this.ascend();return this}writeAtPath(e,t,n){return this.at(e,()=>this.write(t,n)),this.reset(),this}writeMove(e,t,n=0){return this.writeAtPath(e,`p`,n).writeAtPath(t,`d`,n)}getPath(){let e=super.getPath();return e.push(...this.pendingDescent),e}};e.WriteCursor=s,e.writeCursor=()=>new s,e.readCursor=e=>new o(e);function c(e,t,n){let i,a;a=i=e?e.descendFirst():!1;function o(i){let o;for(;a;){let s=o=e.getKey();if(i!=null){let n=!1;if(t&&typeof s==`number`&&(o=t(s,e.getComponent()),o<0&&(o=~o,n=!0)),r(o,i))return null;if(o===i&&!n)return e}n&&typeof o==`number`&&n(o,e.getComponent()),a=e.nextSibling()}return null}return o.end=()=>{i&&e.ascend()},o}e.advancer=c;function l(e,t,n){let i,a,o,s;for(i=a=e&&e.descendFirst(),o=s=t&&t.descendFirst();i||o;){let a=i?e.getKey():null,s=o?t.getKey():null;a!==null&&s!==null&&(r(s,a)?s=null:a!==s&&(a=null)),n(a==null?s:a,a==null?null:e,s==null?null:t),a!=null&&i&&(i=e.nextSibling()),s!=null&&o&&(o=t.nextSibling())}a&&e.ascend(),s&&t.ascend()}e.eachChildOf=l})),Wo=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ConflictType=void 0,(function(e){e[e.RM_UNEXPECTED_CONTENT=1]=`RM_UNEXPECTED_CONTENT`,e[e.DROP_COLLISION=2]=`DROP_COLLISION`,e[e.BLACKHOLE=3]=`BLACKHOLE`})(e.ConflictType||(e.ConflictType={}))})),Go=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.uniToStrPos=e.strPosToUni=void 0,e.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){let t=e.charCodeAt(r);t>=55296&&t<=57343&&(n++,r++)}if(r!==t)throw Error(`Invalid offset - splits unicode bytes`);return r-n},e.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){let t=e.charCodeAt(n);n+=t>=55296&&t<=57343?2:1}return n}})),Ko=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;let t=Go(),n=t=>{if(!Array.isArray(t))throw Error(`Op must be an array of components`);let n=null;for(let r=0;r<t.length;r++){let i=t[r];switch(typeof i){case`object`:if(typeof i.d!=`number`&&typeof i.d!=`string`)throw Error(`Delete must be number or string`);if(e.dlen(i.d)<=0)throw Error(`Deletes must not be empty`);break;case`string`:if(!(i.length>0))throw Error(`Inserts cannot be empty`);break;case`number`:if(!(i>0))throw Error(`Skip components must be >0`);if(typeof n==`number`)throw Error(`Adjacent skip components should be combined`);break}n=i}if(typeof n==`number`)throw Error(`Op has a trailing skip`)};function r(n,r){let i=0,a=0;for(let o=0;o<n.length;o++){let s=n[o];switch(r(s,i,a),typeof s){case`object`:i+=e.dlen(s.d);break;case`string`:a+=t.strPosToUni(s);break;case`number`:i+=s,a+=s;break}}}e.eachOp=r;function i(e,t){let n=[],i=s(n);return r(e,(e,n,r)=>{i(t(e,n,r))}),d(n)}let a=e=>e,o=e=>i(e,a);e.dlen=e=>typeof e==`number`?e:t.strPosToUni(e);let s=t=>n=>{if(!(!n||n.d===0||n.d===``))if(t.length===0)t.push(n);else if(typeof n==typeof t[t.length-1])if(typeof n==`object`){let r=t[t.length-1];r.d=typeof r.d==`string`&&typeof n.d==`string`?r.d+n.d:e.dlen(r.d)+e.dlen(n.d)}else t[t.length-1]+=n;else t.push(n)},c=e=>typeof e==`number`?e:typeof e==`string`?t.strPosToUni(e):typeof e.d==`number`?e.d:t.strPosToUni(e.d);e.uniSlice=(e,n,r)=>{let i=t.uniToStrPos(e,n),a=r==null?1/0:t.uniToStrPos(e,r);return e.slice(i,a)};let l=(t,n,r)=>typeof t==`number`?r==null?t-n:Math.min(t,r)-n:e.uniSlice(t,n,r),u=n=>{let r=0,i=0;return{take:(a,o)=>{if(r===n.length)return a===-1?null:a;let s=n[r],c;if(typeof s==`number`)return a===-1||s-i<=a?(c=s-i,++r,i=0,c):(i+=a,a);if(typeof s==`string`){if(a===-1||o===`i`||t.strPosToUni(s.slice(i))<=a)return c=s.slice(i),++r,i=0,c;{let e=i+t.uniToStrPos(s.slice(i),a);return c=s.slice(i,e),i=e,c}}else if(a===-1||o===`d`||e.dlen(s.d)-i<=a)return c={d:l(s.d,i)},++r,i=0,c;else{let e=l(s.d,i,i+a);return i+=a,{d:e}}},peek:()=>n[r]}},d=e=>(e.length>0&&typeof e[e.length-1]==`number`&&e.pop(),e);function f(r,i,a){if(a!==`left`&&a!==`right`)throw Error(`side (`+a+`) must be 'left' or 'right'`);n(r),n(i);let o=[],l=s(o),{take:f,peek:p}=u(r);for(let n=0;n<i.length;n++){let r=i[n],o,s;switch(typeof r){case`number`:for(o=r;o>0;)s=f(o,`i`),l(s),typeof s!=`string`&&(o-=c(s));break;case`string`:a===`left`&&typeof p()==`string`&&l(f(-1)),l(t.strPosToUni(r));break;case`object`:for(o=e.dlen(r.d);o>0;)switch(s=f(o,`i`),typeof s){case`number`:o-=s;break;case`string`:l(s);break;case`object`:o-=e.dlen(s.d)}break}}let m;for(;m=f(-1);)l(m);return d(o)}function p(r,i){n(r),n(i);let a=[],o=s(a),{take:f}=u(r);for(let n=0;n<i.length;n++){let r=i[n],a,s;switch(typeof r){case`number`:for(a=r;a>0;)s=f(a,`d`),o(s),typeof s!=`object`&&(a-=c(s));break;case`string`:o(r);break;case`object`:a=e.dlen(r.d);let n=0;for(;n<a;)switch(s=f(a-n,`d`),typeof s){case`number`:o({d:l(r.d,n,n+s)}),n+=s;break;case`string`:n+=t.strPosToUni(s);break;case`object`:o(s)}break}}let p;for(;p=f(-1);)o(p);return d(a)}let m=(n,r)=>{let i=0;for(let a=0;a<r.length&&n>i;a++){let o=r[a];switch(typeof o){case`number`:i+=o;break;case`string`:let r=t.strPosToUni(o);i+=r,n+=r;break;case`object`:n-=Math.min(e.dlen(o.d),n-i);break}}return n},h=(e,t)=>typeof e==`number`?m(e,t):e.map(e=>m(e,t));function g(e,t,n){return i(e,(e,r)=>typeof e==`object`&&typeof e.d==`number`?{d:n.slice(t,r,r+e.d)}:e)}function _(e){return i(e,e=>{switch(typeof e){case`object`:if(typeof e.d==`number`)throw Error(`Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.`);return e.d;case`string`:return{d:e};case`number`:return e}})}function v(e){return i(e,e=>typeof e==`object`&&typeof e.d==`string`?{d:t.strPosToUni(e.d)}:e)}function y(e){let t=!0;return r(e,e=>{typeof e==`object`&&typeof e.d==`number`&&(t=!1)}),t}function b(t){return{name:`text-unicode`,uri:`http://sharejs.org/types/text-unicode`,trim:d,normalize:o,checkOp:n,create(e=``){if(typeof e!=`string`)throw Error(`Initial data must be a string`);return t.create(e)},apply(r,i){n(i);let a=t.builder(r);for(let t=0;t<i.length;t++){let n=i[t];switch(typeof n){case`number`:a.skip(n);break;case`string`:a.append(n);break;case`object`:a.del(e.dlen(n.d));break}}return a.build()},transform:f,compose:p,transformPosition:m,transformSelection:h,isInvertible:y,makeInvertible(e,n){return g(e,n,t)},stripInvertible:v,invert:_,invertWithDoc(e,n){return _(g(e,n,t))},isNoop:e=>e.length===0}}e.default=b})),qo=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ko(),n=Go();function r(e,r){return{get:e,getLength(){return e().length},insert(t,i,a){return r([n.strPosToUni(e(),t),i],a)},remove(t,i,a){return r([n.strPosToUni(e(),t),{d:i}],a)},_onOp(e){t.eachOp(e,(e,n,r)=>{switch(typeof e){case`string`:this.onInsert&&this.onInsert(r,e);break;case`object`:let n=t.dlen(e.d);this.onRemove&&this.onRemove(r,n)}})},onInsert:null,onRemove:null}}e.default=r,r.provides={text:!0}})),Jo=f((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)Object.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.type=e.remove=e.insert=void 0;let a=Go(),o=r(Ko()),s=i(qo()),c={create(e){return e},toString(e){return e},builder(e){if(typeof e!=`string`)throw Error(`Invalid document snapshot: `+e);let t=[];return{skip(n){let r=a.uniToStrPos(e,n);if(r>e.length)throw Error(`The op is too long for this document`);t.push(e.slice(0,r)),e=e.slice(r)},append(e){t.push(e)},del(t){e=e.slice(a.uniToStrPos(e,t))},build(){return t.join(``)+e}}},slice:o.uniSlice},l=o.default(c);e.type=Object.assign(Object.assign({},l),{api:s.default}),e.insert=(e,t)=>t.length===0?[]:e===0?[t]:[e,t],e.remove=(e,t)=>o.dlen(t)===0?[]:e===0?[{d:t}]:[e,{d:t}];var u=Ko();Object.defineProperty(e,`makeType`,{enumerable:!0,get:function(){return u.default}})})),Yo=f((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;let n=t(Vo()),r=t(Ho()),i=Uo(),a=Wo(),o=()=>{};function s(e,t){if(!e)throw Error(t)}let c=!1;e.type={name:`json1`,uri:`http://sharejs.org/types/JSONv1`,readCursor:i.readCursor,writeCursor:i.writeCursor,create:e=>e,isNoop:e=>e==null,setDebug(e){c=e,o.quiet=!e},registerSubtype:y,checkValidOp:D,normalize:O,apply:k,transformPosition:A,compose:j,tryTransform:te,transform:L,makeInvertible:ee,invert:M,invertWithDoc:P,RM_UNEXPECTED_CONTENT:a.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:a.ConflictType.DROP_COLLISION,BLACKHOLE:a.ConflictType.BLACKHOLE,transformNoConflict:(e,t,n)=>ie(()=>!0,e,t,n),typeAllowingConflictsPred:t=>Object.assign(Object.assign({},e.type),{transform:(e,n,r)=>ie(t,e,n,r)})};let l=e=>e?e.getComponent():null;function u(e){return e&&typeof e==`object`&&!Array.isArray(e)}let d=e=>Array.isArray(e)?e.slice():typeof e==`object`&&e?Object.assign({},e):e,f=e=>e&&(e.p!=null||e.r!==void 0),p=e=>e&&(e.d!=null||e.i!==void 0);function m(e,t){return s(e!=null),typeof t==`number`?(s(Array.isArray(e),`Invalid key - child is not an array`),(e=e.slice()).splice(t,1)):(s(u(e),`Invalid key - child is not an object`),delete(e=Object.assign({},e))[t]),e}function h(e,t,n){return typeof t==`number`?(s(e!=null,`Container is missing for key`),s(Array.isArray(e),`Cannot use numerical key for object container`),s(e.length>=t,`Cannot insert into out of bounds index`),e.splice(t,0,n)):(s(u(e),`Cannot insert into missing item`),s(e[t]===void 0,`Trying to overwrite value at key. Your op needs to remove it first`),e[t]=n),n}e.removeOp=(e,t=!0)=>i.writeCursor().writeAtPath(e,`r`,t).get(),e.moveOp=(e,t)=>i.writeCursor().writeMove(e,t).get(),e.insertOp=(e,t)=>i.writeCursor().writeAtPath(e,`i`,t).get(),e.replaceOp=(e,t,n)=>i.writeCursor().at(e,e=>{e.write(`r`,t),e.write(`i`,n)}).get(),e.editOp=(e,t,n,r=!1)=>i.writeCursor().at(e,e=>w(e,t,n,r)).get();let g=(e,t)=>e!=null&&(typeof t==`number`?Array.isArray(e):typeof e==`object`),_=(e,t)=>g(e,t)?e[t]:void 0,v={};function y(e){let t=e.type?e.type:e;t.name&&(v[t.name]=t),t.uri&&(v[t.uri]=t)}let b=e=>{let t=v[e];if(t)return t;throw Error(`Missing type: `+e)};y(Jo());let x=(e,t)=>e+t;y({name:`number`,apply:x,compose:x,invert:e=>-e,transform:e=>e});let S=e=>e==null?null:e.et?b(e.et):e.es?v[`text-unicode`]:e.ena==null?null:v.number,C=e=>e.es?e.es:e.ena==null?e.e:e.ena,w=(e,t,n,r=!1)=>{let[i,a]=typeof t==`string`?[b(t),t]:[t,t.name];!r&&i.isNoop&&i.isNoop(n)||(a===`number`?e.write(`ena`,n):a===`text-unicode`?e.write(`es`,n):(e.write(`et`,a),e.write(`e`,n)))};function T(e){s(typeof e==`number`),s(e>=0),s(e===(0|e))}function E(e){typeof e==`number`?T(e):s(typeof e==`string`)}function D(e){if(e===null)return;let t=new Set,n=new Set,r=e=>{let r=!0,i=!1;for(let a in e){let o=e[a];if(r=!1,s(a===`p`||a===`r`||a===`d`||a===`i`||a===`e`||a===`es`||a===`ena`||a===`et`,`Invalid component item '`+a+`'`),a===`p`)T(o),s(!t.has(o)),t.add(o),s(e.r===void 0);else if(a===`d`)T(o),s(!n.has(o)),n.add(o),s(e.i===void 0);else if(a===`e`||a===`es`||a===`ena`){s(!i),i=!0;let t=S(e);s(t,`Missing type in edit`),t.checkValidOp&&t.checkValidOp(C(e))}}s(!r)},a=(e,t,n)=>{if(!Array.isArray(e))throw Error(`Op must be null or a list`);if(e.length===0)throw Error(`Empty descent`);t||E(e[0]);let o=1,c=0,l=0;for(let t=0;t<e.length;t++){let u=e[t];if(s(u!=null),Array.isArray(u)){let e=a(u,!1,n);if(c){let t=typeof l,n=typeof e;t===n?s(l<e,`descent keys are not in order`):s(t===`number`&&n===`string`)}l=e,c++,o=3}else typeof u==`object`?(s(o===1,`Prev not scalar - instead ${o}`),r(u),o=2):(s(o!==3),E(u),s(i.isValidPathItem(u),`Invalid path key`),o=1)}return s(c!==1,`Operation makes multiple descents. Remove some []`),s(o===2||o===3),e[0]};a(e,!0,!1),s(t.size===n.size,`Mismatched picks and drops in op`);for(let e=0;e<t.size;e++)s(t.has(e)),s(n.has(e))}function O(e){let t=0,n=[],r=i.writeCursor();return r.mergeTree(e,(e,r)=>{let i=S(e);if(i){let t=C(e);w(r,i,i.normalize?i.normalize(t):t)}for(let i of[`r`,`p`,`i`,`d`])if(e[i]!==void 0){let o=i===`p`||i===`d`?(a=e[i],n[a]==null&&(n[a]=t++),n[a]):e[i];r.write(i,o)}var a}),r.get()}function k(e,t){if(o.quiet=!c,D(t),t===null)return e;let n=[];return function e(t,r){let i=t,a=0,o={root:t},c=0,l=o,u=`root`;function f(){for(;c<a;c++){let e=r[c];typeof e!=`object`&&(s(g(l,u)),l=l[u]=d(l[u]),u=e)}}for(;a<r.length;a++){let t=r[a];if(Array.isArray(t)){let n=e(i,t);n!==i&&n!==void 0&&(f(),i=l[u]=n)}else if(typeof t==`object`){t.d==null?t.i!==void 0&&(f(),i=h(l,u,t.i)):(f(),i=h(l,u,n[t.d]));let e=S(t);if(e)f(),i=l[u]=e.apply(i,C(t));else if(t.e!==void 0)throw Error(`Subtype `+t.et+` undefined`)}else i=_(i,t)}return o.root}(e=function e(t,r){let i=[],a=0;for(;a<r.length;a++){let e=r[a];if(Array.isArray(e))break;typeof e!=`object`&&(i.push(t),t=_(t,e))}for(let n=r.length-1;n>=a;n--)t=e(t,r[n]);for(--a;a>=0;a--){let e=r[a];if(typeof e!=`object`){let n=i.pop();t=t===_(n,e)?n:t===void 0?m(n,e):(c=e,l=t,(o=d(o=n))[c]=l,o)}else f(e)&&(s(t!==void 0,`Cannot pick up or remove undefined`),e.p!=null&&(n[e.p]=t),t=void 0)}var o,c,l;return t}(e,t),t)}function A(e,t){e=e.slice(),D(t);let n=i.readCursor(t),r,a,o=!1,s=[];for(let t=0;;t++){let c=e[t],l=n.getComponent();if(l&&(l.r===void 0?l.p!=null&&(o=!1,r=l.p,a=t):o=!0),t>=e.length)break;let u=0,d=i.advancer(n,void 0,(e,t)=>{f(t)&&u++});s.unshift(d);let p=d(c);if(typeof c==`number`&&(e[t]-=u),!p)break}if(s.forEach(e=>e.end()),o)return null;let c=()=>{let t=0;if(r!=null){let r=n.getPath();t=r.length,e=r.concat(e.slice(a))}for(;t<e.length;t++){let r=e[t],a=l(n),o=S(a);if(o){let n=C(a);o.transformPosition&&(e[t]=o.transformPosition(e[t],n));break}let s=0,c=i.advancer(n,(e,t)=>p(t)?~(e-s):e-s,(e,t)=>{p(t)&&s++})(r);if(typeof r==`number`&&(e[t]+=s),!c)break}};return r==null?c():n.eachDrop(null,e=>{e===r&&c()}),e}function j(e,t){if(D(e),D(t),e==null)return t;if(t==null)return e;let n=0,r=i.readCursor(e),a=i.readCursor(t),o=i.writeCursor(),c=[],u=[],d=[],m=[],h=[],g=[],_=new Set;r.traverse(null,e=>{e.p!=null&&(d[e.p]=r.clone())}),a.traverse(null,e=>{e.d!=null&&(m[e.d]=a.clone())});let v=i.writeCursor();return function e(t,r,a,o,v,y,b,x){s(r||a);let T=l(r),E=l(a),D=!!E&&E.r!==void 0,O=!!T&&T.i!==void 0,k=T?T.d:null,A=E?E.p:null,j=(y||D)&&A==null;if(A!=null)o=m[A],b=u[A]=new i.WriteCursor;else if(E&&E.r!==void 0)o=null;else{let e=l(o);e&&e.d!=null&&(o=null)}let M=l(o);if(k!=null)if(t=d[k],x=c[k]=new i.WriteCursor,j)y&&!D&&x.write(`r`,!0);else{let e=h[k]=n++;b.write(`d`,e)}else if(T&&T.i!==void 0)t=null;else{let e=l(t);e&&e.p!=null&&(t=null)}let N;O?(s(v===void 0),N=T.i):N=v;let ee=(A==null?!O||y||D:N===void 0)?null:b.getComponent();if(A!=null){if(!(v!==void 0||O)){let e=k==null?n++:h[k];g[A]=e,x.write(`p`,e)}}else D&&(O||v!==void 0||(E.r,x.write(`r`,E.r)));let P=j?null:S(T),F=S(M);if((P||F)&&(P&&P.name,F&&F.name),P&&F){s(P===F);let e=C(T),t=C(M),n=P.compose(e,t);w(b,P,n),_.add(M)}else P?w(b,P,C(T)):F&&(w(b,F,C(M)),_.add(M));let te=typeof N==`object`&&!!N,I=!1,L=0,ne=0,re=0,ie=0,ae=0,oe=i.advancer(o,(e,t)=>p(t)?ie-e-1:e-ie,(e,t)=>{p(t)&&ie++}),se=i.advancer(t,(e,t)=>f(t)?L-e-1:e-L,(e,t)=>{f(t)&&L++});if(i.eachChildOf(r,a,(t,n,r)=>{let i,a,o=t,c=t,u=t;if(typeof t==`number`){let e=t+re;a=oe(e),c=e+ie;let d=t+ne;i=se(d),p(l(a))&&(i=null),o=d+L,u=t+ae,s(o>=0,`p1PickKey is negative`),s(c>=0,`p2DropKey is negative`);let m=p(l(n)),h=f(l(r));(m||h&&!j)&&ae--,m&&ne--,h&&re--}else i=se(t),a=oe(t);x.descend(o),b.descend(c);let d=te&&!p(l(n))?N[u]:void 0,m=e(i,n,r,a,d,j,b,x);var h,g,_;te&&!j?d!==m&&(I||(N=Array.isArray(N)?N.slice():Object.assign({},N),I=!0),h=N,_=m,typeof(g=u)==`number`?(s(Array.isArray(h)),s(g<h.length)):(s(!Array.isArray(h)),s(h[g]!==void 0)),_===void 0?typeof g==`number`?h.splice(g,1):delete h[g]:h[g]=_):s(m===void 0),b.ascend(),x.ascend()}),se.end(),oe.end(),ee!=null)ee.i=N;else if(!y&&!D&&A==null)return N}(r,r.clone(),a,a.clone(),void 0,!1,o,v),o.reset(),o.mergeTree(v.get()),o.reset(),o.get(),c.map(e=>e.get()),u.map(e=>e.get()),r.traverse(o,(e,t)=>{let n=e.p;if(n!=null){let e=h[n];e!=null&&t.write(`p`,e);let r=c[n];r&&r.get(),r&&t.mergeTree(r.get())}else e.r!==void 0&&t.write(`r`,e.r)}),o.reset(),o.get(),a.traverse(o,(e,t)=>{let n=e.d;if(n!=null){let e=g[n];e!=null&&t.write(`d`,e);let r=u[n];r&&t.mergeTree(r.get())}else e.i!==void 0&&t.write(`i`,e.i);let r=S(e);r&&!_.has(e)&&w(t,r,C(e))}),o.get()}function M(e){if(e==null)return null;let t=new i.ReadCursor(e),n=new i.WriteCursor,r,a=[],o=[];return function e(t,n,i){let o=t.getComponent(),s,c=!1;if(o){o.p!=null&&(n.write(`d`,o.p),a[o.p]=t.clone()),o.r!==void 0&&n.write(`i`,o.r),o.d!=null&&(n.write(`p`,o.d),i=void 0),o.i!==void 0&&(i=s=o.i);let e=S(o);e&&(i===void 0?(r||(r=new Set),r.add(o)):(C(o),i=e.apply(i,C(o)),c=!0))}let l=0;for(let r of t){n.descend(r);let a=typeof r==`number`?r-l:r,o=_(i,a);p(t.getComponent())&&l++;let s=e(t,n,o);if(i!==void 0&&s!==void 0){if(c||(c=!0,i=d(i)),!g(i,a))throw Error(`Cannot modify child - invalid operation`);i[a]=s}n.ascend()}if(s===void 0)return c?i:void 0;n.write(`r`,i)}(t,n,void 0),r&&(n.reset(),function e(t,n,s){let c=n.getComponent();if(c){let e=c.d;if(e!=null&&(t=a[e],s=o[e]=i.writeCursor()),r.has(c)){let e=S(c);if(!e.invert)throw Error(`Cannot invert subtype ${e.name}`);w(s,e,e.invert(C(c)))}}let l=0,u=0,d=i.advancer(t,(e,t)=>f(t)?l-e-1:e-l,(e,t)=>{f(t)&&l++});for(let t of n)if(typeof t==`number`){let r=t-u,i=d(r),a=r+l;s.descend(a),e(i,n,s),p(n.getComponent())&&u++,s.ascend()}else s.descend(t),e(d(t),n,s),s.ascend();d.end()}(t.clone(),t,n),o.length&&(n.reset(),t.traverse(n,(e,t)=>{let n=e.p;if(n!=null){let e=o[n];e&&e.get(),e&&t.mergeTree(e.get())}}))),n.get()}let N=(e,t)=>e.some(e=>typeof e==`object`&&(Array.isArray(e)?N(e,t):t(e)));function ee(e,t){if(e==null||!N(e,e=>{var t;return e.r!==void 0||((t=S(e))==null?void 0:t.makeInvertible)!=null}))return e;let n=new i.ReadCursor(e),a=new i.WriteCursor,o=!1,c=[],l=[],u=(e,t,n)=>{let i=e.getComponent(),a=!1;if(i){i.d!=null&&t.write(`d`,i.d),i.i!==void 0&&t.write(`i`,i.i);let r=i.p;if(r!=null&&(c[r]=e.clone(),s(n!==void 0,`Operation picks up at an invalid key`),l[r]=n,t.write(`p`,i.p)),i.r!==void 0&&n===void 0)throw Error(`Invalid doc / op in makeInvertible: removed item missing from doc`);let a=S(i);a&&(a.makeInvertible?o=!0:w(t,a,C(i),!0))}let f=0;for(let r of e){t.descend(r);let i=typeof r==`number`?r-f:r,o=_(n,i),s=u(e,t,o);o!==s&&(a||(a=!0,n=d(n)),s===void 0?(n=m(n,i),typeof r==`number`&&f++):n[i]=s),t.ascend()}return i&&(i.r===void 0?i.p!=null&&(n=void 0):(t.write(`r`,r.default(n)),n=void 0)),n};return u(n,a,t),a.get(),o&&(a.reset(),function e(t,n,r,a,o){let s=n.getComponent();if(s){s.i===void 0?s.d!=null&&(a=l[s.d],t=c[s.d],o=!1,s.d):(a=s.i,o=!0);let e=S(s);if(e&&e.makeInvertible){let t=C(s);w(r,e,e.makeInvertible(t,a),!0)}}let u=0,d=0,m=i.advancer(t,(e,t)=>f(t)?u-e-1:e-u,(e,t)=>{f(t)&&u++});for(let t of n)if(typeof t==`number`){let i=t-d,s=m(i),c=i+u,l=_(a,o?i:c);r.descend(t),e(s,n,r,l,o),p(n.getComponent())&&d++,r.ascend()}else{let i=_(a,t);r.descend(t),e(m(t),n,r,i,o),r.ascend()}m.end()}(n.clone(),n,a,t,!1)),a.get()}function P(e,t){return M(ee(e,t))}let F=e=>{if(e==null)return null;let t=e.slice();for(let n=0;n<e.length;n++){let e=t[n];Array.isArray(e)&&(t[n]=F(e))}return t};function te(t,u,d){s(d===`left`||d===`right`,`Direction must be left or right`);let m=d===`left`?0:1;if(o.quiet=!c,o.prefix=0,u==null)return{ok:!0,result:t};D(t),D(u);let h=null,g=[],_=[],v=[],y=[],b=[],x=[],T=[],E=[],O=[],k=[],A=[],j=[],M=[],N=[],ee=[],P=0,te=i.readCursor(t),I=i.readCursor(u),L=i.writeCursor();if(function e(t,n=null,r){let a=l(n);a&&(a.r===void 0?a.p!=null&&(r=null,x[a.p]=t.clone()):r=n.clone());let o=t.getComponent(),s;o&&(s=o.p)!=null&&(b[s]=n?n.clone():null,v[s]=t.clone(),r&&(k[s]=!0,O[s]=r),a&&a.p!=null&&(N[s]=a.p));let c=i.advancer(n);for(let n of t)e(t,c(n),r);c.end()}(I,te,null),function t(n,r,o,s,c){let u=o.getComponent(),d,p=!1;u&&((d=u.d)==null?u.i!==void 0&&(n=r=null,p=!0,c&&h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(c.getPath()),op2:e.insertOp(o.getPath(),u.i)})):(y[d]=o.clone(),s!=null&&(ee[s]==null&&(ee[s]=[]),ee[s].push(d)),k[d],n=b[d]||null,r=v[d]||null,k[d]?(c&&(A[d]=!0),c=O[d]||null):!c||m!==1&&N[d]!=null||h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(c.getPath()),op2:e.moveOp(r.getPath(),o.getPath())}),p=!0));let g=l(n);g&&(g.r===void 0?g.p!=null&&(g.p,s=g.p,c=null):c=n.clone());let _=S(u);_&&c&&h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(c.getPath()),op2:e.editOp(o.getPath(),_,C(u),!0)});let x=0,w=0,T=i.advancer(r,(e,t)=>f(t)?x-e-1:e-x,(e,t)=>{f(t)&&x++}),E=i.advancer(n);for(let e of o)if(typeof e==`number`){let n=e-w,r=T(n);w+=+t(E(n+x),r,o,s,c)}else{let n=T(e);t(E(e),n,o,s,c)}return T.end(),E.end(),p}(te,I,I.clone(),null,null),y.map(e=>e&&e.get()),h)return{ok:!1,conflict:h};A.map(e=>!!e);let ne=[],re=null;(function e(t,n,r,a,o){let c=!1,u=l(n);if(f(u)){let e=u.p;e==null?(r=null,o=n.clone()):(r=y[e],a=j[e]=i.writeCursor(),c=!0,o=null)}else p(l(r))&&(r=null);let d=t.getComponent();if(d){let e=d.p;e==null?d.r!==void 0&&(o||a.write(`r`,!0),(o||c)&&(re==null&&(re=new Set),re.add(d))):(o&&(E[e]=o),ne[e]=o||m===1&&c?null:a.getComponent(),g[e]=t.clone(),r&&(T[e]=r.clone()))}let h=0,_=0,v=i.advancer(n,void 0,(e,t)=>{f(t)&&h++}),b=i.advancer(r,(e,t)=>p(t)?~(e-_):e-_,(e,t)=>{p(t)&&_++});if(t)for(let n of t)if(typeof n==`string`){let r=v(n),i=b(n);a.descend(n),e(t,r,i,a,o),a.ascend()}else{let r=v(n),i=n-h,c=f(l(r))?null:b(i),u=i+_;s(u>=0),a.descend(u),e(t,r,c,a,o),a.ascend()}v.end(),b.end()})(te,I,I.clone(),L,null),L.reset();let ie=[];if(function t(o,c,u,b,D,O){s(c);let A=c.getComponent(),j=l(b),ee=!1,F=(t,n,r)=>t?e.moveOp(t.getPath(),n.getPath()):e.insertOp(n.getPath(),r.i);if(p(A)){let t=A.d;t!=null&&(_[t]=c.clone());let i=t==null?null:ne[t],s=!1;if(A.i!==void 0||t!=null&&i){let o;j&&(j.i!==void 0||(o=j.d)!=null&&!k[o])&&(s=o==null?n.default(j.i,A.i):t!=null&&t===N[o],s||o!=null&&m!==1&&N[o]!=null||h==null&&(h={type:a.ConflictType.DROP_COLLISION,op1:F(t==null?null:g[t],c,A),op2:F(o==null?null:v[o],b,j)})),s||(O?h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:F(t==null?null:g[t],c,A),op2:e.removeOp(O.getPath())}):(t==null?D.write(`i`,r.default(A.i)):(ie[P]=t,D.write(`d`,i.p=P++)),ee=!0))}else if(t!=null&&!i){let e=E[t];e&&(O=e.clone())}t==null?A.i!==void 0&&(o=u=null,s||(b=null)):(o=g[t],u=x[t],b=T[t])}else f(l(o))&&(o=u=b=null);let te=l(o),I=l(u);if(f(I)){let e=I.p;I.r!==void 0&&(!te||te.r===void 0)||k[e]?(b=null,O=u.clone()):e!=null&&(b=y[e],m!==1&&N[e]!=null||((D=M[e])||(D=M[e]=i.writeCursor()),D.reset(),O=null))}else !p(A)&&p(j)&&(b=null);j=b==null?null:b.getComponent();let L=S(A);if(L){let t=C(A);if(O)h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(c.getPath(),L,t,!0),op2:e.removeOp(O.getPath())});else{let e=S(j),n;if(e){if(L!==e)throw Error(`Transforming incompatible types`);let r=C(j);n=L.transform(t,r,d)}else n=r.default(t);w(D,L,n)}}let ae=0,oe=0,se=0,ce=0,le=0,ue=0,de=o!=null&&o.descendFirst(),R=de,fe=i.advancer(u,void 0,(e,t)=>{f(t)&&se++}),pe=b!=null&&b.descendFirst(),me=pe;for(let e of c)if(typeof e==`number`){let n,r=p(c.getComponent()),i=e-oe;{let e;for(;de&&typeof(e=o.getKey())==`number`;){e+=ae;let t=o.getComponent(),n=f(t);if(e>i||e===i&&(!n||m===0&&r))break;if(n){ae--;let e=t.p;ne[e],N.includes(e),t.d,l(M[t.d]),f(l(M[t.d])),(t.r===void 0||re&&re.has(t))&&(e==null||!ne[e]||m!==1&&N.includes(e))||le--}de=o.nextSibling()}n=de&&e===i?o:null}let a=i-ae,u=fe(a),d=a-se,h=null;{let e,t;for(;pe&&typeof(e=b.getKey())==`number`;){t=e-ce;let n=b.getComponent(),i=p(n);if(t>d)break;if(t===d){if(!i){h=b;break}{if(m===0&&r){h=b;break}let e=u&&f(u.getComponent());if(m===0&&e)break}}if(i){let e=n.d;k[e],N[e],n.i===void 0&&(k[e]||N[e]!=null&&m!==1)?(k[e]||N[e]!=null&&m===0)&&(ce++,ue--):ce++}pe=b.nextSibling()}}let g=d+ce+le+ue;s(g>=0,`trying to descend to a negative index`),D.descend(g),r&&(n=u=h=null,oe++),t(n,c,u,h,D,O)&&ue++,D.ascend()}else{let n;for(;de&&(n=o.getKey(),typeof n!=`string`||!(n>e||n===e));)de=o.nextSibling();let r=de&&n===e?o:null,i=fe(e),a;for(;pe&&(a=b.getKey(),typeof a!=`string`||!(a>e||a===e));)pe=b.nextSibling();let s=pe&&a===e?b:null;D.descend(e),t(r,c,i,s,D,O),D.ascend()}return fe.end(),R&&o.ascend(),me&&b.ascend(),ee}(te,te.clone(),I,I.clone(),L,null),h)return{ok:!1,conflict:h};L.reset();let ae=(e,t,n)=>e.traverse(t,(t,r)=>{t.d!=null&&n(t.d,e,r)});(k.length||j.length)&&(ae(I,L,(e,t,n)=>{k[e]&&!A[e]&&n.write(`r`,!0),j[e]&&n.mergeTree(j[e].get())}),L.reset());let oe=[],se=[];if((M.length||k.length)&&!h){let e=i.readCursor(F(L.get()));if(ae(e,null,(e,t)=>{oe[e]=t.clone()}),M.forEach(e=>{e&&ae(i.readCursor(e.get()),null,(e,t)=>{oe[e]=t.clone()})}),function e(t,n,r,a,s,c){o.prefix++;let u=l(n);if(u&&f(u))if(u.p!=null){s=u;let e=u.p;oe[e].getPath(),r=oe[e],a=se[e]=i.writeCursor()}else u.r!==void 0&&(r=null,c=!0);else p(l(r))&&(r=null);let d=t.getComponent();if(d){let e;if((e=d.d)!=null){let t=M[e];t&&(t.get(),a.mergeTree(t.get()),r=i.readCursor(t.get()))}}let m=0,h=0,g=i.advancer(n,void 0,(e,t)=>{f(t)&&m--}),_=i.advancer(r,(e,t)=>p(t)?-(e-h)-1:e-h,(e,t)=>{p(t)&&h++});for(let n of t)if(typeof n==`number`){let r=g(n),i=n+m,o=_(i),l=i+h;a.descend(l),e(t,r,o,a,s,c),a.ascend()}else a.descend(n),e(t,g(n),_(n),a,s,c),a.ascend();g.end(),_.end()}(I,e,e.clone(),L,null,!1),L.reset(),h)return{ok:!1,conflict:h};if(L.get(),se.length){let e=se.map(e=>e?e.get():null);if(ae(i.readCursor(F(L.get())),L,(t,n,r)=>{let i=e[t];i&&(r.mergeTree(i),e[t]=null)}),e.find(e=>e)){let t=i.writeCursor(),n=i.writeCursor(),r=0,o=0;e.forEach(e=>{e!=null&&ae(i.readCursor(e),null,e=>{let i=ie[e];t.writeMove(g[i].getPath(),_[i].getPath(),r++);let a=ee[i];a&&a.forEach(e=>{k[e]||m!==1&&N[e]!=null||n.writeMove(v[e].getPath(),y[e].getPath(),o++)})})}),h={type:a.ConflictType.BLACKHOLE,op1:t.get(),op2:n.get()}}}}return h?{ok:!1,conflict:h}:{ok:!0,result:L.get()}}let I=e=>{let t=Error(`Transform detected write conflict`);throw t.conflict=e,t.type=t.name=`writeConflict`,t};function L(e,t,n){let r=te(e,t,n);if(r.ok)return r.result;I(r.conflict)}let ne=e=>{let t=i.writeCursor();return i.readCursor(e).traverse(t,(e,t)=>{(p(e)||S(e))&&t.write(`r`,!0)}),t.get()},re=(e,t)=>{let{type:n,op1:r,op2:o}=e;switch(n){case a.ConflictType.DROP_COLLISION:return t===`left`?[null,ne(o)]:[ne(r),null];case a.ConflictType.RM_UNEXPECTED_CONTENT:let e=!1;return i.readCursor(r).traverse(null,t=>{t.r!==void 0&&(e=!0)}),e?[null,ne(o)]:[ne(r),null];case a.ConflictType.BLACKHOLE:return[ne(r),ne(o)];default:throw Error(`Unrecognised conflict: `+n)}};function ie(e,t,n,r){let i=null;for(;;){let a=te(t,n,r);if(a.ok)return j(i,a.result);{let{conflict:o}=a;e(o)||I(o);let[s,c]=re(o,r);t=j(O(t),s),n=j(O(n),c),i=j(i,c)}}}})),Xo=h(f((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!n.hasOwnProperty(r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Yo(),e);var r=Uo();Object.defineProperty(e,`ReadCursor`,{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,`WriteCursor`,{enumerable:!0,get:function(){return r.WriteCursor}});var i=Wo();Object.defineProperty(e,`ConflictType`,{enumerable:!0,get:function(){return i.ConflictType}})}))());let Zo=function(e){return e[e.COVER=0]=`COVER`,e[e.REPLACE=1]=`REPLACE`,e}({}),Qo=function(e){return e.RETAIN=`r`,e.INSERT=`i`,e.DELETE=`d`,e}({}),$o=(0,t.createIdentifier)(`univer.config-service`);var es=class{constructor(){R(this,`_configChanged$`,new r.Subject),R(this,`configChanged$`,this._configChanged$.asObservable()),R(this,`_config`,new Map)}dispose(){this._config.clear(),this._configChanged$.complete()}getConfig(e){return this._config.get(e)}setConfig(e,t,n){var r;let{merge:i=!1}=n||{},a=(r=this._config.get(e))==null?{}:r;a=i?Li(a,t):t,this._config.set(e,a),this._configChanged$.next({[e]:a})}deleteConfig(e){return this._config.delete(e)}subscribeConfigValue$(e){return new r.Observable(t=>{Object.prototype.hasOwnProperty.call(this._config,e)&&t.next(this._config.get(e));let n=this.configChanged$.pipe((0,r.filter)(t=>Object.prototype.hasOwnProperty.call(t,e))).subscribe(n=>t.next(n[e]));return()=>n.unsubscribe()})}};let ts=(0,t.createIdentifier)(`univer.context-service`);var ns=class extends V{constructor(...e){super(...e),R(this,`_contextChanged$`,new r.Subject),R(this,`contextChanged$`,this._contextChanged$.asObservable()),R(this,`_contextMap`,new Map)}dispose(){super.dispose(),this._contextChanged$.complete(),this._contextMap.clear()}getContextValue(e){var t;return(t=this._contextMap.get(e))==null?!1:t}setContextValue(e,t){this._contextMap.set(e,t),this._contextChanged$.next({[e]:t})}subscribeContextValue$(e){return new r.Observable(t=>{let n=this._contextChanged$.pipe((0,r.filter)(t=>t[e]!==void 0)).subscribe(n=>t.next(n[e]));return this._contextMap.has(e)&&t.next(this._contextMap.get(e)),()=>n.unsubscribe()})}};let rs=function(e){return e[e.SILENT=0]=`SILENT`,e[e.ERROR=1]=`ERROR`,e[e.WARN=2]=`WARN`,e[e.INFO=3]=`INFO`,e[e.VERBOSE=4]=`VERBOSE`,e}({}),is=(0,t.createIdentifier)(`univer.log`);var as=class extends V{constructor(...e){super(...e),R(this,`_logLevel`,3),R(this,`_deduction`,new Set)}dispose(){super.dispose(),this._logLevel=3,this._deduction.clear()}debug(...e){this._logLevel>=4&&this._log(console.debug,...e)}log(...e){this._logLevel>=3&&this._log(console.log,...e)}warn(...e){this._logLevel>=2&&this._log(console.warn,...e)}error(...e){this._logLevel>=1&&this._log(console.error,...e)}deprecate(...e){this._logLevel>=2&&this._logWithDeduplication(console.error,...e)}setLogLevel(e){this._logLevel=e}_log(e,...t){let n=t[0];/^\[(.*?)\]/g.test(n)?e(`\x1B[97;104m${n}\x1B[0m`,...t.slice(1)):e(...t)}_logWithDeduplication(e,...t){let n=os(...t);this._deduction.has(n)||(this._deduction.add(n),this._log(e,...t))}};function os(...e){return e.map(e=>JSON.stringify(e)).join(``)}function W(e,t){return function(n,r){t(n,r,e)}}function ss(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let cs=`command.logExecution`,ls=function(e){return e[e.COMMAND=0]=`COMMAND`,e[e.OPERATION=1]=`OPERATION`,e[e.MUTATION=2]=`MUTATION`,e}({}),us=(0,t.createIdentifier)(`univer.core.command-service`);var ds=class{constructor(){R(this,`_commands`,new Map),R(this,`_commandTypes`,new Map)}registerCommand(e){if(this._commands.has(e.id))throw Error(`[CommandRegistry]: command "${e.id}" has been registered before.`);return this._commands.set(e.id,e),this._commandTypes.set(e.id,e.type),B(()=>{this.unregisterCommand(e.id)})}unregisterCommand(e){this._commands.delete(e),this._commandTypes.delete(e)}hasCommand(e){return this._commands.has(e)}getCommand(e){return this._commands.has(e)?[this._commands.get(e)]:null}getCommandType(e){return this._commandTypes.get(e)}};let fs={id:`nil`,type:0,handler:()=>!0},ps=class extends V{constructor(e,t,n){super(),this._injector=e,this._logService=t,this._configService=n,R(this,`_commandRegistry`,void 0),R(this,`_beforeCommandExecutionListeners`,[]),R(this,`_commandExecutedListeners`,[]),R(this,`_collabMutationListeners`,[]),R(this,`_multiCommandDisposables`,new Map),R(this,`_commandExecutingLevel`,0),R(this,`_commandExecutionStack`,[]),this._commandRegistry=new ds,this.registerCommand(fs)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0,this._collabMutationListeners.length=0}disposed(){return this._disposed}hasCommand(e){return this._commandRegistry.hasCommand(e)}registerCommand(e){return this._commandRegistry.registerCommand(e)}unregisterCommand(e){var t;this._commandRegistry.unregisterCommand(e),(t=this._multiCommandDisposables.get(e))==null||t.dispose()}registerMultipleCommand(e){return this._registerMultiCommand(e)}beforeCommandExecuted(e){if(this._beforeCommandExecutionListeners.indexOf(e)===-1)return this._beforeCommandExecutionListeners.push(e),B(()=>{let t=this._beforeCommandExecutionListeners.indexOf(e);this._beforeCommandExecutionListeners.splice(t,1)});throw Error(`[CommandService]: could not add a listener twice.`)}onCommandExecuted(e){if(this._commandExecutedListeners.indexOf(e)===-1)return this._commandExecutedListeners.push(e),B(()=>{let t=this._commandExecutedListeners.indexOf(e);this._commandExecutedListeners.splice(t,1)});throw Error(`[CommandService]: could not add a listener twice.`)}onMutationExecutedForCollab(e){if(this._collabMutationListeners.indexOf(e)===-1)return this._collabMutationListeners.push(e),B(()=>{let t=this._collabMutationListeners.indexOf(e);this._collabMutationListeners.splice(t,1)});throw Error(`[CommandService]: could not add a collab mutation listener twice.`)}async executeCommand(e,t,n){try{let r=this._commandRegistry.getCommand(e);if(r){let[e]=r,i={id:e.id,type:e.type,params:t},a=this._pushCommandExecutionStack(i),o=n==null?{}:n;this._beforeCommandExecutionListeners.forEach(e=>e(i,o));let s=await this._execute(e,t,o);return o.syncOnly||this._commandExecutedListeners.forEach(e=>e(i,o)),e.type===2&&this._collabMutationListeners.forEach(e=>e(i,o)),a.dispose(),s}throw Error(`[CommandService]: command "${e}" is not registered.`)}catch(e){if(e instanceof oe)return!1;throw e}}syncExecuteCommand(e,t,n){try{let i=this._commandRegistry.getCommand(e);if(i){let[e]=i,a={id:e.id,type:e.type,params:t};if(e.type===2){let e=w(this._commandExecutionStack,e=>e.type===0);if(e){var r;a.params=(r=a.params)==null?{}:r,a.params.trigger=e.id}}let o=this._pushCommandExecutionStack(a),s=n==null?{}:n;this._beforeCommandExecutionListeners.forEach(e=>e(a,s));let c=this._syncExecute(e,t,s);return s.syncOnly||this._commandExecutedListeners.forEach(e=>e(a,s)),e.type===2&&this._collabMutationListeners.forEach(e=>e(a,s)),o.dispose(),c}throw Error(`[CommandService]: command "${e}" is not registered.`)}catch(e){if(e instanceof oe)return!1;throw e}}_pushCommandExecutionStack(e){return this._commandExecutionStack.push(e),B(()=>x(this._commandExecutionStack,e))}_registerMultiCommand(e){let t=this._commandRegistry.getCommand(e.id),n;if(!t){n=new ms(e.id);let t=new Qi;t.add(this._commandRegistry.registerCommand(n)),t.add(B(()=>{this._multiCommandDisposables.delete(e.id)})),this._multiCommandDisposables.set(e.id,t)}else if(t[0].multi!==!0)throw Error(`Command has registered as a single command.`);else n=t[0];let r=n.registerImplementation(e);return B(()=>{if(r.dispose(),!n.hasImplementations()){var t;(t=this._multiCommandDisposables.get(e.id))==null||t.dispose()}})}async _execute(e,t,n){if(n!=null&&n.syncOnly)return!0;this._configService.getConfig(`command.logExecution`)!==!1&&this._logService.debug(`[CommandService]`,`${`|-`.repeat(Math.max(this._commandExecutingLevel,0))}executing command "${e.id}"`),this._commandExecutingLevel++;let r;try{r=await this._injector.invoke(e.handler,t,n),this._commandExecutingLevel--}catch(e){throw r=!1,this._commandExecutingLevel=0,e}return r}_syncExecute(e,t,n){if(n!=null&&n.syncOnly)return!0;this._configService.getConfig(`command.logExecution`)!==!1&&this._logService.debug(`[CommandService]`,`${`|-`.repeat(Math.max(0,this._commandExecutingLevel))}executing command "${e.id}".`),this._commandExecutingLevel++;let r;try{if(r=this._injector.invoke(e.handler,t,n),r instanceof Promise)throw TypeError(`[CommandService]: Command handler should not return a promise.`);this._commandExecutingLevel--}catch(e){throw r=!1,this._commandExecutingLevel=0,e}return r}};ps=ss([W(0,(0,t.Inject)(t.Injector)),W(1,is),W(2,$o)],ps);var ms=class{constructor(e){this.id=e,R(this,`name`,void 0),R(this,`multi`,!0),R(this,`type`,0),R(this,`priority`,0),R(this,`_implementations`,[]),R(this,`handler`,async(e,n)=>{if(!this._implementations.length)return!1;let r=e.get(is),i=e.get(ts),a=e.get(t.Injector);for(let e of this._implementations){let t=e.command.preconditions;if((!t||t&&t(i))&&(r.debug(`[MultiCommand]`,`executing implementation "${e.command.name}".`),await a.invoke(e.command.handler,n)))return!0}return!1}),this.name=e}registerImplementation(e){let t={command:e};return this._implementations.push(t),this._implementations.sort((e,t)=>t.command.priority-e.command.priority),B(()=>{let e=this._implementations.indexOf(t);this._implementations.splice(e,1)})}hasImplementations(){return this._implementations.length>0}};function hs(e,t,n){return Yi(e.map(e=>()=>t.syncExecuteCommand(e.id,e.params,n)))}function gs(e,t,n){return Ji(e.map(e=>()=>t.executeCommand(e.id,e.params,n)))}function _s(e){return new r.Observable(t=>{let n=e((...e)=>t.next(e));return()=>n==null?void 0:n.dispose()})}function vs(e){return function(t){return new r.Observable(n=>(t.subscribe({next:t=>{n.next(t),e(t)&&n.complete()},complete:()=>n.complete(),error:e=>n.error(e)}),()=>n.unsubscribe()))}}function ys(e=0){return t=>{let n=[];return t.pipe((0,r.tap)(e=>n.push(e)),(0,r.debounceTime)(e),(0,r.map)(()=>n),(0,r.tap)(()=>n=[]))}}function bs(e){let t=new r.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe((0,r.take)(1))}function xs(e,t){let n=new r.BehaviorSubject(t);return e.subscribe(n),n}let Ss=e=>new Promise(t=>{(0,r.merge)(_s(e.onCommandExecuted.bind(e)).pipe((0,i.filter)(([e])=>e.type===2)),(0,r.timer)(300)).pipe((0,i.debounceTime)(16),(0,i.first)()).subscribe(()=>{t()})});function Cs(e,t){let n=0,r=e.length-1;if(t<e[0])return 0;if(t>=e[e.length-1])return e.length-1;for(;n<=r;){if(e[n]===t){for(;n<e.length&&e[n]===t;)n++;return n}if(t>e[n]&&t<e[n+1])return n+1;if(e[r]===t){for(;r<e.length&&e[r]===t;)r++;return r}if(t>e[r-1]&&t<e[r])return r;n++,r--}return-1}function ws(e,t){let n=0,r=e.length-1;for(;n<=r;){let i=Math.floor((r+n)/2);if(t<e[i]&&(i===0||t>=e[i-1]))return i;if(t>=e[i])n=i+1;else if(t<e[i])r=i-1;else return-1}return-1}function Ts(e,t){let n=0,r=e.length;for(;n<r;){let i=Math.floor((n+r)/2);e[i]<=t?n=i+1:r=i}return n<e.length?n:e.length-1}function Es(e,t,n=!1){let r=e.length-1;if(t<0||t<e[0])return 0;if(r=e.length<40||t<=e[20]||t>=e[r-20]?Cs(e,t):Ts(e,t),n){let t=e[r];return e.indexOf(t)}return r}function Ds(e){let t=new Blob([e],{type:`text/javascript`});return window.URL.createObjectURL(t)}function Os(e,t){if(t==null||e==null)return!0;let{left:n=0,top:r=0,height:i=0,width:a=0,angle:o=0}=t,{left:s=0,top:c=0,height:l=0,width:u=0,angle:d=0}=e,f=u,p=l,m=a,h=i;return Math.abs(s-n)>2||Math.abs(c-r)>2||Math.abs(f-m)>2||Math.abs(p-h)>2||Math.abs(d-o)>1}let ks={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],darkyellow:[139,128,0],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]};var As=class e{static mix(t,n,r){var i,a;r=Math.min(1,Math.max(0,r));let o=new e(t).toRgb(),s=new e(n).toRgb(),c=(i=o.a)==null?1:i,l=(a=s.a)==null?1:a;return new e({r:(s.r-o.r)*r+o.r,g:(s.g-o.g)*r+o.g,b:(s.b-o.b)*r+o.b,a:(l-c)*r+c})}static getContrastRatio(t,n){let r=new e(t).getLuminance(),i=new e(n).getLuminance();return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}constructor(t){if(R(this,`_color`,void 0),R(this,`_rgbColor`,void 0),R(this,`_isValid`,!1),t==null){this._setNullColor();return}if(t instanceof e){this._color={...t._color},this._rgbColor={...t._rgbColor};return}let n=Ns(t);if(n==null){this._setNullColor();return}this._color=n;let r=Rs(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){let{r:e,g:t,b:n,a:r=1}=this.toRgb(),i=r<1;return`rgb${i?`a`:``}(${e},${t},${n}${i?`,${r}`:``})`}toString(){return this.toRgbString()}toHexString(e){let{r:t,g:n,b:r,a:i=1}=this.toRgb(),a=i<1,o=[js(Math.round(t).toString(16)),js(Math.round(n).toString(16)),js(Math.round(r).toString(16)),js(Math.round(i*255).toString(16))];return e&&o[0][0]===o[0][1]&&o[1][0]===o[1][1]&&o[2][0]===o[2][1]&&o[3][0]===o[3][1]?a?`#${o[0][0]}${o[1][0]}${o[2][0]}${o[3][0]}`:`#${o[0][0]}${o[1][0]}${o[2][0]}`:a?`#${o[0]}${o[1]}${o[2]}${o[3]}`:`#${o[0]}${o[1]}${o[2]}`}toHsv(){return Us(this.toRgb())}toHsl(){return Hs(this.toRgb())}lighten(t=10){let n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new e(n)}darken(t=10){let n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new e(n)}setAlpha(t){return new e({...this._rgbColor,a:t})}getLuminance(){let{r:e,g:t,b:n}=this.toRgb();return e=Ms(e),t=Ms(t),n=Ms(n),Number((.2126*e+.7152*t+.0722*n).toFixed(3))}getBrightness(){let{r:e,g:t,b:n}=this.toRgb();return(e*299+t*587+n*114)/1e3}getAlpha(){var e;return(e=this._color.a)==null?1:e}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}}};let js=e=>e.length===1?`0${e}`:e,Ms=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),Ns=e=>{if(Gs(e)){if(`r`in e){let t={r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)};return e.a!==void 0&&(t.a=e.a),t}if(`l`in e){let t={h:Math.round(e.h),s:e.s,l:e.l};return e.a!==void 0&&(t.a=e.a),t}let t={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(t.a=e.a),t}let t=e.trim().toLowerCase();if(ks[t]){let e=ks[t],n={r:Math.round(e[0]),g:Math.round(e[1]),b:Math.round(e[2])};return n.a=e[3]||1,n}if(t.startsWith(`#`))return Ps(t);if(t.startsWith(`rgb`))return Fs(t);if(t.startsWith(`hsl`))return Is(t);if(t.startsWith(`hsv`))return Ls(t)},Ps=e=>{let t=e.substring(1),n=RegExp(`.{1,${t.length>=6?2:1}}`,`g`),r=t.match(n);if(!r||r.length<3)throw Error(`The color '${e}' is illegal hex color`);r[0].length===1&&(r=r.map(e=>e+e));let i={r:Number.parseInt(r[0],16),g:Number.parseInt(r[1],16),b:Number.parseInt(r[2],16)};return r.length>3&&(i.a=Number.parseInt(r[3],16)/255),i},Fs=e=>{let t=e.indexOf(`(`);if(t===-1)throw Error(`The color '${e}' is illegal rgb color`);let n=e.substring(t+1,e.length-1).split(`,`);if(n.length<3)throw Error(`The color '${e}' is illegal rgb color`);let r={r:Number.parseInt(n[0],10),g:Number.parseInt(n[1],10),b:Number.parseInt(n[2],10)};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Is=e=>{let t=e.indexOf(`(`);if(t===-1)throw Error(`The color '${e}' is illegal hsl color`);let n=e.substring(t+1,e.length-1).split(`,`);if(n.length<3)throw Error(`The color '${e}' is illegal hsl color`);let r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),l:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Ls=e=>{let t=e.indexOf(`(`);if(t===-1)throw Error(`The color '${e}' is illegal hsv color`);let n=e.substring(t+1,e.length-1).split(`,`);if(n.length<3)throw Error(`The color '${e}' is illegal hsv color`);let r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),v:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Rs=e=>{let t=Ns(e);if(t!=null)return`r`in t?t:`l`in t?Bs(t):Vs(t)},zs=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),Bs=e=>{let{h:t,s:n,l:r}=e;t/=360,n/=100,r/=100;let i=0,a=0,o=0;if(n===0)i=a=o=r;else{let e=r<.5?r*(1+n):r+n-r*n,s=2*r-e;i=zs(s,e,t+1/3),a=zs(s,e,t),o=zs(s,e,t-1/3)}let s={r:Math.round(i*255),g:Math.round(a*255),b:Math.round(o*255)};return e.a!==void 0&&(s.a=e.a),s},Vs=e=>{let{h:t,s:n,v:r}=e;t=t/360*6,n/=100,r/=100;let i=Math.floor(t),a=t-i,o=r*(1-n),s=r*(1-a*n),c=r*(1-(1-a)*n),l=i%6,u=[r,s,o,o,c,r][l],d=[c,r,r,s,o,o][l],f=[o,o,c,r,r,s][l],p={r:u*255,g:d*255,b:f*255};return e.a!==void 0&&(p.a=e.a),p},Hs=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;let i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c;if(i===a)s=c=0;else{let e=i-a;switch(c=o>.5?e/(2-i-a):e/(i+a),i){case t:s=(n-r)/e+(n<r?6:0);break;case n:s=(r-t)/e+2;break;default:s=(t-n)/e+4;break}s/=6}let l={h:Math.round(s*360),s:Math.round(c*100),l:Math.round(o*100)};return e.a!==void 0&&(l.a=e.a),l},Us=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;let i=Math.max(t,n,r),a=Math.min(t,n,r),o,s=i,c=i-a,l=i===0?0:c/i;if(i===a)o=0;else{switch(i){case t:o=(n-r)/c+(n<r?6:0);break;case n:o=(r-t)/c+2;break;default:o=(t-n)/c+4;break}o/=6}let u={h:Math.round(o*360),s:Math.round(l*100),v:Math.round(s*100)};return e.a!==void 0&&(u.a=e.a),u},Ws=e=>e==null,Gs=e=>!Ws(e)&&typeof e==`object`;function Ks(e){return!!(/^#(?:[0]{3}|[0]{6})\b/.test(e)||/^rgb\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*\)$/.test(e)||/^rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e)||/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*\)$/.test(e)||/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e))}function qs(e){return!!(/^#(?:[Ff]{3}|[Ff]{6})\b/.test(e)||/^rgb\s*\(\s*255\s*,\s*255\s*,\s*255\s*\)$/.test(e)||/^rgba\s*\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e)||/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*\)$/.test(e)||/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e))}function Js(e){return e&&(e.s!==void 0||e.p!==void 0||e.v!==void 0||e.t!==void 0||e.f!==void 0||e.si!==void 0||e.custom!==void 0)}function Ys(e){if(e.t!==void 0)return e.t;if(typeof e.v==`string`)return 1;if(typeof e.v==`number`)return 2;if(typeof e.v==`boolean`)return 3}function Xs(e){if(e==null)return!0;let{v:t,f:n,si:r,p:i,custom:a}=e;return!(!(t==null||typeof t==`string`&&t.length===0)||n!=null&&n.length>0||r!=null&&r.length>0||i!=null||a!=null)}function Zs(e){return e!=null&&(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)}let Qs=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.ROW=1]=`ROW`,e[e.COLUMN=2]=`COLUMN`,e[e.ALL=3]=`ALL`,e}({}),$s=function(e){return e[e.NONE=0]=`NONE`,e[e.ROW=1]=`ROW`,e[e.COLUMN=2]=`COLUMN`,e[e.ALL=3]=`ALL`,e}({});function ec(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}let tc=function(e){return e.NONE=`none`,e.BACKWARD=`backward`,e.FORWARD=`forward`,e}({}),nc=function(e){return e.RECT=`RECT`,e.TEXT=`TEXT`,e}({});function rc(e,t,n){let r=!1,i=!1,a=e,o=t,s=e,c=t;if(n==null)return{actualRow:e,actualColumn:t,isMergedMainCell:i,isMerged:r,endRow:a,endColumn:o,startRow:s,startColumn:c};for(let l=0;l<n.length;l++){let{startRow:u,endRow:d,startColumn:f,endColumn:p}=n[l];if(e===u&&t===f){a=d,o=p,s=u,c=f,i=!0;break}if(e>=u&&e<=d&&t>=f&&t<=p){a=d,o=p,s=u,c=f,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:i,isMerged:r,endRow:a,endColumn:o,startRow:s,startColumn:c}}let ic=function(e){return e.Raw=`raw`,e.Intercepted=`intercepted`,e.Both=`both`,e}({}),ac={Office:{4:`#4472C4`,5:`#ED7D31`,6:`#A5A5A5`,7:`#70AD47`,8:`#5B9BD5`,9:`#70AD47`,0:`#000000`,2:`#44546A`,1:`#FFFFFF`,3:`#E7E6E6`,10:`#0563C1`,11:`#954F72`}},oc=`general`,sc=`hash`,cc=`zero`,lc=`qmark`,uc=`slash`,dc=`group`,fc=`scale`,pc=`comma`,mc=`break`,hc=`text`,gc=`plus`,_c=`minus`,vc=`point`,yc=`space`,bc=`percent`,xc=`digit`,Sc=`calendar`,Cc=`error`,wc=`datetime`,Tc=`duration`,Ec=`condition`,Dc=`dbnum`,Oc=`natnum`,kc=`locale`,Ac=`color`,jc=`modifier`,Mc=`ampm`,Nc=`escaped`,Pc=`string`,Fc=`skip`,Ic=`fill`,Lc=`paren`,Rc=`char`,zc=`#000000.#FFFFFF.#FF0000.#00FF00.#0000FF.#FFFF00.#FF00FF.#00FFFF.#800000.#008000.#000080.#808000.#800080.#008080.#C0C0C0.#808080.#9999FF.#993366.#FFFFCC.#CCFFFF.#660066.#FF8080.#0066CC.#CCCCFF.#000080.#FF00FF.#FFFF00.#00FFFF.#800080.#800000.#008080.#0000FF.#00CCFF.#CCFFFF.#CCFFCC.#FFFF99.#99CCFF.#FF99CC.#CC99FF.#FFCC99.#3366FF.#33CCCC.#99CC00.#FFCC00.#FF9900.#FF6600.#666699.#969696.#003366.#339966.#003300.#333300.#993300.#993366.#333399.#333333`.split(`.`),Bc=`¤.$.£.¥.֏.؋.৳.฿.៛.₡.₦.₩.₪.₫.€.₭.₮.₱.₲.₴.₸.₹.₺.₼.₽.₾.₿`.split(`.`),Vc=RegExp(`[`+Bc.join(``)+`]`);var Hc=Object.freeze({1078:`af`,1052:`sq`,1118:`am`,5121:`ar_DZ`,15361:`ar_BH`,3073:`ar_EG`,2049:`ar_IQ`,11265:`ar_JO`,13313:`ar_KW`,12289:`ar_LB`,4097:`ar_LY`,6145:`ar_MA`,8193:`ar_OM`,16385:`ar_QA`,1025:`ar_SA`,10241:`ar_SY`,7169:`ar_TN`,14337:`ar_AE`,9217:`ar_YE`,1067:`hy`,1101:`as`,2092:`az_AZ`,1068:`az_AZ`,1069:`eu`,1059:`be`,2117:`bn`,1093:`bn_IN`,5146:`bs`,1026:`bg`,1109:`my`,1027:`ca`,2052:`zh_CN`,3076:`zh_HK`,5124:`zh_MO`,4100:`zh_SG`,1028:`zh_TW`,1050:`hr`,1029:`cs`,1030:`da`,1125:`dv`,2067:`nl_BE`,1043:`nl_NL`,1126:`bin`,3081:`en_AU`,10249:`en_BZ`,4105:`en_CA`,9225:`en_CB`,2057:`en_GB`,16393:`en_IN`,6153:`en_IE`,8201:`en_JM`,5129:`en_NZ`,13321:`en_PH`,7177:`en_ZA`,11273:`en_TT`,1033:`en_US`,12297:`en_ZW`,1061:`et`,1071:`mk`,1080:`fo`,1065:`fa`,1124:`fil`,1035:`fi`,2060:`fr_BE`,11276:`fr_CM`,3084:`fr_CA`,9228:`fr_CG`,12300:`fr_CI`,1036:`fr_FR`,5132:`fr_LU`,13324:`fr_ML`,6156:`fr_MC`,14348:`fr_MA`,10252:`fr_SN`,4108:`fr_CH`,7180:`fr`,1122:`fy_NL`,2108:`gd_IE`,1084:`gd`,1110:`gl`,1079:`ka`,3079:`de_AT`,1031:`de_DE`,5127:`de_LI`,4103:`de_LU`,2055:`de_CH`,1032:`el`,1140:`gn`,1095:`gu`,1279:`en`,1037:`he`,1081:`hi`,1038:`hu`,1039:`is`,1136:`ig_NG`,1057:`id`,1040:`it_IT`,2064:`it_CH`,1041:`ja`,1099:`kn`,1120:`ks`,1087:`kk`,1107:`km`,1111:`kok`,1042:`ko`,1088:`ky`,1108:`lo`,1142:`la`,1062:`lv`,1063:`lt`,2110:`ms_BN`,1086:`ms_MY`,1100:`ml`,1082:`mt`,1112:`mni`,1153:`mi`,1102:`mr`,1104:`mn`,2128:`mn`,1121:`ne`,1044:`no_NO`,2068:`no_NO`,1096:`or`,1045:`pl`,1046:`pt_BR`,2070:`pt_PT`,1094:`pa`,1047:`rm`,2072:`ro_MO`,1048:`ro_RO`,1049:`ru`,2073:`ru_MO`,1083:`se`,1103:`sa`,3098:`sr_SP`,2074:`sr_SP`,1072:`st`,1074:`tn`,1113:`sd`,1115:`si`,1051:`sk`,1060:`sl`,1143:`so`,1070:`sb`,11274:`es_AR`,16394:`es_BO`,13322:`es_CL`,9226:`es_CO`,5130:`es_CR`,7178:`es_DO`,12298:`es_EC`,17418:`es_SV`,4106:`es_GT`,18442:`es_HN`,2058:`es_MX`,19466:`es_NI`,6154:`es_PA`,15370:`es_PY`,10250:`es_PE`,20490:`es_PR`,1034:`es_ES`,14346:`es_UY`,8202:`es_VE`,1089:`sw`,2077:`sv_FI`,1053:`sv_SE`,1114:`syc`,1064:`tg`,1097:`ta`,1092:`tt`,1098:`te`,1054:`th`,1105:`bo`,1073:`ts`,1055:`tr`,1090:`tk`,1058:`uk`,1056:`ur`,2115:`uz_UZ`,1091:`uz_UZ`,1075:`ve`,1066:`vi`,1106:`cy`,1076:`xh`,1085:`yi`,1077:`zu`});let Uc=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,Wc={},G=(e,t=``)=>e.replace(/~/g,t).split(`;`),K=(e,t=0,n=0)=>(e.mmm||(e.mmm=t<1?e.mmmm.concat():e.mmmm.map(e=>{let n=e.slice(0,t%10);return n+(t<10||e===n?``:`.`)})),e.ddd||(e.ddd=n<1?e.dddd.concat():e.dddd.map(e=>{let t=e.slice(0,n%10);return t+(n<10||e===t?``:`.`)})),!e.mmm6&&e.mmmm6&&(e.mmm6=e.mmmm6),e),Gc={group:`\xA0`,decimal:`.`,positive:`+`,negative:`-`,percent:`%`,exponent:`E`,nan:`NaN`,infinity:`∞`,ampm:G(`AM;PM`),mmmm6:G(`Muharram;Safar;Rabiʻ I;Rabiʻ II;Jumada I;Jumada II;Rajab;Shaʻban;Ramadan;Shawwal;Dhuʻl-Qiʻdah;Dhuʻl-Hijjah`),mmm6:G(`Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhuʻl-Q.;Dhuʻl-H.`),mmmm:G(`January;February;March;April;May;June;July;August;September;October;November;December`),mmm:G(`Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec`),dddd:G(`Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday`),ddd:G(`Sun;Mon;Tue;Wed;Thu;Fri;Sat`),bool:G(`TRUE;FALSE`),preferMDY:!1};function Kc(e){let t=Uc.exec(e);if(!t)throw SyntaxError(`Malformed locale: ${e}`);return{lang:t[1]+(t[2]?`_`+t[2]:``),language:t[1],territory:t[2]||``}}function qc(e){if(typeof e==`number`)return Hc[e&65535]||null;let t=parseInt(e,16);return isFinite(t)&&Hc[t&65535]?Hc[t&65535]||null:Uc.test(e)?e:null}function Jc(e){let t=qc(e),n=null;if(t){let e=Kc(t);n=Wc[e.lang]||Wc[e.language]||null}return n}function Yc(e){return Object.assign({},Gc,e)}function q(e,t){let n=typeof t==`object`?t:Kc(t);return Wc[n.lang]=Yc(e),n.language!==n.lang&&!Wc[n.language]&&(Wc[n.language]=Yc(e)),Wc[n.lang]}let Xc=Yc({group:`,`,preferMDY:!0});Xc.isDefault=!0,q({group:`,`,ampm:G(`上午;下午`),mmmm:G(`一月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月`),mmm:G(`1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月`),dddd:G(`~日;~一;~二;~三;~四;~五;~六`,`星期`),ddd:G(`周日;周一;周二;周三;周四;周五;周六`)},`zh_CN`);let Zc={group:`,`,ampm:G(`上午;下午`),mmmm:G(`1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月`),mmm:G(`1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月`),dddd:G(`~日;~一;~二;~三;~四;~五;~六`,`星期`),ddd:G(`周日;周一;周二;周三;周四;周五;周六`)};q({...Zc,nan:`非數值`,dddd:G(`~日;~一;~二;~三;~四;~五;~六`,`星期`)},`zh_TW`),q({...Zc,dddd:G(`~日;~一;~二;~三;~四;~五;~六`,`星期`)},`zh_HK`),q({...Zc,ampm:G(`午前;午後`),dddd:G(`日~;月~;火~;水~;木~;金~;土~`,`曜日`),ddd:G(`日;月;火;水;木;金;土`)},`ja`),q({group:`,`,ampm:G(`오전;오후`),mmmm:G(`1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월`),mmm:G(`1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월`),dddd:G(`일요일;월요일;화요일;수요일;목요일;금요일;토요일`),ddd:G(`일;월;화;수;목;금;토`)},`ko`),q({group:`,`,ampm:G(`ก่อนเที่ยง;หลังเที่ยง`),mmmm:G(`มกร~;กุมภาพันธ์;มีน~;เมษายน;พฤษภ~;มิถุนายน;กรกฎ~;สิงห~;กันยายน;ตุล~;พฤศจิกายน;ธันว~`,`าคม`),mmm:G(`ม.ค.;ก.พ.;มี.ค.;เม.ย.;พ.ค.;มิ.ย.;ก.ค.;ส.ค.;ก.ย.;ต.ค.;พ.ย.;ธ.ค.`),dddd:G(`วันอาทิตย์;วันจันทร์;วันอังคาร;วันพุธ;วันพฤหัสบดี;วันศุกร์;วันเสาร์`),ddd:G(`อา.;จ.;อ.;พ.;พฤ.;ศ.;ส.`)},`th`),q(K({decimal:`,`,ampm:G(`dop.;odp.`),mmmm:G(`ledna;února;března;dubna;května;června;července;srpna;září;října;listopadu;prosince`),mmm:G(`I;II;III;IV;V;VI;VII;VIII;IX;X;XI;XII`),dddd:G(`neděle;pondělí;úterý;středa;čtvrtek;pátek;sobota`),bool:G(`PRAVDA;NEPRAVDA`)},-1,2),`cs`),q(K({group:`.`,decimal:`,`,mmmm:G(`januar;februar;marts;april;maj;juni;juli;august;september;oktober;november;december`),dddd:G(`søn~;man~;tirs~;ons~;tors~;fre~;lør~`,`dag`),bool:G(`SAND;FALSK`)},13,13),`da`),q(K({group:`.`,decimal:`,`,ampm:G(`a.m.;p.m.`),mmmm:G(`januari;februari;maart;april;mei;juni;juli;augustus;september;oktober;november;december`),mmm:G(`jan.;feb.;mrt.;apr.;mei;jun.;jul.;aug.;sep.;okt.;nov.;dec.`),dddd:G(`zondag;maandag;dinsdag;woensdag;donderdag;vrijdag;zaterdag`),bool:G(`WAAR;ONWAAR`)},-1,2),`nl`),q({group:`,`,preferMDY:!0},`en`),q({group:`,`,preferMDY:!0},`en_US`),q({group:`,`},`en_AU`),q({group:`,`},`en_CA`),q({group:`,`},`en_GB`),q({group:`,`,mmm:G(`Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sept;Oct;Nov;Dec`)},`en_IE`),q(K({decimal:`,`,nan:`epäluku`,ampm:G(`ap.;ip.`),mmmm:G(`tammi~;helmi~;maalis~;huhti~;touko~;kesä~;heinä~;elo~;syys~;loka~;marras~;joulu~`,`kuuta`),mmm:G(`tammik.;helmik.;maalisk.;huhtik.;toukok.;kesäk.;heinäk.;elok.;syysk.;lokak.;marrask.;jouluk.`),dddd:G(`sunnun~;maanan~;tiis~;keskiviikkona;tors~;perjan~;lauan~`,`taina`),bool:G(`TOSI;EPÄTOSI`)},-1,2),`fi`);let Qc=K({group:` `,decimal:`,`,mmmm:G(`janvier;février;mars;avril;mai;juin;juillet;août;septembre;octobre;novembre;décembre`),mmm:G(`janv.;févr.;mars;avr.;mai;juin;juil.;août;sept.;oct.;nov.;déc.`),dddd:G(`~manche;lun~;mar~;mercre~;jeu~;vendre~;same~`,`di`),bool:G(`VRAI;FAUX`)},-1,13);q({...Qc},`fr`),q({...Qc,mmm:G(`janv.;févr.;mars;avr.;mai;juin;juill.;août;sept.;oct.;nov.;déc.`)},`fr_CA`),q({group:`'`,decimal:`.`,...Qc},`fr_CH`);let $c=K({mmmm:G(`Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember`),mmm:G(`Jan.;Feb.;März;Apr.;Mai;Juni;Juli;Aug.;Sept.;Okt.;Nov.;Dez.`),dddd:G(`Sonn~;Mon~;Diens~;Mittwoch;Donners~;Frei~;Sams~`,`tag`),bool:G(`WAHR;FALSCH`)},-1,12);q({group:`.`,decimal:`,`,...$c},`de`),q({group:`'`,decimal:`.`,...$c},`de_CH`),q(K({group:`.`,decimal:`,`,ampm:G(`π.μ.;μ.μ.`),mmmm:G(`Ιανουαρ~;Φεβρουαρ~;Μαρτ~;Απριλ~;Μαΐου;Ιουν~;Ιουλ~;Αυγούστου;Σεπτεμβρ~;Οκτωβρ~;Νοεμβρ~;Δεκεμβρ~`,`ίου`),mmm:G(`Ιαν;Φεβ;Μαρ;Απρ;Μαΐ;Ιουν;Ιουλ;Αυγ;Σεπ;Οκτ;Νοε;Δεκ`),dddd:G(`Κυριακή;Δευτέρα;Τρίτη;Τετάρτη;Πέμπτη;Παρασκευή;Σάββατο`)},-1,3),`el`),q({decimal:`,`,ampm:G(`de.;du.`),mmmm:G(`január;február;március;április;május;június;július;augusztus;szeptember;október;november;december`),mmm:G(`jan.;febr.;márc.;ápr.;máj.;jún.;júl.;aug.;szept.;okt.;nov.;dec.`),dddd:G(`vasárnap;hétfő;kedd;szerda;csütörtök;péntek;szombat`),ddd:G(`V;H;K;Sze;Cs;P;Szo`),bool:G(`IGAZ;HAMIS`)},`hu`),q(K({group:`.`,decimal:`,`,ampm:G(`f.h.;e.h.`),mmmm:G(`janúar;febrúar;mars;apríl;maí;júní;júlí;ágúst;september;október;nóvember;desember`),dddd:G(`sunnu~;mánu~;þriðju~;miðviku~;fimmtu~;föstu~;laugar~`,`dagur`)},13,13),`is`),q(K({group:`.`,decimal:`,`,mmmm:G(`Januari;Februari;Maret;April;Mei;Juni;Juli;Agustus;September;Oktober;November;Desember`),dddd:G(`Minggu;Senin;Selasa;Rabu;Kamis;Jumat;Sabtu`)},3,3),`id`);let el=K({mmmm:G(`gennaio;febbraio;marzo;aprile;maggio;giugno;luglio;agosto;settembre;ottobre;novembre;dicembre`),dddd:G(`domenica;lunedì;martedì;mercoledì;giovedì;venerdì;sabato`),bool:G(`VERO;FALSO`)},3,3);q({group:`.`,decimal:`,`,...el},`it`),q({group:`'`,decimal:`.`,...el},`it_CH`);let tl={decimal:`,`,ampm:G(`a.m.;p.m.`),mmmm:G(`januar;februar;mars;april;mai;juni;juli;august;september;oktober;november;desember`),mmm:G(`jan.;feb.;mar.;apr.;mai;jun.;jul.;aug.;sep.;okt.;nov.;des.`),dddd:G(`søn~;man~;tirs~;ons~;tors~;fre~;lør~`,`dag`),bool:G(`SANN;USANN`)};q(K({...tl},-1,13),`nb`),q(K({...tl},-1,13),`no`),q(K({decimal:`,`,mmmm:G(`stycznia;lutego;marca;kwietnia;maja;czerwca;lipca;sierpnia;września;października;listopada;grudnia`),dddd:G(`niedziela;poniedziałek;wtorek;środa;czwartek;piątek;sobota`),ddd:G(`niedz.;pon.;wt.;śr.;czw.;pt.;sob.`),bool:G(`PRAWDA;FAŁSZ`)},3,-1),`pl`);let nl={group:`.`,decimal:`,`,mmmm:G(`janeiro;fevereiro;março;abril;maio;junho;julho;agosto;setembro;outubro;novembro;dezembro`),dddd:G(`domingo;segunda-feira;terça-feira;quarta-feira;quinta-feira;sexta-feira;sábado`),bool:G(`VERDADEIRO;FALSO`)};q(K(nl,13,13),`pt`),q(K(nl,13,13),`pt_BR`),q({decimal:`,`,nan:`не\xA0число`,mmmm:G(`января;февраля;марта;апреля;мая;июня;июля;августа;сентября;октября;ноября;декабря`),mmm:G(`янв.;февр.;мар.;апр.;мая;июн.;июл.;авг.;сент.;окт.;нояб.;дек.`),dddd:G(`воскресенье;понедельник;вторник;среда;четверг;пятница;суббота`),ddd:G(`вс;пн;вт;ср;чт;пт;сб`),mmmm6:G(`рамадан;шавваль;зуль-каада;зуль-хиджжа;мухаррам;раби-уль-авваль;раби-уль-ахир;джумад-уль-авваль;джумад-уль-ахир;раджаб;шаабан;рамадан`),mmm6:G(`рам.;шав.;зуль-к.;зуль-х.;мух.;раб. I;раб. II;джум. I;джум. II;радж.;шааб.;рам.`),bool:G(`ИСТИНА;ЛОЖЬ`)},`ru`),q(K({decimal:`,`,mmmm:G(`januára;februára;marca;apríla;mája;júna;júla;augusta;septembra;októbra;novembra;decembra`),dddd:G(`nedeľa;pondelok;utorok;streda;štvrtok;piatok;sobota`)},3,2),`sk`);let rl={group:`.`,decimal:`,`,ampm:G(`a.\xA0m.;p.\xA0m.`),mmmm:G(`enero;febrero;marzo;abril;mayo;junio;julio;agosto;septiem~;octu~;noviem~;diciem~`,`bre`),mmm:G(`ene;feb;mar;abr;may;jun;jul;ago;sept;oct;nov;dic`),dddd:G(`domingo;lunes;martes;miércoles;jueves;viernes;sábado`),ddd:G(`dom;lun;mar;mié;jue;vie;sáb`),bool:G(`VERDADERO;FALSO`)},il=G(`ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic`),al=G(`ene.;feb.;mar.;abr.;may.;jun.;jul.;ago.;sept.;oct.;nov.;dic.`);q({...rl},`es`),q({...rl},`es_AR`),q({...rl},`es_BO`),q({...rl},`es_CL`),q({...rl},`es_CO`),q({...rl},`es_EC`),q({...rl,mmm:il,ampm:G(`a.m.;p.m.`)},`es_MX`),q({...rl,mmm:al},`es_PY`),q({...rl,mmm:al},`es_UY`),q({...rl,mmm:al,mmmm:G(`enero;febrero;marzo;abril;mayo;junio;julio;agosto;setiembre;octubre;noviembre;diciembre`)},`es_VE`),q({decimal:`,`,ampm:G(`fm;em`),mmmm:G(`januari;februari;mars;april;maj;juni;juli;augusti;september;oktober;november;december`),mmm:G(`jan.;feb.;mars;apr.;maj;juni;juli;aug.;sep.;okt.;nov.;dec.`),dddd:G(`sön~;mån~;tis~;ons~;tors~;fre~;lör~`,`dag`),ddd:G(`sön;mån;tis;ons;tors;fre;lör`)},`sv`),q(K({group:`.`,decimal:`,`,ampm:G(`ÖÖ;ÖS`),mmmm:G(`Ocak;Şubat;Mart;Nisan;Mayıs;Haziran;Temmuz;Ağustos;Eylül;Ekim;Kasım;Aralık`),mmm:G(`Oca;Şub;Mar;Nis;May;Haz;Tem;Ağu;Eyl;Eki;Kas;Ara`),dddd:G(`Pazar;Pazartesi;Salı;Çarşamba;Perşembe;Cuma;Cumartesi`),ddd:G(`Paz;Pzt;Sal;Çar;Per;Cum;Cmt`),bool:G(`DOĞRU;YANLIŞ`)},3,-1),`tr`),q({group:`,`,ampm:G(`yb;yh`),mmmm:G(`Ionawr;Chwefror;Mawrth;Ebrill;Mai;Mehefin;Gorffennaf;Awst;Medi;Hydref;Tachwedd;Rhagfyr`),mmm:G(`Ion;Chwef;Maw;Ebr;Mai;Meh;Gorff;Awst;Medi;Hyd;Tach;Rhag`),dddd:G(`Dydd Sul;Dydd Llun;Dydd Mawrth;Dydd Mercher;Dydd Iau;Dydd Gwener;Dydd Sadwrn`),ddd:G(`Sul;Llun;Maw;Mer;Iau;Gwen;Sad`)},`cy`),q({group:`.`,decimal:`,`,mmmm:G(`yanvar;fevral;mart;aprel;may;iyun;iyul;avqust;sentyabr;oktyabr;noyabr;dekabr`),mmm:G(`yan;fev;mar;apr;may;iyn;iyl;avq;sen;okt;noy;dek`),dddd:G(`bazar;bazar ertəsi;çərşənbə axşamı;çərşənbə;cümə axşamı;cümə;şənbə`),ddd:G(`B.;B.e.;Ç.a.;Ç.;C.a.;C.;Ş.`)},`az`),q(K({decimal:`,`,mmmm:G(`студзеня;лютага;сакавіка;красавіка;мая;чэрвеня;ліпеня;жніўня;верасня;кастрычніка;лістапада;снежня`),dddd:G(`нядзеля;панядзелак;аўторак;серада;чацвер;пятніца;субота`),ddd:G(`нд;пн;аў;ср;чц;пт;сб`)},3,-1),`be`),q({decimal:`,`,ampm:G(`пр.об.;сл.об.`),mmmm:G(`януари;февруари;март;април;май;юни;юли;август;септември;октомври;ноември;декември`),mmm:G(`яну;фев;март;апр;май;юни;юли;авг;сеп;окт;ное;дек`),dddd:G(`неделя;понеделник;вторник;сряда;четвъртък;петък;събота`),ddd:G(`нд;пн;вт;ср;чт;пт;сб`),bool:G(`ИСТИНА;ЛОЖЬ`)},`bg`),q({group:`.`,decimal:`,`,mmmm:G(`de gener;de febrer;de març;d’abril;de maig;de juny;de juliol;d’agost;de setembre;d’octubre;de novembre;de desembre`),mmm:G(`de gen.;de febr.;de març;d’abr.;de maig;de juny;de jul.;d’ag.;de set.;d’oct.;de nov.;de des.`),dddd:G(`diumenge;dilluns;dimarts;dimecres;dijous;divendres;dissabte`),ddd:G(`dg.;dl.;dt.;dc.;dj.;dv.;ds.`),ampm:G(`a.\xA0m.;p.\xA0m.`)},`ca`),q(K({group:`,`,decimal:`.`,mmmm:G(`Enero;Pebrero;Marso;Abril;Mayo;Hunyo;Hulyo;Agosto;Setyembre;Oktubre;Nobyembre;Disyembre`),dddd:G(`Linggo;Lunes;Martes;Miyerkules;Huwebes;Biyernes;Sabado`)},3,3),`fil`),q({group:`,`,decimal:`.`,mmmm:G(`જાન્યુઆરી;ફેબ્રુઆરી;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટેમ્બર;ઑક્ટોબર;નવેમ્બર;ડિસેમ્બર`),mmm:G(`જાન્યુ;ફેબ્રુ;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટે;ઑક્ટો;નવે;ડિસે`),dddd:G(`રવિ~;સોમ~;મંગળ~;બુધ~;ગુરુ~;શુક્ર~;શનિ~`,`વાર`),ddd:G(`રવિ;સોમ;મંગળ;બુધ;ગુરુ;શુક્ર;શનિ`)},`gu`),q({group:`,`,decimal:`.`,ampm:G(`לפנה״צ;אחה״צ`),dddd:G(`~ראשון;~שני;~שלישי;~רביעי;~חמישי;~שישי;~שבת`,`יום `),ddd:G(`~א׳;~ב׳;~ג׳;~ד׳;~ה׳;~ו׳;שבת`,`יום `),mmmm:G(`ינואר;פברואר;מרץ;אפריל;מאי;יוני;יולי;אוגוסט;ספטמבר;אוקטובר;נובמבר;דצמבר`),mmm:G(`ינו׳;פבר׳;מרץ;אפר׳;מאי;יוני;יולי;אוג׳;ספט׳;אוק׳;נוב׳;דצמ׳`),mmmm6:G(`רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע אל־אוול;רביע א־ת׳אני;ג׳ומאדא אל־אולא;ג׳ומאדא א־ת׳אניה;רג׳ב;שעבאן;רמדאן`),mmm6:G(`רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע א׳;רביע ב׳;ג׳ומאדא א׳;ג׳ומאדא ב׳;רג׳ב;שעבאן;רמדאן`)},`he`),q(K({group:`.`,decimal:`,`,mmmm:G(`siječnja;veljače;ožujka;travnja;svibnja;lipnja;srpnja;kolovoza;rujna;listopada;studenoga;prosinca`),mmm:G(`sij;velj;ožu;tra;svi;lip;srp;kol;ruj;lis;stu;pro`),dddd:G(`nedjelja;ponedjeljak;utorak;srijeda;četvrtak;petak;subota`)},-1,3),`hr`),q({decimal:`,`,mmmm:G(`հունվարի;փետրվարի;մարտի;ապրիլի;մայիսի;հունիսի;հուլիսի;օգոստոսի;սեպտեմբերի;հոկտեմբերի;նոյեմբերի;դեկտեմբերի`),mmm:G(`հնվ;փտվ;մրտ;ապր;մյս;հնս;հլս;օգս;սեպ;հոկ;նոյ;դեկ`),dddd:G(`կիրակի;երկուշաբթի;երեքշաբթի;չորեքշաբթի;հինգշաբթի;ուրբաթ;շաբաթ`),ddd:G(`կիր;երկ;երք;չրք;հնգ;ուր;շբթ`)},`hy`),q(K({decimal:`,`,mmmm:G(`იანვარი;თებერვალი;მარტი;აპრილი;მაისი;ივნისი;ივლისი;აგვისტო;სექტემბერი;ოქტომბერი;ნოემბერი;დეკემბერი`),dddd:G(`კვირა;ორშაბათი;სამშაბათი;ოთხშაბათი;ხუთშაბათი;პარასკევი;შაბათი`)},3,3),`ka`),q(K({decimal:`,`,mmmm:G(`қаңтар;ақпан;наурыз;сәуір;мамыр;маусым;шілде;тамыз;қыркүйек;қазан;қараша;желтоқсан`),dddd:G(`жексенбі;дүйсенбі;сейсенбі;сәрсенбі;бейсенбі;жұма;сенбі`),ddd:G(`жс;дс;сс;ср;бс;жм;сб`)},13,-1),`kk`),q({group:`,`,mmmm:G(`ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿಲ್;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂಬರ್;ಅಕ್ಟೋಬರ್;ನವೆಂಬರ್;ಡಿಸೆಂಬರ್`),mmm:G(`ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿ;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂ;ಅಕ್ಟೋ;ನವೆಂ;ಡಿಸೆಂ`),dddd:G(`ಭಾನು~;ಸೋಮ~;ಮಂಗಳ~;ಬುಧ~;ಗುರು~;ಶುಕ್ರ~;ಶನಿ~`,`ವಾರ`),ddd:G(`ಭಾನು;ಸೋಮ;ಮಂಗಳ;ಬುಧ;ಗುರು;ಶುಕ್ರ;ಶನಿ`),ampm:G(`ಪೂರ್ವಾಹ್ನ;ಅಪರಾಹ್ನ`)},`kn`),q({decimal:`,`,mmmm:G(`sausio;vasario;kovo;balandžio;gegužės;birželio;liepos;rugpjūčio;rugsėjo;spalio;lapkričio;gruodžio`),mmm:G(`saus.;vas.;kov.;bal.;geg.;birž.;liep.;rugp.;rugs.;spal.;lapkr.;gruod.`),dddd:G(`sekmadienis;pirmadienis;antradienis;trečiadienis;ketvirtadienis;penktadienis;šeštadienis`),ddd:G(`sk;pr;an;tr;kt;pn;št`),ampm:G(`priešpiet;popiet`)},`lt`),q({decimal:`,`,mmmm:G(`janvāris;februāris;marts;aprīlis;maijs;jūnijs;jūlijs;augusts;septembris;oktobris;novembris;decembris`),mmm:G(`janv.;febr.;marts;apr.;maijs;jūn.;jūl.;aug.;sept.;okt.;nov.;dec.`),dddd:G(`svētdiena;pirmdiena;otrdiena;trešdiena;ceturtdiena;piektdiena;sestdiena`),ddd:G(`svētd.;pirmd.;otrd.;trešd.;ceturtd.;piektd.;sestd.`),ampm:G(`priekšpusdienā;pēcpusdienā`)},`lv`),q({group:`,`,decimal:`.`,mmmm:G(`ജനുവരി;ഫെബ്രുവരി;മാർച്ച്;ഏപ്രിൽ;മേയ്;ജൂൺ;ജൂലൈ;ഓഗസ്റ്റ്;സെപ്റ്റംബർ;ഒക്ടോബർ;നവംബർ;ഡിസംബർ`),mmm:G(`ജനു;ഫെബ്രു;മാർ;ഏപ്രി;മേയ്;ജൂൺ;ജൂലൈ;ഓഗ;സെപ്റ്റം;ഒക്ടോ;നവം;ഡിസം`),dddd:G(`ഞായറാഴ്ച;തിങ്കളാഴ്ച;ചൊവ്വാഴ്ച;ബുധനാഴ്ച;വ്യാഴാഴ്ച;വെള്ളിയാഴ്ച;ശനിയാഴ്ച`),ddd:G(`ഞായർ;തിങ്കൾ;ചൊവ്വ;ബുധൻ;വ്യാഴം;വെള്ളി;ശനി`)},`ml`),q({group:`,`,decimal:`.`,mmmm:G(`нэгдүгээ~;хоёрдугаа~;гуравдугаа~;дөрөвдүгээ~;тавдугаа~;зургаадугаа~;долоодугаа~;наймдугаа~;есдүгээ~;аравдугаа~;арван нэгдүгээ~;арван хоёрдугаа~`,`р сар`),mmm:G(`1~;2~;3~;4~;5~;6~;7~;8~;9~;10~;11~;12~`,`-р сар`),dddd:G(`ням;даваа;мягмар;лхагва;пүрэв;баасан;бямба`),ddd:G(`Ня;Да;Мя;Лх;Пү;Ба;Бя`),ampm:G(`ү.ө.;ү.х.`)},`mn`),q({group:`,`,decimal:`.`,mmmm:G(`जानेवारी;फेब्रुवारी;मार्च;एप्रिल;मे;जून;जुलै;ऑगस्ट;सप्टेंबर;ऑक्टोबर;नोव्हेंबर;डिसेंबर`),mmm:G(`जाने;फेब्रु;मार्च;एप्रि;मे;जून;जुलै;ऑग;सप्टें;ऑक्टो;नोव्हें;डिसें`),dddd:G(`रविवार;सोमवार;मंगळवार;बुधवार;गुरुवार;शुक्रवार;शनिवार`),ddd:G(`रवि;सोम;मंगळ;बुध;गुरु;शुक्र;शनि`)},`mr`),q(K({group:`,`,decimal:`.`,mmmm:G(`ဇန်နဝါရီ;ဖေဖော်ဝါရီ;မတ်;ဧပြီ;မေ;ဇွန်;ဇူလိုင်;ဩဂုတ်;စက်တင်ဘာ;အောက်တိုဘာ;နိုဝင်ဘာ;ဒီဇင်ဘာ`),mmm:G(`ဇန်;ဖေ;မတ်;ဧ;မေ;ဇွန်;ဇူ;ဩ;စက်;အောက်;နို;ဒီ`),dddd:G(`တနင်္ဂနွေ;တနင်္လာ;အင်္ဂါ;ဗုဒ္ဓဟူး;ကြာသပတေး;သောကြာ;စနေ`),ampm:G(`နံနက်;ညနေ`)},-1,0),`my`),q({group:`,`,decimal:`.`,mmmm:G(`ਜਨਵਰੀ;ਫ਼ਰਵਰੀ;ਮਾਰਚ;ਅਪ੍ਰੈਲ;ਮਈ;ਜੂਨ;ਜੁਲਾਈ;ਅਗਸਤ;ਸਤੰਬਰ;ਅਕਤੂਬਰ;ਨਵੰਬਰ;ਦਸੰਬਰ`),mmm:G(`ਜਨ;ਫ਼ਰ;ਮਾਰਚ;ਅਪ੍ਰੈ;ਮਈ;ਜੂਨ;ਜੁਲਾ;ਅਗ;ਸਤੰ;ਅਕਤੂ;ਨਵੰ;ਦਸੰ`),dddd:G(`ਐਤਵਾਰ;ਸੋਮਵਾਰ;ਮੰਗਲਵਾਰ;ਬੁੱਧਵਾਰ;ਵੀਰਵਾਰ;ਸ਼ੁੱਕਰਵਾਰ;ਸ਼ਨਿੱਚਰਵਾਰ`),ddd:G(`ਐਤ;ਸੋਮ;ਮੰਗਲ;ਬੁੱਧ;ਵੀਰ;ਸ਼ੁੱਕਰ;ਸ਼ਨਿੱਚਰ`),ampm:G(`ਪੂ.ਦੁ.;ਬਾ.ਦੁ.`)},`pa`),q({group:`.`,decimal:`,`,mmmm:G(`ianuarie;februarie;martie;aprilie;mai;iunie;iulie;august;septem~;octom~;noiem~;decem~`,`brie`),mmm:G(`ian.;feb.;mar.;apr.;mai;iun.;iul.;aug.;sept.;oct.;nov.;dec.`),dddd:G(`duminică;luni;marți;miercuri;joi;vineri;sâmbătă`),ddd:G(`dum.;lun.;mar.;mie.;joi;vin.;sâm.`),ampm:G(`a.m.;p.m.`)},`ro`),q(K({group:`.`,decimal:`,`,mmmm:G(`januar;februar;marec;april;maj;junij;julij;avgust;september;oktober;november;december`),mmm:G(`jan.;feb.;mar.;apr.;maj;jun.;jul.;avg.;sep.;okt.;nov.;dec.`),dddd:G(`nedelja;ponedeljek;torek;sreda;četrtek;petek;sobota`),ampm:G(`dop.;pop.`)},-1,13),`sl`),q(K({group:`.`,decimal:`,`,mmmm:G(`јануар;фебруар;март;април;мај;јун;јул;август;септембар;октобар;новембар;децембар`),dddd:G(`недеља;понедељак;уторак;среда;четвртак;петак;субота`)},3,3),`sr`),q({group:`,`,decimal:`.`,mmmm:G(`ஜனவரி;பிப்ரவரி;மார்ச்;ஏப்ரல்;மே;ஜூன்;ஜூலை;ஆகஸ்ட்;செப்டம்பர்;அக்டோபர்;நவம்பர்;டிசம்பர்`),mmm:G(`ஜன.;பிப்.;மார்.;ஏப்.;மே;ஜூன்;ஜூலை;ஆக.;செப்.;அக்.;நவ.;டிச.`),dddd:G(`ஞாயிறு;திங்கள்;செவ்வாய்;புதன்;வியாழன்;வெள்ளி;சனி`),ddd:G(`ஞாயி.;திங்.;செவ்.;புத.;வியா.;வெள்.;சனி`)},`ta`),q({group:`,`,decimal:`.`,mmmm:G(`జనవరి;ఫిబ్రవరి;మార్చి;ఏప్రిల్;మే;జూన్;జులై;ఆగస్టు;సెప్టెంబర్;అక్టోబర్;నవంబర్;డిసెంబర్`),mmm:G(`జన;ఫిబ్ర;మార్చి;ఏప్రి;మే;జూన్;జులై;ఆగ;సెప్టెం;అక్టో;నవం;డిసెం`),dddd:G(`ఆదివారం;సోమవారం;మంగళవారం;బుధవారం;గురువారం;శుక్రవారం;శనివారం`),ddd:G(`ఆది;సోమ;మంగళ;బుధ;గురు;శుక్ర;శని`)},`te`),q({decimal:`,`,mmmm:G(`січня;лютого;березня;квітня;травня;червня;липня;серпня;вересня;жовтня;листопада;грудня`),mmm:G(`січ.;лют.;бер.;квіт.;трав.;черв.;лип.;серп.;вер.;жовт.;лист.;груд.`),dddd:G(`неділю;понеділок;вівторок;середу;четвер;пʼятницю;суботу`),ddd:G(`нд;пн;вт;ср;чт;пт;сб`),ampm:G(`дп;пп`)},`uk`),q({group:`.`,decimal:`,`,mmmm:G(`~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12`,`tháng `),mmm:G(`~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12`,`thg `),dddd:G(`Chủ Nhật;Thứ Hai;Thứ Ba;Thứ Tư;Thứ Năm;Thứ Sáu;Thứ Bảy`),ddd:G(`CN;Th 2;Th 3;Th 4;Th 5;Th 6;Th 7`),ampm:G(`SA;CH`)},`vi`),q(K({group:`٬`,decimal:`٫`,ampm:G(`ص;م`),mmmm:G(`يناير;فبراير;مارس;أبريل;مايو;يونيو;يوليو;أغسطس;سبتمبر;أكتوبر;نوفمبر;ديسمبر`),dddd:G(`الأحد;الاثنين;الثلاثاء;الأربعاء;الخميس;الجمعة;السبت`),mmmm6:G(`رمضان;شوال;ذو القعدة;ذو الحجة;محرم;ربيع الأول;ربيع الآخرة;جمادى الأولى;جمادى الآخرة;رجب;شعبان;رمضان`)},0,0),`ar`),q({group:`,`,decimal:`.`,mmmm:G(`জানুয়ারী;ফেব্রুয়ারী;মার্চ;এপ্রিল;মে;জুন;জুলাই;আগস্ট;সেপ্টেম্বর;অক্টোবর;নভেম্বর;ডিসেম্বর`),mmm:G(`জানু;ফেব;মার্চ;এপ্রি;মে;জুন;জুল;আগ;সেপ্টেঃ;অক্টোঃ;নভেঃ;ডিসেঃ`),dddd:G(`রবিবার;সোমবার;মঙ্গলবার;বুধবার;বৃহস্পতিবার;শুক্রবার;শনিবার`),ddd:G(`রবি;সোম;মঙ্গল;বুধ;বৃহস্পতি;শুক্র;শনি`)},`bn`),q({group:`,`,decimal:`.`,mmmm:G(`जनवरी;फ़रवरी;मार्च;अप्रैल;मई;जून;जुलाई;अगस्त;सितंबर;अक्तूबर;नवंबर;दिसंबर`),mmm:G(`जन॰;फ़र॰;मार्च;अप्रैल;मई;जून;जुल॰;अग॰;सित॰;अक्तू॰;नव॰;दिस॰`),dddd:G(`रविवार;सोमवार;मंगलवार;बुधवार;गुरुवार;शुक्रवार;शनिवार`),ddd:G(`रवि;सोम;मंगल;बुध;गुरु;शुक्र;शनि`),ampm:G(`am;pm`)},`hi`);let ol={overflow:`######`,dateErrorThrows:!1,dateErrorNumber:!0,bigintErrorNumber:!1,dateSpanLarge:!0,leap1900:!0,nbsp:!1,throws:!0,invalid:`######`,locale:``,ignoreTimezone:!1,grouping:[3,3],indexColors:!0,skipChar:``,repeatChar:``};function sl(e,t=0){if(typeof e!=`number`)return e;if(e<0)return-sl(-e,t);if(t){let n=10**t||1;return sl(e*n,0)/n}return Math.round(e)}function cl(e,t=2,n=2){let r=e<0?-1:1,i=10**(t||2),a=10**(n||2),o=Math.abs(e),s=0,c=0,l=0,u=1,d,f;if(e=o,e%1==0)f=[e*r,1];else if(e<1e-19)f=[r,0x8ac7230489e80000];else if(e>0x8ac7230489e80000)f=[0x8ac7230489e80000*r,1];else{do if(o=1/(o-Math.floor(o)),d=u,u=u*Math.floor(o)+s,s=d,c=l,l=Math.floor(e*u+.5),l>=i||u>=a)return[r*c,s];while(Math.abs(e-l/u)>=1e-13&&o!==Math.floor(o));f=[r*l,u]}return f}let ll=Math.floor;function ul(e,t=!0){if(t&&e>=0){if(e===0)return[1900,1,0];if(e===60)return[1900,2,29];if(e<60)return[1900,e<32?1:2,(e-1)%31+1]}let n=e+68569+2415019,r=ll(4*n/146097);n-=ll((146097*r+3)/4);let i=ll(4e3*(n+1)/1461001);n=n-ll(1461*i/4)+31;let a=ll(80*n/2447),o=n-ll(2447*a/80);n=ll(a/11);let s=a+2-12*n;return[100*(r-49)+i+n|0,s|0,o|0]}function dl(e){return ul(e+1462)}function fl(e){if(e===60)throw Error(`#VALUE!`);if(e<=1)return[1317,8,29];if(e<60)return[1317,e<32?9:10,1+(e-2)%30];let t=10631/30,n=8.01/60,r=e+466935,i=ll(r/10631);r-=10631*i;let a=ll((r-n)/t);r-=ll(a*t+n);let o=ll((r+28.5001)/29.5);return o===13?[30*i+a,12,30]:[30*i+a,o,r-ll(29.5001*o-29)]}function pl(e,t=0,n=!0){let r=ll(e);return t===6?fl(r):t===-1?dl(r):ul(r,n)}let ml=Math.floor,hl=86400;function gl(e,t){let n=null;if(Array.isArray(e)){let[t,r,i,a,o,s]=e;n=Date.UTC(t,r==null?0:r-1,i==null?1:i,a||0,o||0,s||0)}else if(e instanceof Date&&(n=e*1,!(t!=null&&t.ignoreTimezone))){let t=new Date;t.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setUTCHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n=t*1}if(n!=null&&isFinite(n)){let e=n/864e5;return e-(e<=-25509?-25568:-25569)}return null}function _l(e,t){let n=e|0,r=hl*(e-n),i=ml(r);r-i>.9999&&(i+=1,i===hl&&(i=0,n+=1));let a=i<0?hl+i:i,[o,s,c]=pl(e,0,t==null?void 0:t.leap1900);return[o,s,c,ml(a/60/60)%60,ml(a/60)%60,ml(a)%60]}let vl=`!d-m-y.!d-m-Y.!j-m-y.!j-m-Y.!d-n-y.!d-n-Y.!j-n-y.!j-n-Y.?m-d-y.?m-d-Y.?m-j-y.?m-j-Y.?n-d-y.?n-d-Y.?n-j-y.?n-j-Y.d-M-y.d-M-Y.j-M-y.j-M-Y.M-d-y.M-d-Y.M-j-y.M-j-Y.d-F-y.d-F-Y.F-d-y.F-d-Y.F-j-y.F-j-Y.j-F-y.j-F-Y.y-F-d.y-F-j.y-M-d.y-M-j.Y-F-d.Y-F-j.Y-M-d.Y-m-d.Y-M-j.Y-m-j.Y-n-d.Y-n-j.j-F.j-M.d-F.d-M.n-d.n-j.n-Y.m-d.m-j.m-Y.M-Y.M-y.F-y.F-Y.Y-M.Y-n.Y-m.Y-F.Y-M`.split(`.`),yl={j:`d`,d:`d`,D:`ddd`,l:`dddd`,n:`m`,m:`m`,M:`mmm`,F:`mmmm`,y:`yy`,Y:`yyyy`},bl={j:`dd`,d:`dd`,D:`ddd`,l:`dddd`,n:`mm`,m:`mm`,M:`mmm`,F:`mmmm`,y:`yy`,Y:`yyyy`},xl={},Sl={};function Cl(e,t,n=1){if(e){let r=e[0],i=e.slice(1);r===`!`?Cl(i,t,4):r===`?`?Cl(i,t,2):(t[r]=t[r]||{},Cl(i,t[r],n))}else t.$=n}function wl(e,t){Cl(e,t),Cl(e+` x`,t),Cl(e+` l`,t),Cl(e+` l x`,t),Cl(`l `+e,t),Cl(`l `+e+` x`,t),Cl(e+` D`,t),Cl(e+` D x`,t),Cl(`D `+e,t),Cl(`D `+e+` x`,t)}vl.forEach(e=>{e.startsWith(`?`)||wl(e,xl),e.startsWith(`!`)||wl(e,Sl)});let Tl=new Date().getUTCFullYear(),El={".":[`,`,`\xA0`,` `,`'`,`٬`],",":[`.`,`\xA0`,` `,`'`,`٬`],"٫":[`.`,`\xA0`,` `,`'`,`٬`]},Dl=e=>(e==null?void 0:e.length)===1&&e>=`0`&&e<=`9`;function Ol(e,t={}){let n=Jc(t.locale||``)||Xc,r=n.decimal,i=[...El[r]||[`'`,`٬`]];!i.includes(n.group)&&n.group!==` `&&n.group!==r&&i.push(n.group);let a=``,o=``,s=1,c=``,l=!1,u=!1,d=!1,f=!1,p=!1,m=null,h=!1,g=0,_=[` `,`\xA0`,` `,`+`,`%`,`(`,`-`].concat(Bc);for(;_.includes(e[g]);){let t=e[g];if(t===`-`){if(l||u)return null;l=!0,s=-1}else if(Vc.test(t)){if(p)return null;p=!0,m=t}else if(t===`(`){if(u||l)return null;u=!0,s=-1}else if(t===`%`){if(f)return null;f=!0}g++}let v=!1,y;if(e[g]===r||Dl(e[g]))for(;g<e.length;){let t=e[g];if(!y&&i.includes(t))y=t;else if(!(y&&y===t))if(t===r){if(v)break;a+=`.`,v=!0}else if(Dl(t))a+=t;else break;g++}if(e[g]===`e`||e[g]===`E`){o+=e[g],g++,(e[g]===`+`||e[g]===`-`)&&(o+=e[g],g++);let t=g;for(;Dl(e[g]);)o+=e[g],g++;if(t===g)return null}let b=[` `,`\xA0`,` `,`%`,`$`,`)`].concat(Bc);for(;b.includes(e[g]);){let t=e[g];if(Vc.test(t)){if(p)return null;p=!0,m=t,h=!0}else if(t===`)`){if(d||!u)return null;d=!0}else if(t===`%`){if(f)return null;f=!0}g++}if(g!==e.length)return null;let x=parseFloat(a+o);if(!isFinite(x))return null;if(o){if(f||p)return null;c=`0.00E+00`}else if(f){if(p)return null;c=a.includes(`.`)?`0.00%`:`0%`,x*=.01}else if(p){let e=a.includes(`.`)?`#,##0.00`:`#,##0`;c=h?e+m:m+e}else y&&(c=a.includes(`.`)?`#,##0.00`:`#,##0`);let S={v:x*s};return c&&(S.z=c),S}function kl(e,t,n){if(n<1||t<1||t>12)return!1;if(t===2){if(n>(e%4==0&&e%100!=0||e%400==0||e===1900?29:28))return!1}else if((t===4||t===6||t===9||t===11)&&n>30||(t===1||t===3||t===5||t===7||t===8||t===10||t===12)&&n>31)return!1;return!0}let Al=(e,t,n=!1)=>{for(let r of t)if(e.startsWith(r[0])){let t=r[0].length;return n&&(r[2]===`D`||r[2]===`M`)&&e[t]===`.`&&t++,[e.slice(0,t),r]}return[``,null]},jl=(e,t,n,r)=>{let i=n.path||``,a=Object.keys(t);for(let o of a){let a;if(t[o]){if(o===`$`||o===`€`)e||(a=n);else if(o===`-`){let s=/^(\s*([./-]|,\s)\s*|\s+)/.exec(e);if(s){let c=s[1]===`-`||s[1]===`/`||s[1]===`.`?s[1]:` `;if(!n.sep||n.sep===c){let l=s[0].replace(/\s+/g,` `);a=jl(e.slice(s[0].length),t[o],{...n,sep:c,path:i+l},r)}}}else if(o===` `){let s=/^[,.]?\s+/.exec(e);if(s){let c=s[0].replace(/\s+/g,` `);a=jl(e.slice(s[0].length),t[o],{...n,path:i+c},r)}}else if(o===`j`||o===`d`){let s=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(e);s&&(a=jl(e.slice(s[0].length),t[o],{...n,day:s[0],path:i+o},r))}else if(o===`n`||o===`m`){let s=/^(0?[1-9]|1[012])\b/.exec(e);s&&(a=jl(e.slice(s[0].length),t[o],{...n,month:+s[0],_mon:s[0],path:i+o},r))}else if(o===`F`||o===`M`){let[s,c]=Al(e,r.mon,r.mp);(c==null?void 0:c[2])===o&&(a=jl(e.slice(s.length),t[o],{...n,month:c[1],_mon:s,path:i+o},r))}else if(o===`l`||o===`D`){let[s,c]=Al(e,r.day,r.dp);(c==null?void 0:c[2])===o&&(a=jl(e.slice(s.length),t[o],{...n,path:i+o},r))}else if(o===`y`){let s=/^\d\d\b/.exec(e);if(s){let c=+s[0]>=30?+s[0]+1900:+s[0]+2e3;a=jl(e.slice(s[0].length),t[o],{...n,year:c,path:i+o},r)}}else if(o===`Y`){let s=/^\d\d\d\d\b/.exec(e);s&&(a=jl(e.slice(s[0].length),t[o],{...n,year:+s[0],path:i+o},r))}else if(o===`x`){let s=Il(e,{locale:r.locale});s&&(a=jl(``,t[o],{...n,time:s.v,tf:s.z,path:i+o},r))}else throw Error(`Unknown date token "${o}"`);if(a&&kl(n.year||1916,n.month||1,n.day?+n.day:1))return a}}},Ml=e=>e.replace(/\s+/g,` `).trim().replace(/’/,`'`).replace(/\.$/,``).toLowerCase(),Nl=(e,t)=>{let n=e.map((e,n)=>[Ml(e),n+1,t]);return n.sort((e,t)=>t[0].length-e[0].length),n};function Pl(e,t={}){let n=Jc(t.locale||``)||Xc,r={mon:Nl(n.mmmm,`F`).concat(Nl(n.mmm,`M`)),mp:n.mmm[0].at(-1)===`.`,day:Nl(n.dddd,`l`).concat(Nl(n.ddd,`D`)),dp:n.ddd[0].at(-1)===`.`,locale:t.locale},i=jl(Ml(e),n.preferMDY?Sl:xl,{path:``},r);if(i){var a;if(i.sep===`.`&&i.path.length===3)return null;let e=+((a=i.year)==null?Tl:a);i.day||(i.day=1);let t=-1/0;if(e<1900)return null;e<=1900&&i.month<=2?t=25568:e<1e4&&(t=25569);let n=Date.UTC(e,i.month-1,i.day)/864e5+t+(i.time||0);if(n>=0&&n<=2958465){let e=i._mon[0]===`0`||i.day[0]===`0`||i._mon.length===2&&i.day.length===2;return{v:n,z:i.path.replace(/[jdlDnmMFyYx]/g,t=>t===`x`?i.tf||``:(e?bl[t]:yl[t])||t)}}}return null}let Fl=e=>e.replace(/\s+/g,``).trim().replace(/\./g,``).toLowerCase();function Il(e,t={}){let n=Jc(t.locale||``)||Xc,r=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?=\s*[^\s\d]|$)/.exec(e),i=``;if(r){let t=Fl(e.slice(r[0].length));if(t===Fl(n.ampm[0])||t===`a`||t===`am`)i=`a`;else if(t===Fl(n.ampm[1])||t===`p`||t===`pm`)i=`p`;else if(t===`:`)r[3]||(r[3]=`0`),r[2]||(r[2]=`0`);else if(t)return null}if(r){let[,e,t,n,a]=r;if(a&&!n||!i&&!t&&!n)return null;let o=(e||0)*1;if(i){if(o>=13)return null;i===`a`?o===12&&(o=0):i===`p`&&o!==12&&(o+=12)}let s=(t||0)*1,c=(n||0)*1,l=(a||0)*1;return{v:(o*60*60+s*60+c+l)/(3600*24),z:(e.length===2?`hh`:`h`)+`:mm`+(n?`:ss`:``)+(i?` AM/PM`:``)}}return null}function Ll(e,t={}){let n=Jc(t.locale||``)||Xc,r=e.trim().toLowerCase(),i=n.bool[0].toLowerCase();if(r===`true`||r===i)return{v:!0};let a=n.bool[1].toLowerCase();return r===`false`||r===a?{v:!1}:null}function Rl(e,t){var n,r,i;return(n=(r=(i=Ol(e,t))==null?Pl(e,t):i)==null?Il(e,t):r)==null?Ll(e,t):n}function zl(e,t,n){return t[n+`_max`]=e.length,t[n+`_min`]=e.replace(/#/g,``).length,t}function J(e,t){typeof e==`string`?t.push({type:`string`,value:e}):t.push(e)}function Bl(e,t){let n=e==null?void 0:e.type;return n===`hash`||n===`zero`||n===`qmark`||n===`digit`&&t===`den`}function Vl(e){let t=[],n={scale:1,percent:!1,text:!1,date:0,date_eval:!1,date_system:1,sec_decimals:0,general:!1,clock:24,int_pattern:[],frac_pattern:[],man_pattern:[],den_pattern:[],num_pattern:[],tokens:t},r=`int`,i=null,a=[],o,s=!1,c=-1,l=!1,u=``,d=!1;for(;++c<e.length&&!l;){var f;let h=e[c],g=h.type||`error`;if(u+=h.raw,g===`general`)n.general=!0,J(h,t);else if(Bl(h,r)){let e=n[r+`_pattern`];Bl(o,r)||(o==null?void 0:o.type)===`group`?(e.push((e.pop()||``)+h.value),i.num+=h.value):(e.push(h.value),i={type:r,num:h.value},J(i,t))}else if(g===`paren`)h.value===`(`&&(n.parens=!0),J(h.value,t);else if(g===`digit`)J(h.value,t);else if(g===`slash`)if(d=!0,n[r+`_pattern`].length){if(!i)throw SyntaxError(`Format pattern is missing a numerator`);n.fractions=!0,n.num_pattern.push(n[r+`_pattern`].pop()),i.type=`num`,r=`den`,J({type:`div`},t)}else J(h.value,t);else if(g===`comma`)J(`,`,t);else if(g===`scale`)n.scale=.001**h.raw.length;else if(g===`group`){if(r===`int`&&(n.grouping=!0),r===`den`)throw SyntaxError(`Cannot group denominator digits`)}else if(g===`space`)J(h,t);else if(g===`break`){l=!0;break}else if(g===`text`)n.text=!0,J(h,t);else if(g===`plus`||g===`minus`)J(h,t);else if(g===`duration`){let e=h.value.toLowerCase(),r=e[0],i={type:``,size:0,date:1,pad:e.length};r===`h`?(i.size=16,i.type=`hour-elap`):r===`m`?(i.size=32,i.type=`min-elap`):(i.size=64,i.type=`sec-elap`),n.date|=i.size,a.push(i),J(i,t)}else if(n.date&&g===`point`&&((f=e[c+1])==null?void 0:f.type)===`zero`){var p,m;let r=1;c++;let i=`0`;((p=e[c+1])==null?void 0:p.type)===`zero`&&(i+=`0`,r=2,c++),((m=e[c+1])==null?void 0:m.type)===`zero`&&(i+=`0`,r=3,c++),u+=i;let a=[64,128,256,512][r];n.date|=a,n.date_eval=!0,n.sec_decimals=Math.max(n.sec_decimals,r),J({type:`subsec`,size:a,decimals:r,date:1},t)}else if(g===`calendar`)s||(h.value===`B2`||h.value===`b2`?n.date_system=6:n.date_system=1);else if(g===`datetime`){let e={type:``,size:0,date:1},r=h.value.toLowerCase(),i=r[0];if(r===`y`||r===`yy`)e.size=2,e.type=`year-short`;else if(i===`y`||i===`e`)e.size=2,e.type=`year`;else if(r===`b`||r===`bb`)e.size=2,e.type=`b-year-short`;else if(i===`b`)e.size=2,e.type=`b-year`;else if(r===`d`||r===`dd`)e.size=8,e.type=`day`,e.pad=/dd/.test(r);else if(r===`ddd`||r===`aaa`)e.size=8,e.type=`weekday-short`;else if(i===`d`||i===`a`)e.size=8,e.type=`weekday`;else if(i===`h`)e.size=16,e.type=`hour`,e.pad=/hh/i.test(r);else if(i===`m`){r.length===3?(e.size=4,e.type=`monthname-short`):r.length===5?(e.size=4,e.type=`monthname-single`):r.length>=4&&(e.size=4,e.type=`monthname`);let t=a[a.length-1];!e.type&&t&&!t.used&&t.size&80&&(t.used=!0,e.size=32,e.type=`min`,e.pad=/mm/.test(r)),e.type||(e.size=4,e.type=`month`,e.pad=/mm/.test(r),e.indeterminate=!0)}else if(i===`s`){e.size=64,e.type=`sec`,e.pad=/ss/.test(r);let t=a[a.length-1];t&&t.size&32?e.used=!0:t!=null&&t.indeterminate&&(delete t.indeterminate,t.size=32,t.type=`min`,e.used=!0)}n.date|=e.size,n.date_eval=!0,a.push(e),J(e,t)}else if(g===`ampm`)n.clock=12,n.date|=16,n.date_eval=!0,h.short=h.value===`A/P`,J(h,t);else if(g===`string`||g===`escaped`||g===`char`)J(h.value,t);else if(g===`condition`)n.condition=[h.value[0],parseFloat(h.value[1])];else if(g===`locale`){let e=h.value.split(`-`),r=e.length<2?``:e.slice(1).join(`-`),i=e[0];i&&J(i,t);let a=qc(r);a&&(n.locale=a);let o=parseInt(r,16);isFinite(o)&&o&16711680&&(o>>16&255)==6&&(n.date_system=6),s=!0}else if(g===`color`){let e,t=h.value.toLowerCase();(e=/^color\s*(\d+)$/i.exec(t))&&(t=parseInt(e[1],10)),n.color=t}else if(g===`percent`)n.scale=100,n.percent=!0,J(`%`,t);else if(g===`point`)J(h,t),n.date||(n.dec_fractions=!0,r=`frac`);else if(g===`exp`)n.exponential=!0,n.exp_plus=h.value.includes(`+`),r=`man`,J({type:`exp`,plus:n.exp_plus},t);else if(g===`skip`)J(h,t);else if(g===`fill`)J(h,t);else if(!(g===`dbnum`||g===`natnum`))throw SyntaxError(g===`error`?`Illegal character: ${u}`:`Unknown token ${g} in ${u}`);o=h}if(n.tokensUsed=c,n.pattern=u,/^((?:\[[^\]]+\])+)(;|$)/.test(n.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(n.pattern)&&J({type:`text`},t),n.fractions&&n.dec_fractions||n.grouping&&!n.int_pattern.length||n.fractions&&n.exponential||n.fractions&&n.den_pattern.length*n.num_pattern.length===0||d&&!n.fractions&&!n.date||n.exponential&&(n.int_pattern.length||n.frac_pattern.length)*n.man_pattern.length===0)throw SyntaxError(`Invalid pattern: ${u}`);let h=n.int_pattern.join(``),g=n.man_pattern.join(``),_=n.frac_pattern.join(``);zl(h,n,`int`);let v=0;for(let e=0;e<h.length;e++){let t=h[h.length-1-e];/^[0-9?]/.test(t)&&(v=e+1)}n.int_min=v,zl(_,n,`frac`),zl(g,n,`man`);let y=n.num_pattern.join(``),b=n.den_pattern[0]||``;if(b.includes(`?`)||y.includes(`?`)?(b=b.replace(/\d/g,`?`),b=b.replace(/#$/g,`?`),zl(y,n,`num`),zl(b,n,`den`),y=y.replace(/#$/g,`?`)):(zl(y,n,`num`),zl(b,n,`den`)),n.int_p=h,n.man_p=g,n.num_p=y,n.den_p=b,n.den_pattern.length&&(n.denominator=parseInt(n.den_pattern.join(``).replace(/\D/g,``),10)),n.integer=!!h.length,!n.integer&&!n.exponential&&_.length){let e=n.tokens.findIndex(e=>e.type===`point`);n.tokens.splice(e,0,{type:`int`,value:`#`}),n.integer=!0,n.int_pattern=[`#`],n.int_p=`#`}if(n.fractions)for(let e=0;e<t.length-1;e++){let n=t[e];if(n.type!==`string`&&n.type!==`space`)continue;let r=t[e+1].type;r===`num`?n.rule=`num+int`:r===`div`?n.rule=`num`:r===`den`&&(n.rule=`den`)}return n.grouping&&n.int_pattern.length>1&&(n.grouping=!1),n}function Hl(e){if(e===0)return e;let t=Math.ceil(Math.log10(e<0?-e:e)),n=10**(16-Math.floor(t));return isFinite(n)?Math.round(e*n)/n:0}function Ul(e,t=0){let n=Math.floor(Math.log10(e));return t>1?Math.floor(n/t)*t:n}function Wl(e,t=1){return t<-300?parseFloat(e.toExponential().split(`e`)[0]):e*10**-t}let Gl={total:1,sign:0,period:0,int:1,frac:0};function Kl(e,t=!0){let n=Math.abs(e);if(!n)return Gl;let r=t&&e<0?1:0,i=Math.floor(n),a=Math.floor(Math.log10(n)+1),o=0,s=0;if(i!==n){o=1;let e=String(sl(n*10**-a,15)),t=e.length,r=!0,i=0;for(;i<=e.length;){if(e[i]===`.`){t--;break}else e[i]===`0`&&r?t--:r=!1;i++}s=t-a,s<0&&(s=0,o=0)}return{total:r+Math.max(a,1)+o+s,digits:Math.max(a,0)+s,sign:r,period:o,int:Math.max(a,1),frac:s}}let ql=(e,t)=>e.replace(/\./,t.decimal),Jl=(e,t,n)=>{let r=Math.abs(t),i;return i=e===1?e:sl(e,5),[ql(i+``,n),n.exponent,t<0?n.negative:n.positive,r<10?`0`:``,r]};function Yl(e,t,n,r){let i=n|0;if(typeof n==`string`)e.push(n);else if(n===i)e.push(Math.abs(i));else{let t=Math.abs(n),i=Ul(t),a=Wl(t,i);a===10&&(a=1,i++);let o=Kl(t);if(i>=-4&&i<=-1){let n=t.toPrecision(10+i).replace(/\.?0+$/,``);e.push(ql(n,r))}else if(i===10){let n=t.toFixed(10).slice(0,12).replace(/\.$/,``);e.push(ql(n,r))}else if(Math.abs(i)<=9)if(o.total<=11){let n=sl(t,9).toFixed(o.frac);e.push(ql(n,r))}else i===9?e.push(Math.floor(t)):i>=0&&i<9?e.push(ql(String(sl(t,9-i)),r)):e.push(...Jl(a,i,r));else o.total>=12?e.push(...Jl(a,i,r)):e.push(ql(sl(t,9).toFixed(o.frac),r))}return e}function Xl(e,t=!1){return e===`0`?`0`:e===`?`?t?`\xA0`:` `:``}let Zl=86400,Ql=(e,t,n)=>n?e<-694324||t>=35830291:e<0||t>=2958466;function $l(e,t,n,r){var i,a;let o=``,s=``,c=``,l=``,u=``,d=``,f=0,p=0;if(typeof e==`bigint`){if(e<=2**53-1&&e>=-(2**53-1))e=Number(e);else return n.bigintErrorNumber?String(e):n.overflow;p=e}else p=Math.trunc(e);let m=0,h=0,g=1,_=0,v=0,y=0,b=0,x=0,S=0,C=r||Xc;if(!t.text&&isFinite(t.scale)&&t.scale!==1&&(e=Hl(e*t.scale)),t.exponential){let n=Math.abs(e);n&&(f=Ul(n,t.int_max)),e&&!t.integer&&f++,n=Wl(n,f),t.int_max===1&&sl(n,t.frac_max)===10&&(n=1,f++),e=e<0?-n:n,o+=Math.abs(f)}if(t.integer){let n=Math.abs(sl(e,t.fractions?1:t.frac_max));d+=n<1?``:Math.floor(n)}let w=(i=n.grouping[0])==null?3:i,T=(a=n.grouping[1])==null?w:a;t.dec_fractions&&(u=String(sl(e,t.frac_max)).split(`.`)[1]||``);let E=!t.error&&(t.num_p.includes(`0`)||t.den_p.includes(`0`)),D=E;if(t.fractions){D=E||!!(e%1);let n=Math.abs(t.integer?e%1:e);if(n)if(D=!0,t.denominator&&isFinite(t.denominator))l+=t.denominator,c+=sl(n*t.denominator),c===`0`&&(c=``,l=``,D=E);else{let e=cl(n,1/0,t.den_max);c+=e[0],l+=e[1],t.integer&&c===`0`&&(c=``,l=``,D=E)}else !e&&!t.integer&&(D=!0,c=`0`,l=`1`);t.integer&&!D&&!Math.trunc(e)&&(d=`0`)}if(t.date){p=Math.trunc(e);let r=Zl*(e-p);if(m=Math.floor(r),S=r-m,Math.abs(S)<1e-6?S=0:S>.9999&&(S=0,m+=1,m===Zl&&(m=0,p+=1)),S){let e=t.date&512||t.date&256||t.date&128;(e===512&&S>.9995||e===256&&S>.995||e===128&&S>.95||!e&&S>=.5)&&(m++,S=0)}if(p||t.date_system){let r=pl(e,t.date_system,n.leap1900);h=r[0],g=r[1],_=r[2]}if(m){let e=m<0?Zl+m:m;x=Math.floor(e)%60,b=Math.floor(e/60)%60,y=Math.floor(e/60/60)%60}if(v=(6+p)%7,t.date_eval&&Ql(e,p+m/Zl,n.dateSpanLarge)){if(n.dateErrorThrows)throw Error(`Date out of bounds`);return n.dateErrorNumber?Yl(e<0?[C.negative]:[],{},e,C).join(``):n.overflow}}let O=Xl(`?`,n.nbsp);f<0?s=`-`:t.exp_plus&&(s=`+`);let k=[],A=(e,t,r,i)=>{let a=!i&&e.length>t.length?r.length+e.length-t.length:r.length;e.length<t.length&&(i+=e.length-t.length);for(let t=0;t<a;t++)k.push(e[t+i]||Xl(r[t],n.nbsp));return a},j=!1,M={int:0,frac:0,man:0,num:0,den:0};for(let i=0,a=t.tokens.length;i<a;i++){let a=t.tokens[i],f=a.type,E=a.num?a.num.length:0;if(f===`string`)a.rule?a.rule===`num`?D?k.push(a.value.replace(/ /g,O)):(t.num_min>0||t.den_min>0)&&k.push(a.value.replace(/./g,O)):a.rule===`num+int`?D&&d?k.push(a.value.replace(/ /g,O)):t.den_min>0&&(d||t.num_min)&&k.push(a.value.replace(/./g,O)):a.rule===`den`&&(D?k.push(a.value.replace(/ /g,O)):(t.den_min>0||t.den_min>0)&&k.push(a.value.replace(/./g,O))):k.push(a.value.replace(/ /g,O));else if(f===`space`)a.rule===`num+int`?(D||t.num_min||t.den_min)&&(d||t.num_min)&&k.push(O):k.push(O);else if(f===`error`)k.push(n.invalid);else if(f===`point`)k.push(t.date?a.value:C.decimal);else if(f===`general`)Yl(k,t,e,C);else if(f===`exp`)k.push(C.exponent);else if(f===`minus`)a.volatile&&t.date||a.volatile&&(e>=0||typeof e!=`number`)||(a.volatile&&!t.fractions&&(t.integer||t.dec_fractions)?(e<0&&d&&d!==`0`||u)&&k.push(C.negative):k.push(C.negative));else if(f===`plus`)k.push(C.positive);else if(f===`text`)k.push(e);else if(f===`fill`)n.fillChar&&k.push(n.fillChar,a.value);else if(f===`skip`)n.skipChar?k.push(n.skipChar,a.value):k.push(n.nbsp?`\xA0`:` `);else if(f===`div`)D?k.push(`/`):t.num_min>0||t.den_min>0?k.push(O):k.push(Xl(`#`,n.nbsp));else if(f===`int`)if(t.int_pattern.length===1){let e=t.int_p,r=Math.max(t.int_min,d.length),i=``;for(let a=r;a>0;a--){let r=d.charAt(d.length-a),o=r?``:e.charAt(e.length-a)||e[0],s=``;if(t.grouping){let e=a-1-w;e>=0&&!(e%T)&&(s=r||o===`0`?C.group:Xl(`?`,n.nbsp))}i+=(r||Xl(o,n.nbsp))+s}k.push(i)}else M.int+=A(d,t.int_p,a.num,M.int);else if(f===`frac`){let e=M.frac;for(let t=0;t<E;t++)k.push(u[t+e]||Xl(a.num[t],n.nbsp));M.frac+=E}else if(f===`man`)!M[f]&&!M.man&&k.push(s),M.man+=A(o,t.man_p,a.num,M.man);else if(f===`num`)M.num+=A(c,t.num_p,a.num,M.num);else if(f===`den`){let e=M.den;for(let t=0;t<E;t++){let r=l[t+e];if(!r){let e=a.num[t];`123456789`.includes(e)||j&&e===`0`?(j=!0,r=n.nbsp?`\xA0`:` `):r=!j&&t===E-1&&e===`0`&&!l?`1`:Xl(e,n.nbsp)}k.push(r)}M.den+=E}else if(f===`year`)h<0&&k.push(C.negative),k.push(String(Math.abs(h)).padStart(4,`0`));else if(f===`year-short`){let e=h%100;k.push(e<10?`0`:``,e)}else if(f===`month`)k.push(a.pad&&g<10?`0`:``,g);else if(f===`monthname-single`)t.date_system===6?k.push(C.mmmm6[g-1].charAt(0)):k.push(C.mmmm[g-1].charAt(0));else if(f===`monthname-short`)t.date_system===6?k.push(C.mmm6[g-1]):k.push(C.mmm[g-1]);else if(f===`monthname`)t.date_system===6?k.push(C.mmmm6[g-1]):k.push(C.mmmm[g-1]);else if(a.type===`weekday-short`)k.push(C.ddd[v]);else if(f===`weekday`)k.push(C.dddd[v]);else if(f===`day`)k.push(a.pad&&_<10?`0`:``,_);else if(f===`hour`){let e=y%t.clock||(t.clock<24?t.clock:0);k.push(a.pad&&e<10?`0`:``,e)}else if(f===`min`)k.push(a.pad&&b<10?`0`:``,b);else if(f===`sec`)k.push(a.pad&&x<10?`0`:``,x);else if(f===`subsec`){k.push(C.decimal);let e=S.toFixed(t.sec_decimals);k.push(e.slice(2,2+a.decimals))}else if(f===`ampm`){let e=y<12?0:1;a.short&&!r?k.push(`AP`[e]):k.push(C.ampm[e])}else if(f===`hour-elap`){e<0&&k.push(C.negative);let t=p*24+Math.floor(Math.abs(m)/3600);k.push(String(Math.abs(t)).padStart(a.pad,`0`))}else if(f===`min-elap`){e<0&&k.push(C.negative);let t=p*1440+Math.floor(Math.abs(m)/60);k.push(String(Math.abs(t)).padStart(a.pad,`0`))}else if(f===`sec-elap`){e<0&&k.push(C.negative);let t=p*Zl+Math.abs(m);k.push(String(Math.abs(t)).padStart(a.pad,`0`))}else if(f===`b-year`)k.push(h+543);else if(f===`b-year-short`){let e=(h+543)%100;k.push(e<10?`0`:``,e)}}return k.join(``)}let eu=Vl([{type:hc,value:`@`,raw:`@`}]);function tu(e,t){for(let n=0;n<3;n++){let r=t[n];if(r){let t;if(r.condition){let n=r.condition[0],i=r.condition[1];n===`=`?t=e===i:n===`>`?t=e>i:n===`<`?t=e<i:n===`>=`?t=e>=i:n===`<=`?t=e<=i:n===`<>`&&(t=e!==i)}else t=!0;if(t)return r}}}function nu(e,t,n){let r=t.partitions,i=r[3],a=null;return(typeof e==`number`||typeof e==`bigint`)&&isFinite(e)&&(i=tu(e,r)),i!=null&&i.color&&(a=i.color),a&&typeof a==`number`&&n.indexColors&&(a=zc[a-1]||`#000`),a}function ru(e,t,n){let r=t.partitions,i=Jc(t.locale||n.locale),a=r[3]?r[3]:eu;if(typeof e==`boolean`&&(e=(i||Xc).bool[+!e]),e==null)return``;let o=typeof e==`bigint`;if(typeof e!=`number`&&!o)return $l(e,a,n,i);if(!o&&!isFinite(e)){let t=i||Xc;return isNaN(e)?t.nan:(e<0?t.negative:``)+t.infinity}let s=tu(e,r);return s?$l(e,s,n,i):n.overflow}function iu(e){var t,n,r,i;return!!((t=e[0])!=null&&t.percent||(n=e[1])!=null&&n.percent||(r=e[2])!=null&&r.percent||(i=e[3])!=null&&i.percent)}function au(e){var t,n,r,i;return!!((t=e[0])!=null&&t.date||(n=e[1])!=null&&n.date||(r=e[2])!=null&&r.date||(i=e[3])!=null&&i.date)}function ou(e){let[t,n,r,i]=e;return!!((!t||t.generated)&&(!n||n.generated)&&(!r||r.generated)&&i!=null&&i.text&&!i.generated)}let su={text:15,datetime:10.8,date:10.8,time:10.8,percent:10.6,currency:10.4,grouped:10.2,scientific:6,number:4,fraction:2,general:0,error:0},cu=[[`DMY`,1],[`DM`,2],[`MY`,3],[`MDY`,4],[`MD`,5],[`hmsa`,6],[`hma`,7],[`hms`,8],[`hm`,9]];function lu(e,t=null){var n;let[r,i]=e,a=r.frac_max,o={type:`general`,isDate:au(e),isText:ou(e),isPercent:iu(e),maxDecimals:r.general?9:a,scale:(n=r.scale)==null?1:n,color:0,parentheses:0,grouped:+!!r.grouping},s=!o.isDate&&!o.isText&&!r.error&&r.tokens.some(e=>e.type===`string`&&(t?e.value===t:Vc.test(e.value))),c=`G`,l=a>=0?Math.min(15,a):``,u=``,d=``;if(i!=null&&i.color&&(d=`-`,o.color=1),r.parens&&(u=`()`,o.parentheses=1),s)c=`C`,o.type=`currency`;else if(r.error)o.type=`error`,o.maxDecimals=0;else if(o.isDate){let e=0,t=0,n=``;r.tokens.forEach(r=>{let i=r.type;/^(b-)?year/.test(i)?(n+=`Y`,t++):i.startsWith(`month`)?(n+=`M`,t++):/^(week)?day/.test(i)?(n+=`D`,t++):(i===`hour`||i===`min`||i===`sec`||i===`ampm`)&&(n+=i[0],e++)}),o.type=`date`,t&&e?o.type=`datetime`:!t&&e&&(o.type=`time`);let i=cu.find(e=>n.startsWith(e[0]));c=i?`D`:`G`,l=i?i[1]:``}else o.isText?(c=`G`,o.type=`text`,l=``,o.maxDecimals=0):r.general?(c=`G`,o.type=`general`,l=``):r.fractions?(c=`G`,o.type=`fraction`,l=``):r.exponential?(c=`S`,o.type=`scientific`):o.isPercent?(c=`P`,o.type=`percent`):r.grouping?(c=`,`,o.type=`grouped`):(r.int_max||a)&&(c=`F`,o.type=`number`);return o.code=c+l+d+u,o.level=su[o.type],Object.freeze(o)}function uu(e){let[t]=e;return{year:!!(t.date&2),month:!!(t.date&4),day:!!(t.date&8),hours:!!(t.date&16),minutes:!!(t.date&32),seconds:!!(t.date&64),clockType:t.clock===12?12:24}}let du=[[oc,/^General/i,0],[sc,/^#/,0],[cc,/^0/,0],[lc,/^\?/,0],[uc,/^\//,0],[mc,/^;/,0],[hc,/^@/,0],[gc,/^\+/,0],[_c,/^-/,0],[vc,/^\./,0],[yc,/^ /,0],[bc,/^%/,0],[xc,/^[1-9]/,0],[Sc,/^(?:B[12])/i,0],[Cc,/^B$/,0],[wc,/^(?:[hH]+|[mM]+|[sS]+|[yY]+|[bB]+|[dD]+|[gG]+|[aA]{3,}|e+)/,0],[Tc,/^(?:\[(h+|m+|s+)\])/i,1],[Ec,/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/,[1,2]],[Dc,/^\[(DBNum[0-4]?\d)\]/i,1],[Oc,/^\[(NatNum[0-4]?\d)\]/i,1],[kc,/^\[\$([^\]]+)\]/,1],[Ac,/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*\d+)\]/i,1],[jc,/^\[([^\]]+)\]/,1],[Mc,/^(?:AM\/PM|am\/pm|A\/P)/,0],[Nc,/^\\(.)/,1],[Pc,/^"([^"]*?)"/,1],[Fc,/^_(\\.|.)/,1],[`exp`,/^[Ee]([+-])/,1],[Ic,/^\*(\\.|.)/,1],[Lc,/^[()]/,0],[Cc,/^[EÈÉÊËèéêëĒēĔĕĖėĘęĚěȄȅȆȇȨȩNnÑñŃńŅņŇňǸǹ["*/\\_]/,0],[Rc,/^./,0]],fu=e=>{let t=(e||`\0`).charCodeAt(0);return t===63||t===35||t>=48&&t<=57};function pu(e){let t=0,n=[],r=[];for(;t<e.length;){let i=e.slice(t),a=0,o=/^(,+)(.)?/.exec(i);if(o){let i=o[1];a=i.length;let s=e[t-1]||``,c=!1,l=!1;fu(s)?(c=!0,l=!0):s===`.`&&(l=!0);let u=o[2]||``;if(c&&(!u||u===`;`)&&(c=!1),l&&fu(u)&&(l=!1),c&&!l)n.push({type:dc,value:`,`,raw:i});else if(!c&&l)n.push({type:fc,value:`,`,raw:i});else if(c&&l){let e={type:fc,value:`,`,raw:i};n.push(e),r.push(e)}else n.push({type:pc,value:`,`,raw:i})}else{let e;for(let[t,r,o]of du){let s=r.exec(i);if(s){e={type:t,value:Array.isArray(o)?o.map(e=>s[e]):s[o||0],raw:s[0]},n.push(e),a=s[0].length;break}}r.length&&e.raw===`;`&&(r.length=0),r.length&&fu(e.raw)&&(r.forEach(e=>e.type=dc),r.length=0)}if(!a){let e=i[0];a=1,n.push({type:Rc,value:e,raw:e})}t+=a}return n}let mu=e=>{var t;let[n,r]=(t=e.condition)==null?[]:t;r<0&&(n===`<`||n===`<=`||n===`=`)||r===0&&n===`<`||e.tokens.unshift({type:`minus`,volatile:!0})},hu=(e,t=null)=>{let n={};for(let t in e)Array.isArray(e[t])?n[t]=[...e[t]]:n[t]=e[t];return t&&n.tokens.unshift(t),n.generated=!0,n};function gu(e){let t=[],n=!1,r,i=null,a=0,o=!1,s=0,c=0,l=pu(e);do{var u;if(o=Vl(l),(o.date||o.general)&&(o.int_pattern.length||o.frac_pattern.length||o.scale!==1||o.text))throw Error(`Illegal format`);if(o.condition&&(c++,n=!0),o.text){if(i)throw Error(`Unexpected partition`);i=o}o.locale&&(r=qc(o.locale)),t.push(o),a=+(((u=l[o.tokensUsed])==null?void 0:u.type)===`break`),l=l.slice(o.tokensUsed+a),s++}while(a&&s<4&&c<3);if(a)throw Error(`Unexpected partition`);if(c>2)throw Error(`Unexpected condition`);let d=t[3];if(d&&(d.int_pattern.length||d.frac_pattern.length||d.date))throw Error(`Unexpected partition`);if(n){t[0].condition||(t[0].condition=[`>`,0]);let e=t.length;if(e===1&&(t[1]=Vl(pu(`General`)),t[1].generated=!0),e<3){let e=t[0],n=t[1];if(mu(e),n.condition)mu(n);else{let t=e.condition;(t[0]===`=`||t[1]>=0&&(t[0]===`>`||t[0]===`>=`))&&n.tokens.unshift({type:`minus`,volatile:!0})}}else t.forEach(mu)}else{if(t.length<4&&i)for(let e=0,n=t.length;e<n;e++)t[e]===i&&t.splice(e,1);if(t.length<1&&i&&(t[0]=Vl(pu(`General`)),t[0].generated=!0),t.length<2&&t.push(hu(t[0],{type:`minus`,volatile:!0})),t.length<3&&t.push(hu(t[0])),t.length<4)if(i)t.push(i);else{let e=Vl(pu(`@`));e.generated=!0,t.push(e)}t[0].condition=[`>`,0],t[1].condition=[`<`,0],t[2].condition=null}return{pattern:e,partitions:t,locale:r}}var _u=p({addLocale:()=>q,dateFromSerial:()=>_l,dateToSerial:()=>gl,dec2frac:()=>cl,format:()=>bu,formatColor:()=>xu,getFormatDateInfo:()=>Du,getFormatInfo:()=>Eu,getLocale:()=>Jc,isDateFormat:()=>Su,isPercentFormat:()=>Cu,isTextFormat:()=>wu,isValidFormat:()=>Tu,parseBool:()=>Ll,parseDate:()=>Pl,parseLocale:()=>Kc,parseNumber:()=>Ol,parseTime:()=>Il,parseValue:()=>Rl,round:()=>sl,tokenTypes:()=>Ou,tokenize:()=>pu});let vu=Object.create({});function yu(e,t=!1){e||(e=`General`);let n=vu[e];if(!n)try{n=gu(e),vu[e]=n}catch(r){if(t)throw r;let i={tokens:[{type:`error`}],error:r.message};n={pattern:e,partitions:[i,i,i,i],error:r.message,locale:null}}return n}function bu(e,t,n={}){var r;let i=Object.assign({},ol,n),a=yu(e,i.throws);return ru((r=gl(t,i))==null?t:r,a,i)}function xu(e,t,n){var r;let i=Object.assign({},ol,n),a=yu(e,i.throws);return nu((r=gl(t,i))==null?t:r,a,i)}function Su(e){return au(yu(e,!1).partitions)}function Cu(e){return iu(yu(e,!1).partitions)}function wu(e){return ou(yu(e,!1).partitions)}function Tu(e){try{return yu(e,!0),!0}catch{return!1}}function Eu(e,t={}){let n=yu(e,!1);return n.info||(n.info=lu(n.partitions,t==null?void 0:t.currency)),n.info}function Du(e){let t=yu(e,!1);return t.dateInfo||(t.dateInfo=uu(t.partitions)),t.dateInfo}let Ou=Object.freeze({AMPM:Mc,BREAK:mc,CALENDAR:Sc,CHAR:Rc,COLOR:Ac,COMMA:pc,CONDITION:Ec,DATETIME:wc,DBNUM:Dc,DIGIT:xc,DURATION:Tc,ERROR:Cc,ESCAPED:Nc,EXP:`exp`,FILL:Ic,GENERAL:oc,GROUP:dc,HASH:sc,LOCALE:kc,MINUS:_c,MODIFIER:jc,NATNUM:Oc,PAREN:Lc,PERCENT:bc,PLUS:gc,POINT:vc,QMARK:lc,SCALE:fc,SKIP:Fc,SLASH:uc,SPACE:yc,STRING:Pc,TEXT:hc,ZERO:cc});function ku(e){return e===`@@@`||e===`@`}function Au(e){return e==null||e===`General`}let ju=(e,t)=>{if(e&&!t||!e&&t)return!1;let n=e=>{let t=pu(e),n=``,r=!1,i=!1;for(let e of t){if(e.type===Ou.POINT){r=!0;continue}if(!(i&&e.type===Ou.MINUS)&&e.type!==Ou.SKIP){if(e.type===Ou.COLOR){i=!0;continue}else i=!1;r&&e.type===Ou.ZERO||(r=!1,r||(n+=e.value||``))}}return n};return n(e)===n(t)},Mu=new Set([`m d`]),Nu=new Set([`h:mm AM/PM`,`hh:mm AM/PM`]),Pu=new Set([`$`,`¥`,`₽`,`₫`,`NT$`,`€`,`₩`,`﷼`]),Fu=e=>{var t,n;let r=(t=(n=Pl(e))==null?Il(e):n)==null?Ol(e):t;if(!r)return null;let{z:i}=r;if(i){if(Mu.has(i)||Nu.has(i)&&!/\s(A|AM|P|PM)$/i.test(e))return null;if(i.includes(`#,##0`)){if(/[.,]$/.test(e))return null;let t=e.replace(RegExp(`^[${[...Pu].join(``)}]+`),``).trim();if(t.includes(`,`)&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(t))return null}}return r};function Iu(e,t){let n={};for(let r in e){let i=Number(r),a=e[i];for(let e in a){let r=Number(e),o=a[r],s=t(i,r,o);s!==void 0&&(n[i]?n[i][r]=s:n[i]={[r]:s})}}return n}function Lu(e){let t=0,n=Object.keys(e);for(let e of n){let n=Number(e);t=Math.max(t,n)}return t+1}let Ru=e=>e==null||typeof e==`object`&&Object.keys(e).length===0;function zu(e,t,n){let r=Lu(n),i=n;for(let t=r-1;t>=e;t--)Ru(i[t])?delete i[t+1]:i[t+1]=i[t];Ru(t)||(i[e]=t)}function Bu(e,t,n){let r=Object.keys(n).reduce((e,t)=>Math.max(e,Number.parseInt(t)),0)+1;for(let i=e;i<r;i++)i<e+t?delete n[i]:n[i]!==void 0&&(n[i-t]=n[i],delete n[i])}function Vu(e,t){let n=e,r=Object.keys(n),i=r.length,a=t,o=Object.keys(a),s=o.length,c={},l=0;for(let e=0;e<i;e++,l++)c[l]=n[r[e]];for(let e=0;e<s;e++,l++)c[l]=a[o[e]];return c}function Hu(e,t,n){let r=n;if(Lu(n)>0){let n={},i=0;for(let a=e;a<=t;a++)r[a]&&(n[i]=r[a],i++);return n}return{}}function Uu(e,t,n,r){let i=e>n;if(!i&&e+t>n)throw Error(`Invalid move operation`);i?Wu(e,t,n,r):Gu(e,t,n,r)}function Wu(e,t,n,r){let i=r,a=[];for(let n=e;n<e+t;n++)a.push(i[n]);for(let r=e-1;r>=n;r--){let e=i[r];i[r+t]=e,e===void 0&&delete i[r+t]}a.forEach((e,t)=>{i[n+t]=e,e===void 0&&delete i[n+t]})}function Gu(e,t,n,r){let i=r,a=[];for(let n=e;n<e+t;n++)a.push(i[n]);for(let r=e+t;r<n;r++){let e=i[r];i[r-t]=e,e===void 0&&delete i[r-t]}a.forEach((e,r)=>{i[n+r-t]=e,e===void 0&&delete i[n+r-t]})}var Ku=class e{constructor(e={}){R(this,`_matrix`,void 0),this._setOriginValue(e)}static MakeObjectMatrixSize(t){return new e({[t-1]:{}})}getMatrix(){return this._matrix}forEach(e){let t=this._matrix,n=Object.keys(t);for(let r of n){let n=Number(r),i=t[n];if(e(n,i)===!1)return this}return this}forRow(e){let t=this._matrix,n=Object.keys(t);for(let r of n){let n=Number(r),i=t[n];if(e(n,Object.keys(i).map(e=>Number(e)))===!1)return this}return this}forValue(e){let t=this._matrix;for(let n in t){let r=Number(n),i=t[r];if(i)for(let t in i){let n=Number(t),a=i[n];if(e(r,n,a)===!1)return this}}return this}swapRow(e,t){let n=this._matrix[e],r=this._matrix[t];this._matrix[e]=r,this._matrix[t]=n}getRow(e){return this._matrix[e]}getRowOrCreate(e){let t=this.getRow(e);return t==null&&(t={},this._matrix[e]=t),t}reset(){this._setOriginValue({})}hasValue(){let e=this._matrix,t=Object.keys(e);if(t.length===0)return!1;for(let n of t){let t=e[Number(n)];if(Object.keys(t).length>0)return!0}return!1}getValue(e,t){var n;return(n=this._matrix)==null||(n=n[e])==null?void 0:n[t]}setValue(e,t,n){let r=this.getRowOrCreate(e);r[t]=n}deleteValue(e,t){var n;(n=this._matrix)==null||(n=n[e])==null||delete n[t]}realDeleteValue(e,t){var n;if((n=this._matrix)==null||(n=n[e])==null||delete n[t],this.getRow(e)){let t=this.getRow(e);if(t==null)return;if(Object.keys(t).length===0){var r;(r=this._matrix)==null||delete r[e]}}}setRow(e,t){this._matrix[e]=t}moveRows(e,t,n){Uu(e,t,n,this._matrix)}moveColumns(e,t,n){this.forEach((r,i)=>{Uu(e,t,n,i)})}insertRows(e,t){let n=Object.keys(this._matrix);for(let r=n.length-1;r>=0;r--){let i=Number(n[r]);if(i>=e){let e=this._matrix[i];delete this._matrix[i],this._matrix[i+t]=e}}}insertColumns(e,t){let n=Object.keys(this._matrix);for(let r=0;r<n.length;r++){let i=Number(n[r]),a=this._matrix[i],o=Object.keys(a);for(let n=o.length-1;n>=0;n--){let r=Number(o[n]);if(r>=e){let e=a[r];delete a[r],a[r+t]=e}}}}removeRows(e,t){Bu(e,t,this._matrix)}removeColumns(e,t){this.forEach((n,r)=>{r&&Bu(e,t,r)})}getFragment(t,n,r,i){let a=new e,o=0;for(let e=t;e<=n;e++){let t={},n=0;for(let a=r;a<=i;a++)t[n]=this.getValue(e,a),n++;a.setRow(o,t),o++}return a}getSlice(t,n,r,i){let a=new e;for(let e=t;e<=n;e++)for(let t=r;t<=i;t++){let n=this.getValue(e,t);n&&a.setValue(e,t,H.deepClone(n))}return a}getSliceDataAndCellCountByRows(t,n){let r=new e,i=0;for(let e=t;e<=n;e++){let t=this.getRow(e);t&&(r.setRow(e,t),i+=Object.keys(t).length)}return{sliceData:r,cellCount:i}}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Lu(this._matrix)}getRange(){let e=this.getLength()-1,t=0,n=this.getLength();for(let e=0;e<n;e++){let n=this.getRow(e);if(n){let e=Lu(n)-1;t=e>t?e:t}}return{startRow:0,startColumn:0,endRow:e,endColumn:t}}getRealRange(){let e=Object.keys(this._matrix),t=e.length,n=t>0?Number(e[0]):0,r=t>0?Number(e[t-1]):0,i=-1/0,a=0;for(let t of e){let e=this.getRow(Number(t));if(e){let t=Object.keys(e);if(t.length>0){let e=Number(t[0]),n=Number(t[t.length-1]);(i===-1/0||e<i)&&(i=e),n>a&&(a=n)}}}return i===-1/0&&(i=0),{startRow:n,endRow:r,startColumn:i,endColumn:a}}getRealRowRange(){let e=Object.keys(this._matrix),t=e.length;return{startRow:t>0?Number(e[0]):0,endRow:t>0?Number(e[t-1]):0}}toNativeArray(){let e=[];return this.forValue((t,n,r)=>{e.push(r)}),e}toArray(){let e=[];return this.forRow((t,n)=>{e[t]==null&&(e[t]=[]),n.forEach(n=>{e[t][n]=this.getValue(t,n)})}),e}toFullArray(){let{endColumn:e,endRow:t}=this.getRange(),n=[];for(let r=0;r<=t;r++){let t=Array(e+1).fill(void 0);n.push(t)}return this.forValue((e,t,r)=>{n[e][t]=r}),n}toJSON(){return this._matrix}clone(){let e=JSON.stringify(this._matrix);return JSON.parse(e)}getData(){let e=JSON.stringify(this._matrix);return JSON.parse(e)}getArrayData(){let t=0,n=0,r=!1,i=!1,a=new e;return this.forEach((e,o)=>{r||(r=!0,t=e),Object.keys(o).forEach(r=>{let o=Number(r);i?o<n&&(n=o):(i=!0,n=o);let s=this.getValue(e,o);a.setValue(e-t,o-n,s)})}),a.getData()}getStartEndScope(){let e=-1,t=-1,n=-1,r=-1,i=Object.keys(this._matrix);i.length>0&&(e=+i[0],t=+i[i.length-1]);for(let e of i){let t=Object.keys(this._matrix[e]);t.length>0&&(n=n===-1?+t[0]:Math.min(n,+t[0]),r=Math.max(r,+t[t.length-1]))}return{startRow:e,endRow:t,startColumn:n,endColumn:r}}getDataRange(){let e=0,t=0,n=0,r=-1,i=!1,a=!1;return this.forEach((o,s)=>{if(i||(i=!0,e=o),s==null)return;let c=Lu(s)-1;c>n&&(n=c),Object.keys(s).forEach(e=>{let n=Number(e);a?n<t&&(t=n):(a=!0,t=n)}),o>r&&(r=o)}),{startRow:e,startColumn:t,endRow:r,endColumn:n}}getDiscreteRanges(){let e=[];return this.forEach((t,n)=>{Object.keys(n).forEach(n=>{let r=Number(n),i=!1;for(let n of e)if(t>=n.startRow&&t<=n.endRow+1&&r>=n.startColumn&&r<=n.endColumn+1){n.endRow=Math.max(t,n.endRow),n.endColumn=Math.max(r,n.endColumn),i=!0;break}i||e.push({startRow:t,endRow:t,startColumn:r,endColumn:r})})}),e}merge(e){this.forValue((t,n)=>{let r=e.getValue(t,n);r!=null&&this.setValue(t,n,r)})}concatRows(e){let t=e.getMatrix();for(let e in t){let n=Number(e);this.setRow(n,t[n])}}_setOriginValue(e={}){this._matrix=e}};function qu(e){let{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:i,mergeInfo:a}=e,{startY:o,endY:s,startX:c,endX:l}=e,u=t,d=n,f=t,p=n;if(r&&a){let{startRow:e,startColumn:t,endRow:n,endColumn:r,startY:i,endY:m,startX:h,endX:g}=a;u=e,d=t,f=n,p=r,o=i,s=m,c=h,l=g}return i&&(o=a.startY,s=a.endY,c=a.startX,l=a.endX,f=a.endRow,p=a.endColumn),{startRow:u,startColumn:d,endRow:f,endColumn:p,startY:o,endY:s,startX:c,endX:l}}let Ju=qu;function Yu(e){if(!e)return;let{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:i,startRow:a,startColumn:o,endRow:s,endColumn:c}=e,l=t,u=n,d=t,f=n;return(r||i)&&(l=a,u=o,d=s,f=c),{startRow:l,startColumn:u,endRow:d,endColumn:f}}function Xu(e){var t;return!e||((e==null||(t=e.v)==null?void 0:t.toString())||``).length===0&&!e.p}function Zu(e){return Xu(e)&&(e==null?void 0:e.coverable)!==!1}function Qu(e){if(e){if(e.rgb)return new As(e.rgb).toHexString();if(e.th!=null){var t;let n=(t=ac.Office)==null?void 0:t[e.th];if(n)return new As(n).toRgbString()}}return null}function $u(e){return H.isString(e)&&e.substring(0,1)===`=`&&e.length>1}function ed(e){return H.isString(e)&&e.length>0}function td(e,t=!1){let n=``,r=new Map([[`ff`,()=>{e.ff&&(n+=`font-family: ${e.ff}; `)}],[`fs`,()=>{if(e.fs){let t=e.fs;e.va&&(t/=2),n+=`font-size: ${t}pt; `}}],[`it`,()=>{e.it&&(n+=`font-style: italic; `)}],[`bl`,()=>{e.bl&&(n+=`font-weight: bold; `)}],[`ul`,()=>{var t;(t=e.ul)!=null&&t.s&&(n.indexOf(`text-decoration-line`)>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(e,t)=>`${t} underline`):n+=`text-decoration: underline; `,e.ul.cl&&n.indexOf(`text-decoration-color`)===-1&&(n+=`text-decoration-color: ${Qu(e.ul.cl)}; `),e.ul.t&&n.indexOf(`text-decoration-style`)===-1&&(n+=`text-decoration-style: ${e.ul.t} `))}],[`st`,()=>{var t;(t=e.st)!=null&&t.s&&(n.indexOf(`text-decoration-line`)>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(e,t)=>`${t} line-through`):n+=`text-decoration-line: line-through; `,e.st.cl&&n.indexOf(`text-decoration-color`)===-1&&(n+=`text-decoration-color: ${Qu(e.st.cl)}; `),e.st.t&&n.indexOf(`text-decoration-style`)===-1&&(n+=`text-decoration-style: ${e.st.t} `))}],[`ol`,()=>{var t;(t=e.ol)!=null&&t.s&&(n.indexOf(`text-decoration-line`)>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(e,t)=>`${t} overline`):n+=`text-decoration-line: overline; `,e.ol.cl&&n.indexOf(`text-decoration-color`)===-1&&(n+=`text-decoration-color: ${Qu(e.ol.cl)}; `),e.ol.t&&n.indexOf(`text-decoration-style`)===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],[`bg`,()=>{e.bg&&(n+=`background: ${Qu(e.bg)}; `)}],[`bd`,()=>{var t,r,i,a;if((t=e.bd)!=null&&t.b){var o,s;n+=`border-bottom: ${nd((o=e.bd)==null?void 0:o.b.s)} ${(s=Qu(e.bd.b.cl))==null?``:s}; `}if((r=e.bd)!=null&&r.t){var c,l;n+=`border-top: ${nd((c=e.bd)==null?void 0:c.t.s)} ${(l=Qu(e.bd.t.cl))==null?``:l}; `}if((i=e.bd)!=null&&i.r){var u,d;n+=`border-right: ${nd((u=e.bd)==null?void 0:u.r.s)} ${(d=Qu(e.bd.r.cl))==null?``:d}; `}if((a=e.bd)!=null&&a.l){var f,p;n+=`border-left: ${nd((f=e.bd)==null?void 0:f.l.s)} ${(p=Qu(e.bd.l.cl))==null?``:p}; `}}],[`cl`,()=>{e.cl&&(n+=`color: ${Qu(e.cl)}; `)}],[`va`,()=>{e.va===2?n+=`vertical-align: sub; `:e.va===3&&(n+=`vertical-align: super; `)}],[`td`,()=>{e.td===1?n+=`direction: ltr; `:e.td===2&&(n+=`direction: rtl; `)}],[`tr`,()=>{if(e.tr){var t,r,i;n+=`--data-rotate: (${(t=e.tr)==null?void 0:t.a}deg${(r=e.tr)!=null&&r.v?` ,${(i=e.tr)==null?void 0:i.v}`:``});`}}],[`ht`,()=>{e.ht===1?n+=`text-align: left; `:e.ht===3?n+=`text-align: right; `:e.ht===2?n+=`text-align: center; `:e.ht===4&&(n+=`text-align: justify; `)}],[`vt`,()=>{e.vt===3?n+=`vertical-align: bottom; `:e.vt===1?n+=`vertical-align: top; `:e.vt===2&&(n+=`vertical-align: middle; `)}],[`tb`,()=>{e.tb===2?n+=`white-space: nowrap; overflow-x: hidden; `:e.tb===3&&(n+=`white-space: normal;`)}],[`pd`,()=>{var t,r,i,a,o,s,c,l;let u=`${(t=e.pd)==null?void 0:t.b}pt`,d=`${(r=e.pd)==null?void 0:r.t}pt`,f=`${(i=e.pd)==null?void 0:i.l}pt`,p=`${(a=e.pd)==null?void 0:a.r}pt`;(o=e.pd)!=null&&o.b&&(n+=`padding-bottom: ${u}; `),(s=e.pd)!=null&&s.t&&(n+=`padding-top: ${d}; `),(c=e.pd)!=null&&c.l&&(n+=`padding-left: ${f}; `),(l=e.pd)!=null&&l.r&&(n+=`padding-right: ${p}; `)}]]),i=[`bd`,`tr`,`tb`];for(let n in e){var a;t&&i.includes(n)||(a=r.get(n))==null||a()}return n}function nd(e){let t=``;return e===0?t=`none`:e===1?t=`0.5pt solid`:e===2?t=`0.5pt double`:e===3?t=`0.5pt dotted`:e===4||e===5?t=`0.5pt dashed`:e===6?t=`0.5pt dotted`:e===7?t=`0.5pt double`:e===8?t=`1pt solid`:e===9||e===10?t=`1pt dashed`:e===11?t=`1pt dotted`:e===12?t=`0.5pt dashed`:e===13&&(t=`1.5pt solid`),t}function rd(e){let t=0;if(e=e.trim(),e===`none`)t=0;else if(e===`0.5pt solid`)t=1;else if(e===`0.5pt double`)t=2;else if(e===`0.5pt dotted`)t=3;else if(e===`0.5pt dashed`)t=4;else if(e===`1pt solid`)t=8;else if(e===`1pt dashed`)t=9;else if(e===`1pt dotted`)t=11;else if(e===`1.5pt solid`)t=13;else if(!e.includes(`none`))t=1;else return 0;return t}function id(e,t){let n=e.body;if(t){let{headers:r,footers:i}=e;r!=null&&r[t]?n=r[t].body:i!=null&&i[t]&&(n=i[t].body)}return n}function ad(e,t){let{startRow:n,endRow:r,startColumn:i,endColumn:a,rangeType:o}=e;if(n<0||i<0||r<0||a<0||!(Number.isNaN(n)&&Number.isNaN(r))&&o===2||!(Number.isNaN(i)&&Number.isNaN(a))&&o===1||o!==1&&o!==2&&(Number.isNaN(i)||Number.isNaN(n)||Number.isNaN(a)||Number.isNaN(r)))return!1;if(t){let e=t.getRowCount(),n=t.getColumnCount();if(r>=e||a>=n)return!1}return!0}function od(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function sd(e){if($u(e))return{f:e,v:null,p:null};if(Zs(e)){if(typeof e==`string`){let t=Fu(e);if(t&&t.z)return{v:t.v,p:null,f:null,s:{n:{pattern:t.z||`General`}}}}return{v:e,p:null,f:null}}return Js(e),e}function cd(e,t){let n=new Ku,{startRow:r,startColumn:i,endRow:a,endColumn:o}=t;if(H.isArray(e))for(let t=0;t<=a-r;t++)for(let a=0;a<=o-i;a++)n.setValue(t+r,a+i,sd(e[t][a]));else new Ku(e).forValue((e,t,r)=>{n.setValue(e,t,sd(r))});return n.getMatrix()}function ld(e,t){return Object.prototype.toString.call(e)===Object.prototype.toString.call(t)?Object.prototype.toString.call(e)===`[object Object]`||Object.prototype.toString.call(e)===`[object Array]`?Object.keys(e).length===Object.keys(t).length?Object.keys(e).every(n=>ld(e[n],t[n])):!1:e===t:!1}function ud(e,t){let n=e.ts||{},r=t.ts||{};return e.sId===t.sId?ld(n,r):!1}function dd(e,t){return t.some(t=>e.indexOf(t)>-1)}let fd=1e3*1,pd=60*fd,md=60*pd;24*md;let hd=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],gd=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],_d=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],vd=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],yd=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],bd={L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`,l:`M/D/YYYY`,ll:`MMM D, YYYY`,lll:`MMM D, YYYY h:mm A`,llll:`ddd, MMM D, YYYY h:mm A`},xd={millisecond:`millisecond`,milliseconds:`millisecond`,ms:`millisecond`,second:`second`,seconds:`second`,s:`second`,minute:`minute`,minutes:`minute`,m:`minute`,hour:`hour`,hours:`hour`,h:`hour`,day:`day`,days:`day`,d:`day`,week:`week`,weeks:`week`,w:`week`,month:`month`,months:`month`,M:`month`,year:`year`,years:`year`,y:`year`};var Sd=class e{constructor(e,t){this._date=e,this._isUTC=t}isValid(){return!Number.isNaN(this._date.getTime())}format(e=`YYYY-MM-DDTHH:mm:ssZ`){return this.isValid()?Ld(this._date,e,this._isUTC):`Invalid Date`}valueOf(){return this._date.getTime()}toDate(){return new Date(this.valueOf())}_clone(){return new e(this.toDate(),this._isUTC)}add(t,n=`millisecond`){let r=Od(n);return!this.isValid()||!r||!Number.isFinite(t)?this._clone():new e(jd(this._date,t,r,this._isUTC),this._isUTC)}subtract(e,t=`millisecond`){return this.add(-e,t)}startOf(t){let n=Od(t);return!n||!this.isValid()?this._clone():new e(Md(this._date,n,this._isUTC),this._isUTC)}endOf(e){let t=Od(e);return!t||!this.isValid()||t===`millisecond`?this._clone():this.startOf(t).add(1,t).subtract(1,`millisecond`)}utc(){return new e(this.toDate(),!0)}local(){return new e(this.toDate(),!1)}weekday(e){let t=(wd(this._date,this._isUTC).dayOfWeek-0+7)%7;return e===void 0?t:this.add(e-t,`day`)}week(e){let t=Nd(this._date,this._isUTC);return e===void 0?t:this.add((e-t)*7,`day`)}};function Cd(e,t=2){return String(Math.abs(e)).padStart(t,`0`)}function wd(e,t){return t?{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),millisecond:e.getUTCMilliseconds(),dayOfWeek:e.getUTCDay()}:{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),millisecond:e.getMilliseconds(),dayOfWeek:e.getDay()}}function Td(e,t){return e instanceof Sd?e.toDate():e===void 0?new Date:e===null?new Date(NaN):e instanceof Date?new Date(e.getTime()):typeof e==`number`?new Date(e):typeof e==`string`?Dd(e,t):new Date(NaN)}function Ed(e,t,n,r,i,a,o,s){let c=s?new Date(Date.UTC(e,t-1,n,r,i,a,o)):new Date(e,t-1,n,r,i,a,o),l=wd(c,s);return l.year!==e||l.month!==t||l.day!==n||l.hour!==r||l.minute!==i||l.second!==a?new Date(NaN):c}function Dd(e,t){let n=e.trim();if(!n)return new Date(NaN);let r=n.match(/^(\d{4})年(\d{1,2})月(\d{1,2})日(?:\s+(\d{1,2})(?::(\d{1,2})(?::(\d{1,2}))?)?)?$/);if(r){let[,e,n,i,a=`0`,o=`0`,s=`0`]=r;return Ed(Number(e),Number(n),Number(i),Number(a),Number(o),Number(s),0,t)}let i=n.match(/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})(?:[ T](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:\.(\d{1,3}))?)?)?)?$/);if(i){let[,e,n,r,a=`0`,o=`0`,s=`0`,c=`0`]=i;return Ed(Number(e),Number(n),Number(r),Number(a),Number(o),Number(s),Number(c),t)}return/^-?\d+(\.\d+)?$/.test(n)?new Date(Number(n)):new Date(n)}function Od(e){var t;return(t=xd[e])==null?xd[String(e).toLowerCase()]:t}function kd(e,t,n){return n?new Date(Date.UTC(e,t,0)).getUTCDate():new Date(e,t,0).getDate()}function Ad(e,t,n,r){let i=new Date(e.getTime());if(t){switch(n){case`year`:i.setUTCFullYear(r);break;case`month`:i.setUTCMonth(r);break;case`day`:i.setUTCDate(r);break;case`hour`:i.setUTCHours(r);break;case`minute`:i.setUTCMinutes(r);break;case`second`:i.setUTCSeconds(r);break;case`millisecond`:i.setUTCMilliseconds(r);break}return i}switch(n){case`year`:i.setFullYear(r);break;case`month`:i.setMonth(r);break;case`day`:i.setDate(r);break;case`hour`:i.setHours(r);break;case`minute`:i.setMinutes(r);break;case`second`:i.setSeconds(r);break;case`millisecond`:i.setMilliseconds(r);break}return i}function jd(e,t,n,r){switch(n){case`millisecond`:return new Date(e.getTime()+t);case`second`:return new Date(e.getTime()+t*fd);case`minute`:return new Date(e.getTime()+t*pd);case`hour`:return new Date(e.getTime()+t*md);case`day`:return Ad(e,r,`day`,(r?e.getUTCDate():e.getDate())+t);case`week`:return Ad(e,r,`day`,(r?e.getUTCDate():e.getDate())+t*7);case`month`:{let n=wd(e,r),i=Ed(n.year,n.month,1,n.hour,n.minute,n.second,n.millisecond,r),a=Ad(i,r,`month`,(r?i.getUTCMonth():i.getMonth())+t),o=wd(a,r),s=kd(o.year,o.month,r);return Ad(a,r,`day`,Math.min(n.day,s))}case`year`:return jd(e,t*12,`month`,r)}}function Md(e,t,n){let r=wd(e,n);switch(t){case`year`:return Ed(r.year,1,1,0,0,0,0,n);case`month`:return Ed(r.year,r.month,1,0,0,0,0,n);case`week`:{let e=(r.dayOfWeek-0+7)%7,t=Ed(r.year,r.month,r.day,0,0,0,0,n);return Ad(t,n,`day`,(n?t.getUTCDate():t.getDate())-e)}case`day`:return Ed(r.year,r.month,r.day,0,0,0,0,n);case`hour`:return Ed(r.year,r.month,r.day,r.hour,0,0,0,n);case`minute`:return Ed(r.year,r.month,r.day,r.hour,r.minute,0,0,n);case`second`:return Ed(r.year,r.month,r.day,r.hour,r.minute,r.second,0,n);default:return new Date(e.getTime())}}function Nd(e,t){let n=Md(e,`week`,t),r=Md(Md(e,`year`,t),`week`,t);return Math.floor((n.getTime()-r.getTime())/864e5/7)+1}function Pd(e,t,n=!1){if(t)return n?`+0000`:`+00:00`;let r=-e.getTimezoneOffset(),i=r>=0?`+`:`-`,a=Math.abs(r),o=Cd(Math.floor(a/60),2),s=Cd(a%60,2);return n?`${i}${o}${s}`:`${i}${o}:${s}`}function Fd(e){let t=e%100;if(t>=11&&t<=13)return`${e}th`;switch(e%10){case 1:return`${e}st`;case 2:return`${e}nd`;case 3:return`${e}rd`;default:return`${e}th`}}function Id(e){return e.replace(/LLLL|LLL|LL|L|llll|lll|ll|l/g,e=>{var t;return(t=bd[e])==null?e:t})}function Ld(e,t,n){let r=wd(e,n),i=r.hour%12,a=i===0?12:i,o=Math.ceil(r.month/3),s={YYYY:String(r.year),YY:Cd(r.year%100,2),MMMM:hd[r.month-1],MMM:gd[r.month-1],MM:Cd(r.month,2),M:String(r.month),DD:Cd(r.day,2),D:String(r.day),Do:Fd(r.day),dddd:_d[r.dayOfWeek],ddd:vd[r.dayOfWeek],dd:yd[r.dayOfWeek],d:String(r.dayOfWeek),HH:Cd(r.hour,2),H:String(r.hour),hh:Cd(a,2),h:String(a),mm:Cd(r.minute,2),m:String(r.minute),ss:Cd(r.second,2),s:String(r.second),SSS:Cd(r.millisecond,3),A:r.hour>=12?`PM`:`AM`,a:r.hour>=12?`pm`:`am`,Q:String(o),Qo:Fd(o),X:String(Math.floor(e.getTime()/1e3)),x:String(e.getTime()),Z:Pd(e,n,!1),ZZ:Pd(e,n,!0)},c=[];return Id(t.replace(/\[([^\]]+)]/g,(e,t)=>`\u0000${c.push(t)-1}\u0000`)).replace(/YYYY|YY|MMMM|MMM|MM|M|DD|Do|D|dddd|ddd|dd|d|HH|H|hh|h|mm|m|ss|s|SSS|A|a|Qo|Q|X|x|ZZ|Z/g,e=>{var t;return(t=s[e])==null?e:t}).replace(/\u0000(\d+)\u0000/g,(e,t)=>{var n;return(n=c[Number(t)])==null?``:n})}function Rd(e){return new Sd(Td(e,!1),!1)}let zd=Object.assign(Rd,{utc:e=>new Sd(Td(e,!0),!0),isDateKit:e=>e instanceof Sd,unix:e=>Rd(e*1e3)});function Bd(e,t,n,r){if(e>t)throw Error(`a1 should be less than a2`);if(n>r)throw Error(`b1 should be less than b2`);if(t<n||r<e)return[e,t];if(n<=e&&r>=t)return[];let i=r-n+1;return e<n&&t>r?[e,t-i]:n<=e&&r<t?[r+1-i,t-i]:n>e&&r>=t?[e,n-1]:[e,t]}function Vd(e){if(e==null)return!1;let t=e.bullet;return(t==null?void 0:t.listId)!=null}function Hd(e){if(e==null)return!1;let t=e.paragraphStyle;return Ud(t)}function Ud(e){var t;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((t=e.hanging)==null?void 0:t.v)===0)}function Wd(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Gd(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}function Kd(e){if(e==null||typeof e==`boolean`)return!1;if(typeof e==`number`)return!isNaN(e);if(typeof e==`string`){let t=e.trim();return t===``?!1:!isNaN(Number(t))}return!1}function qd(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+(t<<6)+(t<<16)-t;return t>>>0}function Jd(e){if(e.length===0)return[];let t=e.slice().sort((e,t)=>(Array.isArray(e)?e[0]:e)-(Array.isArray(t)?t[0]:t)),n=[],r=Array.isArray(t[0])?t[0][0]:t[0],i=r;for(let e=1;e<t.length;e++){let a=t[e],o,s;Array.isArray(a)?(o=a[0],s=a[1]):(o=a,s=a),o<=i+1?i=Math.max(i,s):(n.push([r,i]),r=o,i=s)}return n.push([r,i]),n}function Yd(e){if(e.length===0)return[];let t=e.slice().sort((e,t)=>e[0]-t[0]),n=[],[r,i]=t[0];for(let e=1;e<t.length;e++){let[a,o]=t[e];a<=i+1?i=Math.max(i,o):(n.push([r,i]),r=a,i=o)}return n.push([r,i]),n}function Xd(...e){let t;return t=e.length===1&&Array.isArray(e[0])?e[0]:e,Li({},...t)}let Zd,Qd,$d,ef,Y=Symbol(`newer`),X=Symbol(`older`);Zd=Symbol.iterator;var tf=class{constructor(e){R(this,`entry`,void 0),this.entry=e}[Zd](){return this}next(){let e=this.entry;return e?(this.entry=e[Y],{done:!1,value:e.key}):{done:!0,value:void 0}}};Qd=Symbol.iterator;var nf=class{constructor(e){R(this,`entry`,void 0),this.entry=e}[Qd](){return this}next(){let e=this.entry;return e?(this.entry=e[Y],{done:!1,value:e.value}):{done:!0,value:void 0}}};$d=Symbol.iterator;var rf=class{constructor(e){R(this,`entry`,void 0),this.entry=e}[$d](){return this}next(){let e=this.entry;return e?(this.entry=e[Y],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}}},af=class{constructor(e,t){R(this,`key`,void 0),R(this,`value`,void 0),R(this,Y,void 0),R(this,X,void 0),this.key=e,this.value=t,this[Y]=void 0,this[X]=void 0}toJSON(){return{key:this.key,value:this.value}}};ef=Symbol.iterator;var of=class{onShift(e){if(this._onShiftListeners.indexOf(e)===-1)return this._onShiftListeners.push(e),B(()=>x(this._onShiftListeners,e));throw Error(`[LRUMap]: the listener has been registered!`)}constructor(...e){if(R(this,`_keymap`,void 0),R(this,`size`,0),R(this,`limit`,void 0),R(this,`oldest`,void 0),R(this,`newest`,void 0),R(this,`_onShiftListeners`,[]),sf.hasLength(e,1)){if(sf.isNumber(e[0])){let t=e[0];this._initialize(t,void 0);return}if(sf.isIterable(e[0])){let t=e[0];this._initialize(0,t);return}return}if(sf.hasLength(e,2)){let t=e[0],n=e[1];this._initialize(t,n)}}_initialize(e,t){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=e,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[Y]&&(e===this.oldest&&(this.oldest=e[Y]),e[Y][X]=e[X]),e[X]&&(e[X][Y]=e[Y]),e[Y]=void 0,e[X]=this.newest,this.newest&&(this.newest[Y]=e),this.newest=e)}assign(e){let t,n=this.limit||Number.MAX_VALUE;this._keymap.clear();let r=e[Symbol.iterator]();for(let e=r.next();!e.done;e=r.next()){let r=new af(e.value[0],e.value[1]);if(this._keymap.set(r.key,r),t?(t[Y]=r,r[X]=t):this.oldest=r,t=r,n--===0)throw Error(`overflow`)}this.newest=t,this.size=this._keymap.size}set(e,t){let n=this._keymap.get(e);return n?(n.value=t,this._markEntryAsUsed(n),this):(this._keymap.set(e,n=new af(e,t)),this.newest?(this.newest[Y]=n,n[X]=this.newest):this.oldest=n,this.newest=n,++this.size,this.size>this.limit&&this.shift(),this)}shift(){let e=this.oldest;if(e)return this.oldest&&this.oldest[Y]?(this.oldest=this.oldest[Y],this.oldest[X]=void 0):(this.oldest=void 0,this.newest=void 0),e[Y]=e[X]=void 0,this._keymap.delete(e.key),--this.size,this._onShiftListeners.forEach(t=>t(e)),[e.key,e.value]}get(e){let t=this._keymap.get(e);if(t)return this._markEntryAsUsed(t),t.value}has(e){return this._keymap.has(e)}find(e){let t=this._keymap.get(e);return t?t.value:void 0}delete(e){let t=this._keymap.get(e);if(t)return this._keymap.delete(t.key),t[Y]&&t[X]?(t[X][Y]=t[Y],t[Y][X]=t[X]):t[Y]?(t[Y][X]=void 0,this.oldest=t[Y]):t[X]?(t[X][Y]=void 0,this.newest=t[X]):this.oldest=this.newest=void 0,this.size--,t.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new tf(this.oldest)}values(){return new nf(this.oldest)}entries(){return this[Symbol.iterator]()}[ef](){return new rf(this.oldest)}forEach(e,t){typeof t!=`object`&&(t=this);let n=this.oldest;for(;n;)e.call(t,n.value,n.key,this),n=n[Y]}toJSON(){let e=Array(this.size),t=0,n=this.oldest;for(;n;)e[t++]={key:n.key,value:n.value},n=n[Y];return e}toString(){let e=``,t=this.oldest;for(;t;)e+=`${String(t.key)}:${t.value}`,t=t[Y],t&&(e+=` < `);return e}},sf=class{static hasLength(e,t){return e.length===t}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]`}};function cf(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<65||r>90)return-1;t=t*26+(r-64)}return t}let lf=1048576,uf=16384,df={sheetId:``,range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},ff={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},pf={startRow:0,startColumn:0,endRow:0,endColumn:0},mf={row:0,column:0},Z={ff:`Arial`,fs:11,it:0,bl:0,ul:{s:0},st:{s:0},ol:{s:0},tr:{a:0,v:0},td:0,cl:{rgb:`#000000`},bg:{rgb:`#fff`},ht:0,vt:0,tb:0,pd:{t:0,r:0,b:0,l:0},n:null,bd:{b:null,l:null,r:null,t:null}},hf=[N,P,ee],gf={4:{fs:20,bl:1},5:{fs:18,bl:1},6:{fs:16,bl:1},7:{fs:14,bl:1},8:{fs:12,bl:1},1:null,2:{fs:26,bl:1},3:{fs:15,cl:{rgb:`#999999`}},0:null},_f={4:{spaceAbove:{v:20},spaceBelow:{v:10}},5:{spaceAbove:{v:18},spaceBelow:{v:10}},6:{spaceAbove:{v:16},spaceBelow:{v:10}},7:{spaceAbove:{v:14},spaceBelow:{v:8}},8:{spaceAbove:{v:12},spaceBelow:{v:8}},1:{spaceAbove:{v:0},spaceBelow:{v:0}},2:{spaceAbove:{v:0},spaceBelow:{v:7}},3:{spaceAbove:{v:0},spaceBelow:{v:16}},0:null},vf=function(e){return e.ARRAY_CONVERTOR=`ARRAY_CONVERTOR`,e.MATRIX_CONVERTOR=`MATRIX_CONVERTOR`,e}({}),yf={A3:{width:1123,height:1587},A4:{width:794,height:1124},A5:{width:559,height:794},B4:{width:944,height:1344},B5:{width:665,height:944},Executive:{width:696,height:1008},Folio:{width:816,height:1248},Legal:{width:816,height:1344},Letter:{width:816,height:1056},Statement:{width:528,height:816},Tabloid:{width:1056,height:1632}};function bf(e,t){let{textRuns:n=[]}=t,r=0;for(let t of n){let{ts:n={},st:i,ed:a}=t;if(n[e]==null)return 0;switch(e){case`bl`:case`it`:if(n[e]===0)return 0;break;case`ul`:case`st`:if(n[e].s===0)return 0;break;default:throw Error(`unknown style key: ${e} in IStyleBase`)}r+=a-i}return+(t.dataStream.indexOf(`\r
|
|
3
|
+
`)===r)}var xf=class e{constructor(e,t,n){this._deps=n,R(this,`_range`,void 0),R(this,`_worksheet`,void 0),this._range=t,this._worksheet=e}static foreach(e,t){let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e;for(let e=n;e<=i;e++)for(let n=r;n<=a;n++)t(e,n)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i=[];for(let a=e;a<=t;a++){let e=[];for(let t=n;t<=r;t++)e.push(this.getMatrix().getValue(a,t)||null);i.push(e)}return i}getMatrix(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),a=new Ku;for(let o=e;o<=t;o++)for(let e=n;e<=r;e++)a.setValue(o,e,i.getValue(o,e)||null);return a}getMatrixObject(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),a=new Ku;for(let o=e;o<=t;o++)for(let t=n;t<=r;t++)a.setValue(o-e,t-n,i.getValue(o,t)||{});return a}getA1Notation(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i,a;return n<r?(i=H.numToWord(n+1)+(e+1),a=H.numToWord(r+1)+(t+1)):(i=H.numToWord(r+1)+(t+1),a=H.numToWord(n+1)+(e+1)),i===a?`${i}`:`${i}:${a}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){let e=this._deps.getStyles();return this.getValues().map(t=>t.map(t=>{var n;let r=e.getStyleByCell(t);return(r==null||(n=r.bg)==null?void 0:n.rgb)||Z.bg.rgb}))}getCell(t,n){let{startRow:r,startColumn:i}=this._range,a={startRow:r+t,endRow:r+t,startColumn:i+n,endColumn:i+n};return new e(this._worksheet,a,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(e={}){return this.getObjectValues(e)[0][0]}getObjectValues(e={}){let{startRow:t,endRow:n,startColumn:r,endColumn:i}=this._range,a=this._worksheet.getCellMatrix().getFragment(t,n,r,i).getData();if(e.isIncludeStyle){let e=this._deps.getStyles();for(let s=0;s<=n-t;s++)for(let t=0;t<=i-r;t++){var o;if(a==null||(a==null||(o=a[s])==null?void 0:o[t])==null)continue;let n=a[s][t].s;n&&(a[s][t].s=e.get(n))}}return a}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){let e=this._deps.getStyles();return this.getValues().map(t=>t.map(t=>{var n;let r=e.getStyleByCell(t);return(r==null||(n=r.cl)==null?void 0:n.rgb)||Z.cl.rgb}))}getFontFamilies(){return this._getStyles(`ff`)}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles(`ul`)}getUnderline(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?bf(`ul`,n.body)===1?{s:1}:{s:0}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles(`ol`)}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?bf(`st`,n.body)===1?{s:1}:{s:0}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles(`st`)}getFontSize(){var e,t;let n=((e=this.getValue())==null?void 0:e.p)||{};return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0&&n.body.textRuns.some(e=>{var t;return(e==null||(t=e.ts)==null?void 0:t.fs)!=null})?Math.max(...n.body.textRuns.map(e=>{var t;return(e==null||(t=e.ts)==null?void 0:t.fs)||0})):this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles(`fs`)}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles(`bd`)}getFontStyle(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?+(bf(`it`,n.body)===1):this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles(`it`)}getFontWeight(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?+(bf(`bl`,n.body)===1):this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles(`bl`)}getGridId(){return this._worksheet.getSheetId()}getHeight(){let{_range:e,_worksheet:t}=this,{startRow:n,endRow:r}=e,i=0;for(let e=0;e<=r-n;e++){let n=t.getRowHeight(e);i+=n}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles(`ht`)}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){let{startColumn:e,endColumn:t}=this._range;return t-e+1}getNumRows(){let{startRow:e,endRow:t}=this._range;return t-e+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(e=>e.map(e=>(e==null?void 0:e.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(){let e=this._deps.getStyles();return this.getValues().map(t=>t.map(t=>e.getStyleByCell(t)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles(`vt`)}getWidth(){let{_range:e,_worksheet:t}=this,{startColumn:n,endColumn:r}=e,i=0;for(let e=0;e<=r-n;e++)i+=t.getColumnWidth(e);return i}getWrap(){return+(this.getWrapStrategy()===3)}getWrapStrategies(){return this._getStyles(`tb`)}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){e.foreach(this._range,t)}_getStyles(e){let t=this._deps.getStyles();return this.getValues().map(n=>n.map(n=>{let r=t&&t.getStyleByCell(n);return r&&r[e]||Z[e]}))}};R(xf,`transformRange`,(e,t)=>{let n=t.getMaxColumns()-1,r=t.getMaxRows()-1;return e.rangeType===3?{startColumn:0,startRow:0,endColumn:n,endRow:r}:e.rangeType===2?{startRow:0,endRow:r,startColumn:e.startColumn,endColumn:e.endColumn}:e.rangeType===1?{startColumn:0,endColumn:n,startRow:e.startRow,endRow:e.endRow}:{startColumn:e.startColumn,endColumn:Math.min(e.endColumn,n),startRow:e.startRow,endRow:Math.min(e.endRow,r)}});function Sf(e,t,n=0,r=e.length-1,i=wf){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);Sf(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(Cf(e,n,t),i(e[r],a)>0&&Cf(e,n,r);o<s;){for(Cf(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?Cf(e,n,s):(s++,Cf(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function Cf(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function wf(e,t){return e<t?-1:+(e>t)}var Tf=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,n=[];if(!Lf(e,t))return n;let r=this.toBBox,i=[];for(;t;){for(let a=0;a<t.children.length;a++){let o=t.children[a],s=t.leaf?r(o):o;Lf(e,s)&&(t.leaf?n.push(o):If(e,s)?this._all(o,n):i.push(o))}t=i.pop()}return n}collides(e){let t=this.data;if(!Lf(e,t))return!1;let n=[];for(;t;){for(let r=0;r<t.children.length;r++){let i=t.children[r],a=t.leaf?this.toBBox(i):i;if(Lf(e,a)){if(t.leaf||If(e,a))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=Rf([]),this}remove(e,t){if(!e)return this;let n=this.data,r=this.toBBox(e),i=[],a=[],o,s,c;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],o=a.pop(),c=!0),n.leaf){let r=Ef(e,n.children,t);if(r!==-1)return n.children.splice(r,1),i.push(n),this._condense(i),this}!c&&!n.leaf&&If(n,r)?(i.push(n),a.push(o),o=0,s=n,n=n.children[0]):s?(o++,n=s.children[o],c=!1):n=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){let i=n-t+1,a=this._maxEntries,o;if(i<=a)return o=Rf(e.slice(t,n+1)),Df(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/a**(r-1))),o=Rf([]),o.leaf=!1,o.height=r;let s=Math.ceil(i/a),c=s*Math.ceil(Math.sqrt(a));zf(e,t,n,c,this.compareMinX);for(let i=t;i<=n;i+=c){let t=Math.min(i+c-1,n);zf(e,i,t,s,this.compareMinY);for(let n=i;n<=t;n+=s){let i=Math.min(n+s-1,t);o.children.push(this._build(e,n,i,r-1))}}return Df(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!(t.leaf||r.length-1===n);){let n=1/0,r=1/0,i;for(let a=0;a<t.children.length;a++){let o=t.children[a],s=Mf(o),c=Pf(e,o)-s;c<r?(r=c,n=s<n?s:n,i=o):c===r&&s<n&&(n=s,i=o)}t=i||t.children[0]}return t}_insert(e,t,n){let r=n?e:this.toBBox(e),i=[],a=this._chooseSubtree(r,this.data,t,i);for(a.children.push(e),kf(a,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){let n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);let a=this._chooseSplitIndex(n,i,r),o=Rf(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,Df(n,this.toBBox),Df(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(n,o)}_splitRoot(e,t){this.data=Rf([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Df(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,a=1/0;for(let o=t;o<=n-t;o++){let t=Of(e,0,o,this.toBBox),s=Of(e,o,n,this.toBBox),c=Ff(t,s),l=Mf(t)+Mf(s);c<i?(i=c,r=o,a=l<a?l:a):c===i&&l<a&&(a=l,r=o)}return r||n-t}_chooseSplitAxis(e,t,n){let r=e.leaf?this.compareMinX:Af,i=e.leaf?this.compareMinY:jf;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);let i=this.toBBox,a=Of(e,0,t,i),o=Of(e,n-t,n,i),s=Nf(a)+Nf(o);for(let r=t;r<n-t;r++){let t=e.children[r];kf(a,e.leaf?i(t):t),s+=Nf(a)}for(let r=n-t-1;r>=t;r--){let t=e.children[r];kf(o,e.leaf?i(t):t),s+=Nf(o)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)kf(t[r],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():Df(e[t],this.toBBox)}};function Ef(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function Df(e,t){Of(e,0,e.children.length,t,e)}function Of(e,t,n,r,i){i||(i=Rf(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let a=t;a<n;a++){let t=e.children[a];kf(i,e.leaf?r(t):t)}return i}function kf(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Af(e,t){return e.minX-t.minX}function jf(e,t){return e.minY-t.minY}function Mf(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Nf(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Pf(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Ff(e,t){let n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function If(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Lf(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function Rf(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function zf(e,t,n,r,i){let a=[t,n];for(;a.length;){if(n=a.pop(),t=a.pop(),n-t<=r)continue;let o=t+Math.ceil((n-t)/r/2)*r;Sf(e,o,t,n,i),a.push(t,o,o,n)}}function Bf(e,t,n,r=!1){if(t===0&&n===0)return e;let i={...e},a=i.startAbsoluteRefType||0,o=i.endAbsoluteRefType||0,s=i.rangeType||0;if(!r&&a===3&&o===3)return i;let c=Vf(i.startRow,n,i.startColumn,t,s),l=Vf(i.endRow,n,i.endColumn,t,s);return r||a===0&&o===0?i={...i,startRow:c.row,startColumn:c.column,endRow:l.row,endColumn:l.column}:(a===0?i={...i,startRow:c.row,startColumn:c.column}:a===2?i={...i,startRow:c.row}:a===1&&(i={...i,startColumn:c.column}),o===0?i={...i,endRow:l.row,endColumn:l.column}:o===2?i={...i,endRow:l.row}:o===1&&(i={...i,endColumn:l.column}),i)}function Vf(e,t,n,r,i){return i===0?{row:e+t,column:n+r}:i===1?{row:e+t,column:n}:i===2?{row:e,column:n+r}:{row:e,column:n}}function Hf(e){let t=new Set,n=new Set;for(let r of e)t.add(r.startColumn),t.add(r.endColumn+1),n.add(r.startRow),n.add(r.endRow+1);let r=Array.from(t).sort((e,t)=>e-t),i=Array.from(n).sort((e,t)=>e-t);e.sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn);let a=[];for(let t=0;t<i.length-1;t++)for(let n=0;n<r.length-1;n++){let o=r[n],s=r[n+1]-1,c=i[t],l=i[t+1]-1;for(let t of e){if(t.startRow>l)break;if(t.startRow<=c&&t.endRow>=l&&t.startColumn<=o&&t.endColumn>=s){a.push({startColumn:o,endColumn:s,startRow:c,endRow:l});break}}}return a}function Uf(e){e.sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn);let t={};for(let n of e)t[n.startRow]||(t[n.startRow]=[]),t[n.startRow].push(n);let n=[];for(let e in t){let r=t[+e];r.sort((e,t)=>e.startColumn-t.startColumn);let i=r[0];for(let e=1;e<r.length;e++){let t=r[e];t.startColumn<=i.endColumn+1&&t.startRow===i.startRow&&t.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,t.endColumn):(n.push(i),i=t)}n.push(i)}return n}function Wf(e){e.sort((e,t)=>e.startColumn-t.startColumn||e.startRow-t.startRow);let t={};for(let n of e)t[n.startColumn]||(t[n.startColumn]=[]),t[n.startColumn].push(n);let n=[];for(let e in t){let r=t[+e];r.sort((e,t)=>e.startRow-t.startRow);let i=r[0];for(let e=1;e<r.length;e++){let t=r[e];t.startRow<=i.endRow+1&&t.startColumn===i.startColumn&&t.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,t.endRow):(n.push(i),i=t)}n.push(i)}return n}function Gf(e){return Wf(Uf(Hf(e)))}function Kf(e,t){let n=[];return e.forEach(e=>{n.push(...Zf.subtract(e,t))}),Zf.mergeRanges(n)}function qf(e,t){let n=Jf(e.startRow,e.endRow,t.startRow,t.endRow),r=Jf(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;let[i,a]=n,[o,s]=r;return{startRow:i,endRow:a,startColumn:o,endColumn:s,rangeType:Yf(e.rangeType,t.rangeType,i,a,o,s)}}function Jf(e,t,n,r){let i=isNaN(e)?-1/0:e,a=isNaN(t)?1/0:t,o=isNaN(n)?-1/0:n,s=isNaN(r)?1/0:r,c=Math.max(i,o),l=Math.min(a,s);return c<=l?[c===-1/0?NaN:c,l===1/0?NaN:l]:null}function Yf(e,t,n,r,i,a){let o=e===void 0?Xf(n,r,i,a):e,s=t===void 0?Xf(n,r,i,a):t;return o===3||s===3?o===s?o:o===3?s:o:o===s?o:0}function Xf(e,t,n,r){let i=!isNaN(e)&&!isNaN(t),a=!isNaN(n)&&!isNaN(r);return i&&a?0:i?1:a?2:3}var Zf=class e{static clone(e){return e.rangeType===void 0?{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn}:{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType}}static equals(e,t){return e==null||t==null?!1:e.endRow===t.endRow&&e.endColumn===t.endColumn&&e.startRow===t.startRow&&e.startColumn===t.startColumn&&(e.rangeType===t.rangeType||e.rangeType===void 0&&t.rangeType===0||t.rangeType===void 0&&e.rangeType===0)}static simpleRangesIntersect(e,t){let{startRow:n,endRow:r,startColumn:i,endColumn:a}=e,{startRow:o,endRow:s,startColumn:c,endColumn:l}=t;return n<=s&&r>=o&&i<=l&&a>=c}static intersects(e,t){if(e.rangeType===1&&t.rangeType===2||e.rangeType===2&&t.rangeType===1)return!0;if(e.rangeType===1&&t.rangeType===1)return e.startRow<=t.endRow&&e.endRow>=t.startRow;if(e.rangeType===2&&t.rangeType===2)return e.startColumn<=t.endColumn&&e.endColumn>=t.startColumn;let n=Number.isNaN(e.startRow)?0:e.startRow,r=Number.isNaN(e.endRow)?lf-1:e.endRow,i=Number.isNaN(e.startColumn)?0:e.startColumn,a=Number.isNaN(e.endColumn)?uf-1:e.endColumn,o=Number.isNaN(t.startRow)?0:t.startRow,s=Number.isNaN(t.endRow)?lf-1:t.endRow,c=Number.isNaN(t.startColumn)?0:t.startColumn,l=Number.isNaN(t.endColumn)?uf-1:t.endColumn,u=Math.abs(i+a-c-l),d=Math.abs(i-a)+Math.abs(c-l),f=Math.abs(n+r-o-s),p=Math.abs(n-r)+Math.abs(o-s);return u<=d&&f<=p}static doAnyRangesIntersect(e,t){let n=new Tf;return n.load(e.map(e=>({minX:e.startColumn,minY:e.startRow,maxX:e.endColumn,maxY:e.endRow}))),t.some(e=>n.search({minX:e.startColumn,minY:e.startRow,maxX:e.endColumn,maxY:e.endRow}).length>0)}static getIntersects(e,t){let n=e.startRow,r=e.endRow,i=e.startColumn,a=e.endColumn,o=t.startRow,s=t.endRow,c=t.startColumn,l=t.endColumn,u,d,f,p;if(o<=r)d=o>=n?o:n;else return null;if(s>=n)p=s>=r?r:s;else return null;if(c<=a)u=c>i?c:i;else return null;if(l>=i)f=l>=a?a:l;else return null;return{startRow:d,endRow:p,startColumn:u,endColumn:f,rangeType:0}}static contains(e,t){return e.startRow<=t.startRow&&e.endRow>=t.endRow&&e.startColumn<=t.startColumn&&e.endColumn>=t.endColumn}static realContain(t,n){return e.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...e){return e.reduce((e,t)=>({startRow:Math.min(e.startRow,t.startRow),startColumn:Math.min(e.startColumn,t.startColumn),endRow:Math.max(e.endRow,t.endRow),endColumn:Math.max(e.endColumn,t.endColumn),rangeType:0}),e[0])}static realUnion(...t){let n=t.some(e=>e.rangeType===2),r=t.some(e=>e.rangeType===1),i=e.union(...t);return{startColumn:r?NaN:i.startColumn,endColumn:r?NaN:i.endColumn,startRow:n?NaN:i.startRow,endRow:n?NaN:i.endRow,rangeType:r?1:n?2:0}}static subtract(e,t){if(t.startRow>e.endRow||t.endRow<e.startRow||t.startColumn>e.endColumn||t.endColumn<e.startColumn)return[e];let n=[];t.startRow>=e.startRow&&n.push({startRow:e.startRow,startColumn:e.startColumn,endRow:t.startRow-1,endColumn:e.endColumn}),t.endRow<=e.endRow&&n.push({startRow:t.endRow+1,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn});let r=Math.max(e.startRow,t.startRow),i=Math.min(e.endRow,t.endRow);return t.startColumn>=e.startColumn&&n.push({startRow:r,startColumn:e.startColumn,endRow:i,endColumn:t.startColumn-1}),t.endColumn<=e.endColumn&&n.push({startRow:r,startColumn:t.endColumn+1,endRow:i,endColumn:e.endColumn}),n.filter(e=>e.startRow<=e.endRow&&e.startColumn<=e.endColumn)}static mergeRanges(e){return Gf(e)}static splitIntoGrid(e){return Hf(e)}static subtractMulti(e,t){if(!t.length)return e;let n=e;return t.forEach(e=>{n=Kf(n,e)}),n}static hasIntersectionBetweenTwoRect(e,t){return!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)}static getIntersectionBetweenTwoRect(e,t){let n=Math.max(e.left,t.left),r=Math.min(e.right,t.right),i=Math.max(e.top,t.top),a=Math.min(e.bottom,t.bottom);return r<=n||a<=i?null:{left:n,right:r,top:i,bottom:a,width:r-n,height:a-i}}static sort(e){return e.sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn)}};R(Zf,`getRelativeRange`,(e,t)=>({startRow:e.startRow-t.startRow,endRow:e.endRow-e.startRow,startColumn:e.startColumn-t.startColumn,endColumn:e.endColumn-e.startColumn})),R(Zf,`getPositionRange`,(e,t,n)=>({...n||{},startRow:n&&[1,3].includes(n.startAbsoluteRefType||0)?n.startRow:e.startRow+t.startRow,endRow:n&&[1,3].includes(n.endAbsoluteRefType||0)?n.endRow:e.endRow+e.startRow+t.startRow,startColumn:n&&[2,3].includes(n.startAbsoluteRefType||0)?n.startColumn:e.startColumn+t.startColumn,endColumn:n&&[2,3].includes(n.endAbsoluteRefType||0)?n.endColumn:e.endColumn+e.startColumn+t.startColumn})),R(Zf,`moveHorizontal`,(e,t=0,n=0)=>({...e,startColumn:e.startColumn+t,endColumn:e.endColumn+t+n})),R(Zf,`moveVertical`,(e,t=0,n=0)=>({...e,startRow:e.startRow+t,endRow:e.endRow+t+n})),R(Zf,`moveOffset`,(e,t,n)=>{let r={...e};switch(e.startAbsoluteRefType){case 1:r.startColumn+=t;break;case 2:r.startRow+=n;break;case 3:break;default:r.startRow+=n,r.startColumn+=t;break}switch(e.endAbsoluteRefType){case 1:r.endColumn+=t;break;case 2:r.endRow+=n;break;case 3:break;default:r.endRow+=n,r.endColumn+=t;break}return r});function Qf(e,t){if(e.length===0||e[0].length===0)return null;let n=Array(e[0].length).fill(0),r=0,i=null;for(let a=0;a<e.length;a++){for(let r=0;r<e[0].length;r++)n[r]=t(e[a][r])?n[r]+1:0;let o=$f(n);o.area>r&&(r=o.area,i={startColumn:o.start,startRow:a-o.height+1,endColumn:o.end,endRow:a})}return i}function $f(e){let t=[],n=0,r={area:0,height:0,start:0,end:0},i=0;for(;i<e.length;)if(t.length===0||e[i]>=e[t[t.length-1]])t.push(i++);else{let a=e[t.pop()],o=t.length===0?i:i-t[t.length-1]-1;a*o>n&&(n=a*o,r={area:n,height:a,start:t.length===0?0:t[t.length-1]+1,end:i-1})}for(;t.length>0;){let a=e[t.pop()],o=t.length===0?i:i-t[t.length-1]-1;a*o>n&&(n=a*o,r={area:n,height:a,start:t.length===0?0:t[t.length-1]+1,end:i-1})}return r}function ep(e,t){xf.foreach(t,(t,n)=>{e[t][n]=void 0})}function tp(e,t){let n=e.toFullArray(),r=[];for(;;){let e=Qf(n,t);if(!e)break;r.push(e),ep(n,e)}return r}var np=class{constructor(e,t){R(this,`_values`,[]),R(this,`_keys`,[]),R(this,`_keyMaps`,new Map),this._values=e,this._keys=t,e.forEach(e=>{this._initKeyMap(e)})}_initKeyMap(e){this._keys.forEach(t=>{let n=e[t],r=this._keyMaps.get(t)||new Map;r.set(n,e),this._keyMaps.set(t,r)})}getValue(e,t){let n=t||this._keys;for(let t=0;t<n.length;t++){let r=this._keyMaps.get(n[t]);if(r!=null&&r.has(e))return r.get(e)}return null}hasValue(e){for(let t=0;t<this._keys.length;t++){let n=this._keyMaps.get(this._keys[t]);if(n!=null&&n.has(e))return!0}return!1}addValue(e){this._values.push(e),this._initKeyMap(e)}setValue(e,t,n){let r=this.getValue(e);r&&Object.keys(r).includes(t)&&(r[t]=n)}deleteValue(e,t){let n=this.getValue(e,t);if(n){this._keys.forEach(e=>{let t=this._keyMaps.get(e),r=n[e];t==null||t.delete(r)});let e=this._values.findIndex(e=>e===n);this._values.splice(e,1)}}getValues(){return this._values}getKeyMap(e){var t;return[...((t=this._keyMaps.get(e))==null?void 0:t.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}};function rp(e,t,n,r){return{forEach(i){for(let a=e;a<=t;a++)for(let e=n;e<=r;e++)i(a,e)}}}function ip(e){if(e==null||e.length===0)return NaN;let t=e.toLowerCase().split(``),n=t.length,r=e=>e.charCodeAt(0)-96,i=0,a=0;for(let e=0;e<n;e++)a=r(t[e]),i+=a*26**(n-e-1);return i===0?NaN:i-1}function ap(e){let t=``;for(;e>=0;)t=String.fromCharCode(e%26+65)+t,e=Math.floor(e/26)-1;return t}function op(e,t){let n=``;for(;t>0;)n+=e,t--;return n}function sp(e,t=!1){let n=97;return t&&(n=65),op(String.fromCharCode(e%26+n),Math.floor(e/26)+1)}function cp(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function lp(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function up(e=`index`,t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}function dp(e,t=!1){let n=[];for(let r of e){let{st:e,ed:i,ts:a}=r;if(r.sId===void 0&&delete r.sId,e===i||!t&&H.isEmptyObject(a)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}let o=n.pop();ud(r,o)&&H.hasIntersectionBetweenTwoRanges(o.st,o.ed,r.st,r.ed)?n.push({...r,st:o.st,ed:i}):n.push(o,r)}return n}function fp(e,t,n,r){var i;let{textRuns:a}=e;if(a==null)return;let o=[],s=a.length,c=!1,l=(i=t.textRuns)==null?[]:i;if(l.length)for(let e of l)e.st+=r,e.ed+=r;for(let e=0;e<s;e++){let t=a[e],{st:i,ed:s}=t;if(s<=r)o.push(t);else if(r>i&&r<s){c=!0;let e={...t,ed:r};o.push(e),l.length&&o.push(...l);let i={...t,st:r+n,ed:s+n};o.push(i)}else t.st+=n,t.ed+=n,c||(c=!0,o.push(...l)),o.push(t)}c||(c=!0,o.push(...l)),e.textRuns=dp(o)}function pp(e,t,n,r){let{paragraphs:i}=e;if(i==null)return;let{paragraphs:a}=t,o=[],s=-1;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n),s===-1&&a>=r&&(s=e),o.push(t.startIndex)}let c=-1;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r;let n=t.startIndex;c=o.indexOf(n)}c!==-1&&i.splice(c,1),i.push(...a),i.sort(up(`startIndex`))}}function mp(e,t,n,r){let{sectionBreaks:i}=e;if(i==null)return;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n)}let a=t.sectionBreaks;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r}i.push(...a),i.sort(up(`startIndex`))}}function hp(e,t,n,r){let{customBlocks:i=[]}=e;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n)}let a=t.customBlocks;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r}i.push(...a),i.sort(up(`startIndex`))}i.length&&!e.customBlocks&&(e.customBlocks=i)}function gp(e,t,n,r){let{tables:i}=e;if(i==null)return;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a,endIndex:o}=t;a>r?(t.startIndex+=n,t.endIndex+=n):o>r&&(t.endIndex+=n)}let a=t.tables;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r,t.endIndex+=r}i.push(...a),i.sort(up(`startIndex`))}}let _p=e=>e.split(`$`)[0];function vp(e){if(e.length<=1)return e;e.sort((e,t)=>e.startIndex-t.startIndex);let t=[],n={...e[0]};n.rangeId=_p(n.rangeId);for(let r=1;r<e.length;r++){let i=e[r];i.rangeId=_p(i.rangeId),i.rangeId===n.rangeId&&ae(n.properties,i.properties)&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}t.push(n);let r=Object.create(null);for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.rangeId;r[i]?(n.rangeId=`${i}\$${r[i]}`,r[i]=r[i]+1):r[i]=1}return t}function yp(e,t){let n=e.findIndex(e=>e.startIndex<t&&e.endIndex>=t),r=e[n];r&&e.splice(n,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:t-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:t,endIndex:r.endIndex,properties:{...r.properties}})}function bp(e){if(e.length<=1)return e;e.sort((e,t)=>e.startIndex-t.startIndex);let t=[],n={...e[0]};for(let r=1;r<e.length;r++){let i=e[r];i.id===n.id&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}return t.push(n),t}function xp(e,t){e.filter(e=>e.startIndex<t&&e.endIndex>=t).forEach(n=>{let r=e.indexOf(n);e.splice(r,1,{id:n.id,type:n.type,startIndex:n.startIndex,endIndex:t-1},{id:n.id,type:n.type,startIndex:t,endIndex:n.endIndex})})}function Sp(e,t,n,r){e.customRanges||(e.customRanges=[]);let{customRanges:i}=e;yp(i,r);for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n,t.endIndex+=n)}let a=[];if(t.customRanges){for(let e=0,n=t.customRanges.length;e<n;e++){let n=t.customRanges[e];n.startIndex+=r,n.endIndex+=r,a.push(n)}i.push(...a)}e.customRanges=vp(i)}function Cp(e,t,n,r){e.customDecorations||(e.customDecorations=[]);let{customDecorations:i}=e;xp(i,r);for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n,t.endIndex+=n)}let a=[];if(t.customDecorations){for(let e=0,n=t.customDecorations.length;e<n;e++){let n=t.customDecorations[e];n.startIndex+=r,n.endIndex+=r,a.push(n)}i.push(...a)}e.customDecorations=bp(i)}function wp(e,t,n){let{textRuns:r}=e,i=n,a=n+t,o=[];if(r){let n=[];for(let e=0,s=r.length;e<s;e++){let s=r[e],{st:c,ed:l}=s;if(i<=c&&a>=l){o.push({...s,st:c-i,ed:l-i});continue}else c<=i&&l>=a?(o.push({...s,st:i-i,ed:a-i}),s.ed-=t):i>=c&&i<l?(o.push({...s,st:i-i,ed:l-i}),s.ed=i):a>c&&a<=l?(o.push({...s,st:c-i,ed:a-i}),s.st=a-t,s.ed-=t):c>=a&&(s.st-=t,s.ed-=t);n.push(s)}e.textRuns=n}return o.length===0&&o.push({st:0,ed:t,ts:{}}),o}function Tp(e,t,n){let{paragraphs:r}=e,i=n,a=n+t,o=[],s=null,c=!1;if(r){let l=[];for(let e=0,u=r.length;e<u;e++){let u=r[e],{startIndex:d}=u;if(d>=i&&d<a){o.push({...u,startIndex:d-n}),c=!0;continue}else d>=a&&(u.startIndex-=t);l.push(u),s==null&&c&&(s=u)}e.paragraphs=l}return o}function Ep(e,t,n){let{sectionBreaks:r}=e,i=n,a=n+t-1,o=[];if(r){let s=[];for(let e=0,c=r.length;e<c;e++){let c=r[e],{startIndex:l}=c;if(l>=i&&l<=a){o.push({...c,startIndex:l-n});continue}else l>a&&(c.startIndex-=t);s.push(c)}e.sectionBreaks=s}return o}function Dp(e,t,n){let{customBlocks:r=[]}=e,i=n,a=n+t-1,o=[];if(r){let s=[];for(let e=0,c=r.length;e<c;e++){let c=r[e],{startIndex:l}=c;if(l>=i&&l<=a){o.push({...c,startIndex:l-n});continue}else l>a&&(c.startIndex-=t);s.push(c)}e.customBlocks=s}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function Op(e,t,n){let{tables:r}=e,i=n,a=n+t-1,o=[];if(r){let s=[];for(let e=0,c=r.length;e<c;e++){let c=r[e],{startIndex:l,endIndex:u}=c;if(i<=l&&a>=u){o.push({...c,startIndex:l-n,endIndex:u-n});continue}else if(l<=i&&u>=a){let e=Bd(l,u,i,a);if(e.length===0||(c.startIndex=e[0],c.endIndex=e[1],c.startIndex===c.endIndex))continue}else a<l&&(c.startIndex-=t,c.endIndex-=t);s.push(c)}e.tables=s}return o}function kp(e,t,n){let{customRanges:r}=e,i=n,a=n+t-1,o=[];if(r){let n=[];for(let e=0,s=r.length;e<s;e++){let s=r[e],{startIndex:c,endIndex:l}=s;if(c>=i&&l<=a){o.push(s);continue}else if(Math.max(i,c)<=Math.min(a,l)){let e=Bd(c,l,i,a);if(e.length===0)continue;s.startIndex=e[0],s.endIndex=e[1]}else a<c&&(s.startIndex-=t,s.endIndex-=t);n.push(s)}e.customRanges=vp(n)}return o}function Ap(e,t,n,r=!0){let{customDecorations:i}=e,a=n,o=n+t-1,s=[];if(i){let n=[];for(let e=0,c=i.length;e<c;e++){let c=i[e],{startIndex:l,endIndex:u}=c;if(l>=a&&u<=o){s.push(c);continue}else if(Math.max(a,l)<=Math.min(o,u)){let e=Bd(l,u,a,o);if(e.length===0)continue;c.startIndex=e[0],c.endIndex=e[1]}else o<l&&r&&(c.startIndex-=t,c.endIndex-=t);n.push(c)}e.customDecorations=n}return s}let jp=function(e){return e.ORDER_LIST_QUICK_1=`1.`,e.ORDER_LIST_QUICK_2=`a)`,e.ORDER_LIST_QUICK_3=`a.`,e.ORDER_LIST_QUICK_4=`i.`,e.ORDER_LIST_QUICK_5=`A.`,e.ORDER_LIST_QUICK_6=`I.`,e.ORDER_LIST_QUICK_7=`01.`,e.BULLET_LIST=`*`,e}({}),Mp=function(e){return e.BULLET_LIST=`BULLET_LIST`,e.BULLET_LIST_1=`BULLET_LIST_1`,e.BULLET_LIST_2=`BULLET_LIST_2`,e.BULLET_LIST_3=`BULLET_LIST_3`,e.BULLET_LIST_4=`BULLET_LIST_4`,e.BULLET_LIST_5=`BULLET_LIST_5`,e.ORDER_LIST=`ORDER_LIST`,e.ORDER_LIST_1=`ORDER_LIST_1`,e.ORDER_LIST_2=`ORDER_LIST_2`,e.ORDER_LIST_3=`ORDER_LIST_3`,e.ORDER_LIST_4=`ORDER_LIST_4`,e.ORDER_LIST_5=`ORDER_LIST_5`,e.ORDER_LIST_QUICK_2=`ORDER_LIST_QUICK_2`,e.ORDER_LIST_QUICK_3=`ORDER_LIST_QUICK_3`,e.ORDER_LIST_QUICK_4=`ORDER_LIST_QUICK_4`,e.ORDER_LIST_QUICK_5=`ORDER_LIST_QUICK_5`,e.ORDER_LIST_QUICK_6=`ORDER_LIST_QUICK_6`,e.CHECK_LIST=`CHECK_LIST`,e.CHECK_LIST_CHECKED=`CHECK_LIST_CHECKED`,e}({}),Np={"a)":{glyphFormat:`%1)`,glyphType:2},"1.":{glyphFormat:`%1.`,glyphType:2},"a.":{glyphFormat:`%1.`,glyphType:5},"A.":{glyphFormat:`%1.`,glyphType:4},"i.":{glyphFormat:`%1.`,glyphType:7},"I.":{glyphFormat:`%1.`,glyphType:4}},Pp=e=>[...e,...e,...e].map((e,t)=>({glyphFormat:` %${t+1}`,glyphSymbol:e,bulletAlignment:1,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),Fp=e=>e.map((e,t)=>({...e,bulletAlignment:1,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),Ip=(e,t)=>Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:1,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),Lp={BULLET_LIST:{listType:`BULLET_LIST`,nestingLevel:Pp([`●`,`○`,`■`])},BULLET_LIST_1:{listType:`BULLET_LIST`,nestingLevel:Pp([`❖`,`➢`,`■`])},BULLET_LIST_2:{listType:`BULLET_LIST`,nestingLevel:Pp([`✔`,`●`,`◆`])},BULLET_LIST_3:{listType:`BULLET_LIST`,nestingLevel:Pp([`■`,`◆`,`○`])},BULLET_LIST_4:{listType:`BULLET_LIST`,nestingLevel:Pp([`✧`,`○`,`■`])},BULLET_LIST_5:{listType:`BULLET_LIST`,nestingLevel:Pp([`➢`,`○`,`◆`])},ORDER_LIST:{listType:`ORDER_LIST`,nestingLevel:Fp([{glyphFormat:`%1.`,glyphType:2},{glyphFormat:`%2.`,glyphType:5},{glyphFormat:`%3.`,glyphType:7},{glyphFormat:`%4.`,glyphType:2},{glyphFormat:`%5.`,glyphType:5},{glyphFormat:`%6.`,glyphType:7},{glyphFormat:`%7.`,glyphType:2},{glyphFormat:`%8.`,glyphType:5},{glyphFormat:`%9.`,glyphType:7}])},ORDER_LIST_1:{listType:`ORDER_LIST`,nestingLevel:Fp([{glyphFormat:`%1)`,glyphType:2},{glyphFormat:`%2)`,glyphType:5},{glyphFormat:`%3)`,glyphType:7},{glyphFormat:`%4)`,glyphType:2},{glyphFormat:`%5)`,glyphType:5},{glyphFormat:`%6)`,glyphType:7},{glyphFormat:`%7)`,glyphType:2},{glyphFormat:`%8)`,glyphType:5},{glyphFormat:`%9)`,glyphType:7}])},ORDER_LIST_2:{listType:`ORDER_LIST`,nestingLevel:Fp([`%1.`,`%1.%2.`,`%1.%2.%3.`,`%1.%2.%3.%4.`,`%1.%2.%3.%4.%5.`,`%1.%2.%3.%4.%5.%6.`,`%1.%2.%3.%4.%5.%6.%7.`].map(e=>({glyphFormat:e,glyphType:2})))},ORDER_LIST_3:{listType:`ORDER_LIST`,nestingLevel:Fp([{glyphFormat:`%1.`,glyphType:4},{glyphFormat:`%2.`,glyphType:5},{glyphFormat:`%3.`,glyphType:7},{glyphFormat:`%4.`,glyphType:4},{glyphFormat:`%5.`,glyphType:5},{glyphFormat:`%6.`,glyphType:7},{glyphFormat:`%7.`,glyphType:4},{glyphFormat:`%8.`,glyphType:5},{glyphFormat:`%9.`,glyphType:7}])},ORDER_LIST_4:{listType:`ORDER_LIST`,nestingLevel:Fp([{glyphFormat:`%1.`,glyphType:4},{glyphFormat:`%2.`,glyphType:2},{glyphFormat:`%3.`,glyphType:7},{glyphFormat:`%4.`,glyphType:4},{glyphFormat:`%5.`,glyphType:2},{glyphFormat:`%6.`,glyphType:7},{glyphFormat:`%7.`,glyphType:4},{glyphFormat:`%8.`,glyphType:2},{glyphFormat:`%9.`,glyphType:7}])},ORDER_LIST_5:{listType:`ORDER_LIST`,nestingLevel:Fp([{glyphFormat:`%1.`,glyphType:3},{glyphFormat:`%2.`,glyphType:5},{glyphFormat:`%3.`,glyphType:7},{glyphFormat:`%4.`,glyphType:3},{glyphFormat:`%5.`,glyphType:5},{glyphFormat:`%6.`,glyphType:7},{glyphFormat:`%7.`,glyphType:3},{glyphFormat:`%8.`,glyphType:5},{glyphFormat:`%9.`,glyphType:7}])},CHECK_LIST:{listType:`CHECK_LIST`,nestingLevel:Ip(`☐`)},CHECK_LIST_CHECKED:{listType:`CHECK_LIST_CHECKED`,nestingLevel:Ip(`☑`,{st:{s:1}})}},Rp=e=>{let{glyphFormat:t,glyphType:n}=e,r=H.deepClone(Lp.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},zp={ORDER_LIST_QUICK_2:Rp(Np[`a)`]),ORDER_LIST_QUICK_3:Rp(Np[`a.`]),ORDER_LIST_QUICK_4:Rp(Np[`i.`]),ORDER_LIST_QUICK_6:Rp(Np[`I.`])};Object.assign(Lp,zp);let Bp={"1.":`ORDER_LIST`,"a)":`ORDER_LIST_QUICK_2`,"a.":`ORDER_LIST_QUICK_3`,"i.":`ORDER_LIST_QUICK_4`,"A.":`ORDER_LIST_3`,"I.":`ORDER_LIST_QUICK_6`,"01.":`ORDER_LIST_5`,"*":`BULLET_LIST`};function Vp(e,t,n,r,i){return{dataStream:``,textRuns:Hp(e,t,n,r,i),paragraphs:Wp(e,t,n,r,i),sectionBreaks:Gp(e,t,n,r,i),customBlocks:Kp(e,t,n,r,i),tables:qp(e,t,n,r,i),customRanges:Jp(e,t,n,r,i),customDecorations:Yp(e,t,n,r,i)}}function Hp(e,t,n,r,i){let{textRuns:a}=e,{textRuns:o}=t;if(a==null||o==null)return;let s=wp(e,n,r);return i!==1&&(t.textRuns=Up(o,s,i)),fp(e,t,n,r),s}function Up(e,t,n){if(t.length===0)return e;e=H.deepClone(e),t=H.deepClone(t);let r=[],i=e.length,a=t.length,o=0,s=0,c=null;function l(){return c?(r.push(c),c=null,!0):!1}for(;o<i&&s<a;){let{st:i,ed:a,ts:u}=e[o],{st:d,ed:f,ts:p,sId:m}=t[s],h;if(h=n===0?{...p,...u}:{...u},a<d)l()||r.push(e[o]),o++;else if(f<i)l()||r.push(t[s]),s++;else{let n={st:Math.min(i,d),ed:Math.max(i,d),ts:i<d?{...u}:{...p},sId:i<d?void 0:m};n.ed>n.st&&r.push(n),r.push({st:Math.max(i,d),ed:Math.min(a,f),ts:h,sId:m}),a<f?(o++,t[s].st=a,t[s].st===t[s].ed&&s++):(s++,e[o].st=f,e[o].st===e[o].ed&&o++);let l={st:Math.min(a,f),ed:Math.max(a,f),ts:a<f?{...p}:{...u},sId:a<f?m:void 0};c=l.ed>l.st?l:null}}l();let u=r[r.length-1],d=e[i-1],f=t[a-1];return u&&u.ed!==Math.max(d.ed,f.ed)&&(d.ed>f.ed?r.push(d):r.push(f)),dp(r)}function Wp(e,t,n,r,i){let{paragraphs:a}=e,{paragraphs:o}=t;if(a==null||o==null)return;let s=Tp(e,n,r);if(i!==1){let e=[];for(let t of o){let{startIndex:n,paragraphStyle:r,bullet:a}=t,o=[];for(let e of s){let{startIndex:t,paragraphStyle:s,bullet:c}=e,l,u;if(i===0?(l={...s,...r},u={listId:``,listType:`BULLET_LIST`,nestingLevel:0,textStyle:{},...c,...a}):(l={...r,...s},u={listId:``,listType:`BULLET_LIST`,nestingLevel:0,textStyle:{},...a,...c}),n===t){o.push({startIndex:n,paragraphStyle:l,bullet:u});break}}e.push(...o),o=[]}t.paragraphs=e}return pp(e,t,n,r),s}function Gp(e,t,n,r,i){let{sectionBreaks:a}=e,{sectionBreaks:o}=t;if(a==null||o==null)return;let s=Ep(e,n,r);if(i!==1){let e=[];for(let t of o){let{startIndex:n}=t,r=[];for(let e of s){let{startIndex:a}=e;if(n===a){i===0?r.push({...e,...t}):r.push({...t,...e});break}}e.push(...r),r=[]}t.sectionBreaks=e}return mp(e,t,n,r),s}function Kp(e,t,n,r,i){let{customBlocks:a=[]}=e,{customBlocks:o}=t;if(a==null||o==null)return;let s=Dp(e,n,r);if(i!==1){let e=[];for(let t of o){let{startIndex:n}=t,r=[];for(let e of s){let{startIndex:a}=e;if(n===a){i===0?r.push({...e,...t}):r.push({...t,...e});break}}e.push(...r),r=[]}t.customBlocks=e}return hp(e,t,n,r),a.length&&!e.customBlocks&&(e.customBlocks=a),s}function qp(e,t,n,r,i){let{tables:a}=e,{tables:o}=t;if(a==null||o==null)return;let s=Op(e,n,r);if(i!==1){let e=[];for(let t of o){let{startIndex:n,endIndex:r}=t,a=[];for(let e of s){let{startIndex:o,endIndex:s}=e;if(o>=n&&s<=r){i===0?a.push({...e,...t}):a.push({...t,...e});break}}e.push(...a),a=[]}t.tables=e}return gp(e,t,n,r),s}function Jp(e,t,n,r,i){e.customRanges||(e.customRanges=[]),yp(e.customRanges,r),yp(e.customRanges,r+n);let a=r,o=r+n-1,{customRanges:s}=t,c=[],l=new Map;return e.customRanges.forEach(e=>{let{startIndex:t,endIndex:n}=e;t>=a&&n<=o?l.set(e.rangeId,e):c.push(e)}),s?(s.forEach(e=>{let{startIndex:t,endIndex:n}=e;c.push({...e,startIndex:t+r,endIndex:n+r})}),e.customRanges=vp(c),[]):[]}function Yp(e,t,n,r,i){e.customDecorations||(e.customDecorations=[]),xp(e.customDecorations,r),xp(e.customDecorations,r+n);let a=[],{customDecorations:o}=e,{customDecorations:s=[]}=t;if(i===1){for(let e=0;e<o.length;e++){let t=o[e],{startIndex:i,endIndex:s}=t;i>=r&&s<=r+n-1&&a.push(t)}s.forEach(e=>{let{startIndex:t,endIndex:n}=e;o.push({...e,startIndex:t+r,endIndex:n+r})})}else for(let e of s){let{id:t}=e;if(e.type===9999){let e=o.filter(e=>e.id===t);e.length&&a.push(...e)}else o.push({...e,startIndex:e.startIndex+r,endIndex:e.endIndex+r})}for(let e of a){let{id:t}=e,n=o.findIndex(e=>e.id===t);n!==-1&&o.splice(n,1)}return e.customDecorations=bp(o),a}let Xp=function(e){return e[e.copy=0]=`copy`,e[e.cut=1]=`cut`,e}({});function Zp(e,t,n,r=!0){let{textRuns:i}=e;if(i){let e=[];for(let r of i){let i=H.deepClone(r),{st:a,ed:o}=i;H.hasIntersectionBetweenTwoRanges(a,o,t,n)&&(t>=a&&t<=o?e.push({...i,st:t,ed:Math.min(n,o)}):n>=a&&n<=o?e.push({...i,st:Math.max(t,a),ed:n}):e.push(i))}return dp(e.map(e=>{let{st:n,ed:r}=e;return{...e,st:n-t,ed:r-t}}))}else if(r)return[{st:0,ed:n-t,ts:{}}]}function Qp(e,t,n){let{tables:r=[]}=e,i=[];for(let e of r){let r=H.deepClone(e),{startIndex:a,endIndex:o}=r;a>=t&&o<=n&&i.push({...r,startIndex:a-t,endIndex:o-t})}return i}function $p(e,t,n){let{paragraphs:r=[]}=e,i=[];for(let e of r){let{startIndex:r}=e;if(r>=t&&r<n){let t=H.deepClone(e);i.push(t)}}if(i.length)return i.map(e=>({...e,startIndex:e.startIndex-t}))}function em(e,t,n){let{sectionBreaks:r=[]}=e,i=[];for(let e of r){let{startIndex:r}=e;r>=t&&r<=n&&i.push(H.deepClone(e))}if(i.length)return i.map(e=>({...e,startIndex:e.startIndex-t}))}function tm(e,t,n){let{customBlocks:r=[]}=e,i=[];for(let e of r){let{startIndex:r}=e;r>=t&&r<n&&i.push(H.deepClone(e))}if(i.length)return i.map(e=>({...e,startIndex:e.startIndex-t}))}function nm(e,t,n,r=!0,i=1){let{dataStream:a}=e,o={dataStream:a.slice(t,n)};o.textRuns=Zp(e,t,n,r);let s=Qp(e,t,n);if(s.length&&(o.tables=s),o.paragraphs=$p(e,t,n),i===1){let i=am(e,t,n);i?o.customDecorations=i:r&&(o.customDecorations=[])}let{customRanges:c}=im(e,t,n);return c?o.customRanges=c:r&&(o.customRanges=[]),o.customBlocks=tm(e,t,n),o}function rm(e){let{dataStream:t,textRuns:n,paragraphs:r,customRanges:i,customDecorations:a,tables:o}=e,s=0,c=0;i==null||i.forEach(e=>{e.startIndex<0&&(s=Math.max(s,-e.startIndex)),e.endIndex>t.length-1&&(c=Math.max(c,e.endIndex-t.length+1))});let l=`${t}`;return n&&(n[0]&&(n[0].st=n[0].st-s),n[n.length-1]&&(n[n.length-1].ed=n[n.length-1].ed+c)),n==null||n.forEach(e=>{e.st+=s,e.ed+=s}),r==null||r.forEach(e=>{e.startIndex+=s}),i==null||i.forEach(e=>{e.startIndex+=s,e.endIndex+=s}),a==null||a.forEach(e=>{e.startIndex+=s,e.endIndex+=c}),o==null||o.forEach(e=>{e.startIndex+=s,e.endIndex+=c}),{...e,dataStream:l,textRuns:n,paragraphs:r,customRanges:i,customDecorations:a,tables:o}}function im(e,t,n){if(e.customRanges==null)return{};let{customRanges:r}=e;return{customRanges:r.filter(e=>Math.max(e.startIndex,t)<=Math.min(e.endIndex,n-1)).map(e=>({...e,startIndex:Math.max(e.startIndex,t),endIndex:Math.min(e.endIndex,n-1)})).map(e=>({...e,startIndex:e.startIndex-t,endIndex:e.endIndex-t})),leftOffset:0,rightOffset:0}}function am(e,t,n){if(e.customDecorations==null)return;let{customDecorations:r=[]}=e,i=[];return r.forEach(e=>{if(Math.max(e.startIndex,t)<=Math.min(e.endIndex,n-1)){let r=H.deepClone(e);i.push({...r,startIndex:Math.max(r.startIndex-t,0),endIndex:Math.min(r.endIndex,n-1)-t})}}),i}function om(e,t,n){return e==null||t==null?e==null?t:e:Up(e,t,n)}function sm(e,t,n){if(e==null||t==null)return e==null?t:e;if(t.length===0||e.length===0)return e;if(t.length>1||e.length>1)throw Error(`Cannot cover multiple customRanges`);return n===1?[{...e[0]}]:[{...t[0],...e[0]}]}function cm(e,t,n){return t.length===0||e.length===0||n===1?e:[...e,...t.filter(t=>!e.some(e=>t.id===e.id))]}function lm(e,t,n=0){if(t.dataStream!==``)throw Error(`Cannot compose other body with non-empty dataStream`);let r={dataStream:e.dataStream},{textRuns:i,paragraphs:a=[],customRanges:o,customDecorations:s=[]}=e,{textRuns:c,paragraphs:l=[],customRanges:u,customDecorations:d=[]}=t;r.textRuns=om(c,i,n),r.customRanges=sm(u,o,n);let f=cm(d,s,n);f.length&&(r.customDecorations=f);let p=[],m=0,h=0;for(;m<a.length&&h<l.length;){let e=a[m],t=l[h],{startIndex:n}=e,{startIndex:r}=t;n===r?(p.push(H.deepMerge(e,t)),m++,h++):n<r?(p.push(H.deepClone(e)),m++):(p.push(H.deepClone(t)),h++)}return m<a.length&&p.push(...a.slice(m)),h<l.length&&p.push(...l.slice(h)),p.length&&(r.paragraphs=p),r}function um(e){let{body:t}=e;if(t==null)return!0;let{textRuns:n,paragraphs:r,customRanges:i,customBlocks:a,customDecorations:o,tables:s}=t;return n==null&&r==null&&i==null&&a==null&&o==null&&s==null}var dm=class{constructor(e){this._actions=e,R(this,`_index`,0),R(this,`_offset`,0)}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);let t=this._actions[this._index];if(t){let n=this._offset,r=t.len;return e>=r-n?(e=r-n,this._index+=1,this._offset=0):this._offset+=e,t.t===`d`||t.t===`r`&&t.body==null?H.deepClone({...t,len:e}):H.deepClone({...t,len:e,body:nm(t.body,n,n+e,!1)})}else return{t:`r`,len:1/0}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:1/0}peekType(){let e=this._actions[this._index];return e?e.t:`r`}rest(){if(!this.hasNext())return[];if(this._offset===0)return this._actions.slice(this._index);{let e=this._offset,t=this._index,n=this.next(),r=this._actions.slice(this._index);return this._offset=e,this._index=t,[n].concat(r)}}};function fm(e,t,n){let{dataStream:r}=e,i=n,a=n+t,o=wp(e,t,n),s=Tp(e,t,n),c=Ep(e,t,n),l=Dp(e,t,n),u=Op(e,t,n),d=kp(e,t,n),f=Ap(e,t,n),p=``;return r&&(e.dataStream=Gd(r,i,a),p=r.slice(i,a)),{dataStream:p,textRuns:o,paragraphs:s,sectionBreaks:c,customBlocks:l,tables:u,customRanges:d,customDecorations:f}}function pm(e,t,n,r){e.dataStream=Wd(e.dataStream,r,t.dataStream),fp(e,t,n,r),pp(e,t,n,r),mp(e,t,n,r),hp(e,t,n,r),gp(e,t,n,r),Sp(e,t,n,r),Cp(e,t,n,r)}function mm(e,t,n,r,i=0){return Vp(e,t,n,r,i)}function hm(e,t,n){return t<=0?{dataStream:``}:fm(e,t,n)}function gm(e,t,n,r){n!==0&&pm(e,t,n,r)}function _m(e,t){let n=new Bi;return n.reset(),t.forEach(t=>{let r=H.deepClone(t);switch(r.t){case`r`:{let{coverType:t,body:i,len:a}=r;i!=null&&mm(e,i,a,n.cursor,t),n.moveCursor(a);break}case`i`:{let{body:t,len:i}=r;gm(e,t,i,n.cursor),n.moveCursor(i);break}case`d`:{let{len:t}=r;hm(e,t,n.cursor);break}default:throw Error(`Unknown action type for action: ${r}.`)}}),e}function vm(e,t,n,r,i){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=H.deepClone(t),e=H.deepClone(e);let a=[],o=t.length,s=e.length,c=0,l=0,u=null;function d(){return u?(a.push(u),u=null,!0):!1}for(;c<o&&l<s;){let{st:o,ed:s,ts:f}=t[c],{st:p,ed:m,ts:h,sId:g}=e[l],_={};if(i===0)_={...f},n===0&&r===1&&h&&(_=Object.assign({},h,_));else if(_={...f},n===1){if(r===1)_={...h};else if(f&&h){let e=Object.keys(f);for(let t of e)h[t]&&delete _[t]}}else if(r===1){if(h){let e=Object.keys(h);for(let t of e)h[t]!==void 0&&(_[t]=h[t])}}else if(h){let e=Object.keys(h);for(let t of e)_[t]!==void 0&&delete _[t]}if(s<p)d()||a.push(t[c]),c++;else if(m<o)d()||a.push(e[l]),l++;else{let n={st:Math.min(o,p),ed:Math.max(o,p),ts:o<p?{...f}:{...h},sId:o<p?void 0:g};n.ed>n.st&&a.push(),a.push({st:Math.max(o,p),ed:Math.min(s,m),ts:_,sId:g}),s<m?(c++,e[l].st=s,e[l].st===e[l].ed&&l++):(l++,t[c].st=m,t[c].st===t[c].ed&&c++);let r={st:Math.min(s,m),ed:Math.max(s,m),ts:s<m?{...h}:{...f},sId:s<m?g:void 0};u=r.ed>r.st?r:null}}d();let f=a[a.length-1],p=t[o-1],m=e[s-1];return f.ed!==Math.max(p.ed,m.ed)&&(p.ed>m.ed?a.push(p):a.push(m)),dp(a,!0)}function ym(e,t,n,r,i){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];if(e.length>1||t.length>1)throw Error(`CustomRanges is only supported transform for length one now.`);let a=e[0],o=t[0];if(n===1)return i===1?[H.deepClone(a)]:[H.deepClone(o)];if(r===1){let e=H.deepClone(o);return i===1&&Object.assign(e,H.deepClone(a)),[e]}else{let e=H.deepClone(o);return i===1&&Object.assign(e,H.deepClone(a)),[e]}}function bm(e,t,n,r,i){let a={startIndex:t.startIndex};if(t.paragraphStyle&&(a.paragraphStyle=H.deepClone(t.paragraphStyle),e.paragraphStyle)){if(n===1)if(r===1)i===1&&(a.paragraphStyle={...e.paragraphStyle});else if(i===1){let t=Object.keys(e.paragraphStyle);for(let n of t)e.paragraphStyle[n]!==void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else{let t=Object.keys(e.paragraphStyle);for(let n of t)a.paragraphStyle[n]===void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else if(r===1)if(i===1){let t=Object.keys(e.paragraphStyle);for(let n of t)e.paragraphStyle[n]!==void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else{let t=Object.keys(e.paragraphStyle);for(let n of t)a.paragraphStyle[n]===void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else if(i===1){let t=Object.keys(e.paragraphStyle);for(let e of t)a.paragraphStyle[e]&&delete a.paragraphStyle[e]}}return n===1&&r===1?a.bullet=i===1?H.deepClone(e.bullet):H.deepClone(t.bullet):e.bullet===void 0?a.bullet=H.deepClone(t.bullet):n===1||r===1?a.bullet=i===0&&t.bullet?H.deepClone(t.bullet):H.deepClone(e.bullet):i===0&&t.bullet!==void 0&&(a.bullet=H.deepClone(t.bullet)),a}function xm(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return H.deepClone(t);let n=[];for(let r of t){let{id:t,type:i}=r,a=!1;for(let o of e)if(o.id===t){(o.type===9999||i===9999)&&(a=!0,n.push({...r,type:9999}));break}a||n.push(r)}return n}function Sm(e,t,n=!1){let{body:r,coverType:i=0}=e,{body:a,coverType:o=0}=t;if(r==null||r.dataStream!==``||a==null||a.dataStream!==``)throw Error(`Data stream is not supported in retain transform.`);let s={dataStream:``},c=o,{textRuns:l,paragraphs:u=[],customRanges:d,customDecorations:f}=r,{textRuns:p,paragraphs:m=[],customRanges:h,customDecorations:g}=a,_=vm(l,p,i,o,+!!n);_&&(s.textRuns=_);let v=ym(d,h,i,o,+!!n);v&&(s.customRanges=v);let y=xm(f,g);y&&(s.customDecorations=y);let b=[],x=0,S=0;for(;x<u.length&&S<m.length;){let e=u[x],t=m[S],{startIndex:r}=e,{startIndex:a}=t;if(r===a){let a={startIndex:r};a=n?bm(e,t,i,o,1):bm(e,t,i,o,0),b.push(a),x++,S++}else r<a?x++:(b.push(H.deepClone(t)),S++)}return S<m.length&&b.push(...m.slice(S)),b.length&&(s.paragraphs=b),{coverType:c,body:s}}function Cm(e){return Object.keys(e).length===1}var Q=class e{constructor(){R(this,`_actions`,[])}static apply(e,t){return _m(e,t)}static compose(t,n){let r=new dm(t),i=new dm(n),a=new e;for(;r.hasNext()||i.hasNext();)if(i.peekType()===`i`)a.push(i.next());else if(r.peekType()===`d`)a.push(r.next());else{let e=Math.min(r.peekLength(),i.peekLength()),t=r.next(e),n=i.next(e);if(t.t===`i`&&n.t===`r`)n.body==null?a.push(t):a.push({...t,body:lm(t.body,n.body,n.coverType)});else if(t.t===`r`&&n.t===`r`)if(t.body==null&&n.body==null)a.push(t.len===1/0?n:t);else if(t.body&&n.body){let e=+(t.coverType===1||n.coverType===1);a.push({...t,t:`r`,coverType:e,body:lm(t.body,n.body,n.coverType)})}else a.push(t.body?t:n);else t.t===`r`&&n.t===`d`?a.push(n):t.t===`i`&&n.t}return a.trimEndUselessRetainAction(),a.serialize()}static transform(e,t,n=`right`){return this._transform(t,e,n===`left`?`right`:`left`)}static _transform(t,n,r=`right`){let i=new dm(t),a=new dm(n),o=new e;for(;i.hasNext()||a.hasNext();)if(i.peekType()===`i`&&(r===`left`||a.peekType()!==`i`)){let e=i.next();o.retain(e.len)}else if(a.peekType()===`i`)o.push(a.next());else{let e=Math.min(i.peekLength(),a.peekLength()),t=i.next(e),n=a.next(e);if(t.t===`d`)continue;if(n.t===`d`){o.push(n);continue}if(t.body==null||n.body==null)o.push(n);else{let{coverType:e,body:i}=Sm(t,n,r===`left`);o.push({...n,t:`r`,coverType:e,body:i})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(e,t,n=!1){let r=new dm(e),i=0;for(;r.hasNext()&&i<=t;){let e=r.peekLength(),a=r.peekType();if(r.next(),a===`d`){t-=Math.min(e,t-i);continue}else a===`i`&&(i<t||!n)&&(t+=e);i+=e}return t}static isNoop(e){return e.length===0}static invert(e){let t=[];for(let n of e)if(n.t===`i`)t.push({t:`d`,len:n.len,body:n.body});else if(n.t===`d`){if(n.body==null)throw Error(`Can not invert DELETE action without body property, makeInvertible must be called first.`);t.push({t:`i`,body:n.body,len:n.len})}else if(n.body!=null){if(n.oldBody==null)throw Error(`Can not invert RETAIN action without oldBody property, makeInvertible must be called first.`);t.push({t:`r`,body:n.oldBody,oldBody:n.body,len:n.len,coverType:1})}else t.push(n);return t}static makeInvertible(e,t){let n=[],r=0;for(let i of e){if(i.t===`d`&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){let e=nm(t,r,r+i.len,!1);i.len=e.dataStream.length,i.body=e}if(i.t===`r`&&i.body!=null){let e=nm(t,r,r+i.len,!0);i.oldBody={...e,dataStream:``},i.len=e.dataStream.length}n.push(i),i.t!==`i`&&(r+=i.len)}return n}insert(e,t){let n={t:`i`,body:t,len:e};return this.push(n),this}retain(e,t,n){let r={t:`r`,len:e};return t!=null&&(r.body=t),n!=null&&(r.coverType=n),this.push(r),this}delete(e){let t={t:`d`,len:e};return this.push(t),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...e){if(e.length>1){for(let t of e)this.push(t);return this}let t=this._actions.length,n=this._actions[t-1],r=H.deepClone(e[0]);if(r.t===`r`&&r.len===0&&r.body==null)return this;if(typeof n==`object`){if(n.t===`d`&&r.t===`d`)return n.len+=r.len,this;if(n.t===`d`&&r.t===`i`&&(--t,n=this._actions[t-1],n==null))return this._actions.unshift(r),this;if(n.t===`r`&&r.t===`r`&&n.body==null&&r.body==null)return n.len+=r.len,this;if(n.t===`i`&&Cm(n.body)&&r.t===`i`&&Cm(r.body))return n.len+=r.len,n.body.dataStream+=r.body.dataStream,this}return t===this._actions.length?this._actions.push(r):this._actions.splice(t,0,r),this}trimEndUselessRetainAction(){let e=this._actions[this._actions.length-1];for(;e&&e.t===`r`&&um(e);)this._actions.pop(),e=this._actions[this._actions.length-1];return this}};R(Q,`id`,`text-x`),R(Q,`uri`,`https://github.com/dream-num/univer#text-x`),Object.defineProperty(Q,`name`,{value:`text-x`});var wm=class e{static registerSubtype(e){var t;e==null||this._subTypes.has(e.name)&&((t=this._subTypes.get(e.name))==null?void 0:t.id)!==Q.id||(this._subTypes.set(e.name,e),Xo.type.registerSubtype(e))}static apply(e,t){if(!Xo.type.isNoop(t))return Xo.type.apply(e,t)}static compose(e,t){return Xo.type.compose(e,t)}static transform(e,t,n){return Xo.type.transform(e,t,n)}static transformPosition(e,t,n=`right`){return e&&e.length===2&&e[0]===`body`&&e[1].et===Q.name?Q.transformPosition(e[1].e,t,n===`left`):t}static invertWithDoc(e,t){return Xo.type.invertWithDoc(e,t)}static isNoop(e){return Xo.type.isNoop(e)}static getInstance(){return this._instance==null&&(this._instance=new e),this._instance}removeOp(e,t){return Xo.removeOp(e,t)}moveOp(e,t){return Xo.moveOp(e,t)}insertOp(e,t){return Xo.insertOp(e,t)}replaceOp(e,t,n){return Xo.replaceOp(e,t,n)}editOp(e,t=[`body`]){return Xo.editOp(t,Q.name,e)}};R(wm,`uri`,`https://github.com/dream-num/univer#json-x`),R(wm,`_subTypes`,new Map),R(wm,`_instance`,null),wm.registerSubtype(Q);let Tm=function(e){return e.PARAGRAPH=`PARAGRAPH`,e.SECTION_BREAK=`SECTION_BREAK`,e.TABLE=`TABLE`,e.TABLE_ROW=`TABLE_ROW`,e.TABLE_CELL=`TABLE_CELL`,e.CUSTOM_BLOCK=`CUSTOM_BLOCK`,e}({}),Em=function(e){return e.PARAGRAPH=`\r`,e.SECTION_BREAK=`
|
|
4
|
+
`,e.TABLE_START=``,e.TABLE_ROW_START=`\x1B`,e.TABLE_CELL_START=``,e.TABLE_CELL_END=``,e.TABLE_ROW_END=``,e.TABLE_END=``,e.CUSTOM_RANGE_START=``,e.CUSTOM_RANGE_END=``,e.COLUMN_BREAK=`\v`,e.PAGE_BREAK=`\f`,e.DOCS_END=`\0`,e.TAB=` `,e.CUSTOM_BLOCK=`\b`,e.LETTER=``,e.SPACE=` `,e}({});function Dm(e){return`${e}`}let Om=[``,`\x1B`,``,``,``,``],km=e=>{let t=e.endsWith(`\r
|
|
5
|
+
`)?e.slice(0,-2):e;return Om.reduce((e,t)=>e.replaceAll(t,``),t)},Am=e=>e?km(e).replaceAll(`\r`,``)===``:!0,jm=e=>{let t=e.replace(/\n/g,`\r`),n=[],r=[],i=0,a=``,o=(o,s=!0)=>{let c=t.slice(i,o);if(H.isLegalUrl(c)){let t=U(),l=`${c}`,u={startIndex:i,endIndex:i+l.length-1,rangeId:t,rangeType:0,properties:{url:e}};r.push(u),a+=l,i=o+1,s&&(a+=`\r`,n.push({startIndex:o}))}else a+=t.slice(i,o+1),i=o+1,s&&n.push({startIndex:o})},s=0;for(let e=0;e<t.length;e++)t[e]===`\r`&&(o(e),s=e);return(s!==t.length-1||t.length===1)&&o(t.length,!1),{dataStream:a,paragraphs:n,customRanges:r}},Mm={id:`default_doc`,documentStyle:{}};var Nm=class extends ta{getUnitId(){throw Error(`Method not implemented.`)}constructor(e){var t;super(),R(this,`type`,n.UniverType.UNIVER_DOC),R(this,`_name$`,new r.BehaviorSubject(``)),R(this,`name$`,this._name$.asObservable()),R(this,`snapshot`,void 0),this.snapshot={...Mm,...e},this._name$.next((t=this.snapshot.title)==null?`No Title`:t)}getRev(){var e;return(e=this.snapshot.rev)==null?1:e}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(e){this.snapshot.rev=e}setName(e){this.snapshot.title=e,this._name$.next(e)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var e;return((e=this.snapshot.settings)==null?void 0:e.zoomRatio)||1}resetDrawing(e,t){this.snapshot.drawings=e,this.snapshot.drawingsOrder=t}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var e;let t=(e=this.snapshot.lists)==null?{}:e;return{...Lp,...t}}updateDocumentId(e){this.snapshot.id=e}updateDocumentRenderConfig(e){let{documentStyle:t}=this.snapshot;t.renderConfig==null?t.renderConfig=e:t.renderConfig={...t.renderConfig,...e}}getDocumentStyle(){return this.snapshot.documentStyle}updateDocumentStyle(e){this.snapshot.documentStyle==null?this.snapshot.documentStyle=e:this.snapshot.documentStyle={...this.snapshot.documentStyle,...e}}updateDocumentDataMargin(e){let{t,l:n,b:r,r:i}=e,{documentStyle:a}=this.snapshot;t!=null&&(a.marginTop=t),n!=null&&(a.marginLeft=n),r!=null&&(a.marginBottom=r),i!=null&&(a.marginRight=i)}updateDocumentDataPageSize(e,t){let{documentStyle:n}=this.snapshot;if(!n.pageSize){n.pageSize={width:e==null?1/0:e,height:t==null?1/0:t};return}e!==void 0&&(n.pageSize.width=e),t!==void 0&&(n.pageSize.height=t)}updateDrawing(e,t){let{drawings:n}=this,{width:r,height:i,left:a,top:o}=t,s=n==null?void 0:n[e];if(!s)return;let c=s.docTransform;c.size.width=r,c.size.height=i,c.positionH.posOffset=a,c.positionV.posOffset=o}setZoomRatio(e=1){this.snapshot.settings?this.snapshot.settings.zoomRatio=e:this.snapshot.settings={zoomRatio:e}}setDisabled(e){this.snapshot.disabled=e}getDisabled(){return this.snapshot.disabled}getTitle(){return this.snapshot.title}},Pm=class e extends Nm{constructor(e){var t,n;super(H.isEmptyObject(e)?Bo():e),R(this,`_unitId`,void 0),R(this,`headerModelMap`,new Map),R(this,`footerModelMap`,new Map),R(this,`change$`,new r.BehaviorSubject(0)),this._unitId=(t=this.snapshot.id)==null?U(6):t,this._initializeHeaderFooterModel(),this._name$.next((n=this.snapshot.title)==null?``:n)}dispose(){super.dispose(),this.headerModelMap.forEach(e=>{e.dispose()}),this.footerModelMap.forEach(e=>{e.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var e;return(e=this.snapshot.body)==null?void 0:e.customRanges}getCustomDecorations(){var e;return(e=this.snapshot.body)==null?void 0:e.customDecorations}getSettings(){return this.snapshot.settings}reset(e){if(e.id&&e.id!==this._unitId)throw Error(`Cannot reset a document model with a different unit id!`);this.snapshot={...Mm,...e},this._initializeHeaderFooterModel(),this.change$.next(this.change$.value+1)}getSelfOrHeaderFooterModel(e){if(e!=null){if(this.headerModelMap.has(e))return this.headerModelMap.get(e);if(this.footerModelMap.has(e))return this.footerModelMap.get(e)}return this}getUnitId(){return this._unitId}apply(e){if(!wm.isNoop(e))return this.snapshot=wm.apply(this.snapshot,e),e!=null&&e.some(e=>Array.isArray(e)&&((e==null?void 0:e[0])===`headers`||(e==null?void 0:e[0])===`footers`))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.change$.next(this.change$.value+1),this.snapshot}sliceBody(e,t,n=0){let r=this.getBody();if(r!=null)return nm(r,e,t,!1,n)}_initializeHeaderFooterModel(){let{headers:t,footers:n}=this.getSnapshot();if(t)for(let n in t){let r=t[n];this.headerModelMap.set(n,new e(r)),this.headerModelMap.get(n).updateDocumentId(this.getUnitId())}if(n)for(let t in n){let r=n[t];this.footerModelMap.set(t,new e(r)),this.footerModelMap.get(t).updateDocumentId(this.getUnitId())}}updateDocumentId(e){super.updateDocumentId(e),this._unitId=e}getPlainText(){var e,t;return km((e=(t=this.getBody())==null?void 0:t.dataStream)==null?``:e)}};function Fm(e){let{ranges:t,id:n,type:r}=e,i=new Q,a=0;for(let e=0;e<t.length;e++){let{startOffset:o,endOffset:s}=t[e];o>0&&i.push({t:`r`,len:o-a}),i.push({t:`r`,body:{dataStream:``,customDecorations:[{id:n,type:r,startIndex:0,endIndex:s-o-1}]},len:s-o}),a=s}return i}function Im(e){var t;let{id:n,segmentId:r,documentDataModel:i}=e,a=i==null?void 0:i.getBody();if(!i||!a)return!1;let o=(t=i.getSelfOrHeaderFooterModel(r))==null||(t=t.getBody())==null||(t=t.customDecorations)==null?void 0:t.find(e=>e.id===n);if(!o)return!1;let s=new Q,{startIndex:c,endIndex:l}=o,u=l-c+1;return s.push({t:`r`,len:c}),s.push({t:`r`,len:u,body:{dataStream:``,customDecorations:[{startIndex:0,endIndex:u-1,id:n,type:9999}]}}),s}function Lm(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function Rm(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):Lm(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function zm(e){return{...H.deepClone(e),rangeId:U()}}function Bm(e,t){let n=[],r=e[0];for(let i of t)i<e[0]||i>e[1]||(r<i&&n.push([r,i-1]),r=i+1);return r<=e[1]&&n.push([r,e[1]]),n}function Vm(e,t,n,r){let i=[];for(let a=0,o=n.length;a<o;a++){let o=n[a];if((r===void 0||o.rangeType===r)&&Math.max(o.startIndex,e)<=Math.min(o.endIndex,t)&&i.push({...o}),o.startIndex>t)break}return i}function Hm(e,t){var n,r,i,a,o;let s=Vm(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(n=t.customRanges)==null?[]:n),c=Math.min(e.startOffset,(r=(i=s[0])==null?void 0:i.startIndex)==null?1/0:r),l=Math.max(e.endOffset,((a=(o=s[s.length-1])==null?void 0:o.endIndex)==null?-1/0:a)+1);return{startOffset:c,endOffset:l,collapsed:c===l}}var Um=h(f(((e,t)=>{var n=-1,r=1,i=0;function a(e,t,n,r,a){if(e===t)return e?[[i,e]]:[];if(n!=null){var s=D(e,t,n);if(s)return s}var c=l(e,t),u=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=d(e,t);var f=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var m=o(e,t);return u&&m.unshift([i,u]),f&&m.push([i,f]),b(m,a),r&&p(m),m}function o(e,t){var o;if(!e)return[[r,t]];if(!t)return[[n,e]];var c=e.length>t.length?e:t,l=e.length>t.length?t:e,u=c.indexOf(l);if(u!==-1)return o=[[r,c.substring(0,u)],[i,l],[r,c.substring(u+l.length)]],e.length>t.length&&(o[0][0]=o[2][0]=n),o;if(l.length===1)return[[n,e],[r,t]];var d=f(e,t);if(d){var p=d[0],m=d[1],h=d[2],g=d[3],_=d[4],v=a(p,h),y=a(m,g);return v.concat([[i,_]],y)}return s(e,t)}function s(e,t){for(var i=e.length,a=t.length,o=Math.ceil((i+a)/2),s=o,l=2*o,u=Array(l),d=Array(l),f=0;f<l;f++)u[f]=-1,d[f]=-1;u[s+1]=0,d[s+1]=0;for(var p=i-a,m=p%2!=0,h=0,g=0,_=0,v=0,y=0;y<o;y++){for(var b=-y+h;b<=y-g;b+=2){for(var x=s+b,S=b===-y||b!==y&&u[x-1]<u[x+1]?u[x+1]:u[x-1]+1,C=S-b;S<i&&C<a&&e.charAt(S)===t.charAt(C);)S++,C++;if(u[x]=S,S>i)g+=2;else if(C>a)h+=2;else if(m){var w=s+p-b;if(w>=0&&w<l&&d[w]!==-1){var T=i-d[w];if(S>=T)return c(e,t,S,C)}}}for(var E=-y+_;E<=y-v;E+=2){for(var w=s+E,T=E===-y||E!==y&&d[w-1]<d[w+1]?d[w+1]:d[w-1]+1,D=T-E;T<i&&D<a&&e.charAt(i-T-1)===t.charAt(a-D-1);)T++,D++;if(d[w]=T,T>i)v+=2;else if(D>a)_+=2;else if(!m){var x=s+p-E;if(x>=0&&x<l&&u[x]!==-1){var S=u[x],C=s+S-x;if(T=i-T,S>=T)return c(e,t,S,C)}}}}return[[n,e],[r,t]]}function c(e,t,n,r){var i=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=a(i,o),u=a(s,c);return l.concat(u)}function l(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return x(e.charCodeAt(i-1))&&i--,i}function u(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}}function d(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return S(e.charCodeAt(e.length-i))&&i--,i}function f(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;function i(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),i=-1,a=``,o,s,c,u;(i=t.indexOf(r,i+1))!==-1;){var f=l(e.substring(n),t.substring(i)),p=d(e.substring(0,n),t.substring(0,i));a.length<p+f&&(a=t.substring(i-p,i)+t.substring(i,i+f),o=e.substring(0,n-p),s=e.substring(n+f),c=t.substring(0,i-p),u=t.substring(i+f))}return a.length*2>=e.length?[o,s,c,u,a]:null}var a=i(n,r,Math.ceil(n.length/4)),o=i(n,r,Math.ceil(n.length/2)),s;if(!a&&!o)return null;s=o?a&&a[4].length>o[4].length?a:o:a;var c,u,f,p;e.length>t.length?(c=s[0],u=s[1],f=s[2],p=s[3]):(f=s[0],p=s[1],c=s[2],u=s[3]);var m=s[4];return[c,u,f,p,m]}function p(e){for(var t=!1,a=[],o=0,s=null,c=0,l=0,d=0,f=0,p=0;c<e.length;)e[c][0]==i?(a[o++]=c,l=f,d=p,f=0,p=0,s=e[c][1]):(e[c][0]==r?f+=e[c][1].length:p+=e[c][1].length,s&&s.length<=Math.max(l,d)&&s.length<=Math.max(f,p)&&(e.splice(a[o-1],0,[n,s]),e[a[o-1]+1][0]=r,o--,o--,c=o>0?a[o-1]:-1,l=0,d=0,f=0,p=0,s=null,t=!0)),c++;for(t&&b(e),y(e),c=1;c<e.length;){if(e[c-1][0]==n&&e[c][0]==r){var m=e[c-1][1],h=e[c][1],g=u(m,h),_=u(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(c,0,[i,h.substring(0,g)]),e[c-1][1]=m.substring(0,m.length-g),e[c+1][1]=h.substring(g),c++):(_>=m.length/2||_>=h.length/2)&&(e.splice(c,0,[i,m.substring(0,_)]),e[c-1][0]=r,e[c-1][1]=h.substring(0,h.length-_),e[c+1][0]=n,e[c+1][1]=m.substring(_),c++),c++}c++}}var m=/[^a-zA-Z0-9]/,h=/\s/,g=/[\r\n]/,_=/\n\r?\n$/,v=/^\r?\n\r?\n/;function y(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),i=n.match(m),a=r.match(m),o=i&&n.match(h),s=a&&r.match(h),c=o&&n.match(g),l=s&&r.match(g),u=c&&e.match(_),d=l&&t.match(v);return u||d?5:c||l?4:i&&!o&&s?3:o||s?2:i||a?1:0}for(var n=1;n<e.length-1;){if(e[n-1][0]==i&&e[n+1][0]==i){var r=e[n-1][1],a=e[n][1],o=e[n+1][1],s=d(r,a);if(s){var c=a.substring(a.length-s);r=r.substring(0,r.length-s),a=c+a.substring(0,a.length-s),o=c+o}for(var l=r,u=a,f=o,p=t(r,a)+t(a,o);a.charAt(0)===o.charAt(0);){r+=a.charAt(0),a=a.substring(1)+o.charAt(0),o=o.substring(1);var y=t(r,a)+t(a,o);y>=p&&(p=y,l=r,u=a,f=o)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=u,f?e[n+1][1]=f:(e.splice(n+1,1),n--))}n++}}function b(e,t){e.push([i,``]);for(var a=0,o=0,s=0,c=``,u=``,f;a<e.length;){if(a<e.length-1&&!e[a][1]){e.splice(a,1);continue}switch(e[a][0]){case r:s++,u+=e[a][1],a++;break;case n:o++,c+=e[a][1],a++;break;case i:var p=a-s-o-1;if(t){if(p>=0&&w(e[p][1])){var m=e[p][1].slice(-1);if(e[p][1]=e[p][1].slice(0,-1),c=m+c,u=m+u,!e[p][1]){e.splice(p,1),a--;var h=p-1;e[h]&&e[h][0]===r&&(s++,u=e[h][1]+u,h--),e[h]&&e[h][0]===n&&(o++,c=e[h][1]+c,h--),p=h}}if(C(e[a][1])){var m=e[a][1].charAt(0);e[a][1]=e[a][1].slice(1),c+=m,u+=m}}if(a<e.length-1&&!e[a][1]){e.splice(a,1);break}if(c.length>0||u.length>0){c.length>0&&u.length>0&&(f=l(u,c),f!==0&&(p>=0?e[p][1]+=u.substring(0,f):(e.splice(0,0,[i,u.substring(0,f)]),a++),u=u.substring(f),c=c.substring(f)),f=d(u,c),f!==0&&(e[a][1]=u.substring(u.length-f)+e[a][1],u=u.substring(0,u.length-f),c=c.substring(0,c.length-f)));var g=s+o;c.length===0&&u.length===0?(e.splice(a-g,g),a-=g):c.length===0?(e.splice(a-g,g,[r,u]),a=a-g+1):u.length===0?(e.splice(a-g,g,[n,c]),a=a-g+1):(e.splice(a-g,g,[n,c],[r,u]),a=a-g+2)}a!==0&&e[a-1][0]===i?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,s=0,o=0,c=``,u=``;break}}e[e.length-1][1]===``&&e.pop();var _=!1;for(a=1;a<e.length-1;)e[a-1][0]===i&&e[a+1][0]===i&&(e[a][1].substring(e[a][1].length-e[a-1][1].length)===e[a-1][1]?(e[a][1]=e[a-1][1]+e[a][1].substring(0,e[a][1].length-e[a-1][1].length),e[a+1][1]=e[a-1][1]+e[a+1][1],e.splice(a-1,1),_=!0):e[a][1].substring(0,e[a+1][1].length)==e[a+1][1]&&(e[a-1][1]+=e[a+1][1],e[a][1]=e[a][1].substring(e[a+1][1].length)+e[a+1][1],e.splice(a+1,1),_=!0)),a++;_&&b(e,t)}function x(e){return e>=55296&&e<=56319}function S(e){return e>=56320&&e<=57343}function C(e){return S(e.charCodeAt(0))}function w(e){return x(e.charCodeAt(e.length-1))}function T(e){for(var t=[],n=0;n<e.length;n++)e[n][1].length>0&&t.push(e[n]);return t}function E(e,t,a,o){return w(e)||C(o)?null:T([[i,e],[n,t],[r,a],[i,o]])}function D(e,t,n){var r=typeof n==`number`?{index:n,length:0}:n.oldRange,i=typeof n==`number`?null:n.newRange,a=e.length,o=t.length;if(r.length===0&&(i===null||i.length===0)){var s=r.index,c=e.slice(0,s),l=e.slice(s),u=i?i.index:null;editBefore:{var d=s+o-a;if(u!==null&&u!==d||d<0||d>o)break editBefore;var f=t.slice(0,d),p=t.slice(d);if(p!==l)break editBefore;var m=Math.min(s,d),h=c.slice(0,m),g=f.slice(0,m);if(h!==g)break editBefore;var _=c.slice(m),v=f.slice(m);return E(h,_,v,l)}editAfter:{if(u!==null&&u!==s)break editAfter;var y=s,f=t.slice(0,y),p=t.slice(y);if(f!==c)break editAfter;var b=Math.min(a-y,o-y),x=l.slice(l.length-b),S=p.slice(p.length-b);if(x!==S)break editAfter;var _=l.slice(0,l.length-b),v=p.slice(0,p.length-b);return E(c,_,v,x)}}if(r.length>0&&i&&i.length===0)replaceRange:{var h=e.slice(0,r.index),x=e.slice(r.index+r.length),m=h.length,b=x.length;if(o<m+b)break replaceRange;var g=t.slice(0,m),S=t.slice(o-b);if(h!==g||x!==S)break replaceRange;var _=e.slice(m,a-b),v=t.slice(m,o-b);return E(h,_,v,x)}return null}function O(e,t,n,r){return a(e,t,n,r,!0)}O.INSERT=r,O.DELETE=n,O.EQUAL=i,t.exports=O}))());function Wm(e){var t,n;let{rangeId:r,segmentId:i,documentDataModel:a,insert:o}=e,s=(t=a.getSelfOrHeaderFooterModel(i).getBody())==null||(t=t.customRanges)==null?void 0:t.find(e=>e.rangeId===r);if(!s)return!1;let{startIndex:c,endIndex:l}=s,u=new Q,d=l-c+1;u.push({t:`r`,len:c}),u.push({t:`r`,len:d,body:{dataStream:``,customRanges:[]}}),o&&u.push({t:`i`,body:o,len:o.dataStream.length});let f=l+1+((n=o==null?void 0:o.dataStream.length)==null?0:n);return u.selections=[{startOffset:f,endOffset:f,collapsed:!0}],u}function Gm(e){let{ranges:t,rangeId:n,rangeType:r,wholeEntity:i,properties:a,body:o}=e,s=0,c=new Q,l=!1;return t.forEach(e=>{var t,u,d;let f=Hm(e,o);if(!f||!o)return!1;let{startOffset:p,endOffset:m}=f,h=(t=o.customRanges)==null?[]:t,g=(e,t,o)=>{var l,u,d,f;let p=Vm(e,t,h,r),m=Math.min((l=(u=p[0])==null?void 0:u.startIndex)==null?1/0:l,e),g=Math.max((d=(f=p[p.length-1])==null?void 0:f.endIndex)==null?-1/0:d,t),_={rangeId:o?`${n}$${o}`:n,rangeType:r,startIndex:0,endIndex:g-m,wholeEntity:i,properties:{...a}};c.push({t:`r`,len:m-s}),c.push({t:`r`,len:g-m+1,body:{dataStream:``,customRanges:[_]},coverType:0}),s=g+1},_=((u=o.paragraphs)==null?[]:u).filter(e=>e.startIndex<m&&e.startIndex>p),v=((d=o.customBlocks)==null?[]:d).filter(e=>e.startIndex<m&&e.startIndex>p);Bm([p,m-1],[..._.map(e=>e.startIndex),...v.map(e=>e.startIndex)]).forEach(([e,t],n)=>g(e,t,n)),l=!0,c.selections=[{startOffset:f.endOffset,endOffset:f.endOffset,collapsed:!0}]}),l?c:!1}function Km(e,t,n=0,r=null,i=!0){e.sort((e,t)=>e.startOffset-t.startOffset);let a=[],{paragraphs:o=[]}=t,s=o==null?void 0:o.find(t=>t.startIndex>=e[0].startOffset&&t.startIndex<e[0].endOffset),c=n;if(e.forEach(e=>{let{startOffset:t,endOffset:n}=e;t>c&&(a.push({t:`r`,len:t-c}),c=t),c<n&&(a.push({t:`d`,len:n-c}),c=n)}),r&&a.push({t:`i`,body:r,len:r.dataStream.length}),s&&i){let t=o.find(t=>t.startIndex-n>=e[e.length-1].endOffset-1);t&&(t.startIndex>c&&(a.push({t:`r`,len:t.startIndex-c}),c=t.startIndex),a.push({t:`r`,len:1,body:{dataStream:``,paragraphs:[{...t,startIndex:0,bullet:s==null?void 0:s.bullet}]},coverType:1}))}return a}function qm(e,t,n=0){let r=[],i=n;return e.forEach(e=>{let{startOffset:n,endOffset:a}=e;n>i&&(r.push({t:`r`,len:n-i}),i=n),a>i&&(r.push({t:`r`,len:a-i,body:{...H.deepClone(t),dataStream:``}}),i=a)}),r}let Jm=e=>{var t;let{selection:n,body:r,doc:i}=e,a=n.segmentId,o=(t=i.getSelfOrHeaderFooterModel(a))==null?void 0:t.getBody();if(!o)return!1;let s=n.collapsed?null:nm(o,n.startOffset,n.endOffset),c=(0,Um.default)(s?s.dataStream:``,r.dataStream),l=0,u=c.map(([e,t])=>{switch(e){case 0:{let e={t:`r`,body:{...nm(r,l,l+t.length,!1),dataStream:``},len:t.length};return l+=t.length,e}case 1:{let e={t:`i`,body:nm(r,l,l+t.length),len:t.length};return l+=t.length,e}default:return{t:`d`,len:t.length}}}),d=new Q;return d.push({t:`r`,len:n.startOffset}),d.push(...u),d};function Ym(e,t){return!!((e==null?void 0:e.length)===(t==null?void 0:t.length)&&e!=null&&e.every((e,n)=>JSON.stringify(e)===JSON.stringify(t==null?void 0:t[n])))}let Xm=e=>{var t;let{selection:n,body:r,doc:i,themeService:a}=e,o=n.segmentId,s=(t=i.getSelfOrHeaderFooterModel(o))==null?void 0:t.getBody();if(!s)return!1;let c=n.collapsed?null:nm(s,n.startOffset,n.endOffset),l=(0,Um.default)(c?c.dataStream:``,r.dataStream),u=0,d=l.map(([e,t])=>{switch(e){case 0:{let e=Zp(r,u,u+t.length,!1),n={t:`r`,body:Ym(e,Zp(c,u,u+t.length,!1))?void 0:{textRuns:e==null?void 0:e.map(e=>{var t,n,r,i;return{...e,ts:{...e.ts,cl:!((t=e.ts)==null||(t=t.cl)==null||(t=t.rgb)==null)&&t.includes(`.`)?{rgb:a.getColorFromTheme((n=(r=e.ts)==null||(r=r.cl)==null?void 0:r.rgb)==null?``:n)}:(i=e.ts)==null?void 0:i.cl}}}),dataStream:``},len:t.length};return u+=t.length,n}case 1:{let e={t:`i`,body:nm(r,u,u+t.length),len:t.length};return u+=t.length,e}default:return{t:`d`,len:t.length}}});if(d.every(e=>e.t===`r`&&!e.body))return!1;let f=new Q;return f.push({t:`r`,len:n.startOffset}),f.push(...d),f};function Zm(e,t){let n=[],{customBlocks:r=[]}=e;for(let e of t){let{startOffset:t,endOffset:i}=e;if(!(t==null||i==null))for(let e of r){let{startIndex:r}=e;r>=t&&r<i&&n.push(e.blockId)}}return n}function Qm(e,t=``){if(!t)return[`body`];let{headers:n,footers:r}=e.getSnapshot();if(n==null&&r==null)throw Error(`Document data model must have headers or footers when update by segment id`);if((n==null?void 0:n[t])!=null)return[`headers`,t,`body`];if((r==null?void 0:r[t])!=null)return[`footers`,t,`body`];throw Error(`Segment id not found in headers or footers`)}let $m=e=>{var t,n;let{selection:r,documentDataModel:i,drawings:a}=e,{collapsed:o,startOffset:s,segmentId:c}=r,l=new Q,u=wm.getInstance(),d=[],f=i.getSelfOrHeaderFooterModel(c).getBody();if(!f)return!1;let p=(t=(n=i.getSnapshot().drawingsOrder)==null?void 0:n.length)==null?0:t,m=0;if(o)s>0&&l.push({t:`r`,len:s});else{var h,g;let e=Km([r],f,0,null,!1);l.push(...e);let t=Zm(f,[r]),n=(h=i.getDrawings())==null?{}:h,a=(g=i.getDrawingsOrder())==null?[]:g,o=t.sort((e,t)=>a.indexOf(e)>a.indexOf(t)?-1:+(a.indexOf(e)<a.indexOf(t)));if(o.length>0)for(let e of o){let t=n[e],r=a.indexOf(e);if(t==null||r<0)continue;let i=u.removeOp([`drawings`,e],t),o=u.removeOp([`drawingsOrder`,r],e);d.push(i),d.push(o),m++}}l.push({t:`i`,body:{dataStream:`\b`.repeat(a.length),customBlocks:a.map((e,t)=>({startIndex:t,blockId:e.drawingId}))},len:a.length});let _=Qm(i,c),v=u.editOp(l.serialize(),_);d.push(v);for(let e of a){let{drawingId:t}=e,n=u.insertOp([`drawings`,t],e),r=u.insertOp([`drawingsOrder`,p-m],t);d.push(n),d.push(r)}return d.reduce((e,t)=>wm.compose(e,t),null)};function eh(e,t){if(t===void 0)return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function th(e){let{startOffset:t,endOffset:n,collapsed:r}=e;return{startOffset:Math.min(t,n),endOffset:Math.max(t,n),collapsed:r}}function nh(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}function rh(e,t,n,r){let{startOffset:i,endOffset:a}=e,o=r==null?oh(t,n):r,s=[],c=-1;for(let e=0;e<o.length;e++){let t=o[e],{startIndex:n}=t;(i>c&&i<=n||a>c&&a<=n||n>=i&&n<=a)&&s.push(t),c=n}return s}function ih(e,t,n){let r=[],i=oh(t,n);for(let a of e){let e=rh(a,t,n,i);r.push(...e)}return r}let ah=[`\r`,``,``,`\x1B`,``,``];function oh(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r],{startIndex:a}=i,o=a-1;for(;!ah.includes(t[o])&&o>=0;)o--;n.push({...i,paragraphStart:o+1,paragraphEnd:i.startIndex})}return n}let sh=e=>{var t,n;let{paragraphs:r,segmentId:i,document:a}=e,o=e.listType,s=(t=(n=a.getSelfOrHeaderFooterModel(i).getBody())==null?void 0:n.paragraphs)==null?[]:t,c=r.every(e=>{var t;return((t=e.bullet)==null?void 0:t.listType.indexOf(o))===0}),l=U(6);if(r.length===1){let e=s.indexOf(r[0]),t=s[e-1],n=s[e+1];t&&t.bullet&&t.bullet.listType.indexOf(o)===0?(l=t.bullet.listId,o!==`CHECK_LIST`&&(o=t.bullet.listType)):n&&n.bullet&&n.bullet.listType.indexOf(o)===0&&(l=n.bullet.listId,o!==`CHECK_LIST`&&(o=n.bullet.listType))}let u=new Bi;u.reset();let d=new Q;for(let e of r){var f;let{startIndex:t,paragraphStyle:n={},bullet:r}=e;d.push({t:`r`,len:t-u.cursor}),d.push({t:`r`,len:1,body:{dataStream:``,paragraphs:[c?{paragraphStyle:n,startIndex:0}:{startIndex:0,paragraphStyle:{...n},bullet:{nestingLevel:(f=r==null?void 0:r.nestingLevel)==null?0:f,textStyle:{fs:20},listType:o,listId:l}}]},coverType:1}),u.moveCursorTo(t+1)}return d},ch=e=>{var t;let{paragraphIndex:n,segmentId:r,document:i}=e,a=(t=i.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:t.paragraphs;if(a==null)return!1;let o=a.find(e=>e.startIndex===n);if(!(o!=null&&o.bullet)||o.bullet.listType.indexOf(`CHECK_LIST`)===-1)return!1;let s=new Bi;s.reset();let c=new Q,{startIndex:l,paragraphStyle:u={}}=o,d=o.bullet.listType===`CHECK_LIST`?`CHECK_LIST_CHECKED`:`CHECK_LIST`;return c.push({t:`r`,len:l-s.cursor}),c.push({t:`r`,len:1,body:{dataStream:``,paragraphs:[{...o,paragraphStyle:u,startIndex:0,bullet:{...o.bullet,listType:d}}]},coverType:1}),s.moveCursorTo(l+1),c},lh=e=>{var t;let{paragraphs:n,listType:r,segmentId:i,document:a}=e;if(((t=a.getSelfOrHeaderFooterModel(i).getBody())==null?void 0:t.paragraphs)==null)return!1;let o=U(6),s=new Bi;s.reset();let c=new Q;for(let e of n){var l;let{startIndex:t,paragraphStyle:n={},bullet:i}=e;c.push({t:`r`,len:t-s.cursor}),c.push({t:`r`,len:1,body:{dataStream:``,paragraphs:[{startIndex:0,paragraphStyle:n,bullet:{nestingLevel:(l=i==null?void 0:i.nestingLevel)==null?0:l,textStyle:(i==null?void 0:i.listType)===r?i.textStyle:{fs:20},listType:r,listId:o}}]},coverType:1}),s.moveCursorTo(t+1)}return c};function uh(e,t){return t.some(t=>e.startIndex>t.startIndex&&e.startIndex<t.endIndex)}let dh=e=>{var t,n,r;let{paragraphs:i,document:a,type:o}=e,s=new Bi;s.reset();let c=new Q,l=(t=a.getSnapshot().lists)==null?{}:t,u=(n=(r=a.getBody())==null?void 0:r.tables)==null?[]:n,d={...Lp,...l};for(let e of i){let{startIndex:t,paragraphStyle:n={},bullet:r}=e,i=uh(e,u);if(c.push({t:`r`,len:t-s.cursor}),r){let e=d[r.listType].nestingLevel.length-1;i&&(e=Math.min(e,2)),c.push({t:`r`,len:1,body:{dataStream:``,paragraphs:[{startIndex:0,paragraphStyle:{...n},bullet:{...r,nestingLevel:Math.max(Math.min(r.nestingLevel+o,e),0)}}]},coverType:1})}else c.push({t:`r`,len:1});s.moveCursorTo(t+1)}return c},fh=e=>{var t,n,r,i;let{textRanges:a,segmentId:o,document:s,style:c,paragraphTextRun:l,cursor:u,deleteLen:d,textX:f}=e,p=s.getSelfOrHeaderFooterModel(o),m=ih(a,(t=(n=p.getBody())==null?void 0:n.paragraphs)==null?[]:t,(r=(i=p.getBody())==null?void 0:i.dataStream)==null?``:r),h=new Bi;u&&h.moveCursorTo(u);let g=f==null?new Q:f;m.sort((e,t)=>e.startIndex-t.startIndex);let _=Math.max(0,m[0].paragraphStart-1);_>h.cursor&&(g.push({t:`r`,len:_-h.cursor}),h.moveCursorTo(_)),d&&g.push({t:`d`,len:d});for(let e of m){let{startIndex:t,paragraphStyle:n={}}=e,r=t-h.cursor;g.push({t:`r`,len:r,...l?{body:{dataStream:``,textRuns:[{ts:l,st:0,ed:r}]},coverType:1}:null}),g.push({t:`r`,len:1,body:{dataStream:``,paragraphs:[{startIndex:0,paragraphStyle:{...n,...c}}]},coverType:1}),h.moveCursorTo(t+1)}return g};var $=class{};R($,`customRange`,{add:Gm,delete:Wm,copyCustomRange:zm,getCustomRangesInterestsWithSelection:Rm,isIntersecting:Lm}),R($,`customDecoration`,{add:Fm,delete:Im}),R($,`selection`,{replace:Jm,makeSelection:eh,normalizeSelection:th,delete:Km,replaceTextRuns:Xm,retain:qm}),R($,`range`,{isIntersects:nh,getParagraphsInRange:rh,getParagraphsInRanges:ih}),R($,`transform`,{getPlainText:km,fromPlainText:jm,isEmptyDocument:Am}),R($,`paragraph`,{bullet:{set:lh,switch:sh,toggleChecklist:ch,changeNestLevel:dh},style:{set:fh},util:{transform:oh,getParagraphsInRange:rh,getParagraphsInRanges:ih}}),R($,`drawing`,{add:$m});function ph(e,t,n,r){if(t===``)return e;let i=new Pm({id:`mock-id`,body:e,documentStyle:{}}),a=t.length,o;for(;(o=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){let e=new Q,t=wm.getInstance();if(o>0&&e.retain(o),n.length>0){var s;let t=i.sliceBody(o,o+a),r={dataStream:n};Array.isArray(t==null?void 0:t.textRuns)&&t.textRuns.length&&(r.textRuns=[{...t.textRuns[0],st:0,ed:n.length}]),!(t==null||(s=t.customRanges)==null)&&s.length&&(r.customRanges=[{...t.customRanges[0],startIndex:0,endIndex:n.length-1}]),e.insert(n.length,r)}e.delete(a),i.apply(t.editOp(e.serialize()))}let c=i.getBody();return i.dispose(),c}function mh(e){if(e.customRanges||(e.customRanges=[]),!e.paragraphs){e.paragraphs=[];for(let t=0;t<e.dataStream.length;t++)e.dataStream[t]===`\r`&&e.paragraphs.push({startIndex:t})}return e.customBlocks||(e.customBlocks=[]),e.textRuns||(e.textRuns=[]),e.customDecorations||(e.customDecorations=[]),e.sectionBreaks||(e.sectionBreaks=[]),e.tables||(e.tables=[]),e}function hh(e){var t;return e.body=mh((t=e.body)==null?{dataStream:``}:t),e.drawingsOrder||(e.drawingsOrder=[]),e.drawings||(e.drawings={}),e.documentStyle||(e.documentStyle={}),e}var gh=class e{static create(t={}){return new e(t)}constructor(e={}){R(this,`_style`,void 0),this._style=e}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===1}get bold(){return this._style.bl===1}get underline(){return this._style.ul&&vh.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&vh.create(this._style.bbl)}get strikethrough(){return this._style.st&&vh.create(this._style.st)}get overline(){return this._style.ol&&vh.create(this._style.ol)}get background(){return this._style.bg}get border(){return this._style.bd}get color(){return this._style.cl}get verticalAlign(){return this._style.va}get numberFormat(){return this._style.n}copy(){return _h.create(H.deepClone(this._style))}getValue(){return{...this._style}}},_h=class e extends gh{static create(t={}){return new e(t)}constructor(e={}){super(e)}setFontFamily(e){return this._style.ff=e,this}setFontSize(e){return this._style.fs=e,this}setItalic(e){return this._style.it=+!!e,this}setBold(e){return this._style.bl=+!!e,this}setUnderline(e){return this._style.ul=e.build(),this}setBottomBorderLine(e){return this._style.bbl=e.build(),this}setStrikethrough(e){return this._style.st=e.build(),this}setOverline(e){return this._style.ol=e.build(),this}setBackground(e){return this._style.bg=e,this}setBorder(e){return this._style.bd=e,this}setColor(e){return this._style.cl=e,this}setVerticalAlign(e){return this._style.va=e,this}copy(){return e.create(H.deepClone(this._style))}build(){return this.getValue()}},vh=class e{static create(t={s:1}){return new e(t)}constructor(e={s:1}){R(this,`_decoration`,void 0),this._decoration=e}get show(){return this._decoration.s===1}get followFontColor(){return this._decoration.c===1}get color(){return this._decoration.cl}get type(){return this._decoration.t}setShow(e){return this._decoration.s=+!!e,this}setFollowFontColor(e){return this._decoration.c=+!!e,this}setColor(e){return this._decoration.cl=e,this}setLineType(e){return this._decoration.t=e,this}copy(){return e.create(H.deepClone(this._decoration))}build(){return{...this._decoration}}},yh=class e{static create(t={}){return new e(t)}constructor(e={}){R(this,`_style`,void 0),this._style=e}get indentFirstLine(){return this._style.indentFirstLine}get hanging(){return this._style.hanging}get indentStart(){return this._style.indentStart}get tabStops(){return this._style.tabStops}get indentEnd(){return this._style.indentEnd}get textStyle(){return this._style.textStyle}get headingId(){return this._style.headingId}get namedStyleType(){return this._style.namedStyleType}get horizontalAlign(){return this._style.horizontalAlign}get lineSpacing(){return this._style.lineSpacing}get direction(){return this._style.direction}get spacingRule(){return this._style.spacingRule}get snapToGrid(){return this._style.snapToGrid}get spaceAbove(){return this._style.spaceAbove}get spaceBelow(){return this._style.spaceBelow}get borderBetween(){return this._style.borderBetween}get borderTop(){return this._style.borderTop}get borderBottom(){return this._style.borderBottom}get borderLeft(){return this._style.borderLeft}get borderRight(){return this._style.borderRight}get keepLines(){return this._style.keepLines===1}get keepNext(){return this._style.keepNext===1}get wordWrap(){return this._style.wordWrap===1}get widowControl(){return this._style.widowControl===1}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===1}copy(){return bh.create(H.deepClone(this._style))}getValue(){return this._style}},bh=class e extends yh{static create(t={}){return new e(t)}constructor(e={}){super(e)}setIndentFirstLine(e){return this._style.indentFirstLine=e,this}setHanging(e){return this._style.hanging=e,this}setIndentStart(e){return this._style.indentStart=e,this}setTabStops(e){return this._style.tabStops=e,this}setIndentEnd(e){return this._style.indentEnd=e,this}setTextStyle(e){return this._style.textStyle=e,this}setHeadingId(e){return this._style.headingId=e,this}setNamedStyleType(e){return this._style.namedStyleType=e,this}setHorizontalAlign(e){return this._style.horizontalAlign=e,this}setLineSpacing(e){return this._style.lineSpacing=e,this}setDirection(e){return this._style.direction=e,this}setSpacingRule(e){return this._style.spacingRule=e,this}setSnapToGrid(e){return this._style.snapToGrid=+!!e,this}setSpaceAbove(e){return this._style.spaceAbove=e,this}setSpaceBelow(e){return this._style.spaceBelow=e,this}setBorderBetween(e){return this._style.borderBetween=e,this}setBorderTop(e){return this._style.borderTop=e,this}setBorderBottom(e){return this._style.borderBottom=e,this}setBorderLeft(e){return this._style.borderLeft=e,this}setBorderRight(e){return this._style.borderRight=e,this}setKeepLines(e){return this._style.keepLines=+!!e,this}setKeepNext(e){return this._style.keepNext=+!!e,this}setWordWrap(e){return this._style.wordWrap=+!!e,this}setWidowControl(e){return this._style.widowControl=+!!e,this}setShading(e){return this._style.shading=e,this}setSuppressHyphenation(e){return this._style.suppressHyphenation=+!!e,this}copy(){return e.create(H.deepClone(this._style))}build(){return this.getValue()}},xh=class e{static create(t){return new e(t)}static createByBody(t){return new e({body:t,id:`d`,documentStyle:{}})}constructor(e){if(R(this,`_data`,void 0),!e.body)throw Error(`Invalid document data, body is required`);this._data=hh(e)}copy(){return Sh.create(H.deepClone(this._data))}slice(e,t){let{body:n,...r}=this._data;return Sh.create({...H.deepClone(r),body:nm(n,e,t)})}toPlainText(){var e,t;return $.transform.getPlainText((e=(t=this._data.body)==null?void 0:t.dataStream)==null?``:e).replaceAll(`\r`,`
|
|
6
|
+
`)}getParagraphStyle(){var e;return yh.create((e=this._data.body)==null||(e=e.paragraphs)==null?void 0:e[0].paragraphStyle)}getParagraphBullet(){var e;return(e=this._data.body)==null||(e=e.paragraphs)==null?void 0:e[0].bullet}getParagraphs(){var e,t;let n=(e=(t=this._data.body)==null?void 0:t.paragraphs)==null?[]:e,r=0;return n.map(e=>{let t=this.slice(r,e.startIndex);return r=e.startIndex,t})}getTextRuns(){var e,t;return((e=(t=this._data.body)==null?void 0:t.textRuns)==null?[]:e).map(e=>({...e,ts:e.ts?gh.create(e.ts):null}))}getLinks(){var e,t;return(e=(t=this._data.body)==null||(t=t.customRanges)==null?void 0:t.filter(e=>e.rangeType===0))==null?[]:e}getData(){return this._data}},Sh=class e extends xh{static newEmptyData(){return hh({id:`d`,documentStyle:{},drawings:{},drawingsOrder:[],body:{dataStream:`\r
|
|
7
|
+
`,customBlocks:[],customRanges:[],paragraphs:[{startIndex:0}],textRuns:[],tables:[],sectionBreaks:[]}})}static create(t){return new e(t==null?e.newEmptyData():t)}constructor(e){super(e),R(this,`_doc`,void 0),this._doc=new Pm(e)}insertText(e,t,n){var r,i;let a=((r=(i=this._data.body)==null?void 0:i.dataStream.length)==null?2:r)-2,o,s;if(typeof e==`string`?o=e:(a=Math.min(e,a),o=t),s=typeof t==`object`?t instanceof _h?t.build():t:n instanceof _h?n.build():n,!o)return this;let c={dataStream:o,textRuns:s?[{ts:s,st:a,ed:a+o.length}]:[]},l=$.selection.replace({doc:this._doc,selection:{startOffset:a,endOffset:a,collapsed:!0},body:c});if(!l)throw Error(`Insert text failed, please check.`);return Q.apply(this._doc.getBody(),l.serialize()),this}insertRichText(e,t){var n,r;let i=((n=(r=this._data.body)==null?void 0:r.dataStream.length)==null?2:n)-2,a;typeof e==`object`?a=e instanceof xh?e.getData():e:(i=Math.min(e,i),a=t instanceof xh?t.getData():t);let o=$.selection.replace({doc:this._doc,selection:{startOffset:i,endOffset:i,collapsed:!0},body:a.body});if(!o)throw Error(`Insert text failed, please check.`);return Q.apply(this._doc.getBody(),o.serialize()),this}delete(e,t){if(t!==void 0){if(!t)return this;let n=$.selection.delete([{startOffset:e,endOffset:e+t,collapsed:!0}],this._data.body);Q.apply(this._doc.getBody(),n)}return this}setStyle(e,t,n){let r={dataStream:``,textRuns:[{ts:n instanceof _h?n.build():n,st:0,ed:t-e}]},i=$.selection.retain([{startOffset:e,endOffset:t,collapsed:!0}],r);return Q.apply(this._doc.getBody(),i),this}setLink(e,t,n){let r=$.customRange.add({rangeType:0,rangeId:U(),properties:{url:n},ranges:[{startOffset:e,endOffset:t,collapsed:!1}],body:this._data.body});if(!r)throw Error(`Insert text failed, please check.`);return Q.apply(this._doc.getBody(),r.serialize()),this}cancelLink(e,t){if(typeof e==`string`){let t=$.customRange.delete({rangeId:e,documentDataModel:this._doc});if(!t)throw Error(`Insert text failed, please check.`);Q.apply(this._doc.getBody(),t.serialize())}else this.slice(e,t).getLinks().forEach(e=>{let t=$.customRange.delete({rangeId:e.rangeId,documentDataModel:this._doc});if(!t)throw Error(`Insert text failed, please check.`);Q.apply(this._doc.getBody(),t.serialize())});return this}updateLink(e,t){var n;let r=(n=this._data.body)==null||(n=n.customRanges)==null?void 0:n.find(t=>t.rangeId===e);if(!r)throw Error(`Link not found`);return r.properties.url=t,this}insertParagraph(e,t){let n,r;if(typeof e==`object`){var i,a;n={dataStream:`\r`,paragraphs:[{startIndex:0,paragraphStyle:e.build()}]},r=((i=(a=this._data.body)==null?void 0:a.dataStream.length)==null?2:i)-2}else r=e,n={dataStream:`\r`,paragraphs:[{startIndex:0,paragraphStyle:t==null?void 0:t.build()}]};return this.insertRichText(r,xh.create({body:n,id:`d`,documentStyle:{}})),this}insertLink(t,n,r){let i=``,a=``;typeof t==`string`?(i=t,a=n):(i=n,a=r);let o=e.createByBody({dataStream:i,customRanges:[{rangeType:0,rangeId:U(),properties:{url:a},startIndex:0,endIndex:i.length-1}]});return typeof t==`number`?this.insertRichText(t,o):this.insertRichText(o)}},Ch=class{constructor(){R(this,`skipNextObservers`,!1),R(this,`lastReturnValue`,void 0),R(this,`isStopPropagation`,!1)}stopPropagation(){this.isStopPropagation=!0}},wh=class extends r.Subject{constructor(...e){super(...e),R(this,`_sortedObservers`,[])}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(e){let t;t=typeof e==`function`?{next:([t,n])=>e(t,n)}:e;let n=super.subscribe(t);return this._sortedObservers.push(t),this._sortedObservers.sort((e,t)=>{var n,r;return((n=e.priority)==null?0:n)-((r=t.priority)==null?0:r)}),n.add(()=>this._sortedObservers=this._sortedObservers.filter(e=>e!==t)),n}clearObservers(){this._sortedObservers.forEach(e=>{var t;return(t=e.complete)==null?void 0:t.call(e)}),this._sortedObservers.length=0}emitEvent(e){if(!this.closed){let n=new Ch;n.lastReturnValue=e;for(let r of this._sortedObservers){var t;if(n.lastReturnValue=(t=r.next)==null?void 0:t.call(r,[e,n]),n.skipNextObservers)return{handled:!0,lastReturnValue:n.lastReturnValue,stopPropagation:n.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:n.lastReturnValue,stopPropagation:n.isStopPropagation}}throw Error(`[EventSubject]: cannot emit event on a closed subject.`)}};function Th(e){return new r.Observable(t=>{let n=e.subscribeEvent(e=>{t.next(e)});return()=>n.unsubscribe()})}let Eh=(0,t.createIdentifier)(`core.resource-manager.service`),Dh={[n.UnitRole.Editor]:`Editor`,[n.UnitRole.Owner]:`Owner`,[n.UnitRole.Reader]:`Reader`,[n.UnitRole.UNRECOGNIZED]:`UNRECOGNIZED`},Oh=e=>e?{userID:`${Dh[e]}_${U(8)}`,name:Dh[e],avatar:``}:{userID:``,name:``,avatar:``,anonymous:!0,canBindAnonymous:!1},kh=(e,t)=>e.startsWith(Dh[t]);var Ah=class extends V{constructor(...e){super(...e),R(this,`_model`,new Map),R(this,`_userChange$`,new r.Subject),R(this,`userChange$`,this._userChange$.asObservable()),R(this,`_currentUser$`,new r.BehaviorSubject(Oh())),R(this,`currentUser$`,this._currentUser$.asObservable())}dispose(){super.dispose(),this._model.clear(),this._userChange$.complete(),this._currentUser$.complete()}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(e){this.addUser(e),this._currentUser$.next(e)}addUser(e){this._model.set(e.userID,e),this._userChange$.next({type:`add`,user:e})}getUser(e,t){let n=this._model.get(e);if(n)return n;t&&t()}delete(e){let t=this.getUser(e);this._model.delete(e),t&&this._userChange$.next({type:`delete`,user:t})}clear(){this._model.clear(),this._userChange$.next({type:`clear`})}list(){return Array.from(this._model.values())}};let jh=class{constructor(e,t){this._resourceManagerService=e,this._userManagerService=t,R(this,`_permissionMap`,new Map([])),R(this,`_permissionOverrides`,new Map),R(this,`_cfgEnableObjInherit`,!1),this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){let e=this._userManagerService.getCurrentUser();e&&e.userID||this._userManagerService.setCurrentUser(Oh(n.UnitRole.Owner))}_getRole(e){let t=this._userManagerService.getCurrentUser();return t?kh(t.userID,e):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:e=>{let t=[...this._permissionMap.keys()].reduce((e,t)=>(e[t]=this._permissionMap.get(t),e),{});return JSON.stringify(t)},parseJson:e=>JSON.parse(e),pluginName:`SHEET_AuthzIoMockService_PLUGIN`,businesses:[n.UniverType.UNIVER_SHEET,n.UniverType.UNIVER_DOC,n.UniverType.UNIVER_SLIDE],onLoad:(e,t)=>{for(let e in t)this._permissionMap.set(e,t[e])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(e){let t=U(8),{objectType:r,selectRangeObject:i,worksheetObject:a}=e,o=i||a,s={objectType:r,unitID:(o==null?void 0:o.unitID)||``,name:(o==null?void 0:o.name)||``,strategies:[{action:6,role:n.UnitRole.Owner},{action:16,role:n.UnitRole.Owner},{action:17,role:n.UnitRole.Owner},{action:18,role:n.UnitRole.Owner},{action:19,role:n.UnitRole.Owner},{action:33,role:n.UnitRole.Owner},{action:34,role:n.UnitRole.Owner},{action:35,role:n.UnitRole.Owner},{action:36,role:n.UnitRole.Owner},{action:37,role:n.UnitRole.Owner},{action:38,role:n.UnitRole.Owner},{action:39,role:n.UnitRole.Owner},{action:40,role:n.UnitRole.Owner}],selectRangeObject:i};return this._permissionMap.set(t,s),t}async allowed(e){let{objectID:t,actions:r}=e,i=this._permissionMap.get(t);return i?r.map(e=>{let r=`${t}:${e}`;if(this._permissionOverrides.has(r))return{action:e,allowed:this._permissionOverrides.get(r)};let a=i.strategies.find(t=>t.action===e);return a?{action:e,allowed:this._getRole(a.role)}:{action:e,allowed:this._getRole(n.UnitRole.Owner)||this._getRole(n.UnitRole.Editor)}}):r.map(e=>({action:e,allowed:this._getRole(n.UnitRole.Owner)||this._getRole(n.UnitRole.Editor)}))}async batchAllowed(e){let t=await Promise.all(e.map(e=>this.allowed(e)));return e.map((e,n)=>({unitID:e.unitID,objectID:e.objectID,actions:t[n]}))}async list(e){let t=[],r=[{action:6,role:n.UnitRole.Owner},{action:16,role:n.UnitRole.Owner},{action:17,role:n.UnitRole.Owner},{action:18,role:n.UnitRole.Owner},{action:19,role:n.UnitRole.Owner},{action:33,role:n.UnitRole.Owner},{action:34,role:n.UnitRole.Owner},{action:35,role:n.UnitRole.Owner},{action:36,role:n.UnitRole.Owner},{action:37,role:n.UnitRole.Owner},{action:38,role:n.UnitRole.Owner},{action:39,role:n.UnitRole.Owner},{action:40,role:n.UnitRole.Owner}];return e.objectIDs.forEach(i=>{let a=this._permissionMap.get(i),o=(a==null?void 0:a.strategies)||r,s={objectID:i,unitID:e.unitID,objectType:(a==null?void 0:a.objectType)||3,name:(a==null?void 0:a.name)||``,shareOn:!1,shareRole:n.UnitRole.Owner,shareScope:-1,scope:{read:n.ObjectScope.AllCollaborator,edit:n.ObjectScope.AllCollaborator},creator:Oh(n.UnitRole.Owner),strategies:o.map(e=>({action:e.action,role:e.role})),actions:e.actions.map(e=>{let t=`${i}:${e}`;if(this._permissionOverrides.has(t))return{action:e,allowed:this._permissionOverrides.get(t)};let r=o.find(t=>t.action===e);return r?{action:e,allowed:this._getRole(r.role)}:{action:e,allowed:this._getRole(n.UnitRole.Owner)||this._getRole(n.UnitRole.Editor)}})};t.push(s)}),t}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(e){let{objectID:t,strategies:r}=e,i=this._permissionMap.get(t);i&&r&&(i.strategies=r.map(e=>({action:e.action,role:e.role})),this._permissionMap.set(t,i),r.forEach(e=>{e.role===n.UnitRole.Reader?this.setPermissionOverride(t,e.action,!1):(e.role===n.UnitRole.Owner||e.role===n.UnitRole.Editor)&&this.clearPermissionOverride(t,e.action)}))}setPermissionOverride(e,t,n){let r=`${e}:${t}`;this._permissionOverrides.set(r,n)}clearPermissionOverride(e,t){let n=`${e}:${t}`;this._permissionOverrides.delete(n)}clearAllOverrides(e){let t=[];this._permissionOverrides.forEach((n,r)=>{r.startsWith(`${e}:`)&&t.push(r)}),t.forEach(e=>this._permissionOverrides.delete(e))}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(e){}setCfgEnableObjInherit(e){this._cfgEnableObjInherit=e}getCfgEnableObjInherit(){return this._cfgEnableObjInherit}};jh=ss([W(0,Eh),W(1,(0,t.Inject)(Ah))],jh);let Mh=(0,t.createIdentifier)(`IAuthzIoIoService`),Nh=(0,t.createIdentifier)(`univer.confirm-service`);var Ph=class{constructor(){R(this,`confirmOptions$`,new r.Subject)}dispose(){this.confirmOptions$.complete()}open(e){throw Error(`This is not implemented in the test service!`)}confirm(e){return Promise.resolve(!0)}close(e){throw Error(`This is not implemented in the test service!`)}};let Fh=`FOCUSING_UNIT`,Ih=`FOCUSING_SHEET`,Lh=`FOCUSING_DOC`,Rh=`FOCUSING_SLIDE`,zh=`EDITOR_ACTIVATED`,Bh=`FOCUSING_FX_BAR_EDITOR`;var Vh=class extends V{constructor(...e){super(...e),R(this,`_error$`,new r.Subject),R(this,`error$`,this._error$.asObservable())}dispose(){this._error$.complete()}emit(e){this._error$.next({errorKey:e})}};let Hh=function(e){return e.URL=`URL`,e.UUID=`UUID`,e.BASE64=`BASE64`,e}({}),Uh=function(e){return e.SUCCUSS=`0`,e.ERROR_EXCEED_SIZE=`1`,e.ERROR_IMAGE_TYPE=`2`,e.ERROR_UPLOAD_COUNT_LIMIT=`3`,e.ERROR_IMAGE=`4`,e}({}),Wh=(0,t.createIdentifier)(`core.image-io.service`),Gh=(0,t.createIdentifier)(`core.url-image.service`);var Kh=`@univerjs/core`,qh=`0.22.0`;function Jh(e=``,t=`zhCN`,n=``){return{id:e,sheetOrder:[],name:n,appVersion:qh,locale:t,styles:{},sheets:{},resources:[]}}var Yh=class{constructor(e={}){R(this,`_styles`,void 0),R(this,`_cacheMap`,new of(1e5)),this._styles=e,this._generateCacheMap()}each(e){return Object.entries(this._styles).forEach(e),this}search(e,t){return this._cacheMap.has(t)?this._cacheMap.get(t):this._getExistingStyleId(e)||`-1`}get(e){return typeof e==`string`?(e=String(e),this._styles[e]):e}add(e,t){let n=U(6);return this._styles[n]=e,this._cacheMap.set(t,n),n}setValue(e){if(e==null)return;let t=JSON.stringify(e),n=this.search(e,t);return n===`-1`?this.add(e,t):n}addCustomStyle(e,t){t!=null&&(this._styles[e]=t,this._cacheMap.set(JSON.stringify(t),e))}remove(e){let t=this._styles[e];t&&(delete this._styles[e],this._cacheMap.delete(JSON.stringify(t)))}toJSON(){return this._styles}getStyleByCell(e){let t;t=e&&H.isObject(e.s)?e.s:(e==null?void 0:e.s)&&this.get(e.s);let n=e==null?void 0:e.interceptorStyle;return n?{...t,...n}:t}_generateCacheMap(){let{_styles:e,_cacheMap:t}=this;for(let n in e){let r=JSON.stringify(e[n]);t.set(r,n)}}_getExistingStyleId(e){let{_styles:t}=this;for(let n in t)if(H.diffValue(t[n],e))return n;return null}};let Xh=(e,t)=>t.length===e.length&&!e.some(e=>t.some(t=>!Zf.equals(t,e))),Zh=(e,t)=>t.length===e.length&&e.every((e,n)=>{let r=t[n];return r.unitId===e.unitId&&r.sheetId===e.sheetId&&Zf.equals(e.range,r.range)}),Qh={t:0,b:2,l:2,r:2},$h=e=>({sbr:.6,sbo:e,spr:.6,spo:e});function eg(e,t,n={}){let r=e.length,{textRotation:i,paddingData:a,horizontalAlign:o=0,verticalAlign:s=0,wrapStrategy:c=0,cellValueType:l}=n,{t:u,r:d,b:f,l:p}=a||Qh,{vertexAngle:m,centerAngle:h}=cg(i);return new Pm({id:`d`,body:{dataStream:`${e}\r
|
|
8
|
+
`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:1/0,height:1/0},marginTop:u,marginBottom:f,marginRight:d,marginLeft:p,renderConfig:{horizontalAlign:o,verticalAlign:s,centerAngle:h,vertexAngle:m,wrapStrategy:c,cellValueType:l}},drawings:{},drawingsOrder:[]})}function tg(e){if(!e)return{};let{tr:t,td:n,ht:r,vt:i,tb:a,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:i,wrapStrategy:a,paddingData:o}}function ng(e){if(!e)return{};let{ff:t,fs:n,it:r,bl:i,ul:a,st:o,ol:s,cl:c}=e,l={};return t&&(l.ff=t),n&&(l.fs=n),r&&(l.it=r),i&&(l.bl=i),a&&(l.ul=a),o&&(l.st=o),s&&(l.ol=s),c&&(l.cl=c),l}function rg(e,t,n){var r;let i=e.getBody();if((r=i.customRanges)!=null&&r.some(e=>e.rangeType===0))return;let a=$.customRange.add({ranges:[{startOffset:0,endOffset:i.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:0,body:i,properties:{url:t,refId:n}});a&&Q.apply(i,a.serialize())}function ig(e){return e!=null}function ag(){return{p:null,s:null,v:null,t:null,f:null,si:null,ref:null,xf:null}}function og(e){let t=Z.ff,n=Z.fs;if(!e){let e=`${n}pt ${t}`;return{fontCache:e,fontString:e,fontSize:n,originFontSize:n,fontFamily:t}}let r=`italic`;(e.it===0||e.it===void 0)&&(r=`normal`);let i=`bold`;(e.bl===0||e.bl===void 0)&&(i=`normal`);let a=n;e.fs&&(a=Math.ceil(e.fs));let o=t;if(e.ff){let n=e.ff;n=n.replace(/"/g,``).replace(/'/g,``),n.indexOf(` `)>-1&&(n=`"${n}"`),n==null&&(n=t),o=n}let{va:s}=e,c=a;if(s===2||s===3){let{sbr:e,spr:t}=sg(o,c);c*=s===2?e:t}let l=`${r} ${i} ${c}pt ${o}`;return{fontCache:l,fontString:`${l}, "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif `,fontSize:c,originFontSize:a,fontFamily:o}}function sg(e,t){return $h(t)}function cg(e){let{a:t=0,v:n=0}=e||{a:0,v:0},r=0,i=t;return n===1&&(r=90,i=90),{centerAngle:r,vertexAngle:i}}function lg(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e)){let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=lg(e[r]);return n}let t={},n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r];t[i]=lg(e[i])}return t}function ug(e){if(e==null)return e;let t={};return e.p!==void 0&&(t.p=e.p===null?null:lg(e.p)),e.s!==void 0&&(e.s===null||typeof e.s==`string`?t.s=e.s:t.s=lg(e.s)),e.v!==void 0&&(t.v=e.v),e.t!==void 0&&(t.t=e.t),e.f!==void 0&&(t.f=e.f),e.ref!==void 0&&(t.ref=e.ref),e.xf!==void 0&&(t.xf=e.xf),e.si!==void 0&&(t.si=e.si),e.custom!==void 0&&(t.custom=e.custom===null?null:lg(e.custom)),t}function dg(e){if(e==null)return e;let t={};return e.p!==void 0&&(t.p=e.p===null?null:lg(e.p)),e.s!==void 0&&(e.s===null||typeof e.s==`string`?t.s=e.s:t.s=lg(e.s)),e.v!==void 0&&(t.v=e.v),e.t!==void 0&&(t.t=e.t),e.f!==void 0&&(t.f=e.f),e.ref!==void 0&&(t.ref=e.ref),e.xf!==void 0&&(t.xf=e.xf),e.si!==void 0&&(t.si=e.si),e.custom!==void 0&&(t.custom=e.custom===null?null:lg(e.custom)),e.rowSpan!==void 0&&(t.rowSpan=e.rowSpan),e.colSpan!==void 0&&(t.colSpan=e.colSpan),e.displayV!==void 0&&(t.displayV=e.displayV),t}function fg(e){let t={},n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r],a=Number(i),o=e[a];if(o===void 0)continue;let s={},c=Object.keys(o);for(let e=0,t=c.length;e<t;e++){let t=c[e],n=Number(t),r=o[n];r!=null&&(s[n]=ug(r))}t[a]=s}return t}function pg(e){let t={},n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r],a=Number(i),o=e[a];if(o===void 0)continue;let s={};`h`in o&&o.h!==void 0&&(s.h=o.h),`ia`in o&&o.ia!==void 0&&(s.ia=o.ia),`ah`in o&&o.ah!==void 0&&(s.ah=o.ah),`hd`in o&&o.hd!==void 0&&(s.hd=o.hd),`w`in o&&o.w!==void 0&&(s.w=o.w),`s`in o&&o.s!==void 0&&(o.s===null||typeof o.s==`string`?s.s=o.s:s.s=lg(o.s)),`custom`in o&&o.custom!==void 0&&(s.custom=o.custom===null?null:lg(o.custom)),t[a]=s}return t}function mg(e){let t=e.length,n=Array(t);for(let r=0;r<t;r++){let t=e[r];n[r]={startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType,startAbsoluteRefType:t.startAbsoluteRefType,endAbsoluteRefType:t.endAbsoluteRefType}}return n}function hg(e){let t={id:e.id,name:e.name,tabColor:e.tabColor,hidden:e.hidden,rowCount:e.rowCount,columnCount:e.columnCount,zoomRatio:e.zoomRatio,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,defaultColumnWidth:e.defaultColumnWidth,defaultRowHeight:e.defaultRowHeight,showGridlines:e.showGridlines,rightToLeft:e.rightToLeft,freeze:{xSplit:e.freeze.xSplit,ySplit:e.freeze.ySplit,startRow:e.freeze.startRow,startColumn:e.freeze.startColumn},rowHeader:{width:e.rowHeader.width,hidden:e.rowHeader.hidden},columnHeader:{height:e.columnHeader.height,hidden:e.columnHeader.hidden},mergeData:mg(e.mergeData),cellData:fg(e.cellData),rowData:pg(e.rowData),columnData:pg(e.columnData)};return e.gridlinesColor!==void 0&&(t.gridlinesColor=e.gridlinesColor),e.defaultStyle!==void 0&&(e.defaultStyle===null||typeof e.defaultStyle==`string`?t.defaultStyle=e.defaultStyle:t.defaultStyle=lg(e.defaultStyle)),e.custom!==void 0&&(t.custom=e.custom===null?null:lg(e.custom)),t}var gg=class{constructor(e,t){this._config=e,R(this,`_columnData`,{}),this._columnData=t}getColumnData(){return this._columnData}getColVisible(e){let{_columnData:t}=this,n=t[e];return n?n.hd!==1:!0}getColumnStyle(e){var t;return(t=this._columnData[e])==null?void 0:t.s}setColumnStyle(e,t){let n=this.getColumnOrCreate(e);n.s=t}getHiddenCols(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getColVisible(a);r&&e?(r=!1,n.push({rangeType:2,startColumn:i,endColumn:a-1,startRow:0,endRow:0})):!r&&!e&&(r=!0,i=a)}return r&&n.push({startRow:0,endRow:0,startColumn:i,endColumn:t,rangeType:2}),n}getVisibleCols(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getColVisible(a);r&&!e?(r=!1,n.push({rangeType:2,startColumn:i,endColumn:a-1,startRow:0,endRow:0})):!r&&e&&(r=!0,i=a)}return r&&n.push({startRow:0,endRow:0,startColumn:i,endColumn:t,rangeType:2}),n}getColumnDatas(e,t){let n={},r=0;for(let i=e;i<e+t;i++){let e=this.getColumn(i);n[r]=e==null?{w:this._config.defaultColumnWidth,hd:0}:e,r++}return n}getSize(){return Lu(this._columnData)}getColumnWidth(e){var t,n;return(t=(n=this._columnData[e])==null?void 0:n.w)==null?this._config.defaultColumnWidth:t}setColumnWidth(e,t){let n=this._columnData[e];t===this._config.defaultColumnWidth?n&&(delete n.w,Object.keys(n).length===0&&delete this._columnData[e]):this._columnData[e]=n?{...n,w:t}:{w:t}}getColumn(e){return this._columnData[e]}insertColumnsWithData(e,t,n){let r=t-e+1,i=Object.keys(this._columnData);for(let t=i.length-1;t>=0;t--){let n=Number(i[t]);n>=e&&(this._columnData[n+r]=this._columnData[n],delete this._columnData[n])}for(let r=e;r<=t;r++){let t=n==null?void 0:n[r-e];t!=null&&Object.keys(t).length>0&&(this._columnData[r]={...t})}}removeColumn(e){delete this._columnData[e]}getColumnOrCreate(e){let{_columnData:t}=this,n=t[e];if(n)return n;let r={};return this._columnData[e]=r,r}setCustomMetadata(e,t){let n=this.getColumn(e);n&&(n.custom=t)}getCustomMetadata(e){var t;return(t=this.getColumn(e))==null?void 0:t.custom}},_g=class{constructor(e,t,n){this._config=e,this._viewModel=t,R(this,`_rowData`,void 0),this._rowData=n}getRowData(){return this._rowData}getRowStyle(e){var t;return(t=this._rowData[e])==null?void 0:t.s}setRowStyle(e,t){let n=this.getRowOrCreate(e);n.s=t}getRowDatas(e,t){let n={},r=0;for(let i=e;i<e+t;i++){let e=this.getRow(i);n[r]=e==null?{h:this._config.defaultRowHeight,hd:0}:e,r++}return n}getRowHeight(e,t=1){let{_rowData:n}=this,r=this._config,i=0;for(let a=0;a<t;a++){let{ia:t,ah:o,h:s=r.defaultRowHeight}=n[a+e]||{hd:0,h:r.defaultRowHeight};i+=(t==null||t===1)&&typeof o==`number`?o:s}return i}setRowHeight(e,t){let n=this._rowData[e];if(t===this._config.defaultRowHeight)n&&(delete n.h,Object.keys(n).length===0&&delete this._rowData[e]);else{let r=Math.min(t,2e3);this._rowData[e]=n?{...n,h:r}:{h:r}}}getRow(e){return this._rowData[e]}insertRowsWithData(e,t,n){let r=t-e+1,i=Object.keys(this._rowData);for(let t=i.length-1;t>=0;t--){let n=Number(i[t]);n>=e&&(this._rowData[n+r]=this._rowData[n],delete this._rowData[n])}for(let r=e;r<=t;r++){let t=n==null?void 0:n[r-e];t!=null&&Object.keys(t).length>0&&(this._rowData[r]={...t})}}removeRow(e){delete this._rowData[e]}getRowOrCreate(e){let{_rowData:t}=this,n=t[e];if(n)return n;let r={};return t[e]=r,r}getHiddenRows(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getRowRawVisible(a);r&&e?(r=!1,n.push({startRow:i,endRow:a-1,startColumn:0,endColumn:0,rangeType:1})):!r&&!e&&(r=!0,i=a)}return r&&n.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:1}),n}getVisibleRows(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getRowRawVisible(a);r&&!e?(r=!1,n.push({startRow:i,endRow:a-1,startColumn:0,endColumn:0,rangeType:1})):!r&&e&&(r=!0,i=a)}return r&&n.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:1}),n}getRowRawVisible(e){let t=this.getRow(e);return t?t.hd!==1:!0}getSize(){return Lu(this._rowData)}setCustomMetadata(e,t){let n=this.getRow(e);n&&(n.custom=t)}getCustomMetadata(e){var t;return(t=this.getRow(e))==null?void 0:t.custom}};let vg=1e3;function yg(e){let t={name:`Sheet1`,id:`sheet-01`,tabColor:``,hidden:0,rowCount:vg,columnCount:20,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:88,defaultRowHeight:24,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:1,rowHeader:{width:46,hidden:0},columnHeader:{height:20,hidden:0},rightToLeft:0};return Object.keys(t).forEach(n=>{let r=n;e[r]===void 0&&(e[r]=t[r])}),e}var bg=class extends V{constructor(e){super(),R(this,`_cellCache`,new Map),R(this,`_rowCache`,new Map),R(this,`_columnCache`,new Map),R(this,`_hasRow`,!1),R(this,`_hasColumn`,!1),R(this,`_hasAll`,!1),R(this,`_allIndex`,-1),R(this,`_mergeData`,void 0),R(this,`_rangeMap`,new of(5e4)),this._init(e.concat())}_init(e){this._mergeData=e,this._createCache(e)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(e){let t=0;for(let n of e){let{rangeType:e}=n;e===1?this._createRowCache(n,t):e===2?this._createColumnCache(n,t):e===3?this._createCellAllCache(t):this._createCellCache(n,t),t++}}rebuild(e){this._clearCache(),this._init(e.concat())}_createRowCache(e,t){let{startRow:n,endRow:r}=e;for(let e=n;e<=r;e++)this._rowCache.set(e,t),this._hasRow=!0}_createColumnCache(e,t){let{startColumn:n,endColumn:r}=e;for(let e=n;e<=r;e++)this._columnCache.set(e,t),this._hasColumn=!0}_createCellAllCache(e){this._hasAll=!0,this._allIndex=e}_createCellCache(e,t){for(let n=e.startRow;n<=e.endRow;n++){let r=this._cellCache.get(n);r==null&&(r=new Map,this._cellCache.set(n,r));for(let n=e.startColumn;n<=e.endColumn;n++)r.set(n,t)}}add(e){this._mergeData.push(e),this._clearCache(),this._createCache(this._mergeData)}remove(e,t){let n=this._getMergeDataIndex(e,t);n!==-1&&(this._mergeData.splice(n,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(e,t){let n=this._getMergeDataIndex(e,t);return n===-1?null:this._mergeData[n]}getMergeDataIndex(e,t){return this._getMergeDataIndex(e,t)}isRowContainsMergedCell(e){return this._hasAll||!H.isEmptyObject(this._columnCache)?!0:this._mergeData.some(t=>t.startRow<=e&&e<=t.endRow)}isColumnContainsMergedCell(e){return this._hasAll||!H.isEmptyObject(this._rowCache)?!0:this._mergeData.some(t=>t.startColumn<=e&&e<=t.endColumn)}getMergedCellRange(e,t,n,r){let i=[],a=`${e}-${t}-${n}-${r}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let o=0,s=[];for(let a of this._mergeData||[])Zf.intersects(a,{startRow:e,endRow:n,startColumn:t,endColumn:r})&&(i.push({...a}),s.push(o)),o++;return this._rangeMap.set(a,s),i}_getRangeFromCache(e){let t=this._rangeMap.get(e)||[],n=[];for(let e of t)n.push({...this._mergeData[e]});return n}_getMergeDataIndex(e,t){var n;if(this._hasAll)return this._allIndex;if(this._hasRow){let t=this._rowCache.get(e);if(t!==void 0)return t}if(this._hasColumn){let e=this._columnCache.get(t);if(e!==void 0)return e}let r=(n=this._cellCache.get(e))==null?void 0:n.get(t);return r===void 0?-1:r}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}},xg=class extends V{constructor(e){super(),this.getRawCell=e,R(this,`_cellContentInterceptor`,null),R(this,`_rowFilteredInterceptor`,null)}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(e,t,n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(e,t,3,n,r):this.getRawCell(e,t)}getCellValueOnly(e,t){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(e,t,2):this.getRawCell(e,t)}getCellStyleOnly(e,t){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(e,t,1):this.getRawCell(e,t)}getRowFiltered(e){var t,n;return(t=(n=this._rowFilteredInterceptor)==null?void 0:n.getRowFiltered(e))==null?!1:t}registerCellContentInterceptor(e){if(this._cellContentInterceptor)throw Error(`[SheetViewModel]: Interceptor already registered.`);return this._cellContentInterceptor=e,B(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(e){if(this._rowFilteredInterceptor)throw Error(`[SheetViewModel]: Interceptor already registered.`);return this._rowFilteredInterceptor=e,B(()=>this._rowFilteredInterceptor=null)}};let Sg={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};var Cg=class e{constructor(e,t,n){var r;this.unitId=e,this._styles=n,R(this,`_sheetId`,void 0),R(this,`_snapshot`,void 0),R(this,`_cellData`,void 0),R(this,`_rowManager`,void 0),R(this,`_columnManager`,void 0),R(this,`_viewModel`,void 0),R(this,`_spanModel`,void 0),R(this,`_isRowStylePrecedeColumnStyle`,!0),R(this,`_getCellHeight`,void 0),this._snapshot=yg(t);let{columnData:i,rowData:a,cellData:o}=this._snapshot;this._sheetId=(r=this._snapshot.id)==null?U(6):r,this._cellData=new Ku(o),this._viewModel=new xg((e,t)=>this.getCellRaw(e,t)),this._rowManager=new _g(this._snapshot,this._viewModel,a),this._columnManager=new gg(this._snapshot,i),this._spanModel=new bg(this._snapshot.mergeData)}__interceptViewModel(e){e(this._viewModel)}__registerGetCellHeight(e){return this._getCellHeight=e,B(()=>{this._getCellHeight=null})}getSnapshot(){return this._snapshot}getCellHeight(e,t){return this._getCellHeight?this._getCellHeight(e,t):this.getRowHeight(e)}setMergeData(e){this._snapshot.mergeData=e,this.getSpanModel().rebuild(e)}getSpanModel(){return this._spanModel}setIsRowStylePrecedeColumnStyle(e){this._isRowStylePrecedeColumnStyle=e}getStyleDataByHash(e){return{...this._styles.get(e)}}setStyleData(e){return this._styles.setValue(e)}getColumnStyle(e,t=!1){return t?this._columnManager.getColumnStyle(e):this._styles.get(this._columnManager.getColumnStyle(e))}setColumnStyle(e,t){this._columnManager.setColumnStyle(e,t)}getRowStyle(e,t=!1){return t?this._rowManager.getRowStyle(e):this._styles.get(this._rowManager.getRowStyle(e))}setRowStyle(e,t){this._rowManager.setRowStyle(e,t)}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){let e=this._snapshot.defaultStyle;return this._styles.get(e)}setDefaultCellStyle(e){this._snapshot.defaultStyle=e}getCellStyle(e,t){let n=this.getCell(e,t);if(n){let e=n.s;return typeof e==`string`?this._styles.get(e):e}return null}getComposedCellStyle(e,t,n){let r=this.getDefaultCellStyleInternal(),i=this.getRowStyle(e),a=this.getColumnStyle(t),o=this.getCell(e,t),s=this._styles.getStyleByCell(o);return(n==null?this._isRowStylePrecedeColumnStyle:n)?ga(r,a,i,o==null?void 0:o.themeStyle,s):ga(r,i,a,o==null?void 0:o.themeStyle,s)}getComposedCellStyleByCellData(e,t,n,r){let i=this.getDefaultCellStyleInternal(),a=this.getRowStyle(e),o=this.getColumnStyle(t),s=this._styles.getStyleByCell(n);return(r==null?this._isRowStylePrecedeColumnStyle:r)?ga(i,o,a,n==null?void 0:n.themeStyle,s):ga(i,a,o,n==null?void 0:n.themeStyle,s)}getComposedCellStyleWithoutSelf(e,t,n,r){let i=n===void 0?this.getComposedCellStyle(e,t,r):this.getComposedCellStyleByCellData(e,t,n,r),a=this.getCellRaw(e,t);if(!a||!a.s)return i;let o=typeof a.s==`string`?this._styles.get(a.s):a.s;if(!o)return i;for(let e in o)e in i&&delete i[e];return i}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){let e=this.getCellMatrix(),t=this.getMergeData(),n=-1,r=-1,i=-1,a=-1,o=!1,s=!1;return e.forEach((t,c)=>{Object.keys(c).forEach(c=>{let l=+c,u=e.getValue(t,l),d=u!=null&&u.s?this._styles.get(u.s):null,f=(d==null?void 0:d.bd)&&(d.bd.b||d.bd.l||d.bd.r||d.bd.t||d.bd.bc_tr||d.bd.bl_tr||d.bd.ml_tr||d.bd.tl_bc||d.bd.tl_br||d.bd.tl_mr);(u&&(u.v!==null&&u.v!==void 0&&u.v!==``||u.p)||d!=null&&d.bg||f)&&(o?n=Math.min(n,t):(n=t,o=!0),r=Math.max(r,t),s?i=Math.min(i,l):(s=!0,i=l),a=Math.max(a,l))})}),t.forEach(e=>{o?n=Math.min(n,e.startRow):(n=e.startRow,o=!0),r=Math.max(r,e.endRow),s?i=Math.min(i,e.startColumn):(i=e.startColumn,o=!0),a=Math.max(a,e.endColumn)}),!o||!s?null:{startColumn:i,startRow:n,endColumn:a,endRow:r}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){let{_snapshot:t}=this,n=hg(t);return new e(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(e,t){return this._spanModel.getMergedCell(e,t)}getMergedCellRange(e,t,n,r){return this._spanModel.getMergedCellRange(e,t,n,r)}isRowContainsMergedCell(e){return this._spanModel.isRowContainsMergedCell(e)}isColumnContainsMergedCell(e){return this._spanModel.isColumnContainsMergedCell(e)}getCellInfoInMergeData(e,t){let n=this.getMergedCell(e,t),r=!1,i=!1,a=e,o=t,s=e,c=t;if(n){let{startRow:l,endRow:u,startColumn:d,endColumn:f}=n;e===l&&t===d?(a=u,o=f,s=l,c=d,i=!0):e>=l&&e<=u&&t>=d&&t<=f&&(a=u,o=f,s=l,c=d,r=!0)}return{actualRow:e,actualColumn:t,isMergedMainCell:i,isMerged:r,endRow:a,endColumn:o,startRow:s,startColumn:c}}getCell(e,t){return e<0||t<0?null:this._viewModel.getCell(e,t)}getCellValueOnly(e,t){return e<0||t<0?null:this._viewModel.getCellValueOnly(e,t)}getCellStyleOnly(e,t){return e<0||t<0?null:this._viewModel.getCellStyleOnly(e,t)}getCellRaw(e,t){return this.getCellMatrix().getValue(e,t)}getCellWithFilteredInterceptors(e,t,n,r){return this._viewModel.getCell(e,t,n,r)}getRowFiltered(e){return this._viewModel.getRowFiltered(e)}getRangeFilterRows(e){let t=[];for(let n=e.startRow;n<=e.endRow;n++)this.getRowFiltered(n)&&t.push(n);return t}getMatrixWithMergedCells(e,t,n,r,i=`raw`){let a=this.getCellMatrix(),o=this._spanModel.getMergedCellRange(e,t,n,r),s=new Ku;return rp(e,n,t,r).forEach((e,t)=>{let n;if(i===`raw`)n=this.getCellRaw(e,t);else if(i===`intercepted`)n=this.getCell(e,t);else if(i===`both`){let i=this.getCellRaw(e,t);if(i){var r;n={...i};let a=(r=this.getCell(e,t))==null?void 0:r.v;ig(a)&&n&&(n.displayV=String(a))}}n&&s.setValue(e,t,n)}),o.forEach(e=>{let{startColumn:t,startRow:n,endColumn:r,endRow:i}=e;rp(n,i,t,r).forEach((e,o)=>{e===n&&o===t&&s.setValue(e,o,{...a.getValue(e,o),rowSpan:i-n+1,colSpan:r-t+1}),(e!==n||o!==t)&&s.realDeleteValue(e,o)})}),s}getRange(e,t,n,r){return typeof e==`object`?new xf(this,e,{getStyles:()=>this._styles}):new xf(this,{startRow:e,startColumn:t,endColumn:r||t,endRow:n||e},{getStyles:()=>this._styles})}getScrollLeftTopFromSnapshot(){return{scrollLeft:this._snapshot.scrollLeft,scrollTop:this._snapshot.scrollTop}}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){let{_snapshot:e}=this,{columnCount:t}=e;return t}getMaxRows(){let{_snapshot:e}=this,{rowCount:t}=e;return t}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(){let{_snapshot:e}=this,{showGridlines:t}=e;return t===0}getGridlinesColor(){return this.getConfig().gridlinesColor}getTabColor(){let{_snapshot:e}=this,{tabColor:t}=e;return t}getColumnWidth(e){return this.getColumnManager().getColumnWidth(e)}getRowHeight(e){return this._viewModel.getRowFiltered(e)?0:this.getRowManager().getRowHeight(e)}isRowFiltered(e){return this._viewModel.getRowFiltered(e)}getRowVisible(e){return!this.isRowFiltered(e)&&this.getRowRawVisible(e)}getRowRawVisible(e){return this.getRowManager().getRowRawVisible(e)}getHiddenRows(e,t){let n=this.getMaxColumns()-1,r=this._rowManager.getHiddenRows(e,t);return r.forEach(e=>e.endColumn=n),r}getColVisible(e){return this._columnManager.getColVisible(e)}getHiddenCols(e,t){let n=this.getMaxRows()-1,r=this._columnManager.getHiddenCols(e,t);return r.forEach(e=>e.endRow=n),r}getVisibleRows(){let e=this.getRowCount();return this._rowManager.getVisibleRows(0,e-1)}getVisibleCols(){let e=this.getColumnCount();return this._columnManager.getVisibleCols(0,e-1)}isRightToLeft(){let{_snapshot:e}=this,{rightToLeft:t}=e;return t}getLastRowWithContent(){return this._cellData.getRealRowRange().endRow}getLastColumnWithContent(){return this.getDataRealRange().endColumn}getDataRealRange(){return this._cellData.getRealRange()}getDataRangeScope(){return this._cellData.getStartEndScope()}cellHasValue(e){return e&&(e.v!==void 0||e.f!==void 0||e.p!==void 0)}iterateByRow(e,t=!0){let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e,o=this;return{[Symbol.iterator]:()=>{let e=n,s=r;return{next(){for(;;){if(s>a&&(e+=1,s=r),e>i)return{done:!0,value:void 0};let n=o.getCell(e,s),c=!n,l=o.getMergedCell(e,s);if(l){if(e!==l.startRow||s!==l.startColumn){s=l.endColumn+1;continue}if(c&&t){s=l.endColumn+1;continue}let r={row:e,col:s,value:n};return r.colSpan=l.endColumn-l.startColumn+1,r.rowSpan=l.endRow-l.startRow+1,s=l.endColumn+1,{done:!1,value:r}}if(c&&t)s+=1;else{let t={row:e,col:s,value:n};return s+=1,{done:!1,value:t}}}}}}}}iterateByColumn(e,t=!0,n=!0){let{startRow:r,startColumn:i,endRow:a,endColumn:o}=e,s=this;return{[Symbol.iterator]:()=>{let e=r,c=i;return{next(){for(;;){if(e>a&&(c+=1,e=r),c>o)return{done:!0,value:void 0};let i=s.getMergedCell(e,c);if(i){let r=e!==i.startRow,a=r||c!==i.startColumn;if(n&&a||!n&&r){e=i.endRow+1;continue}let o=s.getCell(i.startRow,i.startColumn);if(!o&&t){e=i.endRow+1;continue}let l={row:e,col:i.startColumn,value:o};return l.colSpan=i.endColumn-i.startColumn+1,l.rowSpan=i.endRow-i.startRow+1,e=i.endRow+1,{done:!1,value:l}}let l=s.getCell(e,c);if(!l&&t)e+=1;else{let t={row:e,col:c,value:l};return e+=1,{done:!1,value:t}}}}}}}}getCellDocumentModel(e,t,n=Sg){var r;if(!e)return;let{isDeepClone:i,displayRawFormula:a,ignoreTextRotation:o}={...Sg,...n},s,c=`document`,l=tg(t),u=o?Z.tr:l.textRotation||Z.tr,d=l.horizontalAlign||Z.ht,f=l.verticalAlign||Z.vt,p=l.wrapStrategy||Z.tb,m=l.paddingData||Qh;if(e.f&&a)s=eg(e.f.toString(),{},{verticalAlign:f}),d=Z.ht;else if(e.p){let{centerAngle:t,vertexAngle:n}=cg(u);s=this._updateConfigAndGetDocumentModel(i?H.deepClone(e.p):e.p,d,m,{horizontalAlign:d,verticalAlign:f,centerAngle:t,vertexAngle:n,wrapStrategy:p,zeroWidthParagraphBreak:1})}else if(e.v!=null){let n=ng(t);c=og(n).fontCache;let r=wg(e);e.t===4&&a&&(r=`'${r}`),s=eg(r,n,{...l,textRotation:u,cellValueType:e.t})}return s&&e.linkUrl&&e.linkId&&rg(s,e.linkUrl,e.linkId),{documentModel:s,fontString:c,textRotation:u,wrapStrategy:p,verticalAlign:f,horizontalAlign:d,paddingData:m,fill:t==null||(r=t.bg)==null?void 0:r.rgb}}_updateConfigAndGetDocumentModel(e,t,n,r){var i,a,o,s,c;if(!r||!((i=e.body)!=null&&i.dataStream))return;e.documentStyle||(e.documentStyle={}),e.documentStyle.marginTop=(a=n.t)==null?0:a,e.documentStyle.marginBottom=(o=n.b)==null?2:o,e.documentStyle.marginLeft=(s=n.l)==null?2:s,e.documentStyle.marginRight=(c=n.r)==null?2:c,e.documentStyle.pageSize={width:1/0,height:1/0},e.documentStyle.renderConfig={...e.documentStyle.renderConfig,...r};let l=e.body.paragraphs||[];for(let e of l)e.paragraphStyle||(e.paragraphStyle={}),e.paragraphStyle.horizontalAlign=t;return new Pm(e)}getBlankCellDocumentModel(e,t,n){let r=this.getComposedCellStyleByCellData(t,n,e),i=ng(r),a=this.getCellDocumentModel(e,r,{ignoreTextRotation:!0});if(a!=null)return a.documentModel==null&&(a.documentModel=eg(``,i)),a;let o=`document`,s=Z.tr,c=Z.ht,l=Z.vt,u=Z.tb,d=Qh;return o=og({}).fontCache,{documentModel:eg(``,i),fontString:o,textRotation:s,wrapStrategy:u,verticalAlign:l,horizontalAlign:c,paddingData:d}}getCellDocumentModelWithFormula(e,t,n){let r=this.getComposedCellStyleByCellData(t,n,e);return this.getCellDocumentModel(e,r,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(e){this._snapshot.custom=e}};function wg(e){var t;if(!e)return``;let n=(t=e.p)==null||(t=t.body)==null?void 0:t.dataStream;if(n)return $.transform.getPlainText(n);let r=e.v;return typeof r==`string`?e.t===3?r.toUpperCase():r.replace(/[\r\n]/g,``):typeof r==`number`?e.t===3?r?`TRUE`:`FALSE`:r.toString():typeof r==`boolean`?r?`TRUE`:`FALSE`:``}function Tg(e){var t;if(!e)return``;let n=(t=e.p)==null||(t=t.body)==null?void 0:t.dataStream;if(n)return $.transform.getPlainText(n);let r=e.v;if(r==null)return``;if(e.t===3){if(typeof r==`string`)return r.toUpperCase();if(typeof r==`number`)return r?`TRUE`:`FALSE`}return typeof r==`boolean`?r?`TRUE`:`FALSE`:String(r)}function Eg(e){if(e===null)return``;if(e!=null&&e.p){let t=e==null?void 0:e.p.body;if(t==null)return``;let n=t.dataStream;return $.transform.getPlainText(n)}return e==null?void 0:e.v}function Dg(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}let Og=class extends ta{get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(e){return typeof e==`string`||`startRow`in e||`row`in e}constructor(e={},t){super(),this._logService=t,R(this,`type`,n.UniverType.UNIVER_SHEET),R(this,`_sheetCreated$`,new r.Subject),R(this,`sheetCreated$`,this._sheetCreated$.asObservable()),R(this,`_sheetDisposed$`,new r.Subject),R(this,`sheetDisposed$`,this._sheetDisposed$.asObservable()),R(this,`_activeSheet$`,new r.BehaviorSubject(null)),R(this,`activeSheet$`,this._activeSheet$.asObservable()),R(this,`_worksheets`,void 0),R(this,`_styles`,void 0),R(this,`_snapshot`,void 0),R(this,`_unitId`,void 0),R(this,`_count`,void 0),R(this,`_name$`,void 0),R(this,`name$`,void 0);let i=Jh();H.isEmptyObject(e)?this._snapshot=i:this._snapshot=H.commonExtend(i,e);let{styles:a}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=U(6)),this._unitId=this._snapshot.id,this._styles=new Yh(a),this._count=1,this._worksheets=new Map,this._name$=new r.BehaviorSubject(e.name||``),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete(),Array.from(this._worksheets.keys()).forEach(e=>{this._removeSheet(e)})}save(){return H.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(e){this._name$.next(e),this._snapshot.name=e}getUnitId(){return this._unitId}getRev(){var e;return(e=this._snapshot.rev)==null?1:e}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(e){this._snapshot.rev=e}addWorksheet(e,t,n){let{sheets:r,sheetOrder:i}=this._snapshot;if(r[e])return!1;r[e]=n,i.splice(t,0,e),this.ensureSheetOrderUnique();let a=new Cg(this._unitId,n,this._styles);return this._worksheets.set(e,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}ensureSheetOrderUnique(){let e=new Set,t=[];for(let n of this._snapshot.sheetOrder)e.has(n)||(e.add(n),t.push(n));this._snapshot.sheetOrder=t,e.clear()}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}addStyles(e){Object.entries(e).forEach(([e,t])=>{this._styles.addCustomStyle(e,t)})}removeStyles(e){e.forEach(e=>{this._styles.remove(e)})}getConfig(){return this._snapshot}getIndexBySheetId(e){let{sheetOrder:t}=this._snapshot;return t.findIndex(t=>t===e)}getActiveSheet(e){if(!this._activeSheet&&e===void 0)throw Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){let e=this._activeSheet;if(e)return e;let t=this._snapshot.sheetOrder;for(let e=0,n=t.length;e<n;e++){let n=this._worksheets.get(t[e]);if(n&&n.isSheetHidden()!==1)return this.setActiveSheet(n),n}let n=this._worksheets.get(t[0]);return this.setActiveSheet(n),n}setActiveSheet(e){this._activeSheet$.next(e)}_removeSheet(e){let t=this._worksheets.get(e);return t?(this._worksheets.delete(e),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(e),1),this.ensureSheetOrderUnique(),this._sheetDisposed$.next(t),!0):!1}removeSheet(e){let t=this._removeSheet(e);return t&&delete this._snapshot.sheets[e],t}getActiveSheetIndex(){let{sheetOrder:e}=this._snapshot;return e.findIndex(e=>this._worksheets.get(e)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){let{sheetOrder:e}=this._snapshot;return e.map(e=>this._worksheets.get(e))}getSheetsName(){let{sheetOrder:e}=this._snapshot,t=[];return e.forEach(e=>{let n=this._worksheets.get(e);n&&t.push(n.getName())}),t}getSheetIndex(e){let{sheetOrder:t}=this._snapshot;return t.findIndex(t=>e.getSheetId()===t)}getSheetBySheetName(e){let{sheetOrder:t}=this._snapshot,n=t.find(t=>this._worksheets.get(t).getName()===e);return this._worksheets.get(n)}getSheetBySheetId(e){return this._worksheets.get(e)}getSheetByIndex(e){let{sheetOrder:t}=this._snapshot;return this._worksheets.get(t[e])}getHiddenWorksheets(){return this.getSheets().filter(e=>e.getConfig().hidden===1).map(e=>e.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(e=>e.getConfig().hidden!==1).map(e=>e.getConfig().id)}load(e){this._snapshot=e}checkSheetName(e){return this.getSheetsName().some(t=>t.toLowerCase()===e.toLowerCase())}uniqueSheetName(e=`Sheet1`){let t=e;for(;this.checkSheetName(t);)t=e+this._count,this._count++;return t}generateNewSheetName(e){let t=e+this._count;for(;this.checkSheetName(t);)t=e+this._count,this._count++;return t}_parseWorksheetSnapshots(){let{_snapshot:e,_worksheets:t}=this,{sheets:n,sheetOrder:r}=e;if(H.isEmptyObject(n)){let e=U();n[e]={id:e}}for(let e in n){let i=n[e],{name:a}=i;i.name=this.uniqueSheetName(a),i.name!==a&&this._logService.debug(`[Workbook]`,`The worksheet name ${a} is duplicated, we changed it to ${i.name}. Please fix the problem in your snapshot.`);let o=new Cg(this._unitId,i,this._styles);t.set(e,o),r.includes(e)||r.push(e)}this.ensureSheetOrderUnique(),this.ensureActiveSheet()}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(e){this._snapshot.custom=e}};Og=ss([W(1,is)],Og);let kg=(0,t.createIdentifier)(`univer.current`),Ag=class extends V{constructor(e,t,n){super(),this._injector=e,this._contextService=t,this._logService=n,R(this,`_unitsByType`,new Map),R(this,`_createHandler`,void 0),R(this,`_ctorByType`,new Map),R(this,`_currentUnits`,new Map),R(this,`_currentUnits$`,new r.BehaviorSubject(this._currentUnits)),R(this,`currentUnits$`,this._currentUnits$.asObservable()),R(this,`_unitAdded$`,new r.Subject),R(this,`unitAdded$`,this._unitAdded$.asObservable()),R(this,`_unitDisposed$`,new r.Subject),R(this,`unitDisposed$`,this._unitDisposed$.asObservable()),R(this,`_focused$`,new r.BehaviorSubject(null)),R(this,`focused$`,this._focused$.asObservable())}dispose(){super.dispose(),this._focused$.complete(),this._currentUnits$.complete(),this._unitAdded$.complete(),this._currentUnits.forEach(e=>e==null?void 0:e.dispose()),this._currentUnits.clear(),this._unitsByType.clear()}__setCreateHandler(e){this._createHandler=e}createUnit(e,t,n){return this._createHandler(e,t,this._ctorByType.get(e),n)}registerCtorForType(e,t){return this._ctorByType.set(e,t),{dispose:()=>{this._ctorByType.delete(e)}}}__getCtorByType(e){return this._ctorByType.get(e)}getCurrentTypeOfUnit$(e){return this.currentUnits$.pipe((0,r.map)(t=>{var n;return(n=t.get(e))==null?null:n}),(0,r.distinctUntilChanged)())}getCurrentUnitForType(e){return this._currentUnits.get(e)}getCurrentUnitOfType(e){return this.getCurrentUnitForType(e)}setCurrentUnitForType(e){let t=this._getUnitById(e);if(!t)throw Error(`[UniverInstanceService]: no document with unitId ${e}!`);this._currentUnits.set(t[1],t[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(e){return this._unitAdded$.pipe((0,r.filter)(t=>t.unit.type===e))}__addUnit(e,t){var n;this._logService.debug(`[UniverInstanceService]: Adding unit with id ${e.getUnitId()}`);let r=e.type;this._unitsByType.has(r)||this._unitsByType.set(r,[]);let i=this._unitsByType.get(r),a=e.getUnitId();if(i.findIndex(e=>e.getUnitId()===a)!==-1)throw Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${a}.`);i.push(e),this._unitAdded$.next({unit:e,options:t}),((n=t==null?void 0:t.makeCurrent)==null||n)&&this.setCurrentUnitForType(e.getUnitId())}getTypeOfUnitDisposed$(e){return this.unitDisposed$.pipe((0,r.filter)(t=>t.type===e))}getUnit(e,t){var n;let r=(n=this._getUnitById(e))==null?void 0:n[0];return t&&(r==null?void 0:r.type)!==t?null:r}getCurrentUniverDocInstance(){return this.getCurrentUnitForType(n.UniverType.UNIVER_DOC)}getUniverDocInstance(e){return this.getUnit(e,n.UniverType.UNIVER_DOC)}getUniverSheetInstance(e){return this.getUnit(e,n.UniverType.UNIVER_SHEET)}getAllUnitsForType(e){var t;return(t=this._unitsByType.get(e))==null?[]:t}changeDoc(e,t){let r=this.getAllUnitsForType(n.UniverType.UNIVER_DOC),i=r.find(t=>t.getUnitId()===e);if(i!=null){let e=r.indexOf(i);r.splice(e,1)}this.__addUnit(t)}get focused(){var e;let t=this._focused$.getValue();return t?(e=this._getUnitById(t))==null?void 0:e[0]:null}focusUnit(e){var t;this._focused$.next(e),this.focused instanceof Og?(this._contextService.setContextValue(Fh,!0),this._contextService.setContextValue(Lh,!1),this._contextService.setContextValue(Ih,!0),this._contextService.setContextValue(Rh,!1),this.setCurrentUnitForType(e)):this.focused instanceof Pm?(this._contextService.setContextValue(Fh,!0),this._contextService.setContextValue(Lh,!0),this._contextService.setContextValue(Ih,!1),this._contextService.setContextValue(Rh,!1),this.setCurrentUnitForType(e)):((t=this.focused)==null?void 0:t.type)===n.UniverType.UNIVER_SLIDE?(this._contextService.setContextValue(Fh,!0),this._contextService.setContextValue(Lh,!1),this._contextService.setContextValue(Ih,!1),this._contextService.setContextValue(Rh,!0),this.setCurrentUnitForType(e)):(this._contextService.setContextValue(Fh,!1),this._contextService.setContextValue(Lh,!1),this._contextService.setContextValue(Ih,!1),this._contextService.setContextValue(Rh,!1))}getFocusedUnit(){return this.focused}getUnitType(e){let t=this._getUnitById(e);return t?t[1]:n.UniverType.UNRECOGNIZED}disposeUnit(e){this._logService.debug(`[UniverInstanceService]: Disposing unit with id ${e}`);let t=this._getUnitById(e);if(!t)return this._logService.debug(`[UniverInstanceService]: No unit found with id ${e}`),!1;let[n,r]=t,i=this._unitsByType.get(r),a=i.indexOf(n);return i.splice(a,1),this._tryResetCurrentOnRemoval(e,r),this._tryResetFocusOnRemoval(e),this._unitDisposed$.next(n),n.dispose(),!0}_tryResetCurrentOnRemoval(e,t){let n=this.getCurrentUnitForType(t);(n==null?void 0:n.getUnitId())===e&&(this._currentUnits.set(t,null),this._currentUnits$.next(this._currentUnits))}_tryResetFocusOnRemoval(e){var t;((t=this.focused)==null?void 0:t.getUnitId())===e&&this._focused$.next(null)}_getUnitById(e){for(let[t,n]of this._unitsByType){let r=n.find(t=>t.getUnitId()===e);if(r)return[r,t]}}};Ag=ss([W(0,(0,t.Inject)(t.Injector)),W(1,ts),W(2,(0,t.Inject)(is))],Ag);let jg=function(e){return e[e.Starting=0]=`Starting`,e[e.Ready=1]=`Ready`,e[e.Rendered=2]=`Rendered`,e[e.Steady=3]=`Steady`,e}({}),Mg={0:`Starting`,1:`Ready`,2:`Rendered`,3:`Steady`};var Ng=class extends Error{constructor(e){super(`[LifecycleService]: lifecycle stage "${Mg[e]}" will never be reached!`),this.name=`LifecycleUnreachableError`}};let Pg=class extends V{constructor(e){super(),this._logService=e,R(this,`_lifecycle$`,new r.BehaviorSubject(0)),R(this,`lifecycle$`,this._lifecycle$.asObservable()),R(this,`_lock`,!1),this._reportProgress(0)}get stage(){return this._lifecycle$.getValue()}set stage(e){if(this._lock)throw Error(`[LifecycleService]: cannot set new stage when related logic is all handled!`);if(e<this.stage)throw Error(`[LifecycleService]: lifecycle stage cannot go backward!`);e!==this.stage&&(this._lock=!0,this._reportProgress(e),this._lifecycle$.next(e),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}onStage(e){return(0,r.firstValueFrom)(this.lifecycle$.pipe((0,r.filter)(t=>t>=e),vs(t=>t===e),(0,r.map)(()=>void 0))).catch(t=>t.name===`EmptyError`?Promise.reject(new Ng(e)):Promise.reject(t))}subscribeWithPrevious(){return(0,r.merge)(Fg(this.stage),this._lifecycle$.pipe((0,r.skip)(1))).pipe(vs(e=>e===3))}_reportProgress(e){this._logService.debug(`[LifecycleService]`,`lifecycle progressed to "${Mg[e]}".`)}};Pg=ss([W(0,is)],Pg);function Fg(e){switch(e){case 0:return(0,r.of)(0);case 1:return(0,r.of)(0,1);case 2:return(0,r.of)(0,1,2);default:return(0,r.of)(0,1,2,3)}}let Ig=(0,t.createIdentifier)(`ILocalStorageService`);var Lg=class extends V{get _currentLocale(){return this._currentLocale$.value}constructor(){super(),R(this,`_currentLocale$`,new r.BehaviorSubject(`zhCN`)),R(this,`currentLocale$`,this._currentLocale$.asObservable()),R(this,`_locales`,null),R(this,`localeChanged$`,new r.Subject),R(this,`t`,(e,...t)=>{if(!this._locales)throw Error(`[LocaleService]: Locale not initialized`);let n=e.split(`.`),r=this.resolveKeyPath(this._locales[this._currentLocale],n);if(typeof r==`string`){let e=r;return t.forEach((t,n)=>{e=e.replace(`{${n}}`,t)}),e}else return e}),this.disposeWithMe(B(()=>{this._locales=null,this._currentLocale$.complete(),this.localeChanged$.complete()}))}load(e){var t;this._locales=Li((t=this._locales)==null?{}:t,e)}setLocale(e){this._currentLocale$.next(e),this.localeChanged$.next()}getLocales(){var e;return(e=this._locales)==null?void 0:e[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(e,t){let n=t.shift();if(n&&e&&n in e){let r=e[n];return t.length>0&&(typeof r==`object`||Array.isArray(r))?this.resolveKeyPath(r,t):r}return null}};let Rg=class{constructor(e){this._userManagerService=e}async list(e){return{list:[{type:0,mentions:[{objectType:0,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:`PEOPLE`}],page:e.page,size:e.size,total:1}}};Rg=ss([W(0,(0,t.Inject)(Ah))],Rg);let zg=(0,t.createIdentifier)(`univer.service.mention-io`),Bg=function(e){return e.INIT=`init`,e.FETCHING=`fetching`,e.DONE=`done`,e}({}),Vg=(0,t.createIdentifier)(`univer.permission-service`);var Hg=class extends V{constructor(...e){super(...e),R(this,`_permissionPointMap`,new Map),R(this,`_permissionPointUpdate$`,new r.Subject),R(this,`permissionPointUpdate$`,this._permissionPointUpdate$.asObservable()),R(this,`_showComponents`,!0)}setShowComponents(e){this._showComponents=e}getShowComponents(){return this._showComponents}deletePermissionPoint(e){let t=this._permissionPointMap.get(e);t&&(t.complete(),this._permissionPointMap.delete(e))}addPermissionPoint(e){let t=e instanceof r.BehaviorSubject,n=t?e.getValue():e;return n.id?this._permissionPointMap.get(n.id)?(console.warn(`${n.id} PermissionPoint already exists`),!1):(this._permissionPointMap.set(n.id,t?e:new r.BehaviorSubject(n)),this._permissionPointUpdate$.next(n),!0):!1}updatePermissionPoint(e,t){let n=this._permissionPointMap.get(e);if(!n)return;let r=n.getValue();r.value=t,r.status=`done`,n.next(r),this._permissionPointUpdate$.next(r)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(e){let t=this._permissionPointMap.get(e);if(t)return t.getValue()}getPermissionPoint$(e){let t=this._permissionPointMap.get(e);if(t)return t}composePermission$(e){return(0,r.combineLatest)(e.map(e=>{var t;let n=(t=this._permissionPointMap)==null?void 0:t.get(e);if(!n)throw Error(`[PermissionService]: ${e} permissionPoint does not exist!`);return n.asObservable()})).pipe((0,i.map)(e=>e))}composePermission(e){return e.map(e=>{var t;let n=(t=this._permissionPointMap)==null?void 0:t.get(e);if(!n)throw Error(`[PermissionService]: ${e} permissionPoint does not exist!`);return n.getValue()})}getAllPermissionPoint(){let e=new Map;return this._permissionPointMap.forEach((t,n)=>{e.set(n,t)}),e}};function Ug(e,t){if(!t)return e;let n=[];for(let r of e){let e=t.find(([e])=>e===r[0]);if(e){if(e[1]===null)continue;n.push([r[0],e[1]])}else n.push(r)}return n}let Wg=Symbol(`DependentOn`);var Gg=class extends V{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUnitType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}};R(Gg,`pluginName`,void 0),R(Gg,`packageName`,Kh),R(Gg,`version`,qh),R(Gg,`type`,n.UniverType.UNIVER_UNKNOWN);var Kg=class{constructor(){R(this,`_plugins`,[])}addPlugin(e){this._plugins.push(e)}removePlugins(){let e=this._plugins.slice();return this._plugins.length=0,e}forEachPlugin(e){this._plugins.forEach(e)}};function qg(...e){return function(t){t[Wg]=e}}let Jg=class{constructor(e,t,r){this._injector=e,this._lifecycleService=t,this._logService=r,R(this,`_pluginRegistry`,new Map),R(this,`_pluginStore`,new Kg),R(this,`_seenPlugins`,new Set),R(this,`_loadedPlugins`,new Set),R(this,`_loadedPluginTypes`,new Set([n.UniverType.UNIVER_UNKNOWN])),R(this,`_flushTimerByType`,new Map)}dispose(){this._pluginStore.removePlugins().forEach(e=>e.dispose()),this._flushTimerByType.forEach(e=>clearTimeout(e))}registerPlugin(e,t){this._assertPluginValid(e);let r={plugin:e,options:t};this._pluginRegistry.set(e.pluginName,r),this._logService.debug(`[PluginService]`,`Plugin "${e.pluginName}" registered.`);let{type:i}=e;this._loadedPluginTypes.has(i)&&(i===n.UniverType.UNIVER_UNKNOWN?this._loadFromPlugins([r]):this._flushType(i))}startPluginsForType(e){this._loadedPluginTypes.has(e)||this._loadPluginsForType(e)}_loadPluginsForType(e){let t=Array.from(this._pluginRegistry.keys()),n=[];t.forEach(t=>{let r=this._pluginRegistry.get(t);r.plugin.type===e&&n.push(r)}),this._loadFromPlugins(n),this._loadedPluginTypes.add(e)}_assertPluginValid(e){let{type:t,pluginName:r,packageName:i,version:a}=e;if(t===n.UniverType.UNRECOGNIZED)throw Error(`[PluginService]: invalid plugin type for ${e.name}. Please assign a "type" to your plugin.`);if(!r)throw Error(`[PluginService]: no plugin name for ${e.name}. Please assign a "pluginName" to your plugin.`);if(a&&a!==Gg.version)throw Error(`[PluginService]: package "${i==null?`UNKNOWN`:i}" version mismatch. Plugin version is "${a}" but @univerjs/core version is "${Gg.version}". Please make sure all @univerjs packages use the same version.`);if(this._seenPlugins.has(r))throw Error(`[PluginService]: duplicated plugin name for "${r}". Maybe a plugin that dependents on "${r} has already registered it. In that case please register "${r}" before the that plugin.`);this._seenPlugins.add(e.pluginName)}_flushType(e){this._flushTimerByType.get(e)===void 0&&this._flushTimerByType.set(e,setTimeout(()=>{this._loadPluginsForType(e),this._flushTimerByType.delete(e)},4))}_loadFromPlugins(e){let t=[],r=new Set,i=e=>{let{plugin:a}=e,{pluginName:o}=a;if(this._loadedPlugins.has(o)||r.has(o))return;r.add(o),this._pluginRegistry.delete(o);let s=a[Wg];s&&s.forEach(e=>{let t=this._pluginRegistry.get(e.pluginName);if(t)i(t);else if(!this._seenPlugins.has(e.pluginName)&&!r.has(e.pluginName)){if(a.type===n.UniverType.UNIVER_UNKNOWN&&e.type!==n.UniverType.UNIVER_UNKNOWN)throw Error(`[PluginService]: cannot register a plugin with Univer type that depends on a plugin with other type. The dependent is ${a.pluginName} and the dependency is ${e.pluginName}.`);a.type!==e.type&&e.type!==n.UniverType.UNIVER_UNKNOWN&&this._logService.debug(`[PluginService]`,`Plugin "${o}" depends on "${e.pluginName}" which has different type.`),this._logService.debug(`[PluginService]`,`Plugin "${o}" depends on "${e.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._assertPluginValid(e),i({plugin:e,options:void 0})}}),t.push(e)};e.forEach(e=>i(e));let a=t.map(e=>this._initPlugin(e.plugin,e.options));this._pluginsRunLifecycle(a)}_pluginsRunLifecycle(e){let t=this._lifecycleService.stage;if(Fg(t).subscribe(t=>this._runStage(e,t)),t!==3){let t=this._lifecycleService.lifecycle$.pipe((0,r.skip)(1)).subscribe(n=>{this._runStage(e,n),n===3&&t.unsubscribe()})}}_runStage(e,t){e.forEach(e=>{switch(t){case 0:e.onStarting();break;case 1:e.onReady();break;case 2:e.onRendered();break;case 3:e.onSteady();break}})}_initPlugin(e,t){let n=this._injector.createInstance(e,t);return this._pluginStore.addPlugin(n),this._loadedPlugins.add(e.pluginName),this._logService.debug(`[PluginService]`,`Plugin "${n.getPluginName()}" loaded.`),n}};Jg=ss([W(0,(0,t.Inject)(t.Injector)),W(1,(0,t.Inject)(Pg)),W(2,is)],Jg);let Yg=(0,t.createIdentifier)(`resource-loader-service`),Xg=class extends V{constructor(e){super(),this._logService=e,R(this,`_resourceMap`,new Map),R(this,`_register$`,new r.Subject),R(this,`register$`,this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(e,t){return t?this.getResourcesByType(e,t):this.getAllResourceHooks().map(t=>{let n=t.toJson(e);return{name:t.pluginName,data:n}})}getResourcesByType(e,t){return this.getAllResourceHooks().filter(e=>e.businesses.includes(t)).map(t=>{let n=t.toJson(e);return{name:t.pluginName,data:n}})}registerPluginResource(e){let t=e.pluginName;if(this._resourceMap.has(t))throw Error(`the pluginName is registered {${t}}`);return this._resourceMap.set(t,e),this._register$.next(e),B(()=>this._resourceMap.delete(t))}disposePluginResource(e){this._resourceMap.delete(e)}loadResources(e,t){this.getAllResourceHooks().forEach(n=>{var r;let i=t==null||(r=t.find(e=>e.name===n.pluginName))==null?void 0:r.data;if(i)try{let t=n.parseJson(i);n.onLoad(e,t)}catch(e){this._logService.error(`[ResourceManagerService]`,`loadResources error`,e)}})}unloadResources(e,t){this.getAllResourceHooks().filter(e=>e.businesses.includes(t)).forEach(t=>{t.onUnLoad(e)})}dispose(){this._register$.complete(),this._resourceMap.clear()}};Xg=ss([W(0,is)],Xg);var Zg=class extends V{get darkMode(){return this._darkMode$.getValue()}constructor(){super(),R(this,`_darkMode$`,new r.BehaviorSubject(!1)),R(this,`darkMode$`,this._darkMode$.asObservable()),R(this,`_validColorCache`,new Map),R(this,`_currentTheme`,a.defaultTheme),R(this,`_currentTheme$`,new r.BehaviorSubject(this._currentTheme)),R(this,`currentTheme$`,this._currentTheme$.asObservable()),this.disposeWithMe(B(()=>{this._currentTheme=a.defaultTheme,this._currentTheme$.complete(),this._darkMode$.complete()}))}isValidThemeColor(e){if(this._validColorCache.has(e))return this._validColorCache.get(e);let t=!1,n=e.split(`.`);if(n.length===1)t=e in a.defaultTheme;else if(n.length===2){let[e,r]=n;t=e in a.defaultTheme&&r in this._currentTheme[e]}return this._validColorCache.set(e,t),t}getCurrentTheme(){return this._currentTheme}setTheme(e){this._currentTheme=e,this._currentTheme$.next(e)}setDarkMode(e){this._darkMode$.next(e)}getColorFromTheme(e){return Qr(this._currentTheme,e)}};let Qg=(0,t.createIdentifier)(`univer.undo-redo.service`);var $g=class{dispose(){}async dispatchToHandlers(){return!1}};let e_=`univer.command.redo`,t_=`univer.command.undo`,n_=new class extends $g{constructor(...e){super(...e),R(this,`type`,0),R(this,`id`,t_)}handler(e){let t=e.get(Qg),n=t.pitchTopUndoElement();if(!n)return!1;let r=e.get(us);return hs(n.undoMutations,r).result?(t.popUndoToRedo(),!0):!1}},r_=new class extends $g{constructor(...e){super(...e),R(this,`type`,0),R(this,`id`,e_)}handler(e){let t=e.get(Qg),n=t.pitchTopRedoElement();if(!n)return!1;let r=e.get(us);return hs(n.redoMutations,r).result?(t.popRedoToUndo(),!0):!1}},i_=class extends V{constructor(e,t,n){super(),this._univerInstanceService=e,this._commandService=t,this._contextService=n,R(this,`undoRedoStatus$`,void 0),R(this,`_undoRedoStatus$`,new r.BehaviorSubject({undos:0,redos:0})),R(this,`_undoStacks`,new Map),R(this,`_redoStacks`,new Map),R(this,`_batchingStatus`,new Map),this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(n_)),this.disposeWithMe(this._commandService.registerCommand(r_)),this.disposeWithMe(B(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(B(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(e){let{unitID:t}=e,n=this._getRedoStack(t,!0),r=this._getUndoStack(t,!0);if(n.length=0,this._batchingStatus.has(e.unitID)){let t=this._batchingStatus.get(e.unitID),n=this._pitchUndoElement(e.unitID);t===0||!n?(i(e),this._batchingStatus.set(e.unitID,1)):this._tryBatchingElements(n,e)}else i(e);function i(e){r.push(e),r.length>20&&r.splice(0,1)}this._updateStatus()}clearUndoRedo(e){let t=this._getRedoStack(e);t&&(t.length=0);let n=this._getUndoStack(e);n&&(n.length=0),this._updateStatus()}pitchTopUndoElement(){let e=this._getFocusedUnitId();return this._pitchUndoElement(e)}pitchTopRedoElement(){let e=this._getFocusedUnitId();return this._pitchRedoElement(e)}_pitchUndoElement(e){let t=this._getUndoStack(e);return t!=null&&t.length?t[t.length-1]:null}_pitchRedoElement(e){let t=this._getRedoStack(e);return t!=null&&t.length?t[t.length-1]:null}popUndoToRedo(){let e=this._getUndoStackForFocused().pop();e&&(e.redoMutations.length>0&&this._getRedoStackForFocused().push(e),this._updateStatus())}popRedoToUndo(){let e=this._getRedoStackForFocused().pop();e&&(this._getUndoStackForFocused().push(e),this._updateStatus())}rollback(e,t){let n=t||this._getFocusedUnitId(),r=this._getUndoStack(n),i=r==null?void 0:r[(r==null?void 0:r.length)-1];i&&i.id===e&&(r.pop(),hs(i.undoMutations,this._commandService))}__tempBatchingUndoRedo(e){if(this._batchingStatus.has(e))throw Error(`[LocalUndoRedoService]: cannot batching undo redo twice at the same time!`);return this._batchingStatus.set(e,0),B(()=>this._batchingStatus.delete(e))}_updateStatus(){var e,t;let n=this._getFocusedUnitId(),r=n&&((e=this._undoStacks.get(n))==null?void 0:e.length)||0,i=n&&((t=this._redoStacks.get(n))==null?void 0:t.length)||0;this._undoRedoStatus$.next({undos:r,redos:i})}_getUndoStack(e,t=!1){let n=this._undoStacks.get(e);return!n&&t&&(n=[],this._undoStacks.set(e,n)),n||null}_getRedoStack(e,t=!1){let n=this._redoStacks.get(e);return!n&&t&&(n=[],this._redoStacks.set(e,n)),n||null}_getUndoStackForFocused(){let e=this._getFocusedUnitId();if(!e)throw Error(`No focused univer instance!`);return this._getUndoStack(e,!0)}_getRedoStackForFocused(){let e=this._getFocusedUnitId();if(!e)throw Error(`No focused univer instance!`);return this._getRedoStack(e,!0)}_tryBatchingElements(e,t){e.redoMutations.push(...t.redoMutations),e.undoMutations.push(...t.undoMutations)}_getFocusedUnitId(){let e=``,t=this._contextService.getContextValue(Ih),n=this._contextService.getContextValue(Bh),r=this._contextService.getContextValue(zh);if(t)if(n)e=ee;else if(r)e=N;else{var i,a;e=(i=(a=this._univerInstanceService.getFocusedUnit())==null?void 0:a.getUnitId())==null?``:i}else{var o,s;e=(o=(s=this._univerInstanceService.getFocusedUnit())==null?void 0:s.getUnitId())==null?``:o}return e}};i_=ss([W(0,kg),W(1,us),W(2,ts)],i_);var a_=class{constructor(e,t=1e3){this._injector=e,R(this,`_imageCacheMap`,void 0),this._imageCacheMap=new of(t)}_getImageCacheKey(e,t){return`${e}-${t}`}getImage(e,t,n,r){let i=this._getImageCacheKey(e,t);return this._imageCacheMap.get(i)||((async()=>{let a=new Image,o=this._injector.has(Wh)?this._injector.get(Wh):null,s=this._injector.has(Gh)?this._injector.get(Gh):null;if(e===`UUID`)try{a.src=await(o==null?void 0:o.getImage(t))||``}catch(e){console.error(e)}else if(e===`URL`)try{a.src=await(s==null?void 0:s.getImage(t))||t}catch{a.src=t}else a.src=t;a.onload=()=>{a.removeAttribute(`data-error`),n==null||n()},a.onerror=()=>{a.setAttribute(`data-error`,`true`),r==null||r()},this._imageCacheMap.set(i,a)})(),null)}};function o_(e){return!(e.length===0||e.length>31||e.startsWith(`'`)||e.endsWith(`'`)||/[:\\\/\?\*\[\]]/.test(e))}function s_(e,t){return!(!e||e.length===0||e.length>255||t.has(e)||/[ :\\\/\?\*\[\]]/.test(e)||!/^[\p{L}_]/u.test(e)||/^\$?[A-Za-z]{1,3}\$?[0-9]+$/.test(e)||/^[rR]\d+[cC]\d+$/.test(e)||/^\d+$/.test(e))}let c_=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var l_=class e{static from(t){if(!(t instanceof ArrayBuffer))throw Error(`Data must be an instance of ArrayBuffer.`);let[n,r]=new Uint8Array(t,0,2);if(n!==219)throw Error(`Data does not appear to be in a KDBush format.`);let i=r>>4;if(i!==1)throw Error(`Got v${i} data when expected v1.`);let a=c_[r&15];if(!a)throw Error(`Unrecognized array type.`);let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,o,a,t)}constructor(e,t=64,n=Float64Array,r){if(isNaN(e)||e<0)throw Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let i=c_.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return u_(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],c=[];for(;s.length;){let l=s.pop()||0,u=s.pop()||0,d=s.pop()||0;if(u-d<=o){for(let o=d;o<=u;o++){let s=a[2*o],l=a[2*o+1];s>=e&&s<=n&&l>=t&&l<=r&&c.push(i[o])}continue}let f=d+u>>1,p=a[2*f],m=a[2*f+1];p>=e&&p<=n&&m>=t&&m<=r&&c.push(i[f]),(l===0?e<=p:t<=m)&&(s.push(d),s.push(f-1),s.push(1-l)),(l===0?n>=p:r>=m)&&(s.push(f+1),s.push(u),s.push(1-l))}return c}within(e,t,n){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:r,coords:i,nodeSize:a}=this,o=[0,r.length-1,0],s=[],c=n*n;for(;o.length;){let l=o.pop()||0,u=o.pop()||0,d=o.pop()||0;if(u-d<=a){for(let n=d;n<=u;n++)m_(i[2*n],i[2*n+1],e,t)<=c&&s.push(r[n]);continue}let f=d+u>>1,p=i[2*f],m=i[2*f+1];m_(p,m,e,t)<=c&&s.push(r[f]),(l===0?e-n<=p:t-n<=m)&&(o.push(d),o.push(f-1),o.push(1-l)),(l===0?e+n>=p:t+n>=m)&&(o.push(f+1),o.push(u),o.push(1-l))}return s}};function u_(e,t,n,r,i,a){if(i-r<=n)return;let o=r+i>>1;d_(e,t,o,r,i,a),u_(e,t,n,r,o-1,1-a),u_(e,t,n,o+1,i,1-a)}function d_(e,t,n,r,i,a){for(;i>r;){if(i-r>600){let o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);d_(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}let o=t[2*n+a],s=r,c=i;for(f_(e,t,r,n),t[2*i+a]>o&&f_(e,t,r,i);s<c;){for(f_(e,t,s,c),s++,c--;t[2*s+a]<o;)s++;for(;t[2*c+a]>o;)c--}t[2*r+a]===o?f_(e,t,r,c):(c++,f_(e,t,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function f_(e,t,n,r){p_(e,n,r),p_(t,2*n,2*r),p_(t,2*n+1,2*r+1)}function p_(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function m_(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}var h_=class{constructor(e=!1){this._enableOneCellCache=e,R(this,`_tree`,new Map),R(this,`_oneCellCache`,new Map),R(this,`_kdTree`,new Map)}dispose(){this.clear()}getTree(e,t){return this._tree.has(e)||this._tree.set(e,new Map),this._tree.get(e).has(t)||this._tree.get(e).set(t,new Tf),this._tree.get(e).get(t)}_getOneCellCache(e,t,n,r){return this._oneCellCache.has(e)||this._oneCellCache.set(e,new Map),this._oneCellCache.get(e).has(t)||this._oneCellCache.get(e).set(t,new Map),this._oneCellCache.get(e).get(t).has(n)||this._oneCellCache.get(e).get(t).set(n,new Map),this._oneCellCache.get(e).get(t).get(n).has(r)||this._oneCellCache.get(e).get(t).get(n).set(r,new Set),this._oneCellCache.get(e).get(t).get(n).get(r)}_removeOneCellCache(e,t,n,r,i){let a=this._oneCellCache.get(e);if(!a)return;let o=a.get(t);if(!o)return;let s=o.get(n);if(!s)return;let c=s.get(r);c&&c.delete(i)}_removeCellCacheByRange(e){let{unitId:t,sheetId:n,range:r,id:i}=e,a=this._oneCellCache.get(t);if(!a)return;let o=a.get(n);if(!o)return;let{startRow:s,startColumn:c,endRow:l,endColumn:u}=r;for(let e=s;e<=l;e++){let t=o.get(e);if(t)for(let e=c;e<=u;e++){let n=t.get(e);n&&n.delete(i)}}}_insertOneCellCache(e,t,n,r,i){this._getOneCellCache(e,t,n,r).add(i)}_getRdTreeItems(e){let t=[];for(let[n,r]of e)for(let[e,i]of r)t.push({x:e,y:n,ids:i});return t}_searchByOneCellCache(e){var t;let{unitId:n,sheetId:r,range:i}=e,{startRow:a,startColumn:o,endRow:s,endColumn:c}=i,l=(t=this._kdTree.get(n))==null?void 0:t.get(r);if(!l)return[];let{tree:u,items:d}=l,f=u.range(o,a,c,s),p=[];for(let e of f){let t=d[e];p.push(...Array.from(t.ids))}return p}openKdTree(){for(let[t,n]of this._oneCellCache){this._kdTree.has(t)||this._kdTree.set(t,new Map);for(let[r,i]of n){var e;let n=this._getRdTreeItems(i),a=new l_(n.length);(e=this._kdTree.get(t))==null||e.set(r,{tree:a,items:n});for(let e of n)a.add(e.x,e.y);a.finish()}}}closeKdTree(){for(let[t,n]of this._oneCellCache)for(let[r,i]of n){var e;(e=this._kdTree.get(t))==null||e.set(r,void 0)}}insert(e){let{unitId:t,sheetId:n,range:r,id:i}=e;if(!t||t.length===0)return;let{startRow:a,endRow:o,startColumn:s,endColumn:c}=r;if(this._enableOneCellCache&&a===o&&s===c){this._insertOneCellCache(t,n,a,s,i);return}let l=this.getTree(t,n);Number.isNaN(a)&&(a=0),Number.isNaN(s)&&(s=0),Number.isNaN(o)&&(o=1/0),Number.isNaN(c)&&(c=1/0),l.insert({minX:s,minY:a,maxX:c,maxY:o,id:i})}bulkInsert(e){for(let t of e)this.insert(t)}*searchGenerator(e){var t;let{unitId:n,sheetId:r,range:i}=e;if(this._enableOneCellCache){let t=this._searchByOneCellCache(e);for(let e of t)yield e}let a=(t=this._tree.get(n))==null?void 0:t.get(r);if(!a)return;let o=a.search({minX:i.startColumn,minY:i.startRow,maxX:i.endColumn,maxY:i.endRow});for(let e of o)yield e.id}bulkSearch(e,t){let n=new Set;for(let r of e)for(let e of this.searchGenerator(r))(t==null?void 0:t.has(e))!==!0&&n.add(e);return n}removeById(e,t){if(t){var n,r;(n=this._tree.get(e))==null||n.delete(t),(r=this._oneCellCache.get(e))==null||r.delete(t)}else this._tree.delete(e),this._oneCellCache.delete(e)}_removeRTreeItem(e){let{unitId:t,sheetId:n,range:r,id:i}=e,a=this.getTree(t,n),o=a.search({minX:r.startColumn,minY:r.startRow,maxX:r.endColumn,maxY:r.endRow});for(let e=0;e<o.length;e++)o[e].id===i&&a.remove(o[e])}remove(e){let{unitId:t,sheetId:n,range:r,id:i}=e,{startRow:a,startColumn:o,endRow:s,endColumn:c}=r;this._enableOneCellCache?a===s&&o===c?this._removeOneCellCache(t,n,r.startRow,r.startColumn,i):(this._removeCellCacheByRange(e),this._removeRTreeItem(e)):this._removeRTreeItem(e)}bulkRemove(e){for(let t of e)this.remove(t)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){let e={};return this._tree.forEach((t,n)=>{e[n]={},t.forEach((t,r)=>{e[n][r]=t.toJSON()})}),e}fromJSON(e){this._tree.clear();for(let t in e){this._tree.set(t,new Map);for(let n in e[t]){let r=new Tf;r.fromJSON(e[t][n]),this._tree.get(t).set(n,r)}}}};function g_(e){return new Promise(t=>setTimeout(t,e))}function __(e=1){return new Promise(t=>{let n=0,r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}let v_=class extends V{constructor(e){super(),this._localeService=e,R(this,`_fontLocale`,void 0),R(this,`_dirty`,!0),this._localeInitial()}get dirty(){return this._dirty}getFontLocale(){return this._fontLocale}makeDirty(e){this._dirty=e}dispose(){super.dispose(),this._fontLocale=null}_localeInitial(){}};v_=ss([W(0,(0,t.Inject)(Lg))],v_);function y_(e={}){let t={defaultBackgroundColor:`rgba(24, 119, 242, 0.08)`,defaultStripeColor:`rgba(24, 119, 242, 0.25)`,rowGaps:{1:{size:6},3:{size:10,color:`rgba(245, 158, 11, 0.14)`},6:{size:14,color:`rgba(16, 185, 129, 0.12)`,stripeColor:`rgba(5, 150, 105, 0.35)`}},colGaps:{1:{size:5},2:{size:8,stripeColor:`rgba(59, 130, 246, 0.35)`},4:{size:12,color:`rgba(244, 63, 94, 0.12)`,stripeColor:`rgba(225, 29, 72, 0.30)`}}};return{...t,...e,rowGaps:{...t.rowGaps,...e.rowGaps},colGaps:{...t.colGaps,...e.colGaps}}}let b_=class extends v_{constructor(e,t,n,r,i,a){super(n),this.worksheet=e,this._styles=t,this._contextService=r,this._configService=i,this._injector=a,R(this,`_worksheetData`,void 0),R(this,`_renderRawFormula`,!1),R(this,`_cellData`,void 0),R(this,`_imageCacheMap`,void 0),R(this,`_skipAutoHeightForMergedCells`,!0),R(this,`_rowTotalHeight`,0),R(this,`_columnTotalWidth`,0),R(this,`_rowHeaderWidth`,0),R(this,`_columnHeaderHeight`,0),R(this,`_rowHeightAccumulation`,[]),R(this,`_columnWidthAccumulation`,[]),R(this,`_marginTop`,0),R(this,`_marginLeft`,0),R(this,`_gapConfig`,{}),R(this,`_scaleX`,1),R(this,`_scaleY`,1),R(this,`_scrollX`,0),R(this,`_scrollY`,0),this._worksheetData=this.worksheet.getConfig(),this._cellData=this.worksheet.getCellMatrix(),this._imageCacheMap=new a_(this._injector),this.initConfig()}initConfig(){var e,t;this._skipAutoHeightForMergedCells=!((e=this._configService.getConfig(te))!=null&&e),this.worksheet.setIsRowStylePrecedeColumnStyle((t=this._configService.getConfig(`isRowStylePrecedeColumnStyle`))==null?!1:t)}resetCache(){}getWorksheetConfig(){return this._worksheetData}getLocation(){return[this.worksheet.getUnitId(),this.worksheet.getSheetId()]}set columnHeaderHeight(e){this._columnHeaderHeight=e,this._worksheetData.columnHeader.height=e}set rowHeaderWidth(e){this._rowHeaderWidth=e,this._worksheetData.rowHeader.width=e}get rowHeightAccumulation(){return this._rowHeightAccumulation}get rowTotalHeight(){return this._rowTotalHeight}get columnWidthAccumulation(){return this._columnWidthAccumulation}get columnTotalWidth(){return this._columnTotalWidth}get rowHeaderWidth(){return this._rowHeaderWidth}get columnHeaderHeight(){return this._columnHeaderHeight}setMarginLeft(e){this._marginLeft=e}setMarginTop(e){this._marginTop=e}setScale(e,t){this._updateLayout(),this._scaleX=e,this._scaleY=t||e,this._updateLayout()}setScroll(e,t){H.isDefine(e)&&(this._scrollX=e),H.isDefine(t)&&(this._scrollY=t)}get scrollX(){return this._scrollX}get scrollY(){return this._scrollY}get scaleX(){return this._scaleX}get scaleY(){return this._scaleY}get rowHeaderWidthAndMarginLeft(){return this.rowHeaderWidth+this._marginLeft}get columnHeaderHeightAndMarginTop(){return this.columnHeaderHeight+this._marginTop}get imageCacheMap(){return this._imageCacheMap}get gapConfig(){return this._gapConfig}setGapConfig(e){this._gapConfig=this._fillDefaultGapThemeColors(e),this.makeDirty(!0),this._updateLayout()}_fillDefaultGapThemeColors(e){var t,n;if(e.defaultBackgroundColor&&e.defaultStripeColor)return e;let{r,g:i,b:a}=new As(this._injector.get(Zg).getColorFromTheme(`primary.500`)).toRgb();return{...e,defaultBackgroundColor:(t=e.defaultBackgroundColor)==null?`rgba(${r}, ${i}, ${a}, 0.08)`:t,defaultStripeColor:(n=e.defaultStripeColor)==null?`rgba(${r}, ${i}, ${a}, 0.25)`:n}}getRowGapSize(e){var t,n;return(t=(n=this._gapConfig.rowGaps)==null||(n=n[e])==null?void 0:n.size)==null?0:t}getColGapSize(e){var t,n;return(t=(n=this._gapConfig.colGaps)==null||(n=n[e])==null?void 0:n.size)==null?0:t}getGapSizeGetter(){if(!(!this._gapConfig.rowGaps&&!this._gapConfig.colGaps))return{row:e=>this.getRowGapSize(e),col:e=>this.getColGapSize(e)}}getRowGapAtPosition(e){let{rowGaps:t}=this._gapConfig;if(!t)return-1;for(let a of Object.keys(t)){var n,r,i;let o=Number(a),s=(n=(r=t[o])==null?void 0:r.size)==null?0:n;if(s<=0)continue;let c=(i=this._rowHeightAccumulation[o-1])==null?0:i,l=c+s;if(e>=c&&e<l)return o}return-1}getColGapAtPosition(e){let{colGaps:t}=this._gapConfig;if(!t)return-1;for(let a of Object.keys(t)){var n,r,i;let o=Number(a),s=(n=(r=t[o])==null?void 0:r.size)==null?0:n;if(s<=0)continue;let c=(i=this._columnWidthAccumulation[o-1])==null?0:i,l=c+s;if(e>=c&&e<l)return o}return-1}_generateRowMatrixCache(e,t,n){let r=0,i=[],a=t;for(let t=0;t<e;t++){var o,s;let e=n;if(this.worksheet.getRowFiltered(t))e=0;else if(a[t]!=null){let r=a[t];if(!r)continue;let{h:i=n,ah:o,ia:s}=r;e=(s==null||s===1)&&typeof o==`number`&&o>0?o:i,r.hd===1&&(e=0)}let c=(o=(s=this._gapConfig.rowGaps)==null||(s=s[t])==null?void 0:s.size)==null?0:o;r+=c,r+=e,i.push(r)}return{rowTotalHeight:r,rowHeightAccumulation:i}}_generateColumnMatrixCache(e,t,n){let r=0,i=[],a=t;for(let t=0;t<e;t++){var o,s;let e=n;if(a[t]!=null){let n=a[t];if(!n)continue;n.w!=null&&(e=n.w),n.hd===1&&(e=0)}let c=(o=(s=this._gapConfig.colGaps)==null||(s=s[t])==null?void 0:s.size)==null?0:o;r+=c,r+=e,i.push(r)}return{columnTotalWidth:r,columnWidthAccumulation:i}}intersectMergeRange(e,t){return!!this.worksheet.getMergedCell(e,t)}_getOverflowBound(e,t,n,r,i=1){let a=0;if(t>n){let o=this._columnWidthAccumulation.length-1;for(let s=t;s>=n;s--){let n=s;if(!Zu(this.worksheet.getCell(e,n))&&n!==t||this.intersectMergeRange(e,n))return n===t?n:n+1>o?o:n+1;let{startX:c,endX:l}=S_(e,n,this.rowHeightAccumulation,this.columnWidthAccumulation,void 0,this.getGapSizeGetter());if(i===2&&n===t?a+=(l-c)/2:a+=l-c,r<a)return n}return t}for(let o=t;o<=n;o++){let n=o;if(!Zu(this.worksheet.getCell(e,n))&&n!==t||this.intersectMergeRange(e,n))return n===t?n:n-1<0?0:n-1;let{startX:s,endX:c}=S_(e,n,this.rowHeightAccumulation,this.columnWidthAccumulation,void 0,this.getGapSizeGetter());if(i===2&&n===t?a+=(c-s)/2:a+=c-s,r<a)return n}return n}_updateLayout(){if(!this.dirty)return;let{rowData:e,columnData:t,defaultRowHeight:n,defaultColumnWidth:r,rowCount:i,columnCount:a,rowHeader:o,columnHeader:s}=this._worksheetData,{rowTotalHeight:c,rowHeightAccumulation:l}=this._generateRowMatrixCache(i,e,n),{columnTotalWidth:u,columnWidthAccumulation:d}=this._generateColumnMatrixCache(a,t,r);this._rowHeaderWidth=o.hidden===1?0:this._dynamicallyUpdateRowHeaderWidth(o),this._columnHeaderHeight=s.hidden===1?0:s.height,this._rowTotalHeight=c,this._rowHeightAccumulation=l,this._columnTotalWidth=u,this._columnWidthAccumulation=d,this.makeDirty(!1)}calculate(){return this.resetCache(),this._updateLayout(),this}resetRangeCache(e){}_dynamicallyUpdateRowHeaderWidth(e){let t=`${this.worksheet.getRowCount()}`.length*8;return Math.max(e.width,t)}_hasUnMergedCellInRow(e,t,n){if(!this.worksheet.getMergeData())return!1;for(let r=t;r<=n;r++){let{isMerged:t,isMergedMainCell:n}=this.worksheet.getCellInfoInMergeData(e,r);if(!t&&!n)return!0}return!1}expandRangeByMerge(e,t){let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e,o=this._worksheetData.mergeData;if(!o)return{startRow:n,startColumn:r,endRow:i,endColumn:a};let s=!0,c=new Ku,l=0,u=null;for(;s;){s=!1;for(let e=0;e<o.length;e++){let{startRow:t,startColumn:d,endRow:f,endColumn:p}=o[e];if(c.getValue(t,d))continue;let m={startColumn:r,startRow:n,endColumn:a,endRow:i},h={startColumn:d,startRow:t,endColumn:p,endRow:f};qf(m,h)&&(n=Math.min(n,t),r=Math.min(r,d),i=Math.max(i,f),a=Math.max(a,p),c.setValue(t,d,!0),s=!0,l++,u=h)}}return t&&l===1&&Zf.contains(u,e)?{startRow:u.startRow,startColumn:u.startColumn,endRow:u.startRow,endColumn:u.startColumn}:{startRow:n,startColumn:r,endRow:i,endColumn:a}}getColumnCount(){return this._columnWidthAccumulation.length}getRowCount(){return this._rowHeightAccumulation.length}_getCellMergeInfo(e,t){return this.worksheet.getCellInfoInMergeData(e,t)}getNoMergeCellWithCoordByIndex(e,t,n=!0){let{rowHeightAccumulation:r,columnWidthAccumulation:i,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:o}=this,{startY:s,endY:c,startX:l,endX:u}=S_(e,t,r,i,void 0,this.getGapSizeGetter());return n&&(s+=o,c+=o,l+=a,u+=a),{startY:s,endY:c,startX:l,endX:u}}getRowIndexByOffsetY(e,t,n,r){let{rowHeightAccumulation:i}=this;e=w_(e,t,n,this.columnHeaderHeightAndMarginTop);let a=Es(i,e,r==null?void 0:r.firstMatch);if(r!=null&&r.closeFirst){var o;Math.abs(i[a]-e)<Math.abs(e-((o=i[a-1])==null?0:o))&&(a+=1)}return a}getColumnIndexByOffsetX(e,t,n,r){let i=C_(e,t,n,this.rowHeaderWidthAndMarginLeft),{columnWidthAccumulation:a}=this,o=Es(a,i,r==null?void 0:r.firstMatch);if(r!=null&&r.closeFirst){var s;Math.abs(a[o]-i)<Math.abs(i-((s=a[o-1])==null?0:s))&&(o+=1)}return o}getCellIndexByOffset(e,t,n,r,i,a){return{row:this.getRowIndexByOffsetY(t,r,i,a),column:this.getColumnIndexByOffsetX(e,n,i,a)}}getCellByOffset(e,t,n,r,i){var a;let o=(a=this)==null?void 0:a.getCellIndexByOffset(e,t,n,r,i,{firstMatch:!0});return o?this.worksheet.getCellInfoInMergeData(o.row,o.column):null}getCellWithCoordByIndex(e,t,n=!0){var r;let{rowHeightAccumulation:i,columnWidthAccumulation:a,rowHeaderWidthAndMarginLeft:o,columnHeaderHeightAndMarginTop:s}=this,c=S_(e,t,i,a,(r=this.worksheet)==null?void 0:r.getCellInfoInMergeData(e,t),this.getGapSizeGetter()),{isMerged:l,isMergedMainCell:u}=c,{startY:d,endY:f,startX:p,endX:m,mergeInfo:h}=c,g=o,_=s;return n===!1&&(g=0,_=0),d+=_,f+=_,p+=g,m+=g,h.startY+=_,h.endY+=_,h.startX+=g,h.endX+=g,{actualRow:e,actualColumn:t,startX:p,startY:d,endX:m,endY:f,isMerged:l,isMergedMainCell:u,mergeInfo:h}}getCellWithCoordByOffset(e,t,n,r,i,a){let{row:o,column:s}=this.getCellIndexByOffset(e,t,n,r,i,a);return this.getCellWithCoordByIndex(o,s)}getOffsetByColumn(e){let{columnWidthAccumulation:t,rowHeaderWidthAndMarginLeft:n}=this,r=t.length-1,i=t[e];return i==null?e<0?n:t[r]+n:i+n}getOffsetByRow(e){let{rowHeightAccumulation:t,columnHeaderHeightAndMarginTop:n}=this,r=t.length-1,i=t[e];return i==null?e<0?n:t[r]+n:i+n}getOffsetRelativeToRowCol(e,t){let n=Es(this.columnWidthAccumulation,e),r=e-((this._columnWidthAccumulation[n-1]||0)+this.getColGapSize(n)),i=Es(this.rowHeightAccumulation,t);return{row:i,column:n,columnOffset:r,rowOffset:t-((this._rowHeightAccumulation[i-1]||0)+this.getRowGapSize(i))}}getCellIndexAndOffsetByPosition(e,t){let{actualRow:n,actualColumn:r,startX:i,startY:a}=this.getCellWithCoordByOffset(e,t,this._scaleX,this._scaleY,{x:this._scrollX,y:this._scrollY});return{row:n,rowOffset:t-a,column:r,columnOffset:e-i}}_updateConfigAndGetDocumentModel(e,t,n,r){var i,a,o,s,c;if(!r||!((i=e.body)!=null&&i.dataStream))return;e.documentStyle||(e.documentStyle={}),e.documentStyle.marginTop=(a=n.t)==null?0:a,e.documentStyle.marginBottom=(o=n.b)==null?2:o,e.documentStyle.marginLeft=(s=n.l)==null?2:s,e.documentStyle.marginRight=(c=n.r)==null?2:c,e.documentStyle.pageSize={width:1/0,height:1/0},e.documentStyle.renderConfig={...e.documentStyle.renderConfig,...r};let l=e.body.paragraphs||[];for(let e of l)e.paragraphStyle||(e.paragraphStyle={}),e.paragraphStyle.horizontalAlign=t;return new Pm(e)}dispose(){super.dispose(),this._rowHeightAccumulation=[],this._columnWidthAccumulation=[],this._rowTotalHeight=0,this._columnTotalWidth=0,this._rowHeaderWidth=0,this._columnHeaderHeight=0,this._worksheetData=null,this._cellData=null,this._styles=null,this.worksheet=null}};b_=ss([W(2,(0,t.Inject)(Lg)),W(3,ts),W(4,$o),W(5,(0,t.Inject)(t.Injector))],b_);function x_(e,t,n,r,i=0,a=0){let o=e-1,s=t-1,c=(n[o]||0)+i,l=n[e];l==null&&(l=n[n.length-1]);let u=(r[s]||0)+a,d=r[t];return d==null&&(d=r[r.length-1]),{startY:c,endY:l,startX:u,endX:d}}function S_(e,t,n,r,i,a){var o,s;e=H.clamp(e,0,n.length-1),t=H.clamp(t,0,r.length-1);let{startY:c,endY:l,startX:u,endX:d}=x_(e,t,n,r,(o=a==null?void 0:a.row(e))==null?0:o,(s=a==null?void 0:a.col(t))==null?0:s);if(!i)return{startY:c,endY:l,startX:u,endX:d,isMerged:!1,isMergedMainCell:!1,actualRow:e,actualColumn:t,mergeInfo:{startY:c,endY:l,startX:u,endX:d,startRow:e,startColumn:t,endRow:e,endColumn:t}};let{isMerged:f,isMergedMainCell:p,startRow:m,startColumn:h,endRow:g,endColumn:_}=i,v={startRow:m,startColumn:h,endRow:g,endColumn:_,startY:c,endY:l,startX:u,endX:d},y=n.length-1,b=r.length-1;if(f&&m!==-1&&h!==-1){var x,S;let e=(x=a==null?void 0:a.row(m))==null?0:x,t=(S=a==null?void 0:a.col(h))==null?0:S,i=(n[m-1]||0)+e,o=n[g]||n[y],s=(r[h-1]||0)+t,c=r[_]||r[b];v={...v,startY:i,endY:o,startX:s,endX:c}}else if(!f&&g!==-1&&_!==-1){let e=n[g]||n[y],t=r[_]||r[b];v={...v,startY:c,endY:e,startX:u,endX:t}}return{isMerged:f,isMergedMainCell:p,actualRow:e,actualColumn:t,startY:c,endY:l,startX:u,endX:d,mergeInfo:v}}function C_(e,t,n,r){let{x:i}=n;return e/t+i-r}function w_(e,t,n,r){let{y:i}=n;return e=e/t+i-r,e}let T_=[`script`,`style`,`meta`,`comment`,`link`],E_=function(e){return e[e.INFO=0]=`INFO`,e[e.STOP=1]=`STOP`,e[e.WARNING=2]=`WARNING`,e}({}),D_=function(e){return e[e.DISABLED=0]=`DISABLED`,e[e.FULL_ALPHA=1]=`FULL_ALPHA`,e[e.FULL_HANGUL=2]=`FULL_HANGUL`,e[e.FULL_KATAKANA=3]=`FULL_KATAKANA`,e[e.HALF_ALPHA=4]=`HALF_ALPHA`,e[e.HALF_HANGUL=5]=`HALF_HANGUL`,e[e.HALF_KATAKANA=6]=`HALF_KATAKANA`,e[e.HIRAGANA=7]=`HIRAGANA`,e[e.NO_CONTROL=8]=`NO_CONTROL`,e[e.OFF=9]=`OFF`,e[e.ON=10]=`ON`,e}({}),O_=function(e){return e.BETWEEN=`between`,e.EQUAL=`equal`,e.GREATER_THAN=`greaterThan`,e.GREATER_THAN_OR_EQUAL=`greaterThanOrEqual`,e.LESS_THAN=`lessThan`,e.LESS_THAN_OR_EQUAL=`lessThanOrEqual`,e.NOT_BETWEEN=`notBetween`,e.NOT_EQUAL=`notEqual`,e}({}),k_=function(e){return e[e.TEXT=0]=`TEXT`,e[e.ARROW=1]=`ARROW`,e[e.CUSTOM=2]=`CUSTOM`,e}({}),A_=function(e){return e.VALID=`valid`,e.INVALID=`invalid`,e.VALIDATING=`validating`,e}({}),j_=function(e){return e.CUSTOM=`custom`,e.LIST=`list`,e.LIST_MULTIPLE=`listMultiple`,e.NONE=`none`,e.TEXT_LENGTH=`textLength`,e.DATE=`date`,e.TIME=`time`,e.WHOLE=`whole`,e.DECIMAL=`decimal`,e.CHECKBOX=`checkbox`,e.ANY=`any`,e}({}),M_=class extends V{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){let e=e=>{e.businesses.forEach(t=>{switch(t){case n.UniverType.UNRECOGNIZED:case n.UniverType.UNIVER_UNKNOWN:case n.UniverType.UNIVER_SLIDE:case n.UniverType.UNIVER_DOC:this._univerInstanceService.getAllUnitsForType(n.UniverType.UNIVER_DOC).forEach(t=>{let n=(t.getSnapshot().resources||[]).find(t=>t.name===e.pluginName);if(n)try{let r=e.parseJson(n.data);e.onLoad(t.getUnitId(),r)}catch{console.error(`Load Document{${t.getUnitId()}} Resources{${e.pluginName}} Data Error.`)}});break;case n.UniverType.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(n.UniverType.UNIVER_SHEET).forEach(t=>{let n=(t.getSnapshot().resources||[]).find(t=>t.name===e.pluginName);if(n)try{let r=e.parseJson(n.data);e.onLoad(t.getUnitId(),r)}catch{console.error(`Load Workbook{${t.getUnitId()}} Resources{${e.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(t=>e(t)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(t=>e(t))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(n.UniverType.UNIVER_SHEET).subscribe(e=>{let{unit:t}=e;this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(n.UniverType.UNIVER_DOC).subscribe(e=>{let{unit:t}=e;L(t.getUnitId())||this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(n.UniverType.UNIVER_SHEET).subscribe(e=>{this._resourceManagerService.unloadResources(e.getUnitId(),n.UniverType.UNIVER_SHEET)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(n.UniverType.UNIVER_DOC).subscribe(e=>{this._resourceManagerService.unloadResources(e.getUnitId(),n.UniverType.UNIVER_DOC)}))}saveUnit(e){let t=this._univerInstanceService.getUnit(e);if(!t)return null;let n=this._resourceManagerService.getResources(e,t.type),r=H.deepClone(t.getSnapshot());return r.resources=n,r}};M_=ss([W(0,(0,t.Inject)(Eh)),W(1,(0,t.Inject)(kg))],M_);var N_=class extends ta{constructor(...e){super(...e),R(this,`type`,void 0),R(this,`name$`,void 0)}getUnitId(){throw Error(`Method not implemented.`)}setName(e){throw Error(`Method not implemented.`)}getSnapshot(){throw Error(`Method not implemented.`)}getRev(){throw Error(`Method not implemented.`)}incrementRev(){throw Error(`Method not implemented.`)}setRev(e){throw Error(`Method not implemented.`)}},P_=class{get _univerInstanceService(){return this._injector.get(kg)}get _pluginService(){return this._injector.get(Jg)}constructor(e={},t){R(this,`_startedTypes`,new Set),R(this,`_injector`,void 0),R(this,`_disposingCallbacks`,new Qi);let n=this._injector=F_(t,e==null?void 0:e.override),{theme:r,darkMode:i,locale:a,locales:o,logLevel:s,logCommandExecution:c}=e;r&&this._injector.get(Zg).setTheme(r),i&&this._injector.get(Zg).setDarkMode(i),o&&this._injector.get(Lg).load(o),a&&this._injector.get(Lg).setLocale(a),s&&this._injector.get(is).setLogLevel(s),c!==void 0&&this._injector.get($o).setConfig(cs,c),this._init(n)}__getInjector(){return this._injector}onDispose(e){let t=this._disposingCallbacks.add(B(e));return B(()=>t.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(e){this._injector.get(Lg).setLocale(e)}createUnit(e,t){return this._univerInstanceService.createUnit(e,t)}_init(e){this._univerInstanceService.registerCtorForType(n.UniverType.UNIVER_SHEET,Og),this._univerInstanceService.registerCtorForType(n.UniverType.UNIVER_DOC,Pm),this._univerInstanceService.registerCtorForType(n.UniverType.UNIVER_SLIDE,N_);let t=e.get(kg);t.__setCreateHandler((n,r,i,a)=>{var o;let s=!this._startedTypes.has(n);s&&(this._pluginService.startPluginsForType(n),this._startedTypes.add(n));let c=(o=t.__getCtorByType(n))==null?i:o;if(!c)throw Error(`[Univer]: No constructor registered for unit type ${n}.`);let l=e.createInstance(c,r);return t.__addUnit(l,a),s&&this._tryProgressToReady(),l})}_tryProgressToReady(){this._injector.get(Pg).stage<1&&(this._injector.get(Pg).stage=1)}registerPlugin(e,t){this._pluginService.registerPlugin(e,t)}registerPlugins(e){e.forEach(e=>{let[t,n]=e;this._pluginService.registerPlugin(t,n)})}};function F_(e,n){let r=Ug([[Vh],[Lg],[Zg],[Pg],[Jg],[Ah],[kg,{useClass:Ag}],[Vg,{useClass:Hg}],[is,{useClass:as,lazy:!0}],[us,{useClass:ps}],[Qg,{useClass:i_,lazy:!0}],[$o,{useClass:es}],[ts,{useClass:ns}],[Eh,{useClass:Xg,lazy:!0}],[Yg,{useClass:M_,lazy:!0}],[Mh,{useClass:jh}],[zg,{useClass:Rg,lazy:!0}]],n),i=e?e.createChild(r):new t.Injector(r);return ie(i,[[Ah],[Yg]]),i}b(),e.ABCToNumber=ip,e.AUTO_HEIGHT_FOR_MERGED_CELLS=te,e.AbsoluteRefType=$s,e.ActionIterator=dm,e.AlignTypeH=wo,e.AlignTypeV=To,e.ArrangeTypeEnum=Ao,e.AsyncInterceptorManager=ve,e.AsyncLock=k.default,Object.defineProperty(e,`AuthzIoLocalService`,{enumerable:!0,get:function(){return jh}}),e.AutoFillSeries=ya,e.BORDER_KEYS=Io,e.BORDER_STYLE_KEYS=Fo,e.BaselineOffset=Ua,e.BlockType=eo,e.BooleanNumber=Wa,e.BorderStyleTypes=ba,e.BorderType=xa,e.BuildTextUtils=$,e.BulletAlignment=Za,e.COLORS=ks,e.COLOR_STYLE_KEYS=Po,e.COMMAND_LOG_EXECUTION_CONFIG_KEY=cs,e.CanceledError=se,e.CellModeEnum=ic,e.CellValueType=Ga,e.ColorKit=As,e.ColorType=Sa,e.ColumnSeparatorType=io,Object.defineProperty(e,`CommandService`,{enumerable:!0,get:function(){return ps}}),e.CommandType=ls,e.CommonHideTypes=Ca,e.ConfigService=es,e.ContextService=ns,e.CopyPasteType=wa,e.CustomCommandExecutionError=oe,e.CustomDecorationType=$a,e.CustomRangeType=Qa,e.DEFAULT_CELL=mf,e.DEFAULT_DOC=Mm,e.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=`__default_document_sub_component_id20231101__`,e.DEFAULT_EMPTY_DOCUMENT_VALUE=`\r
|
|
9
|
+
`,e.DEFAULT_NUMBER_FORMAT=`General`,e.DEFAULT_RANGE=ff,e.DEFAULT_RANGE_ARRAY=df,e.DEFAULT_SELECTION=pf,e.DEFAULT_STYLES=Z,e.DEFAULT_TEXT_FORMAT=`@@@`,e.DEFAULT_TEXT_FORMAT_EXCEL=`@`,e.DEFAULT_WORKSHEET_COLUMN_COUNT=20,e.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=`DEFAULT_WORKSHEET_COLUMN_COUNT`,e.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=20,e.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=`DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT`,e.DEFAULT_WORKSHEET_COLUMN_WIDTH=88,e.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=`DEFAULT_WORKSHEET_COLUMN_WIDTH`,e.DEFAULT_WORKSHEET_ROW_COUNT=vg,e.DEFAULT_WORKSHEET_ROW_COUNT_KEY=`DEFAULT_WORKSHEET_ROW_COUNT`,e.DEFAULT_WORKSHEET_ROW_HEIGHT=24,e.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=`DEFAULT_WORKSHEET_ROW_HEIGHT`,e.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=46,e.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=`DEFAULT_WORKSHEET_ROW_TITLE_WIDTH`,e.DOCS_COMMENT_EDITOR_UNIT_ID_KEY=F,e.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=ee,e.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=N,e.DOCS_ZEN_EDITOR_UNIT_ID_KEY=P,e.DOC_DRAWING_PRINTING_COMPONENT_KEY=`univer-docs-drawing-printing`,e.DOC_RANGE_TYPE=nc,e.DashStyleType=fo,e.DataStreamTreeNodeType=Tm,e.DataStreamTreeTokenType=Em,e.DataValidationErrorStyle=E_,e.DataValidationImeMode=D_,e.DataValidationOperator=O_,e.DataValidationRenderMode=k_,e.DataValidationStatus=A_,e.DataValidationType=j_,e.DeleteDirection=Ta,e.DependentOn=qg,e.DesktopLogService=as,e.DeveloperMetadataVisibility=Ea,e.Dimension=Da,e.Direction=Oa,e.Disposable=V,e.DisposableCollection=Qi,e.DocStyleType=Ja,e.DocumentDataModel=Pm,e.DocumentFlavor=to,e.DrawingTypeEnum=jo,e.EDITOR_ACTIVATED=zh,e.EXTENSION_NAMES=vf,e.ErrorService=Vh,e.EventState=Ch,e.EventSubject=wh,e.FOCUSING_COMMENT_EDITOR=`FOCUSING_COMMENT_EDITOR`,e.FOCUSING_COMMON_DRAWINGS=`FOCUSING_COMMON_DRAWINGS`,e.FOCUSING_DOC=Lh,e.FOCUSING_EDITOR_BUT_HIDDEN=`FOCUSING_EDITOR_BUT_HIDDEN`,e.FOCUSING_EDITOR_INPUT_FORMULA=`FOCUSING_EDITOR_INPUT_FORMULA`,e.FOCUSING_EDITOR_STANDALONE=`FOCUSING_EDITOR_INPUT_FORMULA`,e.FOCUSING_FX_BAR_EDITOR=Bh,e.FOCUSING_PANEL_EDITOR=`FOCUSING_PANEL_EDITOR`,e.FOCUSING_SHAPE_TEXT_EDITOR=`FOCUSING_SHAPE_TEXT_EDITOR`,e.FOCUSING_SHEET=Ih,e.FOCUSING_SLIDE=Rh,e.FOCUSING_UNIT=Fh,e.FOCUSING_UNIVER_EDITOR=`FOCUSING_UNIVER_EDITOR`,e.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=`FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE`,e.FORMULA_EDITOR_ACTIVATED=`FORMULA_EDITOR_ACTIVATED`,e.FollowNumberWithType=Ya,e.FontItalic=Va,e.FontStyleType=bo,e.FontWeight=Ha,e.GridType=no,e.HorizontalAlign=Ra,e.IAuthzIoService=Mh,e.ICommandService=us,e.IConfigService=$o,e.IConfirmService=Nh,e.IContextService=ts,e.IImageIoService=Wh,e.ILocalStorageService=Ig,e.ILogService=is,e.IMentionIOService=zg,e.IPermissionService=Vg,e.IResourceLoaderService=Yg,e.IResourceManagerService=Eh,e.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=`isRowStylePrecedeColumnStyle`,e.IURLImageService=Gh,e.IUndoRedoService=Qg,e.IUniverInstanceService=kg,e.ImageCacheMap=a_,e.ImageSourceType=Hh,e.ImageUploadStatusType=Uh,Object.defineProperty(e,`Inject`,{enumerable:!0,get:function(){return t.Inject}}),Object.defineProperty(e,`InjectSelf`,{enumerable:!0,get:function(){return t.InjectSelf}}),Object.defineProperty(e,`Injector`,{enumerable:!0,get:function(){return t.Injector}}),e.InterceptorEffectEnum=fe,e.InterceptorManager=he,e.InterpolationPointType=Aa,Object.defineProperty(e,`JSON1`,{enumerable:!0,get:function(){return Xo}}),e.JSONX=wm,e.LRUHelper=sf,e.LRUMap=of,Object.defineProperty(e,`LifecycleService`,{enumerable:!0,get:function(){return Pg}}),e.LifecycleStages=jg,e.LifecycleUnreachableError=Ng,e.ListGlyphType=Xa,Object.defineProperty(e,`LocalUndoRedoService`,{enumerable:!0,get:function(){return i_}}),e.LocaleService=Lg,e.LocaleType=ja,e.LogLevel=rs,Object.defineProperty(e,`LookUp`,{enumerable:!0,get:function(){return t.LookUp}}),e.MAX_COLUMN_COUNT=uf,e.MAX_ROW_COUNT=lf,e.MOVE_BUFFER_VALUE=2,Object.defineProperty(e,`Many`,{enumerable:!0,get:function(){return t.Many}}),e.MemoryCursor=Bi,Object.defineProperty(e,`MentionIOLocalService`,{enumerable:!0,get:function(){return Rg}}),e.MentionType=Ma,e.NAMED_STYLE_MAP=gf,e.NAMED_STYLE_SPACE_MAP=_f,e.NamedStyleType=lo,e.NilCommand=fs,e.NumberUnitType=Co,e.ObjectMatrix=Ku,e.ObjectRelativeFromH=xo,e.ObjectRelativeFromV=So,Object.defineProperty(e,`Optional`,{enumerable:!0,get:function(){return t.Optional}}),e.PADDING_KEYS=Ro,e.PAGE_SIZE=yf,e.PAPER_TYPES=ko,e.PRESET_LIST_TYPE=Lp,e.PRINT_CHART_COMPONENT_KEY=`univer-sheets-chart-print-chart`,e.PageOrientType=Do,e.PaperType=Oo,e.ParagraphElementType=oo,e.ParagraphStyleBuilder=bh,e.ParagraphStyleValue=yh,e.PermissionService=Hg,e.PermissionStatus=Bg,e.Plugin=Gg,Object.defineProperty(e,`PluginService`,{enumerable:!0,get:function(){return Jg}}),e.PositionedObjectLayoutType=co,e.PresetListType=Mp,e.ProtectionType=Na,Object.defineProperty(e,`Quantity`,{enumerable:!0,get:function(){return t.Quantity}}),e.QuickListType=jp,e.QuickListTypeMap=Bp,e.RANGE_DIRECTION=tc,e.RANGE_TYPE=Qs,e.RBush=Tf,e.RCDisposable=ea,e.RGBA_PAREN=`rgba(`,e.RGB_PAREN=`rgb(`,e.ROTATE_BUFFER_VALUE=1,e.RTree=h_,e.Range=xf,e.Rectangle=Zf,Object.defineProperty(e,`RediError`,{enumerable:!0,get:function(){return t.RediError}}),e.RedoCommand=r_,e.RedoCommandId=e_,e.RefAlias=np,e.Registry=Gi,e.RegistryAsMap=Ki,e.RelativeDate=Pa,Object.defineProperty(e,`ResourceManagerService`,{enumerable:!0,get:function(){return Xg}}),e.RichTextBuilder=Sh,e.RichTextValue=xh,e.RxDisposable=$i,e.SHEET_EDITOR_UNITS=hf,e.STYLE_KEYS=zo,e.SectionType=ro,Object.defineProperty(e,`Self`,{enumerable:!0,get:function(){return t.Self}}),Object.defineProperty(e,`SheetSkeleton`,{enumerable:!0,get:function(){return b_}}),e.SheetTypes=Fa,e.SheetViewModel=xg,Object.defineProperty(e,`Skeleton`,{enumerable:!0,get:function(){return v_}}),Object.defineProperty(e,`SkipSelf`,{enumerable:!0,get:function(){return t.SkipSelf}}),e.SliceBodyType=Xp,e.SpacingRule=uo,e.Styles=Yh,e.TEXT_DECORATION_KEYS=No,e.TEXT_ROTATION_KEYS=Lo,e.THEME_COLORS=ac,e.TabStopAlignment=po,e.TableAlignmentType=ho,e.TableLayoutType=go,e.TableRowHeightRule=vo,e.TableSizeType=mo,e.TableTextWrapType=_o,e.TestConfirmService=Ph,e.TextDecoration=La,e.TextDecorationBuilder=vh,e.TextDirection=Ia,e.TextDirectionType=ao,e.TextStyleBuilder=_h,e.TextStyleValue=gh,e.TextX=Q,e.TextXActionType=Qo,e.ThemeColorType=Ka,e.ThemeColors=qa,e.ThemeService=Zg,e.Tools=H,e.UndoCommand=n_,e.UndoCommandId=t_,e.UnitModel=ta,e.Univer=P_,Object.defineProperty(e,`UniverInstanceService`,{enumerable:!0,get:function(){return Ag}}),e.UniverInstanceType=n.UniverType,e.UpdateDocsAttributeType=Zo,e.UserManagerService=Ah,e.VerticalAlign=za,e.VerticalAlignmentType=yo,Object.defineProperty(e,`WithNew`,{enumerable:!0,get:function(){return t.WithNew}}),Object.defineProperty(e,`Workbook`,{enumerable:!0,get:function(){return Og}}),e.Worksheet=Cg,e.WrapStrategy=Ba,e.WrapTextType=so,e.addLinkToDocumentModel=rg,e.afterInitApply=Ss,e.afterTime=bs,e.awaitTime=g_,e.binSearchFirstGreaterThanTarget=Ts,e.binarySearchArray=ws,e.bufferDebounceTime=ys,e.cellToRange=od,e.characterSpacingControlType=Eo,e.checkForSubstrings=dd,e.checkIfMove=Os,e.checkParagraphHasBullet=Vd,e.checkParagraphHasIndent=Hd,e.checkParagraphHasIndentByStyle=Ud,e.cloneCellData=ug,e.cloneCellDataMatrix=fg,e.cloneCellDataWithSpanAndDisplay=dg,e.cloneValue=lg,e.cloneWorksheetData=hg,e.codeToBlob=Ds,e.columnLabelToNumber=cf,e.composeBody=lm,e.composeInterceptors=me,e.composeStyles=ga,e.concatMatrixArray=Vu,e.convertCellToRange=qu,e.convertObservableToBehaviorSubject=xs,e.covertCellValue=sd,e.covertCellValues=cd,e.createAsyncInterceptorKey=ge,e.createDefaultUser=Oh,e.createDocumentModelWithStyle=eg,Object.defineProperty(e,`createIdentifier`,{enumerable:!0,get:function(){return t.createIdentifier}}),e.createInterceptorKey=pe,e.createInternalEditorID=I,e.createREGEXFromWildChar=va,e.createRowColIter=rp,e.createSheetGapTestConfig=y_,e.customNameCharacterCheck=s_,e.dateKit=zd,e.debounce=ki,e.dedupe=S,e.dedupeBy=C,e.deepCompare=ld,e.delayAnimationFrame=__,e.deleteContent=Gd,e.extractPureTextFromCell=wg,Object.defineProperty(e,`forwardRef`,{enumerable:!0,get:function(){return t.forwardRef}}),e.fromCallback=_s,e.fromEventSubject=Th,e.generateIntervalsByPoints=Jd,e.generateRandomId=U,e.get=Qr,e.getArrayLength=Lu,e.getBodySlice=nm,e.getBorderStyleType=rd,e.getCellCoordByIndexSimple=x_,e.getCellInfoInMergeData=rc,e.getCellValueType=Ys,e.getCellWithCoordByIndexCore=S_,e.getColorStyle=Qu,e.getCustomBlockSlice=tm,e.getCustomDecorationSlice=am,e.getCustomRangeSlice=im,e.getDisplayValueFromCell=Tg,e.getDocsUpdateBody=id,e.getEmptyCell=ag,e.getIntersectRange=qf,e.getNumfmtParseValueFilter=Fu,e.getOriginCellValue=Eg,e.getParagraphsSlice=$p,e.getPlainText=km,e.getReverseDirection=ka,e.getSectionBreakSlice=em,e.getTableSlice=Qp,e.getTextRunSlice=Zp,e.getTransformOffsetX=C_,e.getTransformOffsetY=w_,e.getWorksheetUID=Dg,e.groupBy=E,e.handleStyleToString=td,e.hashAlgorithm=qd,e.horizontalLineSegmentsSubtraction=Bd,e.insertMatrixArray=zu,e.insertTextToContent=Wd,e.invertColorByHSL=Ae,e.invertColorByMatrix=Ne,Object.defineProperty(e,`isAsyncDependencyItem`,{enumerable:!0,get:function(){return t.isAsyncDependencyItem}}),Object.defineProperty(e,`isAsyncHook`,{enumerable:!0,get:function(){return t.isAsyncHook}}),e.isBlackColor=Ks,e.isBooleanString=j,e.isCellCoverable=Zu,e.isCellV=Zs,Object.defineProperty(e,`isClassDependencyItem`,{enumerable:!0,get:function(){return t.isClassDependencyItem}}),e.isCommentEditorID=ne,Object.defineProperty(e,`isCtor`,{enumerable:!0,get:function(){return t.isCtor}}),e.isDefaultFormat=Au,Object.defineProperty(e,`isDisposable`,{enumerable:!0,get:function(){return t.isDisposable}}),e.isEmptyCell=Xu,Object.defineProperty(e,`isFactoryDependencyItem`,{enumerable:!0,get:function(){return t.isFactoryDependencyItem}}),e.isFormulaId=ed,e.isFormulaString=$u,e.isICellData=Js,e.isInternalEditorID=L,e.isNodeEnv=_a,e.isNotNullOrUndefined=ig,e.isNullCell=Xs,e.isNumeric=Hi,e.isPatternEqualWithoutDecimal=ju,e.isRangesEqual=Xh,e.isRealNum=Kd,e.isSafeNumeric=Ui,e.isSameStyleTextRun=ud,e.isTextFormat=ku,e.isUnitRangesEqual=Zh,e.isValidRange=ad,Object.defineProperty(e,`isValueDependencyItem`,{enumerable:!0,get:function(){return t.isValueDependencyItem}}),e.isWhiteColor=qs,e.makeArray=D,e.makeCellRangeToRangeData=Yu,e.makeCellToSelection=Ju,e.makeCustomRangeStream=Dm,e.mapObjectMatrix=Iu,e.merge=Li,e.mergeIntervals=Yd,e.mergeLocales=Xd,e.mergeOverrideWithDependencies=Ug,e.mergeSets=Xi,e.mergeWith=Ii,e.mergeWorksheetSnapshotWithDefault=yg,e.mixinClass=Vi,e.moveMatrixArray=Uu,e.moveRangeByOffset=Bf,e.nameCharacterCheck=o_,e.normalizeBody=rm,e.normalizeTextRuns=dp,e.numberToABC=ap,e.numberToListABC=sp,Object.defineProperty(e,`numfmt`,{enumerable:!0,get:function(){return _u}}),e.queryObjectMatrix=tp,e.registerDependencies=re,e.remove=x,e.repeatStringNumTimes=op,e.replaceInDocumentBody=ph,e.requestImmediateMacroTask=qi,e.resolveWithBasePath=ca,e.rotate=T,e.searchArray=Es,e.searchInOrderedArray=Cs,e.selectionToArray=ec,e.sequence=Yi,e.sequenceAsync=Ji,e.sequenceExecute=hs,e.sequenceExecuteAsync=gs,e.set=zi,Object.defineProperty(e,`setDependencies`,{enumerable:!0,get:function(){return t.setDependencies}}),e.shallowEqual=ae,e.skipParseTagNames=T_,e.sliceMatrixArray=Hu,e.sortRules=cp,e.sortRulesByDesc=lp,e.sortRulesFactory=up,e.spliceArray=Bu,e.splitIntoGrid=Hf,e.takeAfter=vs,Object.defineProperty(e,`textDiff`,{enumerable:!0,get:function(){return Um.default}}),e.throttle=ce,e.toDisposable=B,e.touchDependencies=ie,e.updateAttributeByDelete=fm,e.updateAttributeByInsert=pm,e.willLoseNumericPrecision=Wi});
|