@univerjs/core 0.5.0-alpha.0 → 0.5.0-beta.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/lib/cjs/index.js CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";var gu=Object.defineProperty;var pu=(e,t,n)=>t in e?gu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var R=(e,t,n)=>pu(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const le=require("rxjs"),Sr=require("rxjs/operators"),Ze=require("react");function mu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}function _u(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const It=mu(Ze);function Eu(){Ru()}const fr=typeof global<"u"?global:typeof self<"u"?self:window;function Ru(){typeof fr.requestIdleCallback!="function"&&(fr.requestIdleCallback=function(n){const r=Date.now();return setTimeout(function(){const i=Math.max(0,50-(Date.now()-r));n({didTimeout:i===0,timeRemaining(){return i}})},1)}),typeof fr.cancelIdleCallback!="function"&&(fr.cancelIdleCallback=function(n){clearTimeout(n)})}var $o=typeof global=="object"&&global&&global.Object===Object&&global,Cu=typeof self=="object"&&self&&self.Object===Object&&self,on=$o||Cu||Function("return this")(),Cn=on.Symbol,Wo=Object.prototype,Iu=Wo.hasOwnProperty,vu=Wo.toString,Nn=Cn?Cn.toStringTag:void 0;function Su(e){var t=Iu.call(e,Nn),n=e[Nn];try{e[Nn]=void 0;var r=!0}catch{}var s=vu.call(e);return r&&(t?e[Nn]=n:delete e[Nn]),s}var Ou=Object.prototype,bu=Ou.toString;function yu(e){return bu.call(e)}var wu="[object Null]",Au="[object Undefined]",Mi=Cn?Cn.toStringTag:void 0;function er(e){return e==null?e===void 0?Au:wu:Mi&&Mi in Object(e)?Su(e):yu(e)}function Sn(e){return e!=null&&typeof e=="object"}var Nu="[object Symbol]";function Hr(e){return typeof e=="symbol"||Sn(e)&&er(e)==Nu}function Tu(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var In=Array.isArray,Mu=1/0,Li=Cn?Cn.prototype:void 0,Di=Li?Li.toString:void 0;function Vo(e){if(typeof e=="string")return e;if(In(e))return Tu(e,Vo)+"";if(Hr(e))return Di?Di.call(e):"";var t=e+"";return t=="0"&&1/e==-Mu?"-0":t}var Lu=/\s/;function Du(e){for(var t=e.length;t--&&Lu.test(e.charAt(t)););return t}var xu=/^\s+/;function Uu(e){return e&&e.slice(0,Du(e)+1).replace(xu,"")}function pt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var xi=NaN,Pu=/^[-+]0x[0-9a-f]+$/i,Fu=/^0b[01]+$/i,ku=/^0o[0-7]+$/i,ju=parseInt;function Ui(e){if(typeof e=="number")return e;if(Hr(e))return xi;if(pt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=pt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Uu(e);var n=Fu.test(e);return n||ku.test(e)?ju(e.slice(2),n?2:8):Pu.test(e)?xi:+e}function zo(e){return e}var Hu="[object AsyncFunction]",Bu="[object Function]",$u="[object GeneratorFunction]",Wu="[object Proxy]";function Gs(e){if(!pt(e))return!1;var t=er(e);return t==Bu||t==$u||t==Hu||t==Wu}var es=on["__core-js_shared__"],Pi=function(){var e=/[^.]+$/.exec(es&&es.keys&&es.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Vu(e){return!!Pi&&Pi in e}var zu=Function.prototype,Gu=zu.toString;function Ku(e){if(e!=null){try{return Gu.call(e)}catch{}try{return e+""}catch{}}return""}var Yu=/[\\^$.*+?()[\]{}|]/g,Xu=/^\[object .+?Constructor\]$/,Qu=Function.prototype,Ju=Object.prototype,Zu=Qu.toString,qu=Ju.hasOwnProperty,eh=RegExp("^"+Zu.call(qu).replace(Yu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function th(e){if(!pt(e)||Vu(e))return!1;var t=Gs(e)?eh:Xu;return t.test(Ku(e))}function nh(e,t){return e==null?void 0:e[t]}function Ks(e,t){var n=nh(e,t);return th(n)?n:void 0}var Fi=Object.create,rh=function(){function e(){}return function(t){if(!pt(t))return{};if(Fi)return Fi(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function sh(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 ih(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var oh=800,ah=16,lh=Date.now;function ch(e){var t=0,n=0;return function(){var r=lh(),s=ah-(r-n);if(n=r,s>0){if(++t>=oh)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function uh(e){return function(){return e}}var Ar=function(){try{var e=Ks(Object,"defineProperty");return e({},"",{}),e}catch{}}(),hh=Ar?function(e,t){return Ar(e,"toString",{configurable:!0,enumerable:!1,value:uh(t),writable:!0})}:zo,dh=ch(hh),fh=9007199254740991,gh=/^(?:0|[1-9]\d*)$/;function Ys(e,t){var n=typeof e;return t=t==null?fh:t,!!t&&(n=="number"||n!="symbol"&&gh.test(e))&&e>-1&&e%1==0&&e<t}function Xs(e,t,n){t=="__proto__"&&Ar?Ar(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Br(e,t){return e===t||e!==e&&t!==t}var ph=Object.prototype,mh=ph.hasOwnProperty;function Go(e,t,n){var r=e[t];(!(mh.call(e,t)&&Br(r,n))||n===void 0&&!(t in e))&&Xs(e,t,n)}function _h(e,t,n,r){var s=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],l=void 0;l===void 0&&(l=e[a]),s?Xs(n,a,l):Go(n,a,l)}return n}var ki=Math.max;function Eh(e,t,n){return t=ki(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=ki(r.length-t,0),o=Array(i);++s<i;)o[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=n(o),sh(e,this,a)}}function Rh(e,t){return dh(Eh(e,t,zo),e+"")}var Ch=9007199254740991;function Ko(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ch}function Qs(e){return e!=null&&Ko(e.length)&&!Gs(e)}function Ih(e,t,n){if(!pt(n))return!1;var r=typeof t;return(r=="number"?Qs(n)&&Ys(t,n.length):r=="string"&&t in n)?Br(n[t],e):!1}function Yo(e){return Rh(function(t,n){var r=-1,s=n.length,i=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&Ih(n[0],n[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var a=n[r];a&&e(t,a,r,i)}return t})}var vh=Object.prototype;function Xo(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||vh;return e===n}function Sh(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Oh="[object Arguments]";function ji(e){return Sn(e)&&er(e)==Oh}var Qo=Object.prototype,bh=Qo.hasOwnProperty,yh=Qo.propertyIsEnumerable,ps=ji(function(){return arguments}())?ji:function(e){return Sn(e)&&bh.call(e,"callee")&&!yh.call(e,"callee")};function wh(){return!1}var Jo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hi=Jo&&typeof module=="object"&&module&&!module.nodeType&&module,Ah=Hi&&Hi.exports===Jo,Bi=Ah?on.Buffer:void 0,Nh=Bi?Bi.isBuffer:void 0,Zo=Nh||wh,Th="[object Arguments]",Mh="[object Array]",Lh="[object Boolean]",Dh="[object Date]",xh="[object Error]",Uh="[object Function]",Ph="[object Map]",Fh="[object Number]",kh="[object Object]",jh="[object RegExp]",Hh="[object Set]",Bh="[object String]",$h="[object WeakMap]",Wh="[object ArrayBuffer]",Vh="[object DataView]",zh="[object Float32Array]",Gh="[object Float64Array]",Kh="[object Int8Array]",Yh="[object Int16Array]",Xh="[object Int32Array]",Qh="[object Uint8Array]",Jh="[object Uint8ClampedArray]",Zh="[object Uint16Array]",qh="[object Uint32Array]",Be={};Be[zh]=Be[Gh]=Be[Kh]=Be[Yh]=Be[Xh]=Be[Qh]=Be[Jh]=Be[Zh]=Be[qh]=!0;Be[Th]=Be[Mh]=Be[Wh]=Be[Lh]=Be[Vh]=Be[Dh]=Be[xh]=Be[Uh]=Be[Ph]=Be[Fh]=Be[kh]=Be[jh]=Be[Hh]=Be[Bh]=Be[$h]=!1;function ed(e){return Sn(e)&&Ko(e.length)&&!!Be[er(e)]}function td(e){return function(t){return e(t)}}var qo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bn=qo&&typeof module=="object"&&module&&!module.nodeType&&module,nd=Bn&&Bn.exports===qo,ts=nd&&$o.process,$i=function(){try{var e=Bn&&Bn.require&&Bn.require("util").types;return e||ts&&ts.binding&&ts.binding("util")}catch{}}(),Wi=$i&&$i.isTypedArray,ea=Wi?td(Wi):ed;function rd(e,t){var n=In(e),r=!n&&ps(e),s=!n&&!r&&Zo(e),i=!n&&!r&&!s&&ea(e),o=n||r||s||i,a=o?Sh(e.length,String):[],l=a.length;for(var c in e)o&&(c=="length"||s&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ys(c,l))||a.push(c);return a}function sd(e,t){return function(n){return e(t(n))}}function id(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var od=Object.prototype,ad=od.hasOwnProperty;function ld(e){if(!pt(e))return id(e);var t=Xo(e),n=[];for(var r in e)r=="constructor"&&(t||!ad.call(e,r))||n.push(r);return n}function ta(e){return Qs(e)?rd(e):ld(e)}var cd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ud=/^\w*$/;function hd(e,t){if(In(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Hr(e)?!0:ud.test(e)||!cd.test(e)||t!=null&&e in Object(t)}var Gn=Ks(Object,"create");function dd(){this.__data__=Gn?Gn(null):{},this.size=0}function fd(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var gd="__lodash_hash_undefined__",pd=Object.prototype,md=pd.hasOwnProperty;function _d(e){var t=this.__data__;if(Gn){var n=t[e];return n===gd?void 0:n}return md.call(t,e)?t[e]:void 0}var Ed=Object.prototype,Rd=Ed.hasOwnProperty;function Cd(e){var t=this.__data__;return Gn?t[e]!==void 0:Rd.call(t,e)}var Id="__lodash_hash_undefined__";function vd(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Gn&&t===void 0?Id:t,this}function qt(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])}}qt.prototype.clear=dd;qt.prototype.delete=fd;qt.prototype.get=_d;qt.prototype.has=Cd;qt.prototype.set=vd;function Sd(){this.__data__=[],this.size=0}function $r(e,t){for(var n=e.length;n--;)if(Br(e[n][0],t))return n;return-1}var Od=Array.prototype,bd=Od.splice;function yd(e){var t=this.__data__,n=$r(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():bd.call(t,n,1),--this.size,!0}function wd(e){var t=this.__data__,n=$r(t,e);return n<0?void 0:t[n][1]}function Ad(e){return $r(this.__data__,e)>-1}function Nd(e,t){var n=this.__data__,r=$r(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Pt(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])}}Pt.prototype.clear=Sd;Pt.prototype.delete=yd;Pt.prototype.get=wd;Pt.prototype.has=Ad;Pt.prototype.set=Nd;var na=Ks(on,"Map");function Td(){this.size=0,this.__data__={hash:new qt,map:new(na||Pt),string:new qt}}function Md(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Wr(e,t){var n=e.__data__;return Md(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Ld(e){var t=Wr(this,e).delete(e);return this.size-=t?1:0,t}function Dd(e){return Wr(this,e).get(e)}function xd(e){return Wr(this,e).has(e)}function Ud(e,t){var n=Wr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Gt(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])}}Gt.prototype.clear=Td;Gt.prototype.delete=Ld;Gt.prototype.get=Dd;Gt.prototype.has=xd;Gt.prototype.set=Ud;var Pd="Expected a function";function Js(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Pd);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(Js.Cache||Gt),n}Js.Cache=Gt;var Fd=500;function kd(e){var t=Js(e,function(r){return n.size===Fd&&n.clear(),r}),n=t.cache;return t}var jd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hd=/\\(\\)?/g,Bd=kd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(jd,function(n,r,s,i){t.push(s?i.replace(Hd,"$1"):r||n)}),t});function $d(e){return e==null?"":Vo(e)}function ra(e,t){return In(e)?e:hd(e,t)?[e]:Bd($d(e))}var Wd=1/0;function sa(e){if(typeof e=="string"||Hr(e))return e;var t=e+"";return t=="0"&&1/e==-Wd?"-0":t}function Vd(e,t){t=ra(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[sa(t[n++])];return n&&n==r?e:void 0}function zd(e,t,n){var r=e==null?void 0:Vd(e,t);return r===void 0?n:r}var ia=sd(Object.getPrototypeOf,Object),Gd="[object Object]",Kd=Function.prototype,Yd=Object.prototype,oa=Kd.toString,Xd=Yd.hasOwnProperty,Qd=oa.call(Object);function Jd(e){if(!Sn(e)||er(e)!=Gd)return!1;var t=ia(e);if(t===null)return!0;var n=Xd.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&oa.call(n)==Qd}function Zd(){this.__data__=new Pt,this.size=0}function qd(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ef(e){return this.__data__.get(e)}function tf(e){return this.__data__.has(e)}var nf=200;function rf(e,t){var n=this.__data__;if(n instanceof Pt){var r=n.__data__;if(!na||r.length<nf-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gt(r)}return n.set(e,t),this.size=n.size,this}function On(e){var t=this.__data__=new Pt(e);this.size=t.size}On.prototype.clear=Zd;On.prototype.delete=qd;On.prototype.get=ef;On.prototype.has=tf;On.prototype.set=rf;var aa=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vi=aa&&typeof module=="object"&&module&&!module.nodeType&&module,sf=Vi&&Vi.exports===aa,zi=sf?on.Buffer:void 0;zi&&zi.allocUnsafe;function of(e,t){return e.slice()}var Gi=on.Uint8Array;function af(e){var t=new e.constructor(e.byteLength);return new Gi(t).set(new Gi(e)),t}function lf(e,t){var n=af(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function cf(e){return typeof e.constructor=="function"&&!Xo(e)?rh(ia(e)):{}}function uf(e){return function(t,n,r){for(var s=-1,i=Object(t),o=r(t),a=o.length;a--;){var l=o[++s];if(n(i[l],l,i)===!1)break}return t}}var hf=uf(),ns=function(){return on.Date.now()},df="Expected a function",ff=Math.max,gf=Math.min;function pf(e,t,n){var r,s,i,o,a,l,c=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(df);t=Ui(t)||0,pt(n)&&(u=!!n.leading,h="maxWait"in n,i=h?ff(Ui(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function f(O){var L=r,z=s;return r=s=void 0,c=O,o=e.apply(z,L),o}function _(O){return c=O,a=setTimeout(S,t),u?f(O):o}function C(O){var L=O-l,z=O-c,ge=t-L;return h?gf(ge,i-z):ge}function T(O){var L=O-l,z=O-c;return l===void 0||L>=t||L<0||h&&z>=i}function S(){var O=ns();if(T(O))return x(O);a=setTimeout(S,C(O))}function x(O){return a=void 0,d&&r?f(O):(r=s=void 0,o)}function B(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function V(){return a===void 0?o:x(ns())}function y(){var O=ns(),L=T(O);if(r=arguments,s=this,l=O,L){if(a===void 0)return _(l);if(h)return clearTimeout(a),a=setTimeout(S,t),f(l)}return a===void 0&&(a=setTimeout(S,t)),o}return y.cancel=B,y.flush=V,y}function ms(e,t,n){(n!==void 0&&!Br(e[t],n)||n===void 0&&!(t in e))&&Xs(e,t,n)}function mf(e){return Sn(e)&&Qs(e)}function _s(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function _f(e){return _h(e,ta(e))}function Ef(e,t,n,r,s,i,o){var a=_s(e,n),l=_s(t,n),c=o.get(l);if(c){ms(e,n,c);return}var u=i?i(a,l,n+"",e,t,o):void 0,h=u===void 0;if(h){var d=In(l),f=!d&&Zo(l),_=!d&&!f&&ea(l);u=l,d||f||_?In(a)?u=a:mf(a)?u=ih(a):f?(h=!1,u=of(l)):_?(h=!1,u=lf(l)):u=[]:Jd(l)||ps(l)?(u=a,ps(a)?u=_f(a):(!pt(a)||Gs(a))&&(u=cf(l))):h=!1}h&&(o.set(l,u),s(u,l,r,i,o),o.delete(l)),ms(e,n,u)}function Zs(e,t,n,r,s){e!==t&&hf(t,function(i,o){if(s||(s=new On),pt(i))Ef(e,t,o,n,Zs,r,s);else{var a=r?r(_s(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),ms(e,o,a)}},ta)}var Rf=Yo(function(e,t,n,r){Zs(e,t,n,r)}),Cf=Yo(function(e,t,n){Zs(e,t,n)});function If(e,t,n,r){if(!pt(e))return e;t=ra(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=sa(t[s]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var u=a[l];c=void 0,c===void 0&&(c=pt(u)?u:Ys(t[s+1])?[]:{})}Go(a,l,c),a=a[l]}return e}function vf(e,t,n){return e==null?e:If(e,t,n)}var at=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ut=-1,lt=1,Ye=0;function Kn(e,t,n,r,s){if(e===t)return e?[[Ye,e]]:[];if(n!=null){var i=Mf(e,t,n);if(i)return i}var o=ei(e,t),a=e.substring(0,o);e=e.substring(o),t=t.substring(o),o=Vr(e,t);var l=e.substring(e.length-o);e=e.substring(0,e.length-o),t=t.substring(0,t.length-o);var c=Sf(e,t);return a&&c.unshift([Ye,a]),l&&c.push([Ye,l]),ti(c,s),r&&yf(c),c}function Sf(e,t){var n;if(!e)return[[lt,t]];if(!t)return[[ut,e]];var r=e.length>t.length?e:t,s=e.length>t.length?t:e,i=r.indexOf(s);if(i!==-1)return n=[[lt,r.substring(0,i)],[Ye,s],[lt,r.substring(i+s.length)]],e.length>t.length&&(n[0][0]=n[2][0]=ut),n;if(s.length===1)return[[ut,e],[lt,t]];var o=bf(e,t);if(o){var a=o[0],l=o[1],c=o[2],u=o[3],h=o[4],d=Kn(a,c),f=Kn(l,u);return d.concat([[Ye,h]],f)}return Of(e,t)}function Of(e,t){for(var n=e.length,r=t.length,s=Math.ceil((n+r)/2),i=s,o=2*s,a=new Array(o),l=new Array(o),c=0;c<o;c++)a[c]=-1,l[c]=-1;a[i+1]=0,l[i+1]=0;for(var u=n-r,h=u%2!==0,d=0,f=0,_=0,C=0,T=0;T<s;T++){for(var S=-T+d;S<=T-f;S+=2){var x=i+S,B;S===-T||S!==T&&a[x-1]<a[x+1]?B=a[x+1]:B=a[x-1]+1;for(var V=B-S;B<n&&V<r&&e.charAt(B)===t.charAt(V);)B++,V++;if(a[x]=B,B>n)f+=2;else if(V>r)d+=2;else if(h){var y=i+u-S;if(y>=0&&y<o&&l[y]!==-1){var O=n-l[y];if(B>=O)return Ki(e,t,B,V)}}}for(var L=-T+_;L<=T-C;L+=2){var y=i+L,O;L===-T||L!==T&&l[y-1]<l[y+1]?O=l[y+1]:O=l[y-1]+1;for(var z=O-L;O<n&&z<r&&e.charAt(n-O-1)===t.charAt(r-z-1);)O++,z++;if(l[y]=O,O>n)C+=2;else if(z>r)_+=2;else if(!h){var x=i+u-L;if(x>=0&&x<o&&a[x]!==-1){var B=a[x],V=i+B-x;if(O=n-O,B>=O)return Ki(e,t,B,V)}}}}return[[ut,e],[lt,t]]}function Ki(e,t,n,r){var s=e.substring(0,n),i=t.substring(0,r),o=e.substring(n),a=t.substring(r),l=Kn(s,i),c=Kn(o,a);return l.concat(c)}function ei(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),s=r,i=0;n<s;)e.substring(i,s)==t.substring(i,s)?(n=s,i=n):r=s,s=Math.floor((r-n)/2+n);return la(e.charCodeAt(s-1))&&s--,s}function Yi(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 s=Math.min(n,r);if(e==t)return s;for(var i=0,o=1;;){var a=e.substring(s-o),l=t.indexOf(a);if(l==-1)return i;o+=l,(l==0||e.substring(s-o)==t.substring(0,o))&&(i=o,o++)}}function Vr(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var n=0,r=Math.min(e.length,t.length),s=r,i=0;n<s;)e.substring(e.length-s,e.length-i)==t.substring(t.length-s,t.length-i)?(n=s,i=n):r=s,s=Math.floor((r-n)/2+n);return ca(e.charCodeAt(e.length-s))&&s--,s}function bf(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 s(f,_,C){for(var T=f.substring(C,C+Math.floor(f.length/4)),S=-1,x="",B,V,y,O;(S=_.indexOf(T,S+1))!==-1;){var L=ei(f.substring(C),_.substring(S)),z=Vr(f.substring(0,C),_.substring(0,S));x.length<z+L&&(x=_.substring(S-z,S)+_.substring(S,S+L),B=f.substring(0,C-z),V=f.substring(C+L),y=_.substring(0,S-z),O=_.substring(S+L))}return x.length*2>=f.length?[B,V,y,O,x]:null}var i=s(n,r,Math.ceil(n.length/4)),o=s(n,r,Math.ceil(n.length/2)),a;if(!i&&!o)return null;o?i?a=i[4].length>o[4].length?i:o:a=o:a=i;var l,c,u,h;e.length>t.length?(l=a[0],c=a[1],u=a[2],h=a[3]):(u=a[0],h=a[1],l=a[2],c=a[3]);var d=a[4];return[l,c,u,h,d]}function yf(e){for(var t=!1,n=[],r=0,s=null,i=0,o=0,a=0,l=0,c=0;i<e.length;)e[i][0]==Ye?(n[r++]=i,o=l,a=c,l=0,c=0,s=e[i][1]):(e[i][0]==lt?l+=e[i][1].length:c+=e[i][1].length,s&&s.length<=Math.max(o,a)&&s.length<=Math.max(l,c)&&(e.splice(n[r-1],0,[ut,s]),e[n[r-1]+1][0]=lt,r--,r--,i=r>0?n[r-1]:-1,o=0,a=0,l=0,c=0,s=null,t=!0)),i++;for(t&&ti(e),Nf(e),i=1;i<e.length;){if(e[i-1][0]==ut&&e[i][0]==lt){var u=e[i-1][1],h=e[i][1],d=Yi(u,h),f=Yi(h,u);d>=f?(d>=u.length/2||d>=h.length/2)&&(e.splice(i,0,[Ye,h.substring(0,d)]),e[i-1][1]=u.substring(0,u.length-d),e[i+1][1]=h.substring(d),i++):(f>=u.length/2||f>=h.length/2)&&(e.splice(i,0,[Ye,u.substring(0,f)]),e[i-1][0]=lt,e[i-1][1]=h.substring(0,h.length-f),e[i+1][0]=ut,e[i+1][1]=u.substring(f),i++),i++}i++}}var Xi=/[^a-zA-Z0-9]/,Qi=/\s/,Ji=/[\r\n]/,wf=/\n\r?\n$/,Af=/^\r?\n\r?\n/;function Nf(e){function t(f,_){if(!f||!_)return 6;var C=f.charAt(f.length-1),T=_.charAt(0),S=C.match(Xi),x=T.match(Xi),B=S&&C.match(Qi),V=x&&T.match(Qi),y=B&&C.match(Ji),O=V&&T.match(Ji),L=y&&f.match(wf),z=O&&_.match(Af);return L||z?5:y||O?4:S&&!B&&V?3:B||V?2:S||x?1:0}for(var n=1;n<e.length-1;){if(e[n-1][0]==Ye&&e[n+1][0]==Ye){var r=e[n-1][1],s=e[n][1],i=e[n+1][1],o=Vr(r,s);if(o){var a=s.substring(s.length-o);r=r.substring(0,r.length-o),s=a+s.substring(0,s.length-o),i=a+i}for(var l=r,c=s,u=i,h=t(r,s)+t(s,i);s.charAt(0)===i.charAt(0);){r+=s.charAt(0),s=s.substring(1)+i.charAt(0),i=i.substring(1);var d=t(r,s)+t(s,i);d>=h&&(h=d,l=r,c=s,u=i)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=c,u?e[n+1][1]=u:(e.splice(n+1,1),n--))}n++}}function ti(e,t){e.push([Ye,""]);for(var n=0,r=0,s=0,i="",o="",a;n<e.length;){if(n<e.length-1&&!e[n][1]){e.splice(n,1);continue}switch(e[n][0]){case lt:s++,o+=e[n][1],n++;break;case ut:r++,i+=e[n][1],n++;break;case Ye:var l=n-s-r-1;if(t){if(l>=0&&ha(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),i=c+i,o=c+o,!e[l][1]){e.splice(l,1),n--;var u=l-1;e[u]&&e[u][0]===lt&&(s++,o=e[u][1]+o,u--),e[u]&&e[u][0]===ut&&(r++,i=e[u][1]+i,u--),l=u}}if(ua(e[n][1])){var c=e[n][1].charAt(0);e[n][1]=e[n][1].slice(1),i+=c,o+=c}}if(n<e.length-1&&!e[n][1]){e.splice(n,1);break}if(i.length>0||o.length>0){i.length>0&&o.length>0&&(a=ei(o,i),a!==0&&(l>=0?e[l][1]+=o.substring(0,a):(e.splice(0,0,[Ye,o.substring(0,a)]),n++),o=o.substring(a),i=i.substring(a)),a=Vr(o,i),a!==0&&(e[n][1]=o.substring(o.length-a)+e[n][1],o=o.substring(0,o.length-a),i=i.substring(0,i.length-a)));var h=s+r;i.length===0&&o.length===0?(e.splice(n-h,h),n=n-h):i.length===0?(e.splice(n-h,h,[lt,o]),n=n-h+1):o.length===0?(e.splice(n-h,h,[ut,i]),n=n-h+1):(e.splice(n-h,h,[ut,i],[lt,o]),n=n-h+2)}n!==0&&e[n-1][0]===Ye?(e[n-1][1]+=e[n][1],e.splice(n,1)):n++,s=0,r=0,i="",o="";break}}e[e.length-1][1]===""&&e.pop();var d=!1;for(n=1;n<e.length-1;)e[n-1][0]===Ye&&e[n+1][0]===Ye&&(e[n][1].substring(e[n][1].length-e[n-1][1].length)===e[n-1][1]?(e[n][1]=e[n-1][1]+e[n][1].substring(0,e[n][1].length-e[n-1][1].length),e[n+1][1]=e[n-1][1]+e[n+1][1],e.splice(n-1,1),d=!0):e[n][1].substring(0,e[n+1][1].length)==e[n+1][1]&&(e[n-1][1]+=e[n+1][1],e[n][1]=e[n][1].substring(e[n+1][1].length)+e[n+1][1],e.splice(n+1,1),d=!0)),n++;d&&ti(e,t)}function la(e){return e>=55296&&e<=56319}function ca(e){return e>=56320&&e<=57343}function ua(e){return ca(e.charCodeAt(0))}function ha(e){return la(e.charCodeAt(e.length-1))}function Tf(e){for(var t=[],n=0;n<e.length;n++)e[n][1].length>0&&t.push(e[n]);return t}function rs(e,t,n,r){return ha(e)||ua(r)?null:Tf([[Ye,e],[ut,t],[lt,n],[Ye,r]])}function Mf(e,t,n){var r=typeof n=="number"?{index:n,length:0}:n.oldRange,s=typeof n=="number"?null:n.newRange,i=e.length,o=t.length;if(r.length===0&&(s===null||s.length===0)){var a=r.index,l=e.slice(0,a),c=e.slice(a),u=s?s.index:null;e:{var h=a+o-i;if(u!==null&&u!==h||h<0||h>o)break e;var d=t.slice(0,h),f=t.slice(h);if(f!==c)break e;var _=Math.min(a,h),C=l.slice(0,_),T=d.slice(0,_);if(C!==T)break e;var S=l.slice(_),x=d.slice(_);return rs(C,S,x,c)}e:{if(u!==null&&u!==a)break e;var B=a,d=t.slice(0,B),f=t.slice(B);if(d!==l)break e;var V=Math.min(i-B,o-B),y=c.slice(c.length-V),O=f.slice(f.length-V);if(y!==O)break e;var S=c.slice(0,c.length-V),x=f.slice(0,f.length-V);return rs(l,S,x,y)}}if(r.length>0&&s&&s.length===0)e:{var C=e.slice(0,r.index),y=e.slice(r.index+r.length),_=C.length,V=y.length;if(o<_+V)break e;var T=t.slice(0,_),O=t.slice(o-V);if(C!==T||y!==O)break e;var S=e.slice(_,i-V),x=t.slice(_,o-V);return rs(C,S,x,y)}return null}function zr(e,t,n,r){return Kn(e,t,n,r,!0)}zr.INSERT=lt;zr.DELETE=ut;zr.EQUAL=Ye;var Lf=zr;const da=qs(Lf);function tr(e,t){const n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function Df(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function xf(e,t){for(let n=e.length-1;n>-1;n--){const r=e[n];if(t(r,n))return r}return null}function Uf(e,t){if(e.length===0)return e;const n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function Pf(e,t){const n=new Map;return e.forEach(r=>{const s=t(r);let i=n.get(s);n.has(s)||(i=[],n.set(s,i)),i.push(r)}),n}function Ff(e){return Array.isArray(e)?e:[e]}function kf(e){return["true","false"].includes(e.toLowerCase())}const nr="__INTERNAL_EDITOR__",ni=`${nr}DOCS_NORMAL`,ri=`${nr}DOCS_FORMULA_BAR`,fa=`${nr}ZEN_EDITOR`,ga=`\r
2
- `,jf="isRowStylePrecedeColumnStyle";function Hf(e){return`${nr}${e}`}function pa(e){return e.startsWith(nr)}var si=Symbol("$$IDENTIFIER_DECORATOR");function Bf(e){return e&&e[si]===!0}function ii(e){return typeof e=="function"}function Es(e){return!!(e&&typeof e.useClass<"u")}function Rs(e){return!!(e&&typeof e.useFactory<"u")}function Cs(e){return!!(e&&typeof e.useValue<"u")}function $f(e){return!!(e&&typeof e.useExisting<"u")}function Is(e){return!!(e&&typeof e.useAsync<"u")}var ma=Symbol("AsyncHook");function Or(e){return!!(e&&e.__symbol===ma)}function ht(e){return typeof e>"u"?"undefined":ii(e)&&!e[si]?e.name:e.toString()}exports.Quantity=void 0;(function(e){e.MANY="many",e.OPTIONAL="optional",e.REQUIRED="required"})(exports.Quantity||(exports.Quantity={}));exports.LookUp=void 0;(function(e){e.SELF="self",e.SKIP_SELF="skipSelf"})(exports.LookUp||(exports.LookUp={}));var Wf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qe=function(e){Wf(t,e);function t(n){return e.call(this,"[redi]: ".concat(n))||this}return t}(Error),_a=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zi=Symbol("$$TARGET"),vs=Symbol("$$DEPENDENCIES"),Vf=function(e){_a(t,e);function t(n,r){var s="Could not find dependency registered on the ".concat(n,' (indexed) parameter of the constructor of "').concat(ht(r),'".');return e.call(this,s)||this}return t}(Qe),Ea=function(e){_a(t,e);function t(n,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(ht(n),'". Please make sure that there is not cyclic dependency among your TypeScript files, or consider using "forwardRef". For more info please visit our website https://redi.wendell.fun/docs/debug#could-not-find-dependency-registered-on');return e.call(this,s)||this}return t}(Qe);function Ra(e){var t=e;return t[vs]||[]}function oi(e,t){var n=Ra(e),r=n.find(function(s){return s.paramIndex===t});if(!r)throw new Vf(t,e);return r}function ai(e,t,n,r,s){r===void 0&&(r=exports.Quantity.REQUIRED);var i={paramIndex:n,identifier:t,quantity:r,lookUp:s,withNew:!1};if(typeof t>"u")throw new Ea(e,n);var o=e;o[Zi]===o?o[vs].push(i):(o[vs]=[i],o[Zi]=o)}var qi=new Set;function _t(e){if(qi.has(e))throw new Qe('Identifier "'.concat(e,'" already exists.'));qi.add(e);var t=function(n,r,s){ai(n,t,s)};return t.toString=function(){return e},t[si]=!0,t}var zf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gf=function(e){zf(t,e);function t(n,r,s){var i='Expect "'.concat(r,'" dependency items for id "').concat(ht(n),'" but get ').concat(s,".");return e.call(this,i)||this}return t}(Qe);function Ca(e,t,n){if(t===exports.Quantity.OPTIONAL&&n>1||t===exports.Quantity.REQUIRED&&n!==1)throw new Gf(e,t,n)}function Kf(e,t){return e===exports.Quantity.MANY?t:t[0]}function Yf(e,t,n){var r=oi(e,t);r.quantity=n}function li(e){return function t(n){return this instanceof t?this:function(r,s,i){if(n)ai(r,n,i,e);else{if(e===exports.Quantity.REQUIRED)throw new Ea(r,i);Yf(r,i,e)}}}}var Ia=li(exports.Quantity.MANY),va=li(exports.Quantity.OPTIONAL),mt=li(exports.Quantity.REQUIRED);function Xf(e){return{unwrap:e}}function Qf(e){return!!e&&typeof e.unwrap=="function"}function Jf(e){return Qf(e)?e.unwrap():e}function Ss(e){return!!e&&typeof e.dispose=="function"}var Sa=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();function Zf(e){return e.length===1}var Gr=[];function eo(e){Gr.push(e)}function to(){Gr.pop()}function qf(){Gr.length=0}var no=function(e){Sa(t,e);function t(n,r,s){var i='Cannot find "'.concat(ht(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(Bf(n)?ht(n):n.name,'".');return e.call(this,i)||this}return t}(Qe),br=function(e){Sa(t,e);function t(n){var r=this,s='Cannot find "'.concat(ht(n),'" registered by any injector. The stack of dependencies is: "').concat(Gr.map(function(i){return ht(i)}).join(" -> "),'".');return r=e.call(this,s)||this,qf(),r}return t}(Qe),eg=function(){function e(t){var n=this;this.dependencyMap=new Map,this.normalizeDependencies(t).map(function(r){return n.add(r[0],r[1])})}return e.prototype.add=function(t,n){typeof n>"u"&&(n={useClass:t,lazy:!1});var r=this.dependencyMap.get(t);typeof r>"u"&&(r=[],this.dependencyMap.set(t,r)),r.push(n)},e.prototype.delete=function(t){this.dependencyMap.delete(t)},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.dependencyMap.get(t);return Ca(t,n,r.length),Kf(n,r)},e.prototype.has=function(t){return this.dependencyMap.has(t)},e.prototype.append=function(t){var n=this;this.normalizeDependencies(t).forEach(function(r){return n.add(r[0],r[1])})},e.prototype.dispose=function(){this.dependencyMap.clear()},e.prototype.normalizeDependencies=function(t){return t.map(function(n){var r=n[0],s;return Zf(n)?s={useClass:n[0],lazy:!1}:s=n[1],[r,s]})},e}(),tg=function(){function e(){this.resolvedDependencies=new Map}return e.prototype.add=function(t,n){var r=this.resolvedDependencies.get(t);typeof r>"u"&&(r=[],this.resolvedDependencies.set(t,r)),r.push(n)},e.prototype.has=function(t){return this.resolvedDependencies.has(t)},e.prototype.delete=function(t){if(this.resolvedDependencies.has(t)){var n=this.resolvedDependencies.get(t);n.forEach(function(r){return Ss(r)?r.dispose():void 0}),this.resolvedDependencies.delete(t)}},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.resolvedDependencies.get(t);if(!r)throw new br(t);return Ca(t,n,r.length),n===exports.Quantity.MANY?r:r[0]},e.prototype.dispose=function(){Array.from(this.resolvedDependencies.values()).forEach(function(t){t.forEach(function(n){return Ss(n)?n.dispose():void 0})}),this.resolvedDependencies.clear()},e}();function ng(e,t,n){var r=oi(e,t);r.lookUp=n}function Oa(e){return function t(){return this instanceof t?this:function(n,r,s){ng(n,s,e)}}}var ba=Oa(exports.LookUp.SKIP_SELF),ya=Oa(exports.LookUp.SELF);function rg(e,t,n){var r=oi(e,t);r.withNew=n}function sg(e){return function t(){return this instanceof t?this:function(n,r,s){rg(n,s,e)}}}var wa=sg(!0);function Aa(e,t){return t===void 0&&(t=0),e?e.map(function(n,r){if(r+=t,!Array.isArray(n))return{paramIndex:r,identifier:n,quantity:exports.Quantity.REQUIRED,withNew:!1};var s=n.slice(0,n.length-1),i=n[n.length-1],o=void 0,a=exports.Quantity.REQUIRED,l=!1;return s.forEach(function(c){if(c instanceof ya)o=exports.LookUp.SELF;else if(c instanceof ba)o=exports.LookUp.SKIP_SELF;else if(c instanceof va)a=exports.Quantity.OPTIONAL;else if(c instanceof Ia)a=exports.Quantity.MANY;else if(c instanceof wa)l=!0;else throw new Qe("unknown dep modifier ".concat(c,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}var Os;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")Os=function(t,n){var r=requestIdleCallback(t,typeof n=="number"?{timeout:n}:void 0),s=!1;return function(){s||(s=!0,cancelIdleCallback(r))}};else{var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});Os=function(t){var n=setTimeout(function(){return t(e)}),r=!1;return function(){r||(r=!0,clearTimeout(n))}}}})();var ig=function(){function e(t){var n=this;this.didRun=!1,this.selfExecutor=function(){try{n.value=t()}catch(r){n.error=r}finally{n.didRun=!0}},this.disposeCallback=Os(function(){return n.selfExecutor()})}return e.prototype.hasRun=function(){return this.didRun},e.prototype.dispose=function(){this.disposeCallback()},e.prototype.getValue=function(){if(this.didRun||(this.dispose(),this.selfExecutor()),this.error)throw this.error;return this.value},e}(),bn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nr=function(){return Nr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Nr.apply(this,arguments)},Qt=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},og=300,Tn=Symbol("$$NOT_INSTANTIATED_SYMBOL"),ag=function(e){bn(t,e);function t(n){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(ht(n),'".'))||this}return t}(Qe),lg=function(e){bn(t,e);function t(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return t}(Qe),cg=function(e){bn(t,e);function t(n){return e.call(this,'Async item "'.concat(ht(n),'" returns another async item.'))||this}return t}(Qe),ug=function(e){bn(t,e);function t(n){return e.call(this,'Cannot get async item "'.concat(ht(n),'" from sync api.'))||this}return t}(Qe),ro=function(e){bn(t,e);function t(n){return e.call(this,'Cannot add dependency "'.concat(ht(n),'" after it is already resolved.'))||this}return t}(Qe),hg=function(e){bn(t,e);function t(n){return e.call(this,'Cannot dependency dependency "'.concat(ht(n),'" after it is already resolved.'))||this}return t}(Qe),Nt=function(){function e(t,n){n===void 0&&(n=null),this.parent=n,this.children=[],this.resolutionOngoing=0,this.disposed=!1,this.dependencyCollection=new eg(t||[]),this.resolvedDependencyCollection=new tg,n&&n.children.push(this)}return e.prototype.createChild=function(t){return this._ensureInjectorNotDisposed(),new e(t,this)},e.prototype.dispose=function(){this.children.forEach(function(t){return t.dispose()}),this.children.length=0,this.dependencyCollection.dispose(),this.resolvedDependencyCollection.dispose(),this.deleteSelfFromParent(),this.disposed=!0},e.prototype.deleteSelfFromParent=function(){if(this.parent){var t=this.parent.children.indexOf(this);t>-1&&this.parent.children.splice(t,1)}},e.prototype.add=function(t){this._ensureInjectorNotDisposed();var n=t[0],r=t[1];if(this.resolvedDependencyCollection.has(n))throw new ro(n);typeof r>"u"?this.dependencyCollection.add(n):Is(r)||Es(r)||Cs(r)||Rs(r)?this.dependencyCollection.add(n,r):this.resolvedDependencyCollection.add(n,r)},e.prototype.replace=function(t){this._ensureInjectorNotDisposed();var n=t[0];if(this.resolvedDependencyCollection.has(n))throw new ro(n);this.dependencyCollection.delete(n),t.length===1?this.dependencyCollection.add(n):this.dependencyCollection.add(n,t[1])},e.prototype.delete=function(t){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(t))throw new hg(t);this.dependencyCollection.delete(t)},e.prototype.invoke=function(t){for(var n=this,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];this._ensureInjectorNotDisposed();var i={get:function(o,a,l){return n._get(o,a,l)},has:function(o){return n.has(o)}};return t.apply(void 0,Qt([i],r,!1))},e.prototype.has=function(t){var n;return this.dependencyCollection.has(t)||((n=this.parent)===null||n===void 0?void 0:n.has(t))||!1},e.prototype.get=function(t,n,r){this._ensureInjectorNotDisposed();var s=this._get(t,n,r);if(Array.isArray(s)&&s.some(function(i){return Or(i)})||Or(s))throw new ug(t);return s},e.prototype._get=function(t,n,r,s){var i=exports.Quantity.REQUIRED;if(n===exports.Quantity.REQUIRED||n===exports.Quantity.OPTIONAL||n===exports.Quantity.MANY?i=n:r=n,!s){var o=this.getValue(t,i,r);if(o!==Tn)return o}return this.createDependency(t,i,r,!s)},e.prototype.getAsync=function(t){this._ensureInjectorNotDisposed();var n=this.getValue(t,exports.Quantity.REQUIRED);if(n!==Tn)return Promise.resolve(n);var r=this.createDependency(t,exports.Quantity.REQUIRED);return Or(r)?r.whenReady():Promise.resolve(r)},e.prototype.createInstance=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return this._ensureInjectorNotDisposed(),this._resolveClassImpl.apply(this,Qt([{useClass:t}],n,!1))},e.prototype._resolveDependency=function(t,n,r){r===void 0&&(r=!0);var s;eo(t);try{Cs(n)?s=this._resolveValueDependency(t,n):Rs(n)?s=this._resolveFactory(t,n,r):Es(n)?s=this._resolveClass(t,n,r):$f(n)?s=this._resolveExisting(t,n):s=this._resolveAsync(t,n),to()}catch(i){throw to(),i}return s},e.prototype._resolveExisting=function(t,n){var r=this.get(n.useExisting);return this.resolvedDependencyCollection.add(t,r),r},e.prototype._resolveValueDependency=function(t,n){var r=n.useValue;return this.resolvedDependencyCollection.add(t,r),r},e.prototype._resolveClass=function(t,n,r){var s=this;r===void 0&&(r=!0);var i;if(n.lazy){var o=new ig(function(){return s._ensureInjectorNotDisposed(),s._resolveClassImpl(n)});i=new Proxy(Object.create(null),{get:function(a,l){if(l in a)return a[l];if(l!=="whenReady"){var c=o.getValue(),u=c[l];return typeof u!="function"||(u=u.bind(c),a[l]=u),u}},set:function(a,l,c){return o.getValue()[l]=c,!0}})}else i=this._resolveClassImpl(n);return t&&r&&this.resolvedDependencyCollection.add(t,i),i},e.prototype._resolveClassImpl=function(t){for(var n,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var i=t.useClass;this.markNewResolution(i);for(var o=Ra(i).sort(function(T,S){return T.paramIndex-S.paramIndex}).map(function(T){return Nr(Nr({},T),{identifier:Jf(T.identifier)})}),a=[],l=0,c=o;l<c.length;l++){var u=c[l];try{var h=this._get(u.identifier,u.quantity,u.lookUp,u.withNew);a.push(h)}catch(T){throw T instanceof br?new no(i,u.identifier,u.paramIndex):T}}var d=Qt([],r,!0),f=o.length>0?o[0].paramIndex:d.length;if(d.length!==f){console.warn("[redi]: Expect ".concat(f," custom parameter(s) of ").concat(ht(i)," but get ").concat(d.length,"."));var _=f-d.length;_>0?d=Qt(Qt([],d,!0),new Array(_).fill(void 0),!0):d=d.slice(0,f)}var C=new(i.bind.apply(i,Qt(Qt([void 0],d,!1),a,!1)));return(n=t==null?void 0:t.onInstantiation)===null||n===void 0||n.call(t,C),this.markResolutionCompleted(),C},e.prototype._resolveFactory=function(t,n,r){var s;this.markNewResolution(t);for(var i=Aa(n.deps),o=[],a=0,l=i;a<l.length;a++){var c=l[a];try{var u=this._get(c.identifier,c.quantity,c.lookUp,c.withNew);o.push(u)}catch(d){throw d instanceof br?new no(t,c.identifier,c.paramIndex):d}}var h=n.useFactory.apply(null,o);return r&&this.resolvedDependencyCollection.add(t,h),this.markResolutionCompleted(),(s=n==null?void 0:n.onInstantiation)===null||s===void 0||s.call(n,h),h},e.prototype._resolveAsync=function(t,n){var r=this,s={__symbol:ma,whenReady:function(){return r._resolveAsyncImpl(t,n)}};return s},e.prototype._resolveAsyncImpl=function(t,n){var r=this;return n.useAsync().then(function(s){var i=r.getValue(t);if(i!==Tn)return i;var o;if(Array.isArray(s)){var a=s[1];if(Is(a))throw new cg(t);o=r._resolveDependency(t,a)}else ii(s)?o=r._resolveClassImpl({useClass:s,onInstantiation:n.onInstantiation}):o=s;return r.resolvedDependencyCollection.add(t,o),o})},e.prototype.getValue=function(t,n,r){var s=this;n===void 0&&(n=exports.Quantity.REQUIRED);var i=function(){return s.dependencyCollection.has(t)&&!s.resolvedDependencyCollection.has(t)?Tn:s.resolvedDependencyCollection.get(t,n)},o=function(){return s.parent?s.parent.getValue(t,n):Tn};return r===exports.LookUp.SKIP_SELF?o():r===exports.LookUp.SELF||this.resolvedDependencyCollection.has(t)||this.dependencyCollection.has(t)?i():o()},e.prototype.createDependency=function(t,n,r,s){var i=this;n===void 0&&(n=exports.Quantity.REQUIRED),s===void 0&&(s=!0);var o=function(){var l=i.dependencyCollection.get(t,n),c=null;return Array.isArray(l)?c=l.map(function(u){return i._resolveDependency(t,u,s)}):l&&(c=i._resolveDependency(t,l,s)),c},a=function(){if(i.parent)return i.parent.createDependency(t,n,void 0,s);if(n===exports.Quantity.OPTIONAL)return null;throw eo(t),new br(t)};return r===exports.LookUp.SKIP_SELF?a():t===e?this:this.dependencyCollection.has(t)?o():a()},e.prototype.markNewResolution=function(t){if(this.resolutionOngoing+=1,this.resolutionOngoing>=og)throw new ag(t)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new lg},e}();function dg(e,t,n){n===void 0&&(n=0);var r=Aa(t,n);r.forEach(function(s){ai(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}var so=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,io="REDI_GLOBAL_LOCK",fg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;so[io]?fg||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
1
+ "use strict";var wc=Object.defineProperty;var bc=(e,n,t)=>n in e?wc(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var R=(e,n,t)=>bc(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ee=require("rxjs"),br=require("rxjs/operators"),lt=require("react");function Ac(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}function Tc(e,n){for(var t=0;t<n.length;t++){const r=n[t];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const Tt=Ac(lt);function Nc(){Mc()}const _r=typeof global<"u"?global:typeof self<"u"?self:window;function Mc(){typeof _r.requestIdleCallback!="function"&&(_r.requestIdleCallback=function(t){const r=Date.now();return setTimeout(function(){const i=Math.max(0,50-(Date.now()-r));t({didTimeout:i===0,timeRemaining(){return i}})},1)}),typeof _r.cancelIdleCallback!="function"&&(_r.cancelIdleCallback=function(t){clearTimeout(t)})}var Yo=typeof global=="object"&&global&&global.Object===Object&&global,Dc=typeof self=="object"&&self&&self.Object===Object&&self,mn=Yo||Dc||Function("return this")(),bn=mn.Symbol,zo=Object.prototype,Lc=zo.hasOwnProperty,xc=zo.toString,xn=bn?bn.toStringTag:void 0;function Uc(e){var n=Lc.call(e,xn),t=e[xn];try{e[xn]=void 0;var r=!0}catch{}var s=xc.call(e);return r&&(n?e[xn]=t:delete e[xn]),s}var Pc=Object.prototype,kc=Pc.toString;function Fc(e){return kc.call(e)}var $c="[object Null]",jc="[object Undefined]",Li=bn?bn.toStringTag:void 0;function ir(e){return e==null?e===void 0?jc:$c:Li&&Li in Object(e)?Uc(e):Fc(e)}function Nn(e){return e!=null&&typeof e=="object"}var Hc="[object Symbol]";function Yr(e){return typeof e=="symbol"||Nn(e)&&ir(e)==Hc}function Bc(e,n){for(var t=-1,r=e==null?0:e.length,s=Array(r);++t<r;)s[t]=n(e[t],t,e);return s}var An=Array.isArray,Wc=1/0,xi=bn?bn.prototype:void 0,Ui=xi?xi.toString:void 0;function Vo(e){if(typeof e=="string")return e;if(An(e))return Bc(e,Vo)+"";if(Yr(e))return Ui?Ui.call(e):"";var n=e+"";return n=="0"&&1/e==-Wc?"-0":n}var Yc=/\s/;function zc(e){for(var n=e.length;n--&&Yc.test(e.charAt(n)););return n}var Vc=/^\s+/;function Gc(e){return e&&e.slice(0,zc(e)+1).replace(Vc,"")}function St(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Pi=NaN,Kc=/^[-+]0x[0-9a-f]+$/i,Xc=/^0b[01]+$/i,Qc=/^0o[0-7]+$/i,Jc=parseInt;function ki(e){if(typeof e=="number")return e;if(Yr(e))return Pi;if(St(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=St(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Gc(e);var t=Xc.test(e);return t||Qc.test(e)?Jc(e.slice(2),t?2:8):Kc.test(e)?Pi:+e}function Go(e){return e}var Zc="[object AsyncFunction]",qc="[object Function]",eh="[object GeneratorFunction]",th="[object Proxy]";function Ks(e){if(!St(e))return!1;var n=ir(e);return n==qc||n==eh||n==Zc||n==th}var ns=mn["__core-js_shared__"],Fi=function(){var e=/[^.]+$/.exec(ns&&ns.keys&&ns.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function nh(e){return!!Fi&&Fi in e}var rh=Function.prototype,sh=rh.toString;function ih(e){if(e!=null){try{return sh.call(e)}catch{}try{return e+""}catch{}}return""}var oh=/[\\^$.*+?()[\]{}|]/g,ah=/^\[object .+?Constructor\]$/,lh=Function.prototype,uh=Object.prototype,ch=lh.toString,hh=uh.hasOwnProperty,dh=RegExp("^"+ch.call(hh).replace(oh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fh(e){if(!St(e)||nh(e))return!1;var n=Ks(e)?dh:ah;return n.test(ih(e))}function gh(e,n){return e==null?void 0:e[n]}function Xs(e,n){var t=gh(e,n);return fh(t)?t:void 0}var $i=Object.create,mh=function(){function e(){}return function(n){if(!St(n))return{};if($i)return $i(n);e.prototype=n;var t=new e;return e.prototype=void 0,t}}();function ph(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)}function _h(e,n){var t=-1,r=e.length;for(n||(n=Array(r));++t<r;)n[t]=e[t];return n}var Eh=800,Ch=16,Rh=Date.now;function vh(e){var n=0,t=0;return function(){var r=Rh(),s=Ch-(r-t);if(t=r,s>0){if(++n>=Eh)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}function Ih(e){return function(){return e}}var Dr=function(){try{var e=Xs(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Sh=Dr?function(e,n){return Dr(e,"toString",{configurable:!0,enumerable:!1,value:Ih(n),writable:!0})}:Go,Oh=vh(Sh),yh=9007199254740991,wh=/^(?:0|[1-9]\d*)$/;function Qs(e,n){var t=typeof e;return n=n==null?yh:n,!!n&&(t=="number"||t!="symbol"&&wh.test(e))&&e>-1&&e%1==0&&e<n}function Js(e,n,t){n=="__proto__"&&Dr?Dr(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t}function zr(e,n){return e===n||e!==e&&n!==n}var bh=Object.prototype,Ah=bh.hasOwnProperty;function Ko(e,n,t){var r=e[n];(!(Ah.call(e,n)&&zr(r,t))||t===void 0&&!(n in e))&&Js(e,n,t)}function Th(e,n,t,r){var s=!t;t||(t={});for(var i=-1,o=n.length;++i<o;){var a=n[i],l=void 0;l===void 0&&(l=e[a]),s?Js(t,a,l):Ko(t,a,l)}return t}var ji=Math.max;function Nh(e,n,t){return n=ji(n===void 0?e.length-1:n,0),function(){for(var r=arguments,s=-1,i=ji(r.length-n,0),o=Array(i);++s<i;)o[s]=r[n+s];s=-1;for(var a=Array(n+1);++s<n;)a[s]=r[s];return a[n]=t(o),ph(e,this,a)}}function Mh(e,n){return Oh(Nh(e,n,Go),e+"")}var Dh=9007199254740991;function Xo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Dh}function Zs(e){return e!=null&&Xo(e.length)&&!Ks(e)}function Lh(e,n,t){if(!St(t))return!1;var r=typeof n;return(r=="number"?Zs(t)&&Qs(n,t.length):r=="string"&&n in t)?zr(t[n],e):!1}function Qo(e){return Mh(function(n,t){var r=-1,s=t.length,i=s>1?t[s-1]:void 0,o=s>2?t[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&Lh(t[0],t[1],o)&&(i=s<3?void 0:i,s=1),n=Object(n);++r<s;){var a=t[r];a&&e(n,a,r,i)}return n})}var xh=Object.prototype;function Jo(e){var n=e&&e.constructor,t=typeof n=="function"&&n.prototype||xh;return e===t}function Uh(e,n){for(var t=-1,r=Array(e);++t<e;)r[t]=n(t);return r}var Ph="[object Arguments]";function Hi(e){return Nn(e)&&ir(e)==Ph}var Zo=Object.prototype,kh=Zo.hasOwnProperty,Fh=Zo.propertyIsEnumerable,_s=Hi(function(){return arguments}())?Hi:function(e){return Nn(e)&&kh.call(e,"callee")&&!Fh.call(e,"callee")};function $h(){return!1}var qo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bi=qo&&typeof module=="object"&&module&&!module.nodeType&&module,jh=Bi&&Bi.exports===qo,Wi=jh?mn.Buffer:void 0,Hh=Wi?Wi.isBuffer:void 0,ea=Hh||$h,Bh="[object Arguments]",Wh="[object Array]",Yh="[object Boolean]",zh="[object Date]",Vh="[object Error]",Gh="[object Function]",Kh="[object Map]",Xh="[object Number]",Qh="[object Object]",Jh="[object RegExp]",Zh="[object Set]",qh="[object String]",ed="[object WeakMap]",td="[object ArrayBuffer]",nd="[object DataView]",rd="[object Float32Array]",sd="[object Float64Array]",id="[object Int8Array]",od="[object Int16Array]",ad="[object Int32Array]",ld="[object Uint8Array]",ud="[object Uint8ClampedArray]",cd="[object Uint16Array]",hd="[object Uint32Array]",Xe={};Xe[rd]=Xe[sd]=Xe[id]=Xe[od]=Xe[ad]=Xe[ld]=Xe[ud]=Xe[cd]=Xe[hd]=!0;Xe[Bh]=Xe[Wh]=Xe[td]=Xe[Yh]=Xe[nd]=Xe[zh]=Xe[Vh]=Xe[Gh]=Xe[Kh]=Xe[Xh]=Xe[Qh]=Xe[Jh]=Xe[Zh]=Xe[qh]=Xe[ed]=!1;function dd(e){return Nn(e)&&Xo(e.length)&&!!Xe[ir(e)]}function fd(e){return function(n){return e(n)}}var ta=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vn=ta&&typeof module=="object"&&module&&!module.nodeType&&module,gd=Vn&&Vn.exports===ta,rs=gd&&Yo.process,Yi=function(){try{var e=Vn&&Vn.require&&Vn.require("util").types;return e||rs&&rs.binding&&rs.binding("util")}catch{}}(),zi=Yi&&Yi.isTypedArray,na=zi?fd(zi):dd;function md(e,n){var t=An(e),r=!t&&_s(e),s=!t&&!r&&ea(e),i=!t&&!r&&!s&&na(e),o=t||r||s||i,a=o?Uh(e.length,String):[],l=a.length;for(var c in e)o&&(c=="length"||s&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Qs(c,l))||a.push(c);return a}function pd(e,n){return function(t){return e(n(t))}}function _d(e){var n=[];if(e!=null)for(var t in Object(e))n.push(t);return n}var Ed=Object.prototype,Cd=Ed.hasOwnProperty;function Rd(e){if(!St(e))return _d(e);var n=Jo(e),t=[];for(var r in e)r=="constructor"&&(n||!Cd.call(e,r))||t.push(r);return t}function ra(e){return Zs(e)?md(e):Rd(e)}var vd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Id=/^\w*$/;function Sd(e,n){if(An(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||Yr(e)?!0:Id.test(e)||!vd.test(e)||n!=null&&e in Object(n)}var Jn=Xs(Object,"create");function Od(){this.__data__=Jn?Jn(null):{},this.size=0}function yd(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var wd="__lodash_hash_undefined__",bd=Object.prototype,Ad=bd.hasOwnProperty;function Td(e){var n=this.__data__;if(Jn){var t=n[e];return t===wd?void 0:t}return Ad.call(n,e)?n[e]:void 0}var Nd=Object.prototype,Md=Nd.hasOwnProperty;function Dd(e){var n=this.__data__;return Jn?n[e]!==void 0:Md.call(n,e)}var Ld="__lodash_hash_undefined__";function xd(e,n){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Jn&&n===void 0?Ld:n,this}function un(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}un.prototype.clear=Od;un.prototype.delete=yd;un.prototype.get=Td;un.prototype.has=Dd;un.prototype.set=xd;function Ud(){this.__data__=[],this.size=0}function Vr(e,n){for(var t=e.length;t--;)if(zr(e[t][0],n))return t;return-1}var Pd=Array.prototype,kd=Pd.splice;function Fd(e){var n=this.__data__,t=Vr(n,e);if(t<0)return!1;var r=n.length-1;return t==r?n.pop():kd.call(n,t,1),--this.size,!0}function $d(e){var n=this.__data__,t=Vr(n,e);return t<0?void 0:n[t][1]}function jd(e){return Vr(this.__data__,e)>-1}function Hd(e,n){var t=this.__data__,r=Vr(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this}function Yt(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}Yt.prototype.clear=Ud;Yt.prototype.delete=Fd;Yt.prototype.get=$d;Yt.prototype.has=jd;Yt.prototype.set=Hd;var sa=Xs(mn,"Map");function Bd(){this.size=0,this.__data__={hash:new un,map:new(sa||Yt),string:new un}}function Wd(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function Gr(e,n){var t=e.__data__;return Wd(n)?t[typeof n=="string"?"string":"hash"]:t.map}function Yd(e){var n=Gr(this,e).delete(e);return this.size-=n?1:0,n}function zd(e){return Gr(this,e).get(e)}function Vd(e){return Gr(this,e).has(e)}function Gd(e,n){var t=Gr(this,e),r=t.size;return t.set(e,n),this.size+=t.size==r?0:1,this}function tn(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}tn.prototype.clear=Bd;tn.prototype.delete=Yd;tn.prototype.get=zd;tn.prototype.has=Vd;tn.prototype.set=Gd;var Kd="Expected a function";function qs(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(Kd);var t=function(){var r=arguments,s=n?n.apply(this,r):r[0],i=t.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return t.cache=i.set(s,o)||i,o};return t.cache=new(qs.Cache||tn),t}qs.Cache=tn;var Xd=500;function Qd(e){var n=qs(e,function(r){return t.size===Xd&&t.clear(),r}),t=n.cache;return n}var Jd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zd=/\\(\\)?/g,qd=Qd(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(Jd,function(t,r,s,i){n.push(s?i.replace(Zd,"$1"):r||t)}),n});function ef(e){return e==null?"":Vo(e)}function ia(e,n){return An(e)?e:Sd(e,n)?[e]:qd(ef(e))}var tf=1/0;function oa(e){if(typeof e=="string"||Yr(e))return e;var n=e+"";return n=="0"&&1/e==-tf?"-0":n}function nf(e,n){n=ia(n,e);for(var t=0,r=n.length;e!=null&&t<r;)e=e[oa(n[t++])];return t&&t==r?e:void 0}function rf(e,n,t){var r=e==null?void 0:nf(e,n);return r===void 0?t:r}var aa=pd(Object.getPrototypeOf,Object),sf="[object Object]",of=Function.prototype,af=Object.prototype,la=of.toString,lf=af.hasOwnProperty,uf=la.call(Object);function cf(e){if(!Nn(e)||ir(e)!=sf)return!1;var n=aa(e);if(n===null)return!0;var t=lf.call(n,"constructor")&&n.constructor;return typeof t=="function"&&t instanceof t&&la.call(t)==uf}function hf(){this.__data__=new Yt,this.size=0}function df(e){var n=this.__data__,t=n.delete(e);return this.size=n.size,t}function ff(e){return this.__data__.get(e)}function gf(e){return this.__data__.has(e)}var mf=200;function pf(e,n){var t=this.__data__;if(t instanceof Yt){var r=t.__data__;if(!sa||r.length<mf-1)return r.push([e,n]),this.size=++t.size,this;t=this.__data__=new tn(r)}return t.set(e,n),this.size=t.size,this}function Mn(e){var n=this.__data__=new Yt(e);this.size=n.size}Mn.prototype.clear=hf;Mn.prototype.delete=df;Mn.prototype.get=ff;Mn.prototype.has=gf;Mn.prototype.set=pf;var ua=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vi=ua&&typeof module=="object"&&module&&!module.nodeType&&module,_f=Vi&&Vi.exports===ua,Gi=_f?mn.Buffer:void 0;Gi&&Gi.allocUnsafe;function Ef(e,n){return e.slice()}var Ki=mn.Uint8Array;function Cf(e){var n=new e.constructor(e.byteLength);return new Ki(n).set(new Ki(e)),n}function Rf(e,n){var t=Cf(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}function vf(e){return typeof e.constructor=="function"&&!Jo(e)?mh(aa(e)):{}}function If(e){return function(n,t,r){for(var s=-1,i=Object(n),o=r(n),a=o.length;a--;){var l=o[++s];if(t(i[l],l,i)===!1)break}return n}}var Sf=If(),ss=function(){return mn.Date.now()},Of="Expected a function",yf=Math.max,wf=Math.min;function bf(e,n,t){var r,s,i,o,a,l,c=0,h=!1,u=!1,d=!0;if(typeof e!="function")throw new TypeError(Of);n=ki(n)||0,St(t)&&(h=!!t.leading,u="maxWait"in t,i=u?yf(ki(t.maxWait)||0,n):i,d="trailing"in t?!!t.trailing:d);function f(w){var x=r,B=s;return r=s=void 0,c=w,o=e.apply(B,x),o}function p(w){return c=w,a=setTimeout(I,n),h?f(w):o}function E(w){var x=w-l,B=w-c,ue=n-x;return u?wf(ue,i-B):ue}function v(w){var x=w-l,B=w-c;return l===void 0||x>=n||x<0||u&&B>=i}function I(){var w=ss();if(v(w))return M(w);a=setTimeout(I,E(w))}function M(w){return a=void 0,d&&r?f(w):(r=s=void 0,o)}function L(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function j(){return a===void 0?o:M(ss())}function y(){var w=ss(),x=v(w);if(r=arguments,s=this,l=w,x){if(a===void 0)return p(l);if(u)return clearTimeout(a),a=setTimeout(I,n),f(l)}return a===void 0&&(a=setTimeout(I,n)),o}return y.cancel=L,y.flush=j,y}function Es(e,n,t){(t!==void 0&&!zr(e[n],t)||t===void 0&&!(n in e))&&Js(e,n,t)}function Af(e){return Nn(e)&&Zs(e)}function Cs(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}function Tf(e){return Th(e,ra(e))}function Nf(e,n,t,r,s,i,o){var a=Cs(e,t),l=Cs(n,t),c=o.get(l);if(c){Es(e,t,c);return}var h=i?i(a,l,t+"",e,n,o):void 0,u=h===void 0;if(u){var d=An(l),f=!d&&ea(l),p=!d&&!f&&na(l);h=l,d||f||p?An(a)?h=a:Af(a)?h=_h(a):f?(u=!1,h=Ef(l)):p?(u=!1,h=Rf(l)):h=[]:cf(l)||_s(l)?(h=a,_s(a)?h=Tf(a):(!St(a)||Ks(a))&&(h=vf(l))):u=!1}u&&(o.set(l,h),s(h,l,r,i,o),o.delete(l)),Es(e,t,h)}function ei(e,n,t,r,s){e!==n&&Sf(n,function(i,o){if(s||(s=new Mn),St(i))Nf(e,n,o,t,ei,r,s);else{var a=r?r(Cs(e,o),i,o+"",e,n,s):void 0;a===void 0&&(a=i),Es(e,o,a)}},ra)}var Mf=Qo(function(e,n,t,r){ei(e,n,t,r)}),Df=Qo(function(e,n,t){ei(e,n,t)});function Lf(e,n,t,r){if(!St(e))return e;n=ia(n,e);for(var s=-1,i=n.length,o=i-1,a=e;a!=null&&++s<i;){var l=oa(n[s]),c=t;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var h=a[l];c=void 0,c===void 0&&(c=St(h)?h:Qs(n[s+1])?[]:{})}Ko(a,l,c),a=a[l]}return e}function xf(e,n,t){return e==null?e:Lf(e,n,t)}var Qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Et=-1,pt=1,it=0;function Zn(e,n,t,r,s){if(e===n)return e?[[it,e]]:[];if(t!=null){var i=Wf(e,n,t);if(i)return i}var o=ti(e,n),a=e.substring(0,o);e=e.substring(o),n=n.substring(o),o=Kr(e,n);var l=e.substring(e.length-o);e=e.substring(0,e.length-o),n=n.substring(0,n.length-o);var c=Uf(e,n);return a&&c.unshift([it,a]),l&&c.push([it,l]),ni(c,s),r&&Ff(c),c}function Uf(e,n){var t;if(!e)return[[pt,n]];if(!n)return[[Et,e]];var r=e.length>n.length?e:n,s=e.length>n.length?n:e,i=r.indexOf(s);if(i!==-1)return t=[[pt,r.substring(0,i)],[it,s],[pt,r.substring(i+s.length)]],e.length>n.length&&(t[0][0]=t[2][0]=Et),t;if(s.length===1)return[[Et,e],[pt,n]];var o=kf(e,n);if(o){var a=o[0],l=o[1],c=o[2],h=o[3],u=o[4],d=Zn(a,c),f=Zn(l,h);return d.concat([[it,u]],f)}return Pf(e,n)}function Pf(e,n){for(var t=e.length,r=n.length,s=Math.ceil((t+r)/2),i=s,o=2*s,a=new Array(o),l=new Array(o),c=0;c<o;c++)a[c]=-1,l[c]=-1;a[i+1]=0,l[i+1]=0;for(var h=t-r,u=h%2!==0,d=0,f=0,p=0,E=0,v=0;v<s;v++){for(var I=-v+d;I<=v-f;I+=2){var M=i+I,L;I===-v||I!==v&&a[M-1]<a[M+1]?L=a[M+1]:L=a[M-1]+1;for(var j=L-I;L<t&&j<r&&e.charAt(L)===n.charAt(j);)L++,j++;if(a[M]=L,L>t)f+=2;else if(j>r)d+=2;else if(u){var y=i+h-I;if(y>=0&&y<o&&l[y]!==-1){var w=t-l[y];if(L>=w)return Xi(e,n,L,j)}}}for(var x=-v+p;x<=v-E;x+=2){var y=i+x,w;x===-v||x!==v&&l[y-1]<l[y+1]?w=l[y+1]:w=l[y-1]+1;for(var B=w-x;w<t&&B<r&&e.charAt(t-w-1)===n.charAt(r-B-1);)w++,B++;if(l[y]=w,w>t)E+=2;else if(B>r)p+=2;else if(!u){var M=i+h-x;if(M>=0&&M<o&&a[M]!==-1){var L=a[M],j=i+L-M;if(w=t-w,L>=w)return Xi(e,n,L,j)}}}}return[[Et,e],[pt,n]]}function Xi(e,n,t,r){var s=e.substring(0,t),i=n.substring(0,r),o=e.substring(t),a=n.substring(r),l=Zn(s,i),c=Zn(o,a);return l.concat(c)}function ti(e,n){if(!e||!n||e.charAt(0)!==n.charAt(0))return 0;for(var t=0,r=Math.min(e.length,n.length),s=r,i=0;t<s;)e.substring(i,s)==n.substring(i,s)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return ca(e.charCodeAt(s-1))&&s--,s}function Qi(e,n){var t=e.length,r=n.length;if(t==0||r==0)return 0;t>r?e=e.substring(t-r):t<r&&(n=n.substring(0,t));var s=Math.min(t,r);if(e==n)return s;for(var i=0,o=1;;){var a=e.substring(s-o),l=n.indexOf(a);if(l==-1)return i;o+=l,(l==0||e.substring(s-o)==n.substring(0,o))&&(i=o,o++)}}function Kr(e,n){if(!e||!n||e.slice(-1)!==n.slice(-1))return 0;for(var t=0,r=Math.min(e.length,n.length),s=r,i=0;t<s;)e.substring(e.length-s,e.length-i)==n.substring(n.length-s,n.length-i)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return ha(e.charCodeAt(e.length-s))&&s--,s}function kf(e,n){var t=e.length>n.length?e:n,r=e.length>n.length?n:e;if(t.length<4||r.length*2<t.length)return null;function s(f,p,E){for(var v=f.substring(E,E+Math.floor(f.length/4)),I=-1,M="",L,j,y,w;(I=p.indexOf(v,I+1))!==-1;){var x=ti(f.substring(E),p.substring(I)),B=Kr(f.substring(0,E),p.substring(0,I));M.length<B+x&&(M=p.substring(I-B,I)+p.substring(I,I+x),L=f.substring(0,E-B),j=f.substring(E+x),y=p.substring(0,I-B),w=p.substring(I+x))}return M.length*2>=f.length?[L,j,y,w,M]:null}var i=s(t,r,Math.ceil(t.length/4)),o=s(t,r,Math.ceil(t.length/2)),a;if(!i&&!o)return null;o?i?a=i[4].length>o[4].length?i:o:a=o:a=i;var l,c,h,u;e.length>n.length?(l=a[0],c=a[1],h=a[2],u=a[3]):(h=a[0],u=a[1],l=a[2],c=a[3]);var d=a[4];return[l,c,h,u,d]}function Ff(e){for(var n=!1,t=[],r=0,s=null,i=0,o=0,a=0,l=0,c=0;i<e.length;)e[i][0]==it?(t[r++]=i,o=l,a=c,l=0,c=0,s=e[i][1]):(e[i][0]==pt?l+=e[i][1].length:c+=e[i][1].length,s&&s.length<=Math.max(o,a)&&s.length<=Math.max(l,c)&&(e.splice(t[r-1],0,[Et,s]),e[t[r-1]+1][0]=pt,r--,r--,i=r>0?t[r-1]:-1,o=0,a=0,l=0,c=0,s=null,n=!0)),i++;for(n&&ni(e),Hf(e),i=1;i<e.length;){if(e[i-1][0]==Et&&e[i][0]==pt){var h=e[i-1][1],u=e[i][1],d=Qi(h,u),f=Qi(u,h);d>=f?(d>=h.length/2||d>=u.length/2)&&(e.splice(i,0,[it,u.substring(0,d)]),e[i-1][1]=h.substring(0,h.length-d),e[i+1][1]=u.substring(d),i++):(f>=h.length/2||f>=u.length/2)&&(e.splice(i,0,[it,h.substring(0,f)]),e[i-1][0]=pt,e[i-1][1]=u.substring(0,u.length-f),e[i+1][0]=Et,e[i+1][1]=h.substring(f),i++),i++}i++}}var Ji=/[^a-zA-Z0-9]/,Zi=/\s/,qi=/[\r\n]/,$f=/\n\r?\n$/,jf=/^\r?\n\r?\n/;function Hf(e){function n(f,p){if(!f||!p)return 6;var E=f.charAt(f.length-1),v=p.charAt(0),I=E.match(Ji),M=v.match(Ji),L=I&&E.match(Zi),j=M&&v.match(Zi),y=L&&E.match(qi),w=j&&v.match(qi),x=y&&f.match($f),B=w&&p.match(jf);return x||B?5:y||w?4:I&&!L&&j?3:L||j?2:I||M?1:0}for(var t=1;t<e.length-1;){if(e[t-1][0]==it&&e[t+1][0]==it){var r=e[t-1][1],s=e[t][1],i=e[t+1][1],o=Kr(r,s);if(o){var a=s.substring(s.length-o);r=r.substring(0,r.length-o),s=a+s.substring(0,s.length-o),i=a+i}for(var l=r,c=s,h=i,u=n(r,s)+n(s,i);s.charAt(0)===i.charAt(0);){r+=s.charAt(0),s=s.substring(1)+i.charAt(0),i=i.substring(1);var d=n(r,s)+n(s,i);d>=u&&(u=d,l=r,c=s,h=i)}e[t-1][1]!=l&&(l?e[t-1][1]=l:(e.splice(t-1,1),t--),e[t][1]=c,h?e[t+1][1]=h:(e.splice(t+1,1),t--))}t++}}function ni(e,n){e.push([it,""]);for(var t=0,r=0,s=0,i="",o="",a;t<e.length;){if(t<e.length-1&&!e[t][1]){e.splice(t,1);continue}switch(e[t][0]){case pt:s++,o+=e[t][1],t++;break;case Et:r++,i+=e[t][1],t++;break;case it:var l=t-s-r-1;if(n){if(l>=0&&fa(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),i=c+i,o=c+o,!e[l][1]){e.splice(l,1),t--;var h=l-1;e[h]&&e[h][0]===pt&&(s++,o=e[h][1]+o,h--),e[h]&&e[h][0]===Et&&(r++,i=e[h][1]+i,h--),l=h}}if(da(e[t][1])){var c=e[t][1].charAt(0);e[t][1]=e[t][1].slice(1),i+=c,o+=c}}if(t<e.length-1&&!e[t][1]){e.splice(t,1);break}if(i.length>0||o.length>0){i.length>0&&o.length>0&&(a=ti(o,i),a!==0&&(l>=0?e[l][1]+=o.substring(0,a):(e.splice(0,0,[it,o.substring(0,a)]),t++),o=o.substring(a),i=i.substring(a)),a=Kr(o,i),a!==0&&(e[t][1]=o.substring(o.length-a)+e[t][1],o=o.substring(0,o.length-a),i=i.substring(0,i.length-a)));var u=s+r;i.length===0&&o.length===0?(e.splice(t-u,u),t=t-u):i.length===0?(e.splice(t-u,u,[pt,o]),t=t-u+1):o.length===0?(e.splice(t-u,u,[Et,i]),t=t-u+1):(e.splice(t-u,u,[Et,i],[pt,o]),t=t-u+2)}t!==0&&e[t-1][0]===it?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,r=0,i="",o="";break}}e[e.length-1][1]===""&&e.pop();var d=!1;for(t=1;t<e.length-1;)e[t-1][0]===it&&e[t+1][0]===it&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)===e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),d=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),d=!0)),t++;d&&ni(e,n)}function ca(e){return e>=55296&&e<=56319}function ha(e){return e>=56320&&e<=57343}function da(e){return ha(e.charCodeAt(0))}function fa(e){return ca(e.charCodeAt(e.length-1))}function Bf(e){for(var n=[],t=0;t<e.length;t++)e[t][1].length>0&&n.push(e[t]);return n}function is(e,n,t,r){return fa(e)||da(r)?null:Bf([[it,e],[Et,n],[pt,t],[it,r]])}function Wf(e,n,t){var r=typeof t=="number"?{index:t,length:0}:t.oldRange,s=typeof t=="number"?null:t.newRange,i=e.length,o=n.length;if(r.length===0&&(s===null||s.length===0)){var a=r.index,l=e.slice(0,a),c=e.slice(a),h=s?s.index:null;e:{var u=a+o-i;if(h!==null&&h!==u||u<0||u>o)break e;var d=n.slice(0,u),f=n.slice(u);if(f!==c)break e;var p=Math.min(a,u),E=l.slice(0,p),v=d.slice(0,p);if(E!==v)break e;var I=l.slice(p),M=d.slice(p);return is(E,I,M,c)}e:{if(h!==null&&h!==a)break e;var L=a,d=n.slice(0,L),f=n.slice(L);if(d!==l)break e;var j=Math.min(i-L,o-L),y=c.slice(c.length-j),w=f.slice(f.length-j);if(y!==w)break e;var I=c.slice(0,c.length-j),M=f.slice(0,f.length-j);return is(l,I,M,y)}}if(r.length>0&&s&&s.length===0)e:{var E=e.slice(0,r.index),y=e.slice(r.index+r.length),p=E.length,j=y.length;if(o<p+j)break e;var v=n.slice(0,p),w=n.slice(o-j);if(E!==v||y!==w)break e;var I=e.slice(p,i-j),M=n.slice(p,o-j);return is(E,I,M,y)}return null}function Xr(e,n,t,r){return Zn(e,n,t,r,!0)}Xr.INSERT=pt;Xr.DELETE=Et;Xr.EQUAL=it;var Yf=Xr;const ga=yt(Yf);function or(e,n){const t=e.indexOf(n);return t>-1?(e.splice(t,1),!0):!1}function zf(e){const n=new Set,t=[];for(const r of e)n.has(r)||(n.add(r),t.push(r));return t}function Vf(e,n){for(let t=e.length-1;t>-1;t--){const r=e[t];if(n(r,t))return r}return null}function Gf(e,n){if(e.length===0)return e;const t=n%e.length;return e.slice(t).concat(e.slice(0,t))}function Kf(e,n){const t=new Map;return e.forEach(r=>{const s=n(r);let i=t.get(s);t.has(s)||(i=[],t.set(s,i)),i.push(r)}),t}function Xf(e){return Array.isArray(e)?e:[e]}function Qf(e){return["true","false"].includes(e.toLowerCase())}const ar="__INTERNAL_EDITOR__",ri=`${ar}DOCS_NORMAL`,si=`${ar}DOCS_FORMULA_BAR`,ma=`${ar}ZEN_EDITOR`,pa=`\r
2
+ `,Jf="isRowStylePrecedeColumnStyle";function Zf(e){return`${ar}${e}`}function _a(e){return e.startsWith(ar)}var ii=Symbol("$$IDENTIFIER_DECORATOR");function qf(e){return e&&e[ii]===!0}function oi(e){return typeof e=="function"}function Rs(e){return!!(e&&typeof e.useClass<"u")}function vs(e){return!!(e&&typeof e.useFactory<"u")}function Is(e){return!!(e&&typeof e.useValue<"u")}function eg(e){return!!(e&&typeof e.useExisting<"u")}function Ss(e){return!!(e&&typeof e.useAsync<"u")}var Ea=Symbol("AsyncHook");function Ar(e){return!!(e&&e.__symbol===Ea)}function Ct(e){return typeof e>"u"?"undefined":oi(e)&&!e[ii]?e.name:e.toString()}exports.Quantity=void 0;(function(e){e.MANY="many",e.OPTIONAL="optional",e.REQUIRED="required"})(exports.Quantity||(exports.Quantity={}));exports.LookUp=void 0;(function(e){e.SELF="self",e.SKIP_SELF="skipSelf"})(exports.LookUp||(exports.LookUp={}));var tg=function(){var e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),ot=function(e){tg(n,e);function n(t){return e.call(this,"[redi]: ".concat(t))||this}return n}(Error),Ca=function(){var e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),eo=Symbol("$$TARGET"),Os=Symbol("$$DEPENDENCIES"),ng=function(e){Ca(n,e);function n(t,r){var s="Could not find dependency registered on the ".concat(t,' (indexed) parameter of the constructor of "').concat(Ct(r),'".');return e.call(this,s)||this}return n}(ot),Ra=function(e){Ca(n,e);function n(t,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(Ct(t),'". Please make sure that there is not cyclic dependency among your TypeScript files, or consider using "forwardRef". For more info please visit our website https://redi.wendell.fun/docs/debug#could-not-find-dependency-registered-on');return e.call(this,s)||this}return n}(ot);function va(e){var n=e;return n[Os]||[]}function ai(e,n){var t=va(e),r=t.find(function(s){return s.paramIndex===n});if(!r)throw new ng(n,e);return r}function li(e,n,t,r,s){r===void 0&&(r=exports.Quantity.REQUIRED);var i={paramIndex:t,identifier:n,quantity:r,lookUp:s,withNew:!1};if(typeof n>"u")throw new Ra(e,t);var o=e;o[eo]===o?o[Os].push(i):(o[Os]=[i],o[eo]=o)}var to=new Set;function wt(e){if(to.has(e))throw new ot('Identifier "'.concat(e,'" already exists.'));to.add(e);var n=function(t,r,s){li(t,n,s)};return n.toString=function(){return e},n[ii]=!0,n}var rg=function(){var e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),sg=function(e){rg(n,e);function n(t,r,s){var i='Expect "'.concat(r,'" dependency items for id "').concat(Ct(t),'" but get ').concat(s,".");return e.call(this,i)||this}return n}(ot);function Ia(e,n,t){if(n===exports.Quantity.OPTIONAL&&t>1||n===exports.Quantity.REQUIRED&&t!==1)throw new sg(e,n,t)}function ig(e,n){return e===exports.Quantity.MANY?n:n[0]}function og(e,n,t){var r=ai(e,n);r.quantity=t}function ui(e){return function n(t){return this instanceof n?this:function(r,s,i){if(t)li(r,t,i,e);else{if(e===exports.Quantity.REQUIRED)throw new Ra(r,i);og(r,i,e)}}}}var Sa=ui(exports.Quantity.MANY),Oa=ui(exports.Quantity.OPTIONAL),Ot=ui(exports.Quantity.REQUIRED);function ag(e){return{unwrap:e}}function lg(e){return!!e&&typeof e.unwrap=="function"}function ug(e){return lg(e)?e.unwrap():e}function ys(e){return!!e&&typeof e.dispose=="function"}var ya=function(){var e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();function cg(e){return e.length===1}var Qr=[];function no(e){Qr.push(e)}function ro(){Qr.pop()}function hg(){Qr.length=0}var so=function(e){ya(n,e);function n(t,r,s){var i='Cannot find "'.concat(Ct(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(qf(t)?Ct(t):t.name,'".');return e.call(this,i)||this}return n}(ot),Tr=function(e){ya(n,e);function n(t){var r=this,s='Cannot find "'.concat(Ct(t),'" registered by any injector. The stack of dependencies is: "').concat(Qr.map(function(i){return Ct(i)}).join(" -> "),'".');return r=e.call(this,s)||this,hg(),r}return n}(ot),dg=function(){function e(n){var t=this;this.dependencyMap=new Map,this.normalizeDependencies(n).map(function(r){return t.add(r[0],r[1])})}return e.prototype.add=function(n,t){typeof t>"u"&&(t={useClass:n,lazy:!1});var r=this.dependencyMap.get(n);typeof r>"u"&&(r=[],this.dependencyMap.set(n,r)),r.push(t)},e.prototype.delete=function(n){this.dependencyMap.delete(n)},e.prototype.get=function(n,t){t===void 0&&(t=exports.Quantity.REQUIRED);var r=this.dependencyMap.get(n);return Ia(n,t,r.length),ig(t,r)},e.prototype.has=function(n){return this.dependencyMap.has(n)},e.prototype.append=function(n){var t=this;this.normalizeDependencies(n).forEach(function(r){return t.add(r[0],r[1])})},e.prototype.dispose=function(){this.dependencyMap.clear()},e.prototype.normalizeDependencies=function(n){return n.map(function(t){var r=t[0],s;return cg(t)?s={useClass:t[0],lazy:!1}:s=t[1],[r,s]})},e}(),fg=function(){function e(){this.resolvedDependencies=new Map}return e.prototype.add=function(n,t){var r=this.resolvedDependencies.get(n);typeof r>"u"&&(r=[],this.resolvedDependencies.set(n,r)),r.push(t)},e.prototype.has=function(n){return this.resolvedDependencies.has(n)},e.prototype.delete=function(n){if(this.resolvedDependencies.has(n)){var t=this.resolvedDependencies.get(n);t.forEach(function(r){return ys(r)?r.dispose():void 0}),this.resolvedDependencies.delete(n)}},e.prototype.get=function(n,t){t===void 0&&(t=exports.Quantity.REQUIRED);var r=this.resolvedDependencies.get(n);if(!r)throw new Tr(n);return Ia(n,t,r.length),t===exports.Quantity.MANY?r:r[0]},e.prototype.dispose=function(){Array.from(this.resolvedDependencies.values()).forEach(function(n){n.forEach(function(t){return ys(t)?t.dispose():void 0})}),this.resolvedDependencies.clear()},e}();function gg(e,n,t){var r=ai(e,n);r.lookUp=t}function wa(e){return function n(){return this instanceof n?this:function(t,r,s){gg(t,s,e)}}}var ba=wa(exports.LookUp.SKIP_SELF),Aa=wa(exports.LookUp.SELF);function mg(e,n,t){var r=ai(e,n);r.withNew=t}function pg(e){return function n(){return this instanceof n?this:function(t,r,s){mg(t,s,e)}}}var Ta=pg(!0);function Na(e,n){return n===void 0&&(n=0),e?e.map(function(t,r){if(r+=n,!Array.isArray(t))return{paramIndex:r,identifier:t,quantity:exports.Quantity.REQUIRED,withNew:!1};var s=t.slice(0,t.length-1),i=t[t.length-1],o=void 0,a=exports.Quantity.REQUIRED,l=!1;return s.forEach(function(c){if(c instanceof Aa)o=exports.LookUp.SELF;else if(c instanceof ba)o=exports.LookUp.SKIP_SELF;else if(c instanceof Oa)a=exports.Quantity.OPTIONAL;else if(c instanceof Sa)a=exports.Quantity.MANY;else if(c instanceof Ta)l=!0;else throw new ot("unknown dep modifier ".concat(c,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}var ws;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")ws=function(n,t){var r=requestIdleCallback(n,typeof t=="number"?{timeout:t}:void 0),s=!1;return function(){s||(s=!0,cancelIdleCallback(r))}};else{var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});ws=function(n){var t=setTimeout(function(){return n(e)}),r=!1;return function(){r||(r=!0,clearTimeout(t))}}}})();var _g=function(){function e(n){var t=this;this.didRun=!1,this.selfExecutor=function(){try{t.value=n()}catch(r){t.error=r}finally{t.didRun=!0}},this.disposeCallback=ws(function(){return t.selfExecutor()})}return e.prototype.hasRun=function(){return this.didRun},e.prototype.dispose=function(){this.disposeCallback()},e.prototype.getValue=function(){if(this.didRun||(this.dispose(),this.selfExecutor()),this.error)throw this.error;return this.value},e}(),Dn=function(){var e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Lr=function(){return Lr=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++){n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Lr.apply(this,arguments)},sn=function(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))},Eg=300,Un=Symbol("$$NOT_INSTANTIATED_SYMBOL"),Cg=function(e){Dn(n,e);function n(t){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(Ct(t),'".'))||this}return n}(ot),Rg=function(e){Dn(n,e);function n(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return n}(ot),vg=function(e){Dn(n,e);function n(t){return e.call(this,'Async item "'.concat(Ct(t),'" returns another async item.'))||this}return n}(ot),Ig=function(e){Dn(n,e);function n(t){return e.call(this,'Cannot get async item "'.concat(Ct(t),'" from sync api.'))||this}return n}(ot),io=function(e){Dn(n,e);function n(t){return e.call(this,'Cannot add dependency "'.concat(Ct(t),'" after it is already resolved.'))||this}return n}(ot),Sg=function(e){Dn(n,e);function n(t){return e.call(this,'Cannot dependency dependency "'.concat(Ct(t),'" after it is already resolved.'))||this}return n}(ot),Ft=function(){function e(n,t){t===void 0&&(t=null),this.parent=t,this.children=[],this.resolutionOngoing=0,this.disposed=!1,this.dependencyCollection=new dg(n||[]),this.resolvedDependencyCollection=new fg,t&&t.children.push(this)}return e.prototype.createChild=function(n){return this._ensureInjectorNotDisposed(),new e(n,this)},e.prototype.dispose=function(){this.children.forEach(function(n){return n.dispose()}),this.children.length=0,this.dependencyCollection.dispose(),this.resolvedDependencyCollection.dispose(),this.deleteSelfFromParent(),this.disposed=!0},e.prototype.deleteSelfFromParent=function(){if(this.parent){var n=this.parent.children.indexOf(this);n>-1&&this.parent.children.splice(n,1)}},e.prototype.add=function(n){this._ensureInjectorNotDisposed();var t=n[0],r=n[1];if(this.resolvedDependencyCollection.has(t))throw new io(t);typeof r>"u"?this.dependencyCollection.add(t):Ss(r)||Rs(r)||Is(r)||vs(r)?this.dependencyCollection.add(t,r):this.resolvedDependencyCollection.add(t,r)},e.prototype.replace=function(n){this._ensureInjectorNotDisposed();var t=n[0];if(this.resolvedDependencyCollection.has(t))throw new io(t);this.dependencyCollection.delete(t),n.length===1?this.dependencyCollection.add(t):this.dependencyCollection.add(t,n[1])},e.prototype.delete=function(n){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(n))throw new Sg(n);this.dependencyCollection.delete(n)},e.prototype.invoke=function(n){for(var t=this,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];this._ensureInjectorNotDisposed();var i={get:function(o,a,l){return t._get(o,a,l)},has:function(o){return t.has(o)}};return n.apply(void 0,sn([i],r,!1))},e.prototype.has=function(n){var t;return this.dependencyCollection.has(n)||((t=this.parent)===null||t===void 0?void 0:t.has(n))||!1},e.prototype.get=function(n,t,r){this._ensureInjectorNotDisposed();var s=this._get(n,t,r);if(Array.isArray(s)&&s.some(function(i){return Ar(i)})||Ar(s))throw new Ig(n);return s},e.prototype._get=function(n,t,r,s){var i=exports.Quantity.REQUIRED;if(t===exports.Quantity.REQUIRED||t===exports.Quantity.OPTIONAL||t===exports.Quantity.MANY?i=t:r=t,!s){var o=this.getValue(n,i,r);if(o!==Un)return o}return this.createDependency(n,i,r,!s)},e.prototype.getAsync=function(n){this._ensureInjectorNotDisposed();var t=this.getValue(n,exports.Quantity.REQUIRED);if(t!==Un)return Promise.resolve(t);var r=this.createDependency(n,exports.Quantity.REQUIRED);return Ar(r)?r.whenReady():Promise.resolve(r)},e.prototype.createInstance=function(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return this._ensureInjectorNotDisposed(),this._resolveClassImpl.apply(this,sn([{useClass:n}],t,!1))},e.prototype._resolveDependency=function(n,t,r){r===void 0&&(r=!0);var s;no(n);try{Is(t)?s=this._resolveValueDependency(n,t):vs(t)?s=this._resolveFactory(n,t,r):Rs(t)?s=this._resolveClass(n,t,r):eg(t)?s=this._resolveExisting(n,t):s=this._resolveAsync(n,t),ro()}catch(i){throw ro(),i}return s},e.prototype._resolveExisting=function(n,t){var r=this.get(t.useExisting);return this.resolvedDependencyCollection.add(n,r),r},e.prototype._resolveValueDependency=function(n,t){var r=t.useValue;return this.resolvedDependencyCollection.add(n,r),r},e.prototype._resolveClass=function(n,t,r){var s=this;r===void 0&&(r=!0);var i;if(t.lazy){var o=new _g(function(){return s._ensureInjectorNotDisposed(),s._resolveClassImpl(t)});i=new Proxy(Object.create(null),{get:function(a,l){if(l in a)return a[l];if(l!=="whenReady"){var c=o.getValue(),h=c[l];return typeof h!="function"||(h=h.bind(c),a[l]=h),h}},set:function(a,l,c){return o.getValue()[l]=c,!0}})}else i=this._resolveClassImpl(t);return n&&r&&this.resolvedDependencyCollection.add(n,i),i},e.prototype._resolveClassImpl=function(n){for(var t,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var i=n.useClass;this.markNewResolution(i);for(var o=va(i).sort(function(v,I){return v.paramIndex-I.paramIndex}).map(function(v){return Lr(Lr({},v),{identifier:ug(v.identifier)})}),a=[],l=0,c=o;l<c.length;l++){var h=c[l];try{var u=this._get(h.identifier,h.quantity,h.lookUp,h.withNew);a.push(u)}catch(v){throw v instanceof Tr?new so(i,h.identifier,h.paramIndex):v}}var d=sn([],r,!0),f=o.length>0?o[0].paramIndex:d.length;if(d.length!==f){console.warn("[redi]: Expect ".concat(f," custom parameter(s) of ").concat(Ct(i)," but get ").concat(d.length,"."));var p=f-d.length;p>0?d=sn(sn([],d,!0),new Array(p).fill(void 0),!0):d=d.slice(0,f)}var E=new(i.bind.apply(i,sn(sn([void 0],d,!1),a,!1)));return(t=n==null?void 0:n.onInstantiation)===null||t===void 0||t.call(n,E),this.markResolutionCompleted(),E},e.prototype._resolveFactory=function(n,t,r){var s;this.markNewResolution(n);for(var i=Na(t.deps),o=[],a=0,l=i;a<l.length;a++){var c=l[a];try{var h=this._get(c.identifier,c.quantity,c.lookUp,c.withNew);o.push(h)}catch(d){throw d instanceof Tr?new so(n,c.identifier,c.paramIndex):d}}var u=t.useFactory.apply(null,o);return r&&this.resolvedDependencyCollection.add(n,u),this.markResolutionCompleted(),(s=t==null?void 0:t.onInstantiation)===null||s===void 0||s.call(t,u),u},e.prototype._resolveAsync=function(n,t){var r=this,s={__symbol:Ea,whenReady:function(){return r._resolveAsyncImpl(n,t)}};return s},e.prototype._resolveAsyncImpl=function(n,t){var r=this;return t.useAsync().then(function(s){var i=r.getValue(n);if(i!==Un)return i;var o;if(Array.isArray(s)){var a=s[1];if(Ss(a))throw new vg(n);o=r._resolveDependency(n,a)}else oi(s)?o=r._resolveClassImpl({useClass:s,onInstantiation:t.onInstantiation}):o=s;return r.resolvedDependencyCollection.add(n,o),o})},e.prototype.getValue=function(n,t,r){var s=this;t===void 0&&(t=exports.Quantity.REQUIRED);var i=function(){return s.dependencyCollection.has(n)&&!s.resolvedDependencyCollection.has(n)?Un:s.resolvedDependencyCollection.get(n,t)},o=function(){return s.parent?s.parent.getValue(n,t):Un};return r===exports.LookUp.SKIP_SELF?o():r===exports.LookUp.SELF||this.resolvedDependencyCollection.has(n)||this.dependencyCollection.has(n)?i():o()},e.prototype.createDependency=function(n,t,r,s){var i=this;t===void 0&&(t=exports.Quantity.REQUIRED),s===void 0&&(s=!0);var o=function(){var l=i.dependencyCollection.get(n,t),c=null;return Array.isArray(l)?c=l.map(function(h){return i._resolveDependency(n,h,s)}):l&&(c=i._resolveDependency(n,l,s)),c},a=function(){if(i.parent)return i.parent.createDependency(n,t,void 0,s);if(t===exports.Quantity.OPTIONAL)return null;throw no(n),new Tr(n)};return r===exports.LookUp.SKIP_SELF?a():n===e?this:this.dependencyCollection.has(n)?o():a()},e.prototype.markNewResolution=function(n){if(this.resolutionOngoing+=1,this.resolutionOngoing>=Eg)throw new Cg(n)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new Rg},e}();function Og(e,n,t){t===void 0&&(t=0);var r=Na(n,t);r.forEach(function(s){li(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}var oo=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,ao="REDI_GLOBAL_LOCK",yg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;oo[ao]?yg||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
3
3
  Maybe your dependencies added redi as its dependency and bundled redi to its dist files. Or you import different versions of redi.
4
- For more info please visit our website: https://redi.wendell.fun/en-US/docs/debug#import-scripts-of-redi-more-than-once`):so[io]=!0;var oo="REDI_CONTEXT_LOCK",gg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,ao=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global;ao[oo]?gg||console.error(`[redi]: "RediContext" is already created. You may import "RediContext" from different paths. Use "import { RediContext } from '@wendellhu/redi/react-bindings'; instead."`):ao[oo]=!0;var rr=It.createContext({injector:null});rr.displayName="RediContext";var ci=rr.Provider,Na=rr.Consumer,pg=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mg=function(e){pg(t,e);function t(){return e.call(this,"Using dependency injection outside of a RediContext.")||this}return t}(Qe);function Ta(){var e=It.useContext(rr);if(!e.injector)throw new mg;return e.injector}function _g(e,t,n){var r=Ta();return It.useMemo(function(){return r.get(e,t,n)},[e,t,n])}var Tr=function(){return Tr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Tr.apply(this,arguments)};function Eg(e){var t=e.children,n=e.dependencies,r=It.useRef(null);return It.useEffect(function(){return function(){var s;return(s=r.current)===null||s===void 0?void 0:s.dispose()}},[]),It.createElement(Na,null,function(s){var i;return r.current?i=r.current:(i=s.injector?s.injector.createChild(n):new Nt(n),r.current=i),It.createElement(ci,{value:{injector:i}},t)})}function Rg(e,t){return function(r){return It.createElement(ci,{value:{injector:t}},It.createElement(e,Tr({},r)))}}function Cg(e,t){return function(r){return It.createElement(Eg,{dependencies:t},It.createElement(e,Tr({},r)))}}var Ig=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vg=function(e){Ig(t,e);function t(n){return e.call(this,'You should make "RediContext" as '.concat(n.constructor.name,"'s default context type. ")+"If you want to use multiple context, please check this on React doc site. https://reactjs.org/docs/context.html#classcontexttype")||this}return t}(Qe);function Sg(e,t,n){return function(){return{get:function(){var r=this,s=r.context;if(!s||!s.injector)throw new vg(r);var i=s.injector,o=i.get(e,t||exports.Quantity.REQUIRED,n);return o}}}}var Og=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))};function Ma(e,t){var n=e instanceof le.BehaviorSubject&&typeof t>"u"?e.getValue():t,r=Ze.useState(n),s=r[0],i=r[1];return Ze.useEffect(function(){var o=e.subscribe(function(a){return i(a)});return function(){return o.unsubscribe()}},[e]),s}function lo(e){return typeof e=="function"?e():e}function bg(e,t,n,r){if(typeof e=="function"&&!r)throw new Qe("Expected deps to be provided when observable is a function!");var s=Ze.useRef(null),i=Ze.useRef(!1),o=Ze.useMemo(function(){return e},Og([],typeof r<"u"?r:[e],!0)),a=Ze.useState(0);a[0];var l=a[1],c=Ze.useRef(function(){var u;if(o){var h=lo(o).subscribe(function(d){i.current=!0,u=d});h.unsubscribe()}return u!=null?u:t}());if(Ze.useEffect(function(){var u=null;return o&&(s.current=lo(o),u=s.current.subscribe(function(h){c.current=h,l(function(d){return d+1})})),function(){return u==null?void 0:u.unsubscribe()}},[o]),n&&!i.current)throw new Error("Expect `shouldHaveSyncValue` but not getting a sync value!");return c.current}function yg(e){var t=Ze.useState(0),n=t[1];Ze.useEffect(function(){var r=e.subscribe(function(){return n(function(s){return s+1})});return function(){return r.unsubscribe()}},[])}var bs=new WeakMap;function wg(e,t){var n=Ze.useRef(void 0),r=Ma(e,t),s=Ze.useMemo(function(){return Ze.createContext(r)},[e]),i=Ze.useCallback(function(o){return Ze.createElement(s.Provider,{value:r},o.children)},[e,r]);return n.current!==e&&(n.current&&bs.delete(n.current),n.current=e,bs.set(e,s)),{Provider:i,value:r}}function Ag(e){var t=bs.get(e);if(!t)throw new Qe("try to read context value but no ancestor component subscribed it.");return Ze.useContext(t)}function Ng(e,t){t.forEach(n=>e.add(n))}function La(e,t){t.forEach(([n])=>{e.has(n)&&e.get(n)})}function Da(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let i=0;i<n.length;i++){const o=n[i];if(!s(o))return!1;const a=e[o],l=t[o];if(a!==l)return!1}return!0}class ys extends Error{constructor(t){super(t),this.name="CustomCommandExecutionError"}}function Tg(e,t=16){let n=0,r=null;return function(...i){const o=Date.now();o-n<t?(r&&clearTimeout(r),r=setTimeout(()=>{n=o,e.apply(this,i)},t)):(n=o,e.apply(this,i))}}var gn=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(gn||{});function Mg(e){return`sheet_interceptor_${e}`}const xa=e=>function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=o.handler(s,n,l=>(a=!0,l)),!a)break}return s};class Lg{constructor(t){R(this,"_interceptorsByName",new Map);R(this,"_interceptorPoints");this._interceptorPoints=t}fetchThroughInterceptors(t){const n=t,r=this._interceptorsByName.get(n);return xa(r||[])}intercept(t,n){const r=t;this._interceptorsByName.has(r)||this._interceptorsByName.set(r,[]);const s=this._interceptorsByName.get(r);return s.push(n),this._interceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>tr(this._interceptorsByName.get(r),n)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function Dg(e){return`sheet_async_interceptor_${e}`}const xg=e=>async function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=await o.handler(s,n,async l=>(a=!0,l)),!a)break}return s};class Ug{constructor(t){R(this,"_asyncInterceptorsByName",new Map);R(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=t}fetchThroughAsyncInterceptors(t){const n=t,r=this._asyncInterceptorsByName.get(n);return xg(r||[])}async interceptAsync(t,n){const r=t;this._asyncInterceptorsByName.has(r)||this._asyncInterceptorsByName.set(r,[]);const s=this._asyncInterceptorsByName.get(r);return s.push(n),this._asyncInterceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>tr(this._asyncInterceptorsByName.get(r),n)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}class yn{constructor(){R(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(t){this.cursor+=t}moveCursorTo(t){this.cursor=t}}function Pg(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}const Vn=class Vn{constructor(){const t=this;Vn._constructorQueue.forEach(function(n){n.apply(t)})}_initialize(){}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n==="_initialize"?Vn._constructorQueue.push(t.prototype._initialize):n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}};R(Vn,"_constructorQueue",[]);let Yn=Vn;async function Ua(e){for(const[t,n]of e.entries())try{if(!await n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function Pa(e){for(const[t,n]of e.entries())try{if(!n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function co(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function uo(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,i=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i}function ho(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function $n(e){return typeof e=="function"}function Fg(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var ss=Fg(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
5
- `+n.map(function(r,s){return s+1+") "+r.toString()}).join(`
6
- `):"",this.name="UnsubscriptionError",this.errors=n}});function fo(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Fa=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,s,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=co(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(C){t={error:C}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if($n(u))try{u()}catch(C){i=C instanceof ss?C.errors:[C]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var d=co(h),f=d.next();!f.done;f=d.next()){var _=f.value;try{go(_)}catch(C){i=i!=null?i:[],C instanceof ss?i=ho(ho([],uo(i)),uo(C.errors)):i.push(C)}}}catch(C){r={error:C}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(r)throw r.error}}}if(i)throw new ss(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)go(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&fo(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&fo(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();Fa.EMPTY;function kg(e){return e instanceof Fa||e&&"closed"in e&&$n(e.remove)&&$n(e.add)&&$n(e.unsubscribe)}function go(e){$n(e)?e():e.unsubscribe()}function $e(e){let t=!1;return e?kg(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:$e(()=>{})}function jg(e){return $e(()=>{e.unsubscribe()})}class ui{constructor(){R(this,"_disposables",new Set)}add(t){const n=$e(t);return this._disposables.add(n),{dispose:()=>{n.dispose(),this._disposables.delete(n)}}}dispose(){this._disposables.forEach(t=>{t.dispose()}),this._disposables.clear()}}class Ge{constructor(){R(this,"_disposed",!1);R(this,"_collection",new ui)}disposeWithMe(t){return this._collection.add(t)}ensureNotDisposed(){if(this._disposed)throw new Error("[Disposable]: object is disposed!")}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class Hg extends Ge{constructor(){super(...arguments);R(this,"dispose$",new le.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class Bg extends Ge{constructor(n){super();R(this,"_ref",0);this._rootDisposable=n}inc(){if(this._disposed)throw new Error("[RCDisposable]: should not ref to a disposed.");this._ref+=1}dec(){this._ref-=1,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}}const sr=_t("univer.context-service");class ka extends Ge{constructor(){super(...arguments);R(this,"_contextChanged$",new le.Subject);R(this,"contextChanged$",this._contextChanged$.asObservable());R(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(n){var r;return(r=this._contextMap.get(n))!=null?r:!1}setContextValue(n,r){this._contextMap.set(n,r),this._contextChanged$.next({[n]:r})}subscribeContextValue$(n){return new le.Observable(r=>{const s=this._contextChanged$.pipe(le.filter(i=>typeof i[n]<"u")).subscribe(i=>r.next(i[n]));return this._contextMap.has(n)&&r.next(this._contextMap.get(n)),()=>s.unsubscribe()})}}var ja=(e=>(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))(ja||{});const vt=_t("univer.log");class Ha extends Ge{constructor(){super(...arguments);R(this,"_logLevel",3)}debug(...n){this._logLevel>=4&&this._log(console.debug,...n)}log(...n){this._logLevel>=3&&this._log(console.log,...n)}warn(...n){this._logLevel>=2&&this._log(console.warn,...n)}error(...n){this._logLevel>=1&&this._log(console.error,...n)}setLogLevel(n){this._logLevel=n}_log(n,...r){const s=r[0];/^\[(.*?)\]/g.test(s)?n(`\x1B[97;104m${s}\x1B[0m`,...r.slice(1)):n(...r)}}var $g=Object.defineProperty,Wg=Object.getOwnPropertyDescriptor,Vg=(e,t,n,r)=>{for(var s=r>1?void 0:r?Wg(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&$g(t,n,s),s},po=(e,t)=>(n,r)=>t(n,r,e),ir=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(ir||{});const yt=_t("anywhere.command-service");class zg{constructor(){R(this,"_commands",new Map);R(this,"_commandTypes",new Map)}registerCommand(t){if(this._commands.has(t.id))throw new Error(`[CommandRegistry]: command "${t.id}" has been registered before.`);return this._commands.set(t.id,t),this._commandTypes.set(t.id,t.type),$e(()=>{this._commands.delete(t.id),this._commandTypes.delete(t.id)})}hasCommand(t){return this._commands.has(t)}getCommand(t){return this._commands.has(t)?[this._commands.get(t)]:null}getCommandType(t){return this._commandTypes.get(t)}}const Ba={id:"nil",type:0,handler:()=>!0};exports.CommandService=class extends Ge{constructor(n,r){super();R(this,"_commandRegistry");R(this,"_beforeCommandExecutionListeners",[]);R(this,"_commandExecutedListeners",[]);R(this,"_multiCommandDisposables",new Map);R(this,"_commandExecutingLevel",0);R(this,"_commandExecutionStack",[]);this._injector=n,this._logService=r,this._commandRegistry=new zg,this._registerCommand(Ba)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0}hasCommand(n){return this._commandRegistry.hasCommand(n)}registerCommand(n){return this._registerCommand(n)}registerMultipleCommand(n){return this._registerMultiCommand(n)}beforeCommandExecuted(n){if(this._beforeCommandExecutionListeners.indexOf(n)===-1)return this._beforeCommandExecutionListeners.push(n),$e(()=>{const r=this._beforeCommandExecutionListeners.indexOf(n);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(n){if(this._commandExecutedListeners.indexOf(n)===-1)return this._commandExecutedListeners.push(n),$e(()=>{const r=this._commandExecutedListeners.indexOf(n);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}async executeCommand(n,r,s){try{const i=this._commandRegistry.getCommand(n);if(i){const[o]=i,a={id:o.id,type:o.type,params:r},l=this._pushCommandExecutionStack(a);this._beforeCommandExecutionListeners.forEach(u=>u(a,s));const c=await this._execute(o,r,s);return this._commandExecutedListeners.forEach(u=>u(a,s)),l.dispose(),c}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(i){if(i instanceof ys)return!1;throw i}}syncExecuteCommand(n,r,s){var i;try{const o=this._commandRegistry.getCommand(n);if(o){const[a]=o,l={id:a.id,type:a.type,params:r};if(a.type===2){const h=xf(this._commandExecutionStack,d=>d.type===0);h&&(l.params=(i=l.params)!=null?i:{},l.params.trigger=h.id)}const c=this._pushCommandExecutionStack(l);this._beforeCommandExecutionListeners.forEach(h=>h(l,s));const u=this._syncExecute(a,r,s);return this._commandExecutedListeners.forEach(h=>h(l,s)),c.dispose(),u}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(o){if(o instanceof ys)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),$e(()=>tr(this._commandExecutionStack,n))}_registerCommand(n){return this._commandRegistry.registerCommand(n)}_registerMultiCommand(n){const r=this._commandRegistry.getCommand(n.id);let s;if(r){if(r[0].multi!==!0)throw new Error("Command has registered as a single command.");s=r[0]}else{const o=new ui;s=new Gg(n.id),o.add(this._commandRegistry.registerCommand(s)),o.add($e(()=>{this._multiCommandDisposables.delete(n.id)})),this._multiCommandDisposables.set(n.id,o)}const i=s.registerImplementation(n);return $e(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(n.id))==null||o.dispose()})}async _execute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${n.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(n.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${n.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(n.handler,r,s),i instanceof Promise)throw new TypeError("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}};exports.CommandService=Vg([po(0,mt(Nt)),po(1,vt)],exports.CommandService);class Gg{constructor(t){R(this,"name");R(this,"multi",!0);R(this,"type",0);R(this,"priority",0);R(this,"_implementations",[]);R(this,"handler",async(t,n)=>{if(!this._implementations.length)return!1;const r=t.get(vt),s=t.get(sr),i=t.get(Nt);for(const o of this._implementations){const a=o.command.preconditions;if((!a||a&&a(s))&&(r.debug("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,n)))return!0}return!1});this.id=t,this.name=t}registerImplementation(t){const n={command:t};return this._implementations.push(n),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),$e(()=>{const r=this._implementations.indexOf(n);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function hi(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return Pa(r)}function Kg(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return Ua(r)}function $a(e){return new le.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function Wa(e){return function(n){return new le.Observable(r=>(n.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function Yg(e=0){return t=>{let n=[];return t.pipe(le.tap(r=>n.push(r)),le.debounceTime(e),le.map(()=>n),le.tap(()=>n=[]))}}function Xg(e){const t=new le.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(le.take(1))}const Qg=e=>new Promise(t=>{le.merge($a(e.onCommandExecuted.bind(e)).pipe(Sr.filter(([n])=>n.type===ir.MUTATION)),le.timer(300)).pipe(Sr.debounceTime(16),Sr.first()).subscribe(()=>{t()})});function Va(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 Jg(e,t){let n=0,r=e.length-1;for(;n<=r;){const s=Math.floor((r+n)/2);if(t<e[s]&&(s===0||t>=e[s-1]))return s;if(t>=e[s])n=s+1;else if(t<e[s])r=s-1;else return-1}return-1}function za(e,t){let n=0,r=e.length;for(;n<r;){const s=Math.floor((n+r)/2);e[s]<=t?n=s+1:r=s}return n<e.length?n:e.length-1}function Zg(e,t,n=!1){let r=e.length-1;if(t<0||t<e[0])return 0;if(e.length<40||t<=e[20]||t>=e[r-20]?r=Va(e,t):r=za(e,t),n){const s=e[r];return e.indexOf(s)}return r}function qg(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const xn=2,Ga=1;function ep(e,t){if(t==null||e==null)return!0;const{left:n=0,top:r=0,height:s=0,width:i=0,angle:o=0}=t,{left:a=0,top:l=0,height:c=0,width:u=0,angle:h=0}=e,d=u,f=c,_=i,C=s;return Math.abs(a-n)>xn||Math.abs(l-r)>xn||Math.abs(d-_)>xn||Math.abs(f-C)>xn||Math.abs(h-o)>Ga}var Ka=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(Ka||{}),ke=(e=>(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))(ke||{}),Ya=(e=>(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))(Ya||{}),gt=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(gt||{}),Xa=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(Xa||{}),Qa=(e=>(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))(Qa||{}),Ja=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(Ja||{}),Za=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(Za||{}),qa=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(qa||{}),el=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(el||{});function tp(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var tl=(e=>(e[e.NUMBER_FORMAT_TYPE_UNSPECIFIED=0]="NUMBER_FORMAT_TYPE_UNSPECIFIED",e[e.TEXT=1]="TEXT",e[e.NUMBER=2]="NUMBER",e[e.PERCENT=3]="PERCENT",e[e.CURRENCY=4]="CURRENCY",e[e.DATE=5]="DATE",e[e.TIME=6]="TIME",e[e.DATE_TIME=7]="DATE_TIME",e[e.SCIENTIFIC=8]="SCIENTIFIC",e))(tl||{}),nl=(e=>(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))(nl||{}),or=(e=>(e.EN_US="enUS",e.ZH_CN="zhCN",e.RU_RU="ruRU",e.ZH_TW="zhTW",e.VI_VN="viVN",e.FA_IR="faIR",e))(or||{}),rl=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(rl||{}),sl=(e=>(e.Line="line",e.LineInv="lineInv",e.Triangle="triangle",e.RtTriangle="rtTriangle",e.Rect="rect",e.Diamond="diamond",e.Parallelogram="parallelogram",e.Trapezoid="trapezoid",e.NonIsocelesTrapezoid="nonIsocelesTrapezoid",e.Pentagon="pentagon",e.Hexagon="hexagon",e.Heptagon="heptagon",e.Octagon="octagon",e.Decagon="decagon",e.Dodecagon="dodecagon",e.Star4="star4",e.Star5="star5",e.Star6="star6",e.Star7="star7",e.Star8="star8",e.Star10="star10",e.Star12="star12",e.Star16="star16",e.Star24="star24",e.Star32="star32",e.RoundRect="roundRect",e.Round1Rect="round1Rect",e.Round2SameRect="round2SameRect",e.Round2DiagRect="round2DiagRect",e.Ellipse="ellipse",e))(sl||{}),il=(e=>(e.RightArrow="rightArrow",e.LeftArrow="leftArrow",e.UpArrow="upArrow",e.DownArrow="downArrow",e.LeftRightArrow="leftRightArrow",e.UpDownArrow="upDownArrow",e.QuadArrow="quadArrow",e.LeftRightUpArrow="leftRightUpArrow",e.BentArrow="bentArrow",e.UturnArrow="uturnArrow",e.CircularArrow="circularArrow",e.NotchedRightArrow="notchedRightArrow",e.HomePlate="homePlate",e.Chevron="chevron",e.LeftCircularArrow="leftCircularArrow",e.LeftRightCircularArrow="leftRightCircularArrow",e))(il||{}),ol=(e=>(e.Plaque="plaque",e.Can="can",e.Cube="cube",e.Bevel="bevel",e.Donut="donut",e.NoSmoking="noSmoking",e.BlockArc="blockArc",e.FoldedCorner="foldedCorner",e))(ol||{}),al=(e=>(e.SmileyFace="smileyFace",e.Heart="heart",e.LightningBolt="lightningBolt",e.Sun="sun",e.Moon="moon",e.Cloud="cloud",e.Arc="arc",e.Backpack="backpack",e.Frame="frame",e.HalfFrame="halfFrame",e.Corner="corner",e.Chord="chord",e.Pie="pie",e.Teardrop="teardrop",e.WedgeRectCallout="wedgeRectCallout",e.WedgeRRectCallout="wedgeRRectCallout",e.WedgeEllipseCallout="wedgeEllipseCallout",e.CloudCallout="cloudCallout",e.BorderCallout1="borderCallout1",e.BorderCallout2="borderCallout2",e.BorderCallout3="borderCallout3",e.AccentCallout1="accentCallout1",e.AccentCallout2="accentCallout2",e.AccentCallout3="accentCallout3",e.Callout1="callout1",e.Callout2="callout2",e.Callout3="callout3",e.ActionButtonBackPrevious="actionButtonBackPrevious",e.ActionButtonEnd="actionButtonEnd",e.ActionButtonForwardNext="actionButtonForwardNext",e.ActionButtonHelp="actionButtonHelp",e.ActionButtonHome="actionButtonHome",e.ActionButtonInformation="actionButtonInformation",e.ActionButtonMovie="actionButtonMovie",e.ActionButtonReturn="actionButtonReturn",e.ActionButtonSound="actionButtonSound",e))(al||{}),ll=(e=>(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))(ll||{}),cl=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(cl||{}),Xn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",e[e.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",e))(Xn||{}),ul=(e=>(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))(ul||{}),Ht=(e=>(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))(Ht||{}),Zt=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(Zt||{}),en=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(en||{}),Mr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(Mr||{}),Lr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(Lr||{}),xt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(xt||{}),Re=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(Re||{}),$t=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))($t||{}),it=(e=>(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))(it||{}),Kr=(e=>(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))(Kr||{});const np="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let rp=e=>crypto.getRandomValues(new Uint8Array(e)),sp=(e,t,n)=>{let r=(2<<Math.log2(e.length-1))-1,s=-~(1.6*r*t/e.length);return(i=t)=>{let o="";for(;;){let a=n(s),l=s;for(;l--;)if(o+=e[a[l]&r]||"",o.length===i)return o}}},ip=(e,t=21)=>sp(e,t,rp),op=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=np[n[e]&63];return t};const ap=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"]),lp=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[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 cp(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(lp.test(e)){if(hl(e))return!0;try{const r=new URL(dl(e)).hostname.split(".").pop();if(r&&ap.has(r))return!0}catch{return!1}}return!1}function hl(e){return/^[a-zA-Z]+:\/\//.test(e)}function up(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function dl(e){return hl(e)?e:up(e)?`mailto://${e}`:`https://${e}`}const hp=/^-ms-/,dp=/-([a-z])/g,kt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];function di(e,t){const n=$.getValueType(e),r=$.getValueType(t);return n!==r?!1:$.isArray(e)?fp(e,t):$.isObject(e)?gp(e,t):$.isDate(e)?e.getTime()===t.getTime():$.isRegExp(e)?e.toString()===t.toString():e===t}function fp(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++){const s=e[n],i=t[n];if(!di(s,i))return!1}return!0}function gp(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){if(!r.includes(s))return!1;const i=e[s],o=t[s];if(!di(i,o))return!1}return!0}class ${static stringAt(t){let n="",r=t;for(;r>=kt.length;)r/=kt.length,r-=1,n+=kt[r%kt.length];const s=t%kt.length;return n+=kt[s],n}static indexAt(t){let n=0;for(let r=0;r<t.length-1;r+=1){const s=t.charCodeAt(r)-65,i=t.length-1-r;n+=kt.length**i+kt.length*s}return n+=t.charCodeAt(t.length-1)-65,n}static deleteBlank(t){return $.isString(t)?t.replace(/\s/g,""):t}static getSystemType(){const t=navigator.userAgent,n=navigator.platform==="Win32"||navigator.platform==="Windows",r=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(r)return"Mac";if(navigator.platform==="X11"&&!n&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(n){if(t.indexOf("Windows NT 5.0")>-1||t.indexOf("Windows 2000")>-1)return"Windows 2000";if(t.indexOf("Windows NT 5.1")>-1||t.indexOf("Windows XP")>-1)return"Windows XP";if(t.indexOf("Windows NT 5.2")>-1||t.indexOf("Windows 2003")>-1)return"Windows 2003";if(t.indexOf("Windows NT 6.0")>-1||t.indexOf("Windows Vista")>-1)return"Windows Vista";if(t.indexOf("Windows NT 6.1")>-1||t.indexOf("Windows 7")>-1)return"Windows 7";if(t.indexOf("Windows NT 10")>-1||t.indexOf("Windows 10")>-1)return"Windows 10";if(t.indexOf("Windows NT 11")>-1||t.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const t=navigator.userAgent,n=t.indexOf("Opera")>-1,r=t.indexOf("compatible")>-1&&t.indexOf("MSIE")>-1&&!n,s=t.indexOf("Trident")>-1&&t.indexOf("rv:11.0")>-1,i=t.indexOf("Edge")>-1,o=t.indexOf("Firefox")>-1,a=t.indexOf("Safari")>-1&&t.indexOf("Chrome")===-1,l=t.indexOf("Chrome")>-1&&t.indexOf("Safari")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(t);const u=Number.parseFloat(RegExp.$1);return u===7?"IE7":u===8?"IE8":u===9?"IE9":u===10?"IE10":"0"}return o?"FF":n?"Opera":a?"Safari":l?"Chrome":i?"Edge":s?"IE11":"Unknown browser"}static generateRandomId(t=21,n){return tn(t,n)}static getClassName(t){return t.constructor.name}static deepMerge(t,...n){n.forEach(o=>o&&i(o));function r(o,a){o.forEach((l,c)=>{var u,h;if($.isArray(l)){const d=(u=a[c])!=null?u:[];a[c]=d,r(l,d);return}if($.isObject(l)){const d=(h=a[c])!=null?h:{};a[c]=d,s(l,d);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var u,h;const c=o[l];if($.isObject(c)){const d=(u=a[l])!=null?u:{};a[l]=d,s(c,d);return}if($.isArray(c)){const d=(h=a[l])!=null?h:[];a[l]=d,r(c,d);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,u;const l=o[a];if($.isArray(l)){const h=(c=t[a])!=null?c:[];t[a]=h,r(l,h);return}if($.isObject(l)){const h=(u=t[a])!=null?u:{};t[a]=h,s(l,h);return}t[a]=l})}return t}static numberFixed(t,n){return Number(Number(t).toFixed(n))}static diffValue(t,n){return di(t,n)}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)){const n=[];return t.forEach((r,s)=>{n[s]=$.deepClone(r)}),n}if(this.isObject(t)){const n={};return Object.keys(t).forEach(r=>{const s=t[r];n[r]=$.deepClone(s)}),Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}return t}static getLanguage(){const t="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||t}static getValueType(t){return Object.prototype.toString.apply(t)}static isDefine(t){return t!=null}static isBlank(t){return this.isDefine(t)?this.isString(t)?t.trim()==="":!1:!0}static isBoolean(t){return this.getValueType(t)==="[object Boolean]"}static isPlainObject(t){return this.isDefine(t)?Object.getPrototypeOf(t)===Object.getPrototypeOf({}):!1}static isFunction(t){return this.getValueType(t)==="[object Function]"}static isDate(t){return this.getValueType(t)==="[object Date]"}static isRegExp(t){return this.getValueType(t)==="[object RegExp]"}static isArray(t){return this.getValueType(t)==="[object Array]"}static isString(t){return this.getValueType(t)==="[object String]"}static isNumber(t){return this.getValueType(t)==="[object Number]"}static isStringNumber(t){return!isNaN(Number.parseFloat(t))&&isFinite(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isEmptyObject(t){for(const n in t)return!1;return!0}static isMobile(){let t=0,n=0;return document.body.clientWidth&&(t=document.body.clientWidth),document.body.clientHeight&&(n=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||t<350&&n<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const t=navigator.userAgent.toLowerCase();return String(t.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const t=navigator.userAgent;return t.indexOf("Android")>-1||t.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(t){return cp(t)}static normalizeUrl(t){return dl(t)}static itCount(t){return n=>{for(let r=0;r<t;r++)n&&n()}}static hasLength(t,n){return $.isDefine(t)?$.isDefine(n)?t.length===n:t.length>0:!1}static capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}static fCamelCase(t,n){return n.toUpperCase()}static camelCase(t){return t.replace(hp,"ms-").replace(dp,this.fCamelCase)}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{const r=t[n];r==null?delete t[n]:$.removeNull(r)}),t}static fillTwoDimensionalArray(t,n,r){return new Array(t).fill(r).map(s=>new Array(n).fill(r))}static numToWord(t){let n="";for(;t>0;){let r=t%26;r=r===0?r=26:r,n=String.fromCharCode(96+r)+n,t=(t-r)/26}return n.toLocaleUpperCase()}static ABCatNum(t){if(t==null||t.length===0)return Number.NaN;const n=t.toLowerCase().split(""),r=n.length;let s=0,i=0;for(let o=0;o<r;o++)i=n[o].charCodeAt(0)-96,s+=i*26**(r-o-1);return s===0?Number.NaN:s-1}static chatAtABC(t){let i="";for(;t>=0;)i=String.fromCharCode(t%26+97)+i,t=Math.floor(t/26)-1;return i.toUpperCase()}static randSort(t){for(let n=0,r=t.length;n<r;n++){const s=Number.parseInt((Math.random()*r).toString()),i=t[s];t[s]=t[n],t[n]=i}return t}static commonExtend(t,n){const r={};for(const s in t)r[s]=t[s];for(const s in n)n[s]!=null&&(r[s]=n[s]);return r}static commonExtend1(t,n){for(const r in t)n[r]==null&&(n[r]=t[r]);return n}static arrayToObject(t){const n={};return t.forEach((r,s)=>{n[s]={},r.forEach((i,o)=>{n[s][o]=i})}),n}static hasIntersectionBetweenTwoRanges(t,n,r,s){return n>=r&&s>=t}static isStartValidPosition(t){return/^[A-Za-z_]/.test(t)}static isValidParameter(t){const n=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(t),r=t.length<=255;return!n&&r}static clamp(t,n,r){return Math.max(n,Math.min(r,t))}static now(){return performance&&performance.now?performance.now():Date.now()}}function tn(e=21,t){return t?ip(t,e)():op(e)}function ws(...e){const t={},n=e.length;for(let r=n-1;r>=0;r--){const s=e[r];if(s){const i=Object.keys(s);for(const o of i)t[o]===void 0&&(t[o]=s[o])}}return t}const pp=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function yr(e,t,n){const{dataStream:r,textRuns:s=[]}=e;let i=t;const o=[];for(const a of s){const{st:l,ed:c}=a;$.hasIntersectionBetweenTwoRanges(t,n,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(As(r,{...a,ed:Math.min(c,n)}))):o.push(As(r,{...a,st:i,ed:Math.min(c,n)}))),i=Math.max(t,Math.min(c,n))}return i!==n&&o.push(r.slice(i,n)),o.join("")}function mp(e,t=!0){var n;if(t&&((n=e.paragraphs)!=null&&n.length)){const{dataStream:r,paragraphs:s=[]}=e;let i="",o=-1;for(const a of s){const{startIndex:l,paragraphStyle:c={}}=a,{spaceAbove:u,spaceBelow:h,lineSpacing:d}=c,f=[];u!=null&&(typeof u=="number"?f.push(`margin-top: ${u}px`):f.push(`margin-top: ${u.v}px`)),h!=null&&(typeof h=="number"?f.push(`margin-bottom: ${h}px`):f.push(`margin-bottom: ${h.v}px`)),d!=null&&f.push(`line-height: ${d}`),l>o+1?i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}>${yr(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=yr(e,o,r.length)),i}else return yr(e,0,e.dataStream.length)}function As(e,t){const{st:n,ed:r,ts:s={}}=t,{ff:i,fs:o,it:a,bl:l,ul:c,st:u,ol:h,bg:d,cl:f,va:_}=s;let C=e.slice(n,r);const T=[];return a===Re.TRUE&&(C=`<i>${C}</i>`),_===xt.SUPERSCRIPT?C=`<sup>${C}</sup>`:_===xt.SUBSCRIPT&&(C=`<sub>${C}</sub>`),(c==null?void 0:c.s)===Re.TRUE&&(C=`<u>${C}</u>`),(u==null?void 0:u.s)===Re.TRUE&&(C=`<s>${C}</s>`),l===Re.TRUE&&(C=`<strong>${C}</strong>`),i&&T.push(`font-family: ${i}`),f&&T.push(`color: ${f.rgb}`),o&&T.push(`font-size: ${o}pt`),h&&T.push("text-decoration: overline"),d&&T.push(`background: ${d.rgb}`),T.length?`<span style="${T.join("; ")};">${C}</span>`:C}const fl={[Kr.OFFICE]:{[it.ACCENT1]:"#4472C4",[it.ACCENT2]:"#ED7D31",[it.ACCENT3]:"#A5A5A5",[it.ACCENT4]:"#70AD47",[it.ACCENT5]:"#5B9BD5",[it.ACCENT6]:"#70AD47",[it.DARK1]:"#000000",[it.DARK2]:"#44546A",[it.LIGHT1]:"#FFFFFF",[it.LIGHT2]:"#E7E6E6",[it.HYPERLINK]:"#0563C1",[it.FOLLOWED_HYPERLINK]:"#954F72"}};class Yr{constructor(){R(this,"_themeValue",it.LIGHT1);R(this,"_themeColors");R(this,"_themeTint");R(this,"_rgbValue","");R(this,"_colorType");this._colorType=gt.UNSUPPORTED,this._themeColors=Kr.OFFICE,this._themeTint=0}asRgbColor(){return new Dr(this._rgbValue,this)}asThemeColor(){return new xr(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case gt.THEME:return this.asThemeColor();case gt.RGB:return this.asRgbColor();case gt.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(t){return this._colorType=gt.RGB,this._rgbValue=t,this}setThemeColors(t){this._colorType=gt.THEME,this._themeColors=t}setThemeTint(t){this._colorType=gt.THEME,this._themeTint=t}setThemeColor(t){return this._colorType=gt.THEME,this._themeValue=t,this}getColorType(){return this._colorType}}class nn{constructor(t){R(this,"_builder");this._builder=t}static rgbColorToHexValue(t){return`#${((1<<24)+(t.getRed()<<16)+(t.getGreen()<<8)+t.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(t){t?t.indexOf("#")>-1&&(t=t.substring(1)):t="#000000";const n=+`0x${t[0]}${t[1]}`,r=+`0x${t[2]}${t[3]}`,s=+`0x${t[4]}${t[5]}`;return new Yr().setRgbColor(`rgb(${n},${r},${s})`).asRgbColor()}static hexToRgbString(t){const n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(n,(i,o,a,l)=>o+o+a+a+l+l);const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);let s=null;if(r){const i=Number.parseInt(r[1],16),o=Number.parseInt(r[2],16),a=Number.parseInt(r[3],16);s=`rgba(${i},${o},${a})`}return s}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new nn(this._builder)}equals(t){return!1}}class gl{constructor(t){R(this,"_saturation",0);R(this,"_hue",0);R(this,"_lightness",0);R(this,"_alpha",0);const n=t.getRed()/255,r=t.getGreen()/255,s=t.getBlue()/255,i=t.getAlpha()/255,o=Math.min(n,Math.min(r,s)),a=Math.max(n,Math.max(r,s)),l=a-o;if(a===o){this._hue=0,this._saturation=0,this._lightness=a;return}this._lightness=(o+a)/2,this._lightness<.5?this._saturation=l/(a+o):this._saturation=l/(2-a-o),n===a&&(this._hue=(r-s)/l),r===a&&(this._hue=2+(s-n)/l),s===a&&(this._hue=4+(n-r)/l),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const t=new Yr;if(this._saturation===0)return t.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),t.asRgbColor();let n;this._lightness<.5?n=this._lightness*(1+this._saturation):n=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-n,s=this._hue/360,i=s+1/3,o=this.setColor(n,r,i),a=this.setColor(n,r,s),l=s-1/3,c=this.setColor(n,r,l);return t.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(c*255)},${this._alpha*255})`),t.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(t,n,r){r<0&&(r+=1),r>1&&(r-=1);let s;return 6*r<1?s=n+(t-n)*6*r:2*r<1?s=t:3*r<2?s=n+(t-n)*(2/3-r)*6:s=n,s}setLightness(t){this._lightness=t}}const ft=class ft extends nn{constructor(n,r){super(r);R(this,"_cssString");R(this,"_red");R(this,"_green");R(this,"_blue");R(this,"_alpha");let s=n.match(ft.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=n.match(ft.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return nn.rgbColorToHexValue(this)}getRed(){let n=this._red+ft.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+ft.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+ft.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return gt.RGB}clone(){return new ft(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof ft?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};R(ft,"RGB_COLOR_AMT",0),R(ft,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),R(ft,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let Dr=ft;const jt=class jt extends nn{constructor(n,r,s,i){super(i);R(this,"_themeColorType");R(this,"_themeTint");R(this,"_themeColors");this._themeColorType=n,this._themeTint=r,this._themeColors=s}lumValue(n,r){if(n==null)return r;let s;return n<0?s=r*(1+n):s=r*(1-n)+(255-255*(1-n)),s}asRgbColor(){const n=fl[this._themeColors];if(n==null)throw new Error("not find themeColors type");const r=n[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(jt._cacheThemeColor.has(this._themeColors)){if(s=jt._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,jt._cacheThemeColor.set(this._themeColors,s);const i=new gl(nn.hexValueToRgbColor(r));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return s.set(this._themeColorType,o),o}clone(){return new jt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof jt?n._themeColorType===this._themeColorType:!1}getColorType(){return gt.THEME}getThemeColorType(){return this._themeColorType}};R(jt,"_cacheThemeColor",new Map);let xr=jt;const _p="rgb(",Ep="rgba(",Ns={aliceBlue:[240,248,255],antiqueWhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blancheAlmond:[255,235,205],blue:[0,0,255],blueViolet:[138,43,226],brown:[165,42,42],burlyWood:[222,184,135],cadetBlue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornFlowerBlue:[100,149,237],cornSilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkCyan:[0,139,139],darkGoldenrod:[184,132,11],darkGray:[169,169,169],darkGreen:[0,100,0],darkGrey:[169,169,169],darkKhaki:[189,183,107],darkMagenta:[139,0,139],darkOliveGreen:[85,107,47],darkOrange:[255,140,0],darkOrchid:[153,50,204],darkRed:[139,0,0],darkSalmon:[233,150,122],darkSeaGreen:[143,188,143],darkSlateBlue:[72,61,139],darkSlateGray:[47,79,79],darkSlateGrey:[47,79,79],darkTurquoise:[0,206,209],darkViolet:[148,0,211],deepPink:[255,20,147],deepSkyBlue:[0,191,255],dimGray:[105,105,105],dimGrey:[105,105,105],dodgerBlue:[30,144,255],firebrick:[178,34,34],floralWhite:[255,255,240],forestGreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostWhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenYellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotPink:[255,105,180],indianRed:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderBlush:[255,240,245],lawnGreen:[124,252,0],lemonChiffon:[255,250,205],lightblue:[173,216,230],lightCoral:[240,128,128],lightCyan:[224,255,255],lightGoldenrodYellow:[250,250,210],lightGray:[211,211,211],lightGreen:[144,238,144],lightGrey:[211,211,211],lightPink:[255,182,193],lightSalmon:[255,160,122],lightSeaGreen:[32,178,170],lightSkyBlue:[135,206,250],lightSlateGray:[119,136,153],lightSlateGrey:[119,136,153],lightSteelBlue:[176,196,222],lightYellow:[255,255,224],lime:[0,255,0],limeGreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumAquamarine:[102,205,170],mediumBlue:[0,0,205],mediumOrchid:[186,85,211],mediumPurple:[147,112,219],mediumSeaGreen:[60,179,113],mediumSlateBlue:[123,104,238],mediumSpringGreen:[0,250,154],mediumTurquoise:[72,209,204],mediumVioletRed:[199,21,133],midBightBlue:[25,25,112],mintCream:[245,255,250],mistyRose:[255,228,225],moccasin:[255,228,181],navajoWhite:[255,222,173],navy:[0,0,128],oldLace:[253,245,230],olive:[128,128,0],oliveDrab:[107,142,35],orange:[255,165,0],orangeRed:[255,69,0],orchid:[218,112,214],paleGoldenrod:[238,232,170],paleGreen:[152,251,152],paleTurquoise:[175,238,238],paleVioletRed:[219,112,147],papayaWhip:[255,239,213],peachPuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderBlue:[176,224,230],purple:[128,0,128],rebeccaPurple:[102,51,153],red:[255,0,0],rosyBrown:[188,143,143],royalBlue:[65,105,225],saddleBrown:[139,69,19],salmon:[250,128,114],sandyBrown:[244,164,96],seaGreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyBlue:[135,206,235],slateBlue:[106,90,205],slateGray:[119,128,144],slateGrey:[119,128,144],snow:[255,255,250],springGreen:[0,255,127],steelBlue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whiteSmoke:[245,245,245],yellow:[255,255,0],yellowGreen:[154,205,5]};class Ct{constructor(t){R(this,"_color");R(this,"_rgbColor");R(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof Ct){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=pl(t);if(n==null){this._setNullColor();return}this._color=n;const r=Sp(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(t,n,r){var c,u;r=Math.min(1,Math.max(0,r));const s=new Ct(t).toRgb(),i=new Ct(n).toRgb(),o=(c=s.a)!=null?c:1,a=(u=i.a)!=null?u:1,l={r:(i.r-s.r)*r+s.r,g:(i.g-s.g)*r+s.g,b:(i.b-s.b)*r+s.b,a:(a-o)*r+o};return new Ct(l)}static getContrastRatio(t,n){const r=new Ct(t).getLuminance(),s=new Ct(n).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:t,g:n,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${t},${n},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(t){const{r:n,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[gr(Math.round(n).toString(16)),gr(Math.round(r).toString(16)),gr(Math.round(s).toString(16)),gr(Math.round(i*255).toString(16))];return t&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return wp(this.toRgb())}toHsl(){return yp(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new Ct(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new Ct(n)}setAlpha(t){return new Ct({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=is(t),n=is(n),r=is(r),Number((.2126*t+.7152*n+.0722*r).toFixed(3))}getBrightness(){const{r:t,g:n,b:r}=this.toRgb();return(t*299+n*587+r*114)/1e3}getAlpha(){var t;return(t=this._color.a)!=null?t:1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const gr=e=>e.length===1?`0${e}`:e,is=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),pl=e=>{if(Np(e)){if("r"in e){const r={r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)};return e.a!==void 0&&(r.a=e.a),r}if("l"in e){const r={h:Math.round(e.h),s:e.s,l:e.l};return e.a!==void 0&&(r.a=e.a),r}const n={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(n.a=e.a),n}const t=e.trim();if(Ns[t]){const n=Ns[t],r={r:Math.round(n[0]),g:Math.round(n[1]),b:Math.round(n[2])};return r.a=n[3]||1,r}if(t.startsWith("#"))return Rp(t);if(t.startsWith("rgb"))return Cp(t);if(t.startsWith("hsl"))return Ip(t);if(t.startsWith("hsv"))return vp(t)},Rp=e=>{const t=e.substring(1),n=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(n);if(!r||r.length<3)throw new Error(`The color '${e}' is illegal hex color`);r[0].length===1&&(r=r.map(i=>i+i));const s={r:Number.parseInt(r[0],16),g:Number.parseInt(r[1],16),b:Number.parseInt(r[2],16)};return r.length>3&&(s.a=Number.parseInt(r[3],16)/255),s},Cp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal rgb color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal rgb color`);const 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},Ip=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsl color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsl color`);const 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},vp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsv color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsv color`);const 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},Sp=e=>{const t=pl(e);if(t!=null)return"r"in t?t:"l"in t?Op(t):bp(t)},os=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),Op=e=>{let{h:t,s:n,l:r}=e;t/=360,n/=100,r/=100;let s=0,i=0,o=0;if(n===0)s=i=o=r;else{const l=r<.5?r*(1+n):r+n-r*n,c=2*r-l;s=os(c,l,t+1/3),i=os(c,l,t),o=os(c,l,t-1/3)}const a={r:Math.round(s*255),g:Math.round(i*255),b:Math.round(o*255)};return e.a!==void 0&&(a.a=e.a),a},bp=e=>{let{h:t,s:n,v:r}=e;t=t/360*6,n/=100,r/=100;const s=Math.floor(t),i=t-s,o=r*(1-n),a=r*(1-i*n),l=r*(1-(1-i)*n),c=s%6,u=[r,a,o,o,l,r][c],h=[l,r,r,a,o,o][c],d=[o,o,l,r,r,a][c],f={r:u*255,g:h*255,b:d*255};return e.a!==void 0&&(f.a=e.a),f},yp=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r),o=(s+i)/2;let a,l;if(s===i)a=l=0;else{const u=s-i;switch(l=o>.5?u/(2-s-i):u/(s+i),s){case t:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-t)/u+2;break;default:a=(t-n)/u+4;break}a/=6}const c={h:Math.round(a*360),s:Math.round(l*100),l:Math.round(o*100)};return e.a!==void 0&&(c.a=e.a),c},wp=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r);let o;const a=s,l=s-i,c=s===0?0:l/s;if(s===i)o=0;else{switch(s){case t:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-t)/l+2;break;default:o=(t-n)/l+4;break}o/=6}const u={h:Math.round(o*360),s:Math.round(c*100),v:Math.round(a*100)};return e.a!==void 0&&(u.a=e.a),u},Ap=e=>e==null,Np=e=>!Ap(e)&&typeof e=="object";function Tp(e){const t=/^#(?:[0]{3}|[0]{6})\b/,n=/^rgb\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*\)$/,r=/^rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}function Mp(e){const t=/^#(?:[Ff]{3}|[Ff]{6})\b/,n=/^rgb\s*\(\s*255\s*,\s*255\s*,\s*255\s*\)$/,r=/^rgba\s*\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}var ve=(e=>(e[e.COVER=0]="COVER",e[e.REPLACE=1]="REPLACE",e))(ve||{});function Lp(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 Dp(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return $t.STRING;if(typeof e.v=="number")return $t.NUMBER;if(typeof e.v=="boolean")return $t.BOOLEAN}function xp(e){if(e==null)return!0;const{v:t,f:n,si:r,p:s,s:i,custom:o}=e;return!(!(t==null||typeof t=="string"&&t.length===0)||n!=null&&n.length>0||r!=null&&r.length>0||s!=null||o!=null)}function Up(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var me=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(me||{}),ze=(e=>(e[e.NONE=0]="NONE",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(ze||{});function Pp(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var ml=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(ml||{}),_l=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(_l||{});function Fp(e,t,n){let r=!1,s=!1,i=e,o=t,a=e,l=t;if(n==null)return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l};for(let c=0;c<n.length;c++){const{startRow:u,endRow:h,startColumn:d,endColumn:f}=n[c];if(e===u&&t===d){i=h,o=f,a=u,l=d,s=!0;break}if(e>=u&&e<=h&&t>=d&&t<=f){i=h,o=f,a=u,l=d,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}function kp(e){const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:c}=e,u=t,h=n,d=t,f=n;if(r&&i){const{startRow:_,startColumn:C,endRow:T,endColumn:S,startY:x,endY:B,startX:V,endX:y}=i;u=_,h=C,d=T,f=S,o=x,a=B,l=V,c=y}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,d=i.endRow,f=i.endColumn),{startRow:u,startColumn:h,endRow:d,endColumn:f,startY:o,endY:a,startX:l,endX:c}}function jp(e){if(!e)return;const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let c=t,u=n,h=t,d=n;return(r||s)&&(c=i,u=o,h=a,d=l),{startRow:c,startColumn:u,endRow:h,endColumn:d}}function El(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function Hp(e){return El(e)&&(e==null?void 0:e.coverable)!==!1}function Ot(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new Yr().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function Bp(e){return $.isString(e)&&e.substring(0,1)==="="&&e.length>1}function $p(e){return $.isString(e)&&e.length>0}function Wp(e,t=!1){var i;let n="";const r=new Map([["ff",()=>{e.ff&&(n+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),n+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(n+="font-style: italic; ")}],["bl",()=>{e.bl&&(n+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):n+="text-decoration: underline; ",e.ul.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Ot(e.ul.cl)}; `),e.ul.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):n+="text-decoration-line: line-through; ",e.st.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Ot(e.st.cl)}; `),e.st.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):n+="text-decoration-line: overline; ",e.ol.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Ot(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${Ot(e.bg)}; `)}],["bd",()=>{var o,a,l,c,u,h,d,f,_,C,T,S;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${pr((a=e.bd)==null?void 0:a.b.s)} ${(l=Ot(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(n+=`border-top: ${pr((u=e.bd)==null?void 0:u.t.s)} ${(h=Ot(e.bd.t.cl))!=null?h:""}; `),(d=e.bd)!=null&&d.r&&(n+=`border-right: ${pr((f=e.bd)==null?void 0:f.r.s)} ${(_=Ot(e.bd.r.cl))!=null?_:""}; `),(C=e.bd)!=null&&C.l&&(n+=`border-left: ${pr((T=e.bd)==null?void 0:T.l.s)} ${(S=Ot(e.bd.l.cl))!=null?S:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${Ot(e.cl)}; `)}],["va",()=>{e.va===xt.SUBSCRIPT?n+="vertical-align: sub; ":e.va===xt.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===Xn.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===Xn.RIGHT_TO_LEFT&&(n+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(n+=`--data-rotate: (${(o=e.tr)==null?void 0:o.a}deg${(a=e.tr)!=null&&a.v?` ,${(l=e.tr)==null?void 0:l.v}`:""});`)}],["ht",()=>{e.ht===Ht.LEFT?n+="text-align: left; ":e.ht===Ht.RIGHT?n+="text-align: right; ":e.ht===Ht.CENTER?n+="text-align: center; ":e.ht===Ht.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{e.vt===Zt.BOTTOM?n+="vertical-align: bottom; ":e.vt===Zt.TOP?n+="vertical-align: top; ":e.vt===Zt.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{e.tb===en.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===en.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var u,h,d,f,_,C,T,S;const o=`${(u=e.pd)==null?void 0:u.b}pt`,a=`${(h=e.pd)==null?void 0:h.t}pt`,l=`${(d=e.pd)==null?void 0:d.l}pt`,c=`${(f=e.pd)==null?void 0:f.r}pt`;(_=e.pd)!=null&&_.b&&(n+=`padding-bottom: ${o}; `),(C=e.pd)!=null&&C.t&&(n+=`padding-top: ${a}; `),(T=e.pd)!=null&&T.l&&(n+=`padding-left: ${l}; `),(S=e.pd)!=null&&S.r&&(n+=`padding-right: ${c}; `)}]]),s=["bd","tr","tb"];for(const o in e)t&&s.includes(o)||(i=r.get(o))==null||i();return n}function pr(e){let t="";return e===ke.NONE?t="none":e===ke.THIN?t="0.5pt solid":e===ke.HAIR?t="0.5pt double":e===ke.DOTTED?t="0.5pt dotted":e===ke.DASHED||e===ke.DASH_DOT?t="0.5pt dashed":e===ke.DASH_DOT_DOT?t="0.5pt dotted":e===ke.DOUBLE?t="0.5pt double":e===ke.MEDIUM?t="1pt solid":e===ke.MEDIUM_DASHED||e===ke.MEDIUM_DASH_DOT?t="1pt dashed":e===ke.MEDIUM_DASH_DOT_DOT?t="1pt dotted":e===ke.SLANT_DASH_DOT?t="0.5pt dashed":e===ke.THICK&&(t="1.5pt solid"),t}function Vp(e){let t=0;if(e=e.trim(),e==="none")t=ke.NONE;else if(e==="0.5pt solid")t=ke.THIN;else if(e==="0.5pt double")t=ke.HAIR;else if(e==="0.5pt dotted")t=ke.DOTTED;else if(e==="0.5pt dashed")t=ke.DASHED;else if(e==="1pt solid")t=ke.MEDIUM;else if(e==="1pt dashed")t=ke.MEDIUM_DASHED;else if(e==="1pt dotted")t=ke.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")t=ke.THICK;else if(!e.includes("none"))t=ke.THIN;else return ke.NONE;return t}function zp(e,t){let n=e.body;if(t){const{headers:r,footers:s}=e;r!=null&&r[t]?n=r[t].body:s!=null&&s[t]&&(n=s[t].body)}return n}function Gp(e,t){const{startRow:n,endRow:r,startColumn:s,endColumn:i,rangeType:o}=e;if(n<0||s<0||r<0||i<0||!(Number.isNaN(n)&&Number.isNaN(r))&&o===me.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===me.ROW||o!==me.ROW&&o!==me.COLUMN&&(Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(i)||Number.isNaN(r)))return!1;if(t){const a=t.getRowCount(),l=t.getColumnCount();if(r>=a||i>=l)return!1}return!0}function Kp(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function fi(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?!1:Object.keys(e).every(n=>fi(e[n],t[n])):e===t:!1}function Rl(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:fi(n,r)}function Yp(e,t){return t.some(n=>e.indexOf(n)>-1)}function Xr(e,t,n,r){if(e>t&&([e,t]=[t,e]),n>r&&([n,r]=[r,n]),t<n||r<e)return[e,t];n<e&&(n=e),r>t&&(r=t);const s=r-n+1;let i=[];return e===n?i=[r+1-s,t-s]:t===r?i=[e,n-1]:i=[e,t-s],i}function Xp(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function Qp(e){if(e==null)return!1;const t=e.paragraphStyle;return Cl(t)}function Cl(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 Il(e,t,n){return e.slice(0,t)+n+e.slice(t)}function vl(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}const Jp=/\s/g;function Zp(e){return e===null||e.toString().replace(Jp,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function qp(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+(t<<6)+(t<<16)-t;return t>>>0}const Pe=Symbol("newer"),Ke=Symbol("older");class em{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Pe],{done:!1,value:t.key}):{done:!0,value:void 0}}}class tm{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Pe],{done:!1,value:t.value}):{done:!0,value:void 0}}}class nm{constructor(t){R(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Pe],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}}}var Ho,Bo;Bo=Pe,Ho=Ke;class mo{constructor(t,n){R(this,"key");R(this,"value");R(this,Bo);R(this,Ho);this.key=t,this.value=n,this[Pe]=void 0,this[Ke]=void 0}toJSON(){return{key:this.key,value:this.value}}}class Ur{constructor(...t){R(this,"_keymap");R(this,"size",0);R(this,"limit");R(this,"oldest");R(this,"newest");R(this,"_onShiftListeners",[]);if(Un.hasLength(t,1)){if(Un.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if(Un.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if(Un.hasLength(t,2)){const n=t[0],r=t[1];this._initialize(n,r)}}onShift(t){if(this._onShiftListeners.indexOf(t)===-1)return this._onShiftListeners.push(t),$e(()=>tr(this._onShiftListeners,t));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(t,n){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=t,this._keymap=new Map,n&&(this.assign(n),t<1&&(this.limit=this.size))}_markEntryAsUsed(t){t!==this.newest&&(t[Pe]&&(t===this.oldest&&(this.oldest=t[Pe]),t[Pe][Ke]=t[Ke]),t[Ke]&&(t[Ke][Pe]=t[Pe]),t[Pe]=void 0,t[Ke]=this.newest,this.newest&&(this.newest[Pe]=t),this.newest=t)}assign(t){let n,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const s=t[Symbol.iterator]();for(let i=s.next();!i.done;i=s.next()){const o=new mo(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[Pe]=o,o[Ke]=n):this.oldest=o,n=o,r--===0)throw new Error("overflow")}this.newest=n,this.size=this._keymap.size}set(t,n){let r=this._keymap.get(t);return r?(r.value=n,this._markEntryAsUsed(r),this):(this._keymap.set(t,r=new mo(t,n)),this.newest?(this.newest[Pe]=r,r[Ke]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const t=this.oldest;if(t)return this.oldest&&this.oldest[Pe]?(this.oldest=this.oldest[Pe],this.oldest[Ke]=void 0):(this.oldest=void 0,this.newest=void 0),t[Pe]=t[Ke]=void 0,this._keymap.delete(t.key),--this.size,this._onShiftListeners.forEach(n=>n(t)),[t.key,t.value]}get(t){const n=this._keymap.get(t);if(n)return this._markEntryAsUsed(n),n.value}has(t){return this._keymap.has(t)}find(t){const n=this._keymap.get(t);return n?n.value:void 0}delete(t){const n=this._keymap.get(t);if(n)return this._keymap.delete(n.key),n[Pe]&&n[Ke]?(n[Ke][Pe]=n[Pe],n[Pe][Ke]=n[Ke]):n[Pe]?(n[Pe][Ke]=void 0,this.oldest=n[Pe]):n[Ke]?(n[Ke][Pe]=void 0,this.newest=n[Ke]):this.oldest=this.newest=void 0,this.size--,n.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new em(this.oldest)}values(){return new tm(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new nm(this.oldest)}forEach(t,n){typeof n!="object"&&(n=this);let r=this.oldest;for(;r;)t.call(n,r.value,r.key,this),r=r[Pe]}toJSON(){const t=new Array(this.size);let n=0,r=this.oldest;for(;r;)t[n++]={key:r.key,value:r.value},r=r[Pe];return t}toString(){let t="",n=this.oldest;for(;n;)t+=`${String(n.key)}:${n.value}`,n=n[Pe],n&&(t+=" < ");return t}}class Un{static hasLength(t,n){return t.length===n}static getValueType(t){return Object.prototype.toString.apply(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isIterable(t){return t[Symbol.iterator]!=null}static isNumber(t){return this.getValueType(t)==="[object Number]"}}var Sl={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:at,function(){return function(){var n={d:function(m,g){for(var p in g)n.o(g,p)&&!n.o(m,p)&&Object.defineProperty(m,p,{enumerable:!0,get:g[p]})},o:function(m,g){return Object.prototype.hasOwnProperty.call(m,g)}},r={};n.d(r,{default:function(){return rt}});var s={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"};const i=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,o={},a={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:["AM","PM"],mmmm6:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"],mmm6:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],mmmm:["January","February","March","April","May","June","July","August","September","October","November","December"],mmm:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};function l(m){const g=i.exec(m);if(!g)throw new SyntaxError("Malformed locale: ".concat(m));return{lang:g[1]+(g[2]?"_"+g[2]:""),language:g[1],territory:g[2]||"",codeset:g[3]||"",modifier:g[4]||""}}function c(m){if(typeof m=="number")return s[65535&m]||null;const g=parseInt(m,16);return isFinite(g)&&s[65535&g]?s[65535&g]||null:i.test(m)?m:null}function u(m){const g=c(m);let p=null;if(g){const I=l(g);p=o[I.lang]||o[I.language]||null}return p}function h(m){return Object.assign({},a,m)}function d(m,g){const p=typeof g=="object"?g:l(g);return o[p.lang]=h(m),p.language===p.lang||o[p.language]||(o[p.language]=h(m)),o[p.lang]}const f=h({group:","});function _(m,g){if(typeof m!="number")return m;if(m<0)return-_(-m,g);if(g){const p=10**(g||0)||1;return _(m*p,0)/p}return Math.round(m)}f.isDefault=!0,d({group:",",ampm:["上午","下午"],mmmm:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"]},"zh_CN"),d({group:",",nan:"非數值",ampm:["上午","下午"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["週日","週一","週二","週三","週四","週五","週六"]},"zh_TW"),d({group:",",ampm:["午前","午後"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],ddd:["日","月","火","水","木","金","土"]},"ja"),d({group:",",ampm:["오전","오후"],mmmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],mmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dddd:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ddd:["일","월","화","수","목","금","토"]},"ko"),d({group:",",ampm:["ก่อนเที่ยง","หลังเที่ยง"],mmmm:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],mmm:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dddd:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],ddd:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},"th"),d({decimal:",",ampm:["dop.","odp."],mmmm:["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince"],mmm:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],dddd:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],ddd:["ne","po","út","st","čt","pá","so"]},"cs"),d({group:".",decimal:",",mmmm:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],mmm:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"da"),d({group:".",decimal:",",ampm:["a.m.","p.m."],mmmm:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],mmm:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],ddd:["zo","ma","di","wo","do","vr","za"]},"nl"),d({group:","},"en"),d({decimal:",",nan:"epäluku",ampm:["ap.","ip."],mmmm:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],mmm:["tammik.","helmik.","maalisk.","huhtik.","toukok.","kesäk.","heinäk.","elok.","syysk.","lokak.","marrask.","jouluk."],dddd:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],ddd:["su","ma","ti","ke","to","pe","la"]},"fi"),d({group:" ",decimal:",",mmmm:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],mmm:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dddd:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],ddd:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."]},"fr"),d({group:".",decimal:",",mmmm:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],mmm:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],dddd:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],ddd:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]},"de"),d({group:".",decimal:",",ampm:["π.μ.","μ.μ."],mmmm:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],mmm:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dddd:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],ddd:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"]},"el"),d({decimal:",",ampm:["de.","du."],mmmm:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],mmm:["jan.","febr.","márc.","ápr.","máj.","jún.","júl.","aug.","szept.","okt.","nov.","dec."],dddd:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"],ddd:["V","H","K","Sze","Cs","P","Szo"]},"hu"),d({group:".",decimal:",",ampm:["f.h.","e.h."],mmmm:["janúar","febrúar","mars","apríl","maí","júní","júlí","ágúst","september","október","nóvember","desember"],mmm:["jan.","feb.","mar.","apr.","maí","jún.","júl.","ágú.","sep.","okt.","nóv.","des."],dddd:["sunnudagur","mánudagur","þriðjudagur","miðvikudagur","fimmtudagur","föstudagur","laugardagur"],ddd:["sun.","mán.","þri.","mið.","fim.","fös.","lau."]},"is"),d({group:".",decimal:",",mmmm:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],mmm:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],dddd:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],ddd:["Min","Sen","Sel","Rab","Kam","Jum","Sab"]},"id"),d({group:".",decimal:",",mmmm:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],mmm:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dddd:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],ddd:["dom","lun","mar","mer","gio","ven","sab"]},"it"),d({decimal:",",ampm:["a.m.","p.m."],mmmm:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],mmm:["jan.","feb.","mar.","apr.","mai","jun.","jul.","aug.","sep.","okt.","nov.","des."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"nb"),d({decimal:",",mmmm:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"],mmm:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],dddd:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],ddd:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."]},"pl"),d({group:".",decimal:",",mmmm:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],mmm:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],dddd:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],ddd:["dom.","seg.","ter.","qua.","qui.","sex.","sáb."]},"pt"),d({decimal:",",nan:"не число",mmmm:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],mmm:["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],dddd:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],ddd:["вс","пн","вт","ср","чт","пт","сб"]},"ru"),d({decimal:",",mmmm:["januára","februára","marca","apríla","mája","júna","júla","augusta","septembra","októbra","novembra","decembra"],mmm:["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],dddd:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],ddd:["ne","po","ut","st","št","pi","so"]},"sk"),d({group:".",decimal:",",ampm:["a. m.","p. m."],mmmm:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],mmm:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],dddd:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],ddd:["dom.","lun.","mar.","mié.","jue.","vie.","sáb."]},"es"),d({decimal:",",ampm:["fm","em"],mmmm:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],mmm:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],dddd:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],ddd:["sön","mån","tis","ons","tors","fre","lör"]},"sv"),d({group:".",decimal:",",ampm:["ÖÖ","ÖS"],mmmm:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],mmm:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],dddd:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],ddd:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"]},"tr");function C(m,g,p){const I=m<0?-1:1,b=10**(g||2),N=10**(p||2);let A,M,E=Math.abs(m),P=0,Z=0,U=0,Q=1;if((m=E)%1==0)M=[m*I,1];else if(m<1e-19)M=[I,1e19];else if(m>1e19)M=[1e19*I,1];else{do if(E=1/(E-Math.floor(E)),A=Q,Q=Q*Math.floor(E)+P,P=A,Z=U,U=Math.floor(m*Q+.5),U>=b||Q>=N)return[I*Z,P];while(Math.abs(m-U/Q)>=1e-10&&E!==Math.floor(E));M=[I*U,Q]}return M}const T={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},S=Object.assign({},T);function x(m){if(m===null&&(m=T),m){for(const g in m)if(g in T){const p=m[g];S[g]=p==null?T[g]:p}}return{...S}}const B={"#":"",0:"0","?":" "},V={"@":"text","-":"minus","+":"plus"},y=["#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#800","#080","#008","#880","#808","#088","#CCC","#888","#99F","#936","#FFC","#CFF","#606","#F88","#06C","#CCF","#008","#F0F","#FF0","#0FF","#808","#800","#088","#00F","#0CF","#CFF","#CFC","#FF9","#9CF","#F9C","#C9F","#FC9","#36F","#3CC","#9C0","#FC0"],O=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],L=new RegExp("["+O.join("")+"]");function z(m,g,p){return g[p+"_max"]=m.length,g[p+"_min"]=m.replace(/#/g,"").length,g}const ge={};function de(m){if(!(m in ge)){const g=[],p=m.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,I=>"?".repeat(I.length));for(let I=0;I<p.length;I++){const b=p.charAt(I);g[I]=b in B?B[b]:b}ge[m]=g.join("")}return ge[m]}function be(m,g){typeof m=="string"&&(m={type:"string",value:m=m.replace(/ /g,B["?"])}),g.push(m)}function we(m){const g=[],p={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:g};let I=m+"",b="int",N=!1,A=null;const M=[];let E,P,Z=!1;for(;I&&!N;){if(E=/^General/i.exec(I))p.general=!0,be({type:"general"},g);else if(b==="int"&&(E=/^[#?0]+(?:,[#?0]+)*/.exec(I))||b==="den"&&(E=/^[#?\d]+/.exec(I))||(E=/^[#?0]+/.exec(I)))p[b+"_pattern"].push(E[0]),A={type:b,num:E[0]},be(A,g);else if((E=/^\//.exec(I))&&p[b+"_pattern"].length){if(!A)throw new SyntaxError("Missing a numerator in pattern ".concat(m));p.fractions=!0,p.num_pattern.push(p[b+"_pattern"].pop()),A.type="num",b="den",be({type:"div"},g)}else if(E=/^,+/.exec(I)){const w=I.charAt(1)in B;P.slice(-1)in B&&(E[0].length>1||!w)?p.scale=.001**E[0].length:p.dec_fractions||be(E[0],g)}else{if(E=/^;/.exec(I)){N=!0;break}if(E=/^[@+-]/.exec(I))E[0]==="@"&&(p.text=!0),be({type:V[E[0]]},g);else if(E=/^(?:\[(h+|m+|s+)\])/i.exec(I)){const w=E[1].toLowerCase(),k=w[0],re={type:"",size:0,date:1,raw:E[0],pad:w.length};k==="h"?(re.size=16,re.type="hour-elap"):k==="m"?(re.size=32,re.type="min-elap"):(re.size=64,re.type="sec-elap"),p.date=p.date|re.size,M.push(re),be(re,g)}else if(E=/^(?:B2)/i.exec(I))Z||(p.date_system=6);else if(E=/^(?:B1)/i.exec(I))Z||(p.date_system=1);else if(E=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(I)){const w={type:"",size:0,date:1,raw:E[0]},k=E[0].toLowerCase(),re=k[0];if(k==="y"||k==="yy")w.size=2,w.type="year-short";else if(re==="y"||re==="e")w.size=2,w.type="year";else if(k==="b"||k==="bb")w.size=2,w.type="b-year-short";else if(re==="b")w.size=2,w.type="b-year";else if(k==="d"||k==="dd")w.size=8,w.type="day",w.pad=/dd/.test(k);else if(k==="ddd")w.size=8,w.type="weekday-short";else if(re==="d")w.size=8,w.type="weekday";else if(re==="h")w.size=16,w.type="hour",w.pad=/hh/i.test(k);else if(re==="m"){k.length===3?(w.size=4,w.type="monthname-short"):k.length===5?(w.size=4,w.type="monthname-single"):k.length>=4&&(w.size=4,w.type="monthname");const ue=M[M.length-1];!w.type&&ue&&!ue.used&&80&ue.size&&(ue.used=!0,w.size=32,w.type="min",w.pad=/mm/.test(k)),w.type||(w.size=4,w.type="month",w.pad=/mm/.test(k),w.indeterminate=!0)}else if(re==="s"){w.size=64,w.type="sec",w.pad=/ss/.test(k);const ue=M[M.length-1];ue&&32&ue.size?w.used=!0:ue&&ue.indeterminate&&(delete ue.indeterminate,ue.size=32,ue.type="min",w.used=!0)}p.date=p.date|w.size,p.date_eval=!0,M.push(w),be(w,g)}else if(E=/^(?:AM\/PM|am\/pm|A\/P)/.exec(I))p.clock=12,p.date=16|p.date,p.date_eval=!0,be({type:"am",short:E[0]==="A/P"},g);else if(p.date&&(E=/^\.0{1,3}/i.exec(I))){const w=E[0].length-1,k=[64,128,256,512][w];p.date=p.date|k,p.date_eval=!0,p.sec_decimals=Math.max(p.sec_decimals,w),be({type:"subsec",size:k,decimals:w,date:1,raw:E[0]},g)}else if((E=/^\\(.)/.exec(I))||(E=/^"([^"]*?)"/.exec(I)))be(E[1],g);else if(E=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(I))p.condition=[E[1],parseFloat(E[2],10)];else if(E=/^\[\$([^\]]+)\]/.exec(I)){const w=E[1].split("-"),k=w.length<2?"":w[w.length-1],re=w[0];re&&be(re,g);const ue=c(k);ue&&(p.locale=ue);const Ie=parseInt(k,16);isFinite(Ie)&&16711680&Ie&&(Ie>>16&255)===6&&(p.date_system=6),Z=!0}else if(E=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(I))p.color=E[2]?y[parseInt(E[2],10)]||"#000":E[1].toLowerCase();else if(!(E=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(I))){if(E=/^%/.exec(I))p.scale=100,p.percent=!0,be("%",g);else if(E=/^_(\\.|.)/.exec(I))be(" ",g);else if(E=/^\./.exec(I))be({type:"point",value:E[0]},g),p.dec_fractions=!0,b="frac";else if(E=/^[Ee]([+-]?|(?=[0#?]))/.exec(I))p.exponential=!0,p.exp_plus=E[1]==="+",b="man",be({type:"exp",plus:E[1]==="+"},g);else if(!(E=/^\*(\\.|.)/.exec(I))){if(E=/^[BENn[]/.exec(I))throw new SyntaxError("Unexpected char ".concat(I.charAt(0)," in pattern ").concat(m));I[0]==="("&&(p.parens=!0),E=[I[0]],be(E[0],g)}}}P=E[0],I=I.slice(E?E[0].length:1)}if(p.pattern=m.slice(0,m.length-I.length),/^((?:\[[^\]]+\])+)(;|$)/.test(p.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(p.pattern)&&be({type:"text"},g),p.fractions&&p.dec_fractions||p.fractions&&p.exponential)throw new SyntaxError("Invalid pattern: ".concat(p.pattern));const U=p.int_pattern.join("");if(p.grouping=U.indexOf(",")>=0,p.grouping){const w=U.split(","),k=w.length;k===2?(p.group_pri=w[1].length,p.group_sec=p.group_pri):k>2&&(p.group_pri=w[k-1].length,p.group_sec=w[k-2].length)}else p.group_pri=0,p.group_sec=0;z(U.replace(/[,]/g,""),p,"int"),z(p.frac_pattern.join(""),p,"frac"),z(p.man_pattern.join(""),p,"man");let Q=p.num_pattern.join(""),ae=p.den_pattern.join("");const W=/\?/.test(ae)||/\?/.test(Q);return ae=ae.replace(/\d/g,W?"?":"#"),W&&(ae=ae.replace(/#$/g,"?")),z(Q,p,"num"),z(ae,p,"den"),W&&(Q=Q.replace(/#$/g,"?")),p.int_padding=de(p.int_pattern.join("")),p.man_padding=de(p.man_pattern.join("")),p.num_padding=de(Q),p.den_padding=de(ae),p.den_pattern.length&&(p.denominator=parseInt(p.den_pattern.join("").replace(/\D/g,""),10)),p.integer=!!p.int_pattern.join("").length,p.fractions&&g.forEach((w,k)=>{const re=g[k+1];w.type==="string"&&re&&(re.type==="num"?w.rule="num+int":re.type==="div"?w.rule="num":re.type==="den"&&(w.rule="den"))}),p}const Me=m=>{const g=m.condition;g&&g[1]<0&&(g[0]==="<"||g[0]==="<="||g[0]==="=")||m.tokens.unshift({type:"minus",volatile:!0})};function je(m){const g=[];let p,I=!1,b=null,N=m,A=0,M=!1,E=0,P=0;do{if(M=we(N),(M.date||M.general)&&(M.int_pattern.length||M.frac_pattern.length||M.scale!==1||M.text))throw new Error("Illegal format");if(M.condition&&(P++,I=!0),M.text){if(b)throw new Error("Unexpected partition");b=M}M.locale&&(p=c(M.locale)),g.push(M),A=N.charAt(M.pattern.length)===";"?1:0,N=N.slice(M.pattern.length+A),E++}while(A&&E<4&&P<3);if(A)throw new Error("Unexpected partition");if(P>2)throw new Error("Unexpected condition");const Z=g[3];if(Z&&(Z.int_pattern.length||Z.frac_pattern.length||Z.date))throw new Error("Unexpected partition");if(I){const U=g.length;if(U===1&&(g[1]=we("General"),g[1].generated=!0),U<3){const Q=g[0],ae=g[1];if(Me(Q),ae.condition)Me(ae);else{const W=Q.condition;(W[0]==="="||W[1]>=0&&(W[0]===">"||W[0]===">="))&&ae.tokens.unshift({type:"minus",volatile:!0})}}else g.forEach(Me)}else{if(g.length<4&&b)for(let U=0,Q=g.length;U<Q;U++)g[U]===b&&g.splice(U,1);if(g.length<1&&b&&(g[0]=we("General"),g[0].generated=!0),g.length<2){const U=we(g[0].pattern);U.tokens.unshift({type:"minus",volatile:!0}),U.generated=!0,g.push(U)}if(g.length<3){const U=we(g[0].pattern);U.generated=!0,g.push(U)}if(g.length<4)if(b)g.push(b);else{const U=we("@");U.generated=!0,g.push(U)}g[0].condition=[">",0],g[1].condition=["<",0],g[2].condition=null}return{pattern:m,partitions:g,locale:p}}const Ae=Math.floor;function tt(m){if((!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&m>=0){if(m===0)return[1900,1,0];if(m===60)return[1900,2,29];if(m<60)return[1900,m<32?1:2,(m-1)%31+1]}let p=m+68569+2415019;const I=Ae(4*p/146097);p-=Ae((146097*I+3)/4);const b=Ae(4e3*(p+1)/1461001);p=p-Ae(1461*b/4)+31;const N=Ae(80*p/2447),A=p-Ae(2447*N/80);p=Ae(N/11);const M=N+2-12*p;return[0|100*(I-49)+b+p,0|M,0|A]}function qr(m){return tt(m+1462)}function wn(m){if(m===60)throw new Error("#VALUE!");if(m<=1)return[1317,8,29];if(m<60)return[1317,m<32?9:10,1+(m-2)%30];const g=10631/30,p=.1335;let I=m+466935;const b=Ae(I/10631);I-=10631*b;const N=Ae((I-p)/g);I-=Ae(N*g+p);const A=Ae((I+28.5001)/29.5);return A===13?[30*b+N,12,30]:[30*b+N,A,I-Ae(29.5001*A-29)]}function an(m){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const I=Ae(m);return g===6?wn(I):g===-1?qr(I):tt(I,p)}const Kt=Math.floor,An=86400;function Et(m,g){let p=null;if(Array.isArray(m)){const[I,b,N,A,M,E]=m;p=Date.UTC(I,b==null?0:b-1,N!=null?N:1,A||0,M||0,E||0)}else if(m instanceof Date&&(p=1*m,!g||!g.ignoreTimezone)){const I=new Date;I.setUTCFullYear(m.getFullYear(),m.getMonth(),m.getDate()),I.setUTCHours(m.getHours(),m.getMinutes(),m.getSeconds(),m.getMilliseconds()),p=1*I}if(p!=null&&isFinite(p)){const I=p/864e5;return I-(I<=-25509?-25568:-25569)}return m}function ur(m,g){let p=0|m;const I=An*(m-p);let b=Kt(I);I-b>.9999&&(b+=1,b===An&&(b=0,p+=1));const N=b<0?An+b:b,[A,M,E]=an(m,0,g&&g.leap1900),P=Kt(N/60/60)%60,Z=Kt(N/60)%60,U=Kt(N)%60;if(g&&g.nativeDate){const Q=new Date(0);return Q.setUTCFullYear(A,M-1,E),Q.setUTCHours(P,Z,U),Q}return[A,M,E,P,Z,U]}function hr(m){return!!(m[0]&&m[0].percent||m[1]&&m[1].percent||m[2]&&m[2].percent||m[3]&&m[3].percent)}function v(m){return!!(m[0]&&m[0].date||m[1]&&m[1].date||m[2]&&m[2].date||m[3]&&m[3].date)}function D(m){const[g,p,I,b]=m;return!(g&&!g.generated||p&&!p.generated||I&&!I.generated||!b||!b.text||b.generated)}const K={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},ne=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],Y={total:1,sign:0,period:0,int:1,frac:0},J=(m,g)=>m.replace(/\./,g.decimal);function _e(m,g,p,I){const b=0|p;if(typeof p=="string")m.push(p);else if(p===b)m.push(Math.abs(b));else{const N=Math.abs(p);let A=N?Math.floor(Math.log10(N)):0,M=A<0?N*10**-A:N/10**A;M===10&&(M=1,A++);const E=function(Z){let U=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const Q=Math.abs(Z);if(!Q)return Y;const ae=U&&Z<0?1:0,W=Math.floor(Q),w=Math.floor(Math.log10(Q)+1);let k=0,re=0;if(W!==Q){k=1;const ue=String(_(w<0?Q*10**-w:Q/10**w,15));let Ie=ue.length,Se=!0,Le=0;for(;Le<=ue.length;){if(ue[Le]==="."){Ie--;break}ue[Le]==="0"&&Se?Ie--:Se=!1,Le++}re=Ie-w,re<0&&(re=0,k=0)}return{total:ae+Math.max(w,1)+k+re,digits:Math.max(w,0)+re,sign:ae,period:k,int:Math.max(w,1),frac:re}}(N),P=()=>{const Z=Math.abs(A);let U;U=M===1?M:_(M,5),m.push(J(U+"",I),I.exponent,A<0?I.negative:I.positive,Z<10?"0":"",Z)};if(A>=-4&&A<=-1){const Z=N.toPrecision(10+A).replace(/\.?0+$/,"");m.push(J(Z,I))}else if(A===10){const Z=N.toFixed(10).slice(0,12).replace(/\.$/,"");m.push(J(Z,I))}else if(Math.abs(A)<=9)if(E.total<=11){const Z=_(N,9).toFixed(E.frac);m.push(J(Z,I))}else A===9?m.push(Math.floor(N)):A>=0&&A<9?m.push(_(N,9-A)):P();else E.total>=12?P():Math.floor(N)===N?m.push(Math.floor(N)):m.push(J(_(N,9).toFixed(E.frac),I))}return m}const ce=86400,j={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},G=function(m){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const p=Math.floor(Math.log10(m));return g>1?Math.floor(p/g)*g:p};function X(m,g,p,I){let b="",N="",A="",M="",E="",P=0,Z=0|m,U=0,Q=0,ae=1,W=0,w=0,k=0,re=0,ue=0,Ie=0;const Se=I||f;if(!g.text&&isFinite(g.scale)&&g.scale!==1&&(m=function(ie){if(ie===0)return ie;const fe=Math.ceil(Math.log10(ie<0?-ie:ie)),H=10**(16-Math.floor(fe));return Math.round(ie*H)/H}(m*g.scale)),g.exponential){let ie=Math.abs(m);if(ie){const fe=10**-G(ie,g.int_max),H=_(ie*fe,g.frac_max)/fe;P=G(H,g.int_max)}ie/=10**P,m=m<0?-ie:ie,b+=Math.abs(P)}if(g.integer){const ie=Math.abs(_(m,g.fractions?1:g.frac_max));E+=ie<1?"":Math.floor(ie)}if(g.grouping){let ie="",fe=E.length;for(fe>g.group_pri&&(fe-=g.group_pri,ie=Se.group+E.slice(fe,fe+g.group_pri)+ie);fe>g.group_sec;)fe-=g.group_sec,ie=Se.group+E.slice(fe,fe+g.group_sec)+ie;E=fe?E.slice(0,fe)+ie:ie}g.dec_fractions&&(M=String(_(m,g.frac_max)).split(".")[1]||"");let Le=!1;if(g.fractions){const ie=Math.abs(g.integer?m%1:m);if(ie)if(Le=!0,isFinite(g.denominator))A+=g.denominator,N+=_(ie*g.denominator),N==="0"&&(N="",A="",Le=!1,E||(E="0"));else{const fe=C(ie,g.integer?g.num_max:1/0,g.den_max);N+=fe[0],A+=fe[1],g.integer&&N==="0"&&(E||(E="0"),N="",A="",Le=!1)}}if(g.date){Z=Math.trunc(m);const ie=ce*(m-Z);if(U=Math.floor(ie),Ie=ie-U,Math.abs(Ie)<1e-6?Ie=0:Ie>.9999&&(Ie=0,U+=1,U===ce&&(U=0,Z+=1)),Ie){const fe=512&g.date||256&g.date||128&g.date;(fe===512&&Ie>.9995||fe===256&&Ie>.995||fe===128&&Ie>.95||!fe&&Ie>=.5)&&(U++,Ie=0)}if(Z||g.date_system){const fe=an(m,g.date_system,p.leap1900);Q=fe[0],ae=fe[1],W=fe[2]}if(U){const fe=U<0?ce+U:U;ue=Math.floor(fe)%60,re=Math.floor(fe/60)%60,k=Math.floor(fe/60/60)%60}if(w=(6+Z)%7,g.date_eval&&(st=m,ct=Z+U/ce,p.dateSpanLarge?st<-694324||ct>=35830291:st<0||ct>=2958466)){if(p.dateErrorThrows)throw new Error("Date out of bounds");return p.dateErrorNumber?_e(m<0?[Se.negative]:[],0,m,Se).join(""):p.overflow}}var st,ct;if(g.int_padding&&(E=g.int_padding.length===1?E||g.int_padding:g.int_padding.substring(0,g.int_padding.length-E.length)+E),g.num_padding&&(N=g.num_padding.length===1?N||g.num_padding:g.num_padding.substring(0,g.num_padding.length-N.length)+N),g.den_padding&&(A=g.den_padding.length===1?A||g.den_padding:A+g.den_padding.slice(A.length)),g.man_padding){const ie=g.exp_plus?"+":"";b=g.man_padding.length===1?(P<0?"-":ie)+(b||g.man_padding):(P<0?"-":ie)+g.man_padding.slice(0,g.man_padding.length-b.length)+b}const ee=[];let We=0;const oe={int:0,frac:0,man:0,num:0,den:0};for(let ie=0,fe=g.tokens.length;ie<fe;ie++){const H=g.tokens[ie],qe=H.num?H.num.length:0;if(H.type==="string")H.rule?H.rule==="num"?Le?ee.push(H.value):(g.num_min>0||g.den_min>0)&&ee.push(H.value.replace(/./g,B["?"])):H.rule==="num+int"?Le&&E?ee.push(H.value):g.den_min>0&&(E||g.num_min)&&ee.push(H.value.replace(/./g,B["?"])):H.rule==="den"&&(Le?ee.push(H.value):(g.den_min>0||g.den_min>0)&&ee.push(H.value.replace(/./g,B["?"]))):ee.push(H.value);else if(H.type==="error")ee.push(p.invalid);else if(H.type==="point")ee.push(g.date?H.value:Se.decimal);else if(H.type==="general")_e(ee,0,m,Se);else if(H.type==="exp")ee.push(Se.exponent);else if(H.type==="minus")H.volatile&&g.date||H.volatile&&(m>=0||typeof m!="number")||(H.volatile&&!g.fractions&&(g.integer||g.dec_fractions)?(m<0&&E&&E!=="0"||M)&&ee.push(Se.negative):ee.push(Se.negative));else if(H.type==="plus")ee.push(Se.positive);else if(H.type==="text")ee.push(m);else if(H.type==="div")Le?ee.push("/"):g.num_min>0||g.den_min>0?ee.push(B["?"]):ee.push(B["#"]);else if(H.type==="int")if(g.int_pattern.length===1)ee.push(E);else{const Ne=We?g.int_pattern.join("").length-oe.int:1/0,St=We===g.int_pattern.length-1?0:g.int_pattern.join("").length-(oe.int+H.num.length);ee.push(E.substring(E.length-Ne,E.length-St)),We++,oe.int+=H.num.length}else if(H.type==="frac"){const Ne=oe.frac;for(let St=0;St<qe;St++)ee.push(M[St+Ne]||B[H.num[St]]);oe.frac+=qe}else if(H.type in j)g[H.type+"_pattern"].length===1?(H.type==="int"&&ee.push(E),H.type==="frac"&&ee.push(M),H.type==="man"&&ee.push(b),H.type==="num"&&ee.push(N),H.type==="den"&&ee.push(A)):(ee.push(j[H.type].slice(oe[H.type],oe[H.type]+qe)),oe[H.type]+=qe);else if(H.type==="year")Q<0&&ee.push(Se.negative),ee.push(String(Math.abs(Q)).padStart(4,"0"));else if(H.type==="year-short"){const Ne=Q%100;ee.push(Ne<10?"0":"",Ne)}else if(H.type==="month")ee.push(H.pad&&ae<10?"0":"",ae);else if(H.type==="monthname-single")g.date_system===6?ee.push(Se.mmmm6[ae-1].charAt(0)):ee.push(Se.mmmm[ae-1].charAt(0));else if(H.type==="monthname-short")g.date_system===6?ee.push(Se.mmm6[ae-1]):ee.push(Se.mmm[ae-1]);else if(H.type==="monthname")g.date_system===6?ee.push(Se.mmmm6[ae-1]):ee.push(Se.mmmm[ae-1]);else if(H.type==="weekday-short")ee.push(Se.ddd[w]);else if(H.type==="weekday")ee.push(Se.dddd[w]);else if(H.type==="day")ee.push(H.pad&&W<10?"0":"",W);else if(H.type==="hour"){const Ne=k%g.clock||(g.clock<24?g.clock:0);ee.push(H.pad&&Ne<10?"0":"",Ne)}else if(H.type==="min")ee.push(H.pad&&re<10?"0":"",re);else if(H.type==="sec")ee.push(H.pad&&ue<10?"0":"",ue);else if(H.type==="subsec"){ee.push(Se.decimal);const Ne=Ie.toFixed(g.sec_decimals);ee.push(Ne.slice(2,2+H.decimals))}else if(H.type==="am"){const Ne=k<12?0:1;H.short&&!I?ee.push("AP"[Ne]):ee.push(Se.ampm[Ne])}else if(H.type==="hour-elap"){m<0&&ee.push(Se.negative);const Ne=24*Z+Math.floor(Math.abs(U)/3600);ee.push(String(Math.abs(Ne)).padStart(H.pad,"0"))}else if(H.type==="min-elap"){m<0&&ee.push(Se.negative);const Ne=1440*Z+Math.floor(Math.abs(U)/60);ee.push(String(Math.abs(Ne)).padStart(H.pad,"0"))}else if(H.type==="sec-elap"){m<0&&ee.push(Se.negative);const Ne=Z*ce+Math.abs(U);ee.push(String(Math.abs(Ne)).padStart(H.pad,"0"))}else if(H.type==="b-year")ee.push(Q+543);else if(H.type==="b-year-short"){const Ne=(Q+543)%100;ee.push(Ne<10?"0":"",Ne)}}return p.nbsp?ee.join(""):ee.join("").replace(/\u00a0/g," ")}function q(m,g){for(let p=0;p<3;p++){const I=g[p];if(I){let b;if(I.condition){const N=I.condition[0],A=I.condition[1];N==="="?b=m===A:N===">"?b=m>A:N==="<"?b=m<A:N===">="?b=m>=A:N==="<="?b=m<=A:N==="<>"&&(b=m!==A)}else b=!0;if(b)return I}}}const pe=we("@"),Ee="black",F={};function se(m,g){if(m){const p=m[0];g[p]=g[p]||{},se(m.slice(1),g[p])}else g.$=!0}["d-F-y","d-F-Y","d-M-y","d-M-Y","F-d-y","F-d-Y","F-j-y","F-j-Y","j-F-y","j-F-Y","j-M-y","j-M-Y","M-d-y","M-d-Y","M-j-y","M-j-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","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"].forEach(m=>{se(m,F),se(m+" x",F),se(m+" l",F),se(m+" l x",F),se("l "+m,F),se("l "+m+" x",F),se(m+" D",F),se(m+" D x",F),se("D "+m,F),se("D "+m+" x",F)});const De={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},Te={january:1,february:2,march:3,april:4,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Ce={sunday:"l",monday:"l",tuesday:"l",wednesday:"l",thursday:"l",friday:"l",saturday:"l",sun:"D",mon:"D",tue:"D",wed:"D",thu:"D",fri:"D",sat:"D"},He=new Date().getUTCFullYear();function dt(m){const g=new RegExp("^([\\s+%"+O.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+O.join("")+")]*)$").exec(m);if(g){const[,p,I,b,N,A]=g;let M=1,E="",P=!1,Z=!1,U=!1,Q=!1,ae=!1,W=null,w=!1,k=parseFloat(I.replace(/,/g,""));if(!isFinite(k))return null;for(let ue=0;ue<p.length;ue++){const Ie=p[ue];if(Ie==="-"){if(P||Z)return null;P=!0,M=-1}else if(L.test(Ie)){if(ae)return null;ae=!0,W=Ie}else if(Ie==="("){if(Z||P)return null;Z=!0,M=-1}else if(Ie==="%"){if(Q)return null;Q=!0}}for(let ue=0;ue<A.length;ue++){const Ie=A[ue];if(L.test(Ie)){if(ae)return null;ae=!0,W=Ie,w=!0}else if(Ie===")"){if(U||!Z)return null;U=!0}else if(Ie==="%"){if(Q)return null;Q=!0}}if(N){if(Q||ae)return null;E="0.00E+00"}else if(Q){if(ae)return null;E=b.includes(".")?"0.00%":"0%",k*=.01}else if(ae){const ue=b.includes(".")?"#,##0.00":"#,##0";E=w?ue+W:W+ue}else b.includes(",")&&(E=b.includes(".")?"#,##0.00":"#,##0");const re={v:k*M};return E&&(re.z=E),re}}const xe=(m,g,p)=>{const I=p.path||"",b=Object.keys(g);for(let N=0;N<b.length;N++){let A;const M=b[N];if(g[M]){if(M==="$"||M==="€")m||(A=p);else if(M==="-"){const E=/^(\s*([./-]|,\s)\s*|\s+)/.exec(m);if(E){const P=E[1]==="-"||E[1]==="/"||E[1]==="."?E[1]:" ";if(!p.sep||p.sep===P){const Z=E[0].replace(/\s+/g," ");A=xe(m.slice(E[0].length),g[M],{...p,sep:P,path:I+Z})}}}else if(M===" "){const E=/^[,.]?\s+/.exec(m);if(E){const P=E[0].replace(/\s+/g," ");A=xe(m.slice(E[0].length),g[M],{...p,path:I+P})}}else if(M==="j"||M==="d"){const E=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(m);E&&(A=xe(m.slice(E[0].length),g[M],{...p,day:E[0],path:I+M}))}else if(M==="n"||M==="m"){const E=/^(0?[1-9]|1[012])\b/.exec(m);E&&(A=xe(m.slice(E[0].length),g[M],{...p,month:+E[0],_mon:E[0],path:I+M}))}else if(M==="F"||M==="M"){const E=/^([a-z]{3,9})\b/i.exec(m),P=E&&(M==="F"?Te:De)[E[0].toLowerCase()];P&&(A=xe(m.slice(E[0].length),g[M],{...p,month:P,_mon:E[0],path:I+M}))}else if(M==="l"||M==="D"){const E=/^([a-z]{3,9})\b/i.exec(m);(E&&Ce[E[0].toLowerCase()])===M&&(A=xe(m.slice(E[0].length),g[M],{...p,path:I+M}))}else if(M==="y"){const E=/^\d\d\b/.exec(m);if(E){const P=+E[0]>=30?+E[0]+1900:+E[0]+2e3;A=xe(m.slice(E[0].length),g[M],{...p,year:P,path:I+M})}}else if(M==="Y"){const E=/^\d\d\d\d\b/.exec(m);E&&(A=xe(m.slice(E[0].length),g[M],{...p,year:+E[0],path:I+M}))}else{if(M!=="x")throw new Error('Unknown date token "'.concat(M,'"'));{const E=Ue(m);E&&(A=xe("",g[M],{...p,time:E.v,tf:E.z,path:I+M}))}}if(A)return A}}};function Ve(m,g){const p=xe(m.trim(),F,{path:""});if(p){var I;if(p.sep==="."&&p.path.length===3)return null;const b=+((I=p.year)!==null&&I!==void 0?I:He);if(p.day||(p.day=1),!function(M,E,P){if(P<1||E<1||E>12)return!1;if(E===2){if(P>(M%4==0&&M%100!=0||M%400==0||M===1900?29:28))return!1}else if((E===4||E===6||E===9||E===11)&&P>30||(E===1||E===3||E===5||E===7||E===8||E===10||E===12)&&P>31)return!1;return!0}(b,p.month,p.day))return null;let N=-1/0;if(b<1900)return null;b<=1900&&p.month<=2?N=25568:b<1e4&&(N=25569);const A=Date.UTC(b,p.month-1,p.day)/864e5+N+(p.time||0);if(A>=0&&A<=2958465){const M=p._mon[0]==="0"||p.day[0]==="0"||p._mon.length===2&&p.day.length===2,E=p.path.replace(/[jdlDnmMFyYx-]/g,P=>P==="j"||P==="d"?M?"dd":"d":P==="D"?"ddd":P==="l"?"dddd":P==="n"||P==="m"?M?"mm":"m":P==="M"?"mmm":P==="F"?"mmmm":P==="y"?"yy":P==="x"?p.tf||"":P==="Y"?"yyyy":P);return g&&g.nativeDate?{v:ur(A,g),z:E}:{v:A,z:E}}}return null}function Ue(m){const g=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(m);if(g){const[,p,I,b,N,A]=g;if(N&&!b||!A&&!I&&!b)return null;let M=1*(p||0);if(A){if(M>=13)return null;A[0]!=="p"&&A[0]!=="P"||(M+=12)}return{v:(60*M*60+60*(1*(I||0))+1*(b||0)+1*(N||0))/86400,z:(p.length===2?"hh":"h")+":mm"+(b?":ss":"")+(A?" AM/PM":"")}}return null}function nt(m){return/^\s*true\s*$/i.test(m)?{v:!0}:/^\s*false\s*$/i.test(m)?{v:!1}:null}const Je={};function Tt(m,g){const{pattern:p,partitions:I,locale:b}=m,N=E=>{const P=Object.assign({},x(),g,E);return b&&(P.locale=b),P},A=(E,P)=>{const Z=N(P);return function(U,Q,ae){const W=u(ae.locale),w=Q[3]?Q[3]:pe;if(typeof U=="boolean"&&(U=U?"TRUE":"FALSE"),U==null)return"";if(typeof U!="number")return X(U,w,ae,W);if(!isFinite(U)){const re=W||f;return isNaN(U)?re.nan:(U<0?re.negative:"")+re.infinity}const k=q(U,Q);return k?X(U,k,ae,W):ae.overflow}(Et(E,Z),I,Z)};A.color=(E,P)=>function(Z,U){if(typeof Z!="number"||!isFinite(Z))return(U[3]?U[3].color:pe.color)||Ee;const Q=q(Z,U);return Q&&Q.color||Ee}(Et(E,N(P)),I);const M=function(E){var P;let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[U,Q]=E,ae=U.frac_max,W={type:"general",isDate:v(E),isText:D(E),isPercent:hr(E),maxDecimals:U.general?9:ae,scale:(P=U.scale)!==null&&P!==void 0?P:1,color:0,parentheses:0,grouped:U.grouping?1:0,_partitions:E},w=!W.isDate&&!W.isText&&!U.error&&U.tokens.some(Se=>Se.type==="string"&&(Z?Se.value===Z:L.test(Se.value)));let k="G",re=ae>=0?Math.min(15,ae):"",ue="",Ie="";if(Q&&Q.color&&(Ie="-",W.color=1),U.parens&&(ue="()",W.parentheses=1),w)k="C",W.type="currency";else if(U.error)W.type="error",W.maxDecimals=0;else if(W.isDate){let Se=0,Le=0,st="";U.tokens.forEach(ee=>{const We=ee.type;/^(b-)?year/.test(We)?(st+="Y",Le++):We.startsWith("month")?(st+="M",Le++):/^(week)?day/.test(We)?(st+="D",Le++):We!=="hour"&&We!=="min"&&We!=="sec"&&We!=="am"||(st+=We[0],Se++)}),W.type="date",Le&&Se?W.type="datetime":!Le&&Se&&(W.type="time");const ct=ne.find(ee=>st.startsWith(ee[0]));k=ct?"D":"G",re=ct?ct[1]:""}else W.isText?(k="G",W.type="text",re="",W.maxDecimals=0):U.general?(k="G",W.type="general",re=""):U.fractions?(k="G",W.type="fraction",re=""):U.exponential?(k="S",W.type="scientific"):W.isPercent?(k="P",W.type="percent"):U.grouping?(k=",",W.type="grouped"):(U.int_max||ae)&&(k="F",W.type="number");return W.code=k+re+Ie+ue,W.level=K[W.type],Object.freeze(W)}(I,(g||{}).currency)||new SyntaxError;return A.info=M,A.dateInfo=function(E){const[P]=E;return{year:!!(2&P.date),month:!!(4&P.date),day:!!(8&P.date),hours:!!(16&P.date),minutes:!!(32&P.date),seconds:!!(64&P.date),clockType:P.clock===12?12:24}}(I),A.isPercent=()=>!!M.isPercent,A.isDate=()=>!!M.isDate,A.isText=()=>!!M.isText,A.pattern=p,m.error&&(A.error=m.error),A.options=N,A.locale=b||g&&g.locale||"",Object.freeze(A)}function Oe(m,g){m||(m="General");let p=null;return Je[m]?p=Je[m]:(p=Object.assign({},x(),g).throws?je(m):function(I){try{return je(I)}catch(b){const N={tokens:[{type:"error"}],error:b.message};return{pattern:I,partitions:[N,N,N,N],error:b.message,locale:null}}}(m),p.error||(Je[m]=p)),Tt(p,g)}Oe.isDate=m=>Oe(m,{throws:!1}).isDate(),Oe.isPercent=m=>Oe(m,{throws:!1}).isPercent(),Oe.isText=m=>Oe(m,{throws:!1}).isText(),Oe.getInfo=(m,g)=>Oe(m,{...g,throws:!1}).info,Oe.getDateInfo=(m,g)=>Oe(m,{...g,throws:!1}).dateInfo,Oe.dateToSerial=Et,Oe.dateFromSerial=ur,Oe.options=x,Oe.dec2frac=C,Oe.round=_,Oe.codeToLocale=s,Oe.parseLocale=l,Oe.getLocale=u,Oe.addLocale=(m,g)=>{const p=l(g);return delete Je[p.lang],delete Je[p.language],d(m,p)},Oe.format=function(m,g,p){let I=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const b=p&&typeof p=="object"?p:{locale:p,throws:!I};return Oe(m,b)(Et(g,b),b)},Oe.is_date=Oe.isDate,Oe.parseNumber=dt,Oe.parseDate=Ve,Oe.parseTime=Ue,Oe.parseBool=nt,Oe.parseValue=function(m,g){var p,I,b;return(p=(I=(b=dt(m))!==null&&b!==void 0?b:Ve(m,g))!==null&&I!==void 0?I:Ue(m))!==null&&p!==void 0?p:nt(m)};var rt=Oe;return r=r.default}()})})(Sl);var rm=Sl.exports,sm=rm;const im=qs(sm),om=im;function Wt(e){let t=0;const n=Object.keys(e);for(const r of n){const s=Number(r);t=Math.max(t,s)}return t+1}function Ts(e,t,n){const r=Wt(n),s=n;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=t}function Ms(e,t,n){const r=Object.keys(n).reduce((s,i)=>Math.max(s,Number.parseInt(i)),0)+1;for(let s=e;s<r;s++)s<e+t?delete n[s]:n[s]!==void 0&&(n[s-t]=n[s],delete n[s])}function am(e,t){const n=e,r=Object.keys(n),s=r.length,i=t,o=Object.keys(i),a=o.length,l={};let c=0;for(let u=0;u<s;u++,c++){const h=r[u];l[c]=n[h]}for(let u=0;u<a;u++,c++){const h=o[u];l[c]=i[h]}return l}function lm(e,t,n){const r=n;if(Wt(n)>0){const i={};let o=0;for(let a=e;a<=t;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function Ls(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?cm(e,t,n,r):um(e,t,n,r)}function cm(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e-1;o>=n;o--){const a=s[o];s[o+t]=a,a===void 0&&delete s[o+t]}i.forEach((o,a)=>{s[n+a]=o,o===void 0&&delete s[n+a]})}function um(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e+t;o<n;o++){const a=s[o];s[o-t]=a,a===void 0&&delete s[o-t]}i.forEach((o,a)=>{s[n+a-t]=o,o===void 0&&delete s[n+a-t]})}class wt{constructor(t={}){R(this,"_matrix");this._setOriginValue(t)}static MakeObjectMatrixSize(t){return new wt({[t-1]:{}})}getMatrix(){return this._matrix}forEach(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,o)===!1)return this}return this}forRow(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(t){const n=this._matrix;for(const r in n){const s=Number(r),i=n[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(t(s,a,l)===!1)return this}}return this}swapRow(t,n){const r=this._matrix[t],s=this._matrix[n];this._matrix[t]=s,this._matrix[n]=r}getRow(t){return this._matrix[t]}getRowOrCreate(t){let n=this.getRow(t);return n==null&&(n={},this._matrix[t]=n),n}reset(){this._setOriginValue({})}hasValue(){const t=this._matrix,n=Object.keys(t);if(n.length===0)return!1;for(const r of n){const s=Number(r),i=t[s];if(Object.keys(i).length>0)return!0}return!1}getValue(t,n){var r,s;return(s=(r=this._matrix)==null?void 0:r[t])==null?void 0:s[n]}setValue(t,n,r){const s=this.getRowOrCreate(t);s[n]=r}deleteValue(t,n){var r,s;(s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n]}realDeleteValue(t,n){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n],this.getRow(t)){const o=this.getRow(t);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[t])}}setRow(t,n){this._matrix[t]=n}moveRows(t,n,r){Ls(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{Ls(t,n,r,i)})}insertRows(t,n){for(let r=t;r<t+n;r++)Ts(r,{},this._matrix)}insertColumns(t,n){for(let r=t;r<t+n;r++)this.forEach((s,i)=>{i&&Ts(r,void 0,i)})}removeRows(t,n){Ms(t,n,this._matrix)}removeColumns(t,n){this.forEach((r,s)=>{s&&Ms(t,n,s)})}getFragment(t,n,r,s){const i=new wt;let o=0;for(let a=t;a<=n;a++){const l={};let c=0;for(let u=r;u<=s;u++){const h=this.getValue(a,u);l[c]=h,c++}i.setRow(o,l),o++}return i}getSlice(t,n,r,s){const i=new wt;for(let o=t;o<=n;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,$.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Wt(this._matrix)}getRange(){const r=this.getLength()-1;let s=0;const i=this.getLength();for(let o=0;o<i;o++){const a=this.getRow(o);if(a){const l=Wt(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}toNativeArray(){const t=new Array;return this.forValue((n,r,s)=>{t.push(s)}),t}toArray(){const t=[];return this.forRow((n,r)=>{t[n]==null&&(t[n]=[]),r.forEach(s=>{t[n][s]=this.getValue(n,s)})}),t}toFullArray(){const t=this.getRange(),{endColumn:n,endRow:r}=t,s=[];for(let i=0;i<=r;i++){const o=new Array(n+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getData(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getArrayData(){let t=0,n=0,r=!1,s=!1;const i=new wt;return this.forEach((o,a)=>{r||(r=!0,t=o),Object.keys(a).forEach(l=>{const c=Number(l);s?c<n&&(n=c):(s=!0,n=c);const u=this.getValue(o,c);i.setValue(o-t,c-n,u)})}),i.getData()}getStartEndScope(){let t=1/0,n=-1/0,r=1/0,s=-1/0;const i=Object.keys(this._matrix);i.length>0&&(t=+i[0],n=+i[i.length-1]);for(const o of i){const a=Object.keys(this._matrix[o]);a.length>0&&(r=Math.min(r,+a[0]),s=Math.max(s,+a[a.length-1]))}return{startRow:t,endRow:n,startColumn:r,endColumn:s}}getDataRange(){let t=0,n=0,r=0,s=-1,i=!1,o=!1;return this.forEach((a,l)=>{if(i||(i=!0,t=a),l==null)return;const c=Wt(l)-1;c>r&&(r=c),Object.keys(l).forEach(u=>{const h=Number(u);o?h<n&&(n=h):(o=!0,n=h)}),a>s&&(s=a)}),{startRow:t,startColumn:n,endRow:s,endColumn:r}}getDiscreteRanges(){const t=[];return this.forEach((n,r)=>{Object.keys(r).forEach(s=>{const i=Number(s);let o=!1;for(const a of t)if(n>=a.startRow&&n<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(n,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||t.push({startRow:n,endRow:n,startColumn:i,endColumn:i})})}),t}merge(t){this.forValue((n,r)=>{const s=t.getValue(n,r);s!=null&&this.setValue(n,r,s)})}_setOriginValue(t={}){this._matrix=t}}const hm={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},dm={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},fm={startRow:0,startColumn:0,endRow:0,endColumn:0},gm={row:0,column:0},et={ff:"Arial",fs:11,it:Re.FALSE,bl:Re.FALSE,ul:{s:Re.FALSE},st:{s:Re.FALSE},ol:{s:Re.FALSE},tr:{a:0,v:Re.FALSE},td:Xn.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:Ht.UNSPECIFIED,vt:Zt.UNSPECIFIED,tb:en.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null},Ol={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},pm=[ni,fa,ri];var bl=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(bl||{});function mr(e,t){const{textRuns:n=[]}=t;let r=0;for(const i of n){const{ts:o={},st:a,ed:l}=i;if(o[e]==null)return Re.FALSE;switch(e){case"bl":case"it":{if(o[e]===Re.FALSE)return Re.FALSE;break}case"ul":case"st":{if(o[e].s===Re.FALSE)return Re.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
7
- `)===r?Re.TRUE:Re.FALSE}const zn=class zn{constructor(t,n,r){R(this,"_range");R(this,"_worksheet");this._deps=r,this._range=n,this._worksheet=t}static foreach(t,n){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)n(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=[];for(let o=t;o<=n;o++){const a=[];for(let l=r;l<=s;l++)a.push(this.getMatrix().getValue(o,l)||null);i.push(a)}return i}getMatrix(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new wt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new wt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a-t,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=$.numToWord(r+1)+(t+1),o=$.numToWord(s+1)+(n+1)):(i=$.numToWord(s+1)+(n+1),o=$.numToWord(r+1)+(t+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||et.bg.rgb}))}getCell(t,n){const{startRow:r,startColumn:s}=this._range,i={startRow:r+t,endRow:r+t,startColumn:s+n,endColumn:s+n};return new zn(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(t={}){return this.getObjectValues(t)[0][0]}getObjectValues(t={}){var a;const{startRow:n,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(n,r,s,i).getData();if(t.isIncludeStyle){const l=this._deps.getStyles();for(let c=0;c<=r-n;c++)for(let u=0;u<=i-s;u++){if(o==null||((a=o==null?void 0:o[c])==null?void 0:a[u])==null)continue;const h=o[c][u].s;h&&(o[c][u].s=l.get(h))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||et.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?mr("ul",t.body)===Re.TRUE?{s:Re.TRUE}:{s:Re.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?mr("st",t.body)===Re.TRUE?{s:Re.TRUE}:{s:Re.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var n,r;const t=((n=this.getValue())==null?void 0:n.p)||{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?t.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...t.body.textRuns.map(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)||0})):this.getFontSizes()[0][0]:this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?mr("it",t.body)===Re.TRUE?Mr.ITALIC:Mr.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?mr("bl",t.body)===Re.TRUE?Lr.BOLD:Lr.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:t,_worksheet:n}=this,{startRow:r,endRow:s}=t;let i=0;for(let o=0;o<=s-r;o++){const a=n.getRowHeight(o);i+=a}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:t,endColumn:n}=this._range;return n-t+1}getNumRows(){const{startRow:t,endRow:n}=this._range;return n-t+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(t=>t.map(n=>(n==null?void 0:n.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>t.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:t,_worksheet:n}=this,{startColumn:r,endColumn:s}=t;let i=0;for(let o=0;o<=s-r;o++)i+=n.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===en.WRAP?Re.TRUE:Re.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){zn.foreach(this._range,t)}_getStyles(t){const n=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=n&&n.getStyleByCell(s);return i&&i[t]||et[t]}))}};R(zn,"transformRange",(t,n)=>{const r=n.getMaxColumns()-1,s=n.getMaxRows()-1;return t.rangeType===me.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:t.rangeType===me.COLUMN?{startRow:0,endRow:s,startColumn:t.startColumn,endColumn:t.endColumn}:t.rangeType===me.ROW?{startColumn:0,endColumn:r,startRow:t.startRow,endRow:t.endRow}:{startColumn:t.startColumn,endColumn:Math.min(t.endColumn,r),startRow:t.startRow,endRow:Math.min(t.endRow,s)}});let vn=zn;function mm(e,t,n,r=!1){if(t===0&&n===0)return e;let s={...e};const i=s.startAbsoluteRefType||ze.NONE,o=s.endAbsoluteRefType||ze.NONE,a=s.rangeType||me.NORMAL;if(!r&&i===ze.ALL&&o===ze.ALL)return s;const l=_o(s.startRow,n,s.startColumn,t,a),c=_o(s.endRow,n,s.endColumn,t,a);return r||i===ze.NONE&&o===ze.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:c.row,endColumn:c.column}:(i===ze.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===ze.COLUMN?s={...s,startRow:l.row}:i===ze.ROW&&(s={...s,startColumn:l.column}),o===ze.NONE?s={...s,endRow:c.row,endColumn:c.column}:o===ze.COLUMN?s={...s,endRow:c.row}:o===ze.ROW&&(s={...s,endColumn:c.column}),s)}function _o(e,t,n,r,s){return s===me.NORMAL?{row:e+t,column:n+r}:s===me.ROW?{row:e+t,column:n}:s===me.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function yl(e){const t=new Set,n=new Set;for(const o of e)t.add(o.startColumn),t.add(o.endColumn+1),n.add(o.startRow),n.add(o.endRow+1);const r=Array.from(t).sort((o,a)=>o-a),s=Array.from(n).sort((o,a)=>o-a);e.sort((o,a)=>o.startRow-a.startRow||o.startColumn-a.startColumn);const i=[];for(let o=0;o<s.length-1;o++)for(let a=0;a<r.length-1;a++){const l=r[a],c=r[a+1]-1,u=s[o],h=s[o+1]-1;for(const d of e){if(d.startRow>h)break;if(d.startRow<=u&&d.endRow>=h&&d.startColumn<=l&&d.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:u,endRow:h});break}}}return i}function _m(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const t={};for(const r of e)t[r.startRow]||(t[r.startRow]=[]),t[r.startRow].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startColumn-a.startColumn);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startColumn<=i.endColumn+1&&a.startRow===i.startRow&&a.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,a.endColumn):(n.push(i),i=a)}n.push(i)}return n}function Em(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const t={};for(const r of e)t[r.startColumn]||(t[r.startColumn]=[]),t[r.startColumn].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startRow-a.startRow);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startRow<=i.endRow+1&&a.startColumn===i.startColumn&&a.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,a.endRow):(n.push(i),i=a)}n.push(i)}return n}function Rm(e){const t=yl(e),n=_m(t);return Em(n)}function Cm(e,t){const n=[];return e.forEach(r=>{n.push(...zt.subtract(r,t))}),zt.mergeRanges(n)}function Im(e,t){const n=Eo(e.startRow,e.endRow,t.startRow,t.endRow),r=Eo(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=vm(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function Eo(e,t,n,r){const s=isNaN(e)?-1/0:e,i=isNaN(t)?1/0:t,o=isNaN(n)?-1/0:n,a=isNaN(r)?1/0:r,l=Math.max(s,o),c=Math.min(i,a);if(l<=c){const u=l===-1/0?Number.NaN:l,h=c===1/0?Number.NaN:c;return[u,h]}else return null}function vm(e,t,n,r,s,i){const o=e!==void 0?e:Ro(n,r,s,i),a=t!==void 0?t:Ro(n,r,s,i);return o===me.ALL||a===me.ALL?o===a?o:o===me.ALL?a:o:o===a?o:(o===me.NORMAL||a===me.NORMAL,me.NORMAL)}function Ro(e,t,n,r){const s=!isNaN(e)&&!isNaN(t),i=!isNaN(n)&&!isNaN(r);return s&&i?me.NORMAL:s?me.ROW:i?me.COLUMN:me.ALL}const Lt=class Lt{static clone(t){return t.rangeType!==void 0?{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType}:{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn}}static equals(t,n){return t==null||n==null?!1:t.endRow===n.endRow&&t.endColumn===n.endColumn&&t.startRow===n.startRow&&t.startColumn===n.startColumn&&(t.rangeType===n.rangeType||t.rangeType===void 0&&n.rangeType===me.NORMAL||n.rangeType===void 0&&t.rangeType===me.NORMAL)}static simpleRangesIntersect(t,n){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=t,{startRow:a,endRow:l,startColumn:c,endColumn:u}=n,h=r<=l&&s>=a,d=i<=u&&o>=c;return h&&d}static intersects(t,n){if(t.rangeType===me.ROW&&n.rangeType===me.COLUMN||t.rangeType===me.COLUMN&&n.rangeType===me.ROW)return!0;if(t.rangeType===me.ROW&&n.rangeType===me.ROW)return t.startRow<=n.endRow&&t.endRow>=n.startRow;if(t.rangeType===me.COLUMN&&n.rangeType===me.COLUMN)return t.startColumn<=n.endColumn&&t.endColumn>=n.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(t.startRow)?0:t.startRow,i=Number.isNaN(t.endRow)?r:t.endRow,o=Number.isNaN(t.startColumn)?0:t.startColumn,a=Number.isNaN(t.endColumn)?r:t.endColumn,l=Number.isNaN(n.startRow)?0:n.startRow,c=Number.isNaN(n.endRow)?r:n.endRow,u=Number.isNaN(n.startColumn)?0:n.startColumn,h=Number.isNaN(n.endColumn)?r:n.endColumn,d=Math.abs(o+a-u-h),f=Math.abs(o-a)+Math.abs(u-h),_=Math.abs(s+i-l-c),C=Math.abs(s-i)+Math.abs(l-c);return d<=f&&_<=C}static getIntersects(t,n){const r=t.startRow,s=t.endRow,i=t.startColumn,o=t.endColumn,a=n.startRow,l=n.endRow,c=n.startColumn,u=n.endColumn;let h,d,f,_;if(a<=s)a>=r?d=a:d=r;else return null;if(l>=r)l>=s?_=s:_=l;else return null;if(c<=o)c>i?h=c:h=i;else return null;if(u>=i)u>=o?f=o:f=u;else return null;return{startRow:d,endRow:_,startColumn:h,endColumn:f,rangeType:me.NORMAL}}static contains(t,n){return t.startRow<=n.startRow&&t.endRow>=n.endRow&&t.startColumn<=n.startColumn&&t.endColumn>=n.endColumn}static realContain(t,n){return Lt.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...t){return t.reduce((n,r)=>({startRow:Math.min(n.startRow,r.startRow),startColumn:Math.min(n.startColumn,r.startColumn),endRow:Math.max(n.endRow,r.endRow),endColumn:Math.max(n.endColumn,r.endColumn),rangeType:me.NORMAL}),t[0])}static realUnion(...t){const n=t.some(i=>i.rangeType===me.COLUMN),r=t.some(i=>i.rangeType===me.ROW),s=Lt.union(...t);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:n?Number.NaN:s.startRow,endRow:n?Number.NaN:s.endRow,rangeType:r?me.ROW:n?me.COLUMN:me.NORMAL}}static subtract(t,n){if(n.startRow>t.endRow||n.endRow<t.startRow||n.startColumn>t.endColumn||n.endColumn<t.startColumn)return[t];const r=[];n.startRow>=t.startRow&&r.push({startRow:t.startRow,startColumn:t.startColumn,endRow:n.startRow-1,endColumn:t.endColumn}),n.endRow<=t.endRow&&r.push({startRow:n.endRow+1,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn});const s=Math.max(t.startRow,n.startRow),i=Math.min(t.endRow,n.endRow);return n.startColumn>=t.startColumn&&r.push({startRow:s,startColumn:t.startColumn,endRow:i,endColumn:n.startColumn-1}),n.endColumn<=t.endColumn&&r.push({startRow:s,startColumn:n.endColumn+1,endRow:i,endColumn:t.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(t){return Rm(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=Cm(r,s)}),r}static hasIntersectionBetweenTwoRect(t,n){return!(t.left>n.right||t.right<n.left||t.top>n.bottom||t.bottom<n.top)}static getIntersectionBetweenTwoRect(t,n){const r=Math.max(t.left,n.left),s=Math.min(t.right,n.right),i=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(t){return t.sort((n,r)=>n.startRow-r.startRow||n.startColumn-r.startColumn)}};R(Lt,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),R(Lt,"getPositionRange",(t,n,r)=>({...r||{},startRow:r&&[ze.ROW,ze.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:t.startRow+n.startRow,endRow:r&&[ze.ROW,ze.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:t.endRow+t.startRow+n.startRow,startColumn:r&&[ze.COLUMN,ze.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:t.startColumn+n.startColumn,endColumn:r&&[ze.COLUMN,ze.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:t.endColumn+t.startColumn+n.startColumn})),R(Lt,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),R(Lt,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),R(Lt,"moveOffset",(t,n,r)=>({...t,startRow:t.startRow+r,endRow:t.endRow+r,startColumn:t.startColumn+n,endColumn:t.endColumn+n}));let zt=Lt;function Sm(e,t){if(e.length===0||e[0].length===0)return null;const n=new Array(e[0].length).fill(0);let r=0,s=null;for(let i=0;i<e.length;i++){for(let a=0;a<e[0].length;a++)n[a]=t(e[i][a])?n[a]+1:0;const o=Om(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function Om(e){const t=[];let n=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(t.length===0||e[s]>=e[t[t.length-1]])t.push(s++);else{const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}for(;t.length>0;){const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}return r}function bm(e,t){vn.foreach(t,(n,r)=>{e[n][r]=void 0})}function ym(e,t){const n=e.toFullArray(),r=[];for(;;){const s=Sm(n,t);if(!s)break;r.push(s),bm(n,s)}return r}class wm{constructor(t,n){R(this,"_values",[]);R(this,"_keys",[]);R(this,"_keyMaps",new Map);this._values=t,this._keys=n,t.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(t){this._keys.forEach(n=>{const r=t[n],s=this._keyMaps.get(n)||new Map;s.set(r,t),this._keyMaps.set(n,s)})}getValue(t,n){const r=n||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(t))return i.get(t)}return null}hasValue(t){for(let n=0;n<this._keys.length;n++){const r=this._keyMaps.get(this._keys[n]);if(r!=null&&r.has(t))return!0}return!1}addValue(t){this._values.push(t),this._initKeyMap(t)}setValue(t,n,r){const s=this.getValue(t);s&&Object.keys(s).includes(n)&&(s[n]=r)}deleteValue(t,n){const r=this.getValue(t,n);if(r){this._keys.forEach(i=>{const o=this._keyMaps.get(i),a=r[i];o==null||o.delete(a)});const s=this._values.findIndex(i=>i===r);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(t){var n;return[...((n=this._keyMaps.get(t))==null?void 0:n.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function Ds(e,t,n,r){return{forEach(s){for(let i=e;i<=t;i++)for(let o=n;o<=r;o++)s(i,o)}}}function Am(e){if(e==null||e.length===0)return Number.NaN;const t=e.toLowerCase().split(""),n=t.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<n;o++)i=r(t[o]),s+=i*26**(n-o-1);return s===0?Number.NaN:s-1}const Pr=65,wl=90,Nm=97;function Tm(e){const t=wl-Pr+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+Pr)+n,e=Math.floor(e/t)-1;return n}function Al(e,t){let n="";for(;t>0;)n+=e,t--;return n}function Mm(e,t=!1){const n=wl-Pr+1;let r=Nm;t&&(r=Pr);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return Al(s,i)}function Lm(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function Dm(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function ar(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}var ye=(e=>(e[e.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",e[e.UNIVER_DOC=1]="UNIVER_DOC",e[e.UNIVER_SHEET=2]="UNIVER_SHEET",e[e.UNIVER_SLIDE=3]="UNIVER_SLIDE",e[e.UNIVER_PROJECT=4]="UNIVER_PROJECT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(ye||{}),bt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(bt||{}),xs=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(xs||{});class Qr extends Ge{}function xm(e=$.generateRandomId(6),t=or.EN_US,n=""){return{id:e,locale:t,title:n,body:{dataStream:`\r
8
- `,textRuns:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},marginTop:50,marginBottom:50,marginRight:40,marginLeft:40,renderConfig:{vertexAngle:0,centerAngle:0}},settings:{}}}var ot={},Nl={},gi={};Object.defineProperty(gi,"__esModule",{value:!0});function Um(e,t){if(Array.isArray(t))return!1;for(let n in e)if(!pi(e[n],t[n]))return!1;for(let n in t)if(e[n]===void 0)return!1;return!0}function Pm(e,t){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!pi(e[n],t[n]))return!1;return!0}function pi(e,t){return e===t?!0:e===null||t===null||typeof e!="object"||typeof t!="object"?!1:Array.isArray(e)?Pm(e,t):Um(e,t)}gi.default=pi;var mi={};Object.defineProperty(mi,"__esModule",{value:!0});function Us(e){if(e===null)return null;if(Array.isArray(e))return e.map(Us);if(typeof e=="object"){const t={};for(let n in e)t[n]=Us(e[n]);return t}else return e}mi.default=Us;var _i={};(function(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(u,h){if(!u)throw new Error(h)}const n=u=>u!=null&&typeof u=="object"&&!Array.isArray(u),r=(u,h)=>typeof u==typeof h?u>h:typeof u=="string"&&typeof h=="number";function s(u,h){for(let d in u){const f=d;h.write(f,u[f])}}e.isValidPathItem=u=>typeof u=="number"||typeof u=="string"&&u!=="__proto__";class i{constructor(h=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=h}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(){const h=[];let d=this.container,f=this.parents.length-1,_=this.idx;for(;_>=0;)h.unshift(d[_]),_===0?(_=this.indexes[f*2],d=this.parents[f--]):_-=n(d[_-1])?2:1;return h}}class o extends i{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 h;return this.container&&this.container.length>this.idx+1&&n(h=this.container[this.idx+1])?h:null}descendFirst(){let h=this.idx+1;if(!this.container||h>=this.container.length||n(this.container[h])&&h+1>=this.container.length)return!1;n(this.container[h])&&h++;const d=this.container[h];return Array.isArray(d)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(h),this.idx=0,this.container=d):this.idx=h,!0}nextSibling(){if(t(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const h=this.indexes[this.indexes.length-1]+1,d=this.parents[this.parents.length-1];return h>=d.length?!1:(t(!isNaN(h)),this.indexes[this.indexes.length-1]=h,this.container=d[h],!0)}_init(h,d,f,_){this.container=h,this.idx=d,this.parents=f.slice(),this.indexes=_.slice()}clone(){const h=new o;return h._init(this.container,this.idx,this.parents,this.indexes),h}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(h,d){const f=this.getComponent();f&&d(f,h);for(const _ of this)h&&h.descend(_),this.traverse(h,d),h&&h.ascend()}eachPick(h,d){this.traverse(h,(f,_)=>{f.p!=null&&d(f.p,_)})}eachDrop(h,d){this.traverse(h,(f,_)=>{f.d!=null&&d(f.d,_)})}}e.ReadCursor=o;class a extends i{constructor(h=null){super(h),this.pendingDescent=[],this._op=h}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let h=0;h<this.pendingDescent.length;h++){const d=this.pendingDescent[h];let f=this.idx+1;if(f<this.container.length&&n(this.container[f])&&f++,t(f===this.container.length||!n(this.container[f])),f===this.container.length)this.container.push(d),this.idx=f;else if(this.container[f]===d)this.idx=f;else{if(!Array.isArray(this.container[f])){const _=this.container.splice(f,this.container.length-f);this.container.push(_),this.lcIdx>-1&&(this.lcIdx=f)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(d,this.container[this.lcIdx][0])),f=this.lcIdx+1,this.lcIdx=-1);f<this.container.length&&r(d,this.container[f][0]);)f++;if(this.indexes.push(f),this.idx=0,f<this.container.length&&this.container[f][0]===d)this.container=this.container[f];else{const _=[d];this.container.splice(f,0,_),this.container=_}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const h=this.idx+1;if(h<this.container.length&&n(this.container[h]))return this.container[h];{const d={};return this.container.splice(h,0,d),d}}write(h,d){const f=this.getComponent();t(f[h]==null||f[h]===d,"Internal consistency error: Overwritten component. File a bug"),f[h]=d}get(){return this._op}descend(h){if(!e.isValidPathItem(h))throw Error("Invalid JSON key");this.pendingDescent.push(h)}descendPath(h){return this.pendingDescent.push(...h),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(h,d=s){if(h===null)return;if(t(Array.isArray(h)),h===this._op)throw Error("Cannot merge into my own tree");const f=this.lcIdx,_=this.parents.length;let C=0;for(let T=0;T<h.length;T++){const S=h[T];typeof S=="string"||typeof S=="number"?(C++,this.descend(S)):Array.isArray(S)?this.mergeTree(S,d):typeof S=="object"&&d(S,this)}for(;C--;)this.ascend();this.lcIdx=this.parents.length===_?f:-1}at(h,d){this.descendPath(h),d(this);for(let f=0;f<h.length;f++)this.ascend();return this}writeAtPath(h,d,f){return this.at(h,()=>this.write(d,f)),this.reset(),this}writeMove(h,d,f=0){return this.writeAtPath(h,"p",f).writeAtPath(d,"d",f)}getPath(){const h=super.getPath();return h.push(...this.pendingDescent),h}}e.WriteCursor=a,e.writeCursor=()=>new a,e.readCursor=u=>new o(u);function l(u,h,d){let f,_;_=f=u?u.descendFirst():!1;function C(T){let S;for(;_;){const x=S=u.getKey();if(T!=null){let B=!1;if(h&&typeof x=="number"&&(S=h(x,u.getComponent()),S<0&&(S=~S,B=!0)),r(S,T))return null;if(S===T&&!B)return u}d&&typeof S=="number"&&d(S,u.getComponent()),_=u.nextSibling()}return null}return C.end=()=>{f&&u.ascend()},C}e.advancer=l;function c(u,h,d){let f,_,C,T;for(f=_=u&&u.descendFirst(),C=T=h&&h.descendFirst();f||C;){let S=f?u.getKey():null,x=C?h.getKey():null;S!==null&&x!==null&&(r(x,S)?x=null:S!==x&&(S=null)),d(S==null?x:S,S!=null?u:null,x!=null?h:null),S!=null&&f&&(f=u.nextSibling()),x!=null&&C&&(C=h.nextSibling())}_&&u.ascend(),T&&h.ascend()}e.eachChildOf=c})(_i);var Ei={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,function(t){t[t.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",t[t.DROP_COLLISION=2]="DROP_COLLISION",t[t.BLACKHOLE=3]="BLACKHOLE"}(e.ConflictType||(e.ConflictType={}))})(Ei);var as={},Jt={},Co;function Ri(){return Co||(Co=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.uniToStrPos=Jt.strPosToUni=void 0,Jt.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(n++,r++)}if(r!==t)throw Error("Invalid offset - splits unicode bytes");return r-n},Jt.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),Jt}var ls={},Io;function Ps(){return Io||(Io=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=Ri(),n=y=>{if(!Array.isArray(y))throw Error("Op must be an array of components");let O=null;for(let L=0;L<y.length;L++){const z=y[L];switch(typeof z){case"object":if(typeof z.d!="number"&&typeof z.d!="string")throw Error("Delete must be number or string");if(e.dlen(z.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(z.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(z>0))throw Error("Skip components must be >0");if(typeof O=="number")throw Error("Adjacent skip components should be combined");break}O=z}if(typeof O=="number")throw Error("Op has a trailing skip")};function r(y,O){let L=0,z=0;for(let ge=0;ge<y.length;ge++){const de=y[ge];switch(O(de,L,z),typeof de){case"object":L+=e.dlen(de.d);break;case"string":z+=t.strPosToUni(de);break;case"number":L+=de,z+=de;break}}}e.eachOp=r;function s(y,O){const L=[],z=a(L);return r(y,(ge,de,be)=>{z(O(ge,de,be))}),h(L)}const i=y=>y,o=y=>s(y,i);e.dlen=y=>typeof y=="number"?y:t.strPosToUni(y);const a=y=>O=>{if(!(!O||O.d===0||O.d===""))if(y.length===0)y.push(O);else if(typeof O==typeof y[y.length-1])if(typeof O=="object"){const L=y[y.length-1];L.d=typeof L.d=="string"&&typeof O.d=="string"?L.d+O.d:e.dlen(L.d)+e.dlen(O.d)}else y[y.length-1]+=O;else y.push(O)},l=y=>typeof y=="number"?y:typeof y=="string"?t.strPosToUni(y):typeof y.d=="number"?y.d:t.strPosToUni(y.d);e.uniSlice=(y,O,L)=>{const z=t.uniToStrPos(y,O),ge=L==null?1/0:t.uniToStrPos(y,L);return y.slice(z,ge)};const c=(y,O,L)=>typeof y=="number"?L==null?y-O:Math.min(y,L)-O:e.uniSlice(y,O,L),u=y=>{let O=0,L=0;return{take:(de,be)=>{if(O===y.length)return de===-1?null:de;const we=y[O];let Me;if(typeof we=="number")return de===-1||we-L<=de?(Me=we-L,++O,L=0,Me):(L+=de,de);if(typeof we=="string"){if(de===-1||be==="i"||t.strPosToUni(we.slice(L))<=de)return Me=we.slice(L),++O,L=0,Me;{const je=L+t.uniToStrPos(we.slice(L),de);return Me=we.slice(L,je),L=je,Me}}else{if(de===-1||be==="d"||e.dlen(we.d)-L<=de)return Me={d:c(we.d,L)},++O,L=0,Me;{let je=c(we.d,L,L+de);return L+=de,{d:je}}}},peek:()=>y[O]}},h=y=>(y.length>0&&typeof y[y.length-1]=="number"&&y.pop(),y);function d(y,O,L){if(L!=="left"&&L!=="right")throw Error("side ("+L+") must be 'left' or 'right'");n(y),n(O);const z=[],ge=a(z),{take:de,peek:be}=u(y);for(let Me=0;Me<O.length;Me++){const je=O[Me];let Ae,tt;switch(typeof je){case"number":for(Ae=je;Ae>0;)tt=de(Ae,"i"),ge(tt),typeof tt!="string"&&(Ae-=l(tt));break;case"string":L==="left"&&typeof be()=="string"&&ge(de(-1)),ge(t.strPosToUni(je));break;case"object":for(Ae=e.dlen(je.d);Ae>0;)switch(tt=de(Ae,"i"),typeof tt){case"number":Ae-=tt;break;case"string":ge(tt);break;case"object":Ae-=e.dlen(tt.d)}break}}let we;for(;we=de(-1);)ge(we);return h(z)}function f(y,O){n(y),n(O);const L=[],z=a(L),{take:ge}=u(y);for(let be=0;be<O.length;be++){const we=O[be];let Me,je;switch(typeof we){case"number":for(Me=we;Me>0;)je=ge(Me,"d"),z(je),typeof je!="object"&&(Me-=l(je));break;case"string":z(we);break;case"object":Me=e.dlen(we.d);let Ae=0;for(;Ae<Me;)switch(je=ge(Me-Ae,"d"),typeof je){case"number":z({d:c(we.d,Ae,Ae+je)}),Ae+=je;break;case"string":Ae+=t.strPosToUni(je);break;case"object":z(je)}break}}let de;for(;de=ge(-1);)z(de);return h(L)}const _=(y,O)=>{let L=0;for(let z=0;z<O.length&&y>L;z++){const ge=O[z];switch(typeof ge){case"number":{L+=ge;break}case"string":const de=t.strPosToUni(ge);L+=de,y+=de;break;case"object":y-=Math.min(e.dlen(ge.d),y-L);break}}return y},C=(y,O)=>typeof y=="number"?_(y,O):y.map(L=>_(L,O));function T(y,O,L){return s(y,(z,ge)=>typeof z=="object"&&typeof z.d=="number"?{d:L.slice(O,ge,ge+z.d)}:z)}function S(y){return s(y,O=>{switch(typeof O){case"object":if(typeof O.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return O.d;case"string":return{d:O};case"number":return O}})}function x(y){return s(y,O=>typeof O=="object"&&typeof O.d=="string"?{d:t.strPosToUni(O.d)}:O)}function B(y){let O=!0;return r(y,L=>{typeof L=="object"&&typeof L.d=="number"&&(O=!1)}),O}function V(y){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:h,normalize:o,checkOp:n,create(O=""){if(typeof O!="string")throw Error("Initial data must be a string");return y.create(O)},apply(O,L){n(L);const z=y.builder(O);for(let ge=0;ge<L.length;ge++){const de=L[ge];switch(typeof de){case"number":z.skip(de);break;case"string":z.append(de);break;case"object":z.del(e.dlen(de.d));break}}return z.build()},transform:d,compose:f,transformPosition:_,transformSelection:C,isInvertible:B,makeInvertible(O,L){return T(O,L,y)},stripInvertible:x,invert:S,invertWithDoc(O,L){return S(T(O,L,y))},isNoop:O=>O.length===0}}e.default=V}(ls)),ls}var _r={},vo;function Fm(){if(vo)return _r;vo=1,Object.defineProperty(_r,"__esModule",{value:!0});const e=Ps(),t=Ri();function n(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=t.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=t.strPosToUni(r(),i);return s([l,{d:o}],a)},_onOp(i){e.eachOp(i,(o,a,l)=>{switch(typeof o){case"string":this.onInsert&&this.onInsert(l,o);break;case"object":const c=e.dlen(o.d);this.onRemove&&this.onRemove(l,c)}})},onInsert:null,onRemove:null}}return _r.default=n,n.provides={text:!0},_r}var So;function km(){return So||(So=1,function(e){var t=at&&at.__createBinding||(Object.create?function(d,f,_,C){C===void 0&&(C=_),Object.defineProperty(d,C,{enumerable:!0,get:function(){return f[_]}})}:function(d,f,_,C){C===void 0&&(C=_),d[C]=f[_]}),n=at&&at.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=at&&at.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var _ in d)Object.hasOwnProperty.call(d,_)&&t(f,d,_);return n(f,d),f},s=at&&at.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=Ri(),o=r(Ps()),a=s(Fm()),l={create(d){return d},toString(d){return d},builder(d){if(typeof d!="string")throw Error("Invalid document snapshot: "+d);const f=[];return{skip(_){let C=i.uniToStrPos(d,_);if(C>d.length)throw Error("The op is too long for this document");f.push(d.slice(0,C)),d=d.slice(C)},append(_){f.push(_)},del(_){d=d.slice(i.uniToStrPos(d,_))},build(){return f.join("")+d}}},slice:o.uniSlice},c=o.default(l),u=Object.assign(Object.assign({},c),{api:a.default});e.type=u,e.insert=(d,f)=>f.length===0?[]:d===0?[f]:[d,f],e.remove=(d,f)=>o.dlen(f)===0?[]:d===0?[{d:f}]:[d,{d:f}];var h=Ps();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return h.default}})}(as)),as}(function(e){var t=at&&at.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const n=t(gi),r=t(mi),s=_i,i=Ei;function o(v,D){if(!v)throw new Error(D)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:v=>v,isNoop:v=>v==null,setDebug(v){},registerSubtype:S,checkValidOp:ge,normalize:de,apply:be,transformPosition:we,compose:Me,tryTransform:an,transform:An,makeInvertible:tt,invert:je,invertWithDoc:qr,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(v,D,K)=>hr(()=>!0,v,D,K),typeAllowingConflictsPred:v=>Object.assign(Object.assign({},e.type),{transform:(D,K,ne)=>hr(v,D,K,ne)})};const a=v=>v?v.getComponent():null;function l(v){return v&&typeof v=="object"&&!Array.isArray(v)}const c=v=>Array.isArray(v)?v.slice():v!==null&&typeof v=="object"?Object.assign({},v):v,u=v=>v&&(v.p!=null||v.r!==void 0),h=v=>v&&(v.d!=null||v.i!==void 0);function d(v,D){return o(v!=null),typeof D=="number"?(o(Array.isArray(v),"Invalid key - child is not an array"),(v=v.slice()).splice(D,1)):(o(l(v),"Invalid key - child is not an object"),delete(v=Object.assign({},v))[D]),v}function f(v,D,K){return typeof D=="number"?(o(v!=null,"Container is missing for key"),o(Array.isArray(v),"Cannot use numerical key for object container"),o(v.length>=D,"Cannot insert into out of bounds index"),v.splice(D,0,K)):(o(l(v),"Cannot insert into missing item"),o(v[D]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),v[D]=K),K}e.removeOp=(v,D=!0)=>s.writeCursor().writeAtPath(v,"r",D).get(),e.moveOp=(v,D)=>s.writeCursor().writeMove(v,D).get(),e.insertOp=(v,D)=>s.writeCursor().writeAtPath(v,"i",D).get(),e.replaceOp=(v,D,K)=>s.writeCursor().at(v,ne=>{ne.write("r",D),ne.write("i",K)}).get(),e.editOp=(v,D,K,ne=!1)=>s.writeCursor().at(v,Y=>O(Y,D,K,ne)).get();const _=(v,D)=>v!=null&&(typeof D=="number"?Array.isArray(v):typeof v=="object"),C=(v,D)=>_(v,D)?v[D]:void 0,T={};function S(v){let D=v.type?v.type:v;D.name&&(T[D.name]=D),D.uri&&(T[D.uri]=D)}const x=v=>{const D=T[v];if(D)return D;throw Error("Missing type: "+v)};S(km());const B=(v,D)=>v+D;S({name:"number",apply:B,compose:B,invert:v=>-v,transform:v=>v});const V=v=>v==null?null:v.et?x(v.et):v.es?T["text-unicode"]:v.ena!=null?T.number:null,y=v=>v.es?v.es:v.ena!=null?v.ena:v.e,O=(v,D,K,ne=!1)=>{const[Y,J]=typeof D=="string"?[x(D),D]:[D,D.name];!ne&&Y.isNoop&&Y.isNoop(K)||(J==="number"?v.write("ena",K):J==="text-unicode"?v.write("es",K):(v.write("et",J),v.write("e",K)))};function L(v){o(typeof v=="number"),o(v>=0),o(v===(0|v))}function z(v){typeof v=="number"?L(v):o(typeof v=="string")}function ge(v){if(v===null)return;const D=new Set,K=new Set,ne=J=>{let _e=!0,ce=!1;for(let j in J){const G=J[j];if(_e=!1,o(j==="p"||j==="r"||j==="d"||j==="i"||j==="e"||j==="es"||j==="ena"||j==="et","Invalid component item '"+j+"'"),j==="p")L(G),o(!D.has(G)),D.add(G),o(J.r===void 0);else if(j==="d")L(G),o(!K.has(G)),K.add(G),o(J.i===void 0);else if(j==="e"||j==="es"||j==="ena"){o(!ce),ce=!0;const X=V(J);o(X,"Missing type in edit"),X.checkValidOp&&X.checkValidOp(y(J))}}o(!_e)},Y=(J,_e,ce)=>{if(!Array.isArray(J))throw Error("Op must be null or a list");if(J.length===0)throw Error("Empty descent");_e||z(J[0]);let j=1,G=0,X=0;for(let q=0;q<J.length;q++){const pe=J[q];if(o(pe!=null),Array.isArray(pe)){const Ee=Y(pe,!1);if(G){const F=typeof X,se=typeof Ee;F===se?o(X<Ee,"descent keys are not in order"):o(F==="number"&&se==="string")}X=Ee,G++,j=3}else typeof pe=="object"?(o(j===1,`Prev not scalar - instead ${j}`),ne(pe),j=2):(o(j!==3),z(pe),o(s.isValidPathItem(pe),"Invalid path key"),j=1)}return o(G!==1,"Operation makes multiple descents. Remove some []"),o(j===2||j===3),J[0]};Y(v,!0),o(D.size===K.size,"Mismatched picks and drops in op");for(let J=0;J<D.size;J++)o(D.has(J)),o(K.has(J))}function de(v){let D=0,K=[];const ne=s.writeCursor();return ne.mergeTree(v,(Y,J)=>{const _e=V(Y);if(_e){const j=y(Y);O(J,_e,_e.normalize?_e.normalize(j):j)}for(const j of["r","p","i","d"])if(Y[j]!==void 0){const G=j==="p"||j==="d"?(ce=Y[j],K[ce]==null&&(K[ce]=D++),K[ce]):Y[j];J.write(j,G)}var ce}),ne.get()}function be(v,D){if(ge(D),D===null)return v;const K=[];return function ne(Y,J){let _e=Y,ce=0,j={root:Y},G=0,X=j,q="root";function pe(){for(;G<ce;G++){let Ee=J[G];typeof Ee!="object"&&(o(_(X,q)),X=X[q]=c(X[q]),q=Ee)}}for(;ce<J.length;ce++){const Ee=J[ce];if(Array.isArray(Ee)){const F=ne(_e,Ee);F!==_e&&F!==void 0&&(pe(),_e=X[q]=F)}else if(typeof Ee=="object"){Ee.d!=null?(pe(),_e=f(X,q,K[Ee.d])):Ee.i!==void 0&&(pe(),_e=f(X,q,Ee.i));const F=V(Ee);if(F)pe(),_e=X[q]=F.apply(_e,y(Ee));else if(Ee.e!==void 0)throw Error("Subtype "+Ee.et+" undefined")}else _e=C(_e,Ee)}return j.root}(v=function ne(Y,J){const _e=[];let ce=0;for(;ce<J.length;ce++){const q=J[ce];if(Array.isArray(q))break;typeof q!="object"&&(_e.push(Y),Y=C(Y,q))}for(let q=J.length-1;q>=ce;q--)Y=ne(Y,J[q]);for(--ce;ce>=0;ce--){const q=J[ce];if(typeof q!="object"){const pe=_e.pop();Y=Y===C(pe,q)?pe:Y===void 0?d(pe,q):(G=q,X=Y,(j=c(j=pe))[G]=X,j)}else u(q)&&(o(Y!==void 0,"Cannot pick up or remove undefined"),q.p!=null&&(K[q.p]=Y),Y=void 0)}var j,G,X;return Y}(v,D),D)}function we(v,D){v=v.slice(),ge(D);const K=s.readCursor(D);let ne,Y,J=!1;const _e=[];for(let j=0;;j++){const G=v[j],X=K.getComponent();if(X&&(X.r!==void 0?J=!0:X.p!=null&&(J=!1,ne=X.p,Y=j)),j>=v.length)break;let q=0;const pe=s.advancer(K,void 0,(F,se)=>{u(se)&&q++});_e.unshift(pe);const Ee=pe(G);if(typeof G=="number"&&(v[j]-=q),!Ee)break}if(_e.forEach(j=>j.end()),J)return null;const ce=()=>{let j=0;if(ne!=null){const G=K.getPath();j=G.length,v=G.concat(v.slice(Y))}for(;j<v.length;j++){const G=v[j],X=a(K),q=V(X);if(q){const F=y(X);q.transformPosition&&(v[j]=q.transformPosition(v[j],F));break}let pe=0;const Ee=s.advancer(K,(F,se)=>h(se)?~(F-pe):F-pe,(F,se)=>{h(se)&&pe++})(G);if(typeof G=="number"&&(v[j]+=pe),!Ee)break}};return ne!=null?K.eachDrop(null,j=>{j===ne&&ce()}):ce(),v}function Me(v,D){if(ge(v),ge(D),v==null)return D;if(D==null)return v;let K=0;const ne=s.readCursor(v),Y=s.readCursor(D),J=s.writeCursor(),_e=[],ce=[],j=[],G=[],X=[],q=[],pe=new Set;ne.traverse(null,F=>{F.p!=null&&(j[F.p]=ne.clone())}),Y.traverse(null,F=>{F.d!=null&&(G[F.d]=Y.clone())});const Ee=s.writeCursor();return function F(se,De,Te,Ce,He,dt,xe,Ve){o(De||Te);const Ue=a(De),nt=a(Te),Je=!!nt&&nt.r!==void 0,Tt=!!Ue&&Ue.i!==void 0,Oe=Ue?Ue.d:null,rt=nt?nt.p:null,m=(dt||Je)&&rt==null;if(rt!=null)Ce=G[rt],xe=ce[rt]=new s.WriteCursor;else if(nt&&nt.r!==void 0)Ce=null;else{const w=a(Ce);w&&w.d!=null&&(Ce=null)}const g=a(Ce);if(Oe!=null)if(se=j[Oe],Ve=_e[Oe]=new s.WriteCursor,m)dt&&!Je&&Ve.write("r",!0);else{const w=X[Oe]=K++;xe.write("d",w)}else if(Ue&&Ue.i!==void 0)se=null;else{const w=a(se);w&&w.p!=null&&(se=null)}let p;Tt?(o(He===void 0),p=Ue.i):p=He;const I=(rt==null?!Tt||dt||Je:p===void 0)?null:xe.getComponent();if(rt!=null){if(!(He!==void 0||Tt)){const w=Oe!=null?X[Oe]:K++;q[rt]=w,Ve.write("p",w)}}else Je&&(Tt||He!==void 0||(nt.r,Ve.write("r",nt.r)));const b=m?null:V(Ue),N=V(g);if((b||N)&&(b&&b.name,N&&N.name),b&&N){o(b===N);const w=y(Ue),k=y(g),re=b.compose(w,k);O(xe,b,re),pe.add(g)}else b?O(xe,b,y(Ue)):N&&(O(xe,N,y(g)),pe.add(g));const A=typeof p=="object"&&p!=null;let M=!1,E=0,P=0,Z=0,U=0,Q=0;const ae=s.advancer(Ce,(w,k)=>h(k)?U-w-1:w-U,(w,k)=>{h(k)&&U++}),W=s.advancer(se,(w,k)=>u(k)?E-w-1:w-E,(w,k)=>{u(k)&&E++});if(s.eachChildOf(De,Te,(w,k,re)=>{let ue,Ie,Se=w,Le=w,st=w;if(typeof w=="number"){let fe=w+Z;Ie=ae(fe),Le=fe+U;let H=w+P;ue=W(H),h(a(Ie))&&(ue=null),Se=H+E,st=w+Q,o(Se>=0,"p1PickKey is negative"),o(Le>=0,"p2DropKey is negative");const qe=h(a(k)),Ne=u(a(re));(qe||Ne&&!m)&&Q--,qe&&P--,Ne&&Z--}else ue=W(w),Ie=ae(w);Ve.descend(Se),xe.descend(Le);const ct=A&&!h(a(k))?p[st]:void 0,ee=F(ue,k,re,Ie,ct,m,xe,Ve);var We,oe,ie;A&&!m?ct!==ee&&(M||(p=Array.isArray(p)?p.slice():Object.assign({},p),M=!0),We=p,ie=ee,typeof(oe=st)=="number"?(o(Array.isArray(We)),o(oe<We.length)):(o(!Array.isArray(We)),o(We[oe]!==void 0)),ie===void 0?typeof oe=="number"?We.splice(oe,1):delete We[oe]:We[oe]=ie):o(ee===void 0),xe.ascend(),Ve.ascend()}),W.end(),ae.end(),I!=null)I.i=p;else if(!dt&&!Je&&rt==null)return p}(ne,ne.clone(),Y,Y.clone(),void 0,!1,J,Ee),J.reset(),J.mergeTree(Ee.get()),J.reset(),J.get(),_e.map(F=>F.get()),ce.map(F=>F.get()),ne.traverse(J,(F,se)=>{const De=F.p;if(De!=null){const Te=X[De];Te!=null&&se.write("p",Te);const Ce=_e[De];Ce&&Ce.get(),Ce&&se.mergeTree(Ce.get())}else F.r!==void 0&&se.write("r",F.r)}),J.reset(),J.get(),Y.traverse(J,(F,se)=>{const De=F.d;if(De!=null){const Ce=q[De];Ce!=null&&se.write("d",Ce);const He=ce[De];He&&se.mergeTree(He.get())}else F.i!==void 0&&se.write("i",F.i);const Te=V(F);Te&&!pe.has(F)&&O(se,Te,y(F))}),J.get()}function je(v){if(v==null)return null;const D=new s.ReadCursor(v),K=new s.WriteCursor;let ne;const Y=[],J=[];return function _e(ce,j,G){const X=ce.getComponent();let q,pe=!1;if(X){X.p!=null&&(j.write("d",X.p),Y[X.p]=ce.clone()),X.r!==void 0&&j.write("i",X.r),X.d!=null&&(j.write("p",X.d),G=void 0),X.i!==void 0&&(G=q=X.i);const F=V(X);F&&(G===void 0?(ne||(ne=new Set),ne.add(X)):(y(X),G=F.apply(G,y(X)),pe=!0))}let Ee=0;for(const F of ce){j.descend(F);const se=typeof F=="number"?F-Ee:F,De=C(G,se);h(ce.getComponent())&&Ee++;const Te=_e(ce,j,De);if(G!==void 0&&Te!==void 0){if(pe||(pe=!0,G=c(G)),!_(G,se))throw Error("Cannot modify child - invalid operation");G[se]=Te}j.ascend()}if(q===void 0)return pe?G:void 0;j.write("r",G)}(D,K,void 0),ne&&(K.reset(),function _e(ce,j,G){const X=j.getComponent();if(X){const F=X.d;if(F!=null&&(ce=Y[F],G=J[F]=s.writeCursor()),ne.has(X)){const se=V(X);if(!se.invert)throw Error(`Cannot invert subtype ${se.name}`);O(G,se,se.invert(y(X)))}}let q=0,pe=0;const Ee=s.advancer(ce,(F,se)=>u(se)?q-F-1:F-q,(F,se)=>{u(se)&&q++});for(const F of j)if(typeof F=="number"){const se=F-pe,De=Ee(se),Te=se+q;G.descend(Te),_e(De,j,G),h(j.getComponent())&&pe++,G.ascend()}else G.descend(F),_e(Ee(F),j,G),G.ascend();Ee.end()}(D.clone(),D,K),J.length&&(K.reset(),D.traverse(K,(_e,ce)=>{const j=_e.p;if(j!=null){const G=J[j];G&&G.get(),G&&ce.mergeTree(G.get())}}))),K.get()}const Ae=(v,D)=>v.some(K=>typeof K=="object"&&(Array.isArray(K)?Ae(K,D):D(K)));function tt(v,D){if(v==null||!Ae(v,j=>{var G;return j.r!==void 0||((G=V(j))===null||G===void 0?void 0:G.makeInvertible)!=null}))return v;const K=new s.ReadCursor(v),ne=new s.WriteCursor;let Y=!1;const J=[],_e=[],ce=(j,G,X)=>{const q=j.getComponent();let pe=!1;if(q){q.d!=null&&G.write("d",q.d),q.i!==void 0&&G.write("i",q.i);const F=q.p;if(F!=null&&(J[F]=j.clone(),o(X!==void 0,"Operation picks up at an invalid key"),_e[F]=X,G.write("p",q.p)),q.r!==void 0&&X===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const se=V(q);se&&(se.makeInvertible?Y=!0:O(G,se,y(q),!0))}let Ee=0;for(const F of j){G.descend(F);const se=typeof F=="number"?F-Ee:F,De=C(X,se),Te=ce(j,G,De);De!==Te&&(pe||(pe=!0,X=c(X)),Te===void 0?(X=d(X,se),typeof F=="number"&&Ee++):X[se]=Te),G.ascend()}return q&&(q.r!==void 0?(G.write("r",r.default(X)),X=void 0):q.p!=null&&(X=void 0)),X};return ce(K,ne,D),ne.get(),Y&&(ne.reset(),function j(G,X,q,pe,Ee){const F=X.getComponent();if(F){F.i!==void 0?(pe=F.i,Ee=!0):F.d!=null&&(pe=_e[F.d],G=J[F.d],Ee=!1,F.d);let Ce=V(F);if(Ce&&Ce.makeInvertible){const He=y(F);O(q,Ce,Ce.makeInvertible(He,pe),!0)}}let se=0,De=0;const Te=s.advancer(G,(Ce,He)=>u(He)?se-Ce-1:Ce-se,(Ce,He)=>{u(He)&&se++});for(const Ce of X)if(typeof Ce=="number"){const He=Ce-De,dt=Te(He),xe=He+se,Ve=C(pe,Ee?He:xe);q.descend(Ce),j(dt,X,q,Ve,Ee),h(X.getComponent())&&De++,q.ascend()}else{const He=C(pe,Ce);q.descend(Ce),j(Te(Ce),X,q,He,Ee),q.ascend()}Te.end()}(K.clone(),K,ne,D,!1)),ne.get()}function qr(v,D){return je(tt(v,D))}const wn=v=>{if(v==null)return null;const D=v.slice();for(let K=0;K<v.length;K++){const ne=D[K];Array.isArray(ne)&&(D[K]=wn(ne))}return D};function an(v,D,K){o(K==="left"||K==="right","Direction must be left or right");const ne=K==="left"?0:1;if(D==null)return{ok:!0,result:v};ge(v),ge(D);let Y=null;const J=[],_e=[],ce=[],j=[],G=[],X=[],q=[],pe=[],Ee=[],F=[],se=[],De=[],Te=[],Ce=[],He=[];let dt=0;const xe=s.readCursor(v),Ve=s.readCursor(D),Ue=s.writeCursor();if(function g(p,I=null,b){const N=a(I);N&&(N.r!==void 0?b=I.clone():N.p!=null&&(b=null,X[N.p]=p.clone()));const A=p.getComponent();let M;A&&(M=A.p)!=null&&(G[M]=I?I.clone():null,ce[M]=p.clone(),b&&(F[M]=!0,Ee[M]=b),N&&N.p!=null&&(Ce[M]=N.p));const E=s.advancer(I);for(const P of p)g(p,E(P),b);E.end()}(Ve,xe,null),function g(p,I,b,N,A){const M=b.getComponent();let E,P=!1;M&&((E=M.d)!=null?(j[E]=b.clone(),N!=null&&(He[N]==null&&(He[N]=[]),He[N].push(E)),p=G[E]||null,I=ce[E]||null,F[E]?(A&&(se[E]=!0),A=Ee[E]||null):!A||ne!==1&&Ce[E]!=null||Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(A.getPath()),op2:e.moveOp(I.getPath(),b.getPath())}),P=!0):M.i!==void 0&&(p=I=null,P=!0,A&&Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(A.getPath()),op2:e.insertOp(b.getPath(),M.i)})));const Z=a(p);Z&&(Z.r!==void 0?A=p.clone():Z.p!=null&&(Z.p,N=Z.p,A=null));const U=V(M);U&&A&&Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(A.getPath()),op2:e.editOp(b.getPath(),U,y(M),!0)});let Q=0,ae=0;const W=s.advancer(I,(k,re)=>u(re)?Q-k-1:k-Q,(k,re)=>{u(re)&&Q++}),w=s.advancer(p);for(const k of b)if(typeof k=="number"){const re=k-ae,ue=W(re);ae+=+g(w(re+Q),ue,b,N,A)}else{const re=W(k);g(w(k),re,b,N,A)}return W.end(),w.end(),P}(xe,Ve,Ve.clone(),null,null),j.map(g=>g&&g.get()),Y)return{ok:!1,conflict:Y};se.map(g=>!!g);const nt=[];let Je=null;(function g(p,I,b,N,A){let M=!1;const E=a(I);if(u(E)){const W=E.p;W!=null?(b=j[W],N=De[W]=s.writeCursor(),M=!0,A=null):(b=null,A=I.clone())}else h(a(b))&&(b=null);const P=p.getComponent();if(P){const W=P.p;W!=null?(A&&(pe[W]=A),nt[W]=A||ne===1&&M?null:N.getComponent(),J[W]=p.clone(),b&&(q[W]=b.clone())):P.r!==void 0&&(A||N.write("r",!0),(A||M)&&(Je==null&&(Je=new Set),Je.add(P)))}let Z=0,U=0;const Q=s.advancer(I,void 0,(W,w)=>{u(w)&&Z++}),ae=s.advancer(b,(W,w)=>h(w)?~(W-U):W-U,(W,w)=>{h(w)&&U++});if(p)for(const W of p)if(typeof W=="string"){const w=Q(W),k=ae(W);N.descend(W),g(p,w,k,N,A),N.ascend()}else{const w=Q(W),k=W-Z,re=u(a(w))?null:ae(k),ue=k+U;o(ue>=0),N.descend(ue),g(p,w,re,N,A),N.ascend()}Q.end(),ae.end()})(xe,Ve,Ve.clone(),Ue,null),Ue.reset();let Tt=[];if(function g(p,I,b,N,A,M){o(I);const E=I.getComponent();let P=a(N),Z=!1;const U=(oe,ie,fe)=>oe?e.moveOp(oe.getPath(),ie.getPath()):e.insertOp(ie.getPath(),fe.i);if(h(E)){const oe=E.d;oe!=null&&(_e[oe]=I.clone());const ie=oe!=null?nt[oe]:null;let fe=!1;if(E.i!==void 0||oe!=null&&ie){let H;P&&(P.i!==void 0||(H=P.d)!=null&&!F[H])&&(fe=H!=null?oe!=null&&oe===Ce[H]:n.default(P.i,E.i),fe||H!=null&&ne!==1&&Ce[H]!=null||Y==null&&(Y={type:i.ConflictType.DROP_COLLISION,op1:U(oe!=null?J[oe]:null,I,E),op2:U(H!=null?ce[H]:null,N,P)})),fe||(M?Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:U(oe!=null?J[oe]:null,I,E),op2:e.removeOp(M.getPath())}):(oe!=null?(Tt[dt]=oe,A.write("d",ie.p=dt++)):A.write("i",r.default(E.i)),Z=!0))}else if(oe!=null&&!ie){const H=pe[oe];H&&(M=H.clone())}oe!=null?(p=J[oe],b=X[oe],N=q[oe]):E.i!==void 0&&(p=b=null,fe||(N=null))}else u(a(p))&&(p=b=N=null);const Q=a(p),ae=a(b);if(u(ae)){const oe=ae.p;ae.r!==void 0&&(!Q||Q.r===void 0)||F[oe]?(N=null,M=b.clone()):oe!=null&&(N=j[oe],ne!==1&&Ce[oe]!=null||((A=Te[oe])||(A=Te[oe]=s.writeCursor()),A.reset(),M=null))}else!h(E)&&h(P)&&(N=null);P=N!=null?N.getComponent():null;const W=V(E);if(W){const oe=y(E);if(M)Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(I.getPath(),W,oe,!0),op2:e.removeOp(M.getPath())});else{const ie=V(P);let fe;if(ie){if(W!==ie)throw Error("Transforming incompatible types");const H=y(P);fe=W.transform(oe,H,K)}else fe=r.default(oe);O(A,W,fe)}}let w=0,k=0,re=0,ue=0,Ie=0,Se=0,Le=p!=null&&p.descendFirst(),st=Le;const ct=s.advancer(b,void 0,(oe,ie)=>{u(ie)&&re++});let ee=N!=null&&N.descendFirst(),We=ee;for(const oe of I)if(typeof oe=="number"){let ie;const fe=h(I.getComponent()),H=oe-k;{let Ft;for(;Le&&typeof(Ft=p.getKey())=="number";){Ft+=w;const Rt=p.getComponent(),ln=u(Rt);if(Ft>H||Ft===H&&(!ln||ne===0&&fe))break;if(ln){w--;const Yt=Rt.p;Ce.includes(Yt),Rt.d,a(Te[Rt.d]),u(a(Te[Rt.d])),(Rt.r===void 0||Je&&Je.has(Rt))&&(Yt==null||!nt[Yt]||ne!==1&&Ce.includes(Yt))||Ie--}Le=p.nextSibling()}ie=Le&&Ft===H?p:null}const qe=H-w;let Ne=ct(qe);const St=qe-re;let dr=null;{let Ft,Rt;for(;ee&&typeof(Ft=N.getKey())=="number";){Rt=Ft-ue;const ln=N.getComponent(),Yt=h(ln);if(Rt>St)break;if(Rt===St){if(!Yt){dr=N;break}{if(ne===0&&fe){dr=N;break}const Xt=Ne&&u(Ne.getComponent());if(ne===0&&Xt)break}}if(Yt){const Xt=ln.d;Ce[Xt],ln.i===void 0&&(F[Xt]||Ce[Xt]!=null&&ne!==1)?(F[Xt]||Ce[Xt]!=null&&ne===0)&&(ue++,Se--):ue++}ee=N.nextSibling()}}const Ti=St+ue+Ie+Se;o(Ti>=0,"trying to descend to a negative index"),A.descend(Ti),fe&&(ie=Ne=dr=null,k++),g(ie,I,Ne,dr,A,M)&&Se++,A.ascend()}else{let ie;for(;Le&&(ie=p.getKey(),typeof ie!="string"||!(ie>oe||ie===oe));)Le=p.nextSibling();const fe=Le&&ie===oe?p:null,H=ct(oe);let qe;for(;ee&&(qe=N.getKey(),typeof qe!="string"||!(qe>oe||qe===oe));)ee=N.nextSibling();const Ne=ee&&qe===oe?N:null;A.descend(oe),g(fe,I,H,Ne,A,M),A.ascend()}return ct.end(),st&&p.ascend(),We&&N.ascend(),Z}(xe,xe.clone(),Ve,Ve.clone(),Ue,null),Y)return{ok:!1,conflict:Y};Ue.reset();const Oe=(g,p,I)=>g.traverse(p,(b,N)=>{b.d!=null&&I(b.d,g,N)});(F.length||De.length)&&(Oe(Ve,Ue,(g,p,I)=>{F[g]&&!se[g]&&I.write("r",!0),De[g]&&I.mergeTree(De[g].get())}),Ue.reset());const rt=[],m=[];if((Te.length||F.length)&&!Y){const g=s.readCursor(wn(Ue.get()));if(Oe(g,null,(p,I)=>{rt[p]=I.clone()}),Te.forEach(p=>{p&&Oe(s.readCursor(p.get()),null,(I,b)=>{rt[I]=b.clone()})}),function p(I,b,N,A,M,E){const P=a(b);if(P&&u(P))if(P.p!=null){const w=P.p;rt[w].getPath(),N=rt[w],A=m[w]=s.writeCursor()}else P.r!==void 0&&(N=null);else h(a(N))&&(N=null);const Z=I.getComponent();if(Z){let w;if((w=Z.d)!=null){const k=Te[w];k&&(k.get(),A.mergeTree(k.get()),N=s.readCursor(k.get()))}}let U=0,Q=0;const ae=s.advancer(b,void 0,(w,k)=>{u(k)&&U--}),W=s.advancer(N,(w,k)=>h(k)?-(w-Q)-1:w-Q,(w,k)=>{h(k)&&Q++});for(const w of I)if(typeof w=="number"){const k=ae(w),re=w+U,ue=W(re),Ie=re+Q;A.descend(Ie),p(I,k,ue,A),A.ascend()}else A.descend(w),p(I,ae(w),W(w),A),A.ascend();ae.end(),W.end()}(Ve,g,g.clone(),Ue),Ue.reset(),Y)return{ok:!1,conflict:Y};if(Ue.get(),m.length){const p=m.map(b=>b?b.get():null),I=s.readCursor(wn(Ue.get()));if(Oe(I,Ue,(b,N,A)=>{const M=p[b];M&&(A.mergeTree(M),p[b]=null)}),p.find(b=>b)){const b=s.writeCursor(),N=s.writeCursor();let A=0,M=0;p.forEach(E=>{E!=null&&Oe(s.readCursor(E),null,P=>{const Z=Tt[P];b.writeMove(J[Z].getPath(),_e[Z].getPath(),A++);const U=He[Z];U&&U.forEach(Q=>{F[Q]||ne!==1&&Ce[Q]!=null||N.writeMove(ce[Q].getPath(),j[Q].getPath(),M++)})})}),Y={type:i.ConflictType.BLACKHOLE,op1:b.get(),op2:N.get()}}}}return Y?{ok:!1,conflict:Y}:{ok:!0,result:Ue.get()}}const Kt=v=>{const D=new Error("Transform detected write conflict");throw D.conflict=v,D.type=D.name="writeConflict",D};function An(v,D,K){const ne=an(v,D,K);if(ne.ok)return ne.result;Kt(ne.conflict)}const Et=v=>{const D=s.writeCursor();return s.readCursor(v).traverse(D,(K,ne)=>{(h(K)||V(K))&&ne.write("r",!0)}),D.get()},ur=(v,D)=>{const{type:K,op1:ne,op2:Y}=v;switch(K){case i.ConflictType.DROP_COLLISION:return D==="left"?[null,Et(Y)]:[Et(ne),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let J=!1;return s.readCursor(ne).traverse(null,_e=>{_e.r!==void 0&&(J=!0)}),J?[null,Et(Y)]:[Et(ne),null];case i.ConflictType.BLACKHOLE:return[Et(ne),Et(Y)];default:throw Error("Unrecognised conflict: "+K)}};function hr(v,D,K,ne){let Y=null;for(;;){const J=an(D,K,ne);if(J.ok)return Me(Y,J.result);{const{conflict:_e}=J;v(_e)||Kt(_e);const[ce,j]=ur(_e,ne);D=Me(de(D),ce),K=Me(de(K),j),Y=Me(Y,j)}}}})(Nl);(function(e){var t=at&&at.__createBinding||(Object.create?function(i,o,a,l){l===void 0&&(l=a),Object.defineProperty(i,l,{enumerable:!0,get:function(){return o[a]}})}:function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]}),n=at&&at.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),n(Nl,e);var r=_i;Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=Ei;Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})})(ot);const jm=qs(ot),Hm=_u({__proto__:null,default:jm},[ot]);var te=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(te||{}),Tl=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(Tl||{}),Ml=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(Ml||{}),he=(e=>(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))(he||{}),lr=(e=>(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))(lr||{}),Qn=(e=>(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))(Qn||{}),Rn=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(Rn||{}),Ll=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(Ll||{}),Dl=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(Dl||{}),xl=(e=>(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))(xl||{}),Ul=(e=>(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))(Ul||{}),Pl=(e=>(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))(Pl||{}),Fl=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(Fl||{}),kl=(e=>(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))(kl||{}),jl=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(jl||{}),Hl=(e=>(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))(Hl||{}),Bl=(e=>(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[e.HEADING_6=9]="HEADING_6",e))(Bl||{}),$l=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))($l||{}),Wl=(e=>(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))(Wl||{}),Vl=(e=>(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))(Vl||{}),zl=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(zl||{}),Gl=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(Gl||{}),Kl=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(Kl||{}),Yl=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(Yl||{}),Xl=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Xl||{}),Ql=(e=>(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))(Ql||{}),pn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(pn||{}),Jl=(e=>(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))(Jl||{}),Zl=(e=>(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))(Zl||{}),ql=(e=>(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))(ql||{}),ec=(e=>(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))(ec||{}),tc=(e=>(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))(tc||{}),nc=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(nc||{}),rc=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(rc||{}),sc=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(sc||{}),ic=(e=>(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))(ic||{}),Ci=(e=>(e[e.SLIDE=0]="SLIDE",e[e.MASTER=1]="MASTER",e[e.LAYOUT=2]="LAYOUT",e[e.HANDOUT_MASTER=3]="HANDOUT_MASTER",e[e.NOTES_MASTER=4]="NOTES_MASTER",e))(Ci||{}),oc=(e=>(e[e.SHAPE=0]="SHAPE",e[e.IMAGE=1]="IMAGE",e[e.TEXT=2]="TEXT",e[e.SPREADSHEET=3]="SPREADSHEET",e[e.DOCUMENT=4]="DOCUMENT",e[e.SLIDE=5]="SLIDE",e))(oc||{}),ac=(e=>(e[e.RELATIVE_SLIDE_LINK_UNSPECIFIED=0]="RELATIVE_SLIDE_LINK_UNSPECIFIED",e[e.NEXT_SLIDE=1]="NEXT_SLIDE",e[e.PREVIOUS_SLIDE=2]="PREVIOUS_SLIDE",e[e.FIRST_SLIDE=3]="FIRST_SLIDE",e[e.LAST_SLIDE=4]="LAST_SLIDE",e))(ac||{}),lc=(e=>(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))(lc||{}),At=(e=>(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))(At||{});const Er={"a)":{glyphFormat:"%1)",glyphType:he.DECIMAL},"1.":{glyphFormat:"%1.",glyphType:he.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:he.LOWER_LETTER},"A.":{glyphFormat:"%1.",glyphType:he.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:he.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:he.UPPER_LETTER}},cn=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:lr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),un=e=>e.map((t,n)=>({...t,bulletAlignment:lr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),Oo=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:lr.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),cr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:cn(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:cn(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:cn(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:cn(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:cn(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:cn(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:un([{glyphFormat:"%1.",glyphType:he.DECIMAL},{glyphFormat:"%2.",glyphType:he.LOWER_LETTER},{glyphFormat:"%3.",glyphType:he.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:he.DECIMAL},{glyphFormat:"%5.",glyphType:he.LOWER_LETTER},{glyphFormat:"%6.",glyphType:he.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:he.DECIMAL},{glyphFormat:"%8.",glyphType:he.LOWER_LETTER},{glyphFormat:"%9.",glyphType:he.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:un([{glyphFormat:"%1)",glyphType:he.DECIMAL},{glyphFormat:"%2)",glyphType:he.LOWER_LETTER},{glyphFormat:"%3)",glyphType:he.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:he.DECIMAL},{glyphFormat:"%5)",glyphType:he.LOWER_LETTER},{glyphFormat:"%6)",glyphType:he.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:he.DECIMAL},{glyphFormat:"%8)",glyphType:he.LOWER_LETTER},{glyphFormat:"%9)",glyphType:he.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:un(["%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:he.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:un([{glyphFormat:"%1.",glyphType:he.UPPER_LETTER},{glyphFormat:"%2.",glyphType:he.LOWER_LETTER},{glyphFormat:"%3.",glyphType:he.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:he.UPPER_LETTER},{glyphFormat:"%5.",glyphType:he.LOWER_LETTER},{glyphFormat:"%6.",glyphType:he.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:he.UPPER_LETTER},{glyphFormat:"%8.",glyphType:he.LOWER_LETTER},{glyphFormat:"%9.",glyphType:he.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:un([{glyphFormat:"%1.",glyphType:he.UPPER_LETTER},{glyphFormat:"%2.",glyphType:he.DECIMAL},{glyphFormat:"%3.",glyphType:he.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:he.UPPER_LETTER},{glyphFormat:"%5.",glyphType:he.DECIMAL},{glyphFormat:"%6.",glyphType:he.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:he.UPPER_LETTER},{glyphFormat:"%8.",glyphType:he.DECIMAL},{glyphFormat:"%9.",glyphType:he.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:un([{glyphFormat:"%1.",glyphType:he.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:he.LOWER_LETTER},{glyphFormat:"%3.",glyphType:he.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:he.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:he.LOWER_LETTER},{glyphFormat:"%6.",glyphType:he.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:he.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:he.LOWER_LETTER},{glyphFormat:"%9.",glyphType:he.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:Oo("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:Oo("☑",{st:{s:Re.TRUE}})}},Rr=e=>{const{glyphFormat:t,glyphType:n}=e,r=$.deepClone(cr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},Bm={ORDER_LIST_QUICK_2:Rr(Er["a)"]),ORDER_LIST_QUICK_3:Rr(Er["a."]),ORDER_LIST_QUICK_4:Rr(Er["i."]),ORDER_LIST_QUICK_6:Rr(Er["I."])};Object.assign(cr,Bm);const $m={"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"};function Jr(e,t=!1){const n=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!t&&$.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();Rl(r,a)&&$.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function cc(e,t,n,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=t.textRuns)!=null?c:[];if(l.length)for(const u of l)u.st+=r,u.ed+=r;for(let u=0;u<o;u++){const h=s[u],{st:d,ed:f}=h;if(f<=r)i.push(h);else if(r>d&&r<f){a=!0;const _={...h,ed:r};i.push(_),l.length&&i.push(...l);const C={...h,st:r+n,ed:f+n};i.push(C)}else h.st+=n,h.ed+=n,a||(a=!0,i.push(...l)),i.push(h)}a||(a=!0,i.push(...l)),e.textRuns=Jr(i)}function uc(e,t,n,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=t,o=[];for(let l=0,c=s.length;l<c;l++){const u=s[l],{startIndex:h}=u;h>=r&&(u.startIndex+=n),o.push(u.startIndex)}let a=-1;if(i){for(let l=0,c=i.length;l<c;l++){const u=i[l];u.startIndex+=r;const h=u.startIndex;a=o.indexOf(h)}a!==-1&&s.splice(a,1),s.push(...i),s.sort(ar("startIndex"))}}function hc(e,t,n,r){const{sectionBreaks:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(ar("startIndex"))}}function dc(e,t,n,r){const{customBlocks:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(ar("startIndex"))}}function fc(e,t,n,r){const{tables:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c,endIndex:u}=l;c>r?(l.startIndex+=n,l.endIndex+=n):u>r&&(l.endIndex+=n)}const i=t.tables;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r,l.endIndex+=r}s.push(...i),s.sort(ar("startIndex"))}}const gc="$",bo=e=>e.split(gc)[0];function Ii(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=bo(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=bo(i.rangeId),i.rangeId===n.rangeId&&Da(n.properties,i.properties)&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}t.push(n);const r=Object.create(null);for(let s=0,i=t.length;s<i;s++){const o=t[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${gc}${r[a]}`,r[a]=r[a]+1):r[a]=1}return t}function Fs(e,t){const n=e.findIndex(s=>s.startIndex<t&&s.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 pc(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const t=[];let n={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===n.id&&n.endIndex+1>=s.startIndex?n.endIndex=s.endIndex:(t.push(n),n={...s})}return t.push(n),t}function ks(e,t){e.filter(r=>r.startIndex<t&&r.endIndex>=t).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:t-1},{id:r.id,type:r.type,startIndex:t,endIndex:r.endIndex})})}function Wm(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;Fs(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customRanges){for(let o=0,a=t.customRanges.length;o<a;o++){const l=t.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=Ii(s)}function Vm(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;ks(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customDecorations){for(let o=0,a=t.customDecorations.length;o<a;o++){const l=t.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=pc(s)}function mc(e,t,n){const{textRuns:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{st:h,ed:d}=u;if(s<=h&&i>=d){o.push({...u,st:h-s,ed:d-s});continue}else h<=s&&d>=i?(o.push({...u,st:s-s,ed:i-s}),u.ed-=t):s>=h&&s<d?(o.push({...u,st:s-s,ed:d-s}),u.ed=s):i>h&&i<=d?(o.push({...u,st:h-s,ed:i-s}),u.st=i-t,u.ed-=t):h>=i&&(u.st-=t,u.ed-=t);a.push(u)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:t,ts:{}}),o}function _c(e,t,n){const{paragraphs:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<i){o.push({...u,startIndex:h-n});continue}else h>=i&&(u.startIndex-=t);a.push(u)}e.paragraphs=a}return o}function Ec(e,t,n){const{sectionBreaks:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<=i){o.push({...u,startIndex:h-n});continue}else h>i&&(u.startIndex-=t);a.push(u)}e.sectionBreaks=a}return o}function Rc(e,t,n){const{customBlocks:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<=i){o.push({...u,startIndex:h-n});continue}else h>i&&(u.startIndex-=t);a.push(u)}e.customBlocks=a}return o}function Cc(e,t,n){const{tables:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h,endIndex:d}=u;if(s<=h&&i>=d){o.push({...u,startIndex:h-n,endIndex:d-n});continue}else if(h<=s&&d>=i){const f=Xr(h,d,s,i);if(u.startIndex=f[0],u.endIndex=f[1],u.startIndex===u.endIndex)continue}else i<h&&(u.startIndex-=t,u.endIndex-=t);a.push(u)}e.tables=a}return o}function zm(e,t,n){const{customRanges:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h,endIndex:d}=u;if(h>=s&&d<=i){o.push(u);continue}else if(Math.max(s,h)<=Math.min(i,d)){const f=Xr(h,d,s,i);u.startIndex=f[0],u.endIndex=f[1]}else i<h&&(u.startIndex-=t,u.endIndex-=t);a.push(u)}e.customRanges=Ii(a)}return o}function Gm(e,t,n,r=!0){const{customDecorations:s}=e,i=n,o=n+t-1,a=[];if(s){const l=[];for(let c=0,u=s.length;c<u;c++){const h=s[c],{startIndex:d,endIndex:f}=h;if(d>=i&&f<=o){a.push(h);continue}else if(Math.max(i,d)<=Math.min(o,f)){const _=Xr(d,f,i,o);h.startIndex=_[0],h.endIndex=_[1]}else o<d&&r&&(h.startIndex-=t,h.endIndex-=t);l.push(h)}e.customDecorations=l}return a}function Km(e,t,n,r,s){const i=Ym(e,t,n,r,s),o=Xm(e,t,n,r,s),a=Qm(e,t,n,r,s),l=Jm(e,t,n,r,s),c=Zm(e,t,n,r,s),u=qm(e,t,n,r),h=e_(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:u,customDecorations:h}}function Ym(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=mc(e,n,r);if(s!==ve.REPLACE){const l=Ic(o,a,s);t.textRuns=l}return cc(e,t,n,r),a}function Ic(e,t,n){if(t.length===0)return e;e=$.deepClone(e),t=$.deepClone(t);const r=[],s=e.length,i=t.length;let o=0,a=0,l=null;function c(){return l?(r.push(l),l=null,!0):!1}for(;o<s&&a<i;){const{st:f,ed:_,ts:C}=e[o],{st:T,ed:S,ts:x,sId:B}=t[a];let V;if(n===ve.COVER?V={...x,...C}:V={...C},_<T)c()||r.push(e[o]),o++;else if(S<f)c()||r.push(t[a]),a++;else{const y={st:Math.min(f,T),ed:Math.max(f,T),ts:f<T?{...C}:{...x},sId:f<T?void 0:B};y.ed>y.st&&r.push(y),r.push({st:Math.max(f,T),ed:Math.min(_,S),ts:V,sId:B}),_<S?(o++,t[a].st=_,t[a].st===t[a].ed&&a++):(a++,e[o].st=S,e[o].st===e[o].ed&&o++);const O={st:Math.min(_,S),ed:Math.max(_,S),ts:_<S?{...x}:{...C},sId:_<S?B:void 0};l=O.ed>O.st?O:null}}c();const u=r[r.length-1],h=e[s-1],d=t[i-1];return u&&u.ed!==Math.max(h.ed,d.ed)&&(h.ed>d.ed?r.push(h):r.push(d)),Jr(r)}function Xm(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=_c(e,n,r);if(s!==ve.REPLACE){const l=[];for(const c of o){const{startIndex:u,paragraphStyle:h,bullet:d}=c;let f=[];for(const _ of a){const{startIndex:C,paragraphStyle:T,bullet:S}=_;let x,B;if(s===ve.COVER?(x={...T,...h},B={listId:"",listType:At.BULLET_LIST,nestingLevel:0,textStyle:{},...S,...d}):(x={...h,...T},B={listId:"",listType:At.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...S}),u===C){f.push({startIndex:u,paragraphStyle:x,bullet:B});break}}l.push(...f),f=[]}t.paragraphs=l}return uc(e,t,n,r),a}function Qm(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=Ec(e,n,r);if(s!==ve.REPLACE){const l=[];for(const c of o){const{startIndex:u}=c;let h=[];for(const d of a){const{startIndex:f}=d;if(u===f){s===ve.COVER?h.push({...d,...c}):h.push({...c,...d});break}}l.push(...h),h=[]}t.sectionBreaks=l}return hc(e,t,n,r),a}function Jm(e,t,n,r,s){const{customBlocks:i}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=Rc(e,n,r);if(s!==ve.REPLACE){const l=[];for(const c of o){const{startIndex:u}=c;let h=[];for(const d of a){const{startIndex:f}=d;if(u===f){s===ve.COVER?h.push({...d,...c}):h.push({...c,...d});break}}l.push(...h),h=[]}t.customBlocks=l}return dc(e,t,n,r),a}function Zm(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=Cc(e,n,r);if(s!==ve.REPLACE){const l=[];for(const c of o){const{startIndex:u,endIndex:h}=c;let d=[];for(const f of a){const{startIndex:_,endIndex:C}=f;if(_>=u&&C<=h){s===ve.COVER?d.push({...f,...c}):d.push({...c,...f});break}}l.push(...d),d=[]}t.tables=l}return fc(e,t,n,r),a}function qm(e,t,n,r,s){e.customRanges||(e.customRanges=[]),Fs(e.customRanges,r),Fs(e.customRanges,r+n);const i=r,o=r+n-1,{customRanges:a}=t,l=[],c=new Map;e.customRanges.forEach(h=>{const{startIndex:d,endIndex:f}=h;d>=i&&f<=o?c.set(h.rangeId,h):l.push(h)});const u=[];return a?(a.forEach(h=>{const{startIndex:d,endIndex:f}=h;l.push({...h,startIndex:d+r,endIndex:f+r})}),e.customRanges=Ii(l),u):[]}function e_(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),ks(e.customDecorations,r),ks(e.customDecorations,r+n);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=t;if(s===ve.REPLACE){for(let l=0;l<o.length;l++){const c=o[l],{startIndex:u,endIndex:h}=c;u>=r&&h<=r+n-1&&i.push(c)}a.forEach(l=>{const{startIndex:c,endIndex:u}=l;o.push({...l,startIndex:c+r,endIndex:u+r})})}else for(const l of a){const{id:c}=l;if(l.type===Rn.DELETED){const u=o.filter(h=>h.id===c);u.length&&i.push(...u)}else o.push({...l,startIndex:l.startIndex+r,endIndex:l.endIndex+r})}for(const l of i){const{id:c}=l,u=o.findIndex(h=>h.id===c);u!==-1&&o.splice(u,1)}return e.customDecorations=pc(o),i}var vi=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(vi||{});function Vt(e,t,n,r=!0,s=1){const{dataStream:i,textRuns:o,paragraphs:a=[],customBlocks:l=[],tables:c=[],sectionBreaks:u=[]}=e,h={dataStream:i.slice(t,n)};if(o){const S=[];for(const x of o){const B=$.deepClone(x),{st:V,ed:y}=B;$.hasIntersectionBetweenTwoRanges(V,y,t,n)&&(t>=V&&t<=y?S.push({...B,st:t,ed:Math.min(n,y)}):n>=V&&n<=y?S.push({...B,st:Math.max(t,V),ed:n}):S.push(B))}h.textRuns=S.map(x=>{const{st:B,ed:V}=x;return{...x,st:B-t,ed:V-t}})}else r&&(h.textRuns=[{st:0,ed:n-t,ts:{}}]);const d=[];for(const S of c){const x=$.deepClone(S),{startIndex:B,endIndex:V}=x;B>=t&&V<=n&&d.push({...x,startIndex:B-t,endIndex:V-t})}d.length&&(h.tables=d);const f=[];for(const S of a){const{startIndex:x}=S;x>=t&&x<n&&f.push($.deepClone(S))}f.length&&(h.paragraphs=f.map(S=>({...S,startIndex:S.startIndex-t})));const _=[];for(const S of u){const{startIndex:x}=S;x>=t&&x<=n&&_.push($.deepClone(S))}if(_.length&&(h.sectionBreaks=_.map(S=>({...S,startIndex:S.startIndex-t}))),s===1){const S=Sc(e,t,n);S?h.customDecorations=S:r&&(h.customDecorations=[])}const{customRanges:C}=vc(e,t,n);C?h.customRanges=C:r&&(h.customRanges=[]);const T=[];for(const S of l){const{startIndex:x}=S;x>=t&&x<=n&&T.push($.deepClone(S))}return T.length&&(h.customBlocks=T.map(S=>({...S,startIndex:S.startIndex-t}))),h}function t_(e){const{dataStream:t,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}=e;let a=0,l=0;s==null||s.forEach(u=>{u.startIndex<0&&(a=Math.max(a,-u.startIndex)),u.endIndex>t.length-1&&(l=Math.max(l,u.endIndex-t.length+1))});const c=`${t}`;return n&&(n[0]&&(n[0].st=n[0].st-a),n[n.length-1]&&(n[n.length-1].ed=n[n.length-1].ed+l)),n==null||n.forEach(u=>{u.st+=a,u.ed+=a}),r==null||r.forEach(u=>{u.startIndex+=a}),s==null||s.forEach(u=>{u.startIndex+=a,u.endIndex+=a}),i==null||i.forEach(u=>{u.startIndex+=a,u.endIndex+=l}),o==null||o.forEach(u=>{u.startIndex+=a,u.endIndex+=l}),{...e,dataStream:c,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function vc(e,t,n){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,t)<=Math.min(a.endIndex,n-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,t),endIndex:Math.min(a.endIndex,n-1)})).map(a=>({...a,startIndex:a.startIndex-t,endIndex:a.endIndex-t})),leftOffset:0,rightOffset:0}}function Sc(e,t,n){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,t)<=Math.min(i.endIndex,n-1)){const o=$.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function n_(e,t,n){return e==null||t==null?e!=null?e:t:Ic(e,t,n)}function r_(e,t,n){if(e==null||t==null)return e!=null?e:t;if(t.length===0||e.length===0)return e;if(t.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return n===ve.REPLACE?[{...e[0]}]:[{...t[0],...e[0]}]}function s_(e,t,n){return t.length===0||e.length===0||n===ve.REPLACE?e:[...e,...t.filter(r=>!e.some(s=>r.id===s.id))]}function js(e,t,n=ve.COVER){if(t.dataStream!=="")throw new Error("Cannot compose other body with non-empty dataStream");const r={dataStream:e.dataStream},{textRuns:s,paragraphs:i=[],customRanges:o,customDecorations:a=[]}=e,{textRuns:l,paragraphs:c=[],customRanges:u,customDecorations:h=[]}=t;r.textRuns=n_(l,s,n),r.customRanges=r_(u,o,n);const d=s_(h,a,n);d.length&&(r.customDecorations=d);const f=[];let _=0,C=0;for(;_<i.length&&C<c.length;){const T=i[_],S=c[C],{startIndex:x}=T,{startIndex:B}=S;x===B?(f.push($.deepMerge(T,S)),_++,C++):x<B?(f.push($.deepClone(T)),_++):(f.push($.deepClone(S)),C++)}return _<i.length&&f.push(...i.slice(_)),C<c.length&&f.push(...c.slice(C)),f.length&&(r.paragraphs=f),r}function i_(e){const{body:t}=e;if(t==null)return!0;const{textRuns:n,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=t;return n==null&&r==null&&s==null&&i==null&&o==null&&a==null}class dn{constructor(t){R(this,"_index",0);R(this,"_offset",0);this._actions=t}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(t){t||(t=Number.POSITIVE_INFINITY);const n=this._actions[this._index];if(n){const r=this._offset,s=n.len;return t>=s-r?(t=s-r,this._index+=1,this._offset=0):this._offset+=t,n.t===te.DELETE||n.t===te.RETAIN&&n.body==null?$.deepClone({...n,len:t}):$.deepClone({...n,len:t,body:Vt(n.body,r,r+t,!1)})}else return{t:te.RETAIN,len:Number.POSITIVE_INFINITY}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:Number.POSITIVE_INFINITY}peekType(){const t=this._actions[this._index];return t?t.t:te.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const t=this._offset,n=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=t,this._index=n,[r].concat(s)}}else return[]}}function Oc(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=mc(e,t,n),a=_c(e,t,n),l=Ec(e,t,n),c=Rc(e,t,n),u=Cc(e,t,n),h=zm(e,t,n),d=Gm(e,t,n);let f="";return r&&(e.dataStream=vl(r,s,i),f=r.slice(s,i)),{dataStream:f,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:u,customRanges:h,customDecorations:d}}function bc(e,t,n,r){e.dataStream=Il(e.dataStream,r,t.dataStream),cc(e,t,n,r),uc(e,t,n,r),hc(e,t,n,r),dc(e,t,n,r),fc(e,t,n,r),Wm(e,t,n,r),Vm(e,t,n,r)}function o_(e,t,n,r,s=ve.COVER){return Km(e,t,n,r,s)}function a_(e,t,n){return t<=0?{dataStream:""}:Oc(e,t,n)}function l_(e,t,n,r){n!==0&&bc(e,t,n,r)}function c_(e,t){const n=new yn;return n.reset(),t.forEach(r=>{const s=$.deepClone(r);switch(s.t){case te.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&o_(e,o,a,n.cursor,i),n.moveCursor(a);break}case te.INSERT:{const{body:i,len:o}=s;l_(e,i,o,n.cursor),n.moveCursor(o);break}case te.DELETE:{const{len:i}=s;a_(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function u_(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=$.deepClone(t),e=$.deepClone(e);const i=[],o=t.length,a=e.length;let l=0,c=0,u=null;function h(){return u?(i.push(u),u=null,!0):!1}for(;l<o&&c<a;){const{st:C,ed:T,ts:S}=t[l],{st:x,ed:B,ts:V,sId:y}=e[c];let O={};if(s===0)O={...S},n===ve.COVER&&r===ve.REPLACE&&V&&(O=Object.assign({},V,O));else if(O={...S},n===ve.REPLACE){if(r===ve.REPLACE)O={...V};else if(S&&V){const L=Object.keys(S);for(const z of L)V[z]&&delete O[z]}}else if(r===ve.REPLACE){if(V){const L=Object.keys(V);for(const z of L)V[z]!==void 0&&(O[z]=V[z])}}else if(V){const L=Object.keys(V);for(const z of L)O[z]!==void 0&&delete O[z]}if(T<x)h()||i.push(t[l]),l++;else if(B<C)h()||i.push(e[c]),c++;else{const L={st:Math.min(C,x),ed:Math.max(C,x),ts:C<x?{...S}:{...V},sId:C<x?void 0:y};L.ed>L.st&&i.push(),i.push({st:Math.max(C,x),ed:Math.min(T,B),ts:O,sId:y}),T<B?(l++,e[c].st=T,e[c].st===e[c].ed&&c++):(c++,t[l].st=B,t[l].st===t[l].ed&&l++);const z={st:Math.min(T,B),ed:Math.max(T,B),ts:T<B?{...V}:{...S},sId:T<B?y:void 0};u=z.ed>z.st?z:null}}h();const d=i[i.length-1],f=t[o-1],_=e[a-1];return d.ed!==Math.max(f.ed,_.ed)&&(f.ed>_.ed?i.push(f):i.push(_)),Jr(i,!0)}function h_(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];if(e.length>1||t.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=t[0];if(n===ve.REPLACE)return s===1?[$.deepClone(i)]:[$.deepClone(o)];if(r===ve.REPLACE){const a=$.deepClone(o);return s===1&&Object.assign(a,$.deepClone(i)),[a]}else{const a=$.deepClone(o);return s===1&&Object.assign(a,$.deepClone(i)),[a]}}function yo(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=$.deepClone(t.paragraphStyle),e.paragraphStyle)){if(n===ve.REPLACE)if(r===ve.REPLACE)s===1&&(i.paragraphStyle={...e.paragraphStyle});else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(r===ve.REPLACE)if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]&&delete i.paragraphStyle[a]}}return n===ve.REPLACE&&r===ve.REPLACE?i.bullet=s===1?$.deepClone(e.bullet):$.deepClone(t.bullet):e.bullet===void 0?i.bullet=$.deepClone(t.bullet):n===ve.REPLACE||r===ve.REPLACE?i.bullet=s===0&&t.bullet?$.deepClone(t.bullet):$.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=$.deepClone(t.bullet)),i}function d_(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return $.deepClone(t);const n=[];for(const r of t){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===Rn.DELETED||i===Rn.DELETED)&&(o=!0,n.push({...r,type:Rn.DELETED}));break}o||n.push(r)}return n}function f_(e,t,n=!1){const{body:r,coverType:s=ve.COVER}=e,{body:i,coverType:o=ve.COVER}=t;if(r==null||r.dataStream!==""||i==null||i.dataStream!=="")throw new Error("Data stream is not supported in retain transform.");const a={dataStream:""},l=o,{textRuns:c,paragraphs:u=[],customRanges:h,customDecorations:d}=r,{textRuns:f,paragraphs:_=[],customRanges:C,customDecorations:T}=i,S=u_(c,f,s,o,n?1:0);S&&(a.textRuns=S);const x=h_(h,C,s,o,n?1:0);x&&(a.customRanges=x);const B=d_(d,T);B&&(a.customDecorations=B);const V=[];let y=0,O=0;for(;y<u.length&&O<_.length;){const L=u[y],z=_[O],{startIndex:ge}=L,{startIndex:de}=z;if(ge===de){let be={startIndex:ge};n?be=yo(L,z,s,o,1):be=yo(L,z,s,o,0),V.push(be),y++,O++}else ge<de?y++:(V.push($.deepClone(z)),O++)}return O<_.length&&V.push(..._.slice(O)),V.length&&(a.paragraphs=V),{coverType:l,body:a}}function wo(e){return Object.keys(e).length===1}const _n=class _n{constructor(){R(this,"_actions",[])}static apply(t,n){return c_(t,n)}static compose(t,n){const r=new dn(t),s=new dn(n),i=new _n;for(;r.hasNext()||s.hasNext();)if(s.peekType()===te.INSERT)i.push(s.next());else if(r.peekType()===te.DELETE)i.push(r.next());else{const o=Math.min(r.peekLength(),s.peekLength()),a=r.next(o),l=s.next(o);if(a.t===te.INSERT&&l.t===te.RETAIN)l.body==null?i.push(a):i.push({...a,body:js(a.body,l.body,l.coverType)});else if(a.t===te.RETAIN&&l.t===te.RETAIN)if(a.body==null&&l.body==null)i.push(a.len!==Number.POSITIVE_INFINITY?a:l);else if(a.body&&l.body){const c=a.coverType===ve.REPLACE||l.coverType===ve.REPLACE?ve.REPLACE:ve.COVER;i.push({...a,t:te.RETAIN,coverType:c,body:js(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===te.RETAIN&&l.t===te.DELETE?i.push(l):a.t===te.INSERT&&(l.t,te.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(t,n,r="right"){return this._transform(n,t,r==="left"?"right":"left")}static _transform(t,n,r="right"){const s=new dn(t),i=new dn(n),o=new _n;for(;s.hasNext()||i.hasNext();)if(s.peekType()===te.INSERT&&(r==="left"||i.peekType()!==te.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===te.INSERT)o.push(i.next());else{const a=Math.min(s.peekLength(),i.peekLength()),l=s.next(a),c=i.next(a);if(l.t===te.DELETE)continue;if(c.t===te.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:u,body:h}=f_(l,c,r==="left");o.push({...c,t:te.RETAIN,coverType:u,body:h})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new dn(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===te.DELETE){n-=Math.min(o,n-i);continue}else a===te.INSERT&&(i<n||!r)&&(n+=o);i+=o}return n}static isNoop(t){return t.length===0}static invert(t){const n=[];for(const r of t)if(r.t===te.INSERT)n.push({t:te.DELETE,len:r.len,body:r.body});else if(r.t===te.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:te.INSERT,body:r.body,len:r.len})}else if(r.body!=null){if(r.oldBody==null)throw new Error("Can not invert RETAIN action without oldBody property, makeInvertible must be called first.");n.push({t:te.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:ve.REPLACE})}else n.push(r);return n}static makeInvertible(t,n){const r=[];let s=0;for(const i of t){if(i.t===te.DELETE&&i.body==null){const o=Vt(n,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===te.RETAIN&&i.body!=null){const o=Vt(n,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==te.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:te.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:te.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:te.DELETE,len:t};return this.push(n),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...t){if(t.length>1){for(const i of t)this.push(i);return this}let n=this._actions.length,r=this._actions[n-1];const s=$.deepClone(t[0]);if(s.t===te.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===te.DELETE&&s.t===te.DELETE)return r.len+=s.len,this;if(r.t===te.DELETE&&s.t===te.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===te.RETAIN&&s.t===te.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===te.INSERT&&wo(r.body)&&s.t===te.INSERT&&wo(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return n===this._actions.length?this._actions.push(s):this._actions.splice(n,0,s),this}trimEndUselessRetainAction(){let t=this._actions[this._actions.length-1];for(;t&&t.t===te.RETAIN&&i_(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};R(_n,"id","text-x"),R(_n,"uri","https://github.com/dream-num/univer#text-x");let Xe=_n;Object.defineProperty(Xe,"name",{value:"text-x"});const En=class En{static registerSubtype(t){var n;t==null||this._subTypes.has(t.name)&&((n=this._subTypes.get(t.name))==null?void 0:n.id)!==Xe.id||(this._subTypes.set(t.name,t),ot.type.registerSubtype(t))}static apply(t,n){if(!ot.type.isNoop(n))return ot.type.apply(t,n)}static compose(t,n){return ot.type.compose(t,n)}static transform(t,n,r){return ot.type.transform(t,n,r)}static transformPosition(t,n,r="right"){return t&&t.length===2&&t[0]==="body"&&t[1].et===Xe.name?Xe.transformPosition(t[1].e,n,r==="left"):n}static invertWithDoc(t,n){return ot.type.invertWithDoc(t,n)}static isNoop(t){return ot.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new En),this._instance}removeOp(t,n){return ot.removeOp(t,n)}moveOp(t,n){return ot.moveOp(t,n)}insertOp(t,n){return ot.insertOp(t,n)}replaceOp(t,n,r){return ot.replaceOp(t,n,r)}editOp(t,n=["body"]){return ot.editOp(n,Xe.name,t)}};R(En,"uri","https://github.com/dream-num/univer#json-x"),R(En,"_subTypes",new Map),R(En,"_instance",null);let rn=En;rn.registerSubtype(Xe);const Si={id:"default_doc",documentStyle:{}};class g_ extends Qr{constructor(n){var r;super();R(this,"type",ye.UNIVER_DOC);R(this,"_name$",new le.BehaviorSubject(""));R(this,"name$",this._name$.asObservable());R(this,"snapshot");this.snapshot={...Si,...n},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var n;return(n=this.snapshot.rev)!=null?n:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(n){this.snapshot.rev=n}setName(n){this.snapshot.title=n,this._name$.next(n)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var n;return((n=this.snapshot.settings)==null?void 0:n.zoomRatio)||1}resetDrawing(n,r){this.snapshot.drawings=n,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const n=(s=this.snapshot.lists)!=null?s:{};return{...cr,...n}}updateDocumentId(n){this.snapshot.id=n}updateDocumentRenderConfig(n){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=n:r.renderConfig={...r.renderConfig,...n}}updateDocumentStyle(n){this.snapshot.documentStyle==null?this.snapshot.documentStyle=n:this.snapshot.documentStyle={...this.snapshot.documentStyle,...n}}updateDocumentDataMargin(n){const{t:r,l:s,b:i,r:o}=n,{documentStyle:a}=this.snapshot;r!=null&&(a.marginTop=r),s!=null&&(a.marginLeft=s),i!=null&&(a.marginBottom=i),o!=null&&(a.marginRight=o)}updateDocumentDataPageSize(n,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){n=n!=null?n:Number.POSITIVE_INFINITY,r=r!=null?r:Number.POSITIVE_INFINITY,s.pageSize={width:n,height:r};return}n!==void 0&&(s.pageSize.width=n),r!==void 0&&(s.pageSize.height=r)}updateDrawing(n,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[n];if(!c)return;const u=c.docTransform;u.size.width=i,u.size.height=o,u.positionH.posOffset=a,u.positionV.posOffset=l}setZoomRatio(n=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:n}:this.snapshot.settings.zoomRatio=1}}class Ut extends g_{constructor(n){var s,i;super($.isEmptyObject(n)?xm():n);R(this,"_unitId");R(this,"headerModelMap",new Map);R(this,"footerModelMap",new Map);const r=6;this._unitId=(s=this.snapshot.id)!=null?s:$.generateRandomId(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var n;return(n=this.snapshot.body)==null?void 0:n.customRanges}getCustomDecorations(){var n;return(n=this.snapshot.body)==null?void 0:n.customDecorations}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...Si,...n},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){if(!rn.isNoop(n))return this.snapshot=rn.apply(this.snapshot,n),n!=null&&n.some(r=>Array.isArray(r)&&((r==null?void 0:r[0])==="headers"||(r==null?void 0:r[0])==="footers"))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.snapshot}sliceBody(n,r,s=vi.copy){const i=this.getBody();if(i!=null)return Vt(i,n,r,!1,s)}_initializeHeaderFooterModel(){const{headers:n,footers:r}=this.getSnapshot();if(n)for(const s in n){const i=n[s];this.headerModelMap.set(s,new Ut(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new Ut(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}}const p_="0.5.0-alpha.0";function m_(e="",t=or.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:p_,locale:t,styles:{},sheets:{},resources:[]}}class yc{constructor(t={}){R(this,"_styles");R(this,"_cacheMap",new Ur(1e5));this._styles=t,this._generateCacheMap()}each(t){return Object.entries(this._styles).forEach(t),this}search(t,n){if(this._cacheMap.has(n))return this._cacheMap.get(n);const r=this._getExistingStyleId(t);return r||"-1"}get(t){return typeof t!="string"?t:(t=String(t),this._styles[t])}add(t,n){const r=$.generateRandomId(6);return this._styles[r]=t,this._cacheMap.set(n,r),r}setValue(t){if(t==null)return;const n=JSON.stringify(t),r=this.search(t,n);return r!=="-1"?r:this.add(t,n)}toJSON(){return this._styles}getStyleByCell(t){let n;t&&$.isObject(t.s)?n=t.s:n=(t==null?void 0:t.s)&&this.get(t.s);const r=t==null?void 0:t.interceptorStyle;return r?{...n,...r}:n}_generateCacheMap(){const{_styles:t,_cacheMap:n}=this;for(const r in t){const s=JSON.stringify(t[r]);n.set(s,r)}}_getExistingStyleId(t){const{_styles:n}=this;for(const r in n)if($.diffValue(n[r],t))return r;return null}}function wc(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function __(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):wc(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function E_(e){return{...$.deepClone(e),rangeId:tn()}}function R_(e,t){const n=[];let r=e[0];for(const s of t)s<e[0]||s>e[1]||(r<s&&n.push([r,s-1]),r=s+1);return r<=e[1]&&n.push([r,e[1]]),n}function Ac(e,t,n,r){const s=[];for(let i=0,o=n.length;i<o;i++){const a=n[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,t)&&s.push({...a}),a.startIndex>t)break}return s}function C_(e,t){var i,o,a,l,c;const n=Ac(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=t.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=n[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((c=(l=n[n.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}const I_=e=>{var h,d,f;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(d=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs)!=null?d:[],o=t.every(_=>{var C;return((C=_.bullet)==null?void 0:C.listType.indexOf(s))===0});let l=$.generateRandomId(6);if(t.length===1){const _=i.indexOf(t[0]),C=i[_-1],T=i[_+1];C&&C.bullet&&C.bullet.listType.indexOf(s)===0?(l=C.bullet.listId,s!==At.CHECK_LIST&&(s=C.bullet.listType)):T&&T.bullet&&T.bullet.listType.indexOf(s)===0&&(l=T.bullet.listId,s!==At.CHECK_LIST&&(s=T.bullet.listType))}const c=new yn;c.reset();const u=new Xe;for(const _ of t){const{startIndex:C,paragraphStyle:T={},bullet:S}=_;u.push({t:te.RETAIN,len:C-c.cursor}),u.push({t:te.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:T,startIndex:0}:{startIndex:0,paragraphStyle:{...T},bullet:{nestingLevel:(f=S==null?void 0:S.nestingLevel)!=null?f:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:ve.REPLACE}),c.moveCursorTo(C+1)}return u},v_=e=>{var h;const{paragraphIndex:t,segmentId:n,document:r}=e,s=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs;if(s==null)return!1;const i=s.find(d=>d.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(At.CHECK_LIST)===-1)return!1;const o=new yn;o.reset();const a=new Xe,{startIndex:l,paragraphStyle:c={}}=i,u=i.bullet.listType===At.CHECK_LIST?At.CHECK_LIST_CHECKED:At.CHECK_LIST;return a.push({t:te.RETAIN,len:l-o.cursor}),a.push({t:te.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:u}}]},coverType:ve.REPLACE}),o.moveCursorTo(l+1),a},S_=e=>{var u,h;const{paragraphs:t,listType:n,segmentId:r,document:s}=e;if(((u=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:u.paragraphs)==null)return!1;const a=$.generateRandomId(6),l=new yn;l.reset();const c=new Xe;for(const d of t){const{startIndex:f,paragraphStyle:_={},bullet:C}=d;c.push({t:te.RETAIN,len:f-l.cursor}),c.push({t:te.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:_,bullet:{nestingLevel:(h=C==null?void 0:C.nestingLevel)!=null?h:0,textStyle:(C==null?void 0:C.listType)===n?C.textStyle:{fs:20},listType:n,listId:a}}]},coverType:ve.REPLACE}),l.moveCursorTo(f+1)}return c};function O_(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const b_=e=>{var u,h,d;const{paragraphs:t,segmentId:n,document:r,type:s}=e,i=new yn;i.reset();const o=new Xe,a=(u=r.getSnapshot().lists)!=null?u:{},l=(d=(h=r.getBody())==null?void 0:h.tables)!=null?d:[],c={...cr,...a};for(const f of t){const{startIndex:_,paragraphStyle:C={},bullet:T}=f,S=O_(f,l);if(o.push({t:te.RETAIN,len:_-i.cursor}),T){const x=T.listType;let B=c[x].nestingLevel.length-1;S&&(B=Math.min(B,2)),o.push({t:te.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...C},bullet:{...T,nestingLevel:Math.max(Math.min(T.nestingLevel+s,B),0)}}]},coverType:ve.REPLACE})}else o.push({t:te.RETAIN,len:1});i.moveCursorTo(_+1)}return o};var Nc=(e=>(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))(Nc||{}),Mt=(e=>(e.PARAGRAPH="\r",e.SECTION_BREAK=`
9
- `,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))(Mt||{});function y_(e){return`${e}`}const w_=[Mt.TABLE_START,Mt.TABLE_ROW_START,Mt.TABLE_CELL_START,Mt.TABLE_CELL_END,Mt.TABLE_ROW_END,Mt.TABLE_END,Mt.CUSTOM_BLOCK],Tc=e=>{const t=e.endsWith(`\r
10
- `)?e.slice(0,-2):e;return w_.reduce((n,r)=>n.replaceAll(r,""),t)},A_=e=>e?Tc(e).replaceAll("\r","")==="":!0,N_=e=>{const t=e.replace(/\n/g,"\r"),n=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const u=t.slice(s,l);if($.isLegalUrl(u)){const h=tn(),d=`${u}`,f={startIndex:s,endIndex:s+d.length-1,rangeId:h,rangeType:Qn.HYPERLINK,properties:{url:e}};r.push(f),i+=d,s=l+1,c&&(i+="\r",n.push({startIndex:l}))}else i+=t.slice(s,l+1),s=l+1,c&&n.push({startIndex:l})};let a=0;for(let l=0;l<t.length;l++)t[l]==="\r"&&(o(l),a=l);return a!==t.length-1&&o(t.length,!1),{dataStream:i,paragraphs:n,customRanges:r}};function T_(e,t){if(typeof t>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw new Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function M_(e){const{startOffset:t,endOffset:n,collapsed:r}=e,s=Math.min(t,n),i=Math.max(t,n);return{startOffset:s,endOffset:i,collapsed:r}}function L_(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}function D_(e,t){var d,f,_;const{rangeId:n,segmentId:r,documentDataModel:s,insert:i}=t,o=(f=(d=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:d.customRanges)==null?void 0:f.find(C=>C.rangeId===n);if(!o)return!1;const{startIndex:a,endIndex:l}=o,c=new Xe,u=l-a+1;c.push({t:te.RETAIN,len:a}),c.push({t:te.RETAIN,len:u,body:{dataStream:"",customRanges:[]}}),i&&c.push({t:te.INSERT,body:i,len:i.dataStream.length});const h=l+1+((_=i==null?void 0:i.dataStream.length)!=null?_:0);return c.selections=[{startOffset:h,endOffset:h,collapsed:!0}],c}function x_(e){var T,S;const{range:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e,a=C_(t,o);if(!a||!o)return!1;const{startOffset:l,endOffset:c}=a,u=(T=o.customRanges)!=null?T:[];let h=0;const d=new Xe,f=(x,B,V)=>{var ge,de,be,we;const y=Ac(x,B,u,r),O=Math.min((de=(ge=y[0])==null?void 0:ge.startIndex)!=null?de:1/0,x),L=Math.max((we=(be=y[y.length-1])==null?void 0:be.endIndex)!=null?we:-1/0,B),z={rangeId:V?`${n}-${V}`:n,rangeType:r,startIndex:0,endIndex:L-O,wholeEntity:s,properties:{...i}};d.push({t:te.RETAIN,len:O-h}),d.push({t:te.RETAIN,len:L-O+1,body:{dataStream:"",customRanges:[z]},coverType:ve.COVER}),h=L+1},_=((S=o.paragraphs)!=null?S:[]).filter(x=>x.startIndex<c&&x.startIndex>l);return R_([l,c-1],_.map(x=>x.startIndex)).forEach(([x,B],V)=>f(x,B,V)),d.selections=[{startOffset:a.endOffset,endOffset:a.endOffset,collapsed:!0}],d}function U_(e,t,n=0,r=null,s=!0){e.sort((c,u)=>c.startOffset-u.startOffset);const i=[],{paragraphs:o=[]}=t,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=n;if(e.forEach(c=>{const{startOffset:u,endOffset:h}=c;u>l&&(i.push({t:te.RETAIN,len:u-l}),l=u),l<h&&(i.push({t:te.DELETE,len:h-l}),l=h)}),r&&i.push({t:te.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(u=>u.startIndex-n>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:te.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:te.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:ve.REPLACE}))}return i}const P_=e=>{var h;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(h=r.getSelfOrHeaderFooterModel(s))==null?void 0:h.getBody();if(!i)return!1;const o=t.collapsed?null:Vt(i,t.startOffset,t.endOffset),a=da(o?o.dataStream:"",n.dataStream);let l=0;const c=a.map(([d,f])=>{switch(d){case 0:{const _={t:te.RETAIN,body:{...Vt(n,l,l+f.length,!1),dataStream:""},len:f.length};return l+=f.length,_}case 1:{const _={t:te.INSERT,body:Vt(n,l,l+f.length),len:f.length};return l+=f.length,_}default:return{t:te.DELETE,len:f.length}}}),u=new Xe;return u.push({t:te.RETAIN,len:t.startOffset}),u.push(...c),u};class Dt{}R(Dt,"customRange",{add:x_,delete:D_,copyCustomRange:E_,getCustomRangesInterestsWithSelection:__,isIntersecting:wc}),R(Dt,"selection",{replace:P_,makeSelection:T_,normalizeSelection:M_,delete:U_}),R(Dt,"range",{isIntersects:L_}),R(Dt,"transform",{getPlainText:Tc,fromPlainText:N_,isEmptyDocument:A_}),R(Dt,"paragraph",{bullet:{set:S_,switch:I_,toggleChecklist:v_,changeNestLevel:b_}});const F_=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!zt.equals(r,n))),k_=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&zt.equals(n.range,s.range)}),Hs={t:0,b:2,l:2,r:2},j_=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),Ao=90;function Cr(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Ht.UNSPECIFIED,verticalAlign:a=Zt.UNSPECIFIED,wrapStrategy:l=en.UNSPECIFIED,cellValueType:c}=n,{t:u,r:h,b:d,l:f}=i||Hs,{vertexAngle:_,centerAngle:C}=Mc(s),T={id:"d",body:{dataStream:`${e}${ga}`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:u,marginBottom:d,marginRight:h,marginLeft:f,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:C,vertexAngle:_,wrapStrategy:l,cellValueType:c}},drawings:{},drawingsOrder:[]};return new Ut(T)}function H_(e){if(!e)return{};const{tr:t,td:n,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function No(e){if(!e)return{};const{ff:t,fs:n,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return t&&(c.ff=t),n&&(c.fs=n),r&&(c.it=r),s&&(c.bl=s),i&&(c.ul=i),o&&(c.st=o),a&&(c.ol=a),l&&(c.cl=l),c}function B_(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===Qn.HYPERLINK))return;const s=Dt.customRange.add({range:{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1},rangeId:n,rangeType:Qn.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&Xe.apply(r,s.serialize())}const $_='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function To(e){const t=et.ff,n=et.fs;if(!e){const h=`${n}pt ${t}`;return{fontCache:h,fontString:h,fontSize:n,originFontSize:n,fontFamily:t}}let r=pn.ITALIC;(e.it===0||e.it===void 0)&&(r=pn.NORMAL);let s=pn.BOLD;(e.bl===0||e.bl===void 0)&&(s=pn.NORMAL);let i=n;e.fs&&(i=Math.ceil(e.fs));let o=t;if(e.ff){let h=e.ff;h=h.replace(/"/g,"").replace(/'/g,""),h.indexOf(" ")>-1&&(h=`"${h}"`),h==null&&(h=t),o=h}const{va:a}=e;let l=i;if(a===xt.SUBSCRIPT||a===xt.SUPERSCRIPT){const h=W_(o,l),{sbr:d,spr:f}=h;l*=a===xt.SUBSCRIPT?d:f}const c=`${r} ${s} ${l}pt ${o}`,u=`${c}, ${$_} `;return{fontCache:c,fontString:u,fontSize:l,originFontSize:i,fontFamily:o}}function W_(e,t){return j_(t)}function Mc(e){const{a:t=0,v:n=Re.FALSE}=e||{a:0,v:Re.FALSE};let r=0,s=t;return n===Re.TRUE&&(r=Ao,s=Ao),{centerAngle:r,vertexAngle:s}}class V_{constructor(t,n){R(this,"_columnData",{});this._config=t,this._columnData=n}getColumnData(){return this._columnData}getColVisible(t){const{_columnData:n}=this,r=n[t];return r?r.hd!==Re.TRUE:!0}getColumnStyle(t){var n;return(n=this._columnData[t])==null?void 0:n.s}setColumnStyle(t,n){const r=this.getColumnOrCreate(t);r.s=n}getHiddenCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:me.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:me.COLUMN}),r}getVisibleCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:me.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:me.COLUMN}),r}getColumnDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getColumnOrCreate(i);r[s]=o,s++}return r}getSize(){return Wt(this._columnData)}getColumnWidth(t){const{_columnData:n}=this,r=this._config;let s=0;return s=(n[t]||{hd:Re.FALSE,w:r.defaultColumnWidth}).w||r.defaultColumnWidth,s}getColumn(t){const n=this._columnData[t];if(n)return n}removeColumn(t){delete this._columnData[t]}getColumnOrCreate(t){const{_columnData:n}=this,r=n[t];if(r)return r;const s={};return this._columnData[t]=s,s}}class z_{constructor(t,n,r){R(this,"_rowData");this._config=t,this._viewModel=n,this._rowData=r}getRowData(){return this._rowData}getRowStyle(t){var n;return(n=this._rowData[t])==null?void 0:n.s}setRowStyle(t,n){const r=this.getRowOrCreate(t);r.s=n}getRowDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getRowOrCreate(i);r[s]=o,s++}return r}getRowHeight(t,n=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<n;o++){const a=r[o+t]||{hd:Re.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h:u=s.defaultRowHeight}=a;i+=(l==null||l===Re.TRUE)&&typeof c=="number"?c:u}return i}getRow(t){return this._rowData[t]}removeRow(t){delete this._rowData[t]}getRowOrCreate(t){const{_rowData:n}=this,r=n[t];if(r)return r;const s={};return n[t]=s,s}getHiddenRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:me.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:me.ROW}),r}getVisibleRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:me.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:me.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==Re.TRUE:!0}getSize(){return Wt(this._rowData)}}const G_="DEFAULT_WORKSHEET_ROW_COUNT",Lc=1e3,K_="DEFAULT_WORKSHEET_COLUMN_COUNT",Dc=20,Y_="DEFAULT_WORKSHEET_ROW_HEIGHT",xc=24,X_="DEFAULT_WORKSHEET_COLUMN_WIDTH",Uc=88,Q_="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",Pc=46,J_="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",Fc=20;function kc(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:Re.FALSE,rowCount:Lc,columnCount:Dc,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Uc,defaultRowHeight:xc,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:Re.TRUE,rowHeader:{width:Pc,hidden:Re.FALSE},columnHeader:{height:Fc,hidden:Re.FALSE},rightToLeft:Re.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class Z_ extends Ge{constructor(n){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");R(this,"_rangeMap",new Ur(5e4));R(this,"_skeletonCache",new Ur(5e4));this._init(n.concat())}_init(n){this._mergeData=n,this._createCache(n)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._skeletonCache.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(n){let r=0;for(const s of n){const{rangeType:i}=s;i===me.ROW?this._createRowCache(s,r):i===me.COLUMN?this._createColumnCache(s,r):i===me.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(n){this._clearCache(),this._init(n.concat())}_createRowCache(n,r){const{startRow:s,endRow:i}=n;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(n,r){const{startColumn:s,endColumn:i}=n;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(n){this._hasAll=!0,this._allIndex=n}_createCellCache(n,r){for(let s=n.startRow;s<=n.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=n.startColumn;o<=n.endColumn;o++)i.set(o,r)}}add(n){this._mergeData.push(n),this._clearCache(),this._createCache(this._mergeData)}remove(n,r){const s=this._getMergeDataIndex(n,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(n,r){const s=this._getMergeDataIndex(n,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(n,r){return this._getMergeDataIndex(n,r)}isRowContainsMergedCell(n){return this._hasAll||!$.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!$.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=n&&n<=r.endColumn)}getMergedCellRange(n,r,s,i){const o=[],a=`${n}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const c=[];for(const u of this._mergeData||[])zt.intersects(u,{startRow:n,endRow:s,startColumn:r,endColumn:i})&&(o.push({...u}),c.push(l)),l++;return this._rangeMap.set(a,c),o}getMergedCellRangeForSkeleton(n,r,s,i){const o=[],a=this._mergeData,l=`${n}-${r}-${s}-${i}`;if(this._skeletonCache.has(l))return this._getSkeletonRangeFromCache(l);const c=[];for(let u=0;u<a.length;u++){const{startRow:h,endRow:d,startColumn:f,endColumn:_}=a[u];for(let C=n;C<=s;C++){let T=!1;for(let S=r;S<=i;S++)if(C>=h&&C<=d&&S>=f&&S<=_){o.push({startRow:h,endRow:d,startColumn:f,endColumn:_}),c.push(u),T=!0;break}if(T)break}}return this._skeletonCache.set(l,c),o}_getRangeFromCache(n){const r=this._rangeMap.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(n){const r=this._skeletonCache.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(n,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(n);if(o!==void 0)return o}if(this._hasColumn){const o=this._columnCache.get(r);if(o!==void 0)return o}const s=(i=this._cellCache.get(n))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class jc extends Ge{constructor(n){super();R(this,"_cellContentInterceptor",null);R(this,"_rowFilteredInterceptor",null);this.getRawCell=n}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,gn.Value|gn.Style):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,gn.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,gn.Style):this.getRawCell(n,r)}getRowFiltered(n){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(n))!=null?s:!1}registerCellContentInterceptor(n){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=n,$e(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,$e(()=>this._rowFilteredInterceptor=null)}}const Mo={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class Jn{constructor(t,n,r){R(this,"_sheetId");R(this,"_snapshot");R(this,"_cellData");R(this,"_rowManager");R(this,"_columnManager");R(this,"_viewModel");R(this,"_spanModel");var a;this.unitId=t,this._styles=r,this._snapshot=kc(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:$.generateRandomId(6),this._cellData=new wt(o),this._viewModel=new jc((l,c)=>this.getCellRaw(l,c)),this._rowManager=new z_(this._snapshot,this._viewModel,i),this._columnManager=new V_(this._snapshot,s),this._spanModel=new Z_(this._snapshot.mergeData)}__interceptViewModel(t){t(this._viewModel)}getSnapshot(){return this._snapshot}setMergeData(t){this._snapshot.mergeData=t,this.getSpanModel().rebuild(t)}getSpanModel(){return this._spanModel}getColumnStyle(t,n=!1){return n?this._columnManager.getColumnStyle(t):this._styles.get(this._columnManager.getColumnStyle(t))}setColumnStyle(t,n){this._columnManager.setColumnStyle(t,n)}getRowStyle(t,n=!1){return n?this._rowManager.getRowStyle(t):this._styles.get(this._rowManager.getRowStyle(t))}setRowStyle(t,n){this._rowManager.setRowStyle(t,n)}mixinDefaultStyleToCellRaw(t,n,r,s){const i=this.getColumnStyle(n),o=this.getRowStyle(t),a=this.getDefaultCellStyleInternal();if(a||i||o){let l=r==null?void 0:r.s;typeof l=="string"&&(l=this._styles.get(l));const c=s?ws(a,i,o,l):ws(a,o,i,l);r||(r={}),r.s=c}}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const t=this._snapshot.defaultStyle;return this._styles.get(t)}setDefaultCellStyle(t){this._snapshot.defaultStyle=t}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const t=this.getCellMatrix(),n=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return t.forEach((c,u)=>{Object.keys(u).forEach(h=>{const d=+h,f=t.getValue(c,d),_=f!=null&&f.s?this._styles.get(f.s):null,C=(_==null?void 0:_.bd)&&(_.bd.b||_.bd.l||_.bd.r||_.bd.t||_.bd.bc_tr||_.bd.bl_tr||_.bd.ml_tr||_.bd.tl_bc||_.bd.tl_br||_.bd.tl_mr);(f&&(f.v||f.p)||_!=null&&_.bg||C)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),n.forEach(c=>{a?r=Math.min(r,c.startRow):(r=c.startRow,a=!0),s=Math.max(s,c.endRow),l?i=Math.min(i,c.startColumn):(i=c.startColumn,a=!0),o=Math.max(o,c.endColumn)}),!a||!l?null:{startColumn:i,startRow:r,endColumn:o,endRow:s}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:t}=this,n=$.deepClone(t);return new Jn(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(t,n){return this._spanModel.getMergedCell(t,n)}getMergedCellRange(t,n,r,s){return this._spanModel.getMergedCellRange(t,n,r,s)}isRowContainsMergedCell(t){return this._spanModel.isRowContainsMergedCell(t)}isColumnContainsMergedCell(t){return this._spanModel.isColumnContainsMergedCell(t)}getCellInfoInMergeData(t,n){const r=this.getMergedCell(t,n);let s=!1,i=!1,o=t,a=n,l=t,c=n;if(r){const{startRow:u,endRow:h,startColumn:d,endColumn:f}=r;t===u&&n===d?(o=h,a=f,l=u,c=d,i=!0):t>=u&&t<=h&&n>=d&&n<=f&&(o=h,a=f,l=u,c=d,s=!0)}return{actualRow:t,actualColumn:n,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}getCell(t,n){return t<0||n<0?null:this._viewModel.getCell(t,n)}getCellValueOnly(t,n){return t<0||n<0?null:this._viewModel.getCellValueOnly(t,n)}getCellStyleOnly(t,n){return t<0||n<0?null:this._viewModel.getCellStyleOnly(t,n)}getCellRaw(t,n){return this.getCellMatrix().getValue(t,n)}getRowFiltered(t){return this._viewModel.getRowFiltered(t)}getMatrixWithMergedCells(t,n,r,s,i=!1){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new wt;return Ds(t,r,n,s).forEach((c,u)=>{const h=i?this.getCellRaw(c,u):this.getCell(c,u);h&&l.setValue(c,u,h)}),a.forEach(c=>{const{startColumn:u,startRow:h,endColumn:d,endRow:f}=c;Ds(h,f,u,d).forEach((_,C)=>{_===h&&C===u&&l.setValue(_,C,{...o.getValue(_,C),rowSpan:f-h+1,colSpan:d-u+1}),(_!==h||C!==u)&&l.realDeleteValue(_,C)})}),l}getRange(t,n,r,s){return typeof t=="object"?new vn(this,t,{getStyles:()=>this._styles}):new vn(this,{startRow:t,startColumn:n,endColumn:s||n,endRow:r||t},{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(){const{_snapshot:t}=this,{columnCount:n}=t;return n}getMaxRows(){const{_snapshot:t}=this,{rowCount:n}=t;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(t){this._snapshot.rowCount=t}getColumnCount(){return this._snapshot.columnCount}setColumnCount(t){this._snapshot.columnCount=t}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:t}=this,{showGridlines:n}=t;return n===0}getTabColor(){const{_snapshot:t}=this,{tabColor:n}=t;return n}getColumnWidth(t){return this.getColumnManager().getColumnWidth(t)}getRowHeight(t){return this._viewModel.getRowFiltered(t)?0:this.getRowManager().getRowHeight(t)}isRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRowVisible(t){return!this.isRowFiltered(t)&&this.getRowRawVisible(t)}getRowRawVisible(t){return this.getRowManager().getRowRawVisible(t)}getHiddenRows(t,n){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(t,n);return s.forEach(i=>i.endColumn=r),s}getColVisible(t){return this._columnManager.getColVisible(t)}getHiddenCols(t,n){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(t,n);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const t=this.getRowCount();return this._rowManager.getVisibleRows(0,t-1)}getVisibleCols(){const t=this.getColumnCount();return this._columnManager.getVisibleCols(0,t-1)}isRightToLeft(){const{_snapshot:t}=this,{rightToLeft:n}=t;return n}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}cellHasValue(t){return t&&(t.v!==void 0||t.f!==void 0||t.p!==void 0)}iterateByRow(t,n=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t,a=this;return{[Symbol.iterator]:()=>{let l=r,c=s;return{next(){for(;;){if(c>o&&(l+=1,c=s),l>i)return{done:!0,value:void 0};const u=a.getCell(l,c),h=!u,d=a.getMergedCell(l,c);if(d){if(l!==d.startRow||c!==d.startColumn){c=d.endColumn+1;continue}if(h&&n){c=d.endColumn+1;continue}const _={row:l,col:c,value:u};return _.colSpan=d.endColumn-d.startColumn+1,_.rowSpan=d.endRow-d.startRow+1,c=d.endColumn+1,{done:!1,value:_}}if(h&&n)c+=1;else{const f={row:l,col:c,value:u};return c+=1,{done:!1,value:f}}}}}}}}iterateByColumn(t,n=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=t,l=this;return{[Symbol.iterator]:()=>{let c=s,u=i;return{next(){for(;;){if(c>o&&(u+=1,c=s),u>a)return{done:!0,value:void 0};const h=l.getMergedCell(c,u);if(h){const _=c!==h.startRow,C=_||u!==h.startColumn;if(r&&C||!r&&_){c=h.endRow+1;continue}const T=l.getCell(h.startRow,h.startColumn);if(!T&&n){c=h.endRow+1;continue}const x={row:c,col:h.startColumn,value:T};return x.colSpan=h.endColumn-h.startColumn+1,x.rowSpan=h.endRow-h.startRow+1,c=h.endRow+1,{done:!1,value:x}}const d=l.getCell(c,u);if(!d&&n)c+=1;else{const _={row:c,col:u,value:d};return c+=1,{done:!1,value:_}}}}}}}}_getCellDocumentModel(t,n=Mo){var C;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...Mo,...n},o=this._styles.getStyleByCell(t);if(!t)return;let a,l="document";const c=H_(o),u=i?et.tr:c.textRotation||et.tr;let h=c.horizontalAlign||et.ht;const d=c.verticalAlign||et.vt,f=c.wrapStrategy||et.tb,_=c.paddingData||Hs;if(t.f&&s)a=Cr(t.f.toString(),{},{verticalAlign:d}),h=et.ht;else if(t.p){const{centerAngle:T,vertexAngle:S}=Mc(u);a=this._updateConfigAndGetDocumentModel(r?$.deepClone(t.p):t.p,h,_,{horizontalAlign:h,verticalAlign:d,centerAngle:T,vertexAngle:S,wrapStrategy:f})}else if(t.v!=null){const T=No(o);l=To(T).fontCache;let S=Hc(t);t.t===$t.FORCE_STRING&&s&&(S=`'${S}`),a=Cr(S,T,{...c,textRotation:u,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&B_(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:u,wrapStrategy:f,verticalAlign:d,horizontalAlign:h,paddingData:_,fill:(C=o==null?void 0:o.bg)==null?void 0:C.rgb}}_updateConfigAndGetDocumentModel(t,n,r,s){var o,a,l,c,u;if(!s||!((o=t.body)!=null&&o.dataStream))return;t.documentStyle||(t.documentStyle={}),t.documentStyle.marginTop=(a=r.t)!=null?a:0,t.documentStyle.marginBottom=(l=r.b)!=null?l:2,t.documentStyle.marginLeft=(c=r.l)!=null?c:2,t.documentStyle.marginRight=(u=r.r)!=null?u:2,t.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},t.documentStyle.renderConfig=s;const i=t.body.paragraphs||[];for(const h of i)h.paragraphStyle||(h.paragraphStyle={}),h.paragraphStyle.horizontalAlign=n;return new Ut(t)}getBlankCellDocumentModel(t){const n=this._getCellDocumentModel(t,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(t),s=No(r);if(n!=null)return n.documentModel==null&&(n.documentModel=Cr("",s)),n;const i="";let o="document";const a=et.tr,l=et.ht,c=et.vt,u=et.tb,h=Hs;return o=To({}).fontCache,{documentModel:Cr(i,s),fontString:o,textRotation:a,wrapStrategy:u,verticalAlign:c,horizontalAlign:l,paddingData:h}}getCellDocumentModelWithFormula(t){return this._getCellDocumentModel(t,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}}function Hc(e){var r,s;if(!e)return"";const t=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(t)return Dt.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===$t.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===$t.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function q_(e){if(e===null)return"";if(e!=null&&e.p){const t=e==null?void 0:e.p.body;if(t==null)return"";const n=t.dataStream;return Dt.transform.getPlainText(n)}return e==null?void 0:e.v}var eE=Object.defineProperty,tE=Object.getOwnPropertyDescriptor,nE=(e,t,n,r)=>{for(var s=r>1?void 0:r?tE(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&eE(t,n,s),s},rE=(e,t)=>(n,r)=>t(n,r,e);function sE(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}exports.Workbook=class extends Qr{constructor(n={},r){super();R(this,"type",ye.UNIVER_SHEET);R(this,"_sheetCreated$",new le.Subject);R(this,"sheetCreated$",this._sheetCreated$.asObservable());R(this,"_sheetDisposed$",new le.Subject);R(this,"sheetDisposed$",this._sheetDisposed$.asObservable());R(this,"_activeSheet$",new le.BehaviorSubject(null));R(this,"activeSheet$",this._activeSheet$.asObservable());R(this,"_worksheets");R(this,"_styles");R(this,"_snapshot");R(this,"_unitId");R(this,"_count");R(this,"_name$");R(this,"name$");this._logService=r;const s=m_();$.isEmptyObject(n)?this._snapshot=s:this._snapshot=$.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=$.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new yc(i),this._count=1,this._worksheets=new Map,this._name$=new le.BehaviorSubject(n.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return $.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(n){this._name$.next(n),this._snapshot.name=n}getUnitId(){return this._unitId}getRev(){var n;return(n=this._snapshot.rev)!=null?n:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(n){this._snapshot.rev=n}addWorksheet(n,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=s,o.splice(r,0,n);const a=new Jn(this._unitId,s,this._styles);return this._worksheets.set(n,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===n)}getActiveSheet(n){if(!this._activeSheet&&typeof n>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const n=this._activeSheet;if(n)return n;const r=this._snapshot.sheetOrder;for(let i=0,o=r.length;i<o;i++){const a=this._worksheets.get(r[i]);if(a&&a.isSheetHidden()!==Re.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(n){this._activeSheet$.next(n)}removeSheet(n){const r=this._worksheets.get(n);return r?(this._worksheets.delete(n),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(n),1),delete this._snapshot.sheets[n],this._sheetDisposed$.next(r),!0):!1}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:n}=this._snapshot,r=[];return n.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>n.getSheetId()===s)}getSheetBySheetName(n){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(s)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===Re.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==Re.TRUE).map(n=>n.getConfig().id)}load(n){this._snapshot=n}checkSheetName(n){return this.getSheetsName().includes(n)}uniqueSheetName(n="Sheet1"){let r=n;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}generateNewSheetName(n){let r=n+this._count;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:n,_worksheets:r}=this,{sheets:s,sheetOrder:i}=n;if($.isEmptyObject(s)){const o=$.generateRandomId();s[o]={id:o}}for(const o in s){const a=s[o],{name:l}=a;a.name=this.uniqueSheetName(l),a.name!==l&&this._logService.debug("[Workbook]",`The worksheet name ${l} is duplicated, we changed it to ${a.name}. Please fix the problem in your snapshot.`);const c=new Jn(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}};exports.Workbook=nE([rE(1,vt)],exports.Workbook);class Oi extends Qr{constructor(n){var r;super();R(this,"type",ye.UNIVER_SLIDE);R(this,"_activePage$",new le.BehaviorSubject(null));R(this,"activePage$",this._activePage$.asObservable());R(this,"_name$");R(this,"name$");R(this,"_snapshot");R(this,"_unitId");this._snapshot={...Ol,...n},this._unitId=(r=this._snapshot.id)!=null?r:$.generateRandomId(6),this._name$=new le.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const n=this._activePage$.getValue();if(!n){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return n}setName(n){var r;this._snapshot.title=n,this._name$.next(n),this._unitId=(r=this._snapshot.id)!=null?r:tn(6)}getRev(){return 0}incrementRev(){}setRev(n){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var n;return(n=this._snapshot.body)==null?void 0:n.pages}getPageOrder(){var n;return(n=this._snapshot.body)==null?void 0:n.pageOrder}getPage(n){const r=this.getPages();return r==null?void 0:r[n]}getElementsByPage(n){var r;return(r=this.getPage(n))==null?void 0:r.pageElements}getElement(n,r){var s;return(s=this.getElementsByPage(n))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const n=tn(6);return{id:n,pageType:Ci.SLIDE,zIndex:10,title:n,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(n){this._activePage$.next(n)}getActivePage(){return this._activePage}updatePage(n,r){this._snapshot.body&&(this._snapshot.body.pages[n]=r)}appendPage(n){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[n.id]=n;const r=this._activePage,s=this._snapshot.body.pageOrder.indexOf((i=r==null?void 0:r.id)!=null?i:"");this._snapshot.body.pageOrder.splice(s+1,0,n.id)}}const Pn="FOCUSING_UNIT",mn="FOCUSING_SHEET",Fn="FOCUSING_DOC",kn="FOCUSING_SLIDE",iE="FOCUSING_EDITOR_BUT_HIDDEN",Bc="EDITOR_ACTIVATED",oE="FOCUSING_EDITOR_INPUT_FORMULA",$c="FOCUSING_FX_BAR_EDITOR",aE="FOCUSING_UNIVER_EDITOR",lE="FOCUSING_EDITOR_INPUT_FORMULA",cE="FOCUSING_PANEL_EDITOR",uE="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",hE="FOCUSING_COMMON_DRAWINGS",dE="FORMULA_EDITOR_ACTIVATED";var fE=Object.defineProperty,gE=Object.getOwnPropertyDescriptor,pE=(e,t,n,r)=>{for(var s=r>1?void 0:r?gE(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&fE(t,n,s),s},Lo=(e,t)=>(n,r)=>t(n,r,e);const sn=_t("univer.current");exports.UniverInstanceService=class extends Ge{constructor(n,r){super();R(this,"_unitsByType",new Map);R(this,"_createHandler");R(this,"_ctorByType",new Map);R(this,"_currentUnits",new Map);R(this,"_currentUnits$",new le.BehaviorSubject(this._currentUnits));R(this,"currentUnits$",this._currentUnits$.asObservable());R(this,"_unitAdded$",new le.Subject);R(this,"unitAdded$",this._unitAdded$.asObservable());R(this,"_unitDisposed$",new le.Subject);R(this,"unitDisposed$",this._unitDisposed$.asObservable());R(this,"_focused$",new le.BehaviorSubject(null));R(this,"focused$",this._focused$.asObservable());this._injector=n,this._contextService=r}dispose(){super.dispose(),this._focused$.complete()}__setCreateHandler(n){this._createHandler=n}createUnit(n,r,s){return this._createHandler(n,r,this._ctorByType.get(n),s)}registerCtorForType(n,r){return this._ctorByType.set(n,r),{dispose:()=>{this._ctorByType.delete(n)}}}getCurrentTypeOfUnit$(n){return this.currentUnits$.pipe(le.map(r=>{var s;return(s=r.get(n))!=null?s:null}),le.distinctUntilChanged())}getCurrentUnitForType(n){return this._currentUnits.get(n)}setCurrentUnitForType(n){const r=this._getUnitById(n);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${n}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(n){return this._unitAdded$.pipe(le.filter(r=>r.type===n))}__addUnit(n,r){var a;const s=n.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=n.getUnitId();if(i.findIndex(l=>l.getUnitId()===o)!==-1)throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${o}.`);i.push(n),this._unitAdded$.next(n),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(n.getUnitId())}getTypeOfUnitDisposed$(n){return this.unitDisposed$.pipe(le.filter(r=>r.type===n))}getUnit(n,r){var i;const s=(i=this._getUnitById(n))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType(ye.UNIVER_DOC)}getUniverDocInstance(n){return this.getUnit(n,ye.UNIVER_DOC)}getUniverSheetInstance(n){return this.getUnit(n,ye.UNIVER_SHEET)}getAllUnitsForType(n){var r;return(r=this._unitsByType.get(n))!=null?r:[]}changeDoc(n,r){const s=this.getAllUnitsForType(ye.UNIVER_DOC),i=s.find(o=>o.getUnitId()===n);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const n=this._focused$.getValue();return n?(r=this._getUnitById(n))==null?void 0:r[0]:null}focusUnit(n){this._focused$.next(n),this.focused instanceof exports.Workbook?(this._contextService.setContextValue(Pn,!0),this._contextService.setContextValue(Fn,!1),this._contextService.setContextValue(mn,!0),this._contextService.setContextValue(kn,!1),this.setCurrentUnitForType(n)):this.focused instanceof Ut?(this._contextService.setContextValue(Pn,!0),this._contextService.setContextValue(Fn,!0),this._contextService.setContextValue(mn,!1),this._contextService.setContextValue(kn,!1),this.setCurrentUnitForType(n)):this.focused instanceof Oi?(this._contextService.setContextValue(Pn,!0),this._contextService.setContextValue(Fn,!1),this._contextService.setContextValue(mn,!1),this._contextService.setContextValue(kn,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(Pn,!1),this._contextService.setContextValue(Fn,!1),this._contextService.setContextValue(mn,!1),this._contextService.setContextValue(kn,!1))}getFocusedUnit(){return this.focused}getUnitType(n){const r=this._getUnitById(n);return r?r[1]:ye.UNRECOGNIZED}disposeUnit(n){const r=this._getUnitById(n);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryRemoveCurrentUnitForType(n,i),this._tryBlurUnitOnRemoval(n),this._unitDisposed$.next(s),!0}_tryRemoveCurrentUnitForType(n,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===n&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryBlurUnitOnRemoval(n){var r;((r=this.focused)==null?void 0:r.getUnitId())===n&&this._focused$.next(null)}_getUnitById(n){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===n);if(i)return[i,r]}}};exports.UniverInstanceService=pE([Lo(0,mt(Nt)),Lo(1,sr)],exports.UniverInstanceService);var Fe=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(Fe||{});const mE={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var _E=Object.defineProperty,EE=Object.getOwnPropertyDescriptor,RE=(e,t,n,r)=>{for(var s=r>1?void 0:r?EE(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&_E(t,n,s),s},CE=(e,t)=>(n,r)=>t(n,r,e);exports.LifecycleService=class extends Ge{constructor(n){super();R(this,"_lifecycle$",new le.BehaviorSubject(Fe.Starting));R(this,"lifecycle$",this._lifecycle$.asObservable());R(this,"_lock",!1);this._logService=n,this._reportProgress(Fe.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._lock=!0,this._reportProgress(n),this._lifecycle$.next(n),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}subscribeWithPrevious(){return le.merge(Wc(this.stage),this._lifecycle$.pipe(le.skip(1))).pipe(Wa(n=>n===Fe.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${mE[n]}".`)}};exports.LifecycleService=RE([CE(0,vt)],exports.LifecycleService);function Wc(e){switch(e){case Fe.Starting:return le.of(Fe.Starting);case Fe.Ready:return le.of(Fe.Starting,Fe.Ready);case Fe.Rendered:return le.of(Fe.Starting,Fe.Ready,Fe.Rendered);default:return le.of(Fe.Starting,Fe.Ready,Fe.Rendered,Fe.Steady)}}var IE=Object.defineProperty,vE=Object.getOwnPropertyDescriptor,SE=(e,t,n,r)=>{for(var s=r>1?void 0:r?vE(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&IE(t,n,s),s},cs=(e,t)=>(n,r)=>t(n,r,e);const Bt=_t("univer.undo-redo.service"),OE=20;class Vc{dispose(){}async dispatchToHandlers(){return!1}}const zc="univer.command.redo",Gc="univer.command.undo",Zn=new class extends Vc{constructor(){super(...arguments);R(this,"type",ir.COMMAND);R(this,"id",Gc)}async handler(t){const n=t.get(Bt),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(yt);return hi(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},qn=new class extends Vc{constructor(){super(...arguments);R(this,"type",ir.COMMAND);R(this,"id",zc)}async handler(t){const n=t.get(Bt),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(yt);return hi(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};exports.LocalUndoRedoService=class extends Ge{constructor(n,r,s){super();R(this,"undoRedoStatus$");R(this,"_undoRedoStatus$",new le.BehaviorSubject({undos:0,redos:0}));R(this,"_undoStacks",new Map);R(this,"_redoStacks",new Map);R(this,"_batchingStatus",new Map);this._univerInstanceService=n,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(Zn)),this.disposeWithMe(this._commandService.registerCommand(qn)),this.disposeWithMe($e(()=>this._undoRedoStatus$.complete())),this.disposeWithMe($e(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:r}=n,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(n.unitID)){const a=this._batchingStatus.get(n.unitID),l=this._pitchUndoElement(n.unitID);a===0||!l?(o(n),this._batchingStatus.set(n.unitID,1)):this._tryBatchingElements(l,n)}else o(n);function o(a){i.push(a),i.length>OE&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(n){const r=this._getRedoStack(n);r&&(r.length=0);const s=this._getUndoStack(n);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getFocusedUnitId();return this._pitchUndoElement(n)}pitchTopRedoElement(){const n=this._getFocusedUnitId();return this._pitchRedoElement(n)}_pitchUndoElement(n){const r=this._getUndoStack(n);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(n){const r=this._getRedoStack(n);return r!=null&&r.length?r[r.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}__tempBatchingUndoRedo(n){if(this._batchingStatus.has(n))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(n,0),$e(()=>this._batchingStatus.delete(n))}_updateStatus(){var i,o;const n=this._getFocusedUnitId(),r=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,s=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(n,r=!1){let s=this._undoStacks.get(n);return!s&&r&&(s=[],this._undoStacks.set(n,s)),s||null}_getRedoStack(n,r=!1){let s=this._redoStacks.get(n);return!s&&r&&(s=[],this._redoStacks.set(n,s)),s||null}_getUndoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_tryBatchingElements(n,r){n.redoMutations.push(...r.redoMutations),n.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let n="";const r=this._contextService.getContextValue(mn),s=this._contextService.getContextValue($c),i=this._contextService.getContextValue(Bc);return r?s?n=ri:i?n=ni:n=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":n=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",n}};exports.LocalUndoRedoService=SE([cs(0,sn),cs(1,yt),cs(2,sr)],exports.LocalUndoRedoService);const Zr=_t("core.resource-manager.service"),Bs={[bt.Editor]:"Editor",[bt.Owner]:"Owner",[bt.Reader]:"Reader",[bt.UNRECOGNIZED]:"UNRECOGNIZED"},Fr=e=>e?{userID:`${Bs[e]}_${$.generateRandomId(8)}`,name:Bs[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},bE=(e,t)=>e.startsWith(Bs[t]);class kr{constructor(){R(this,"_model",new Map);R(this,"_userChange$",new le.Subject);R(this,"userChange$",this._userChange$.asObservable());R(this,"_currentUser$",new le.BehaviorSubject(Fr()));R(this,"currentUser$",this._currentUser$.asObservable())}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(t){this.addUser(t),this._currentUser$.next(t)}addUser(t){this._model.set(t.userID,t),this._userChange$.next({type:"add",user:t})}getUser(t,n){const r=this._model.get(t);if(r)return r;n&&n()}delete(t){const n=this.getUser(t);this._model.delete(t),n&&this._userChange$.next({type:"delete",user:n})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var yE=Object.defineProperty,wE=Object.getOwnPropertyDescriptor,AE=(e,t,n,r)=>{for(var s=r>1?void 0:r?wE(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&yE(t,n,s),s},Do=(e,t)=>(n,r)=>t(n,r,e);exports.AuthzIoLocalService=class{constructor(t,n){R(this,"_permissionMap",new Map([]));this._resourceManagerService=t,this._userManagerService=n,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const t=this._userManagerService.getCurrentUser();t&&t.userID||this._userManagerService.setCurrentUser(Fr(bt.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?bE(n.userID,t):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:t=>{const n=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(n)},parseJson:t=>JSON.parse(t),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[ye.UNIVER_SHEET,ye.UNIVER_DOC,ye.UNIVER_SLIDE],onLoad:(t,n)=>{for(const r in n)this._permissionMap.set(r,n[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(t){return tn(8)}async allowed(t){return Promise.resolve([])}async batchAllowed(t){return Promise.resolve([])}async list(t){const n=[];return t.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:t.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:bt.Owner,shareScope:-1,scope:{read:xs.AllCollaborator,edit:xs.AllCollaborator},creator:Fr(bt.Owner),strategies:[{action:6,role:1},{action:16,role:1},{action:17,role:1},{action:18,role:1},{action:19,role:1},{action:33,role:1},{action:34,role:1},{action:35,role:1},{action:36,role:1},{action:37,role:1},{action:38,role:1},{action:39,role:1},{action:40,role:1}],actions:t.actions.map(o=>({action:o,allowed:this._getRole(bt.Owner)||this._getRole(bt.Editor)}))};n.push(i)}}),n}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(t){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(t){}};exports.AuthzIoLocalService=AE([Do(0,Zr),Do(1,mt(kr))],exports.AuthzIoLocalService);const Kc=_t("IAuthzIoIoService"),Yc=_t("univer.config-service");class Xc{constructor(){R(this,"_configChanged$",new le.Subject);R(this,"configChanged$",this._configChanged$.asObservable());R(this,"_config",new Map)}dispose(){this._configChanged$.complete()}getConfig(t){return this._config.get(t)}setConfig(t,n,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(t))!=null?o:{};s?i=$.deepMerge(i,n):i=n,this._config.set(t,i),this._configChanged$.next({[t]:i})}deleteConfig(t){return this._config.delete(t)}subscribeConfigValue$(t){return new le.Observable(n=>{Object.prototype.hasOwnProperty.call(this._config,t)&&n.next(this._config.get(t));const r=this.configChanged$.pipe(le.filter(s=>Object.prototype.hasOwnProperty.call(s,t))).subscribe(s=>n.next(s[t]));return()=>r.unsubscribe()})}}class Qc extends Ge{constructor(){super(...arguments);R(this,"_error$",new le.Subject);R(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}class Wn extends Ge{constructor(){super();R(this,"_currentLocale$",new le.BehaviorSubject(or.ZH_CN));R(this,"currentLocale$",this._currentLocale$.asObservable());R(this,"_locales",null);R(this,"localeChanged$",new le.Subject);R(this,"t",(n,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=n.split("."),i=this.resolveKeyPath(this._locales[this._currentLocale],s);if(typeof i=="string"){let o=i;return r.forEach((a,l)=>{o=o.replace(`{${l}}`,a)}),o}else return n});this.disposeWithMe($e(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=$.deepMerge((r=this._locales)!=null?r:{},n)}setLocale(n){this._currentLocale$.next(n),this.localeChanged$.next()}getLocales(){var n;return(n=this._locales)==null?void 0:n[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(n,r){const s=r.shift();if(s&&n&&s in n){const i=n[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var bi=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(bi||{});const Jc=_t("univer.permission-service");class Zc extends Ge{constructor(){super(...arguments);R(this,"_permissionPointMap",new Map);R(this,"_permissionPointUpdate$",new le.Subject);R(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());R(this,"_showComponents",!0)}setShowComponents(n){this._showComponents=n}getShowComponents(){return this._showComponents}deletePermissionPoint(n){const r=this._permissionPointMap.get(n);r&&(r.complete(),this._permissionPointMap.delete(n))}addPermissionPoint(n){const r=n instanceof le.BehaviorSubject,s=r?n.getValue():n;if(!s.id)return!1;if(this._permissionPointMap.get(s.id))throw new Error(`${s.id} PermissionPoint already exists`);return this._permissionPointMap.set(s.id,r?n:new le.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(n,r){const s=this._permissionPointMap.get(n);if(!s)return;const i=s.getValue();i.value=r,i.status=bi.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(n){const r=this._permissionPointMap.get(n);if(r)return r.getValue()}getPermissionPoint$(n){const r=this._permissionPointMap.get(n);if(r)return r}composePermission$(n){const r=n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.asObservable()});return le.combineLatest(r).pipe(Sr.map(s=>s))}composePermission(n){return n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.getValue()})}getAllPermissionPoint(){const n=new Map;return this._permissionPointMap.forEach((r,s)=>{n.set(s,r)}),n}}const qc=Symbol("DependentOn");class $s extends Ge{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}R($s,"pluginName"),R($s,"type",ye.UNIVER_UNKNOWN);class NE{constructor(){R(this,"_plugins",[])}addPlugin(t){this._plugins.push(t)}removePlugins(){const t=this._plugins.slice();return this._plugins.length=0,t}forEachPlugin(t){this._plugins.forEach(t)}}class TE{constructor(){R(this,"_pluginsRegistered",[])}registerPlugin(t,n){this._pluginsRegistered.push({plugin:t,options:n})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var ME=Object.defineProperty,LE=Object.getOwnPropertyDescriptor,eu=(e,t,n,r)=>{for(var s=r>1?void 0:r?LE(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&ME(t,n,s),s},wr=(e,t)=>(n,r)=>t(n,r,e);const DE=4;function xE(...e){return function(t){t[qc]=e}}exports.PluginService=class{constructor(t){R(this,"_pluginHolderForUniver");R(this,"_pluginHoldersForTypes",new Map);R(this,"_seenPlugins",new Set);R(this,"_flushTimer");this._injector=t,this._pluginHolderForUniver=this._injector.createInstance(jr,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this)),this._pluginHoldersForTypes.set(ye.UNIVER_UNKNOWN,this._pluginHolderForUniver),this._pluginHolderForUniver.start()}dispose(){this._clearFlushTimer();for(const t of this._pluginHoldersForTypes.values())t.dispose();this._pluginHolderForUniver.dispose()}registerPlugin(t,n){this._assertPluginValid(t),this._scheduleInitPlugin();const{type:r}=t;r===ye.UNIVER_UNKNOWN?(this._pluginHolderForUniver.register(t,n),this._pluginHolderForUniver.flush()):this._ensurePluginHolderForType(r).register(t,n)}startPluginForType(t){this._ensurePluginHolderForType(t).start()}_ensurePluginHolderForType(t){if(!this._pluginHoldersForTypes.has(t)){const n=this._injector.createInstance(jr,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this));return this._pluginHoldersForTypes.set(t,n),n}return this._pluginHoldersForTypes.get(t)}_immediateInitPlugin(t){this._seenPlugins.add(t.pluginName),this._ensurePluginHolderForType(t.type).immediateInitPlugin(t)}_checkPluginSeen(t){return this._seenPlugins.has(t.pluginName)}_assertPluginValid(t){const{type:n,pluginName:r}=t;if(n===ye.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${t.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${t.name}. Please assign a "pluginName" to your plugin.`);if(this._seenPlugins.has(r))throw new 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(t.pluginName)}_scheduleInitPlugin(){this._flushTimer===void 0&&(this._flushTimer=setTimeout(()=>{this._pluginHolderForUniver.started||this._pluginHolderForUniver.start(),this._flushPlugins(),this._clearFlushTimer()},DE))}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}_flushPlugins(){this._pluginHolderForUniver.flush();for(const[t,n]of this._pluginHoldersForTypes)n.started&&n.flush()}};exports.PluginService=eu([wr(0,mt(Nt))],exports.PluginService);let jr=class extends Ge{constructor(t,n,r,s,i){super();R(this,"_started",!1);R(this,"_warnedAboutOnStartingDeprecation",!1);R(this,"_pluginRegistry",new TE);R(this,"_pluginStore",new NE);R(this,"_pluginsInBatches",[]);this._checkPluginRegistered=t,this._registerPlugin=n,this._logService=r,this._injector=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(le.skip(1)).subscribe(o=>{this._pluginsInBatches.forEach(a=>this._runStage(a,o))}))}get started(){return this._started}dispose(){super.dispose(),this._pluginStore.forEachPlugin(t=>t.dispose()),this._pluginStore.removePlugins(),this._pluginRegistry.removePlugins(),this._pluginsInBatches.length=0}register(t,n){this._pluginRegistry.registerPlugin(t,n)}immediateInitPlugin(t){const n=this._initPlugin(t,void 0);this._pluginsRunLifecycle([n])}start(){this._started||(this._started=!0,this.flush())}flush(){if(!this._started)return;const t=this._pluginRegistry.getRegisterPlugins().map(({plugin:n,options:r})=>this._initPlugin(n,r));t.length&&(this._pluginsRunLifecycle(t),this._pluginRegistry.removePlugins())}_initPlugin(t,n){const r=t[qc];if(r){const i=()=>{const o=r.find(a=>!this._checkPluginRegistered(a));return o?(this._logService.debug("[PluginService]",`Plugin "${t.pluginName}" depends on "${o.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._registerPlugin(o,void 0),!0):!1};for(;i(););}const s=this._injector.createInstance(t,n);return this._pluginStore.addPlugin(s),this._logService.debug("[PluginService]",`Plugin "${s.getPluginName()}" registered.`),s}_pluginsRunLifecycle(t){Wc(this._lifecycleService.stage).subscribe(n=>this._runStage(t,n)),this._pluginsInBatches.push(t)}_runStage(t,n){t.forEach(r=>{switch(n){case Fe.Starting:r.onStarting();break;case Fe.Ready:r.onReady();break;case Fe.Rendered:r.onRendered();break;case Fe.Steady:r.onSteady();break}})}};jr=eu([wr(2,vt),wr(3,mt(Nt)),wr(4,mt(exports.LifecycleService))],jr);function tu(e,t){if(!t)return e;const n=[];for(const r of e){const s=t.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;n.push([r[0],s[1]])}else n.push(r)}return n}var UE=Object.defineProperty,PE=Object.getOwnPropertyDescriptor,FE=(e,t,n,r)=>{for(var s=r>1?void 0:r?PE(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&UE(t,n,s),s},xo=(e,t)=>(n,r)=>t(n,r,e);let Ws=class extends Ge{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){const e=n=>{n.businesses.forEach(r=>{switch(r){case ye.UNRECOGNIZED:case ye.UNIVER_UNKNOWN:case ye.UNIVER_SLIDE:case ye.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType(ye.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}});break}case ye.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(ye.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(n=>e(n)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(n=>e(n))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(ye.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(ye.UNIVER_DOC).subscribe(n=>{const r=n.getUnitId();pa(r)||this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(ye.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(ye.UNIVER_DOC).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())}))}saveUnit(e){const t=this._univerInstanceService.getUnit(e);if(!t)return null;const n=this._resourceManagerService.getResources(e,t.type),r=$.deepClone(t.getSnapshot());return r.resources=n,r}};Ws=FE([xo(0,mt(Zr)),xo(1,mt(sn))],Ws);const Vs=_t("resource-loader-service");class nu extends Ge{constructor(){super(...arguments);R(this,"_resourceMap",new Map);R(this,"_register$",new le.Subject);R(this,"register$",this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(n,r){return r?this.getResourcesByType(n,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}getResourcesByType(n,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}registerPluginResource(n){const r=n.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,n),this._register$.next(n),$e(()=>this._resourceMap.delete(r))}disposePluginResource(n){this._resourceMap.delete(n)}loadResources(n,r){this.getAllResourceHooks().forEach(s=>{var o;const i=(o=r==null?void 0:r.find(a=>a.name===s.pluginName))==null?void 0:o.data;if(i)try{const a=s.parseJson(i);s.onLoad(n,a)}catch{console.error("LoadResources Error!")}})}unloadResources(n){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(n)})}dispose(){this._register$.complete(),this._resourceMap.clear()}}class yi extends Ge{constructor(){super();R(this,"_currentTheme");R(this,"_currentTheme$",new le.BehaviorSubject({}));R(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe($e(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}}class ru{constructor(t={},n){R(this,"_startedTypes",new Set);R(this,"_injector");const r=this._injector=kE(n,t==null?void 0:t.override),{theme:s,locale:i,locales:o,logLevel:a}=t;s&&this._injector.get(yi).setTheme(s),o&&this._injector.get(Wn).load(o),i&&this._injector.get(Wn).setLocale(i),a&&this._injector.get(vt).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(sn)}get _pluginService(){return this._injector.get(exports.PluginService)}__getInjector(){return this._injector}dispose(){this._injector.dispose()}setLocale(t){this._injector.get(Wn).setLocale(t)}createUnit(t,n){return this._univerInstanceService.createUnit(t,n)}createUniverSheet(t){return this._injector.get(vt).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ye.UNIVER_SHEET,t)}createUniverDoc(t){return this._injector.get(vt).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ye.UNIVER_DOC,t)}createUniverSlide(t){return this._injector.get(vt).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ye.UNIVER_SLIDE,t)}_init(t){this._univerInstanceService.registerCtorForType(ye.UNIVER_SHEET,exports.Workbook),this._univerInstanceService.registerCtorForType(ye.UNIVER_DOC,Ut),this._univerInstanceService.registerCtorForType(ye.UNIVER_SLIDE,Oi);const n=t.get(sn);n.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginForType(r),this._startedTypes.add(r);const l=t.createInstance(i,s);return n.__addUnit(l,o),this._tryProgressToReady(),l}const a=t.createInstance(i,s);return n.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(exports.LifecycleService).stage<Fe.Ready&&(this._injector.get(exports.LifecycleService).stage=Fe.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}}function kE(e,t){const n=tu([[Qc],[Wn],[yi],[exports.LifecycleService],[exports.PluginService],[kr],[sn,{useClass:exports.UniverInstanceService}],[Jc,{useClass:Zc}],[vt,{useClass:Ha,lazy:!0}],[yt,{useClass:exports.CommandService}],[Bt,{useClass:exports.LocalUndoRedoService,lazy:!0}],[Yc,{useClass:Xc}],[sr,{useClass:ka}],[Zr,{useClass:nu,lazy:!0}],[Vs,{useClass:Ws,lazy:!0}],[Kc,{useClass:exports.AuthzIoLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Nt(n);return La(r,[[kr],[Vs]]),r}var jE=Object.defineProperty,HE=Object.getOwnPropertyDescriptor,BE=(e,t,n,r)=>{for(var s=r>1?void 0:r?HE(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&jE(t,n,s),s},Uo=(e,t)=>(n,r)=>t(n,r,e);exports.FHooks=class extends Yn{constructor(t,n){super(),this._injector=t,this._lifecycleService=n}onStarting(t){return $e(this._lifecycleService.lifecycle$.pipe(le.filter(n=>n===Fe.Starting)).subscribe(t))}onReady(t){return $e(this._lifecycleService.lifecycle$.pipe(le.filter(n=>n===Fe.Ready)).subscribe(t))}onRendered(t){return $e(this._lifecycleService.lifecycle$.pipe(le.filter(n=>n===Fe.Rendered)).subscribe(t))}onSteady(t){return $e(this._lifecycleService.lifecycle$.pipe(le.filter(n=>n===Fe.Steady)).subscribe(t))}onBeforeUndo(t){return this._injector.get(yt).beforeCommandExecuted(r=>{if(r.id===Zn.id){const i=this._injector.get(Bt).pitchTopUndoElement();i&&t(i)}})}onUndo(t){return this._injector.get(yt).onCommandExecuted(r=>{if(r.id===Zn.id){const i=this._injector.get(Bt).pitchTopUndoElement();i&&t(i)}})}onBeforeRedo(t){return this._injector.get(yt).beforeCommandExecuted(r=>{if(r.id===qn.id){const i=this._injector.get(Bt).pitchTopRedoElement();i&&t(i)}})}onRedo(t){return this._injector.get(yt).onCommandExecuted(r=>{if(r.id===qn.id){const i=this._injector.get(Bt).pitchTopRedoElement();i&&t(i)}})}};exports.FHooks=BE([Uo(0,mt(Nt)),Uo(1,mt(exports.LifecycleService))],exports.FHooks);var $E=Object.defineProperty,WE=Object.getOwnPropertyDescriptor,VE=(e,t,n,r)=>{for(var s=r>1?void 0:r?WE(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&$E(t,n,s),s},us=(e,t)=>(n,r)=>t(n,r,e);exports.FUniver=class extends Yn{constructor(t,n,r){super(),this._injector=t,this._commandService=n,this._univerInstanceService=r}static newAPI(t){return(t instanceof ru?t.__getInjector():t).createInstance(exports.FUniver)}disposeUnit(t){return this._univerInstanceService.disposeUnit(t)}getCurrentLifecycleStage(){return this._injector.get(exports.LifecycleService).stage}undo(){return this._commandService.executeCommand(Zn.id)}redo(){return this._commandService.executeCommand(qn.id)}onBeforeCommandExecute(t){return this._commandService.beforeCommandExecuted((n,r)=>{t(n,r)})}onCommandExecuted(t){return this._commandService.onCommandExecuted((n,r)=>{t(n,r)})}executeCommand(t,n,r){return this._commandService.executeCommand(t,n,r)}getHooks(){return this._injector.createInstance(exports.FHooks)}};exports.FUniver=VE([us(0,mt(Nt)),us(1,yt),us(2,sn)],exports.FUniver);function su(e){return/^-?\d+(\.\d+)?$/.test(e)}function zE(e){return su(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}class wi{constructor(){R(this,"_data",[])}static create(){return new wi}add(t){this._data.indexOf(t)>-1||this._data.push(t)}delete(t){const n=this._data.indexOf(t);this._data.splice(n,1)}getData(){return this._data}}class Ai{constructor(){R(this,"_data",new Map)}static create(){return new Ai}add(t,n){this._data.has(t)||this._data.set(t,n)}delete(t){this._data.delete(t)}getData(){return this._data}}function GE(e){const t=new MessageChannel;let n=!1;const r=()=>{n||e()};return t.port1.onmessage=r,t.port2.postMessage(null),()=>{n=!0,t.port1.close(),t.port2.close()}}function KE(e,t){return t.forEach(n=>e.add(n)),e}function YE(e,t,n,r){var c;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new Ut(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const u=new Xe,h=rn.getInstance();if(a>0&&u.retain(a),n.length>0){const d=i.sliceBody(a,a+o),f={dataStream:n};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(f.textRuns=[{...d.textRuns[0],st:0,ed:n.length}]),(c=d==null?void 0:d.customRanges)!=null&&c.length){const _=d.customRanges[0];f.customRanges=[{..._,startIndex:0,endIndex:n.length-1}]}u.insert(n.length,f)}u.delete(o),i.apply(h.editOp(u.serialize()))}const l=i.getBody();return i.dispose(),l}const XE="__default_document_sub_component_id20231101__";class iu{constructor(){R(this,"skipNextObservers",!1);R(this,"lastReturnValue");R(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class QE extends le.Subject{constructor(){super(...arguments);R(this,"_sortedObservers",[])}subscribe(){throw new Error("[EventSubject]: please use `subscribeEvent` instead of `subscribe` method for `EventSubject`.")}next(){throw new Error("[EventSubject]: please use `emitEvent` instead of `next` method for `EventSubject`.")}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(n){let r;typeof n=="function"?r={next:([i,o])=>n(i,o)}:r=n;const s=super.subscribe(r);return this._sortedObservers.push(r),this._sortedObservers.sort((i,o)=>{var a,l;return((a=i.priority)!=null?a:0)-((l=o.priority)!=null?l:0)}),s.add(()=>this._sortedObservers=this._sortedObservers.filter(i=>i!==r)),s}clearObservers(){this._sortedObservers.forEach(n=>{var r;return(r=n.complete)==null?void 0:r.call(n)}),this._sortedObservers.length=0}emitEvent(n){var r;if(!this.closed){const s=new iu;s.lastReturnValue=n;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[n,s]);if(s.lastReturnValue=o,s.skipNextObservers)return{handled:!0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}throw new Error("[EventSubject]: cannot emit event on a closed subject.")}}function JE(e){return new le.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const ZE=_t("ILocalStorageService");function qE(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function e0(e){return new Promise(t=>setTimeout(t,e))}const t0=["script","style","meta","comment","link"];var ou=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(ou||{}),au=(e=>(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))(au||{}),lu=(e=>(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))(lu||{}),cu=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(cu||{}),uu=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(uu||{}),hu=(e=>(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))(hu||{});const Po=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],hs=1,Mn=8;class Ni{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==hs)throw new Error(`Got v${s} data when expected v${hs}.`);const i=Po[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new Ni(a,o,i,t)}constructor(t,n=64,r=Float64Array,s){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=Po.indexOf(this.ArrayType),o=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,Mn,t),this.coords=new this.ArrayType(this.data,Mn+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Mn+o+a+l),this.ids=new this.IndexArrayType(this.data,Mn,t),this.coords=new this.ArrayType(this.data,Mn+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(hs<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=n,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return zs(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,l=[0,i.length-1,0],c=[];for(;l.length;){const u=l.pop()||0,h=l.pop()||0,d=l.pop()||0;if(h-d<=a){for(let T=d;T<=h;T++){const S=o[2*T],x=o[2*T+1];S>=t&&S<=r&&x>=n&&x<=s&&c.push(i[T])}continue}const f=d+h>>1,_=o[2*f],C=o[2*f+1];_>=t&&_<=r&&C>=n&&C<=s&&c.push(i[f]),(u===0?t<=_:n<=C)&&(l.push(d),l.push(f-1),l.push(1-u)),(u===0?r>=_:s>=C)&&(l.push(f+1),l.push(h),l.push(1-u))}return c}within(t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:o}=this,a=[0,s.length-1,0],l=[],c=r*r;for(;a.length;){const u=a.pop()||0,h=a.pop()||0,d=a.pop()||0;if(h-d<=o){for(let T=d;T<=h;T++)Fo(i[2*T],i[2*T+1],t,n)<=c&&l.push(s[T]);continue}const f=d+h>>1,_=i[2*f],C=i[2*f+1];Fo(_,C,t,n)<=c&&l.push(s[f]),(u===0?t-r<=_:n-r<=C)&&(a.push(d),a.push(f-1),a.push(1-u)),(u===0?t+r>=_:n+r>=C)&&(a.push(f+1),a.push(h),a.push(1-u))}return l}}function zs(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;du(e,t,o,r,s,i),zs(e,t,n,r,o-1,1-i),zs(e,t,n,o+1,s,1-i)}function du(e,t,n,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,u=n-r+1,h=Math.log(c),d=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*d*(c-d)/c)*(u-c/2<0?-1:1),_=Math.max(r,Math.floor(n-u*d/c+f)),C=Math.min(s,Math.floor(n+(c-u)*d/c+f));du(e,t,n,_,C,i)}const o=t[2*n+i];let a=r,l=s;for(Ln(e,t,r,n),t[2*s+i]>o&&Ln(e,t,r,s);a<l;){for(Ln(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?Ln(e,t,r,l):(l++,Ln(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function Ln(e,t,n,r){ds(e,n,r),ds(t,2*n,2*r),ds(t,2*n+1,2*r+1)}function ds(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Fo(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}function fu(e,t,n=0,r=e.length-1,s=n0){for(;r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*h/l+d)),_=Math.min(r,Math.floor(t+(l-c)*h/l+d));fu(e,t,f,_,s)}const i=e[t];let o=n,a=r;for(Dn(e,n,t),s(e[r],i)>0&&Dn(e,n,r);o<a;){for(Dn(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?Dn(e,n,a):(a++,Dn(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function Dn(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function n0(e,t){return e<t?-1:e>t?1:0}class ko{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!vr(t,n))return r;const s=this.toBBox,i=[];for(;n;){for(let o=0;o<n.children.length;o++){const a=n.children[o],l=n.leaf?s(a):a;vr(t,l)&&(n.leaf?r.push(a):gs(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!vr(t,n))return!1;const r=[];for(;n;){for(let s=0;s<n.children.length;s++){const i=n.children[s],o=n.leaf?this.toBBox(i):i;if(vr(t,o)){if(n.leaf||gs(t,o))return!0;r.push(i)}}n=r.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let r=0;r<t.length;r++)this.insert(t[r]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=fn([]),this}remove(t,n){if(!t)return this;let r=this.data;const s=this.toBBox(t),i=[],o=[];let a,l,c;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],a=o.pop(),c=!0),r.leaf){const u=r0(t,r.children,n);if(u!==-1)return r.children.splice(u,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&gs(r,s)?(i.push(r),o.push(a),a=0,l=r,r=r.children[0]):l?(a++,r=l.children[a],c=!1):r=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){const r=[];for(;t;)t.leaf?n.push(...t.children):r.push(...t.children),t=r.pop();return n}_build(t,n,r,s){const i=r-n+1;let o=this._maxEntries,a;if(i<=o)return a=fn(t.slice(n,r+1)),hn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=fn([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));jo(t,n,r,c,this.compareMinX);for(let u=n;u<=r;u+=c){const h=Math.min(u+c-1,r);jo(t,u,h,l,this.compareMinY);for(let d=u;d<=h;d+=l){const f=Math.min(d+l-1,h);a.children.push(this._build(t,d,f,s-1))}}return hn(a,this.toBBox),a}_chooseSubtree(t,n,r,s){for(;s.push(n),!(n.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<n.children.length;l++){const c=n.children[l],u=fs(c),h=o0(t,c)-u;h<o?(o=h,i=u<i?u:i,a=c):h===o&&u<i&&(i=u,a=c)}n=a||n.children[0]}return n}_insert(t,n,r){const s=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(s,this.data,n,i);for(o.children.push(t),Hn(o,s);n>=0&&i[n].children.length>this._maxEntries;)this._split(i,n),n--;this._adjustParentBBoxes(s,i,n)}_split(t,n){const r=t[n],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);const o=this._chooseSplitIndex(r,i,s),a=fn(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,hn(r,this.toBBox),hn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=fn([t,n]),this.data.height=t.height+1,this.data.leaf=!1,hn(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let s,i=1/0,o=1/0;for(let a=n;a<=r-n;a++){const l=jn(t,0,a,this.toBBox),c=jn(t,a,r,this.toBBox),u=a0(l,c),h=fs(l)+fs(c);u<i?(i=u,s=a,o=h<o?h:o):u===i&&h<o&&(o=h,s=a)}return s||r-n}_chooseSplitAxis(t,n,r){const s=t.leaf?this.compareMinX:s0,i=t.leaf?this.compareMinY:i0,o=this._allDistMargin(t,n,r,s),a=this._allDistMargin(t,n,r,i);o<a&&t.children.sort(s)}_allDistMargin(t,n,r,s){t.children.sort(s);const i=this.toBBox,o=jn(t,0,n,i),a=jn(t,r-n,r,i);let l=Ir(o)+Ir(a);for(let c=n;c<r-n;c++){const u=t.children[c];Hn(o,t.leaf?i(u):u),l+=Ir(o)}for(let c=r-n-1;c>=n;c--){const u=t.children[c];Hn(a,t.leaf?i(u):u),l+=Ir(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)Hn(n[s],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():hn(t[n],this.toBBox)}}function r0(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 hn(e,t){jn(e,0,e.children.length,t,e)}function jn(e,t,n,r,s){s||(s=fn(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let i=t;i<n;i++){const o=e.children[i];Hn(s,e.leaf?r(o):o)}return s}function Hn(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 s0(e,t){return e.minX-t.minX}function i0(e,t){return e.minY-t.minY}function fs(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Ir(e){return e.maxX-e.minX+(e.maxY-e.minY)}function o0(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 a0(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);return Math.max(0,s-n)*Math.max(0,i-r)}function gs(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function vr(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function fn(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function jo(e,t,n,r,s){const i=[t,n];for(;i.length;){if(n=i.pop(),t=i.pop(),n-t<=r)continue;const o=t+Math.ceil((n-t)/r/2)*r;fu(e,o,t,n,s),i.push(t,o,o,n)}}class l0{constructor(t=!1){R(this,"_tree",new Map);R(this,"_oneCellCache",new Map);R(this,"_kdTree",new Map);this._enableOneCellCache=t}dispose(){this.clear()}getTree(t,n){return this._tree.has(t)||this._tree.set(t,new Map),this._tree.get(t).has(n)||this._tree.get(t).set(n,new ko),this._tree.get(t).get(n)}_getOneCellCache(t,n,r,s){return this._oneCellCache.has(t)||this._oneCellCache.set(t,new Map),this._oneCellCache.get(t).has(n)||this._oneCellCache.get(t).set(n,new Map),this._oneCellCache.get(t).get(n).has(r)||this._oneCellCache.get(t).get(n).set(r,new Map),this._oneCellCache.get(t).get(n).get(r).has(s)||this._oneCellCache.get(t).get(n).get(r).set(s,new Set),this._oneCellCache.get(t).get(n).get(r).get(s)}_removeOneCellCache(t,n,r,s,i){const o=this._oneCellCache.get(t);if(!o)return;const a=o.get(n);if(!a)return;const l=a.get(r);if(!l)return;const c=l.get(s);c&&c.delete(i)}_removeCellCacheByRange(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this._oneCellCache.get(n);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:c,endRow:u,endColumn:h}=s;for(let d=l;d<=u;d++){const f=a.get(d);if(f)for(let _=c;_<=h;_++){const C=f.get(_);C&&C.delete(i)}}}_insertOneCellCache(t,n,r,s,i){this._getOneCellCache(t,n,r,s).add(i)}_getRdTreeItems(t){const n=[];for(const[r,s]of t)for(const[i,o]of s)n.push({x:i,y:r,ids:o});return n}_searchByOneCellCache(t){var _;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(_=this._kdTree.get(n))==null?void 0:_.get(r);if(!c)return[];const{tree:u,items:h}=c,d=u.range(o,i,l,a),f=[];for(const C of d){const T=h[C];f.push(...Array.from(T.ids))}return f}openKdTree(){var t;for(const[n,r]of this._oneCellCache){this._kdTree.has(n)||this._kdTree.set(n,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new Ni(o.length);(t=this._kdTree.get(n))==null||t.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var t;for(const[n,r]of this._oneCellCache)for(const[s,i]of r)(t=this._kdTree.get(n))==null||t.set(s,void 0)}insert(t){const{unitId:n,sheetId:r,range:s,id:i}=t;if(!n||n.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:c}=s;if(this._enableOneCellCache&&o===a&&l===c){this._insertOneCellCache(n,r,o,l,i);return}const u=this.getTree(n,r);Number.isNaN(o)&&(o=0),Number.isNaN(l)&&(l=0),Number.isNaN(a)&&(a=Number.POSITIVE_INFINITY),Number.isNaN(c)&&(c=Number.POSITIVE_INFINITY),u.insert({minX:l,minY:o,maxX:c,maxY:a,id:i})}bulkInsert(t){for(const n of t)this.insert(n)}*searchGenerator(t){var a;const{unitId:n,sheetId:r,range:s}=t;if(this._enableOneCellCache){const l=this._searchByOneCellCache(t);for(const c of l)yield c}const i=(a=this._tree.get(n))==null?void 0:a.get(r);if(!i)return;const o=i.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(const l of o)yield l.id}bulkSearch(t,n){const r=new Set;for(const s of t)for(const i of this.searchGenerator(s))(n==null?void 0:n.has(i))!==!0&&r.add(i);return r}removeById(t,n){var r,s;n?((r=this._tree.get(t))==null||r.delete(n),(s=this._oneCellCache.get(t))==null||s.delete(n)):(this._tree.delete(t),this._oneCellCache.delete(t))}_removeRTreeItem(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this.getTree(n,r),a=o.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(let l=0;l<a.length;l++)a[l].id===i&&o.remove(a[l])}remove(t){const{unitId:n,sheetId:r,range:s,id:i}=t,{startRow:o,startColumn:a,endRow:l,endColumn:c}=s;this._enableOneCellCache?o===l&&a===c?this._removeOneCellCache(n,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(t),this._removeRTreeItem(t)):this._removeRTreeItem(t)}bulkRemove(t){for(const n of t)this.remove(n)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const t={};return this._tree.forEach((n,r)=>{t[r]={},n.forEach((s,i)=>{t[r][i]=s.toJSON()})}),t}fromJSON(t){this._tree.clear();for(const n in t){this._tree.set(n,new Map);for(const r in t[n]){const s=new ko;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}Eu();exports.ABCToNumber=Am;exports.AbsoluteRefType=ze;exports.ActionIterator=dn;exports.AlignTypeH=ec;exports.AlignTypeV=tc;exports.ArrangeTypeEnum=sc;exports.ArrowsAndMarkersShapes=il;exports.AsyncInterceptorManager=Ug;exports.AutoFillSeries=Ka;exports.BaselineOffset=xt;exports.BasicShapes=sl;exports.BlockType=Ll;exports.BooleanNumber=Re;exports.BorderStyleTypes=ke;exports.BorderType=Ya;exports.BuildTextUtils=Dt;exports.BulletAlignment=lr;exports.COLORS=Ns;exports.CellValueType=$t;exports.Color=nn;exports.ColorBuilder=Yr;exports.ColorKit=Ct;exports.ColorType=gt;exports.ColumnSeparatorType=Pl;exports.CommandType=ir;exports.CommonHideTypes=Xa;exports.ConfigService=Xc;exports.ContextService=ka;exports.CopyPasteType=Qa;exports.CustomCommandExecutionError=ys;exports.CustomDecorationType=Rn;exports.CustomRangeType=Qn;exports.DEFAULT_CELL=gm;exports.DEFAULT_DOC=Si;exports.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=XE;exports.DEFAULT_EMPTY_DOCUMENT_VALUE=ga;exports.DEFAULT_RANGE=dm;exports.DEFAULT_RANGE_ARRAY=hm;exports.DEFAULT_SELECTION=fm;exports.DEFAULT_SLIDE=Ol;exports.DEFAULT_STYLES=et;exports.DEFAULT_WORKSHEET_COLUMN_COUNT=Dc;exports.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=K_;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Fc;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=J_;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH=Uc;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=X_;exports.DEFAULT_WORKSHEET_ROW_COUNT=Lc;exports.DEFAULT_WORKSHEET_ROW_COUNT_KEY=G_;exports.DEFAULT_WORKSHEET_ROW_HEIGHT=xc;exports.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=Y_;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Pc;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=Q_;exports.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=ri;exports.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=ni;exports.DOCS_ZEN_EDITOR_UNIT_ID_KEY=fa;exports.DOC_RANGE_TYPE=_l;exports.DashStyleType=Wl;exports.DataStreamTreeNodeType=Nc;exports.DataStreamTreeTokenType=Mt;exports.DataValidationErrorStyle=ou;exports.DataValidationImeMode=au;exports.DataValidationOperator=lu;exports.DataValidationRenderMode=cu;exports.DataValidationStatus=uu;exports.DataValidationType=hu;exports.DeleteDirection=Ja;exports.DependentOn=xE;exports.DesktopLogService=Ha;exports.DeveloperMetadataVisibility=Za;exports.Dimension=qa;exports.Direction=el;exports.Disposable=Ge;exports.DisposableCollection=ui;exports.DocStyleType=Tl;exports.DocumentDataModel=Ut;exports.DocumentFlavor=Dl;exports.DrawingTypeEnum=ic;exports.EDITOR_ACTIVATED=Bc;exports.EXTENSION_NAMES=bl;exports.ErrorService=Qc;exports.EventState=iu;exports.EventSubject=QE;exports.FBase=Yn;exports.FOCUSING_COMMON_DRAWINGS=hE;exports.FOCUSING_DOC=Fn;exports.FOCUSING_EDITOR_BUT_HIDDEN=iE;exports.FOCUSING_EDITOR_INPUT_FORMULA=oE;exports.FOCUSING_EDITOR_STANDALONE=lE;exports.FOCUSING_FX_BAR_EDITOR=$c;exports.FOCUSING_PANEL_EDITOR=cE;exports.FOCUSING_SHEET=mn;exports.FOCUSING_SLIDE=kn;exports.FOCUSING_UNIT=Pn;exports.FOCUSING_UNIVER_EDITOR=aE;exports.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=uE;exports.FORMULA_EDITOR_ACTIVATED=dE;exports.FollowNumberWithType=Ml;exports.FontItalic=Mr;exports.FontStyleType=pn;exports.FontWeight=Lr;exports.FormatType=tl;exports.GlyphType=he;exports.GridType=xl;exports.HLSColor=gl;exports.HorizontalAlign=Ht;exports.IAuthzIoService=Kc;exports.ICommandService=yt;exports.IConfigService=Yc;exports.IContextService=sr;exports.ILocalStorageService=ZE;exports.ILogService=vt;exports.IPermissionService=Jc;exports.IResourceLoaderService=Vs;exports.IResourceManagerService=Zr;exports.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=jf;exports.IUndoRedoService=Bt;exports.IUniverInstanceService=sn;exports.Inject=mt;exports.Injector=Nt;exports.InterceptorEffectEnum=gn;exports.InterceptorManager=Lg;exports.InterpolationPointType=nl;exports.JSON1=Hm;exports.JSONX=rn;exports.LRUHelper=Un;exports.LRUMap=Ur;exports.LifecycleStages=Fe;exports.LocaleService=Wn;exports.LocaleType=or;exports.LogLevel=ja;exports.MOVE_BUFFER_VALUE=xn;exports.Many=Ia;exports.MemoryCursor=yn;exports.NamedStyleType=Bl;exports.NilCommand=Ba;exports.NumberUnitType=ql;exports.ObjectMatrix=wt;exports.ObjectRelativeFromH=Jl;exports.ObjectRelativeFromV=Zl;exports.Optional=va;exports.OtherShapes=ol;exports.PRESET_LIST_TYPE=cr;exports.PageElementType=oc;exports.PageOrientType=rc;exports.PageType=Ci;exports.ParagraphElementType=kl;exports.PermissionService=Zc;exports.PermissionStatus=bi;exports.Plugin=$s;exports.PositionedObjectLayoutType=Hl;exports.PresetListType=At;exports.ProtectionType=rl;exports.QuickListType=lc;exports.QuickListTypeMap=$m;exports.RANGE_DIRECTION=ml;exports.RANGE_TYPE=me;exports.RCDisposable=Bg;exports.RGBA_PAREN=Ep;exports.RGB_PAREN=_p;exports.ROTATE_BUFFER_VALUE=Ga;exports.RTree=l0;exports.Range=vn;exports.Rectangle=zt;exports.RediConsumer=Na;exports.RediContext=rr;exports.RediError=Qe;exports.RediProvider=ci;exports.RedoCommand=qn;exports.RedoCommandId=zc;exports.RefAlias=wm;exports.Registry=wi;exports.RegistryAsMap=Ai;exports.RelativeDate=ll;exports.RelativeSlideLink=ac;exports.ResourceManagerService=nu;exports.RgbColor=Dr;exports.RxDisposable=Hg;exports.SHEET_EDITOR_UNITS=pm;exports.SectionType=Ul;exports.Self=ya;exports.SheetTypes=cl;exports.SheetViewModel=jc;exports.SkipSelf=ba;exports.SliceBodyType=vi;exports.SlideDataModel=Oi;exports.SpacingRule=$l;exports.SpecialShapes=al;exports.Styles=yc;exports.THEME_COLORS=fl;exports.TabStopAlignment=Vl;exports.TableAlignmentType=Gl;exports.TableCellHeightRule=Xl;exports.TableLayoutType=Kl;exports.TableSizeType=zl;exports.TableTextWrapType=Yl;exports.TextDecoration=ul;exports.TextDirection=Xn;exports.TextDirectionType=Fl;exports.TextX=Xe;exports.TextXActionType=te;exports.ThemeColor=xr;exports.ThemeColorType=it;exports.ThemeColors=Kr;exports.ThemeService=yi;exports.Tools=$;exports.UndoCommand=Zn;exports.UndoCommandId=Gc;exports.UnitModel=Qr;exports.Univer=ru;exports.UniverInstanceType=ye;exports.UpdateDocsAttributeType=ve;exports.UserManagerService=kr;exports.VerticalAlign=Zt;exports.VerticalAlignmentType=Ql;exports.WithDependency=Sg;exports.WithNew=wa;exports.Worksheet=Jn;exports.WrapStrategy=en;exports.WrapTextType=jl;exports.afterInitApply=Qg;exports.afterTime=Xg;exports.awaitTime=e0;exports.binSearchFirstGreaterThanTarget=za;exports.binarySearchArray=Jg;exports.bufferDebounceTime=Yg;exports.cellToRange=Kp;exports.characterSpacingControlType=nc;exports.checkForSubstrings=Yp;exports.checkIfMove=ep;exports.checkParagraphHasBullet=Xp;exports.checkParagraphHasIndent=Qp;exports.checkParagraphHasIndentByStyle=Cl;exports.codeToBlob=qg;exports.composeBody=js;exports.composeInterceptors=xa;exports.composeStyles=ws;exports.concatMatrixArray=am;exports.connectDependencies=Cg;exports.connectInjector=Rg;exports.convertBodyToHtml=mp;exports.covertTextRunToHtml=As;exports.createAsyncInterceptorKey=Dg;exports.createDefaultUser=Fr;exports.createIdentifier=_t;exports.createInterceptorKey=Mg;exports.createInternalEditorID=Hf;exports.createRowColIter=Ds;exports.debounce=pf;exports.dedupe=Df;exports.deepCompare=fi;exports.deleteContent=vl;exports.extractPureTextFromCell=Hc;exports.forwardRef=Xf;exports.fromCallback=$a;exports.fromEventSubject=JE;exports.fromObservable=jg;exports.generateRandomId=tn;exports.get=zd;exports.getArrayLength=Wt;exports.getBodySlice=Vt;exports.getBodySliceHtml=yr;exports.getBorderStyleType=Vp;exports.getCellInfoInMergeData=Fp;exports.getCellValueType=Dp;exports.getColorStyle=Ot;exports.getCustomDecorationSlice=Sc;exports.getCustomRangeSlice=vc;exports.getDocsUpdateBody=zp;exports.getIntersectRange=Im;exports.getOriginCellValue=q_;exports.getReverseDirection=tp;exports.getWorksheetUID=sE;exports.groupBy=Pf;exports.handleStyleToString=Wp;exports.hashAlgorithm=qp;exports.horizontalLineSegmentsSubtraction=Xr;exports.insertMatrixArray=Ts;exports.insertTextToContent=Il;exports.isAsyncDependencyItem=Is;exports.isAsyncHook=Or;exports.isBlackColor=Tp;exports.isBooleanString=kf;exports.isCellCoverable=Hp;exports.isCellV=Up;exports.isClassDependencyItem=Es;exports.isCtor=ii;exports.isDisposable=Ss;exports.isEmptyCell=El;exports.isFactoryDependencyItem=Rs;exports.isFormulaId=$p;exports.isFormulaString=Bp;exports.isICellData=Lp;exports.isInternalEditorID=pa;exports.isNodeEnv=pp;exports.isNullCell=xp;exports.isNumeric=su;exports.isRangesEqual=F_;exports.isRealNum=Zp;exports.isSafeNumeric=zE;exports.isSameStyleTextRun=Rl;exports.isUnitRangesEqual=k_;exports.isValidRange=Gp;exports.isValueDependencyItem=Cs;exports.isWhiteColor=Mp;exports.makeArray=Ff;exports.makeCellRangeToRangeData=jp;exports.makeCellToSelection=kp;exports.makeCustomRangeStream=y_;exports.merge=Cf;exports.mergeOverrideWithDependencies=tu;exports.mergeSets=KE;exports.mergeWith=Rf;exports.mergeWorksheetSnapshotWithDefault=kc;exports.mixinClass=Pg;exports.moveMatrixArray=Ls;exports.moveRangeByOffset=mm;exports.nameCharacterCheck=qE;exports.normalizeBody=t_;exports.normalizeTextRuns=Jr;exports.numberToABC=Tm;exports.numberToListABC=Mm;exports.numfmt=om;exports.queryObjectMatrix=ym;exports.registerDependencies=Ng;exports.remove=tr;exports.repeatStringNumTimes=Al;exports.replaceInDocumentBody=YE;exports.requestImmediateMacroTask=GE;exports.rotate=Uf;exports.searchArray=Zg;exports.searchInOrderedArray=Va;exports.selectionToArray=Pp;exports.sequence=Pa;exports.sequenceAsync=Ua;exports.sequenceExecute=hi;exports.sequenceExecuteAsync=Kg;exports.set=vf;exports.setDependencies=dg;exports.shallowEqual=Da;exports.skipParseTagNames=t0;exports.sliceMatrixArray=lm;exports.sortRules=Lm;exports.sortRulesByDesc=Dm;exports.sortRulesFactory=ar;exports.spliceArray=Ms;exports.splitIntoGrid=yl;exports.takeAfter=Wa;exports.textDiff=da;exports.throttle=Tg;exports.toDisposable=$e;exports.touchDependencies=La;exports.updateAttributeByDelete=Oc;exports.updateAttributeByInsert=bc;exports.useDependency=_g;exports.useDependencyContext=wg;exports.useDependencyContextValue=Ag;exports.useDependencyValue=Ma;exports.useInjector=Ta;exports.useObservable=bg;exports.useUpdateBinder=yg;
4
+ For more info please visit our website: https://redi.wendell.fun/en-US/docs/debug#import-scripts-of-redi-more-than-once`):oo[ao]=!0;var lo="REDI_CONTEXT_LOCK",wg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,uo=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global;uo[lo]?wg||console.error(`[redi]: "RediContext" is already created. You may import "RediContext" from different paths. Use "import { RediContext } from '@wendellhu/redi/react-bindings'; instead."`):uo[lo]=!0;var lr=Tt.createContext({injector:null});lr.displayName="RediContext";var ci=lr.Provider,Ma=lr.Consumer,bg=function(){var e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Ag=function(e){bg(n,e);function n(){return e.call(this,"Using dependency injection outside of a RediContext.")||this}return n}(ot);function Da(){var e=Tt.useContext(lr);if(!e.injector)throw new Ag;return e.injector}function Tg(e,n,t){var r=Da();return Tt.useMemo(function(){return r.get(e,n,t)},[e,n,t])}var xr=function(){return xr=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++){n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},xr.apply(this,arguments)};function Ng(e){var n=e.children,t=e.dependencies,r=Tt.useRef(null);return Tt.useEffect(function(){return function(){var s;return(s=r.current)===null||s===void 0?void 0:s.dispose()}},[]),Tt.createElement(Ma,null,function(s){var i;return r.current?i=r.current:(i=s.injector?s.injector.createChild(t):new Ft(t),r.current=i),Tt.createElement(ci,{value:{injector:i}},n)})}function Mg(e,n){return function(r){return Tt.createElement(ci,{value:{injector:n}},Tt.createElement(e,xr({},r)))}}function Dg(e,n){return function(r){return Tt.createElement(Ng,{dependencies:n},Tt.createElement(e,xr({},r)))}}var Lg=function(){var e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),xg=function(e){Lg(n,e);function n(t){return e.call(this,'You should make "RediContext" as '.concat(t.constructor.name,"'s default context type. ")+"If you want to use multiple context, please check this on React doc site. https://reactjs.org/docs/context.html#classcontexttype")||this}return n}(ot);function Ug(e,n,t){return function(){return{get:function(){var r=this,s=r.context;if(!s||!s.injector)throw new xg(r);var i=s.injector,o=i.get(e,n||exports.Quantity.REQUIRED,t);return o}}}}var Pg=function(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))};function La(e,n){var t=e instanceof Ee.BehaviorSubject&&typeof n>"u"?e.getValue():n,r=lt.useState(t),s=r[0],i=r[1];return lt.useEffect(function(){var o=e.subscribe(function(a){return i(a)});return function(){return o.unsubscribe()}},[e]),s}function co(e){return typeof e=="function"?e():e}function kg(e,n,t,r){if(typeof e=="function"&&!r)throw new ot("Expected deps to be provided when observable is a function!");var s=lt.useRef(null),i=lt.useRef(!1),o=lt.useMemo(function(){return e},Pg([],typeof r<"u"?r:[e],!0)),a=lt.useState(0);a[0];var l=a[1],c=lt.useRef(function(){var h;if(o){var u=co(o).subscribe(function(d){i.current=!0,h=d});u.unsubscribe()}return h!=null?h:n}());if(lt.useEffect(function(){var h=null;return o&&(s.current=co(o),h=s.current.subscribe(function(u){c.current=u,l(function(d){return d+1})})),function(){return h==null?void 0:h.unsubscribe()}},[o]),t&&!i.current)throw new Error("Expect `shouldHaveSyncValue` but not getting a sync value!");return c.current}function Fg(e){var n=lt.useState(0),t=n[1];lt.useEffect(function(){var r=e.subscribe(function(){return t(function(s){return s+1})});return function(){return r.unsubscribe()}},[])}var bs=new WeakMap;function $g(e,n){var t=lt.useRef(void 0),r=La(e,n),s=lt.useMemo(function(){return lt.createContext(r)},[e]),i=lt.useCallback(function(o){return lt.createElement(s.Provider,{value:r},o.children)},[e,r]);return t.current!==e&&(t.current&&bs.delete(t.current),t.current=e,bs.set(e,s)),{Provider:i,value:r}}function jg(e){var n=bs.get(e);if(!n)throw new ot("try to read context value but no ancestor component subscribed it.");return lt.useContext(n)}function Hg(e,n){n.forEach(t=>e.add(t))}function xa(e,n){n.forEach(([t])=>{e.has(t)&&e.get(t)})}function Ua(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||!e||typeof n!="object"||!n)return!1;const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;const s=Object.prototype.hasOwnProperty.bind(n);for(let i=0;i<t.length;i++){const o=t[i];if(!s(o))return!1;const a=e[o],l=n[o];if(a!==l)return!1}return!0}class As extends Error{constructor(n){super(n),this.name="CustomCommandExecutionError"}}function Bg(e,n=16){let t=0,r=null;return function(...i){const o=Date.now();o-t<n?(r&&clearTimeout(r),r=setTimeout(()=>{t=o,e.apply(this,i)},n)):(t=o,e.apply(this,i))}}var In=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(In||{});function Wg(e){return`sheet_interceptor_${e}`}const Pa=e=>function(n,t){let r=-1,s=n;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=o.handler(s,t,l=>(a=!0,l)),!a)break}return s};class Yg{constructor(n){R(this,"_interceptorsByName",new Map);R(this,"_interceptorPoints");this._interceptorPoints=n}fetchThroughInterceptors(n){const t=n,r=this._interceptorsByName.get(t);return Pa(r||[])}intercept(n,t){const r=n;this._interceptorsByName.has(r)||this._interceptorsByName.set(r,[]);const s=this._interceptorsByName.get(r);return s.push(t),this._interceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>or(this._interceptorsByName.get(r),t)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function zg(e){return`sheet_async_interceptor_${e}`}const Vg=e=>async function(n,t){let r=-1,s=n;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=await o.handler(s,t,async l=>(a=!0,l)),!a)break}return s};class Gg{constructor(n){R(this,"_asyncInterceptorsByName",new Map);R(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=n}fetchThroughAsyncInterceptors(n){const t=n,r=this._asyncInterceptorsByName.get(t);return Vg(r||[])}async interceptAsync(n,t){const r=n;this._asyncInterceptorsByName.has(r)||this._asyncInterceptorsByName.set(r,[]);const s=this._asyncInterceptorsByName.get(r);return s.push(t),this._asyncInterceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>or(this._asyncInterceptorsByName.get(r),t)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}class Ln{constructor(){R(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(n){this.cursor+=n}moveCursorTo(n){this.cursor=n}}function Kg(e,n){for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t])}const Xn=class Xn{constructor(){const n=this;Xn._constructorQueue.forEach(function(t){t.apply(n)})}_initialize(){}static extend(n){Object.getOwnPropertyNames(n.prototype).forEach(t=>{t==="_initialize"?Xn._constructorQueue.push(n.prototype._initialize):t!=="constructor"&&(this.prototype[t]=n.prototype[t])}),Object.getOwnPropertyNames(n).forEach(t=>{t!=="prototype"&&t!=="name"&&t!=="length"&&(this[t]=n[t])})}};R(Xn,"_constructorQueue",[]);let qn=Xn;async function ka(e){for(const[n,t]of e.entries())try{if(!await t())return{index:n,result:!1}}catch(r){return{index:n,result:!1,error:r}}return{result:!0,index:-1}}function Fa(e){for(const[n,t]of e.entries())try{if(!t())return{index:n,result:!1}}catch(r){return{index:n,result:!1,error:r}}return{result:!0,index:-1}}function ho(e){var n=typeof Symbol=="function"&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function fo(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),s,i=[],o;try{for(;(n===void 0||n-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return i}function go(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))}function Gn(e){return typeof e=="function"}function Xg(e){var n=function(r){Error.call(r),r.stack=new Error().stack},t=e(n);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var os=Xg(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
5
+ `+t.map(function(r,s){return s+1+") "+r.toString()}).join(`
6
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function mo(e,n){if(e){var t=e.indexOf(n);0<=t&&e.splice(t,1)}}var $a=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,t,r,s,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=ho(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(E){n={error:E}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}else o.remove(this);var h=this.initialTeardown;if(Gn(h))try{h()}catch(E){i=E instanceof os?E.errors:[E]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=ho(u),f=d.next();!f.done;f=d.next()){var p=f.value;try{po(p)}catch(E){i=i!=null?i:[],E instanceof os?i=go(go([],fo(i)),fo(E.errors)):i.push(E)}}}catch(E){r={error:E}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(r)throw r.error}}}if(i)throw new os(i)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)po(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(n)}},e.prototype._hasParent=function(n){var t=this._parentage;return t===n||Array.isArray(t)&&t.includes(n)},e.prototype._addParent=function(n){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n},e.prototype._removeParent=function(n){var t=this._parentage;t===n?this._parentage=null:Array.isArray(t)&&mo(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&mo(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}();$a.EMPTY;function Qg(e){return e instanceof $a||e&&"closed"in e&&Gn(e.remove)&&Gn(e.add)&&Gn(e.unsubscribe)}function po(e){Gn(e)?e():e.unsubscribe()}function Je(e){let n=!1;return e?Qg(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{n||(n=!0,e())}}:e:Je(()=>{})}function Jg(e){return Je(()=>{e.unsubscribe()})}class hi{constructor(){R(this,"_disposables",new Set)}add(n){const t=Je(n);return this._disposables.add(t),{dispose:()=>{t.dispose(),this._disposables.delete(t)}}}dispose(){this._disposables.forEach(n=>{n.dispose()}),this._disposables.clear()}}class rt{constructor(){R(this,"_disposed",!1);R(this,"_collection",new hi)}disposeWithMe(n){return this._collection.add(n)}ensureNotDisposed(){if(this._disposed)throw new Error("[Disposable]: object is disposed!")}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class Zg extends rt{constructor(){super(...arguments);R(this,"dispose$",new Ee.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class qg extends rt{constructor(t){super();R(this,"_ref",0);this._rootDisposable=t}inc(){if(this._disposed)throw new Error("[RCDisposable]: should not ref to a disposed.");this._ref+=1}dec(){this._ref-=1,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}}const ur=wt("univer.context-service");class ja extends rt{constructor(){super(...arguments);R(this,"_contextChanged$",new Ee.Subject);R(this,"contextChanged$",this._contextChanged$.asObservable());R(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(t){var r;return(r=this._contextMap.get(t))!=null?r:!1}setContextValue(t,r){this._contextMap.set(t,r),this._contextChanged$.next({[t]:r})}subscribeContextValue$(t){return new Ee.Observable(r=>{const s=this._contextChanged$.pipe(Ee.filter(i=>typeof i[t]<"u")).subscribe(i=>r.next(i[t]));return this._contextMap.has(t)&&r.next(this._contextMap.get(t)),()=>s.unsubscribe()})}}var Ha=(e=>(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))(Ha||{});const Nt=wt("univer.log");class Ba extends rt{constructor(){super(...arguments);R(this,"_logLevel",3)}debug(...t){this._logLevel>=4&&this._log(console.debug,...t)}log(...t){this._logLevel>=3&&this._log(console.log,...t)}warn(...t){this._logLevel>=2&&this._log(console.warn,...t)}error(...t){this._logLevel>=1&&this._log(console.error,...t)}setLogLevel(t){this._logLevel=t}_log(t,...r){const s=r[0];/^\[(.*?)\]/g.test(s)?t(`\x1B[97;104m${s}\x1B[0m`,...r.slice(1)):t(...r)}}var em=Object.defineProperty,tm=Object.getOwnPropertyDescriptor,nm=(e,n,t,r)=>{for(var s=r>1?void 0:r?tm(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&em(n,t,s),s},_o=(e,n)=>(t,r)=>n(t,r,e),cr=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(cr||{});const Ut=wt("anywhere.command-service");class rm{constructor(){R(this,"_commands",new Map);R(this,"_commandTypes",new Map)}registerCommand(n){if(this._commands.has(n.id))throw new Error(`[CommandRegistry]: command "${n.id}" has been registered before.`);return this._commands.set(n.id,n),this._commandTypes.set(n.id,n.type),Je(()=>{this._commands.delete(n.id),this._commandTypes.delete(n.id)})}hasCommand(n){return this._commands.has(n)}getCommand(n){return this._commands.has(n)?[this._commands.get(n)]:null}getCommandType(n){return this._commandTypes.get(n)}}const Wa={id:"nil",type:0,handler:()=>!0};exports.CommandService=class extends rt{constructor(t,r){super();R(this,"_commandRegistry");R(this,"_beforeCommandExecutionListeners",[]);R(this,"_commandExecutedListeners",[]);R(this,"_multiCommandDisposables",new Map);R(this,"_commandExecutingLevel",0);R(this,"_commandExecutionStack",[]);this._injector=t,this._logService=r,this._commandRegistry=new rm,this._registerCommand(Wa)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0}hasCommand(t){return this._commandRegistry.hasCommand(t)}registerCommand(t){return this._registerCommand(t)}registerMultipleCommand(t){return this._registerMultiCommand(t)}beforeCommandExecuted(t){if(this._beforeCommandExecutionListeners.indexOf(t)===-1)return this._beforeCommandExecutionListeners.push(t),Je(()=>{const r=this._beforeCommandExecutionListeners.indexOf(t);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(t){if(this._commandExecutedListeners.indexOf(t)===-1)return this._commandExecutedListeners.push(t),Je(()=>{const r=this._commandExecutedListeners.indexOf(t);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}async executeCommand(t,r,s){try{const i=this._commandRegistry.getCommand(t);if(i){const[o]=i,a={id:o.id,type:o.type,params:r},l=this._pushCommandExecutionStack(a);this._beforeCommandExecutionListeners.forEach(h=>h(a,s));const c=await this._execute(o,r,s);return this._commandExecutedListeners.forEach(h=>h(a,s)),l.dispose(),c}throw new Error(`[CommandService]: command "${t}" is not registered.`)}catch(i){if(i instanceof As)return!1;throw i}}syncExecuteCommand(t,r,s){var i;try{const o=this._commandRegistry.getCommand(t);if(o){const[a]=o,l={id:a.id,type:a.type,params:r};if(a.type===2){const u=Vf(this._commandExecutionStack,d=>d.type===0);u&&(l.params=(i=l.params)!=null?i:{},l.params.trigger=u.id)}const c=this._pushCommandExecutionStack(l);this._beforeCommandExecutionListeners.forEach(u=>u(l,s));const h=this._syncExecute(a,r,s);return this._commandExecutedListeners.forEach(u=>u(l,s)),c.dispose(),h}throw new Error(`[CommandService]: command "${t}" is not registered.`)}catch(o){if(o instanceof As)return!1;throw o}}_pushCommandExecutionStack(t){return this._commandExecutionStack.push(t),Je(()=>or(this._commandExecutionStack,t))}_registerCommand(t){return this._commandRegistry.registerCommand(t)}_registerMultiCommand(t){const r=this._commandRegistry.getCommand(t.id);let s;if(r){if(r[0].multi!==!0)throw new Error("Command has registered as a single command.");s=r[0]}else{const o=new hi;s=new sm(t.id),o.add(this._commandRegistry.registerCommand(s)),o.add(Je(()=>{this._multiCommandDisposables.delete(t.id)})),this._multiCommandDisposables.set(t.id,o)}const i=s.registerImplementation(t);return Je(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(t.id))==null||o.dispose()})}async _execute(t,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${t.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(t.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(t,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${t.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(t.handler,r,s),i instanceof Promise)throw new TypeError("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}};exports.CommandService=nm([_o(0,Ot(Ft)),_o(1,Nt)],exports.CommandService);class sm{constructor(n){R(this,"name");R(this,"multi",!0);R(this,"type",0);R(this,"priority",0);R(this,"_implementations",[]);R(this,"handler",async(n,t)=>{if(!this._implementations.length)return!1;const r=n.get(Nt),s=n.get(ur),i=n.get(Ft);for(const o of this._implementations){const a=o.command.preconditions;if((!a||a&&a(s))&&(r.debug("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,t)))return!0}return!1});this.id=n,this.name=n}registerImplementation(n){const t={command:n};return this._implementations.push(t),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),Je(()=>{const r=this._implementations.indexOf(t);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function di(e,n,t){const r=e.map(s=>()=>n.syncExecuteCommand(s.id,s.params,t));return Fa(r)}function im(e,n,t){const r=e.map(s=>()=>n.executeCommand(s.id,s.params,t));return ka(r)}function Ya(e){return new Ee.Observable(n=>{const t=e((...r)=>n.next(r));return()=>t==null?void 0:t.dispose()})}function za(e){return function(t){return new Ee.Observable(r=>(t.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function om(e=0){return n=>{let t=[];return n.pipe(Ee.tap(r=>t.push(r)),Ee.debounceTime(e),Ee.map(()=>t),Ee.tap(()=>t=[]))}}function am(e){const n=new Ee.ReplaySubject(1);return setTimeout(()=>n.next(),e),n.pipe(Ee.take(1))}const lm=e=>new Promise(n=>{Ee.merge(Ya(e.onCommandExecuted.bind(e)).pipe(br.filter(([t])=>t.type===cr.MUTATION)),Ee.timer(300)).pipe(br.debounceTime(16),br.first()).subscribe(()=>{n()})});function Va(e,n){let t=0,r=e.length-1;if(n<e[0])return 0;if(n>=e[e.length-1])return e.length-1;for(;t<=r;){if(e[t]===n){for(;t<e.length&&e[t]===n;)t++;return t}if(n>e[t]&&n<e[t+1])return t+1;if(e[r]===n){for(;r<e.length&&e[r]===n;)r++;return r}if(n>e[r-1]&&n<e[r])return r;t++,r--}return-1}function um(e,n){let t=0,r=e.length-1;for(;t<=r;){const s=Math.floor((r+t)/2);if(n<e[s]&&(s===0||n>=e[s-1]))return s;if(n>=e[s])t=s+1;else if(n<e[s])r=s-1;else return-1}return-1}function Ga(e,n){let t=0,r=e.length;for(;t<r;){const s=Math.floor((t+r)/2);e[s]<=n?t=s+1:r=s}return t<e.length?t:e.length-1}function cm(e,n,t=!1){let r=e.length-1;if(n<0||n<e[0])return 0;if(e.length<40||n<=e[20]||n>=e[r-20]?r=Va(e,n):r=Ga(e,n),t){const s=e[r];return e.indexOf(s)}return r}function hm(e){const n=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(n)}const $n=2,Ka=1;function dm(e,n){if(n==null||e==null)return!0;const{left:t=0,top:r=0,height:s=0,width:i=0,angle:o=0}=n,{left:a=0,top:l=0,height:c=0,width:h=0,angle:u=0}=e,d=h,f=c,p=i,E=s;return Math.abs(a-t)>$n||Math.abs(l-r)>$n||Math.abs(d-p)>$n||Math.abs(f-E)>$n||Math.abs(u-o)>Ka}var Xa=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(Xa||{}),Ge=(e=>(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))(Ge||{}),Qa=(e=>(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))(Qa||{}),It=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(It||{}),Ja=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(Ja||{}),Za=(e=>(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))(Za||{}),qa=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(qa||{}),el=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(el||{}),tl=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(tl||{}),nl=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(nl||{});function fm(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var rl=(e=>(e[e.NUMBER_FORMAT_TYPE_UNSPECIFIED=0]="NUMBER_FORMAT_TYPE_UNSPECIFIED",e[e.TEXT=1]="TEXT",e[e.NUMBER=2]="NUMBER",e[e.PERCENT=3]="PERCENT",e[e.CURRENCY=4]="CURRENCY",e[e.DATE=5]="DATE",e[e.TIME=6]="TIME",e[e.DATE_TIME=7]="DATE_TIME",e[e.SCIENTIFIC=8]="SCIENTIFIC",e))(rl||{}),sl=(e=>(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))(sl||{}),hr=(e=>(e.EN_US="enUS",e.ZH_CN="zhCN",e.RU_RU="ruRU",e.ZH_TW="zhTW",e.VI_VN="viVN",e.FA_IR="faIR",e))(hr||{}),il=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(il||{}),ol=(e=>(e.Line="line",e.LineInv="lineInv",e.Triangle="triangle",e.RtTriangle="rtTriangle",e.Rect="rect",e.Diamond="diamond",e.Parallelogram="parallelogram",e.Trapezoid="trapezoid",e.NonIsocelesTrapezoid="nonIsocelesTrapezoid",e.Pentagon="pentagon",e.Hexagon="hexagon",e.Heptagon="heptagon",e.Octagon="octagon",e.Decagon="decagon",e.Dodecagon="dodecagon",e.Star4="star4",e.Star5="star5",e.Star6="star6",e.Star7="star7",e.Star8="star8",e.Star10="star10",e.Star12="star12",e.Star16="star16",e.Star24="star24",e.Star32="star32",e.RoundRect="roundRect",e.Round1Rect="round1Rect",e.Round2SameRect="round2SameRect",e.Round2DiagRect="round2DiagRect",e.Ellipse="ellipse",e))(ol||{}),al=(e=>(e.RightArrow="rightArrow",e.LeftArrow="leftArrow",e.UpArrow="upArrow",e.DownArrow="downArrow",e.LeftRightArrow="leftRightArrow",e.UpDownArrow="upDownArrow",e.QuadArrow="quadArrow",e.LeftRightUpArrow="leftRightUpArrow",e.BentArrow="bentArrow",e.UturnArrow="uturnArrow",e.CircularArrow="circularArrow",e.NotchedRightArrow="notchedRightArrow",e.HomePlate="homePlate",e.Chevron="chevron",e.LeftCircularArrow="leftCircularArrow",e.LeftRightCircularArrow="leftRightCircularArrow",e))(al||{}),ll=(e=>(e.Plaque="plaque",e.Can="can",e.Cube="cube",e.Bevel="bevel",e.Donut="donut",e.NoSmoking="noSmoking",e.BlockArc="blockArc",e.FoldedCorner="foldedCorner",e))(ll||{}),ul=(e=>(e.SmileyFace="smileyFace",e.Heart="heart",e.LightningBolt="lightningBolt",e.Sun="sun",e.Moon="moon",e.Cloud="cloud",e.Arc="arc",e.Backpack="backpack",e.Frame="frame",e.HalfFrame="halfFrame",e.Corner="corner",e.Chord="chord",e.Pie="pie",e.Teardrop="teardrop",e.WedgeRectCallout="wedgeRectCallout",e.WedgeRRectCallout="wedgeRRectCallout",e.WedgeEllipseCallout="wedgeEllipseCallout",e.CloudCallout="cloudCallout",e.BorderCallout1="borderCallout1",e.BorderCallout2="borderCallout2",e.BorderCallout3="borderCallout3",e.AccentCallout1="accentCallout1",e.AccentCallout2="accentCallout2",e.AccentCallout3="accentCallout3",e.Callout1="callout1",e.Callout2="callout2",e.Callout3="callout3",e.ActionButtonBackPrevious="actionButtonBackPrevious",e.ActionButtonEnd="actionButtonEnd",e.ActionButtonForwardNext="actionButtonForwardNext",e.ActionButtonHelp="actionButtonHelp",e.ActionButtonHome="actionButtonHome",e.ActionButtonInformation="actionButtonInformation",e.ActionButtonMovie="actionButtonMovie",e.ActionButtonReturn="actionButtonReturn",e.ActionButtonSound="actionButtonSound",e))(ul||{}),cl=(e=>(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))(cl||{}),hl=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(hl||{}),er=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",e[e.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",e))(er||{}),dl=(e=>(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))(dl||{}),Xt=(e=>(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))(Xt||{}),an=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(an||{}),cn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(cn||{}),Ur=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(Ur||{}),Pr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(Pr||{}),Bt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(Bt||{}),Ae=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(Ae||{}),Jt=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(Jt||{}),gt=(e=>(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))(gt||{}),Jr=(e=>(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))(Jr||{});const gm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let mm=e=>crypto.getRandomValues(new Uint8Array(e)),pm=(e,n,t)=>{let r=(2<<Math.log2(e.length-1))-1,s=-~(1.6*r*n/e.length);return(i=n)=>{let o="";for(;;){let a=t(s),l=s;for(;l--;)if(o+=e[a[l]&r]||"",o.length===i)return o}}},_m=(e,n=21)=>pm(e,n,mm),Em=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e));for(;e--;)n+=gm[t[e]&63];return n};const Cm=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"]),Rm=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[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 vm(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(Rm.test(e)){if(fl(e))return!0;try{const r=new URL(gl(e)).hostname.split(".").pop();if(r&&Cm.has(r))return!0}catch{return!1}}return!1}function fl(e){return/^[a-zA-Z]+:\/\//.test(e)}function Im(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function gl(e){return fl(e)?e:Im(e)?`mailto://${e}`:`https://${e}`}const Sm=/^-ms-/,Om=/-([a-z])/g,Gt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];function fi(e,n){const t=G.getValueType(e),r=G.getValueType(n);return t!==r?!1:G.isArray(e)?ym(e,n):G.isObject(e)?wm(e,n):G.isDate(e)?e.getTime()===n.getTime():G.isRegExp(e)?e.toString()===n.toString():e===n}function ym(e,n){if(e.length!==n.length)return!1;for(let t=0,r=e.length;t<r;t++){const s=e[t],i=n[t];if(!fi(s,i))return!1}return!0}function wm(e,n){const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;for(const s of t){if(!r.includes(s))return!1;const i=e[s],o=n[s];if(!fi(i,o))return!1}return!0}class G{static stringAt(n){let t="",r=n;for(;r>=Gt.length;)r/=Gt.length,r-=1,t+=Gt[r%Gt.length];const s=n%Gt.length;return t+=Gt[s],t}static indexAt(n){let t=0;for(let r=0;r<n.length-1;r+=1){const s=n.charCodeAt(r)-65,i=n.length-1-r;t+=Gt.length**i+Gt.length*s}return t+=n.charCodeAt(n.length-1)-65,t}static deleteBlank(n){return G.isString(n)?n.replace(/\s/g,""):n}static getSystemType(){const n=navigator.userAgent,t=navigator.platform==="Win32"||navigator.platform==="Windows",r=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(r)return"Mac";if(navigator.platform==="X11"&&!t&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(t){if(n.indexOf("Windows NT 5.0")>-1||n.indexOf("Windows 2000")>-1)return"Windows 2000";if(n.indexOf("Windows NT 5.1")>-1||n.indexOf("Windows XP")>-1)return"Windows XP";if(n.indexOf("Windows NT 5.2")>-1||n.indexOf("Windows 2003")>-1)return"Windows 2003";if(n.indexOf("Windows NT 6.0")>-1||n.indexOf("Windows Vista")>-1)return"Windows Vista";if(n.indexOf("Windows NT 6.1")>-1||n.indexOf("Windows 7")>-1)return"Windows 7";if(n.indexOf("Windows NT 10")>-1||n.indexOf("Windows 10")>-1)return"Windows 10";if(n.indexOf("Windows NT 11")>-1||n.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const n=navigator.userAgent,t=n.indexOf("Opera")>-1,r=n.indexOf("compatible")>-1&&n.indexOf("MSIE")>-1&&!t,s=n.indexOf("Trident")>-1&&n.indexOf("rv:11.0")>-1,i=n.indexOf("Edge")>-1,o=n.indexOf("Firefox")>-1,a=n.indexOf("Safari")>-1&&n.indexOf("Chrome")===-1,l=n.indexOf("Chrome")>-1&&n.indexOf("Safari")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(n);const h=Number.parseFloat(RegExp.$1);return h===7?"IE7":h===8?"IE8":h===9?"IE9":h===10?"IE10":"0"}return o?"FF":t?"Opera":a?"Safari":l?"Chrome":i?"Edge":s?"IE11":"Unknown browser"}static generateRandomId(n=21,t){return hn(n,t)}static getClassName(n){return n.constructor.name}static deepMerge(n,...t){t.forEach(o=>o&&i(o));function r(o,a){o.forEach((l,c)=>{var h,u;if(G.isArray(l)){const d=(h=a[c])!=null?h:[];a[c]=d,r(l,d);return}if(G.isObject(l)){const d=(u=a[c])!=null?u:{};a[c]=d,s(l,d);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var h,u;const c=o[l];if(G.isObject(c)){const d=(h=a[l])!=null?h:{};a[l]=d,s(c,d);return}if(G.isArray(c)){const d=(u=a[l])!=null?u:[];a[l]=d,r(c,d);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,h;const l=o[a];if(G.isArray(l)){const u=(c=n[a])!=null?c:[];n[a]=u,r(l,u);return}if(G.isObject(l)){const u=(h=n[a])!=null?h:{};n[a]=u,s(l,u);return}n[a]=l})}return n}static numberFixed(n,t){return Number(Number(n).toFixed(t))}static diffValue(n,t){return fi(n,t)}static deepClone(n){if(!this.isDefine(n))return n;if(this.isRegExp(n))return new RegExp(n);if(this.isDate(n))return new Date(n);if(this.isArray(n)){const t=[];return n.forEach((r,s)=>{t[s]=G.deepClone(r)}),t}if(this.isObject(n)){const t={};return Object.keys(n).forEach(r=>{const s=n[r];t[r]=G.deepClone(s)}),Object.setPrototypeOf(t,Object.getPrototypeOf(n)),t}return n}static getLanguage(){const n="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||n}static getValueType(n){return Object.prototype.toString.apply(n)}static isDefine(n){return n!=null}static isBlank(n){return this.isDefine(n)?this.isString(n)?n.trim()==="":!1:!0}static isBoolean(n){return this.getValueType(n)==="[object Boolean]"}static isPlainObject(n){return this.isDefine(n)?Object.getPrototypeOf(n)===Object.getPrototypeOf({}):!1}static isFunction(n){return this.getValueType(n)==="[object Function]"}static isDate(n){return this.getValueType(n)==="[object Date]"}static isRegExp(n){return this.getValueType(n)==="[object RegExp]"}static isArray(n){return this.getValueType(n)==="[object Array]"}static isString(n){return this.getValueType(n)==="[object String]"}static isNumber(n){return this.getValueType(n)==="[object Number]"}static isStringNumber(n){return!isNaN(Number.parseFloat(n))&&isFinite(n)}static isObject(n){return this.getValueType(n)==="[object Object]"}static isEmptyObject(n){for(const t in n)return!1;return!0}static isMobile(){let n=0,t=0;return document.body.clientWidth&&(n=document.body.clientWidth),document.body.clientHeight&&(t=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||n<350&&t<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const n=navigator.userAgent.toLowerCase();return String(n.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const n=navigator.userAgent;return n.indexOf("Android")>-1||n.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(n){return vm(n)}static normalizeUrl(n){return gl(n)}static itCount(n){return t=>{for(let r=0;r<n;r++)t&&t()}}static hasLength(n,t){return G.isDefine(n)?G.isDefine(t)?n.length===t:n.length>0:!1}static capitalize(n){return n.charAt(0).toUpperCase()+n.slice(1)}static fCamelCase(n,t){return t.toUpperCase()}static camelCase(n){return n.replace(Sm,"ms-").replace(Om,this.fCamelCase)}static removeNull(n){return this.isObject(n)&&Object.keys(n).forEach(t=>{const r=n[t];r==null?delete n[t]:G.removeNull(r)}),n}static fillTwoDimensionalArray(n,t,r){return new Array(n).fill(r).map(s=>new Array(t).fill(r))}static numToWord(n){let t="";for(;n>0;){let r=n%26;r=r===0?r=26:r,t=String.fromCharCode(96+r)+t,n=(n-r)/26}return t.toLocaleUpperCase()}static ABCatNum(n){if(n==null||n.length===0)return Number.NaN;const t=n.toLowerCase().split(""),r=t.length;let s=0,i=0;for(let o=0;o<r;o++)i=t[o].charCodeAt(0)-96,s+=i*26**(r-o-1);return s===0?Number.NaN:s-1}static chatAtABC(n){let i="";for(;n>=0;)i=String.fromCharCode(n%26+97)+i,n=Math.floor(n/26)-1;return i.toUpperCase()}static randSort(n){for(let t=0,r=n.length;t<r;t++){const s=Number.parseInt((Math.random()*r).toString()),i=n[s];n[s]=n[t],n[t]=i}return n}static commonExtend(n,t){const r={};for(const s in n)r[s]=n[s];for(const s in t)t[s]!=null&&(r[s]=t[s]);return r}static commonExtend1(n,t){for(const r in n)t[r]==null&&(t[r]=n[r]);return t}static arrayToObject(n){const t={};return n.forEach((r,s)=>{t[s]={},r.forEach((i,o)=>{t[s][o]=i})}),t}static hasIntersectionBetweenTwoRanges(n,t,r,s){return t>=r&&s>=n}static isStartValidPosition(n){return/^[A-Za-z_]/.test(n)}static isValidParameter(n){const t=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(n),r=n.length<=255;return!t&&r}static clamp(n,t,r){return Math.max(t,Math.min(r,n))}static now(){return performance&&performance.now?performance.now():Date.now()}}function hn(e=21,n){return n?_m(n,e)():Em(e)}function Ts(...e){const n={},t=e.length;for(let r=t-1;r>=0;r--){const s=e[r];if(s){const i=Object.keys(s);for(const o of i)n[o]===void 0&&(n[o]=s[o])}}return n}const bm=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Nr(e,n,t){const{dataStream:r,textRuns:s=[]}=e;let i=n;const o=[];for(const a of s){const{st:l,ed:c}=a;G.hasIntersectionBetweenTwoRanges(n,t,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(Ns(r,{...a,ed:Math.min(c,t)}))):o.push(Ns(r,{...a,st:i,ed:Math.min(c,t)}))),i=Math.max(n,Math.min(c,t))}return i!==t&&o.push(r.slice(i,t)),o.join("")}function Am(e,n=!0){var t;if(n&&((t=e.paragraphs)!=null&&t.length)){const{dataStream:r,paragraphs:s=[]}=e;let i="",o=-1;for(const a of s){const{startIndex:l,paragraphStyle:c={}}=a,{spaceAbove:h,spaceBelow:u,lineSpacing:d}=c,f=[];h!=null&&(typeof h=="number"?f.push(`margin-top: ${h}px`):f.push(`margin-top: ${h.v}px`)),u!=null&&(typeof u=="number"?f.push(`margin-bottom: ${u}px`):f.push(`margin-bottom: ${u.v}px`)),d!=null&&f.push(`line-height: ${d}`),l>o+1?i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}>${Nr(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Nr(e,o,r.length)),i}else return Nr(e,0,e.dataStream.length)}function Ns(e,n){const{st:t,ed:r,ts:s={}}=n,{ff:i,fs:o,it:a,bl:l,ul:c,st:h,ol:u,bg:d,cl:f,va:p}=s;let E=e.slice(t,r);const v=[];return a===Ae.TRUE&&(E=`<i>${E}</i>`),p===Bt.SUPERSCRIPT?E=`<sup>${E}</sup>`:p===Bt.SUBSCRIPT&&(E=`<sub>${E}</sub>`),(c==null?void 0:c.s)===Ae.TRUE&&(E=`<u>${E}</u>`),(h==null?void 0:h.s)===Ae.TRUE&&(E=`<s>${E}</s>`),l===Ae.TRUE&&(E=`<strong>${E}</strong>`),i&&v.push(`font-family: ${i}`),f&&v.push(`color: ${f.rgb}`),o&&v.push(`font-size: ${o}pt`),u&&v.push("text-decoration: overline"),d&&v.push(`background: ${d.rgb}`),v.length?`<span style="${v.join("; ")};">${E}</span>`:E}const ml={[Jr.OFFICE]:{[gt.ACCENT1]:"#4472C4",[gt.ACCENT2]:"#ED7D31",[gt.ACCENT3]:"#A5A5A5",[gt.ACCENT4]:"#70AD47",[gt.ACCENT5]:"#5B9BD5",[gt.ACCENT6]:"#70AD47",[gt.DARK1]:"#000000",[gt.DARK2]:"#44546A",[gt.LIGHT1]:"#FFFFFF",[gt.LIGHT2]:"#E7E6E6",[gt.HYPERLINK]:"#0563C1",[gt.FOLLOWED_HYPERLINK]:"#954F72"}};class Zr{constructor(){R(this,"_themeValue",gt.LIGHT1);R(this,"_themeColors");R(this,"_themeTint");R(this,"_rgbValue","");R(this,"_colorType");this._colorType=It.UNSUPPORTED,this._themeColors=Jr.OFFICE,this._themeTint=0}asRgbColor(){return new kr(this._rgbValue,this)}asThemeColor(){return new Fr(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case It.THEME:return this.asThemeColor();case It.RGB:return this.asRgbColor();case It.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(n){return this._colorType=It.RGB,this._rgbValue=n,this}setThemeColors(n){this._colorType=It.THEME,this._themeColors=n}setThemeTint(n){this._colorType=It.THEME,this._themeTint=n}setThemeColor(n){return this._colorType=It.THEME,this._themeValue=n,this}getColorType(){return this._colorType}}class dn{constructor(n){R(this,"_builder");this._builder=n}static rgbColorToHexValue(n){return`#${((1<<24)+(n.getRed()<<16)+(n.getGreen()<<8)+n.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(n){n?n.indexOf("#")>-1&&(n=n.substring(1)):n="#000000";const t=+`0x${n[0]}${n[1]}`,r=+`0x${n[2]}${n[3]}`,s=+`0x${n[4]}${n[5]}`;return new Zr().setRgbColor(`rgb(${t},${r},${s})`).asRgbColor()}static hexToRgbString(n){const t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;n=n.replace(t,(i,o,a,l)=>o+o+a+a+l+l);const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);let s=null;if(r){const i=Number.parseInt(r[1],16),o=Number.parseInt(r[2],16),a=Number.parseInt(r[3],16);s=`rgba(${i},${o},${a})`}return s}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new dn(this._builder)}equals(n){return!1}}class pl{constructor(n){R(this,"_saturation",0);R(this,"_hue",0);R(this,"_lightness",0);R(this,"_alpha",0);const t=n.getRed()/255,r=n.getGreen()/255,s=n.getBlue()/255,i=n.getAlpha()/255,o=Math.min(t,Math.min(r,s)),a=Math.max(t,Math.max(r,s)),l=a-o;if(a===o){this._hue=0,this._saturation=0,this._lightness=a;return}this._lightness=(o+a)/2,this._lightness<.5?this._saturation=l/(a+o):this._saturation=l/(2-a-o),t===a&&(this._hue=(r-s)/l),r===a&&(this._hue=2+(s-t)/l),s===a&&(this._hue=4+(t-r)/l),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const n=new Zr;if(this._saturation===0)return n.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),n.asRgbColor();let t;this._lightness<.5?t=this._lightness*(1+this._saturation):t=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-t,s=this._hue/360,i=s+1/3,o=this.setColor(t,r,i),a=this.setColor(t,r,s),l=s-1/3,c=this.setColor(t,r,l);return n.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(c*255)},${this._alpha*255})`),n.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(n,t,r){r<0&&(r+=1),r>1&&(r-=1);let s;return 6*r<1?s=t+(n-t)*6*r:2*r<1?s=n:3*r<2?s=t+(n-t)*(2/3-r)*6:s=t,s}setLightness(n){this._lightness=n}}const vt=class vt extends dn{constructor(t,r){super(r);R(this,"_cssString");R(this,"_red");R(this,"_green");R(this,"_blue");R(this,"_alpha");let s=t.match(vt.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=t,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=t.match(vt.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=t,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return dn.rgbColorToHexValue(this)}getRed(){let t=this._red+vt.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getGreen(){let t=this._green+vt.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getBlue(){let t=this._blue+vt.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getAlpha(){return this._alpha}getColorType(){return It.RGB}clone(){return new vt(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(t){return t instanceof vt?t._red===this._red&&t._blue===this._blue&&t._green===this._green&&t._alpha===this._alpha:!1}getCssString(){return this._cssString}};R(vt,"RGB_COLOR_AMT",0),R(vt,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),R(vt,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let kr=vt;const Kt=class Kt extends dn{constructor(t,r,s,i){super(i);R(this,"_themeColorType");R(this,"_themeTint");R(this,"_themeColors");this._themeColorType=t,this._themeTint=r,this._themeColors=s}lumValue(t,r){if(t==null)return r;let s;return t<0?s=r*(1+t):s=r*(1-t)+(255-255*(1-t)),s}asRgbColor(){const t=ml[this._themeColors];if(t==null)throw new Error("not find themeColors type");const r=t[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(Kt._cacheThemeColor.has(this._themeColors)){if(s=Kt._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,Kt._cacheThemeColor.set(this._themeColors,s);const i=new pl(dn.hexValueToRgbColor(r));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return s.set(this._themeColorType,o),o}clone(){return new Kt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(t){return t instanceof Kt?t._themeColorType===this._themeColorType:!1}getColorType(){return It.THEME}getThemeColorType(){return this._themeColorType}};R(Kt,"_cacheThemeColor",new Map);let Fr=Kt;const Tm="rgb(",Nm="rgba(",Ms={aliceBlue:[240,248,255],antiqueWhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blancheAlmond:[255,235,205],blue:[0,0,255],blueViolet:[138,43,226],brown:[165,42,42],burlyWood:[222,184,135],cadetBlue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornFlowerBlue:[100,149,237],cornSilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkCyan:[0,139,139],darkGoldenrod:[184,132,11],darkGray:[169,169,169],darkGreen:[0,100,0],darkGrey:[169,169,169],darkKhaki:[189,183,107],darkMagenta:[139,0,139],darkOliveGreen:[85,107,47],darkOrange:[255,140,0],darkOrchid:[153,50,204],darkRed:[139,0,0],darkSalmon:[233,150,122],darkSeaGreen:[143,188,143],darkSlateBlue:[72,61,139],darkSlateGray:[47,79,79],darkSlateGrey:[47,79,79],darkTurquoise:[0,206,209],darkViolet:[148,0,211],deepPink:[255,20,147],deepSkyBlue:[0,191,255],dimGray:[105,105,105],dimGrey:[105,105,105],dodgerBlue:[30,144,255],firebrick:[178,34,34],floralWhite:[255,255,240],forestGreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostWhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenYellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotPink:[255,105,180],indianRed:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderBlush:[255,240,245],lawnGreen:[124,252,0],lemonChiffon:[255,250,205],lightblue:[173,216,230],lightCoral:[240,128,128],lightCyan:[224,255,255],lightGoldenrodYellow:[250,250,210],lightGray:[211,211,211],lightGreen:[144,238,144],lightGrey:[211,211,211],lightPink:[255,182,193],lightSalmon:[255,160,122],lightSeaGreen:[32,178,170],lightSkyBlue:[135,206,250],lightSlateGray:[119,136,153],lightSlateGrey:[119,136,153],lightSteelBlue:[176,196,222],lightYellow:[255,255,224],lime:[0,255,0],limeGreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumAquamarine:[102,205,170],mediumBlue:[0,0,205],mediumOrchid:[186,85,211],mediumPurple:[147,112,219],mediumSeaGreen:[60,179,113],mediumSlateBlue:[123,104,238],mediumSpringGreen:[0,250,154],mediumTurquoise:[72,209,204],mediumVioletRed:[199,21,133],midBightBlue:[25,25,112],mintCream:[245,255,250],mistyRose:[255,228,225],moccasin:[255,228,181],navajoWhite:[255,222,173],navy:[0,0,128],oldLace:[253,245,230],olive:[128,128,0],oliveDrab:[107,142,35],orange:[255,165,0],orangeRed:[255,69,0],orchid:[218,112,214],paleGoldenrod:[238,232,170],paleGreen:[152,251,152],paleTurquoise:[175,238,238],paleVioletRed:[219,112,147],papayaWhip:[255,239,213],peachPuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderBlue:[176,224,230],purple:[128,0,128],rebeccaPurple:[102,51,153],red:[255,0,0],rosyBrown:[188,143,143],royalBlue:[65,105,225],saddleBrown:[139,69,19],salmon:[250,128,114],sandyBrown:[244,164,96],seaGreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyBlue:[135,206,235],slateBlue:[106,90,205],slateGray:[119,128,144],slateGrey:[119,128,144],snow:[255,255,250],springGreen:[0,255,127],steelBlue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whiteSmoke:[245,245,245],yellow:[255,255,0],yellowGreen:[154,205,5]};class At{constructor(n){R(this,"_color");R(this,"_rgbColor");R(this,"_isValid",!1);if(n==null){this._setNullColor();return}if(n instanceof At){this._color={...n._color},this._rgbColor={...n._rgbColor};return}const t=_l(n);if(t==null){this._setNullColor();return}this._color=t;const r=Um(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(n,t,r){var c,h;r=Math.min(1,Math.max(0,r));const s=new At(n).toRgb(),i=new At(t).toRgb(),o=(c=s.a)!=null?c:1,a=(h=i.a)!=null?h:1,l={r:(i.r-s.r)*r+s.r,g:(i.g-s.g)*r+s.g,b:(i.b-s.b)*r+s.b,a:(a-o)*r+o};return new At(l)}static getContrastRatio(n,t){const r=new At(n).getLuminance(),s=new At(t).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:n,g:t,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${n},${t},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(n){const{r:t,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[Er(Math.round(t).toString(16)),Er(Math.round(r).toString(16)),Er(Math.round(s).toString(16)),Er(Math.round(i*255).toString(16))];return n&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return $m(this.toRgb())}toHsl(){return Fm(this.toRgb())}lighten(n=10){const t=this.toHsl();return t.l+=n,t.l=Math.min(Math.max(t.l,0),100),new At(t)}darken(n=10){const t=this.toHsl();return t.l-=n,t.l=Math.min(Math.max(t.l,0),100),new At(t)}setAlpha(n){return new At({...this._rgbColor,a:n})}getLuminance(){let{r:n,g:t,b:r}=this.toRgb();return n=as(n),t=as(t),r=as(r),Number((.2126*n+.7152*t+.0722*r).toFixed(3))}getBrightness(){const{r:n,g:t,b:r}=this.toRgb();return(n*299+t*587+r*114)/1e3}getAlpha(){var n;return(n=this._color.a)!=null?n:1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const Er=e=>e.length===1?`0${e}`:e,as=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),_l=e=>{if(Hm(e)){if("r"in e){const r={r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)};return e.a!==void 0&&(r.a=e.a),r}if("l"in e){const r={h:Math.round(e.h),s:e.s,l:e.l};return e.a!==void 0&&(r.a=e.a),r}const t={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(t.a=e.a),t}const n=e.trim();if(Ms[n]){const t=Ms[n],r={r:Math.round(t[0]),g:Math.round(t[1]),b:Math.round(t[2])};return r.a=t[3]||1,r}if(n.startsWith("#"))return Mm(n);if(n.startsWith("rgb"))return Dm(n);if(n.startsWith("hsl"))return Lm(n);if(n.startsWith("hsv"))return xm(n)},Mm=e=>{const n=e.substring(1),t=new RegExp(`.{1,${n.length>=6?2:1}}`,"g");let r=n.match(t);if(!r||r.length<3)throw new Error(`The color '${e}' is illegal hex color`);r[0].length===1&&(r=r.map(i=>i+i));const s={r:Number.parseInt(r[0],16),g:Number.parseInt(r[1],16),b:Number.parseInt(r[2],16)};return r.length>3&&(s.a=Number.parseInt(r[3],16)/255),s},Dm=e=>{const n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal rgb color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal rgb color`);const r={r:Number.parseInt(t[0],10),g:Number.parseInt(t[1],10),b:Number.parseInt(t[2],10)};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},Lm=e=>{const n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal hsl color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal hsl color`);const r={h:Number.parseInt(t[0],10),s:Number.parseFloat(t[1]),l:Number.parseFloat(t[2])};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},xm=e=>{const n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal hsv color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal hsv color`);const r={h:Number.parseInt(t[0],10),s:Number.parseFloat(t[1]),v:Number.parseFloat(t[2])};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},Um=e=>{const n=_l(e);if(n!=null)return"r"in n?n:"l"in n?Pm(n):km(n)},ls=(e,n,t)=>(t<0&&(t+=1),t>1&&(t-=1),t<1/6?e+(n-e)*6*t:t<1/2?n:t<2/3?e+(n-e)*(2/3-t)*6:e),Pm=e=>{let{h:n,s:t,l:r}=e;n/=360,t/=100,r/=100;let s=0,i=0,o=0;if(t===0)s=i=o=r;else{const l=r<.5?r*(1+t):r+t-r*t,c=2*r-l;s=ls(c,l,n+1/3),i=ls(c,l,n),o=ls(c,l,n-1/3)}const a={r:Math.round(s*255),g:Math.round(i*255),b:Math.round(o*255)};return e.a!==void 0&&(a.a=e.a),a},km=e=>{let{h:n,s:t,v:r}=e;n=n/360*6,t/=100,r/=100;const s=Math.floor(n),i=n-s,o=r*(1-t),a=r*(1-i*t),l=r*(1-(1-i)*t),c=s%6,h=[r,a,o,o,l,r][c],u=[l,r,r,a,o,o][c],d=[o,o,l,r,r,a][c],f={r:h*255,g:u*255,b:d*255};return e.a!==void 0&&(f.a=e.a),f},Fm=e=>{let{r:n,g:t,b:r}=e;n/=255,t/=255,r/=255;const s=Math.max(n,t,r),i=Math.min(n,t,r),o=(s+i)/2;let a,l;if(s===i)a=l=0;else{const h=s-i;switch(l=o>.5?h/(2-s-i):h/(s+i),s){case n:a=(t-r)/h+(t<r?6:0);break;case t:a=(r-n)/h+2;break;default:a=(n-t)/h+4;break}a/=6}const c={h:Math.round(a*360),s:Math.round(l*100),l:Math.round(o*100)};return e.a!==void 0&&(c.a=e.a),c},$m=e=>{let{r:n,g:t,b:r}=e;n/=255,t/=255,r/=255;const s=Math.max(n,t,r),i=Math.min(n,t,r);let o;const a=s,l=s-i,c=s===0?0:l/s;if(s===i)o=0;else{switch(s){case n:o=(t-r)/l+(t<r?6:0);break;case t:o=(r-n)/l+2;break;default:o=(n-t)/l+4;break}o/=6}const h={h:Math.round(o*360),s:Math.round(c*100),v:Math.round(a*100)};return e.a!==void 0&&(h.a=e.a),h},jm=e=>e==null,Hm=e=>!jm(e)&&typeof e=="object";function Bm(e){const n=/^#(?:[0]{3}|[0]{6})\b/,t=/^rgb\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*\)$/,r=/^rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(n.test(e)||t.test(e)||r.test(e)||s.test(e)||i.test(e))}function Wm(e){const n=/^#(?:[Ff]{3}|[Ff]{6})\b/,t=/^rgb\s*\(\s*255\s*,\s*255\s*,\s*255\s*\)$/,r=/^rgba\s*\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(n.test(e)||t.test(e)||r.test(e)||s.test(e)||i.test(e))}var Le=(e=>(e[e.COVER=0]="COVER",e[e.REPLACE=1]="REPLACE",e))(Le||{});function Ym(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 zm(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return Jt.STRING;if(typeof e.v=="number")return Jt.NUMBER;if(typeof e.v=="boolean")return Jt.BOOLEAN}function Vm(e){if(e==null)return!0;const{v:n,f:t,si:r,p:s,s:i,custom:o}=e;return!(!(n==null||typeof n=="string"&&n.length===0)||t!=null&&t.length>0||r!=null&&r.length>0||s!=null||o!=null)}function Gm(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var we=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(we||{}),tt=(e=>(e[e.NONE=0]="NONE",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(tt||{});function Km(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var El=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(El||{}),Cl=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(Cl||{});function Xm(e,n,t){let r=!1,s=!1,i=e,o=n,a=e,l=n;if(t==null)return{actualRow:e,actualColumn:n,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l};for(let c=0;c<t.length;c++){const{startRow:h,endRow:u,startColumn:d,endColumn:f}=t[c];if(e===h&&n===d){i=u,o=f,a=h,l=d,s=!0;break}if(e>=h&&e<=u&&n>=d&&n<=f){i=u,o=f,a=h,l=d,r=!0;break}}return{actualRow:e,actualColumn:n,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}function Rl(e){const{actualRow:n,actualColumn:t,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:c}=e,h=n,u=t,d=n,f=t;if(r&&i){const{startRow:p,startColumn:E,endRow:v,endColumn:I,startY:M,endY:L,startX:j,endX:y}=i;h=p,u=E,d=v,f=I,o=M,a=L,l=j,c=y}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,d=i.endRow,f=i.endColumn),{startRow:h,startColumn:u,endRow:d,endColumn:f,startY:o,endY:a,startX:l,endX:c}}const Qm=Rl;function Jm(e){if(!e)return;const{actualRow:n,actualColumn:t,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let c=n,h=t,u=n,d=t;return(r||s)&&(c=i,h=o,u=a,d=l),{startRow:c,startColumn:h,endRow:u,endColumn:d}}function vl(e){var t;return!e||(((t=e==null?void 0:e.v)==null?void 0:t.toString())||"").length===0&&!e.p}function Zm(e){return vl(e)&&(e==null?void 0:e.coverable)!==!1}function Dt(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new Zr().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function qm(e){return G.isString(e)&&e.substring(0,1)==="="&&e.length>1}function ep(e){return G.isString(e)&&e.length>0}function tp(e,n=!1){var i;let t="";const r=new Map([["ff",()=>{e.ff&&(t+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),t+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(t+="font-style: italic; ")}],["bl",()=>{e.bl&&(t+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):t+="text-decoration: underline; ",e.ul.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${Dt(e.ul.cl)}; `),e.ul.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):t+="text-decoration-line: line-through; ",e.st.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${Dt(e.st.cl)}; `),e.st.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):t+="text-decoration-line: overline; ",e.ol.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${Dt(e.ol.cl)}; `),e.ol.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(t+=`background: ${Dt(e.bg)}; `)}],["bd",()=>{var o,a,l,c,h,u,d,f,p,E,v,I;(o=e.bd)!=null&&o.b&&(t+=`border-bottom: ${Cr((a=e.bd)==null?void 0:a.b.s)} ${(l=Dt(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(t+=`border-top: ${Cr((h=e.bd)==null?void 0:h.t.s)} ${(u=Dt(e.bd.t.cl))!=null?u:""}; `),(d=e.bd)!=null&&d.r&&(t+=`border-right: ${Cr((f=e.bd)==null?void 0:f.r.s)} ${(p=Dt(e.bd.r.cl))!=null?p:""}; `),(E=e.bd)!=null&&E.l&&(t+=`border-left: ${Cr((v=e.bd)==null?void 0:v.l.s)} ${(I=Dt(e.bd.l.cl))!=null?I:""}; `)}],["cl",()=>{e.cl&&(t+=`color: ${Dt(e.cl)}; `)}],["va",()=>{e.va===Bt.SUBSCRIPT?t+="vertical-align: sub; ":e.va===Bt.SUPERSCRIPT&&(t+="vertical-align: super; ")}],["td",()=>{e.td===er.LEFT_TO_RIGHT?t+="direction: ltr; ":e.td===er.RIGHT_TO_LEFT&&(t+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(t+=`--data-rotate: (${(o=e.tr)==null?void 0:o.a}deg${(a=e.tr)!=null&&a.v?` ,${(l=e.tr)==null?void 0:l.v}`:""});`)}],["ht",()=>{e.ht===Xt.LEFT?t+="text-align: left; ":e.ht===Xt.RIGHT?t+="text-align: right; ":e.ht===Xt.CENTER?t+="text-align: center; ":e.ht===Xt.JUSTIFIED&&(t+="text-align: justify; ")}],["vt",()=>{e.vt===an.BOTTOM?t+="vertical-align: bottom; ":e.vt===an.TOP?t+="vertical-align: top; ":e.vt===an.MIDDLE&&(t+="vertical-align: middle; ")}],["tb",()=>{e.tb===cn.CLIP?t+="white-space: nowrap; overflow-x: hidden; ":e.tb===cn.WRAP&&(t+="white-space: normal;")}],["pd",()=>{var h,u,d,f,p,E,v,I;const o=`${(h=e.pd)==null?void 0:h.b}pt`,a=`${(u=e.pd)==null?void 0:u.t}pt`,l=`${(d=e.pd)==null?void 0:d.l}pt`,c=`${(f=e.pd)==null?void 0:f.r}pt`;(p=e.pd)!=null&&p.b&&(t+=`padding-bottom: ${o}; `),(E=e.pd)!=null&&E.t&&(t+=`padding-top: ${a}; `),(v=e.pd)!=null&&v.l&&(t+=`padding-left: ${l}; `),(I=e.pd)!=null&&I.r&&(t+=`padding-right: ${c}; `)}]]),s=["bd","tr","tb"];for(const o in e)n&&s.includes(o)||(i=r.get(o))==null||i();return t}function Cr(e){let n="";return e===Ge.NONE?n="none":e===Ge.THIN?n="0.5pt solid":e===Ge.HAIR?n="0.5pt double":e===Ge.DOTTED?n="0.5pt dotted":e===Ge.DASHED||e===Ge.DASH_DOT?n="0.5pt dashed":e===Ge.DASH_DOT_DOT?n="0.5pt dotted":e===Ge.DOUBLE?n="0.5pt double":e===Ge.MEDIUM?n="1pt solid":e===Ge.MEDIUM_DASHED||e===Ge.MEDIUM_DASH_DOT?n="1pt dashed":e===Ge.MEDIUM_DASH_DOT_DOT?n="1pt dotted":e===Ge.SLANT_DASH_DOT?n="0.5pt dashed":e===Ge.THICK&&(n="1.5pt solid"),n}function np(e){let n=0;if(e=e.trim(),e==="none")n=Ge.NONE;else if(e==="0.5pt solid")n=Ge.THIN;else if(e==="0.5pt double")n=Ge.HAIR;else if(e==="0.5pt dotted")n=Ge.DOTTED;else if(e==="0.5pt dashed")n=Ge.DASHED;else if(e==="1pt solid")n=Ge.MEDIUM;else if(e==="1pt dashed")n=Ge.MEDIUM_DASHED;else if(e==="1pt dotted")n=Ge.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")n=Ge.THICK;else if(!e.includes("none"))n=Ge.THIN;else return Ge.NONE;return n}function rp(e,n){let t=e.body;if(n){const{headers:r,footers:s}=e;r!=null&&r[n]?t=r[n].body:s!=null&&s[n]&&(t=s[n].body)}return t}function sp(e,n){const{startRow:t,endRow:r,startColumn:s,endColumn:i,rangeType:o}=e;if(t<0||s<0||r<0||i<0||!(Number.isNaN(t)&&Number.isNaN(r))&&o===we.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===we.ROW||o!==we.ROW&&o!==we.COLUMN&&(Number.isNaN(s)||Number.isNaN(t)||Number.isNaN(i)||Number.isNaN(r)))return!1;if(n){const a=n.getRowCount(),l=n.getColumnCount();if(r>=a||i>=l)return!1}return!0}function ip(e,n){return{startRow:e,endRow:e,startColumn:n,endColumn:n}}function gi(e,n){return Object.prototype.toString.call(e)===Object.prototype.toString.call(n)?Object.prototype.toString.call(e)==="[object Object]"||Object.prototype.toString.call(e)==="[object Array]"?Object.keys(e).length!==Object.keys(n).length?!1:Object.keys(e).every(t=>gi(e[t],n[t])):e===n:!1}function Il(e,n){const t=e.ts||{},r=n.ts||{};return e.sId!==n.sId?!1:gi(t,r)}function op(e,n){return n.some(t=>e.indexOf(t)>-1)}var Sl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){var t=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",c="day",h="week",u="month",d="quarter",f="year",p="date",E="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(ee){var k=["th","st","nd","rd"],z=ee%100;return"["+ee+(k[(z-20)%10]||k[z]||k[0])+"]"}},L=function(ee,k,z){var me=String(ee);return!me||me.length>=k?ee:""+Array(k+1-me.length).join(z)+ee},j={s:L,z:function(ee){var k=-ee.utcOffset(),z=Math.abs(k),me=Math.floor(z/60),te=z%60;return(k<=0?"+":"-")+L(me,2,"0")+":"+L(te,2,"0")},m:function ee(k,z){if(k.date()<z.date())return-ee(z,k);var me=12*(z.year()-k.year())+(z.month()-k.month()),te=k.clone().add(me,u),Ce=z-te<0,Ie=k.clone().add(me+(Ce?-1:1),u);return+(-(me+(z-te)/(Ce?te-Ie:Ie-te))||0)},a:function(ee){return ee<0?Math.ceil(ee)||0:Math.floor(ee)},p:function(ee){return{M:u,y:f,w:h,d:c,D:p,h:l,m:a,s:o,ms:i,Q:d}[ee]||String(ee||"").toLowerCase().replace(/s$/,"")},u:function(ee){return ee===void 0}},y="en",w={};w[y]=M;var x="$isDayjsObject",B=function(ee){return ee instanceof be||!(!ee||!ee[x])},ue=function ee(k,z,me){var te;if(!k)return y;if(typeof k=="string"){var Ce=k.toLowerCase();w[Ce]&&(te=Ce),z&&(w[Ce]=z,te=Ce);var Ie=k.split("-");if(!te&&Ie.length>1)return ee(Ie[0])}else{var Ne=k.name;w[Ne]=k,te=Ne}return!me&&te&&(y=te),te||!me&&y},q=function(ee,k){if(B(ee))return ee.clone();var z=typeof k=="object"?k:{};return z.date=ee,z.args=arguments,new be(z)},oe=j;oe.l=ue,oe.i=B,oe.w=function(ee,k){return q(ee,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var be=function(){function ee(z){this.$L=ue(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[x]=!0}var k=ee.prototype;return k.parse=function(z){this.$d=function(me){var te=me.date,Ce=me.utc;if(te===null)return new Date(NaN);if(oe.u(te))return new Date;if(te instanceof Date)return new Date(te);if(typeof te=="string"&&!/Z$/i.test(te)){var Ie=te.match(v);if(Ie){var Ne=Ie[2]-1||0,Pe=(Ie[7]||"0").substring(0,3);return Ce?new Date(Date.UTC(Ie[1],Ne,Ie[3]||1,Ie[4]||0,Ie[5]||0,Ie[6]||0,Pe)):new Date(Ie[1],Ne,Ie[3]||1,Ie[4]||0,Ie[5]||0,Ie[6]||0,Pe)}}return new Date(te)}(z),this.init()},k.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},k.$utils=function(){return oe},k.isValid=function(){return this.$d.toString()!==E},k.isSame=function(z,me){var te=q(z);return this.startOf(me)<=te&&te<=this.endOf(me)},k.isAfter=function(z,me){return q(z)<this.startOf(me)},k.isBefore=function(z,me){return this.endOf(me)<q(z)},k.$g=function(z,me,te){return oe.u(z)?this[me]:this.set(te,z)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(z,me){var te=this,Ce=!!oe.u(me)||me,Ie=oe.p(z),Ne=function(K,V){var fe=oe.w(te.$u?Date.UTC(te.$y,V,K):new Date(te.$y,V,K),te);return Ce?fe:fe.endOf(c)},Pe=function(K,V){return oe.w(te.toDate()[K].apply(te.toDate("s"),(Ce?[0,0,0,0]:[23,59,59,999]).slice(V)),te)},He=this.$W,Ze=this.$M,S=this.$D,U="set"+(this.$u?"UTC":"");switch(Ie){case f:return Ce?Ne(1,0):Ne(31,11);case u:return Ce?Ne(1,Ze):Ne(0,Ze+1);case h:var Q=this.$locale().weekStart||0,ne=(He<Q?He+7:He)-Q;return Ne(Ce?S-ne:S+(6-ne),Ze);case c:case p:return Pe(U+"Hours",0);case l:return Pe(U+"Minutes",1);case a:return Pe(U+"Seconds",2);case o:return Pe(U+"Milliseconds",3);default:return this.clone()}},k.endOf=function(z){return this.startOf(z,!1)},k.$set=function(z,me){var te,Ce=oe.p(z),Ie="set"+(this.$u?"UTC":""),Ne=(te={},te[c]=Ie+"Date",te[p]=Ie+"Date",te[u]=Ie+"Month",te[f]=Ie+"FullYear",te[l]=Ie+"Hours",te[a]=Ie+"Minutes",te[o]=Ie+"Seconds",te[i]=Ie+"Milliseconds",te)[Ce],Pe=Ce===c?this.$D+(me-this.$W):me;if(Ce===u||Ce===f){var He=this.clone().set(p,1);He.$d[Ne](Pe),He.init(),this.$d=He.set(p,Math.min(this.$D,He.daysInMonth())).$d}else Ne&&this.$d[Ne](Pe);return this.init(),this},k.set=function(z,me){return this.clone().$set(z,me)},k.get=function(z){return this[oe.p(z)]()},k.add=function(z,me){var te,Ce=this;z=Number(z);var Ie=oe.p(me),Ne=function(Ze){var S=q(Ce);return oe.w(S.date(S.date()+Math.round(Ze*z)),Ce)};if(Ie===u)return this.set(u,this.$M+z);if(Ie===f)return this.set(f,this.$y+z);if(Ie===c)return Ne(1);if(Ie===h)return Ne(7);var Pe=(te={},te[a]=r,te[l]=s,te[o]=t,te)[Ie]||1,He=this.$d.getTime()+z*Pe;return oe.w(He,this)},k.subtract=function(z,me){return this.add(-1*z,me)},k.format=function(z){var me=this,te=this.$locale();if(!this.isValid())return te.invalidDate||E;var Ce=z||"YYYY-MM-DDTHH:mm:ssZ",Ie=oe.z(this),Ne=this.$H,Pe=this.$m,He=this.$M,Ze=te.weekdays,S=te.months,U=te.meridiem,Q=function(V,fe,de,P){return V&&(V[fe]||V(me,Ce))||de[fe].slice(0,P)},ne=function(V){return oe.s(Ne%12||12,V,"0")},K=U||function(V,fe,de){var P=V<12?"AM":"PM";return de?P.toLowerCase():P};return Ce.replace(I,function(V,fe){return fe||function(de){switch(de){case"YY":return String(me.$y).slice(-2);case"YYYY":return oe.s(me.$y,4,"0");case"M":return He+1;case"MM":return oe.s(He+1,2,"0");case"MMM":return Q(te.monthsShort,He,S,3);case"MMMM":return Q(S,He);case"D":return me.$D;case"DD":return oe.s(me.$D,2,"0");case"d":return String(me.$W);case"dd":return Q(te.weekdaysMin,me.$W,Ze,2);case"ddd":return Q(te.weekdaysShort,me.$W,Ze,3);case"dddd":return Ze[me.$W];case"H":return String(Ne);case"HH":return oe.s(Ne,2,"0");case"h":return ne(1);case"hh":return ne(2);case"a":return K(Ne,Pe,!0);case"A":return K(Ne,Pe,!1);case"m":return String(Pe);case"mm":return oe.s(Pe,2,"0");case"s":return String(me.$s);case"ss":return oe.s(me.$s,2,"0");case"SSS":return oe.s(me.$ms,3,"0");case"Z":return Ie}return null}(V)||Ie.replace(":","")})},k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(z,me,te){var Ce,Ie=this,Ne=oe.p(me),Pe=q(z),He=(Pe.utcOffset()-this.utcOffset())*r,Ze=this-Pe,S=function(){return oe.m(Ie,Pe)};switch(Ne){case f:Ce=S()/12;break;case u:Ce=S();break;case d:Ce=S()/3;break;case h:Ce=(Ze-He)/6048e5;break;case c:Ce=(Ze-He)/864e5;break;case l:Ce=Ze/s;break;case a:Ce=Ze/r;break;case o:Ce=Ze/t;break;default:Ce=Ze}return te?Ce:oe.a(Ce)},k.daysInMonth=function(){return this.endOf(u).$D},k.$locale=function(){return w[this.$L]},k.locale=function(z,me){if(!z)return this.$L;var te=this.clone(),Ce=ue(z,me,!0);return Ce&&(te.$L=Ce),te},k.clone=function(){return oe.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},ee}(),Te=be.prototype;return q.prototype=Te,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",f],["$D",p]].forEach(function(ee){Te[ee[1]]=function(k){return this.$g(k,ee[0],ee[1])}}),q.extend=function(ee,k){return ee.$i||(ee(k,be,q),ee.$i=!0),q},q.locale=ue,q.isDayjs=B,q.unix=function(ee){return q(1e3*ee)},q.en=w[y],q.Ls=w,q.p={},q})})(Sl);var ap=Sl.exports;const zt=yt(ap);var Ol={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){return function(t,r){var s=r.prototype,i=s.format;s.format=function(o){var a=this,l=this.$locale();if(!this.isValid())return i.bind(this)(o);var c=this.$utils(),h=(o||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(u){switch(u){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return c.s(a.week(),u==="w"?1:2,"0");case"W":case"WW":return c.s(a.isoWeek(),u==="W"?1:2,"0");case"k":case"kk":return c.s(String(a.$H===0?24:a.$H),u==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return u}});return i.bind(this)(h)}}})})(Ol);var lp=Ol.exports;const up=yt(lp);var yl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,i=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},c=function(v){return(v=+v)+(v>68?1900:2e3)},h=function(v){return function(I){this[v]=+I}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=function(I){if(!I||I==="Z")return 0;var M=I.match(/([+-]|\d\d)/g),L=60*M[1]+(+M[2]||0);return L===0?0:M[0]==="+"?-L:L}(v)}],d=function(v){var I=l[v];return I&&(I.indexOf?I:I.s.concat(I.f))},f=function(v,I){var M,L=l.meridiem;if(L){for(var j=1;j<=24;j+=1)if(v.indexOf(L(j,0,I))>-1){M=j>12;break}}else M=v===(I?"pm":"PM");return M},p={A:[a,function(v){this.afternoon=f(v,!1)}],a:[a,function(v){this.afternoon=f(v,!0)}],Q:[s,function(v){this.month=3*(v-1)+1}],S:[s,function(v){this.milliseconds=100*+v}],SS:[i,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[o,h("seconds")],ss:[o,h("seconds")],m:[o,h("minutes")],mm:[o,h("minutes")],H:[o,h("hours")],h:[o,h("hours")],HH:[o,h("hours")],hh:[o,h("hours")],D:[o,h("day")],DD:[i,h("day")],Do:[a,function(v){var I=l.ordinal,M=v.match(/\d+/);if(this.day=M[0],I)for(var L=1;L<=31;L+=1)I(L).replace(/\[|\]/g,"")===v&&(this.day=L)}],w:[o,h("week")],ww:[i,h("week")],M:[o,h("month")],MM:[i,h("month")],MMM:[a,function(v){var I=d("months"),M=(d("monthsShort")||I.map(function(L){return L.slice(0,3)})).indexOf(v)+1;if(M<1)throw new Error;this.month=M%12||M}],MMMM:[a,function(v){var I=d("months").indexOf(v)+1;if(I<1)throw new Error;this.month=I%12||I}],Y:[/[+-]?\d+/,h("year")],YY:[i,function(v){this.year=c(v)}],YYYY:[/\d{4}/,h("year")],Z:u,ZZ:u};function E(v){var I,M;I=v,M=l&&l.formats;for(var L=(v=I.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(q,oe,be){var Te=be&&be.toUpperCase();return oe||M[be]||t[be]||M[Te].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(ee,k,z){return k||z.slice(1)})})).match(r),j=L.length,y=0;y<j;y+=1){var w=L[y],x=p[w],B=x&&x[0],ue=x&&x[1];L[y]=ue?{regex:B,parser:ue}:w.replace(/^\[|\]$/g,"")}return function(q){for(var oe={},be=0,Te=0;be<j;be+=1){var ee=L[be];if(typeof ee=="string")Te+=ee.length;else{var k=ee.regex,z=ee.parser,me=q.slice(Te),te=k.exec(me)[0];z.call(oe,te),q=q.replace(te,"")}}return function(Ce){var Ie=Ce.afternoon;if(Ie!==void 0){var Ne=Ce.hours;Ie?Ne<12&&(Ce.hours+=12):Ne===12&&(Ce.hours=0),delete Ce.afternoon}}(oe),oe}}return function(v,I,M){M.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(c=v.parseTwoDigitYear);var L=I.prototype,j=L.parse;L.parse=function(y){var w=y.date,x=y.utc,B=y.args;this.$u=x;var ue=B[1];if(typeof ue=="string"){var q=B[2]===!0,oe=B[3]===!0,be=q||oe,Te=B[2];oe&&(Te=B[2]),l=this.$locale(),!q&&Te&&(l=M.Ls[Te]),this.$d=function(me,te,Ce,Ie){try{if(["x","X"].indexOf(te)>-1)return new Date((te==="X"?1e3:1)*me);var Ne=E(te)(me),Pe=Ne.year,He=Ne.month,Ze=Ne.day,S=Ne.hours,U=Ne.minutes,Q=Ne.seconds,ne=Ne.milliseconds,K=Ne.zone,V=Ne.week,fe=new Date,de=Ze||(Pe||He?1:fe.getDate()),P=Pe||fe.getFullYear(),J=0;Pe&&!He||(J=He>0?He-1:fe.getMonth());var Z,re=S||0,Re=U||0,ye=Q||0,F=ne||0;return K?new Date(Date.UTC(P,J,de,re,Re,ye,F+60*K.offset*1e3)):Ce?new Date(Date.UTC(P,J,de,re,Re,ye,F)):(Z=new Date(P,J,de,re,Re,ye,F),V&&(Z=Ie(Z).week(V).toDate()),Z)}catch{return new Date("")}}(w,ue,x,M),this.init(),Te&&Te!==!0&&(this.$L=this.locale(Te).$L),be&&w!=this.format(ue)&&(this.$d=new Date("")),l={}}else if(ue instanceof Array)for(var ee=ue.length,k=1;k<=ee;k+=1){B[1]=ue[k-1];var z=M.apply(this,B);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}k===ee&&(this.$d=new Date(""))}else j.call(this,y)}}})})(yl);var cp=yl.exports;const hp=yt(cp);var wl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){return function(t,r,s){var i=r.prototype,o=function(u){return u&&(u.indexOf?u:u.s)},a=function(u,d,f,p,E){var v=u.name?u:u.$locale(),I=o(v[d]),M=o(v[f]),L=I||M.map(function(y){return y.slice(0,p)});if(!E)return L;var j=v.weekStart;return L.map(function(y,w){return L[(w+(j||0))%7]})},l=function(){return s.Ls[s.locale()]},c=function(u,d){return u.formats[d]||function(f){return f.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(p,E,v){return E||v.slice(1)})}(u.formats[d.toUpperCase()])},h=function(){var u=this;return{months:function(d){return d?d.format("MMMM"):a(u,"months")},monthsShort:function(d){return d?d.format("MMM"):a(u,"monthsShort","months",3)},firstDayOfWeek:function(){return u.$locale().weekStart||0},weekdays:function(d){return d?d.format("dddd"):a(u,"weekdays")},weekdaysMin:function(d){return d?d.format("dd"):a(u,"weekdaysMin","weekdays",2)},weekdaysShort:function(d){return d?d.format("ddd"):a(u,"weekdaysShort","weekdays",3)},longDateFormat:function(d){return c(u.$locale(),d)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return h.bind(this)()},s.localeData=function(){var u=l();return{firstDayOfWeek:function(){return u.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(d){return c(u,d)},meridiem:u.meridiem,ordinal:u.ordinal}},s.months=function(){return a(l(),"months")},s.monthsShort=function(){return a(l(),"monthsShort","months",3)},s.weekdays=function(u){return a(l(),"weekdays",null,null,u)},s.weekdaysShort=function(u){return a(l(),"weekdaysShort","weekdays",3,u)},s.weekdaysMin=function(u){return a(l(),"weekdaysMin","weekdays",2,u)}}})})(wl);var dp=wl.exports;const fp=yt(dp);var bl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,s,i){var o=s.prototype,a=o.format;i.en.formats=t,o.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,h=function(u,d){return u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(f,p,E){var v=E&&E.toUpperCase();return p||d[E]||t[E]||d[v].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(I,M,L){return M||L.slice(1)})})}(l,c===void 0?{}:c);return a.call(this,h)}}})})(bl);var gp=bl.exports;const mp=yt(gp);var Al={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){var t="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(i,o,a){var l=o.prototype;a.utc=function(E){var v={date:E,utc:!0,args:arguments};return new o(v)},l.utc=function(E){var v=a(this.toDate(),{locale:this.$L,utc:!0});return E?v.add(this.utcOffset(),t):v},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(E){E.utc&&(this.$u=!0),this.$utils().u(E.$offset)||(this.$offset=E.$offset),c.call(this,E)};var h=l.init;l.init=function(){if(this.$u){var E=this.$d;this.$y=E.getUTCFullYear(),this.$M=E.getUTCMonth(),this.$D=E.getUTCDate(),this.$W=E.getUTCDay(),this.$H=E.getUTCHours(),this.$m=E.getUTCMinutes(),this.$s=E.getUTCSeconds(),this.$ms=E.getUTCMilliseconds()}else h.call(this)};var u=l.utcOffset;l.utcOffset=function(E,v){var I=this.$utils().u;if(I(E))return this.$u?0:I(this.$offset)?u.call(this):this.$offset;if(typeof E=="string"&&(E=function(y){y===void 0&&(y="");var w=y.match(r);if(!w)return null;var x=(""+w[0]).match(s)||["-",0,0],B=x[0],ue=60*+x[1]+ +x[2];return ue===0?0:B==="+"?ue:-ue}(E),E===null))return this;var M=Math.abs(E)<=16?60*E:E,L=this;if(v)return L.$offset=M,L.$u=E===0,L;if(E!==0){var j=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(L=this.local().add(M+j,t)).$offset=M,L.$x.$localOffset=j}else L=this.utc();return L};var d=l.format;l.format=function(E){var v=E||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,v)},l.valueOf=function(){var E=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*E},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var f=l.toDate;l.toDate=function(E){return E==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var p=l.diff;l.diff=function(E,v,I){if(E&&this.$u===E.$u)return p.call(this,E,v,I);var M=this.local(),L=a(E).local();return p.call(M,L,v,I)}}})})(Al);var pp=Al.exports;const _p=yt(pp);var Tl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){return function(t,r){r.prototype.weekday=function(s){var i=this.$locale().weekStart||0,o=this.$W,a=(o<i?o+7:o)-i;return this.$utils().u(s)?a:this.subtract(a,"day").add(s,"day")}}})})(Tl);var Ep=Tl.exports;const Cp=yt(Ep);var Nl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){var t="week",r="year";return function(s,i,o){var a=i.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=o(this).startOf(r).add(1,r).date(c),u=o(this).endOf(t);if(h.isBefore(u))return 1}var d=o(this).startOf(r).date(c).startOf(t).subtract(1,"millisecond"),f=this.diff(d,t,!0);return f<0?o(this).startOf("week").week():Math.ceil(f)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})})(Nl);var Rp=Nl.exports;const vp=yt(Rp);var Ml={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Qe,function(){return function(t,r){r.prototype.weekYear=function(){var s=this.month(),i=this.week(),o=this.year();return i===1&&s===11?o+1:s===0&&i>=52?o-1:o}}})})(Ml);var Ip=Ml.exports;const Sp=yt(Ip);zt.extend(hp);zt.extend(up);zt.extend(Cp);zt.extend(fp);zt.extend(vp);zt.extend(Sp);zt.extend(_p);zt.extend(mp);function qr(e,n,t,r){if(e>n)throw new Error("a1 should be less than a2");if(t>r)throw new Error("b1 should be less than b2");if(n<t||r<e)return[e,n];if(t<=e&&r>=n)return[];const s=r-t+1;return e<t&&n>r?[e,n-s]:t<=e&&r<n?[r+1-s,n-s]:t>e&&r>=n?[e,t-1]:[e,n]}function Op(e){if(e==null)return!1;const n=e.bullet;return(n==null?void 0:n.listId)!=null}function yp(e){if(e==null)return!1;const n=e.paragraphStyle;return Dl(n)}function Dl(e){var n;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((n=e.hanging)==null?void 0:n.v)===0)}function Ll(e,n,t){return e.slice(0,n)+t+e.slice(n)}function xl(e,n,t){return n>t?e:e.slice(0,n)+e.slice(t)}const wp=/\s/g;function bp(e){return e===null||e.toString().replace(wp,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function Ap(e){let n=0;for(let t=0;t<e.length;t++)n=e.charCodeAt(t)+(n<<6)+(n<<16)-n;return n>>>0}const ze=Symbol("newer"),st=Symbol("older");class Tp{constructor(n){R(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[ze],{done:!1,value:n.key}):{done:!0,value:void 0}}}class Np{constructor(n){R(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[ze],{done:!1,value:n.value}):{done:!0,value:void 0}}}class Mp{constructor(n){R(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[ze],{done:!1,value:[n.key,n.value]}):{done:!0,value:void 0}}}var Bo,Wo;Wo=ze,Bo=st;class Eo{constructor(n,t){R(this,"key");R(this,"value");R(this,Wo);R(this,Bo);this.key=n,this.value=t,this[ze]=void 0,this[st]=void 0}toJSON(){return{key:this.key,value:this.value}}}class $r{constructor(...n){R(this,"_keymap");R(this,"size",0);R(this,"limit");R(this,"oldest");R(this,"newest");R(this,"_onShiftListeners",[]);if(jn.hasLength(n,1)){if(jn.isNumber(n[0])){const t=n[0];this._initialize(t,void 0);return}if(jn.isIterable(n[0])){const t=n[0];this._initialize(0,t);return}return}if(jn.hasLength(n,2)){const t=n[0],r=n[1];this._initialize(t,r)}}onShift(n){if(this._onShiftListeners.indexOf(n)===-1)return this._onShiftListeners.push(n),Je(()=>or(this._onShiftListeners,n));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(n,t){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=n,this._keymap=new Map,t&&(this.assign(t),n<1&&(this.limit=this.size))}_markEntryAsUsed(n){n!==this.newest&&(n[ze]&&(n===this.oldest&&(this.oldest=n[ze]),n[ze][st]=n[st]),n[st]&&(n[st][ze]=n[ze]),n[ze]=void 0,n[st]=this.newest,this.newest&&(this.newest[ze]=n),this.newest=n)}assign(n){let t,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const s=n[Symbol.iterator]();for(let i=s.next();!i.done;i=s.next()){const o=new Eo(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),t?(t[ze]=o,o[st]=t):this.oldest=o,t=o,r--===0)throw new Error("overflow")}this.newest=t,this.size=this._keymap.size}set(n,t){let r=this._keymap.get(n);return r?(r.value=t,this._markEntryAsUsed(r),this):(this._keymap.set(n,r=new Eo(n,t)),this.newest?(this.newest[ze]=r,r[st]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const n=this.oldest;if(n)return this.oldest&&this.oldest[ze]?(this.oldest=this.oldest[ze],this.oldest[st]=void 0):(this.oldest=void 0,this.newest=void 0),n[ze]=n[st]=void 0,this._keymap.delete(n.key),--this.size,this._onShiftListeners.forEach(t=>t(n)),[n.key,n.value]}get(n){const t=this._keymap.get(n);if(t)return this._markEntryAsUsed(t),t.value}has(n){return this._keymap.has(n)}find(n){const t=this._keymap.get(n);return t?t.value:void 0}delete(n){const t=this._keymap.get(n);if(t)return this._keymap.delete(t.key),t[ze]&&t[st]?(t[st][ze]=t[ze],t[ze][st]=t[st]):t[ze]?(t[ze][st]=void 0,this.oldest=t[ze]):t[st]?(t[st][ze]=void 0,this.newest=t[st]):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 Tp(this.oldest)}values(){return new Np(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new Mp(this.oldest)}forEach(n,t){typeof t!="object"&&(t=this);let r=this.oldest;for(;r;)n.call(t,r.value,r.key,this),r=r[ze]}toJSON(){const n=new Array(this.size);let t=0,r=this.oldest;for(;r;)n[t++]={key:r.key,value:r.value},r=r[ze];return n}toString(){let n="",t=this.oldest;for(;t;)n+=`${String(t.key)}:${t.value}`,t=t[ze],t&&(n+=" < ");return n}}class jn{static hasLength(n,t){return n.length===t}static getValueType(n){return Object.prototype.toString.apply(n)}static isObject(n){return this.getValueType(n)==="[object Object]"}static isIterable(n){return n[Symbol.iterator]!=null}static isNumber(n){return this.getValueType(n)==="[object Number]"}}var Ul={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(typeof self<"u"?self:Qe,function(){return function(){var t={d:function(_,g){for(var m in g)t.o(g,m)&&!t.o(_,m)&&Object.defineProperty(_,m,{enumerable:!0,get:g[m]})},o:function(_,g){return Object.prototype.hasOwnProperty.call(_,g)}},r={};t.d(r,{default:function(){return dt}});var s={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"};const i=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,o={},a={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:["AM","PM"],mmmm6:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"],mmm6:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],mmmm:["January","February","March","April","May","June","July","August","September","October","November","December"],mmm:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};function l(_){const g=i.exec(_);if(!g)throw new SyntaxError("Malformed locale: ".concat(_));return{lang:g[1]+(g[2]?"_"+g[2]:""),language:g[1],territory:g[2]||"",codeset:g[3]||"",modifier:g[4]||""}}function c(_){if(typeof _=="number")return s[65535&_]||null;const g=parseInt(_,16);return isFinite(g)&&s[65535&g]?s[65535&g]||null:i.test(_)?_:null}function h(_){const g=c(_);let m=null;if(g){const O=l(g);m=o[O.lang]||o[O.language]||null}return m}function u(_){return Object.assign({},a,_)}function d(_,g){const m=typeof g=="object"?g:l(g);return o[m.lang]=u(_),m.language===m.lang||o[m.language]||(o[m.language]=u(_)),o[m.lang]}const f=u({group:","});function p(_,g){if(typeof _!="number")return _;if(_<0)return-p(-_,g);if(g){const m=10**(g||0)||1;return p(_*m,0)/m}return Math.round(_)}f.isDefault=!0,d({group:",",ampm:["上午","下午"],mmmm:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"]},"zh_CN"),d({group:",",nan:"非數值",ampm:["上午","下午"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["週日","週一","週二","週三","週四","週五","週六"]},"zh_TW"),d({group:",",ampm:["午前","午後"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],ddd:["日","月","火","水","木","金","土"]},"ja"),d({group:",",ampm:["오전","오후"],mmmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],mmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dddd:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ddd:["일","월","화","수","목","금","토"]},"ko"),d({group:",",ampm:["ก่อนเที่ยง","หลังเที่ยง"],mmmm:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],mmm:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dddd:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],ddd:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},"th"),d({decimal:",",ampm:["dop.","odp."],mmmm:["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince"],mmm:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],dddd:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],ddd:["ne","po","út","st","čt","pá","so"]},"cs"),d({group:".",decimal:",",mmmm:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],mmm:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"da"),d({group:".",decimal:",",ampm:["a.m.","p.m."],mmmm:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],mmm:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],ddd:["zo","ma","di","wo","do","vr","za"]},"nl"),d({group:","},"en"),d({decimal:",",nan:"epäluku",ampm:["ap.","ip."],mmmm:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],mmm:["tammik.","helmik.","maalisk.","huhtik.","toukok.","kesäk.","heinäk.","elok.","syysk.","lokak.","marrask.","jouluk."],dddd:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],ddd:["su","ma","ti","ke","to","pe","la"]},"fi"),d({group:" ",decimal:",",mmmm:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],mmm:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dddd:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],ddd:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."]},"fr"),d({group:".",decimal:",",mmmm:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],mmm:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],dddd:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],ddd:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]},"de"),d({group:".",decimal:",",ampm:["π.μ.","μ.μ."],mmmm:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],mmm:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dddd:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],ddd:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"]},"el"),d({decimal:",",ampm:["de.","du."],mmmm:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],mmm:["jan.","febr.","márc.","ápr.","máj.","jún.","júl.","aug.","szept.","okt.","nov.","dec."],dddd:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"],ddd:["V","H","K","Sze","Cs","P","Szo"]},"hu"),d({group:".",decimal:",",ampm:["f.h.","e.h."],mmmm:["janúar","febrúar","mars","apríl","maí","júní","júlí","ágúst","september","október","nóvember","desember"],mmm:["jan.","feb.","mar.","apr.","maí","jún.","júl.","ágú.","sep.","okt.","nóv.","des."],dddd:["sunnudagur","mánudagur","þriðjudagur","miðvikudagur","fimmtudagur","föstudagur","laugardagur"],ddd:["sun.","mán.","þri.","mið.","fim.","fös.","lau."]},"is"),d({group:".",decimal:",",mmmm:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],mmm:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],dddd:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],ddd:["Min","Sen","Sel","Rab","Kam","Jum","Sab"]},"id"),d({group:".",decimal:",",mmmm:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],mmm:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dddd:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],ddd:["dom","lun","mar","mer","gio","ven","sab"]},"it"),d({decimal:",",ampm:["a.m.","p.m."],mmmm:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],mmm:["jan.","feb.","mar.","apr.","mai","jun.","jul.","aug.","sep.","okt.","nov.","des."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"nb"),d({decimal:",",mmmm:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"],mmm:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],dddd:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],ddd:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."]},"pl"),d({group:".",decimal:",",mmmm:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],mmm:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],dddd:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],ddd:["dom.","seg.","ter.","qua.","qui.","sex.","sáb."]},"pt"),d({decimal:",",nan:"не число",mmmm:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],mmm:["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],dddd:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],ddd:["вс","пн","вт","ср","чт","пт","сб"]},"ru"),d({decimal:",",mmmm:["januára","februára","marca","apríla","mája","júna","júla","augusta","septembra","októbra","novembra","decembra"],mmm:["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],dddd:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],ddd:["ne","po","ut","st","št","pi","so"]},"sk"),d({group:".",decimal:",",ampm:["a. m.","p. m."],mmmm:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],mmm:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],dddd:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],ddd:["dom.","lun.","mar.","mié.","jue.","vie.","sáb."]},"es"),d({decimal:",",ampm:["fm","em"],mmmm:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],mmm:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],dddd:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],ddd:["sön","mån","tis","ons","tors","fre","lör"]},"sv"),d({group:".",decimal:",",ampm:["ÖÖ","ÖS"],mmmm:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],mmm:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],dddd:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],ddd:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"]},"tr");function E(_,g,m){const O=_<0?-1:1,b=10**(g||2),N=10**(m||2);let T,D,C=Math.abs(_),H=0,ae=0,$=0,se=1;if((_=C)%1==0)D=[_*O,1];else if(_<1e-19)D=[O,1e19];else if(_>1e19)D=[1e19*O,1];else{do if(C=1/(C-Math.floor(C)),T=se,se=se*Math.floor(C)+H,H=T,ae=$,$=Math.floor(_*se+.5),$>=b||se>=N)return[O*ae,H];while(Math.abs(_-$/se)>=1e-10&&C!==Math.floor(C));D=[O*$,se]}return D}const v={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},I=Object.assign({},v);function M(_){if(_===null&&(_=v),_){for(const g in _)if(g in v){const m=_[g];I[g]=m==null?v[g]:m}}return{...I}}const L={"#":"",0:"0","?":" "},j={"@":"text","-":"minus","+":"plus"},y=["#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#800","#080","#008","#880","#808","#088","#CCC","#888","#99F","#936","#FFC","#CFF","#606","#F88","#06C","#CCF","#008","#F0F","#FF0","#0FF","#808","#800","#088","#00F","#0CF","#CFF","#CFC","#FF9","#9CF","#F9C","#C9F","#FC9","#36F","#3CC","#9C0","#FC0"],w=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],x=new RegExp("["+w.join("")+"]");function B(_,g,m){return g[m+"_max"]=_.length,g[m+"_min"]=_.replace(/#/g,"").length,g}const ue={};function q(_){if(!(_ in ue)){const g=[],m=_.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,O=>"?".repeat(O.length));for(let O=0;O<m.length;O++){const b=m.charAt(O);g[O]=b in L?L[b]:b}ue[_]=g.join("")}return ue[_]}function oe(_,g){typeof _=="string"&&(_={type:"string",value:_=_.replace(/ /g,L["?"])}),g.push(_)}function be(_){const g=[],m={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:g};let O=_+"",b="int",N=!1,T=null;const D=[];let C,H,ae=!1;for(;O&&!N;){if(C=/^General/i.exec(O))m.general=!0,oe({type:"general"},g);else if(b==="int"&&(C=/^[#?0]+(?:,[#?0]+)*/.exec(O))||b==="den"&&(C=/^[#?\d]+/.exec(O))||(C=/^[#?0]+/.exec(O)))m[b+"_pattern"].push(C[0]),T={type:b,num:C[0]},oe(T,g);else if((C=/^\//.exec(O))&&m[b+"_pattern"].length){if(!T)throw new SyntaxError("Missing a numerator in pattern ".concat(_));m.fractions=!0,m.num_pattern.push(m[b+"_pattern"].pop()),T.type="num",b="den",oe({type:"div"},g)}else if(C=/^,+/.exec(O)){const A=O.charAt(1)in L;H.slice(-1)in L&&(C[0].length>1||!A)?m.scale=.001**C[0].length:m.dec_fractions||oe(C[0],g)}else{if(C=/^;/.exec(O)){N=!0;break}if(C=/^[@+-]/.exec(O))C[0]==="@"&&(m.text=!0),oe({type:j[C[0]]},g);else if(C=/^(?:\[(h+|m+|s+)\])/i.exec(O)){const A=C[1].toLowerCase(),W=A[0],ce={type:"",size:0,date:1,raw:C[0],pad:A.length};W==="h"?(ce.size=16,ce.type="hour-elap"):W==="m"?(ce.size=32,ce.type="min-elap"):(ce.size=64,ce.type="sec-elap"),m.date=m.date|ce.size,D.push(ce),oe(ce,g)}else if(C=/^(?:B2)/i.exec(O))ae||(m.date_system=6);else if(C=/^(?:B1)/i.exec(O))ae||(m.date_system=1);else if(C=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(O)){const A={type:"",size:0,date:1,raw:C[0]},W=C[0].toLowerCase(),ce=W[0];if(W==="y"||W==="yy")A.size=2,A.type="year-short";else if(ce==="y"||ce==="e")A.size=2,A.type="year";else if(W==="b"||W==="bb")A.size=2,A.type="b-year-short";else if(ce==="b")A.size=2,A.type="b-year";else if(W==="d"||W==="dd")A.size=8,A.type="day",A.pad=/dd/.test(W);else if(W==="ddd")A.size=8,A.type="weekday-short";else if(ce==="d")A.size=8,A.type="weekday";else if(ce==="h")A.size=16,A.type="hour",A.pad=/hh/i.test(W);else if(ce==="m"){W.length===3?(A.size=4,A.type="monthname-short"):W.length===5?(A.size=4,A.type="monthname-single"):W.length>=4&&(A.size=4,A.type="monthname");const ve=D[D.length-1];!A.type&&ve&&!ve.used&&80&ve.size&&(ve.used=!0,A.size=32,A.type="min",A.pad=/mm/.test(W)),A.type||(A.size=4,A.type="month",A.pad=/mm/.test(W),A.indeterminate=!0)}else if(ce==="s"){A.size=64,A.type="sec",A.pad=/ss/.test(W);const ve=D[D.length-1];ve&&32&ve.size?A.used=!0:ve&&ve.indeterminate&&(delete ve.indeterminate,ve.size=32,ve.type="min",A.used=!0)}m.date=m.date|A.size,m.date_eval=!0,D.push(A),oe(A,g)}else if(C=/^(?:AM\/PM|am\/pm|A\/P)/.exec(O))m.clock=12,m.date=16|m.date,m.date_eval=!0,oe({type:"am",short:C[0]==="A/P"},g);else if(m.date&&(C=/^\.0{1,3}/i.exec(O))){const A=C[0].length-1,W=[64,128,256,512][A];m.date=m.date|W,m.date_eval=!0,m.sec_decimals=Math.max(m.sec_decimals,A),oe({type:"subsec",size:W,decimals:A,date:1,raw:C[0]},g)}else if((C=/^\\(.)/.exec(O))||(C=/^"([^"]*?)"/.exec(O)))oe(C[1],g);else if(C=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(O))m.condition=[C[1],parseFloat(C[2],10)];else if(C=/^\[\$([^\]]+)\]/.exec(O)){const A=C[1].split("-"),W=A.length<2?"":A[A.length-1],ce=A[0];ce&&oe(ce,g);const ve=c(W);ve&&(m.locale=ve);const De=parseInt(W,16);isFinite(De)&&16711680&De&&(De>>16&255)===6&&(m.date_system=6),ae=!0}else if(C=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(O))m.color=C[2]?y[parseInt(C[2],10)]||"#000":C[1].toLowerCase();else if(!(C=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(O))){if(C=/^%/.exec(O))m.scale=100,m.percent=!0,oe("%",g);else if(C=/^_(\\.|.)/.exec(O))oe(" ",g);else if(C=/^\./.exec(O))oe({type:"point",value:C[0]},g),m.dec_fractions=!0,b="frac";else if(C=/^[Ee]([+-]?|(?=[0#?]))/.exec(O))m.exponential=!0,m.exp_plus=C[1]==="+",b="man",oe({type:"exp",plus:C[1]==="+"},g);else if(!(C=/^\*(\\.|.)/.exec(O))){if(C=/^[BENn[]/.exec(O))throw new SyntaxError("Unexpected char ".concat(O.charAt(0)," in pattern ").concat(_));O[0]==="("&&(m.parens=!0),C=[O[0]],oe(C[0],g)}}}H=C[0],O=O.slice(C?C[0].length:1)}if(m.pattern=_.slice(0,_.length-O.length),/^((?:\[[^\]]+\])+)(;|$)/.test(m.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(m.pattern)&&oe({type:"text"},g),m.fractions&&m.dec_fractions||m.fractions&&m.exponential)throw new SyntaxError("Invalid pattern: ".concat(m.pattern));const $=m.int_pattern.join("");if(m.grouping=$.indexOf(",")>=0,m.grouping){const A=$.split(","),W=A.length;W===2?(m.group_pri=A[1].length,m.group_sec=m.group_pri):W>2&&(m.group_pri=A[W-1].length,m.group_sec=A[W-2].length)}else m.group_pri=0,m.group_sec=0;B($.replace(/[,]/g,""),m,"int"),B(m.frac_pattern.join(""),m,"frac"),B(m.man_pattern.join(""),m,"man");let se=m.num_pattern.join(""),_e=m.den_pattern.join("");const X=/\?/.test(_e)||/\?/.test(se);return _e=_e.replace(/\d/g,X?"?":"#"),X&&(_e=_e.replace(/#$/g,"?")),B(se,m,"num"),B(_e,m,"den"),X&&(se=se.replace(/#$/g,"?")),m.int_padding=q(m.int_pattern.join("")),m.man_padding=q(m.man_pattern.join("")),m.num_padding=q(se),m.den_padding=q(_e),m.den_pattern.length&&(m.denominator=parseInt(m.den_pattern.join("").replace(/\D/g,""),10)),m.integer=!!m.int_pattern.join("").length,m.fractions&&g.forEach((A,W)=>{const ce=g[W+1];A.type==="string"&&ce&&(ce.type==="num"?A.rule="num+int":ce.type==="div"?A.rule="num":ce.type==="den"&&(A.rule="den"))}),m}const Te=_=>{const g=_.condition;g&&g[1]<0&&(g[0]==="<"||g[0]==="<="||g[0]==="=")||_.tokens.unshift({type:"minus",volatile:!0})};function ee(_){const g=[];let m,O=!1,b=null,N=_,T=0,D=!1,C=0,H=0;do{if(D=be(N),(D.date||D.general)&&(D.int_pattern.length||D.frac_pattern.length||D.scale!==1||D.text))throw new Error("Illegal format");if(D.condition&&(H++,O=!0),D.text){if(b)throw new Error("Unexpected partition");b=D}D.locale&&(m=c(D.locale)),g.push(D),T=N.charAt(D.pattern.length)===";"?1:0,N=N.slice(D.pattern.length+T),C++}while(T&&C<4&&H<3);if(T)throw new Error("Unexpected partition");if(H>2)throw new Error("Unexpected condition");const ae=g[3];if(ae&&(ae.int_pattern.length||ae.frac_pattern.length||ae.date))throw new Error("Unexpected partition");if(O){const $=g.length;if($===1&&(g[1]=be("General"),g[1].generated=!0),$<3){const se=g[0],_e=g[1];if(Te(se),_e.condition)Te(_e);else{const X=se.condition;(X[0]==="="||X[1]>=0&&(X[0]===">"||X[0]===">="))&&_e.tokens.unshift({type:"minus",volatile:!0})}}else g.forEach(Te)}else{if(g.length<4&&b)for(let $=0,se=g.length;$<se;$++)g[$]===b&&g.splice($,1);if(g.length<1&&b&&(g[0]=be("General"),g[0].generated=!0),g.length<2){const $=be(g[0].pattern);$.tokens.unshift({type:"minus",volatile:!0}),$.generated=!0,g.push($)}if(g.length<3){const $=be(g[0].pattern);$.generated=!0,g.push($)}if(g.length<4)if(b)g.push(b);else{const $=be("@");$.generated=!0,g.push($)}g[0].condition=[">",0],g[1].condition=["<",0],g[2].condition=null}return{pattern:_,partitions:g,locale:m}}const k=Math.floor;function z(_){if((!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&_>=0){if(_===0)return[1900,1,0];if(_===60)return[1900,2,29];if(_<60)return[1900,_<32?1:2,(_-1)%31+1]}let m=_+68569+2415019;const O=k(4*m/146097);m-=k((146097*O+3)/4);const b=k(4e3*(m+1)/1461001);m=m-k(1461*b/4)+31;const N=k(80*m/2447),T=m-k(2447*N/80);m=k(N/11);const D=N+2-12*m;return[0|100*(O-49)+b+m,0|D,0|T]}function me(_){return z(_+1462)}function te(_){if(_===60)throw new Error("#VALUE!");if(_<=1)return[1317,8,29];if(_<60)return[1317,_<32?9:10,1+(_-2)%30];const g=10631/30,m=.1335;let O=_+466935;const b=k(O/10631);O-=10631*b;const N=k((O-m)/g);O-=k(N*g+m);const T=k((O+28.5001)/29.5);return T===13?[30*b+N,12,30]:[30*b+N,T,O-k(29.5001*T-29)]}function Ce(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,m=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const O=k(_);return g===6?te(O):g===-1?me(O):z(O,m)}const Ie=Math.floor,Ne=86400;function Pe(_,g){let m=null;if(Array.isArray(_)){const[O,b,N,T,D,C]=_;m=Date.UTC(O,b==null?0:b-1,N!=null?N:1,T||0,D||0,C||0)}else if(_ instanceof Date&&(m=1*_,!g||!g.ignoreTimezone)){const O=new Date;O.setUTCFullYear(_.getFullYear(),_.getMonth(),_.getDate()),O.setUTCHours(_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()),m=1*O}if(m!=null&&isFinite(m)){const O=m/864e5;return O-(O<=-25509?-25568:-25569)}return _}function He(_,g){let m=0|_;const O=Ne*(_-m);let b=Ie(O);O-b>.9999&&(b+=1,b===Ne&&(b=0,m+=1));const N=b<0?Ne+b:b,[T,D,C]=Ce(_,0,g&&g.leap1900),H=Ie(N/60/60)%60,ae=Ie(N/60)%60,$=Ie(N)%60;if(g&&g.nativeDate){const se=new Date(0);return se.setUTCFullYear(T,D-1,C),se.setUTCHours(H,ae,$),se}return[T,D,C,H,ae,$]}function Ze(_){return!!(_[0]&&_[0].percent||_[1]&&_[1].percent||_[2]&&_[2].percent||_[3]&&_[3].percent)}function S(_){return!!(_[0]&&_[0].date||_[1]&&_[1].date||_[2]&&_[2].date||_[3]&&_[3].date)}function U(_){const[g,m,O,b]=_;return!(g&&!g.generated||m&&!m.generated||O&&!O.generated||!b||!b.text||b.generated)}const Q={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},ne=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],K={total:1,sign:0,period:0,int:1,frac:0},V=(_,g)=>_.replace(/\./,g.decimal);function fe(_,g,m,O){const b=0|m;if(typeof m=="string")_.push(m);else if(m===b)_.push(Math.abs(b));else{const N=Math.abs(m);let T=N?Math.floor(Math.log10(N)):0,D=T<0?N*10**-T:N/10**T;D===10&&(D=1,T++);const C=function(ae){let $=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const se=Math.abs(ae);if(!se)return K;const _e=$&&ae<0?1:0,X=Math.floor(se),A=Math.floor(Math.log10(se)+1);let W=0,ce=0;if(X!==se){W=1;const ve=String(p(A<0?se*10**-A:se/10**A,15));let De=ve.length,xe=!0,je=0;for(;je<=ve.length;){if(ve[je]==="."){De--;break}ve[je]==="0"&&xe?De--:xe=!1,je++}ce=De-A,ce<0&&(ce=0,W=0)}return{total:_e+Math.max(A,1)+W+ce,digits:Math.max(A,0)+ce,sign:_e,period:W,int:Math.max(A,1),frac:ce}}(N),H=()=>{const ae=Math.abs(T);let $;$=D===1?D:p(D,5),_.push(V($+"",O),O.exponent,T<0?O.negative:O.positive,ae<10?"0":"",ae)};if(T>=-4&&T<=-1){const ae=N.toPrecision(10+T).replace(/\.?0+$/,"");_.push(V(ae,O))}else if(T===10){const ae=N.toFixed(10).slice(0,12).replace(/\.$/,"");_.push(V(ae,O))}else if(Math.abs(T)<=9)if(C.total<=11){const ae=p(N,9).toFixed(C.frac);_.push(V(ae,O))}else T===9?_.push(Math.floor(N)):T>=0&&T<9?_.push(p(N,9-T)):H();else C.total>=12?H():Math.floor(N)===N?_.push(Math.floor(N)):_.push(V(p(N,9).toFixed(C.frac),O))}return _}const de=86400,P={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},J=function(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const m=Math.floor(Math.log10(_));return g>1?Math.floor(m/g)*g:m};function Z(_,g,m,O){let b="",N="",T="",D="",C="",H=0,ae=0|_,$=0,se=0,_e=1,X=0,A=0,W=0,ce=0,ve=0,De=0;const xe=O||f;if(!g.text&&isFinite(g.scale)&&g.scale!==1&&(_=function(ge){if(ge===0)return ge;const Oe=Math.ceil(Math.log10(ge<0?-ge:ge)),Y=10**(16-Math.floor(Oe));return Math.round(ge*Y)/Y}(_*g.scale)),g.exponential){let ge=Math.abs(_);if(ge){const Oe=10**-J(ge,g.int_max),Y=p(ge*Oe,g.frac_max)/Oe;H=J(Y,g.int_max)}ge/=10**H,_=_<0?-ge:ge,b+=Math.abs(H)}if(g.integer){const ge=Math.abs(p(_,g.fractions?1:g.frac_max));C+=ge<1?"":Math.floor(ge)}if(g.grouping){let ge="",Oe=C.length;for(Oe>g.group_pri&&(Oe-=g.group_pri,ge=xe.group+C.slice(Oe,Oe+g.group_pri)+ge);Oe>g.group_sec;)Oe-=g.group_sec,ge=xe.group+C.slice(Oe,Oe+g.group_sec)+ge;C=Oe?C.slice(0,Oe)+ge:ge}g.dec_fractions&&(D=String(p(_,g.frac_max)).split(".")[1]||"");let je=!1;if(g.fractions){const ge=Math.abs(g.integer?_%1:_);if(ge)if(je=!0,isFinite(g.denominator))T+=g.denominator,N+=p(ge*g.denominator),N==="0"&&(N="",T="",je=!1,C||(C="0"));else{const Oe=E(ge,g.integer?g.num_max:1/0,g.den_max);N+=Oe[0],T+=Oe[1],g.integer&&N==="0"&&(C||(C="0"),N="",T="",je=!1)}}if(g.date){ae=Math.trunc(_);const ge=de*(_-ae);if($=Math.floor(ge),De=ge-$,Math.abs(De)<1e-6?De=0:De>.9999&&(De=0,$+=1,$===de&&($=0,ae+=1)),De){const Oe=512&g.date||256&g.date||128&g.date;(Oe===512&&De>.9995||Oe===256&&De>.995||Oe===128&&De>.95||!Oe&&De>=.5)&&($++,De=0)}if(ae||g.date_system){const Oe=Ce(_,g.date_system,m.leap1900);se=Oe[0],_e=Oe[1],X=Oe[2]}if($){const Oe=$<0?de+$:$;ve=Math.floor(Oe)%60,ce=Math.floor(Oe/60)%60,W=Math.floor(Oe/60/60)%60}if(A=(6+ae)%7,g.date_eval&&(ft=_,_t=ae+$/de,m.dateSpanLarge?ft<-694324||_t>=35830291:ft<0||_t>=2958466)){if(m.dateErrorThrows)throw new Error("Date out of bounds");return m.dateErrorNumber?fe(_<0?[xe.negative]:[],0,_,xe).join(""):m.overflow}}var ft,_t;if(g.int_padding&&(C=g.int_padding.length===1?C||g.int_padding:g.int_padding.substring(0,g.int_padding.length-C.length)+C),g.num_padding&&(N=g.num_padding.length===1?N||g.num_padding:g.num_padding.substring(0,g.num_padding.length-N.length)+N),g.den_padding&&(T=g.den_padding.length===1?T||g.den_padding:T+g.den_padding.slice(T.length)),g.man_padding){const ge=g.exp_plus?"+":"";b=g.man_padding.length===1?(H<0?"-":ge)+(b||g.man_padding):(H<0?"-":ge)+g.man_padding.slice(0,g.man_padding.length-b.length)+b}const le=[];let qe=0;const pe={int:0,frac:0,man:0,num:0,den:0};for(let ge=0,Oe=g.tokens.length;ge<Oe;ge++){const Y=g.tokens[ge],ut=Y.num?Y.num.length:0;if(Y.type==="string")Y.rule?Y.rule==="num"?je?le.push(Y.value):(g.num_min>0||g.den_min>0)&&le.push(Y.value.replace(/./g,L["?"])):Y.rule==="num+int"?je&&C?le.push(Y.value):g.den_min>0&&(C||g.num_min)&&le.push(Y.value.replace(/./g,L["?"])):Y.rule==="den"&&(je?le.push(Y.value):(g.den_min>0||g.den_min>0)&&le.push(Y.value.replace(/./g,L["?"]))):le.push(Y.value);else if(Y.type==="error")le.push(m.invalid);else if(Y.type==="point")le.push(g.date?Y.value:xe.decimal);else if(Y.type==="general")fe(le,0,_,xe);else if(Y.type==="exp")le.push(xe.exponent);else if(Y.type==="minus")Y.volatile&&g.date||Y.volatile&&(_>=0||typeof _!="number")||(Y.volatile&&!g.fractions&&(g.integer||g.dec_fractions)?(_<0&&C&&C!=="0"||D)&&le.push(xe.negative):le.push(xe.negative));else if(Y.type==="plus")le.push(xe.positive);else if(Y.type==="text")le.push(_);else if(Y.type==="div")je?le.push("/"):g.num_min>0||g.den_min>0?le.push(L["?"]):le.push(L["#"]);else if(Y.type==="int")if(g.int_pattern.length===1)le.push(C);else{const Fe=qe?g.int_pattern.join("").length-pe.int:1/0,Mt=qe===g.int_pattern.length-1?0:g.int_pattern.join("").length-(pe.int+Y.num.length);le.push(C.substring(C.length-Fe,C.length-Mt)),qe++,pe.int+=Y.num.length}else if(Y.type==="frac"){const Fe=pe.frac;for(let Mt=0;Mt<ut;Mt++)le.push(D[Mt+Fe]||L[Y.num[Mt]]);pe.frac+=ut}else if(Y.type in P)g[Y.type+"_pattern"].length===1?(Y.type==="int"&&le.push(C),Y.type==="frac"&&le.push(D),Y.type==="man"&&le.push(b),Y.type==="num"&&le.push(N),Y.type==="den"&&le.push(T)):(le.push(P[Y.type].slice(pe[Y.type],pe[Y.type]+ut)),pe[Y.type]+=ut);else if(Y.type==="year")se<0&&le.push(xe.negative),le.push(String(Math.abs(se)).padStart(4,"0"));else if(Y.type==="year-short"){const Fe=se%100;le.push(Fe<10?"0":"",Fe)}else if(Y.type==="month")le.push(Y.pad&&_e<10?"0":"",_e);else if(Y.type==="monthname-single")g.date_system===6?le.push(xe.mmmm6[_e-1].charAt(0)):le.push(xe.mmmm[_e-1].charAt(0));else if(Y.type==="monthname-short")g.date_system===6?le.push(xe.mmm6[_e-1]):le.push(xe.mmm[_e-1]);else if(Y.type==="monthname")g.date_system===6?le.push(xe.mmmm6[_e-1]):le.push(xe.mmmm[_e-1]);else if(Y.type==="weekday-short")le.push(xe.ddd[A]);else if(Y.type==="weekday")le.push(xe.dddd[A]);else if(Y.type==="day")le.push(Y.pad&&X<10?"0":"",X);else if(Y.type==="hour"){const Fe=W%g.clock||(g.clock<24?g.clock:0);le.push(Y.pad&&Fe<10?"0":"",Fe)}else if(Y.type==="min")le.push(Y.pad&&ce<10?"0":"",ce);else if(Y.type==="sec")le.push(Y.pad&&ve<10?"0":"",ve);else if(Y.type==="subsec"){le.push(xe.decimal);const Fe=De.toFixed(g.sec_decimals);le.push(Fe.slice(2,2+Y.decimals))}else if(Y.type==="am"){const Fe=W<12?0:1;Y.short&&!O?le.push("AP"[Fe]):le.push(xe.ampm[Fe])}else if(Y.type==="hour-elap"){_<0&&le.push(xe.negative);const Fe=24*ae+Math.floor(Math.abs($)/3600);le.push(String(Math.abs(Fe)).padStart(Y.pad,"0"))}else if(Y.type==="min-elap"){_<0&&le.push(xe.negative);const Fe=1440*ae+Math.floor(Math.abs($)/60);le.push(String(Math.abs(Fe)).padStart(Y.pad,"0"))}else if(Y.type==="sec-elap"){_<0&&le.push(xe.negative);const Fe=ae*de+Math.abs($);le.push(String(Math.abs(Fe)).padStart(Y.pad,"0"))}else if(Y.type==="b-year")le.push(se+543);else if(Y.type==="b-year-short"){const Fe=(se+543)%100;le.push(Fe<10?"0":"",Fe)}}return m.nbsp?le.join(""):le.join("").replace(/\u00a0/g," ")}function re(_,g){for(let m=0;m<3;m++){const O=g[m];if(O){let b;if(O.condition){const N=O.condition[0],T=O.condition[1];N==="="?b=_===T:N===">"?b=_>T:N==="<"?b=_<T:N===">="?b=_>=T:N==="<="?b=_<=T:N==="<>"&&(b=_!==T)}else b=!0;if(b)return O}}}const Re=be("@"),ye="black",F={};function he(_,g){if(_){const m=_[0];g[m]=g[m]||{},he(_.slice(1),g[m])}else g.$=!0}["d-F-y","d-F-Y","d-M-y","d-M-Y","F-d-y","F-d-Y","F-j-y","F-j-Y","j-F-y","j-F-Y","j-M-y","j-M-Y","M-d-y","M-d-Y","M-j-y","M-j-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","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"].forEach(_=>{he(_,F),he(_+" x",F),he(_+" l",F),he(_+" l x",F),he("l "+_,F),he("l "+_+" x",F),he(_+" D",F),he(_+" D x",F),he("D "+_,F),he("D "+_+" x",F)});const Be={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},$e={january:1,february:2,march:3,april:4,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Me={sunday:"l",monday:"l",tuesday:"l",wednesday:"l",thursday:"l",friday:"l",saturday:"l",sun:"D",mon:"D",tue:"D",wed:"D",thu:"D",fri:"D",sat:"D"},Ke=new Date().getUTCFullYear();function Rt(_){const g=new RegExp("^([\\s+%"+w.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+w.join("")+")]*)$").exec(_);if(g){const[,m,O,b,N,T]=g;let D=1,C="",H=!1,ae=!1,$=!1,se=!1,_e=!1,X=null,A=!1,W=parseFloat(O.replace(/,/g,""));if(!isFinite(W))return null;for(let ve=0;ve<m.length;ve++){const De=m[ve];if(De==="-"){if(H||ae)return null;H=!0,D=-1}else if(x.test(De)){if(_e)return null;_e=!0,X=De}else if(De==="("){if(ae||H)return null;ae=!0,D=-1}else if(De==="%"){if(se)return null;se=!0}}for(let ve=0;ve<T.length;ve++){const De=T[ve];if(x.test(De)){if(_e)return null;_e=!0,X=De,A=!0}else if(De===")"){if($||!ae)return null;$=!0}else if(De==="%"){if(se)return null;se=!0}}if(N){if(se||_e)return null;C="0.00E+00"}else if(se){if(_e)return null;C=b.includes(".")?"0.00%":"0%",W*=.01}else if(_e){const ve=b.includes(".")?"#,##0.00":"#,##0";C=A?ve+X:X+ve}else b.includes(",")&&(C=b.includes(".")?"#,##0.00":"#,##0");const ce={v:W*D};return C&&(ce.z=C),ce}}const We=(_,g,m)=>{const O=m.path||"",b=Object.keys(g);for(let N=0;N<b.length;N++){let T;const D=b[N];if(g[D]){if(D==="$"||D==="€")_||(T=m);else if(D==="-"){const C=/^(\s*([./-]|,\s)\s*|\s+)/.exec(_);if(C){const H=C[1]==="-"||C[1]==="/"||C[1]==="."?C[1]:" ";if(!m.sep||m.sep===H){const ae=C[0].replace(/\s+/g," ");T=We(_.slice(C[0].length),g[D],{...m,sep:H,path:O+ae})}}}else if(D===" "){const C=/^[,.]?\s+/.exec(_);if(C){const H=C[0].replace(/\s+/g," ");T=We(_.slice(C[0].length),g[D],{...m,path:O+H})}}else if(D==="j"||D==="d"){const C=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(_);C&&(T=We(_.slice(C[0].length),g[D],{...m,day:C[0],path:O+D}))}else if(D==="n"||D==="m"){const C=/^(0?[1-9]|1[012])\b/.exec(_);C&&(T=We(_.slice(C[0].length),g[D],{...m,month:+C[0],_mon:C[0],path:O+D}))}else if(D==="F"||D==="M"){const C=/^([a-z]{3,9})\b/i.exec(_),H=C&&(D==="F"?$e:Be)[C[0].toLowerCase()];H&&(T=We(_.slice(C[0].length),g[D],{...m,month:H,_mon:C[0],path:O+D}))}else if(D==="l"||D==="D"){const C=/^([a-z]{3,9})\b/i.exec(_);(C&&Me[C[0].toLowerCase()])===D&&(T=We(_.slice(C[0].length),g[D],{...m,path:O+D}))}else if(D==="y"){const C=/^\d\d\b/.exec(_);if(C){const H=+C[0]>=30?+C[0]+1900:+C[0]+2e3;T=We(_.slice(C[0].length),g[D],{...m,year:H,path:O+D})}}else if(D==="Y"){const C=/^\d\d\d\d\b/.exec(_);C&&(T=We(_.slice(C[0].length),g[D],{...m,year:+C[0],path:O+D}))}else{if(D!=="x")throw new Error('Unknown date token "'.concat(D,'"'));{const C=Ye(_);C&&(T=We("",g[D],{...m,time:C.v,tf:C.z,path:O+D}))}}if(T)return T}}};function et(_,g){const m=We(_.trim(),F,{path:""});if(m){var O;if(m.sep==="."&&m.path.length===3)return null;const b=+((O=m.year)!==null&&O!==void 0?O:Ke);if(m.day||(m.day=1),!function(D,C,H){if(H<1||C<1||C>12)return!1;if(C===2){if(H>(D%4==0&&D%100!=0||D%400==0||D===1900?29:28))return!1}else if((C===4||C===6||C===9||C===11)&&H>30||(C===1||C===3||C===5||C===7||C===8||C===10||C===12)&&H>31)return!1;return!0}(b,m.month,m.day))return null;let N=-1/0;if(b<1900)return null;b<=1900&&m.month<=2?N=25568:b<1e4&&(N=25569);const T=Date.UTC(b,m.month-1,m.day)/864e5+N+(m.time||0);if(T>=0&&T<=2958465){const D=m._mon[0]==="0"||m.day[0]==="0"||m._mon.length===2&&m.day.length===2,C=m.path.replace(/[jdlDnmMFyYx-]/g,H=>H==="j"||H==="d"?D?"dd":"d":H==="D"?"ddd":H==="l"?"dddd":H==="n"||H==="m"?D?"mm":"m":H==="M"?"mmm":H==="F"?"mmmm":H==="y"?"yy":H==="x"?m.tf||"":H==="Y"?"yyyy":H);return g&&g.nativeDate?{v:He(T,g),z:C}:{v:T,z:C}}}return null}function Ye(_){const g=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(_);if(g){const[,m,O,b,N,T]=g;if(N&&!b||!T&&!O&&!b)return null;let D=1*(m||0);if(T){if(D>=13)return null;T[0]!=="p"&&T[0]!=="P"||(D+=12)}return{v:(60*D*60+60*(1*(O||0))+1*(b||0)+1*(N||0))/86400,z:(m.length===2?"hh":"h")+":mm"+(b?":ss":"")+(T?" AM/PM":"")}}return null}function ht(_){return/^\s*true\s*$/i.test(_)?{v:!0}:/^\s*false\s*$/i.test(_)?{v:!1}:null}const at={};function $t(_,g){const{pattern:m,partitions:O,locale:b}=_,N=C=>{const H=Object.assign({},M(),g,C);return b&&(H.locale=b),H},T=(C,H)=>{const ae=N(H);return function($,se,_e){const X=h(_e.locale),A=se[3]?se[3]:Re;if(typeof $=="boolean"&&($=$?"TRUE":"FALSE"),$==null)return"";if(typeof $!="number")return Z($,A,_e,X);if(!isFinite($)){const ce=X||f;return isNaN($)?ce.nan:($<0?ce.negative:"")+ce.infinity}const W=re($,se);return W?Z($,W,_e,X):_e.overflow}(Pe(C,ae),O,ae)};T.color=(C,H)=>function(ae,$){if(typeof ae!="number"||!isFinite(ae))return($[3]?$[3].color:Re.color)||ye;const se=re(ae,$);return se&&se.color||ye}(Pe(C,N(H)),O);const D=function(C){var H;let ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[$,se]=C,_e=$.frac_max,X={type:"general",isDate:S(C),isText:U(C),isPercent:Ze(C),maxDecimals:$.general?9:_e,scale:(H=$.scale)!==null&&H!==void 0?H:1,color:0,parentheses:0,grouped:$.grouping?1:0,_partitions:C},A=!X.isDate&&!X.isText&&!$.error&&$.tokens.some(xe=>xe.type==="string"&&(ae?xe.value===ae:x.test(xe.value)));let W="G",ce=_e>=0?Math.min(15,_e):"",ve="",De="";if(se&&se.color&&(De="-",X.color=1),$.parens&&(ve="()",X.parentheses=1),A)W="C",X.type="currency";else if($.error)X.type="error",X.maxDecimals=0;else if(X.isDate){let xe=0,je=0,ft="";$.tokens.forEach(le=>{const qe=le.type;/^(b-)?year/.test(qe)?(ft+="Y",je++):qe.startsWith("month")?(ft+="M",je++):/^(week)?day/.test(qe)?(ft+="D",je++):qe!=="hour"&&qe!=="min"&&qe!=="sec"&&qe!=="am"||(ft+=qe[0],xe++)}),X.type="date",je&&xe?X.type="datetime":!je&&xe&&(X.type="time");const _t=ne.find(le=>ft.startsWith(le[0]));W=_t?"D":"G",ce=_t?_t[1]:""}else X.isText?(W="G",X.type="text",ce="",X.maxDecimals=0):$.general?(W="G",X.type="general",ce=""):$.fractions?(W="G",X.type="fraction",ce=""):$.exponential?(W="S",X.type="scientific"):X.isPercent?(W="P",X.type="percent"):$.grouping?(W=",",X.type="grouped"):($.int_max||_e)&&(W="F",X.type="number");return X.code=W+ce+De+ve,X.level=Q[X.type],Object.freeze(X)}(O,(g||{}).currency)||new SyntaxError;return T.info=D,T.dateInfo=function(C){const[H]=C;return{year:!!(2&H.date),month:!!(4&H.date),day:!!(8&H.date),hours:!!(16&H.date),minutes:!!(32&H.date),seconds:!!(64&H.date),clockType:H.clock===12?12:24}}(O),T.isPercent=()=>!!D.isPercent,T.isDate=()=>!!D.isDate,T.isText=()=>!!D.isText,T.pattern=m,_.error&&(T.error=_.error),T.options=N,T.locale=b||g&&g.locale||"",Object.freeze(T)}function Ue(_,g){_||(_="General");let m=null;return at[_]?m=at[_]:(m=Object.assign({},M(),g).throws?ee(_):function(O){try{return ee(O)}catch(b){const N={tokens:[{type:"error"}],error:b.message};return{pattern:O,partitions:[N,N,N,N],error:b.message,locale:null}}}(_),m.error||(at[_]=m)),$t(m,g)}Ue.isDate=_=>Ue(_,{throws:!1}).isDate(),Ue.isPercent=_=>Ue(_,{throws:!1}).isPercent(),Ue.isText=_=>Ue(_,{throws:!1}).isText(),Ue.getInfo=(_,g)=>Ue(_,{...g,throws:!1}).info,Ue.getDateInfo=(_,g)=>Ue(_,{...g,throws:!1}).dateInfo,Ue.dateToSerial=Pe,Ue.dateFromSerial=He,Ue.options=M,Ue.dec2frac=E,Ue.round=p,Ue.codeToLocale=s,Ue.parseLocale=l,Ue.getLocale=h,Ue.addLocale=(_,g)=>{const m=l(g);return delete at[m.lang],delete at[m.language],d(_,m)},Ue.format=function(_,g,m){let O=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const b=m&&typeof m=="object"?m:{locale:m,throws:!O};return Ue(_,b)(Pe(g,b),b)},Ue.is_date=Ue.isDate,Ue.parseNumber=Rt,Ue.parseDate=et,Ue.parseTime=Ye,Ue.parseBool=ht,Ue.parseValue=function(_,g){var m,O,b;return(m=(O=(b=Rt(_))!==null&&b!==void 0?b:et(_,g))!==null&&O!==void 0?O:Ye(_))!==null&&m!==void 0?m:ht(_)};var dt=Ue;return r=r.default}()})})(Ul);var Dp=Ul.exports,Lp=Dp;const xp=yt(Lp),Up=xp;function Zt(e){let n=0;const t=Object.keys(e);for(const r of t){const s=Number(r);n=Math.max(n,s)}return n+1}function Ds(e,n,t){const r=Zt(t),s=t;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=n}function Ls(e,n,t){const r=Object.keys(t).reduce((s,i)=>Math.max(s,Number.parseInt(i)),0)+1;for(let s=e;s<r;s++)s<e+n?delete t[s]:t[s]!==void 0&&(t[s-n]=t[s],delete t[s])}function Pp(e,n){const t=e,r=Object.keys(t),s=r.length,i=n,o=Object.keys(i),a=o.length,l={};let c=0;for(let h=0;h<s;h++,c++){const u=r[h];l[c]=t[u]}for(let h=0;h<a;h++,c++){const u=o[h];l[c]=i[u]}return l}function kp(e,n,t){const r=t;if(Zt(t)>0){const i={};let o=0;for(let a=e;a<=n;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function xs(e,n,t,r){const s=e>t;if(!s&&e+n>t)throw new Error("Invalid move operation");s?Fp(e,n,t,r):$p(e,n,t,r)}function Fp(e,n,t,r){const s=r,i=[];for(let o=e;o<e+n;o++)i.push(s[o]);for(let o=e-1;o>=t;o--){const a=s[o];s[o+n]=a,a===void 0&&delete s[o+n]}i.forEach((o,a)=>{s[t+a]=o,o===void 0&&delete s[t+a]})}function $p(e,n,t,r){const s=r,i=[];for(let o=e;o<e+n;o++)i.push(s[o]);for(let o=e+n;o<t;o++){const a=s[o];s[o-n]=a,a===void 0&&delete s[o-n]}i.forEach((o,a)=>{s[t+a-n]=o,o===void 0&&delete s[t+a-n]})}class Pt{constructor(n={}){R(this,"_matrix");this._setOriginValue(n)}static MakeObjectMatrixSize(n){return new Pt({[n-1]:{}})}getMatrix(){return this._matrix}forEach(n){const t=this._matrix,r=Object.keys(t);for(const s of r){const i=Number(s),o=t[i];if(n(i,o)===!1)return this}return this}forRow(n){const t=this._matrix,r=Object.keys(t);for(const s of r){const i=Number(s),o=t[i];if(n(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(n){const t=this._matrix;for(const r in t){const s=Number(r),i=t[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(n(s,a,l)===!1)return this}}return this}swapRow(n,t){const r=this._matrix[n],s=this._matrix[t];this._matrix[n]=s,this._matrix[t]=r}getRow(n){return this._matrix[n]}getRowOrCreate(n){let t=this.getRow(n);return t==null&&(t={},this._matrix[n]=t),t}reset(){this._setOriginValue({})}hasValue(){const n=this._matrix,t=Object.keys(n);if(t.length===0)return!1;for(const r of t){const s=Number(r),i=n[s];if(Object.keys(i).length>0)return!0}return!1}getValue(n,t){var r,s;return(s=(r=this._matrix)==null?void 0:r[n])==null?void 0:s[t]}setValue(n,t,r){const s=this.getRowOrCreate(n);s[t]=r}deleteValue(n,t){var r,s;(s=(r=this._matrix)==null?void 0:r[n])==null||delete s[t]}realDeleteValue(n,t){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[n])==null||delete s[t],this.getRow(n)){const o=this.getRow(n);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[n])}}setRow(n,t){this._matrix[n]=t}moveRows(n,t,r){xs(n,t,r,this._matrix)}moveColumns(n,t,r){this.forEach((s,i)=>{xs(n,t,r,i)})}insertRows(n,t){for(let r=n;r<n+t;r++)Ds(r,{},this._matrix)}insertColumns(n,t){for(let r=n;r<n+t;r++)this.forEach((s,i)=>{i&&Ds(r,void 0,i)})}removeRows(n,t){Ls(n,t,this._matrix)}removeColumns(n,t){this.forEach((r,s)=>{s&&Ls(n,t,s)})}getFragment(n,t,r,s){const i=new Pt;let o=0;for(let a=n;a<=t;a++){const l={};let c=0;for(let h=r;h<=s;h++){const u=this.getValue(a,h);l[c]=u,c++}i.setRow(o,l),o++}return i}getSlice(n,t,r,s){const i=new Pt;for(let o=n;o<=t;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,G.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Zt(this._matrix)}getRange(){const r=this.getLength()-1;let s=0;const i=this.getLength();for(let o=0;o<i;o++){const a=this.getRow(o);if(a){const l=Zt(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}toNativeArray(){const n=new Array;return this.forValue((t,r,s)=>{n.push(s)}),n}toArray(){const n=[];return this.forRow((t,r)=>{n[t]==null&&(n[t]=[]),r.forEach(s=>{n[t][s]=this.getValue(t,s)})}),n}toFullArray(){const n=this.getRange(),{endColumn:t,endRow:r}=n,s=[];for(let i=0;i<=r;i++){const o=new Array(t+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const n=JSON.stringify(this._matrix);return JSON.parse(n)}getData(){const n=JSON.stringify(this._matrix);return JSON.parse(n)}getArrayData(){let n=0,t=0,r=!1,s=!1;const i=new Pt;return this.forEach((o,a)=>{r||(r=!0,n=o),Object.keys(a).forEach(l=>{const c=Number(l);s?c<t&&(t=c):(s=!0,t=c);const h=this.getValue(o,c);i.setValue(o-n,c-t,h)})}),i.getData()}getStartEndScope(){let n=1/0,t=-1/0,r=1/0,s=-1/0;const i=Object.keys(this._matrix);i.length>0&&(n=+i[0],t=+i[i.length-1]);for(const o of i){const a=Object.keys(this._matrix[o]);a.length>0&&(r=Math.min(r,+a[0]),s=Math.max(s,+a[a.length-1]))}return{startRow:n,endRow:t,startColumn:r,endColumn:s}}getDataRange(){let n=0,t=0,r=0,s=-1,i=!1,o=!1;return this.forEach((a,l)=>{if(i||(i=!0,n=a),l==null)return;const c=Zt(l)-1;c>r&&(r=c),Object.keys(l).forEach(h=>{const u=Number(h);o?u<t&&(t=u):(o=!0,t=u)}),a>s&&(s=a)}),{startRow:n,startColumn:t,endRow:s,endColumn:r}}getDiscreteRanges(){const n=[];return this.forEach((t,r)=>{Object.keys(r).forEach(s=>{const i=Number(s);let o=!1;for(const a of n)if(t>=a.startRow&&t<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(t,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||n.push({startRow:t,endRow:t,startColumn:i,endColumn:i})})}),n}merge(n){this.forValue((t,r)=>{const s=n.getValue(t,r);s!=null&&this.setValue(t,r,s)})}_setOriginValue(n={}){this._matrix=n}}const jp={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},Hp={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},Bp={startRow:0,startColumn:0,endRow:0,endColumn:0},Wp={row:0,column:0},ct={ff:"Arial",fs:11,it:Ae.FALSE,bl:Ae.FALSE,ul:{s:Ae.FALSE},st:{s:Ae.FALSE},ol:{s:Ae.FALSE},tr:{a:0,v:Ae.FALSE},td:er.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:Xt.UNSPECIFIED,vt:an.UNSPECIFIED,tb:cn.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null},Pl={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},Yp=[ri,ma,si];var kl=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(kl||{});function Rr(e,n){const{textRuns:t=[]}=n;let r=0;for(const i of t){const{ts:o={},st:a,ed:l}=i;if(o[e]==null)return Ae.FALSE;switch(e){case"bl":case"it":{if(o[e]===Ae.FALSE)return Ae.FALSE;break}case"ul":case"st":{if(o[e].s===Ae.FALSE)return Ae.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return n.dataStream.indexOf(`\r
7
+ `)===r?Ae.TRUE:Ae.FALSE}const Qn=class Qn{constructor(n,t,r){R(this,"_range");R(this,"_worksheet");this._deps=r,this._range=t,this._worksheet=n}static foreach(n,t){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=n;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)t(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=[];for(let o=n;o<=t;o++){const a=[];for(let l=r;l<=s;l++)a.push(this.getMatrix().getValue(o,l)||null);i.push(a)}return i}getMatrix(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new Pt;for(let a=n;a<=t;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new Pt;for(let a=n;a<=t;a++)for(let l=r;l<=s;l++)o.setValue(a-n,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=G.numToWord(r+1)+(n+1),o=G.numToWord(s+1)+(t+1)):(i=G.numToWord(s+1)+(t+1),o=G.numToWord(r+1)+(n+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>{var i;const s=n.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||ct.bg.rgb}))}getCell(n,t){const{startRow:r,startColumn:s}=this._range,i={startRow:r+n,endRow:r+n,startColumn:s+t,endColumn:s+t};return new Qn(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(n={}){return this.getObjectValues(n)[0][0]}getObjectValues(n={}){var a;const{startRow:t,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(t,r,s,i).getData();if(n.isIncludeStyle){const l=this._deps.getStyles();for(let c=0;c<=r-t;c++)for(let h=0;h<=i-s;h++){if(o==null||((a=o==null?void 0:o[c])==null?void 0:a[h])==null)continue;const u=o[c][h].s;u&&(o[c][h].s=l.get(u))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>{var i;const s=n.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||ct.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Rr("ul",n.body)===Ae.TRUE?{s:Ae.TRUE}:{s:Ae.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Rr("st",n.body)===Ae.TRUE?{s:Ae.TRUE}:{s:Ae.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var t,r;const n=((t=this.getValue())==null?void 0:t.p)||{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?n.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...n.body.textRuns.map(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)||0})):this.getFontSizes()[0][0]:this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Rr("it",n.body)===Ae.TRUE?Ur.ITALIC:Ur.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Rr("bl",n.body)===Ae.TRUE?Pr.BOLD:Pr.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:n,_worksheet:t}=this,{startRow:r,endRow:s}=n;let i=0;for(let o=0;o<=s-r;o++){const a=t.getRowHeight(o);i+=a}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:n,endColumn:t}=this._range;return t-n+1}getNumRows(){const{startRow:n,endRow:t}=this._range;return t-n+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(n=>n.map(t=>(t==null?void 0:t.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>n.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:n,_worksheet:t}=this,{startColumn:r,endColumn:s}=n;let i=0;for(let o=0;o<=s-r;o++)i+=t.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===cn.WRAP?Ae.TRUE:Ae.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(n){Qn.foreach(this._range,n)}_getStyles(n){const t=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=t&&t.getStyleByCell(s);return i&&i[n]||ct[n]}))}};R(Qn,"transformRange",(n,t)=>{const r=t.getMaxColumns()-1,s=t.getMaxRows()-1;return n.rangeType===we.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:n.rangeType===we.COLUMN?{startRow:0,endRow:s,startColumn:n.startColumn,endColumn:n.endColumn}:n.rangeType===we.ROW?{startColumn:0,endColumn:r,startRow:n.startRow,endRow:n.endRow}:{startColumn:n.startColumn,endColumn:Math.min(n.endColumn,r),startRow:n.startRow,endRow:Math.min(n.endRow,s)}});let Tn=Qn;function zp(e,n,t,r=!1){if(n===0&&t===0)return e;let s={...e};const i=s.startAbsoluteRefType||tt.NONE,o=s.endAbsoluteRefType||tt.NONE,a=s.rangeType||we.NORMAL;if(!r&&i===tt.ALL&&o===tt.ALL)return s;const l=Co(s.startRow,t,s.startColumn,n,a),c=Co(s.endRow,t,s.endColumn,n,a);return r||i===tt.NONE&&o===tt.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:c.row,endColumn:c.column}:(i===tt.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===tt.COLUMN?s={...s,startRow:l.row}:i===tt.ROW&&(s={...s,startColumn:l.column}),o===tt.NONE?s={...s,endRow:c.row,endColumn:c.column}:o===tt.COLUMN?s={...s,endRow:c.row}:o===tt.ROW&&(s={...s,endColumn:c.column}),s)}function Co(e,n,t,r,s){return s===we.NORMAL?{row:e+n,column:t+r}:s===we.ROW?{row:e+n,column:t}:s===we.COLUMN?{row:e,column:t+r}:{row:e,column:t}}function mi(e){const n=new Set,t=new Set;for(const o of e)n.add(o.startColumn),n.add(o.endColumn+1),t.add(o.startRow),t.add(o.endRow+1);const r=Array.from(n).sort((o,a)=>o-a),s=Array.from(t).sort((o,a)=>o-a);e.sort((o,a)=>o.startRow-a.startRow||o.startColumn-a.startColumn);const i=[];for(let o=0;o<s.length-1;o++)for(let a=0;a<r.length-1;a++){const l=r[a],c=r[a+1]-1,h=s[o],u=s[o+1]-1;for(const d of e){if(d.startRow>u)break;if(d.startRow<=h&&d.endRow>=u&&d.startColumn<=l&&d.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:h,endRow:u});break}}}return i}function Vp(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const n={};for(const r of e)n[r.startRow]||(n[r.startRow]=[]),n[r.startRow].push(r);const t=[];for(const r in n){const s=n[+r];s.sort((o,a)=>o.startColumn-a.startColumn);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startColumn<=i.endColumn+1&&a.startRow===i.startRow&&a.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,a.endColumn):(t.push(i),i=a)}t.push(i)}return t}function Gp(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const n={};for(const r of e)n[r.startColumn]||(n[r.startColumn]=[]),n[r.startColumn].push(r);const t=[];for(const r in n){const s=n[+r];s.sort((o,a)=>o.startRow-a.startRow);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startRow<=i.endRow+1&&a.startColumn===i.startColumn&&a.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,a.endRow):(t.push(i),i=a)}t.push(i)}return t}function Kp(e){const n=mi(e),t=Vp(n);return Gp(t)}function Xp(e,n){const t=[];return e.forEach(r=>{t.push(...en.subtract(r,n))}),en.mergeRanges(t)}function Qp(e,n){const t=Ro(e.startRow,e.endRow,n.startRow,n.endRow),r=Ro(e.startColumn,e.endColumn,n.startColumn,n.endColumn);if(!t||!r)return null;const[s,i]=t,[o,a]=r,l=Jp(e.rangeType,n.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function Ro(e,n,t,r){const s=isNaN(e)?-1/0:e,i=isNaN(n)?1/0:n,o=isNaN(t)?-1/0:t,a=isNaN(r)?1/0:r,l=Math.max(s,o),c=Math.min(i,a);if(l<=c){const h=l===-1/0?Number.NaN:l,u=c===1/0?Number.NaN:c;return[h,u]}else return null}function Jp(e,n,t,r,s,i){const o=e!==void 0?e:vo(t,r,s,i),a=n!==void 0?n:vo(t,r,s,i);return o===we.ALL||a===we.ALL?o===a?o:o===we.ALL?a:o:o===a?o:(o===we.NORMAL||a===we.NORMAL,we.NORMAL)}function vo(e,n,t,r){const s=!isNaN(e)&&!isNaN(n),i=!isNaN(t)&&!isNaN(r);return s&&i?we.NORMAL:s?we.ROW:i?we.COLUMN:we.ALL}const Ht=class Ht{static clone(n){return n.rangeType!==void 0?{startRow:n.startRow,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn,rangeType:n.rangeType}:{startRow:n.startRow,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn}}static equals(n,t){return n==null||t==null?!1:n.endRow===t.endRow&&n.endColumn===t.endColumn&&n.startRow===t.startRow&&n.startColumn===t.startColumn&&(n.rangeType===t.rangeType||n.rangeType===void 0&&t.rangeType===we.NORMAL||t.rangeType===void 0&&n.rangeType===we.NORMAL)}static simpleRangesIntersect(n,t){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=n,{startRow:a,endRow:l,startColumn:c,endColumn:h}=t,u=r<=l&&s>=a,d=i<=h&&o>=c;return u&&d}static intersects(n,t){if(n.rangeType===we.ROW&&t.rangeType===we.COLUMN||n.rangeType===we.COLUMN&&t.rangeType===we.ROW)return!0;if(n.rangeType===we.ROW&&t.rangeType===we.ROW)return n.startRow<=t.endRow&&n.endRow>=t.startRow;if(n.rangeType===we.COLUMN&&t.rangeType===we.COLUMN)return n.startColumn<=t.endColumn&&n.endColumn>=t.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(n.startRow)?0:n.startRow,i=Number.isNaN(n.endRow)?r:n.endRow,o=Number.isNaN(n.startColumn)?0:n.startColumn,a=Number.isNaN(n.endColumn)?r:n.endColumn,l=Number.isNaN(t.startRow)?0:t.startRow,c=Number.isNaN(t.endRow)?r:t.endRow,h=Number.isNaN(t.startColumn)?0:t.startColumn,u=Number.isNaN(t.endColumn)?r:t.endColumn,d=Math.abs(o+a-h-u),f=Math.abs(o-a)+Math.abs(h-u),p=Math.abs(s+i-l-c),E=Math.abs(s-i)+Math.abs(l-c);return d<=f&&p<=E}static getIntersects(n,t){const r=n.startRow,s=n.endRow,i=n.startColumn,o=n.endColumn,a=t.startRow,l=t.endRow,c=t.startColumn,h=t.endColumn;let u,d,f,p;if(a<=s)a>=r?d=a:d=r;else return null;if(l>=r)l>=s?p=s:p=l;else return null;if(c<=o)c>i?u=c:u=i;else return null;if(h>=i)h>=o?f=o:f=h;else return null;return{startRow:d,endRow:p,startColumn:u,endColumn:f,rangeType:we.NORMAL}}static contains(n,t){return n.startRow<=t.startRow&&n.endRow>=t.endRow&&n.startColumn<=t.startColumn&&n.endColumn>=t.endColumn}static realContain(n,t){return Ht.contains(n,t)&&(n.startRow<t.startRow||n.endRow>t.endRow||n.startColumn<t.startColumn||n.endColumn>t.endColumn)}static union(...n){return n.reduce((t,r)=>({startRow:Math.min(t.startRow,r.startRow),startColumn:Math.min(t.startColumn,r.startColumn),endRow:Math.max(t.endRow,r.endRow),endColumn:Math.max(t.endColumn,r.endColumn),rangeType:we.NORMAL}),n[0])}static realUnion(...n){const t=n.some(i=>i.rangeType===we.COLUMN),r=n.some(i=>i.rangeType===we.ROW),s=Ht.union(...n);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:t?Number.NaN:s.startRow,endRow:t?Number.NaN:s.endRow,rangeType:r?we.ROW:t?we.COLUMN:we.NORMAL}}static subtract(n,t){if(t.startRow>n.endRow||t.endRow<n.startRow||t.startColumn>n.endColumn||t.endColumn<n.startColumn)return[n];const r=[];t.startRow>=n.startRow&&r.push({startRow:n.startRow,startColumn:n.startColumn,endRow:t.startRow-1,endColumn:n.endColumn}),t.endRow<=n.endRow&&r.push({startRow:t.endRow+1,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn});const s=Math.max(n.startRow,t.startRow),i=Math.min(n.endRow,t.endRow);return t.startColumn>=n.startColumn&&r.push({startRow:s,startColumn:n.startColumn,endRow:i,endColumn:t.startColumn-1}),t.endColumn<=n.endColumn&&r.push({startRow:s,startColumn:t.endColumn+1,endRow:i,endColumn:n.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(n){return Kp(n)}static splitIntoGrid(n){return mi(n)}static subtractMulti(n,t){if(!t.length)return n;let r=n;return t.forEach(s=>{r=Xp(r,s)}),r}static hasIntersectionBetweenTwoRect(n,t){return!(n.left>t.right||n.right<t.left||n.top>t.bottom||n.bottom<t.top)}static getIntersectionBetweenTwoRect(n,t){const r=Math.max(n.left,t.left),s=Math.min(n.right,t.right),i=Math.max(n.top,t.top),o=Math.min(n.bottom,t.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(n){return n.sort((t,r)=>t.startRow-r.startRow||t.startColumn-r.startColumn)}};R(Ht,"getRelativeRange",(n,t)=>({startRow:n.startRow-t.startRow,endRow:n.endRow-n.startRow,startColumn:n.startColumn-t.startColumn,endColumn:n.endColumn-n.startColumn})),R(Ht,"getPositionRange",(n,t,r)=>({...r||{},startRow:r&&[tt.ROW,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:n.startRow+t.startRow,endRow:r&&[tt.ROW,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:n.endRow+n.startRow+t.startRow,startColumn:r&&[tt.COLUMN,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:n.startColumn+t.startColumn,endColumn:r&&[tt.COLUMN,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:n.endColumn+n.startColumn+t.startColumn})),R(Ht,"moveHorizontal",(n,t=0,r=0)=>({...n,startColumn:n.startColumn+t,endColumn:n.endColumn+t+r})),R(Ht,"moveVertical",(n,t=0,r=0)=>({...n,startRow:n.startRow+t,endRow:n.endRow+t+r})),R(Ht,"moveOffset",(n,t,r)=>({...n,startRow:n.startRow+r,endRow:n.endRow+r,startColumn:n.startColumn+t,endColumn:n.endColumn+t}));let en=Ht;function Zp(e,n){if(e.length===0||e[0].length===0)return null;const t=new Array(e[0].length).fill(0);let r=0,s=null;for(let i=0;i<e.length;i++){for(let a=0;a<e[0].length;a++)t[a]=n(e[i][a])?t[a]+1:0;const o=qp(t);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function qp(e){const n=[];let t=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(n.length===0||e[s]>=e[n[n.length-1]])n.push(s++);else{const i=e[n.pop()],o=n.length===0?s:s-n[n.length-1]-1;i*o>t&&(t=i*o,r={area:t,height:i,start:n.length===0?0:n[n.length-1]+1,end:s-1})}for(;n.length>0;){const i=e[n.pop()],o=n.length===0?s:s-n[n.length-1]-1;i*o>t&&(t=i*o,r={area:t,height:i,start:n.length===0?0:n[n.length-1]+1,end:s-1})}return r}function e_(e,n){Tn.foreach(n,(t,r)=>{e[t][r]=void 0})}function t_(e,n){const t=e.toFullArray(),r=[];for(;;){const s=Zp(t,n);if(!s)break;r.push(s),e_(t,s)}return r}class n_{constructor(n,t){R(this,"_values",[]);R(this,"_keys",[]);R(this,"_keyMaps",new Map);this._values=n,this._keys=t,n.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(n){this._keys.forEach(t=>{const r=n[t],s=this._keyMaps.get(t)||new Map;s.set(r,n),this._keyMaps.set(t,s)})}getValue(n,t){const r=t||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(n))return i.get(n)}return null}hasValue(n){for(let t=0;t<this._keys.length;t++){const r=this._keyMaps.get(this._keys[t]);if(r!=null&&r.has(n))return!0}return!1}addValue(n){this._values.push(n),this._initKeyMap(n)}setValue(n,t,r){const s=this.getValue(n);s&&Object.keys(s).includes(t)&&(s[t]=r)}deleteValue(n,t){const r=this.getValue(n,t);if(r){this._keys.forEach(i=>{const o=this._keyMaps.get(i),a=r[i];o==null||o.delete(a)});const s=this._values.findIndex(i=>i===r);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(n){var t;return[...((t=this._keyMaps.get(n))==null?void 0:t.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function Us(e,n,t,r){return{forEach(s){for(let i=e;i<=n;i++)for(let o=t;o<=r;o++)s(i,o)}}}function r_(e){if(e==null||e.length===0)return Number.NaN;const n=e.toLowerCase().split(""),t=n.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<t;o++)i=r(n[o]),s+=i*26**(t-o-1);return s===0?Number.NaN:s-1}const jr=65,Fl=90,s_=97;function i_(e){const n=Fl-jr+1;let t="";for(;e>=0;)t=String.fromCharCode(e%n+jr)+t,e=Math.floor(e/n)-1;return t}function $l(e,n){let t="";for(;n>0;)t+=e,n--;return t}function o_(e,n=!1){const t=Fl-jr+1;let r=s_;n&&(r=jr);const s=String.fromCharCode(e%t+r),i=Math.floor(e/t)+1;return $l(s,i)}function a_(e,n){return e.zIndex>n.zIndex?1:e.zIndex===n.zIndex?0:-1}function l_(e,n){return e.zIndex>n.zIndex?-1:e.zIndex===n.zIndex?0:1}function dr(e="index",n=1){return(t,r)=>t[e]>r[e]?n:t[e]===r[e]?0:-n}var ke=(e=>(e[e.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",e[e.UNIVER_DOC=1]="UNIVER_DOC",e[e.UNIVER_SHEET=2]="UNIVER_SHEET",e[e.UNIVER_SLIDE=3]="UNIVER_SLIDE",e[e.UNIVER_PROJECT=4]="UNIVER_PROJECT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(ke||{}),xt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(xt||{}),Ps=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Ps||{});class es extends rt{}function u_(e=G.generateRandomId(6),n=hr.EN_US,t=""){return{id:e,locale:n,title:t,body:{dataStream:`\r
8
+ `,textRuns:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},marginTop:50,marginBottom:50,marginRight:40,marginLeft:40,renderConfig:{vertexAngle:0,centerAngle:0}},settings:{}}}var mt={},jl={},pi={};Object.defineProperty(pi,"__esModule",{value:!0});function c_(e,n){if(Array.isArray(n))return!1;for(let t in e)if(!_i(e[t],n[t]))return!1;for(let t in n)if(e[t]===void 0)return!1;return!0}function h_(e,n){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!_i(e[t],n[t]))return!1;return!0}function _i(e,n){return e===n?!0:e===null||n===null||typeof e!="object"||typeof n!="object"?!1:Array.isArray(e)?h_(e,n):c_(e,n)}pi.default=_i;var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});function ks(e){if(e===null)return null;if(Array.isArray(e))return e.map(ks);if(typeof e=="object"){const n={};for(let t in e)n[t]=ks(e[t]);return n}else return e}Ei.default=ks;var Ci={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.eachChildOf=e.advancer=e.readCursor=e.writeCursor=e.WriteCursor=e.ReadCursor=e.isValidPathItem=void 0;function n(h,u){if(!h)throw new Error(u)}const t=h=>h!=null&&typeof h=="object"&&!Array.isArray(h),r=(h,u)=>typeof h==typeof u?h>u:typeof h=="string"&&typeof u=="number";function s(h,u){for(let d in h){const f=d;u.write(f,h[f])}}e.isValidPathItem=h=>typeof h=="number"||typeof h=="string"&&h!=="__proto__";class i{constructor(u=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=u}ascend(){n(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):(n(this.idx>0),this.idx--,t(this.container[this.idx])&&this.idx--)}getPath(){const u=[];let d=this.container,f=this.parents.length-1,p=this.idx;for(;p>=0;)u.unshift(d[p]),p===0?(p=this.indexes[f*2],d=this.parents[f--]):p-=t(d[p-1])?2:1;return u}}class o extends i{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return n(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let u;return this.container&&this.container.length>this.idx+1&&t(u=this.container[this.idx+1])?u:null}descendFirst(){let u=this.idx+1;if(!this.container||u>=this.container.length||t(this.container[u])&&u+1>=this.container.length)return!1;t(this.container[u])&&u++;const d=this.container[u];return Array.isArray(d)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(u),this.idx=0,this.container=d):this.idx=u,!0}nextSibling(){if(n(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const u=this.indexes[this.indexes.length-1]+1,d=this.parents[this.parents.length-1];return u>=d.length?!1:(n(!isNaN(u)),this.indexes[this.indexes.length-1]=u,this.container=d[u],!0)}_init(u,d,f,p){this.container=u,this.idx=d,this.parents=f.slice(),this.indexes=p.slice()}clone(){const u=new o;return u._init(this.container,this.idx,this.parents,this.indexes),u}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(u,d){const f=this.getComponent();f&&d(f,u);for(const p of this)u&&u.descend(p),this.traverse(u,d),u&&u.ascend()}eachPick(u,d){this.traverse(u,(f,p)=>{f.p!=null&&d(f.p,p)})}eachDrop(u,d){this.traverse(u,(f,p)=>{f.d!=null&&d(f.d,p)})}}e.ReadCursor=o;class a extends i{constructor(u=null){super(u),this.pendingDescent=[],this._op=u}flushDescent(){n(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let u=0;u<this.pendingDescent.length;u++){const d=this.pendingDescent[u];let f=this.idx+1;if(f<this.container.length&&t(this.container[f])&&f++,n(f===this.container.length||!t(this.container[f])),f===this.container.length)this.container.push(d),this.idx=f;else if(this.container[f]===d)this.idx=f;else{if(!Array.isArray(this.container[f])){const p=this.container.splice(f,this.container.length-f);this.container.push(p),this.lcIdx>-1&&(this.lcIdx=f)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(n(r(d,this.container[this.lcIdx][0])),f=this.lcIdx+1,this.lcIdx=-1);f<this.container.length&&r(d,this.container[f][0]);)f++;if(this.indexes.push(f),this.idx=0,f<this.container.length&&this.container[f][0]===d)this.container=this.container[f];else{const p=[d];this.container.splice(f,0,p),this.container=p}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const u=this.idx+1;if(u<this.container.length&&t(this.container[u]))return this.container[u];{const d={};return this.container.splice(u,0,d),d}}write(u,d){const f=this.getComponent();n(f[u]==null||f[u]===d,"Internal consistency error: Overwritten component. File a bug"),f[u]=d}get(){return this._op}descend(u){if(!e.isValidPathItem(u))throw Error("Invalid JSON key");this.pendingDescent.push(u)}descendPath(u){return this.pendingDescent.push(...u),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(u,d=s){if(u===null)return;if(n(Array.isArray(u)),u===this._op)throw Error("Cannot merge into my own tree");const f=this.lcIdx,p=this.parents.length;let E=0;for(let v=0;v<u.length;v++){const I=u[v];typeof I=="string"||typeof I=="number"?(E++,this.descend(I)):Array.isArray(I)?this.mergeTree(I,d):typeof I=="object"&&d(I,this)}for(;E--;)this.ascend();this.lcIdx=this.parents.length===p?f:-1}at(u,d){this.descendPath(u),d(this);for(let f=0;f<u.length;f++)this.ascend();return this}writeAtPath(u,d,f){return this.at(u,()=>this.write(d,f)),this.reset(),this}writeMove(u,d,f=0){return this.writeAtPath(u,"p",f).writeAtPath(d,"d",f)}getPath(){const u=super.getPath();return u.push(...this.pendingDescent),u}}e.WriteCursor=a,e.writeCursor=()=>new a,e.readCursor=h=>new o(h);function l(h,u,d){let f,p;p=f=h?h.descendFirst():!1;function E(v){let I;for(;p;){const M=I=h.getKey();if(v!=null){let L=!1;if(u&&typeof M=="number"&&(I=u(M,h.getComponent()),I<0&&(I=~I,L=!0)),r(I,v))return null;if(I===v&&!L)return h}d&&typeof I=="number"&&d(I,h.getComponent()),p=h.nextSibling()}return null}return E.end=()=>{f&&h.ascend()},E}e.advancer=l;function c(h,u,d){let f,p,E,v;for(f=p=h&&h.descendFirst(),E=v=u&&u.descendFirst();f||E;){let I=f?h.getKey():null,M=E?u.getKey():null;I!==null&&M!==null&&(r(M,I)?M=null:I!==M&&(I=null)),d(I==null?M:I,I!=null?h:null,M!=null?u:null),I!=null&&f&&(f=h.nextSibling()),M!=null&&E&&(E=u.nextSibling())}p&&h.ascend(),v&&u.ascend()}e.eachChildOf=c})(Ci);var Ri={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,function(n){n[n.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",n[n.DROP_COLLISION=2]="DROP_COLLISION",n[n.BLACKHOLE=3]="BLACKHOLE"}(e.ConflictType||(e.ConflictType={}))})(Ri);var us={},on={},Io;function vi(){return Io||(Io=1,Object.defineProperty(on,"__esModule",{value:!0}),on.uniToStrPos=on.strPosToUni=void 0,on.strPosToUni=(e,n=e.length)=>{let t=0,r=0;for(;r<n;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(t++,r++)}if(r!==n)throw Error("Invalid offset - splits unicode bytes");return r-t},on.uniToStrPos=(e,n)=>{let t=0;for(;n>0;n--){const r=e.charCodeAt(t);t+=r>=55296&&r<=57343?2:1}return t}),on}var cs={},So;function Fs(){return So||(So=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const n=vi(),t=y=>{if(!Array.isArray(y))throw Error("Op must be an array of components");let w=null;for(let x=0;x<y.length;x++){const B=y[x];switch(typeof B){case"object":if(typeof B.d!="number"&&typeof B.d!="string")throw Error("Delete must be number or string");if(e.dlen(B.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(B.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(B>0))throw Error("Skip components must be >0");if(typeof w=="number")throw Error("Adjacent skip components should be combined");break}w=B}if(typeof w=="number")throw Error("Op has a trailing skip")};function r(y,w){let x=0,B=0;for(let ue=0;ue<y.length;ue++){const q=y[ue];switch(w(q,x,B),typeof q){case"object":x+=e.dlen(q.d);break;case"string":B+=n.strPosToUni(q);break;case"number":x+=q,B+=q;break}}}e.eachOp=r;function s(y,w){const x=[],B=a(x);return r(y,(ue,q,oe)=>{B(w(ue,q,oe))}),u(x)}const i=y=>y,o=y=>s(y,i);e.dlen=y=>typeof y=="number"?y:n.strPosToUni(y);const a=y=>w=>{if(!(!w||w.d===0||w.d===""))if(y.length===0)y.push(w);else if(typeof w==typeof y[y.length-1])if(typeof w=="object"){const x=y[y.length-1];x.d=typeof x.d=="string"&&typeof w.d=="string"?x.d+w.d:e.dlen(x.d)+e.dlen(w.d)}else y[y.length-1]+=w;else y.push(w)},l=y=>typeof y=="number"?y:typeof y=="string"?n.strPosToUni(y):typeof y.d=="number"?y.d:n.strPosToUni(y.d);e.uniSlice=(y,w,x)=>{const B=n.uniToStrPos(y,w),ue=x==null?1/0:n.uniToStrPos(y,x);return y.slice(B,ue)};const c=(y,w,x)=>typeof y=="number"?x==null?y-w:Math.min(y,x)-w:e.uniSlice(y,w,x),h=y=>{let w=0,x=0;return{take:(q,oe)=>{if(w===y.length)return q===-1?null:q;const be=y[w];let Te;if(typeof be=="number")return q===-1||be-x<=q?(Te=be-x,++w,x=0,Te):(x+=q,q);if(typeof be=="string"){if(q===-1||oe==="i"||n.strPosToUni(be.slice(x))<=q)return Te=be.slice(x),++w,x=0,Te;{const ee=x+n.uniToStrPos(be.slice(x),q);return Te=be.slice(x,ee),x=ee,Te}}else{if(q===-1||oe==="d"||e.dlen(be.d)-x<=q)return Te={d:c(be.d,x)},++w,x=0,Te;{let ee=c(be.d,x,x+q);return x+=q,{d:ee}}}},peek:()=>y[w]}},u=y=>(y.length>0&&typeof y[y.length-1]=="number"&&y.pop(),y);function d(y,w,x){if(x!=="left"&&x!=="right")throw Error("side ("+x+") must be 'left' or 'right'");t(y),t(w);const B=[],ue=a(B),{take:q,peek:oe}=h(y);for(let Te=0;Te<w.length;Te++){const ee=w[Te];let k,z;switch(typeof ee){case"number":for(k=ee;k>0;)z=q(k,"i"),ue(z),typeof z!="string"&&(k-=l(z));break;case"string":x==="left"&&typeof oe()=="string"&&ue(q(-1)),ue(n.strPosToUni(ee));break;case"object":for(k=e.dlen(ee.d);k>0;)switch(z=q(k,"i"),typeof z){case"number":k-=z;break;case"string":ue(z);break;case"object":k-=e.dlen(z.d)}break}}let be;for(;be=q(-1);)ue(be);return u(B)}function f(y,w){t(y),t(w);const x=[],B=a(x),{take:ue}=h(y);for(let oe=0;oe<w.length;oe++){const be=w[oe];let Te,ee;switch(typeof be){case"number":for(Te=be;Te>0;)ee=ue(Te,"d"),B(ee),typeof ee!="object"&&(Te-=l(ee));break;case"string":B(be);break;case"object":Te=e.dlen(be.d);let k=0;for(;k<Te;)switch(ee=ue(Te-k,"d"),typeof ee){case"number":B({d:c(be.d,k,k+ee)}),k+=ee;break;case"string":k+=n.strPosToUni(ee);break;case"object":B(ee)}break}}let q;for(;q=ue(-1);)B(q);return u(x)}const p=(y,w)=>{let x=0;for(let B=0;B<w.length&&y>x;B++){const ue=w[B];switch(typeof ue){case"number":{x+=ue;break}case"string":const q=n.strPosToUni(ue);x+=q,y+=q;break;case"object":y-=Math.min(e.dlen(ue.d),y-x);break}}return y},E=(y,w)=>typeof y=="number"?p(y,w):y.map(x=>p(x,w));function v(y,w,x){return s(y,(B,ue)=>typeof B=="object"&&typeof B.d=="number"?{d:x.slice(w,ue,ue+B.d)}:B)}function I(y){return s(y,w=>{switch(typeof w){case"object":if(typeof w.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return w.d;case"string":return{d:w};case"number":return w}})}function M(y){return s(y,w=>typeof w=="object"&&typeof w.d=="string"?{d:n.strPosToUni(w.d)}:w)}function L(y){let w=!0;return r(y,x=>{typeof x=="object"&&typeof x.d=="number"&&(w=!1)}),w}function j(y){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:u,normalize:o,checkOp:t,create(w=""){if(typeof w!="string")throw Error("Initial data must be a string");return y.create(w)},apply(w,x){t(x);const B=y.builder(w);for(let ue=0;ue<x.length;ue++){const q=x[ue];switch(typeof q){case"number":B.skip(q);break;case"string":B.append(q);break;case"object":B.del(e.dlen(q.d));break}}return B.build()},transform:d,compose:f,transformPosition:p,transformSelection:E,isInvertible:L,makeInvertible(w,x){return v(w,x,y)},stripInvertible:M,invert:I,invertWithDoc(w,x){return I(v(w,x,y))},isNoop:w=>w.length===0}}e.default=j}(cs)),cs}var vr={},Oo;function d_(){if(Oo)return vr;Oo=1,Object.defineProperty(vr,"__esModule",{value:!0});const e=Fs(),n=vi();function t(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=n.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=n.strPosToUni(r(),i);return s([l,{d:o}],a)},_onOp(i){e.eachOp(i,(o,a,l)=>{switch(typeof o){case"string":this.onInsert&&this.onInsert(l,o);break;case"object":const c=e.dlen(o.d);this.onRemove&&this.onRemove(l,c)}})},onInsert:null,onRemove:null}}return vr.default=t,t.provides={text:!0},vr}var yo;function f_(){return yo||(yo=1,function(e){var n=Qe&&Qe.__createBinding||(Object.create?function(d,f,p,E){E===void 0&&(E=p),Object.defineProperty(d,E,{enumerable:!0,get:function(){return f[p]}})}:function(d,f,p,E){E===void 0&&(E=p),d[E]=f[p]}),t=Qe&&Qe.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=Qe&&Qe.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var p in d)Object.hasOwnProperty.call(d,p)&&n(f,d,p);return t(f,d),f},s=Qe&&Qe.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=vi(),o=r(Fs()),a=s(d_()),l={create(d){return d},toString(d){return d},builder(d){if(typeof d!="string")throw Error("Invalid document snapshot: "+d);const f=[];return{skip(p){let E=i.uniToStrPos(d,p);if(E>d.length)throw Error("The op is too long for this document");f.push(d.slice(0,E)),d=d.slice(E)},append(p){f.push(p)},del(p){d=d.slice(i.uniToStrPos(d,p))},build(){return f.join("")+d}}},slice:o.uniSlice},c=o.default(l),h=Object.assign(Object.assign({},c),{api:a.default});e.type=h,e.insert=(d,f)=>f.length===0?[]:d===0?[f]:[d,f],e.remove=(d,f)=>o.dlen(f)===0?[]:d===0?[{d:f}]:[d,{d:f}];var u=Fs();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return u.default}})}(us)),us}(function(e){var n=Qe&&Qe.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const t=n(pi),r=n(Ei),s=Ci,i=Ri;function o(S,U){if(!S)throw new Error(U)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:S=>S,isNoop:S=>S==null,setDebug(S){},registerSubtype:I,checkValidOp:ue,normalize:q,apply:oe,transformPosition:be,compose:Te,tryTransform:Ce,transform:Ne,makeInvertible:z,invert:ee,invertWithDoc:me,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(S,U,Q)=>Ze(()=>!0,S,U,Q),typeAllowingConflictsPred:S=>Object.assign(Object.assign({},e.type),{transform:(U,Q,ne)=>Ze(S,U,Q,ne)})};const a=S=>S?S.getComponent():null;function l(S){return S&&typeof S=="object"&&!Array.isArray(S)}const c=S=>Array.isArray(S)?S.slice():S!==null&&typeof S=="object"?Object.assign({},S):S,h=S=>S&&(S.p!=null||S.r!==void 0),u=S=>S&&(S.d!=null||S.i!==void 0);function d(S,U){return o(S!=null),typeof U=="number"?(o(Array.isArray(S),"Invalid key - child is not an array"),(S=S.slice()).splice(U,1)):(o(l(S),"Invalid key - child is not an object"),delete(S=Object.assign({},S))[U]),S}function f(S,U,Q){return typeof U=="number"?(o(S!=null,"Container is missing for key"),o(Array.isArray(S),"Cannot use numerical key for object container"),o(S.length>=U,"Cannot insert into out of bounds index"),S.splice(U,0,Q)):(o(l(S),"Cannot insert into missing item"),o(S[U]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),S[U]=Q),Q}e.removeOp=(S,U=!0)=>s.writeCursor().writeAtPath(S,"r",U).get(),e.moveOp=(S,U)=>s.writeCursor().writeMove(S,U).get(),e.insertOp=(S,U)=>s.writeCursor().writeAtPath(S,"i",U).get(),e.replaceOp=(S,U,Q)=>s.writeCursor().at(S,ne=>{ne.write("r",U),ne.write("i",Q)}).get(),e.editOp=(S,U,Q,ne=!1)=>s.writeCursor().at(S,K=>w(K,U,Q,ne)).get();const p=(S,U)=>S!=null&&(typeof U=="number"?Array.isArray(S):typeof S=="object"),E=(S,U)=>p(S,U)?S[U]:void 0,v={};function I(S){let U=S.type?S.type:S;U.name&&(v[U.name]=U),U.uri&&(v[U.uri]=U)}const M=S=>{const U=v[S];if(U)return U;throw Error("Missing type: "+S)};I(f_());const L=(S,U)=>S+U;I({name:"number",apply:L,compose:L,invert:S=>-S,transform:S=>S});const j=S=>S==null?null:S.et?M(S.et):S.es?v["text-unicode"]:S.ena!=null?v.number:null,y=S=>S.es?S.es:S.ena!=null?S.ena:S.e,w=(S,U,Q,ne=!1)=>{const[K,V]=typeof U=="string"?[M(U),U]:[U,U.name];!ne&&K.isNoop&&K.isNoop(Q)||(V==="number"?S.write("ena",Q):V==="text-unicode"?S.write("es",Q):(S.write("et",V),S.write("e",Q)))};function x(S){o(typeof S=="number"),o(S>=0),o(S===(0|S))}function B(S){typeof S=="number"?x(S):o(typeof S=="string")}function ue(S){if(S===null)return;const U=new Set,Q=new Set,ne=V=>{let fe=!0,de=!1;for(let P in V){const J=V[P];if(fe=!1,o(P==="p"||P==="r"||P==="d"||P==="i"||P==="e"||P==="es"||P==="ena"||P==="et","Invalid component item '"+P+"'"),P==="p")x(J),o(!U.has(J)),U.add(J),o(V.r===void 0);else if(P==="d")x(J),o(!Q.has(J)),Q.add(J),o(V.i===void 0);else if(P==="e"||P==="es"||P==="ena"){o(!de),de=!0;const Z=j(V);o(Z,"Missing type in edit"),Z.checkValidOp&&Z.checkValidOp(y(V))}}o(!fe)},K=(V,fe,de)=>{if(!Array.isArray(V))throw Error("Op must be null or a list");if(V.length===0)throw Error("Empty descent");fe||B(V[0]);let P=1,J=0,Z=0;for(let re=0;re<V.length;re++){const Re=V[re];if(o(Re!=null),Array.isArray(Re)){const ye=K(Re,!1);if(J){const F=typeof Z,he=typeof ye;F===he?o(Z<ye,"descent keys are not in order"):o(F==="number"&&he==="string")}Z=ye,J++,P=3}else typeof Re=="object"?(o(P===1,`Prev not scalar - instead ${P}`),ne(Re),P=2):(o(P!==3),B(Re),o(s.isValidPathItem(Re),"Invalid path key"),P=1)}return o(J!==1,"Operation makes multiple descents. Remove some []"),o(P===2||P===3),V[0]};K(S,!0),o(U.size===Q.size,"Mismatched picks and drops in op");for(let V=0;V<U.size;V++)o(U.has(V)),o(Q.has(V))}function q(S){let U=0,Q=[];const ne=s.writeCursor();return ne.mergeTree(S,(K,V)=>{const fe=j(K);if(fe){const P=y(K);w(V,fe,fe.normalize?fe.normalize(P):P)}for(const P of["r","p","i","d"])if(K[P]!==void 0){const J=P==="p"||P==="d"?(de=K[P],Q[de]==null&&(Q[de]=U++),Q[de]):K[P];V.write(P,J)}var de}),ne.get()}function oe(S,U){if(ue(U),U===null)return S;const Q=[];return function ne(K,V){let fe=K,de=0,P={root:K},J=0,Z=P,re="root";function Re(){for(;J<de;J++){let ye=V[J];typeof ye!="object"&&(o(p(Z,re)),Z=Z[re]=c(Z[re]),re=ye)}}for(;de<V.length;de++){const ye=V[de];if(Array.isArray(ye)){const F=ne(fe,ye);F!==fe&&F!==void 0&&(Re(),fe=Z[re]=F)}else if(typeof ye=="object"){ye.d!=null?(Re(),fe=f(Z,re,Q[ye.d])):ye.i!==void 0&&(Re(),fe=f(Z,re,ye.i));const F=j(ye);if(F)Re(),fe=Z[re]=F.apply(fe,y(ye));else if(ye.e!==void 0)throw Error("Subtype "+ye.et+" undefined")}else fe=E(fe,ye)}return P.root}(S=function ne(K,V){const fe=[];let de=0;for(;de<V.length;de++){const re=V[de];if(Array.isArray(re))break;typeof re!="object"&&(fe.push(K),K=E(K,re))}for(let re=V.length-1;re>=de;re--)K=ne(K,V[re]);for(--de;de>=0;de--){const re=V[de];if(typeof re!="object"){const Re=fe.pop();K=K===E(Re,re)?Re:K===void 0?d(Re,re):(J=re,Z=K,(P=c(P=Re))[J]=Z,P)}else h(re)&&(o(K!==void 0,"Cannot pick up or remove undefined"),re.p!=null&&(Q[re.p]=K),K=void 0)}var P,J,Z;return K}(S,U),U)}function be(S,U){S=S.slice(),ue(U);const Q=s.readCursor(U);let ne,K,V=!1;const fe=[];for(let P=0;;P++){const J=S[P],Z=Q.getComponent();if(Z&&(Z.r!==void 0?V=!0:Z.p!=null&&(V=!1,ne=Z.p,K=P)),P>=S.length)break;let re=0;const Re=s.advancer(Q,void 0,(F,he)=>{h(he)&&re++});fe.unshift(Re);const ye=Re(J);if(typeof J=="number"&&(S[P]-=re),!ye)break}if(fe.forEach(P=>P.end()),V)return null;const de=()=>{let P=0;if(ne!=null){const J=Q.getPath();P=J.length,S=J.concat(S.slice(K))}for(;P<S.length;P++){const J=S[P],Z=a(Q),re=j(Z);if(re){const F=y(Z);re.transformPosition&&(S[P]=re.transformPosition(S[P],F));break}let Re=0;const ye=s.advancer(Q,(F,he)=>u(he)?~(F-Re):F-Re,(F,he)=>{u(he)&&Re++})(J);if(typeof J=="number"&&(S[P]+=Re),!ye)break}};return ne!=null?Q.eachDrop(null,P=>{P===ne&&de()}):de(),S}function Te(S,U){if(ue(S),ue(U),S==null)return U;if(U==null)return S;let Q=0;const ne=s.readCursor(S),K=s.readCursor(U),V=s.writeCursor(),fe=[],de=[],P=[],J=[],Z=[],re=[],Re=new Set;ne.traverse(null,F=>{F.p!=null&&(P[F.p]=ne.clone())}),K.traverse(null,F=>{F.d!=null&&(J[F.d]=K.clone())});const ye=s.writeCursor();return function F(he,Be,$e,Me,Ke,Rt,We,et){o(Be||$e);const Ye=a(Be),ht=a($e),at=!!ht&&ht.r!==void 0,$t=!!Ye&&Ye.i!==void 0,Ue=Ye?Ye.d:null,dt=ht?ht.p:null,_=(Rt||at)&&dt==null;if(dt!=null)Me=J[dt],We=de[dt]=new s.WriteCursor;else if(ht&&ht.r!==void 0)Me=null;else{const A=a(Me);A&&A.d!=null&&(Me=null)}const g=a(Me);if(Ue!=null)if(he=P[Ue],et=fe[Ue]=new s.WriteCursor,_)Rt&&!at&&et.write("r",!0);else{const A=Z[Ue]=Q++;We.write("d",A)}else if(Ye&&Ye.i!==void 0)he=null;else{const A=a(he);A&&A.p!=null&&(he=null)}let m;$t?(o(Ke===void 0),m=Ye.i):m=Ke;const O=(dt==null?!$t||Rt||at:m===void 0)?null:We.getComponent();if(dt!=null){if(!(Ke!==void 0||$t)){const A=Ue!=null?Z[Ue]:Q++;re[dt]=A,et.write("p",A)}}else at&&($t||Ke!==void 0||(ht.r,et.write("r",ht.r)));const b=_?null:j(Ye),N=j(g);if((b||N)&&(b&&b.name,N&&N.name),b&&N){o(b===N);const A=y(Ye),W=y(g),ce=b.compose(A,W);w(We,b,ce),Re.add(g)}else b?w(We,b,y(Ye)):N&&(w(We,N,y(g)),Re.add(g));const T=typeof m=="object"&&m!=null;let D=!1,C=0,H=0,ae=0,$=0,se=0;const _e=s.advancer(Me,(A,W)=>u(W)?$-A-1:A-$,(A,W)=>{u(W)&&$++}),X=s.advancer(he,(A,W)=>h(W)?C-A-1:A-C,(A,W)=>{h(W)&&C++});if(s.eachChildOf(Be,$e,(A,W,ce)=>{let ve,De,xe=A,je=A,ft=A;if(typeof A=="number"){let Oe=A+ae;De=_e(Oe),je=Oe+$;let Y=A+H;ve=X(Y),u(a(De))&&(ve=null),xe=Y+C,ft=A+se,o(xe>=0,"p1PickKey is negative"),o(je>=0,"p2DropKey is negative");const ut=u(a(W)),Fe=h(a(ce));(ut||Fe&&!_)&&se--,ut&&H--,Fe&&ae--}else ve=X(A),De=_e(A);et.descend(xe),We.descend(je);const _t=T&&!u(a(W))?m[ft]:void 0,le=F(ve,W,ce,De,_t,_,We,et);var qe,pe,ge;T&&!_?_t!==le&&(D||(m=Array.isArray(m)?m.slice():Object.assign({},m),D=!0),qe=m,ge=le,typeof(pe=ft)=="number"?(o(Array.isArray(qe)),o(pe<qe.length)):(o(!Array.isArray(qe)),o(qe[pe]!==void 0)),ge===void 0?typeof pe=="number"?qe.splice(pe,1):delete qe[pe]:qe[pe]=ge):o(le===void 0),We.ascend(),et.ascend()}),X.end(),_e.end(),O!=null)O.i=m;else if(!Rt&&!at&&dt==null)return m}(ne,ne.clone(),K,K.clone(),void 0,!1,V,ye),V.reset(),V.mergeTree(ye.get()),V.reset(),V.get(),fe.map(F=>F.get()),de.map(F=>F.get()),ne.traverse(V,(F,he)=>{const Be=F.p;if(Be!=null){const $e=Z[Be];$e!=null&&he.write("p",$e);const Me=fe[Be];Me&&Me.get(),Me&&he.mergeTree(Me.get())}else F.r!==void 0&&he.write("r",F.r)}),V.reset(),V.get(),K.traverse(V,(F,he)=>{const Be=F.d;if(Be!=null){const Me=re[Be];Me!=null&&he.write("d",Me);const Ke=de[Be];Ke&&he.mergeTree(Ke.get())}else F.i!==void 0&&he.write("i",F.i);const $e=j(F);$e&&!Re.has(F)&&w(he,$e,y(F))}),V.get()}function ee(S){if(S==null)return null;const U=new s.ReadCursor(S),Q=new s.WriteCursor;let ne;const K=[],V=[];return function fe(de,P,J){const Z=de.getComponent();let re,Re=!1;if(Z){Z.p!=null&&(P.write("d",Z.p),K[Z.p]=de.clone()),Z.r!==void 0&&P.write("i",Z.r),Z.d!=null&&(P.write("p",Z.d),J=void 0),Z.i!==void 0&&(J=re=Z.i);const F=j(Z);F&&(J===void 0?(ne||(ne=new Set),ne.add(Z)):(y(Z),J=F.apply(J,y(Z)),Re=!0))}let ye=0;for(const F of de){P.descend(F);const he=typeof F=="number"?F-ye:F,Be=E(J,he);u(de.getComponent())&&ye++;const $e=fe(de,P,Be);if(J!==void 0&&$e!==void 0){if(Re||(Re=!0,J=c(J)),!p(J,he))throw Error("Cannot modify child - invalid operation");J[he]=$e}P.ascend()}if(re===void 0)return Re?J:void 0;P.write("r",J)}(U,Q,void 0),ne&&(Q.reset(),function fe(de,P,J){const Z=P.getComponent();if(Z){const F=Z.d;if(F!=null&&(de=K[F],J=V[F]=s.writeCursor()),ne.has(Z)){const he=j(Z);if(!he.invert)throw Error(`Cannot invert subtype ${he.name}`);w(J,he,he.invert(y(Z)))}}let re=0,Re=0;const ye=s.advancer(de,(F,he)=>h(he)?re-F-1:F-re,(F,he)=>{h(he)&&re++});for(const F of P)if(typeof F=="number"){const he=F-Re,Be=ye(he),$e=he+re;J.descend($e),fe(Be,P,J),u(P.getComponent())&&Re++,J.ascend()}else J.descend(F),fe(ye(F),P,J),J.ascend();ye.end()}(U.clone(),U,Q),V.length&&(Q.reset(),U.traverse(Q,(fe,de)=>{const P=fe.p;if(P!=null){const J=V[P];J&&J.get(),J&&de.mergeTree(J.get())}}))),Q.get()}const k=(S,U)=>S.some(Q=>typeof Q=="object"&&(Array.isArray(Q)?k(Q,U):U(Q)));function z(S,U){if(S==null||!k(S,P=>{var J;return P.r!==void 0||((J=j(P))===null||J===void 0?void 0:J.makeInvertible)!=null}))return S;const Q=new s.ReadCursor(S),ne=new s.WriteCursor;let K=!1;const V=[],fe=[],de=(P,J,Z)=>{const re=P.getComponent();let Re=!1;if(re){re.d!=null&&J.write("d",re.d),re.i!==void 0&&J.write("i",re.i);const F=re.p;if(F!=null&&(V[F]=P.clone(),o(Z!==void 0,"Operation picks up at an invalid key"),fe[F]=Z,J.write("p",re.p)),re.r!==void 0&&Z===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const he=j(re);he&&(he.makeInvertible?K=!0:w(J,he,y(re),!0))}let ye=0;for(const F of P){J.descend(F);const he=typeof F=="number"?F-ye:F,Be=E(Z,he),$e=de(P,J,Be);Be!==$e&&(Re||(Re=!0,Z=c(Z)),$e===void 0?(Z=d(Z,he),typeof F=="number"&&ye++):Z[he]=$e),J.ascend()}return re&&(re.r!==void 0?(J.write("r",r.default(Z)),Z=void 0):re.p!=null&&(Z=void 0)),Z};return de(Q,ne,U),ne.get(),K&&(ne.reset(),function P(J,Z,re,Re,ye){const F=Z.getComponent();if(F){F.i!==void 0?(Re=F.i,ye=!0):F.d!=null&&(Re=fe[F.d],J=V[F.d],ye=!1,F.d);let Me=j(F);if(Me&&Me.makeInvertible){const Ke=y(F);w(re,Me,Me.makeInvertible(Ke,Re),!0)}}let he=0,Be=0;const $e=s.advancer(J,(Me,Ke)=>h(Ke)?he-Me-1:Me-he,(Me,Ke)=>{h(Ke)&&he++});for(const Me of Z)if(typeof Me=="number"){const Ke=Me-Be,Rt=$e(Ke),We=Ke+he,et=E(Re,ye?Ke:We);re.descend(Me),P(Rt,Z,re,et,ye),u(Z.getComponent())&&Be++,re.ascend()}else{const Ke=E(Re,Me);re.descend(Me),P($e(Me),Z,re,Ke,ye),re.ascend()}$e.end()}(Q.clone(),Q,ne,U,!1)),ne.get()}function me(S,U){return ee(z(S,U))}const te=S=>{if(S==null)return null;const U=S.slice();for(let Q=0;Q<S.length;Q++){const ne=U[Q];Array.isArray(ne)&&(U[Q]=te(ne))}return U};function Ce(S,U,Q){o(Q==="left"||Q==="right","Direction must be left or right");const ne=Q==="left"?0:1;if(U==null)return{ok:!0,result:S};ue(S),ue(U);let K=null;const V=[],fe=[],de=[],P=[],J=[],Z=[],re=[],Re=[],ye=[],F=[],he=[],Be=[],$e=[],Me=[],Ke=[];let Rt=0;const We=s.readCursor(S),et=s.readCursor(U),Ye=s.writeCursor();if(function g(m,O=null,b){const N=a(O);N&&(N.r!==void 0?b=O.clone():N.p!=null&&(b=null,Z[N.p]=m.clone()));const T=m.getComponent();let D;T&&(D=T.p)!=null&&(J[D]=O?O.clone():null,de[D]=m.clone(),b&&(F[D]=!0,ye[D]=b),N&&N.p!=null&&(Me[D]=N.p));const C=s.advancer(O);for(const H of m)g(m,C(H),b);C.end()}(et,We,null),function g(m,O,b,N,T){const D=b.getComponent();let C,H=!1;D&&((C=D.d)!=null?(P[C]=b.clone(),N!=null&&(Ke[N]==null&&(Ke[N]=[]),Ke[N].push(C)),m=J[C]||null,O=de[C]||null,F[C]?(T&&(he[C]=!0),T=ye[C]||null):!T||ne!==1&&Me[C]!=null||K==null&&(K={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(T.getPath()),op2:e.moveOp(O.getPath(),b.getPath())}),H=!0):D.i!==void 0&&(m=O=null,H=!0,T&&K==null&&(K={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(T.getPath()),op2:e.insertOp(b.getPath(),D.i)})));const ae=a(m);ae&&(ae.r!==void 0?T=m.clone():ae.p!=null&&(ae.p,N=ae.p,T=null));const $=j(D);$&&T&&K==null&&(K={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(T.getPath()),op2:e.editOp(b.getPath(),$,y(D),!0)});let se=0,_e=0;const X=s.advancer(O,(W,ce)=>h(ce)?se-W-1:W-se,(W,ce)=>{h(ce)&&se++}),A=s.advancer(m);for(const W of b)if(typeof W=="number"){const ce=W-_e,ve=X(ce);_e+=+g(A(ce+se),ve,b,N,T)}else{const ce=X(W);g(A(W),ce,b,N,T)}return X.end(),A.end(),H}(We,et,et.clone(),null,null),P.map(g=>g&&g.get()),K)return{ok:!1,conflict:K};he.map(g=>!!g);const ht=[];let at=null;(function g(m,O,b,N,T){let D=!1;const C=a(O);if(h(C)){const X=C.p;X!=null?(b=P[X],N=Be[X]=s.writeCursor(),D=!0,T=null):(b=null,T=O.clone())}else u(a(b))&&(b=null);const H=m.getComponent();if(H){const X=H.p;X!=null?(T&&(Re[X]=T),ht[X]=T||ne===1&&D?null:N.getComponent(),V[X]=m.clone(),b&&(re[X]=b.clone())):H.r!==void 0&&(T||N.write("r",!0),(T||D)&&(at==null&&(at=new Set),at.add(H)))}let ae=0,$=0;const se=s.advancer(O,void 0,(X,A)=>{h(A)&&ae++}),_e=s.advancer(b,(X,A)=>u(A)?~(X-$):X-$,(X,A)=>{u(A)&&$++});if(m)for(const X of m)if(typeof X=="string"){const A=se(X),W=_e(X);N.descend(X),g(m,A,W,N,T),N.ascend()}else{const A=se(X),W=X-ae,ce=h(a(A))?null:_e(W),ve=W+$;o(ve>=0),N.descend(ve),g(m,A,ce,N,T),N.ascend()}se.end(),_e.end()})(We,et,et.clone(),Ye,null),Ye.reset();let $t=[];if(function g(m,O,b,N,T,D){o(O);const C=O.getComponent();let H=a(N),ae=!1;const $=(pe,ge,Oe)=>pe?e.moveOp(pe.getPath(),ge.getPath()):e.insertOp(ge.getPath(),Oe.i);if(u(C)){const pe=C.d;pe!=null&&(fe[pe]=O.clone());const ge=pe!=null?ht[pe]:null;let Oe=!1;if(C.i!==void 0||pe!=null&&ge){let Y;H&&(H.i!==void 0||(Y=H.d)!=null&&!F[Y])&&(Oe=Y!=null?pe!=null&&pe===Me[Y]:t.default(H.i,C.i),Oe||Y!=null&&ne!==1&&Me[Y]!=null||K==null&&(K={type:i.ConflictType.DROP_COLLISION,op1:$(pe!=null?V[pe]:null,O,C),op2:$(Y!=null?de[Y]:null,N,H)})),Oe||(D?K==null&&(K={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:$(pe!=null?V[pe]:null,O,C),op2:e.removeOp(D.getPath())}):(pe!=null?($t[Rt]=pe,T.write("d",ge.p=Rt++)):T.write("i",r.default(C.i)),ae=!0))}else if(pe!=null&&!ge){const Y=Re[pe];Y&&(D=Y.clone())}pe!=null?(m=V[pe],b=Z[pe],N=re[pe]):C.i!==void 0&&(m=b=null,Oe||(N=null))}else h(a(m))&&(m=b=N=null);const se=a(m),_e=a(b);if(h(_e)){const pe=_e.p;_e.r!==void 0&&(!se||se.r===void 0)||F[pe]?(N=null,D=b.clone()):pe!=null&&(N=P[pe],ne!==1&&Me[pe]!=null||((T=$e[pe])||(T=$e[pe]=s.writeCursor()),T.reset(),D=null))}else!u(C)&&u(H)&&(N=null);H=N!=null?N.getComponent():null;const X=j(C);if(X){const pe=y(C);if(D)K==null&&(K={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(O.getPath(),X,pe,!0),op2:e.removeOp(D.getPath())});else{const ge=j(H);let Oe;if(ge){if(X!==ge)throw Error("Transforming incompatible types");const Y=y(H);Oe=X.transform(pe,Y,Q)}else Oe=r.default(pe);w(T,X,Oe)}}let A=0,W=0,ce=0,ve=0,De=0,xe=0,je=m!=null&&m.descendFirst(),ft=je;const _t=s.advancer(b,void 0,(pe,ge)=>{h(ge)&&ce++});let le=N!=null&&N.descendFirst(),qe=le;for(const pe of O)if(typeof pe=="number"){let ge;const Oe=u(O.getComponent()),Y=pe-W;{let Vt;for(;je&&typeof(Vt=m.getKey())=="number";){Vt+=A;const bt=m.getComponent(),pn=h(bt);if(Vt>Y||Vt===Y&&(!pn||ne===0&&Oe))break;if(pn){A--;const nn=bt.p;Me.includes(nn),bt.d,a($e[bt.d]),h(a($e[bt.d])),(bt.r===void 0||at&&at.has(bt))&&(nn==null||!ht[nn]||ne!==1&&Me.includes(nn))||De--}je=m.nextSibling()}ge=je&&Vt===Y?m:null}const ut=Y-A;let Fe=_t(ut);const Mt=ut-ce;let pr=null;{let Vt,bt;for(;le&&typeof(Vt=N.getKey())=="number";){bt=Vt-ve;const pn=N.getComponent(),nn=u(pn);if(bt>Mt)break;if(bt===Mt){if(!nn){pr=N;break}{if(ne===0&&Oe){pr=N;break}const rn=Fe&&h(Fe.getComponent());if(ne===0&&rn)break}}if(nn){const rn=pn.d;Me[rn],pn.i===void 0&&(F[rn]||Me[rn]!=null&&ne!==1)?(F[rn]||Me[rn]!=null&&ne===0)&&(ve++,xe--):ve++}le=N.nextSibling()}}const Di=Mt+ve+De+xe;o(Di>=0,"trying to descend to a negative index"),T.descend(Di),Oe&&(ge=Fe=pr=null,W++),g(ge,O,Fe,pr,T,D)&&xe++,T.ascend()}else{let ge;for(;je&&(ge=m.getKey(),typeof ge!="string"||!(ge>pe||ge===pe));)je=m.nextSibling();const Oe=je&&ge===pe?m:null,Y=_t(pe);let ut;for(;le&&(ut=N.getKey(),typeof ut!="string"||!(ut>pe||ut===pe));)le=N.nextSibling();const Fe=le&&ut===pe?N:null;T.descend(pe),g(Oe,O,Y,Fe,T,D),T.ascend()}return _t.end(),ft&&m.ascend(),qe&&N.ascend(),ae}(We,We.clone(),et,et.clone(),Ye,null),K)return{ok:!1,conflict:K};Ye.reset();const Ue=(g,m,O)=>g.traverse(m,(b,N)=>{b.d!=null&&O(b.d,g,N)});(F.length||Be.length)&&(Ue(et,Ye,(g,m,O)=>{F[g]&&!he[g]&&O.write("r",!0),Be[g]&&O.mergeTree(Be[g].get())}),Ye.reset());const dt=[],_=[];if(($e.length||F.length)&&!K){const g=s.readCursor(te(Ye.get()));if(Ue(g,null,(m,O)=>{dt[m]=O.clone()}),$e.forEach(m=>{m&&Ue(s.readCursor(m.get()),null,(O,b)=>{dt[O]=b.clone()})}),function m(O,b,N,T,D,C){const H=a(b);if(H&&h(H))if(H.p!=null){const A=H.p;dt[A].getPath(),N=dt[A],T=_[A]=s.writeCursor()}else H.r!==void 0&&(N=null);else u(a(N))&&(N=null);const ae=O.getComponent();if(ae){let A;if((A=ae.d)!=null){const W=$e[A];W&&(W.get(),T.mergeTree(W.get()),N=s.readCursor(W.get()))}}let $=0,se=0;const _e=s.advancer(b,void 0,(A,W)=>{h(W)&&$--}),X=s.advancer(N,(A,W)=>u(W)?-(A-se)-1:A-se,(A,W)=>{u(W)&&se++});for(const A of O)if(typeof A=="number"){const W=_e(A),ce=A+$,ve=X(ce),De=ce+se;T.descend(De),m(O,W,ve,T),T.ascend()}else T.descend(A),m(O,_e(A),X(A),T),T.ascend();_e.end(),X.end()}(et,g,g.clone(),Ye),Ye.reset(),K)return{ok:!1,conflict:K};if(Ye.get(),_.length){const m=_.map(b=>b?b.get():null),O=s.readCursor(te(Ye.get()));if(Ue(O,Ye,(b,N,T)=>{const D=m[b];D&&(T.mergeTree(D),m[b]=null)}),m.find(b=>b)){const b=s.writeCursor(),N=s.writeCursor();let T=0,D=0;m.forEach(C=>{C!=null&&Ue(s.readCursor(C),null,H=>{const ae=$t[H];b.writeMove(V[ae].getPath(),fe[ae].getPath(),T++);const $=Ke[ae];$&&$.forEach(se=>{F[se]||ne!==1&&Me[se]!=null||N.writeMove(de[se].getPath(),P[se].getPath(),D++)})})}),K={type:i.ConflictType.BLACKHOLE,op1:b.get(),op2:N.get()}}}}return K?{ok:!1,conflict:K}:{ok:!0,result:Ye.get()}}const Ie=S=>{const U=new Error("Transform detected write conflict");throw U.conflict=S,U.type=U.name="writeConflict",U};function Ne(S,U,Q){const ne=Ce(S,U,Q);if(ne.ok)return ne.result;Ie(ne.conflict)}const Pe=S=>{const U=s.writeCursor();return s.readCursor(S).traverse(U,(Q,ne)=>{(u(Q)||j(Q))&&ne.write("r",!0)}),U.get()},He=(S,U)=>{const{type:Q,op1:ne,op2:K}=S;switch(Q){case i.ConflictType.DROP_COLLISION:return U==="left"?[null,Pe(K)]:[Pe(ne),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let V=!1;return s.readCursor(ne).traverse(null,fe=>{fe.r!==void 0&&(V=!0)}),V?[null,Pe(K)]:[Pe(ne),null];case i.ConflictType.BLACKHOLE:return[Pe(ne),Pe(K)];default:throw Error("Unrecognised conflict: "+Q)}};function Ze(S,U,Q,ne){let K=null;for(;;){const V=Ce(U,Q,ne);if(V.ok)return Te(K,V.result);{const{conflict:fe}=V;S(fe)||Ie(fe);const[de,P]=He(fe,ne);U=Te(q(U),de),Q=Te(q(Q),P),K=Te(K,P)}}}})(jl);(function(e){var n=Qe&&Qe.__createBinding||(Object.create?function(i,o,a,l){l===void 0&&(l=a),Object.defineProperty(i,l,{enumerable:!0,get:function(){return o[a]}})}:function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]}),t=Qe&&Qe.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&n(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),t(jl,e);var r=Ci;Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=Ri;Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})})(mt);const g_=yt(mt),m_=Tc({__proto__:null,default:g_},[mt]);var ie=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(ie||{});function fr(e,n=!1){const t=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!n&&G.isEmptyObject(o)&&r.sId==null)continue;if(t.length===0){t.push(r);continue}const a=t.pop();Il(r,a)&&G.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?t.push({...r,st:a.st,ed:i}):t.push(a,r)}return t}function Hl(e,n,t,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=n.textRuns)!=null?c:[];if(l.length)for(const h of l)h.st+=r,h.ed+=r;for(let h=0;h<o;h++){const u=s[h],{st:d,ed:f}=u;if(f<=r)i.push(u);else if(r>d&&r<f){a=!0;const p={...u,ed:r};i.push(p),l.length&&i.push(...l);const E={...u,st:r+t,ed:f+t};i.push(E)}else u.st+=t,u.ed+=t,a||(a=!0,i.push(...l)),i.push(u)}a||(a=!0,i.push(...l)),e.textRuns=fr(i)}function Bl(e,n,t,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=n,o=[];for(let l=0,c=s.length;l<c;l++){const h=s[l],{startIndex:u}=h;u>=r&&(h.startIndex+=t),o.push(h.startIndex)}let a=-1;if(i){for(let l=0,c=i.length;l<c;l++){const h=i[l];h.startIndex+=r;const u=h.startIndex;a=o.indexOf(u)}a!==-1&&s.splice(a,1),s.push(...i),s.sort(dr("startIndex"))}}function Wl(e,n,t,r){const{sectionBreaks:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=t)}const i=n.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(dr("startIndex"))}}function Yl(e,n,t,r){const{customBlocks:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=t)}const i=n.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(dr("startIndex"))}}function zl(e,n,t,r){const{tables:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c,endIndex:h}=l;c>r?(l.startIndex+=t,l.endIndex+=t):h>r&&(l.endIndex+=t)}const i=n.tables;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r,l.endIndex+=r}s.push(...i),s.sort(dr("startIndex"))}}const Vl="$",wo=e=>e.split(Vl)[0];function Ii(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const n=[];let t={...e[0]};t.rangeId=wo(t.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=wo(i.rangeId),i.rangeId===t.rangeId&&Ua(t.properties,i.properties)&&t.endIndex+1>=i.startIndex?t.endIndex=i.endIndex:(n.push(t),t={...i})}n.push(t);const r=Object.create(null);for(let s=0,i=n.length;s<i;s++){const o=n[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${Vl}${r[a]}`,r[a]=r[a]+1):r[a]=1}return n}function $s(e,n){const t=e.findIndex(s=>s.startIndex<n&&s.endIndex>=n),r=e[t];r&&e.splice(t,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:n-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:n,endIndex:r.endIndex,properties:{...r.properties}})}function Gl(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const n=[];let t={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===t.id&&t.endIndex+1>=s.startIndex?t.endIndex=s.endIndex:(n.push(t),t={...s})}return n.push(t),n}function js(e,n){e.filter(r=>r.startIndex<n&&r.endIndex>=n).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:n-1},{id:r.id,type:r.type,startIndex:n,endIndex:r.endIndex})})}function p_(e,n,t,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;$s(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=t,l.endIndex+=t)}const i=[];if(n.customRanges){for(let o=0,a=n.customRanges.length;o<a;o++){const l=n.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=Ii(s)}function __(e,n,t,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;js(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=t,l.endIndex+=t)}const i=[];if(n.customDecorations){for(let o=0,a=n.customDecorations.length;o<a;o++){const l=n.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=Gl(s)}function Kl(e,n,t){const{textRuns:r}=e,s=t,i=t+n,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{st:u,ed:d}=h;if(s<=u&&i>=d){o.push({...h,st:u-s,ed:d-s});continue}else u<=s&&d>=i?(o.push({...h,st:s-s,ed:i-s}),h.ed-=n):s>=u&&s<d?(o.push({...h,st:s-s,ed:d-s}),h.ed=s):i>u&&i<=d?(o.push({...h,st:u-s,ed:i-s}),h.st=i-n,h.ed-=n):u>=i&&(h.st-=n,h.ed-=n);a.push(h)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:n,ts:{}}),o}function Xl(e,n,t){const{paragraphs:r}=e,s=t,i=t+n,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<i){o.push({...h,startIndex:u-t});continue}else u>=i&&(h.startIndex-=n);a.push(h)}e.paragraphs=a}return o}function Ql(e,n,t){const{sectionBreaks:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<=i){o.push({...h,startIndex:u-t});continue}else u>i&&(h.startIndex-=n);a.push(h)}e.sectionBreaks=a}return o}function Jl(e,n,t){const{customBlocks:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<=i){o.push({...h,startIndex:u-t});continue}else u>i&&(h.startIndex-=n);a.push(h)}e.customBlocks=a}return o}function Zl(e,n,t){const{tables:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:d}=h;if(s<=u&&i>=d){o.push({...h,startIndex:u-t,endIndex:d-t});continue}else if(u<=s&&d>=i){const f=qr(u,d,s,i);if(f.length===0||(h.startIndex=f[0],h.endIndex=f[1],h.startIndex===h.endIndex))continue}else i<u&&(h.startIndex-=n,h.endIndex-=n);a.push(h)}e.tables=a}return o}function E_(e,n,t){const{customRanges:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:d}=h;if(u>=s&&d<=i){o.push(h);continue}else if(Math.max(s,u)<=Math.min(i,d)){const f=qr(u,d,s,i);if(f.length===0)continue;h.startIndex=f[0],h.endIndex=f[1]}else i<u&&(h.startIndex-=n,h.endIndex-=n);a.push(h)}e.customRanges=Ii(a)}return o}function C_(e,n,t,r=!0){const{customDecorations:s}=e,i=t,o=t+n-1,a=[];if(s){const l=[];for(let c=0,h=s.length;c<h;c++){const u=s[c],{startIndex:d,endIndex:f}=u;if(d>=i&&f<=o){a.push(u);continue}else if(Math.max(i,d)<=Math.min(o,f)){const p=qr(d,f,i,o);if(p.length===0)continue;u.startIndex=p[0],u.endIndex=p[1]}else o<d&&r&&(u.startIndex-=n,u.endIndex-=n);l.push(u)}e.customDecorations=l}return a}var ql=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(ql||{}),eu=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(eu||{}),Se=(e=>(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))(Se||{}),gr=(e=>(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))(gr||{}),tr=(e=>(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))(tr||{}),ln=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(ln||{}),tu=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(tu||{}),nu=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(nu||{}),ru=(e=>(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))(ru||{}),su=(e=>(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))(su||{}),iu=(e=>(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))(iu||{}),ou=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(ou||{}),au=(e=>(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))(au||{}),lu=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(lu||{}),uu=(e=>(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))(uu||{}),cu=(e=>(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[e.HEADING_6=9]="HEADING_6",e))(cu||{}),hu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(hu||{}),du=(e=>(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))(du||{}),fu=(e=>(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))(fu||{}),gu=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(gu||{}),mu=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(mu||{}),pu=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(pu||{}),_u=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(_u||{}),Eu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Eu||{}),Cu=(e=>(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))(Cu||{}),Sn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(Sn||{}),Ru=(e=>(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))(Ru||{}),vu=(e=>(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))(vu||{}),Iu=(e=>(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))(Iu||{}),Su=(e=>(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))(Su||{}),Ou=(e=>(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))(Ou||{}),yu=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(yu||{}),wu=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(wu||{}),bu=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(bu||{}),Au=(e=>(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))(Au||{}),Si=(e=>(e[e.SLIDE=0]="SLIDE",e[e.MASTER=1]="MASTER",e[e.LAYOUT=2]="LAYOUT",e[e.HANDOUT_MASTER=3]="HANDOUT_MASTER",e[e.NOTES_MASTER=4]="NOTES_MASTER",e))(Si||{}),Tu=(e=>(e[e.SHAPE=0]="SHAPE",e[e.IMAGE=1]="IMAGE",e[e.TEXT=2]="TEXT",e[e.SPREADSHEET=3]="SPREADSHEET",e[e.DOCUMENT=4]="DOCUMENT",e[e.SLIDE=5]="SLIDE",e))(Tu||{}),Nu=(e=>(e[e.RELATIVE_SLIDE_LINK_UNSPECIFIED=0]="RELATIVE_SLIDE_LINK_UNSPECIFIED",e[e.NEXT_SLIDE=1]="NEXT_SLIDE",e[e.PREVIOUS_SLIDE=2]="PREVIOUS_SLIDE",e[e.FIRST_SLIDE=3]="FIRST_SLIDE",e[e.LAST_SLIDE=4]="LAST_SLIDE",e))(Nu||{}),Mu=(e=>(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))(Mu||{}),kt=(e=>(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))(kt||{});const Ir={"a)":{glyphFormat:"%1)",glyphType:Se.DECIMAL},"1.":{glyphFormat:"%1.",glyphType:Se.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:Se.LOWER_LETTER},"A.":{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:Se.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER}},_n=e=>[...e,...e,...e].map((n,t)=>({glyphFormat:` %${t+1}`,glyphSymbol:n,bulletAlignment:gr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),En=e=>e.map((n,t)=>({...n,bulletAlignment:gr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),bo=(e,n)=>new Array(9).fill(0).map((t,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:gr.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:n}})),mr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:_n(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:_n(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:_n(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:_n(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:_n(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:_n(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:En([{glyphFormat:"%1.",glyphType:Se.DECIMAL},{glyphFormat:"%2.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.DECIMAL},{glyphFormat:"%5.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.DECIMAL},{glyphFormat:"%8.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:En([{glyphFormat:"%1)",glyphType:Se.DECIMAL},{glyphFormat:"%2)",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3)",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:Se.DECIMAL},{glyphFormat:"%5)",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6)",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:Se.DECIMAL},{glyphFormat:"%8)",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9)",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:En(["%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:Se.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:En([{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:En([{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Se.DECIMAL},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Se.DECIMAL},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Se.DECIMAL},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:En([{glyphFormat:"%1.",glyphType:Se.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:bo("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:bo("☑",{st:{s:Ae.TRUE}})}},Sr=e=>{const{glyphFormat:n,glyphType:t}=e,r=G.deepClone(mr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=n,r.nestingLevel[0].glyphType=t,r},R_={ORDER_LIST_QUICK_2:Sr(Ir["a)"]),ORDER_LIST_QUICK_3:Sr(Ir["a."]),ORDER_LIST_QUICK_4:Sr(Ir["i."]),ORDER_LIST_QUICK_6:Sr(Ir["I."])};Object.assign(mr,R_);const v_={"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"};function I_(e,n,t,r,s){const i=S_(e,n,t,r,s),o=O_(e,n,t,r,s),a=y_(e,n,t,r,s),l=w_(e,n,t,r,s),c=b_(e,n,t,r,s),h=A_(e,n,t,r),u=T_(e,n,t,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:h,customDecorations:u}}function S_(e,n,t,r,s){const{textRuns:i}=e,{textRuns:o}=n;if(i==null||o==null)return;const a=Kl(e,t,r);if(s!==Le.REPLACE){const l=Du(o,a,s);n.textRuns=l}return Hl(e,n,t,r),a}function Du(e,n,t){if(n.length===0)return e;e=G.deepClone(e),n=G.deepClone(n);const r=[],s=e.length,i=n.length;let o=0,a=0,l=null;function c(){return l?(r.push(l),l=null,!0):!1}for(;o<s&&a<i;){const{st:f,ed:p,ts:E}=e[o],{st:v,ed:I,ts:M,sId:L}=n[a];let j;if(t===Le.COVER?j={...M,...E}:j={...E},p<v)c()||r.push(e[o]),o++;else if(I<f)c()||r.push(n[a]),a++;else{const y={st:Math.min(f,v),ed:Math.max(f,v),ts:f<v?{...E}:{...M},sId:f<v?void 0:L};y.ed>y.st&&r.push(y),r.push({st:Math.max(f,v),ed:Math.min(p,I),ts:j,sId:L}),p<I?(o++,n[a].st=p,n[a].st===n[a].ed&&a++):(a++,e[o].st=I,e[o].st===e[o].ed&&o++);const w={st:Math.min(p,I),ed:Math.max(p,I),ts:p<I?{...M}:{...E},sId:p<I?L:void 0};l=w.ed>w.st?w:null}}c();const h=r[r.length-1],u=e[s-1],d=n[i-1];return h&&h.ed!==Math.max(u.ed,d.ed)&&(u.ed>d.ed?r.push(u):r.push(d)),fr(r)}function O_(e,n,t,r,s){const{paragraphs:i}=e,{paragraphs:o}=n;if(i==null||o==null)return;const a=Xl(e,t,r);if(s!==Le.REPLACE){const l=[];for(const c of o){const{startIndex:h,paragraphStyle:u,bullet:d}=c;let f=[];for(const p of a){const{startIndex:E,paragraphStyle:v,bullet:I}=p;let M,L;if(s===Le.COVER?(M={...v,...u},L={listId:"",listType:kt.BULLET_LIST,nestingLevel:0,textStyle:{},...I,...d}):(M={...u,...v},L={listId:"",listType:kt.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...I}),h===E){f.push({startIndex:h,paragraphStyle:M,bullet:L});break}}l.push(...f),f=[]}n.paragraphs=l}return Bl(e,n,t,r),a}function y_(e,n,t,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=n;if(i==null||o==null)return;const a=Ql(e,t,r);if(s!==Le.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Le.COVER?u.push({...d,...c}):u.push({...c,...d});break}}l.push(...u),u=[]}n.sectionBreaks=l}return Wl(e,n,t,r),a}function w_(e,n,t,r,s){const{customBlocks:i}=e,{customBlocks:o}=n;if(i==null||o==null)return;const a=Jl(e,t,r);if(s!==Le.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Le.COVER?u.push({...d,...c}):u.push({...c,...d});break}}l.push(...u),u=[]}n.customBlocks=l}return Yl(e,n,t,r),a}function b_(e,n,t,r,s){const{tables:i}=e,{tables:o}=n;if(i==null||o==null)return;const a=Zl(e,t,r);if(s!==Le.REPLACE){const l=[];for(const c of o){const{startIndex:h,endIndex:u}=c;let d=[];for(const f of a){const{startIndex:p,endIndex:E}=f;if(p>=h&&E<=u){s===Le.COVER?d.push({...f,...c}):d.push({...c,...f});break}}l.push(...d),d=[]}n.tables=l}return zl(e,n,t,r),a}function A_(e,n,t,r,s){e.customRanges||(e.customRanges=[]),$s(e.customRanges,r),$s(e.customRanges,r+t);const i=r,o=r+t-1,{customRanges:a}=n,l=[],c=new Map;e.customRanges.forEach(u=>{const{startIndex:d,endIndex:f}=u;d>=i&&f<=o?c.set(u.rangeId,u):l.push(u)});const h=[];return a?(a.forEach(u=>{const{startIndex:d,endIndex:f}=u;l.push({...u,startIndex:d+r,endIndex:f+r})}),e.customRanges=Ii(l),h):[]}function T_(e,n,t,r,s){e.customDecorations||(e.customDecorations=[]),js(e.customDecorations,r),js(e.customDecorations,r+t);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=n;if(s===Le.REPLACE){for(let l=0;l<o.length;l++){const c=o[l],{startIndex:h,endIndex:u}=c;h>=r&&u<=r+t-1&&i.push(c)}a.forEach(l=>{const{startIndex:c,endIndex:h}=l;o.push({...l,startIndex:c+r,endIndex:h+r})})}else for(const l of a){const{id:c}=l;if(l.type===ln.DELETED){const h=o.filter(u=>u.id===c);h.length&&i.push(...h)}else o.push({...l,startIndex:l.startIndex+r,endIndex:l.endIndex+r})}for(const l of i){const{id:c}=l,h=o.findIndex(u=>u.id===c);h!==-1&&o.splice(h,1)}return e.customDecorations=Gl(o),i}var Oi=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(Oi||{});function qt(e,n,t,r=!0,s=1){const{dataStream:i,textRuns:o,paragraphs:a=[],customBlocks:l=[],tables:c=[],sectionBreaks:h=[]}=e,u={dataStream:i.slice(n,t)};if(o){const I=[];for(const M of o){const L=G.deepClone(M),{st:j,ed:y}=L;G.hasIntersectionBetweenTwoRanges(j,y,n,t)&&(n>=j&&n<=y?I.push({...L,st:n,ed:Math.min(t,y)}):t>=j&&t<=y?I.push({...L,st:Math.max(n,j),ed:t}):I.push(L))}u.textRuns=fr(I.map(M=>{const{st:L,ed:j}=M;return{...M,st:L-n,ed:j-n}}))}else r&&(u.textRuns=[{st:0,ed:t-n,ts:{}}]);const d=[];for(const I of c){const M=G.deepClone(I),{startIndex:L,endIndex:j}=M;L>=n&&j<=t&&d.push({...M,startIndex:L-n,endIndex:j-n})}d.length&&(u.tables=d);const f=[];for(const I of a){const{startIndex:M}=I;M>=n&&M<t&&f.push(G.deepClone(I))}f.length&&(u.paragraphs=f.map(I=>({...I,startIndex:I.startIndex-n})));const p=[];for(const I of h){const{startIndex:M}=I;M>=n&&M<=t&&p.push(G.deepClone(I))}if(p.length&&(u.sectionBreaks=p.map(I=>({...I,startIndex:I.startIndex-n}))),s===1){const I=xu(e,n,t);I?u.customDecorations=I:r&&(u.customDecorations=[])}const{customRanges:E}=Lu(e,n,t);E?u.customRanges=E:r&&(u.customRanges=[]);const v=[];for(const I of l){const{startIndex:M}=I;M>=n&&M<=t&&v.push(G.deepClone(I))}return v.length&&(u.customBlocks=v.map(I=>({...I,startIndex:I.startIndex-n}))),u}function N_(e){const{dataStream:n,textRuns:t,paragraphs:r,customRanges:s,customDecorations:i,tables:o}=e;let a=0,l=0;s==null||s.forEach(h=>{h.startIndex<0&&(a=Math.max(a,-h.startIndex)),h.endIndex>n.length-1&&(l=Math.max(l,h.endIndex-n.length+1))});const c=`${n}`;return t&&(t[0]&&(t[0].st=t[0].st-a),t[t.length-1]&&(t[t.length-1].ed=t[t.length-1].ed+l)),t==null||t.forEach(h=>{h.st+=a,h.ed+=a}),r==null||r.forEach(h=>{h.startIndex+=a}),s==null||s.forEach(h=>{h.startIndex+=a,h.endIndex+=a}),i==null||i.forEach(h=>{h.startIndex+=a,h.endIndex+=l}),o==null||o.forEach(h=>{h.startIndex+=a,h.endIndex+=l}),{...e,dataStream:c,textRuns:t,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function Lu(e,n,t){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,n)<=Math.min(a.endIndex,t-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,n),endIndex:Math.min(a.endIndex,t-1)})).map(a=>({...a,startIndex:a.startIndex-n,endIndex:a.endIndex-n})),leftOffset:0,rightOffset:0}}function xu(e,n,t){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,n)<=Math.min(i.endIndex,t-1)){const o=G.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-n,0),endIndex:Math.min(o.endIndex,t-1)-n})}}),s}function M_(e,n,t){return e==null||n==null?e!=null?e:n:Du(e,n,t)}function D_(e,n,t){if(e==null||n==null)return e!=null?e:n;if(n.length===0||e.length===0)return e;if(n.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return t===Le.REPLACE?[{...e[0]}]:[{...n[0],...e[0]}]}function L_(e,n,t){return n.length===0||e.length===0||t===Le.REPLACE?e:[...e,...n.filter(r=>!e.some(s=>r.id===s.id))]}function Hs(e,n,t=Le.COVER){if(n.dataStream!=="")throw new Error("Cannot compose other body with non-empty dataStream");const r={dataStream:e.dataStream},{textRuns:s,paragraphs:i=[],customRanges:o,customDecorations:a=[]}=e,{textRuns:l,paragraphs:c=[],customRanges:h,customDecorations:u=[]}=n;r.textRuns=M_(l,s,t),r.customRanges=D_(h,o,t);const d=L_(u,a,t);d.length&&(r.customDecorations=d);const f=[];let p=0,E=0;for(;p<i.length&&E<c.length;){const v=i[p],I=c[E],{startIndex:M}=v,{startIndex:L}=I;M===L?(f.push(G.deepMerge(v,I)),p++,E++):M<L?(f.push(G.deepClone(v)),p++):(f.push(G.deepClone(I)),E++)}return p<i.length&&f.push(...i.slice(p)),E<c.length&&f.push(...c.slice(E)),f.length&&(r.paragraphs=f),r}function x_(e){const{body:n}=e;if(n==null)return!0;const{textRuns:t,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=n;return t==null&&r==null&&s==null&&i==null&&o==null&&a==null}class Rn{constructor(n){R(this,"_index",0);R(this,"_offset",0);this._actions=n}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(n){n||(n=Number.POSITIVE_INFINITY);const t=this._actions[this._index];if(t){const r=this._offset,s=t.len;return n>=s-r?(n=s-r,this._index+=1,this._offset=0):this._offset+=n,t.t===ie.DELETE||t.t===ie.RETAIN&&t.body==null?G.deepClone({...t,len:n}):G.deepClone({...t,len:n,body:qt(t.body,r,r+n,!1)})}else return{t:ie.RETAIN,len:Number.POSITIVE_INFINITY}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:Number.POSITIVE_INFINITY}peekType(){const n=this._actions[this._index];return n?n.t:ie.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const n=this._offset,t=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=n,this._index=t,[r].concat(s)}}else return[]}}function Uu(e,n,t){const{dataStream:r}=e,s=t,i=t+n,o=Kl(e,n,t),a=Xl(e,n,t),l=Ql(e,n,t),c=Jl(e,n,t),h=Zl(e,n,t),u=E_(e,n,t),d=C_(e,n,t);let f="";return r&&(e.dataStream=xl(r,s,i),f=r.slice(s,i)),{dataStream:f,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:h,customRanges:u,customDecorations:d}}function Pu(e,n,t,r){e.dataStream=Ll(e.dataStream,r,n.dataStream),Hl(e,n,t,r),Bl(e,n,t,r),Wl(e,n,t,r),Yl(e,n,t,r),zl(e,n,t,r),p_(e,n,t,r),__(e,n,t,r)}function U_(e,n,t,r,s=Le.COVER){return I_(e,n,t,r,s)}function P_(e,n,t){return n<=0?{dataStream:""}:Uu(e,n,t)}function k_(e,n,t,r){t!==0&&Pu(e,n,t,r)}function F_(e,n){const t=new Ln;return t.reset(),n.forEach(r=>{const s=G.deepClone(r);switch(s.t){case ie.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&U_(e,o,a,t.cursor,i),t.moveCursor(a);break}case ie.INSERT:{const{body:i,len:o}=s;k_(e,i,o,t.cursor),t.moveCursor(o);break}case ie.DELETE:{const{len:i}=s;P_(e,i,t.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function $_(e,n,t,r,s){if(e==null||n==null)return n;if(e.length===0||n.length===0)return[];n=G.deepClone(n),e=G.deepClone(e);const i=[],o=n.length,a=e.length;let l=0,c=0,h=null;function u(){return h?(i.push(h),h=null,!0):!1}for(;l<o&&c<a;){const{st:E,ed:v,ts:I}=n[l],{st:M,ed:L,ts:j,sId:y}=e[c];let w={};if(s===0)w={...I},t===Le.COVER&&r===Le.REPLACE&&j&&(w=Object.assign({},j,w));else if(w={...I},t===Le.REPLACE){if(r===Le.REPLACE)w={...j};else if(I&&j){const x=Object.keys(I);for(const B of x)j[B]&&delete w[B]}}else if(r===Le.REPLACE){if(j){const x=Object.keys(j);for(const B of x)j[B]!==void 0&&(w[B]=j[B])}}else if(j){const x=Object.keys(j);for(const B of x)w[B]!==void 0&&delete w[B]}if(v<M)u()||i.push(n[l]),l++;else if(L<E)u()||i.push(e[c]),c++;else{const x={st:Math.min(E,M),ed:Math.max(E,M),ts:E<M?{...I}:{...j},sId:E<M?void 0:y};x.ed>x.st&&i.push(),i.push({st:Math.max(E,M),ed:Math.min(v,L),ts:w,sId:y}),v<L?(l++,e[c].st=v,e[c].st===e[c].ed&&c++):(c++,n[l].st=L,n[l].st===n[l].ed&&l++);const B={st:Math.min(v,L),ed:Math.max(v,L),ts:v<L?{...j}:{...I},sId:v<L?y:void 0};h=B.ed>B.st?B:null}}u();const d=i[i.length-1],f=n[o-1],p=e[a-1];return d.ed!==Math.max(f.ed,p.ed)&&(f.ed>p.ed?i.push(f):i.push(p)),fr(i,!0)}function j_(e,n,t,r,s){if(e==null||n==null)return n;if(e.length===0||n.length===0)return[];if(e.length>1||n.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=n[0];if(t===Le.REPLACE)return s===1?[G.deepClone(i)]:[G.deepClone(o)];if(r===Le.REPLACE){const a=G.deepClone(o);return s===1&&Object.assign(a,G.deepClone(i)),[a]}else{const a=G.deepClone(o);return s===1&&Object.assign(a,G.deepClone(i)),[a]}}function Ao(e,n,t,r,s){const i={startIndex:n.startIndex};if(n.paragraphStyle&&(i.paragraphStyle=G.deepClone(n.paragraphStyle),e.paragraphStyle)){if(t===Le.REPLACE)if(r===Le.REPLACE)s===1&&(i.paragraphStyle={...e.paragraphStyle});else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(r===Le.REPLACE)if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]&&delete i.paragraphStyle[a]}}return t===Le.REPLACE&&r===Le.REPLACE?i.bullet=s===1?G.deepClone(e.bullet):G.deepClone(n.bullet):e.bullet===void 0?i.bullet=G.deepClone(n.bullet):t===Le.REPLACE||r===Le.REPLACE?i.bullet=s===0&&n.bullet?G.deepClone(n.bullet):G.deepClone(e.bullet):s===0&&n.bullet!==void 0&&(i.bullet=G.deepClone(n.bullet)),i}function H_(e,n){if(e==null||n==null)return n;if(e.length===0||n.length===0)return G.deepClone(n);const t=[];for(const r of n){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===ln.DELETED||i===ln.DELETED)&&(o=!0,t.push({...r,type:ln.DELETED}));break}o||t.push(r)}return t}function B_(e,n,t=!1){const{body:r,coverType:s=Le.COVER}=e,{body:i,coverType:o=Le.COVER}=n;if(r==null||r.dataStream!==""||i==null||i.dataStream!=="")throw new Error("Data stream is not supported in retain transform.");const a={dataStream:""},l=o,{textRuns:c,paragraphs:h=[],customRanges:u,customDecorations:d}=r,{textRuns:f,paragraphs:p=[],customRanges:E,customDecorations:v}=i,I=$_(c,f,s,o,t?1:0);I&&(a.textRuns=I);const M=j_(u,E,s,o,t?1:0);M&&(a.customRanges=M);const L=H_(d,v);L&&(a.customDecorations=L);const j=[];let y=0,w=0;for(;y<h.length&&w<p.length;){const x=h[y],B=p[w],{startIndex:ue}=x,{startIndex:q}=B;if(ue===q){let oe={startIndex:ue};t?oe=Ao(x,B,s,o,1):oe=Ao(x,B,s,o,0),j.push(oe),y++,w++}else ue<q?y++:(j.push(G.deepClone(B)),w++)}return w<p.length&&j.push(...p.slice(w)),j.length&&(a.paragraphs=j),{coverType:l,body:a}}function To(e){return Object.keys(e).length===1}const yn=class yn{constructor(){R(this,"_actions",[])}static apply(n,t){return F_(n,t)}static compose(n,t){const r=new Rn(n),s=new Rn(t),i=new yn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===ie.INSERT)i.push(s.next());else if(r.peekType()===ie.DELETE)i.push(r.next());else{const o=Math.min(r.peekLength(),s.peekLength()),a=r.next(o),l=s.next(o);if(a.t===ie.INSERT&&l.t===ie.RETAIN)l.body==null?i.push(a):i.push({...a,body:Hs(a.body,l.body,l.coverType)});else if(a.t===ie.RETAIN&&l.t===ie.RETAIN)if(a.body==null&&l.body==null)i.push(a.len!==Number.POSITIVE_INFINITY?a:l);else if(a.body&&l.body){const c=a.coverType===Le.REPLACE||l.coverType===Le.REPLACE?Le.REPLACE:Le.COVER;i.push({...a,t:ie.RETAIN,coverType:c,body:Hs(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===ie.RETAIN&&l.t===ie.DELETE?i.push(l):a.t===ie.INSERT&&(l.t,ie.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(n,t,r="right"){return this._transform(t,n,r==="left"?"right":"left")}static _transform(n,t,r="right"){const s=new Rn(n),i=new Rn(t),o=new yn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===ie.INSERT&&(r==="left"||i.peekType()!==ie.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===ie.INSERT)o.push(i.next());else{const a=Math.min(s.peekLength(),i.peekLength()),l=s.next(a),c=i.next(a);if(l.t===ie.DELETE)continue;if(c.t===ie.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:h,body:u}=B_(l,c,r==="left");o.push({...c,t:ie.RETAIN,coverType:h,body:u})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(n,t,r=!1){const s=new Rn(n);let i=0;for(;s.hasNext()&&i<=t;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===ie.DELETE){t-=Math.min(o,t-i);continue}else a===ie.INSERT&&(i<t||!r)&&(t+=o);i+=o}return t}static isNoop(n){return n.length===0}static invert(n){const t=[];for(const r of n)if(r.t===ie.INSERT)t.push({t:ie.DELETE,len:r.len,body:r.body});else if(r.t===ie.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");t.push({t:ie.INSERT,body:r.body,len:r.len})}else if(r.body!=null){if(r.oldBody==null)throw new Error("Can not invert RETAIN action without oldBody property, makeInvertible must be called first.");t.push({t:ie.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:Le.REPLACE})}else t.push(r);return t}static makeInvertible(n,t){const r=[];let s=0;for(const i of n){if(i.t===ie.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=qt(t,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===ie.RETAIN&&i.body!=null){const o=qt(t,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==ie.INSERT&&(s+=i.len)}return r}insert(n,t){const r={t:ie.INSERT,body:t,len:n};return this.push(r),this}retain(n,t,r){const s={t:ie.RETAIN,len:n};return t!=null&&(s.body=t),r!=null&&(s.coverType=r),this.push(s),this}delete(n){const t={t:ie.DELETE,len:n};return this.push(t),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...n){if(n.length>1){for(const i of n)this.push(i);return this}let t=this._actions.length,r=this._actions[t-1];const s=G.deepClone(n[0]);if(s.t===ie.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===ie.DELETE&&s.t===ie.DELETE)return r.len+=s.len,this;if(r.t===ie.DELETE&&s.t===ie.INSERT&&(t-=1,r=this._actions[t-1],r==null))return this._actions.unshift(s),this;if(r.t===ie.RETAIN&&s.t===ie.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===ie.INSERT&&To(r.body)&&s.t===ie.INSERT&&To(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return t===this._actions.length?this._actions.push(s):this._actions.splice(t,0,s),this}trimEndUselessRetainAction(){let n=this._actions[this._actions.length-1];for(;n&&n.t===ie.RETAIN&&x_(n);)this._actions.pop(),n=this._actions[this._actions.length-1];return this}};R(yn,"id","text-x"),R(yn,"uri","https://github.com/dream-num/univer#text-x");let nt=yn;Object.defineProperty(nt,"name",{value:"text-x"});const wn=class wn{static registerSubtype(n){var t;n==null||this._subTypes.has(n.name)&&((t=this._subTypes.get(n.name))==null?void 0:t.id)!==nt.id||(this._subTypes.set(n.name,n),mt.type.registerSubtype(n))}static apply(n,t){if(!mt.type.isNoop(t))return mt.type.apply(n,t)}static compose(n,t){return mt.type.compose(n,t)}static transform(n,t,r){return mt.type.transform(n,t,r)}static transformPosition(n,t,r="right"){return n&&n.length===2&&n[0]==="body"&&n[1].et===nt.name?nt.transformPosition(n[1].e,t,r==="left"):t}static invertWithDoc(n,t){return mt.type.invertWithDoc(n,t)}static isNoop(n){return mt.type.isNoop(n)}static getInstance(){return this._instance==null&&(this._instance=new wn),this._instance}removeOp(n,t){return mt.removeOp(n,t)}moveOp(n,t){return mt.moveOp(n,t)}insertOp(n,t){return mt.insertOp(n,t)}replaceOp(n,t,r){return mt.replaceOp(n,t,r)}editOp(n,t=["body"]){return mt.editOp(t,nt.name,n)}};R(wn,"uri","https://github.com/dream-num/univer#json-x"),R(wn,"_subTypes",new Map),R(wn,"_instance",null);let fn=wn;fn.registerSubtype(nt);const yi={id:"default_doc",documentStyle:{}};class W_ extends es{constructor(t){var r;super();R(this,"type",ke.UNIVER_DOC);R(this,"_name$",new Ee.BehaviorSubject(""));R(this,"name$",this._name$.asObservable());R(this,"snapshot");this.snapshot={...yi,...t},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var t;return(t=this.snapshot.rev)!=null?t:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(t){this.snapshot.rev=t}setName(t){this.snapshot.title=t,this._name$.next(t)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var t;return((t=this.snapshot.settings)==null?void 0:t.zoomRatio)||1}resetDrawing(t,r){this.snapshot.drawings=t,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const t=(s=this.snapshot.lists)!=null?s:{};return{...mr,...t}}updateDocumentId(t){this.snapshot.id=t}updateDocumentRenderConfig(t){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=t:r.renderConfig={...r.renderConfig,...t}}updateDocumentStyle(t){this.snapshot.documentStyle==null?this.snapshot.documentStyle=t:this.snapshot.documentStyle={...this.snapshot.documentStyle,...t}}updateDocumentDataMargin(t){const{t:r,l:s,b:i,r:o}=t,{documentStyle:a}=this.snapshot;r!=null&&(a.marginTop=r),s!=null&&(a.marginLeft=s),i!=null&&(a.marginBottom=i),o!=null&&(a.marginRight=o)}updateDocumentDataPageSize(t,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){t=t!=null?t:Number.POSITIVE_INFINITY,r=r!=null?r:Number.POSITIVE_INFINITY,s.pageSize={width:t,height:r};return}t!==void 0&&(s.pageSize.width=t),r!==void 0&&(s.pageSize.height=r)}updateDrawing(t,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[t];if(!c)return;const h=c.docTransform;h.size.width=i,h.size.height=o,h.positionH.posOffset=a,h.positionV.posOffset=l}setZoomRatio(t=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:t}:this.snapshot.settings.zoomRatio=1}}class Wt extends W_{constructor(t){var s,i;super(G.isEmptyObject(t)?u_():t);R(this,"_unitId");R(this,"headerModelMap",new Map);R(this,"footerModelMap",new Map);const r=6;this._unitId=(s=this.snapshot.id)!=null?s:G.generateRandomId(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(t=>{t.dispose()}),this.footerModelMap.forEach(t=>{t.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var t;return(t=this.snapshot.body)==null?void 0:t.customRanges}getCustomDecorations(){var t;return(t=this.snapshot.body)==null?void 0:t.customDecorations}getSettings(){return this.snapshot.settings}reset(t){if(t.id&&t.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...yi,...t},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(t){if(t!=null){if(this.headerModelMap.has(t))return this.headerModelMap.get(t);if(this.footerModelMap.has(t))return this.footerModelMap.get(t)}return this}getUnitId(){return this._unitId}apply(t){if(!fn.isNoop(t))return this.snapshot=fn.apply(this.snapshot,t),t!=null&&t.some(r=>Array.isArray(r)&&((r==null?void 0:r[0])==="headers"||(r==null?void 0:r[0])==="footers"))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.snapshot}sliceBody(t,r,s=Oi.copy){const i=this.getBody();if(i!=null)return qt(i,t,r,!1,s)}_initializeHeaderFooterModel(){const{headers:t,footers:r}=this.getSnapshot();if(t)for(const s in t){const i=t[s];this.headerModelMap.set(s,new Wt(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new Wt(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(t){super.updateDocumentId(t),this._unitId=t}}const Y_="0.5.0-beta.0";function z_(e="",n=hr.ZH_CN,t=""){return{id:e,sheetOrder:[],name:t,appVersion:Y_,locale:n,styles:{},sheets:{},resources:[]}}class ku{constructor(n={}){R(this,"_styles");R(this,"_cacheMap",new $r(1e5));this._styles=n,this._generateCacheMap()}each(n){return Object.entries(this._styles).forEach(n),this}search(n,t){if(this._cacheMap.has(t))return this._cacheMap.get(t);const r=this._getExistingStyleId(n);return r||"-1"}get(n){return typeof n!="string"?n:(n=String(n),this._styles[n])}add(n,t){const r=G.generateRandomId(6);return this._styles[r]=n,this._cacheMap.set(t,r),r}setValue(n){if(n==null)return;const t=JSON.stringify(n),r=this.search(n,t);return r!=="-1"?r:this.add(n,t)}toJSON(){return this._styles}getStyleByCell(n){let t;n&&G.isObject(n.s)?t=n.s:t=(n==null?void 0:n.s)&&this.get(n.s);const r=n==null?void 0:n.interceptorStyle;return r?{...t,...r}:t}_generateCacheMap(){const{_styles:n,_cacheMap:t}=this;for(const r in n){const s=JSON.stringify(n[r]);t.set(s,r)}}_getExistingStyleId(n){const{_styles:t}=this;for(const r in t)if(G.diffValue(t[r],n))return r;return null}}function V_(e){const{ranges:n,id:t,type:r}=e,s=new nt;let i=0;for(let o=0;o<n.length;o++){const a=n[o],{startOffset:l,endOffset:c}=a;l>0&&s.push({t:ie.RETAIN,len:l-i}),s.push({t:ie.RETAIN,body:{dataStream:"",customDecorations:[{id:t,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function G_(e){var h,u,d;const{id:n,segmentId:t,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(d=(u=(h=r.getSelfOrHeaderFooterModel(t))==null?void 0:h.getBody())==null?void 0:u.customDecorations)==null?void 0:d.find(f=>f.id===n);if(!i)return!1;const o=new nt,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:ie.RETAIN,len:a}),o.push({t:ie.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:n,type:ln.DELETED}]}}),o}function Fu(e,n,t,r){return e<=t&&n>=t||e>=t&&e<=r}function K_(e,n){const t=[];for(let r=0,s=n.length;r<s;r++){const i=n[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&t.push(i):Fu(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&t.push(i)}return t}function X_(e){return{...G.deepClone(e),rangeId:hn()}}function Q_(e,n){const t=[];let r=e[0];for(const s of n)s<e[0]||s>e[1]||(r<s&&t.push([r,s-1]),r=s+1);return r<=e[1]&&t.push([r,e[1]]),t}function $u(e,n,t,r){const s=[];for(let i=0,o=t.length;i<o;i++){const a=t[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,n)&&s.push({...a}),a.startIndex>n)break}return s}function J_(e,n){var i,o,a,l,c;const t=$u(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=n.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=t[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((c=(l=t[t.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}const Z_=e=>{var u,d,f;const{paragraphs:n,segmentId:t,document:r}=e;let s=e.listType;const i=(d=(u=r.getSelfOrHeaderFooterModel(t).getBody())==null?void 0:u.paragraphs)!=null?d:[],o=n.every(p=>{var E;return((E=p.bullet)==null?void 0:E.listType.indexOf(s))===0});let l=G.generateRandomId(6);if(n.length===1){const p=i.indexOf(n[0]),E=i[p-1],v=i[p+1];E&&E.bullet&&E.bullet.listType.indexOf(s)===0?(l=E.bullet.listId,s!==kt.CHECK_LIST&&(s=E.bullet.listType)):v&&v.bullet&&v.bullet.listType.indexOf(s)===0&&(l=v.bullet.listId,s!==kt.CHECK_LIST&&(s=v.bullet.listType))}const c=new Ln;c.reset();const h=new nt;for(const p of n){const{startIndex:E,paragraphStyle:v={},bullet:I}=p;h.push({t:ie.RETAIN,len:E-c.cursor}),h.push({t:ie.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:v,startIndex:0}:{startIndex:0,paragraphStyle:{...v},bullet:{nestingLevel:(f=I==null?void 0:I.nestingLevel)!=null?f:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Le.REPLACE}),c.moveCursorTo(E+1)}return h},q_=e=>{var u;const{paragraphIndex:n,segmentId:t,document:r}=e,s=(u=r.getSelfOrHeaderFooterModel(t).getBody())==null?void 0:u.paragraphs;if(s==null)return!1;const i=s.find(d=>d.startIndex===n);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(kt.CHECK_LIST)===-1)return!1;const o=new Ln;o.reset();const a=new nt,{startIndex:l,paragraphStyle:c={}}=i,h=i.bullet.listType===kt.CHECK_LIST?kt.CHECK_LIST_CHECKED:kt.CHECK_LIST;return a.push({t:ie.RETAIN,len:l-o.cursor}),a.push({t:ie.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:h}}]},coverType:Le.REPLACE}),o.moveCursorTo(l+1),a},eE=e=>{var h,u;const{paragraphs:n,listType:t,segmentId:r,document:s}=e;if(((h=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:h.paragraphs)==null)return!1;const a=G.generateRandomId(6),l=new Ln;l.reset();const c=new nt;for(const d of n){const{startIndex:f,paragraphStyle:p={},bullet:E}=d;c.push({t:ie.RETAIN,len:f-l.cursor}),c.push({t:ie.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:p,bullet:{nestingLevel:(u=E==null?void 0:E.nestingLevel)!=null?u:0,textStyle:(E==null?void 0:E.listType)===t?E.textStyle:{fs:20},listType:t,listId:a}}]},coverType:Le.REPLACE}),l.moveCursorTo(f+1)}return c};function tE(e,n){return n.some(t=>e.startIndex>t.startIndex&&e.startIndex<t.endIndex)}const nE=e=>{var h,u,d;const{paragraphs:n,segmentId:t,document:r,type:s}=e,i=new Ln;i.reset();const o=new nt,a=(h=r.getSnapshot().lists)!=null?h:{},l=(d=(u=r.getBody())==null?void 0:u.tables)!=null?d:[],c={...mr,...a};for(const f of n){const{startIndex:p,paragraphStyle:E={},bullet:v}=f,I=tE(f,l);if(o.push({t:ie.RETAIN,len:p-i.cursor}),v){const M=v.listType;let L=c[M].nestingLevel.length-1;I&&(L=Math.min(L,2)),o.push({t:ie.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...E},bullet:{...v,nestingLevel:Math.max(Math.min(v.nestingLevel+s,L),0)}}]},coverType:Le.REPLACE})}else o.push({t:ie.RETAIN,len:1});i.moveCursorTo(p+1)}return o};var ju=(e=>(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))(ju||{}),jt=(e=>(e.PARAGRAPH="\r",e.SECTION_BREAK=`
9
+ `,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))(jt||{});function rE(e){return`${e}`}const sE=[jt.TABLE_START,jt.TABLE_ROW_START,jt.TABLE_CELL_START,jt.TABLE_CELL_END,jt.TABLE_ROW_END,jt.TABLE_END,jt.CUSTOM_BLOCK],Hu=e=>{const n=e.endsWith(`\r
10
+ `)?e.slice(0,-2):e;return sE.reduce((t,r)=>t.replaceAll(r,""),n)},iE=e=>e?Hu(e).replaceAll("\r","")==="":!0,oE=e=>{const n=e.replace(/\n/g,"\r"),t=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const h=n.slice(s,l);if(G.isLegalUrl(h)){const u=hn(),d=`${h}`,f={startIndex:s,endIndex:s+d.length-1,rangeId:u,rangeType:tr.HYPERLINK,properties:{url:e}};r.push(f),i+=d,s=l+1,c&&(i+="\r",t.push({startIndex:l}))}else i+=n.slice(s,l+1),s=l+1,c&&t.push({startIndex:l})};let a=0;for(let l=0;l<n.length;l++)n[l]==="\r"&&(o(l),a=l);return a!==n.length-1&&o(n.length,!1),{dataStream:i,paragraphs:t,customRanges:r}};function aE(e,n){if(typeof n>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(n<e)throw new Error(`Cannot make a doc selection when endOffset ${n} is less than startOffset ${e}.`);return{startOffset:e,endOffset:n,collapsed:e===n}}function lE(e){const{startOffset:n,endOffset:t,collapsed:r}=e,s=Math.min(n,t),i=Math.max(n,t);return{startOffset:s,endOffset:i,collapsed:r}}function uE(e,n,t,r){return Math.max(e,t)<=Math.min(n,r)}function cE(e,n){var d,f,p;const{rangeId:t,segmentId:r,documentDataModel:s,insert:i}=n,o=(f=(d=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:d.customRanges)==null?void 0:f.find(E=>E.rangeId===t);if(!o)return!1;const{startIndex:a,endIndex:l}=o,c=new nt,h=l-a+1;c.push({t:ie.RETAIN,len:a}),c.push({t:ie.RETAIN,len:h,body:{dataStream:"",customRanges:[]}}),i&&c.push({t:ie.INSERT,body:i,len:i.dataStream.length});const u=l+1+((p=i==null?void 0:i.dataStream.length)!=null?p:0);return c.selections=[{startOffset:u,endOffset:u,collapsed:!0}],c}function hE(e){var v,I;const{range:n,rangeId:t,rangeType:r,wholeEntity:s,properties:i,body:o}=e,a=J_(n,o);if(!a||!o)return!1;const{startOffset:l,endOffset:c}=a,h=(v=o.customRanges)!=null?v:[];let u=0;const d=new nt,f=(M,L,j)=>{var ue,q,oe,be;const y=$u(M,L,h,r),w=Math.min((q=(ue=y[0])==null?void 0:ue.startIndex)!=null?q:1/0,M),x=Math.max((be=(oe=y[y.length-1])==null?void 0:oe.endIndex)!=null?be:-1/0,L),B={rangeId:j?`${t}-${j}`:t,rangeType:r,startIndex:0,endIndex:x-w,wholeEntity:s,properties:{...i}};d.push({t:ie.RETAIN,len:w-u}),d.push({t:ie.RETAIN,len:x-w+1,body:{dataStream:"",customRanges:[B]},coverType:Le.COVER}),u=x+1},p=((I=o.paragraphs)!=null?I:[]).filter(M=>M.startIndex<c&&M.startIndex>l);return Q_([l,c-1],p.map(M=>M.startIndex)).forEach(([M,L],j)=>f(M,L,j)),d.selections=[{startOffset:a.endOffset,endOffset:a.endOffset,collapsed:!0}],d}function dE(e,n,t=0,r=null,s=!0){e.sort((c,h)=>c.startOffset-h.startOffset);const i=[],{paragraphs:o=[]}=n,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=t;if(e.forEach(c=>{const{startOffset:h,endOffset:u}=c;h>l&&(i.push({t:ie.RETAIN,len:h-l}),l=h),l<u&&(i.push({t:ie.DELETE,len:u-l}),l=u)}),r&&i.push({t:ie.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(h=>h.startIndex-t>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:ie.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:ie.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Le.REPLACE}))}return i}const fE=e=>{var u;const{selection:n,body:t,doc:r}=e,s=n.segmentId,i=(u=r.getSelfOrHeaderFooterModel(s))==null?void 0:u.getBody();if(!i)return!1;const o=n.collapsed?null:qt(i,n.startOffset,n.endOffset),a=ga(o?o.dataStream:"",t.dataStream);let l=0;const c=a.map(([d,f])=>{switch(d){case 0:{const p={t:ie.RETAIN,body:{...qt(t,l,l+f.length,!1),dataStream:""},len:f.length};return l+=f.length,p}case 1:{const p={t:ie.INSERT,body:qt(t,l,l+f.length),len:f.length};return l+=f.length,p}default:return{t:ie.DELETE,len:f.length}}}),h=new nt;return h.push({t:ie.RETAIN,len:n.startOffset}),h.push(...c),h};class Lt{}R(Lt,"customRange",{add:hE,delete:cE,copyCustomRange:X_,getCustomRangesInterestsWithSelection:K_,isIntersecting:Fu}),R(Lt,"customDecoration",{add:V_,delete:G_}),R(Lt,"selection",{replace:fE,makeSelection:aE,normalizeSelection:lE,delete:dE}),R(Lt,"range",{isIntersects:uE}),R(Lt,"transform",{getPlainText:Hu,fromPlainText:oE,isEmptyDocument:iE}),R(Lt,"paragraph",{bullet:{set:eE,switch:Z_,toggleChecklist:q_,changeNestLevel:nE}});const gE=(e,n)=>n.length===e.length&&!e.some(t=>n.some(r=>!en.equals(r,t))),mE=(e,n)=>n.length===e.length&&e.every((t,r)=>{const s=n[r];return s.unitId===t.unitId&&s.sheetId===t.sheetId&&en.equals(t.range,s.range)}),Bs={t:0,b:2,l:2,r:2},pE=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),No=90;function Or(e,n,t={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Xt.UNSPECIFIED,verticalAlign:a=an.UNSPECIFIED,wrapStrategy:l=cn.UNSPECIFIED,cellValueType:c}=t,{t:h,r:u,b:d,l:f}=i||Bs,{vertexAngle:p,centerAngle:E}=Wu(s),v={id:"d",body:{dataStream:`${e}${pa}`,textRuns:[{ts:n,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:h,marginBottom:d,marginRight:u,marginLeft:f,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:E,vertexAngle:p,wrapStrategy:l,cellValueType:c}},drawings:{},drawingsOrder:[]};return new Wt(v)}function _E(e){if(!e)return{};const{tr:n,td:t,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:n,textDirection:t,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function Mo(e){if(!e)return{};const{ff:n,fs:t,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return n&&(c.ff=n),t&&(c.fs=t),r&&(c.it=r),s&&(c.bl=s),i&&(c.ul=i),o&&(c.st=o),a&&(c.ol=a),l&&(c.cl=l),c}function Bu(e,n,t){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===tr.HYPERLINK))return;const s=Lt.customRange.add({range:{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1},rangeId:t,rangeType:tr.HYPERLINK,body:r,properties:{url:n,refId:t}});s&&nt.apply(r,s.serialize())}const EE='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Do(e){const n=ct.ff,t=ct.fs;if(!e){const u=`${t}pt ${n}`;return{fontCache:u,fontString:u,fontSize:t,originFontSize:t,fontFamily:n}}let r=Sn.ITALIC;(e.it===0||e.it===void 0)&&(r=Sn.NORMAL);let s=Sn.BOLD;(e.bl===0||e.bl===void 0)&&(s=Sn.NORMAL);let i=t;e.fs&&(i=Math.ceil(e.fs));let o=n;if(e.ff){let u=e.ff;u=u.replace(/"/g,"").replace(/'/g,""),u.indexOf(" ")>-1&&(u=`"${u}"`),u==null&&(u=n),o=u}const{va:a}=e;let l=i;if(a===Bt.SUBSCRIPT||a===Bt.SUPERSCRIPT){const u=CE(o,l),{sbr:d,spr:f}=u;l*=a===Bt.SUBSCRIPT?d:f}const c=`${r} ${s} ${l}pt ${o}`,h=`${c}, ${EE} `;return{fontCache:c,fontString:h,fontSize:l,originFontSize:i,fontFamily:o}}function CE(e,n){return pE(n)}function Wu(e){const{a:n=0,v:t=Ae.FALSE}=e||{a:0,v:Ae.FALSE};let r=0,s=n;return t===Ae.TRUE&&(r=No,s=No),{centerAngle:r,vertexAngle:s}}class RE{constructor(n,t){R(this,"_columnData",{});this._config=n,this._columnData=t}getColumnData(){return this._columnData}getColVisible(n){const{_columnData:t}=this,r=t[n];return r?r.hd!==Ae.TRUE:!0}getColumnStyle(n){var t;return(t=this._columnData[n])==null?void 0:t.s}setColumnStyle(n,t){const r=this.getColumnOrCreate(n);r.s=t}getHiddenCols(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:we.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:t,rangeType:we.COLUMN}),r}getVisibleCols(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:we.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:t,rangeType:we.COLUMN}),r}getColumnDatas(n,t){const r={};let s=0;for(let i=n;i<n+t;i++){const o=this.getColumnOrCreate(i);r[s]=o,s++}return r}getSize(){return Zt(this._columnData)}getColumnWidth(n){const{_columnData:t}=this,r=this._config;let s=0;return s=(t[n]||{hd:Ae.FALSE,w:r.defaultColumnWidth}).w||r.defaultColumnWidth,s}getColumn(n){const t=this._columnData[n];if(t)return t}removeColumn(n){delete this._columnData[n]}getColumnOrCreate(n){const{_columnData:t}=this,r=t[n];if(r)return r;const s={};return this._columnData[n]=s,s}}class vE{constructor(n,t,r){R(this,"_rowData");this._config=n,this._viewModel=t,this._rowData=r}getRowData(){return this._rowData}getRowStyle(n){var t;return(t=this._rowData[n])==null?void 0:t.s}setRowStyle(n,t){const r=this.getRowOrCreate(n);r.s=t}getRowDatas(n,t){const r={};let s=0;for(let i=n;i<n+t;i++){const o=this.getRowOrCreate(i);r[s]=o,s++}return r}getRowHeight(n,t=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<t;o++){const a=r[o+n]||{hd:Ae.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h=s.defaultRowHeight}=a;i+=(l==null||l===Ae.TRUE)&&typeof c=="number"?c:h}return i}getRow(n){return this._rowData[n]}removeRow(n){delete this._rowData[n]}getRowOrCreate(n){const{_rowData:t}=this,r=t[n];if(r)return r;const s={};return t[n]=s,s}getHiddenRows(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:we.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:we.ROW}),r}getVisibleRows(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:we.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:we.ROW}),r}getRowRawVisible(n){const t=this.getRow(n);return t?t.hd!==Ae.TRUE:!0}getSize(){return Zt(this._rowData)}}const IE="DEFAULT_WORKSHEET_ROW_COUNT",Yu=1e3,SE="DEFAULT_WORKSHEET_COLUMN_COUNT",zu=20,OE="DEFAULT_WORKSHEET_ROW_HEIGHT",Vu=24,yE="DEFAULT_WORKSHEET_COLUMN_WIDTH",Gu=88,wE="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",Ku=46,bE="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",Xu=20;function Qu(e){const n={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:Ae.FALSE,rowCount:Yu,columnCount:zu,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Gu,defaultRowHeight:Vu,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:Ae.TRUE,rowHeader:{width:Ku,hidden:Ae.FALSE},columnHeader:{height:Xu,hidden:Ae.FALSE},rightToLeft:Ae.FALSE};return Object.keys(n).forEach(t=>{const r=t;typeof e[r]>"u"&&(e[r]=n[r])}),e}class AE extends rt{constructor(t){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");R(this,"_rangeMap",new $r(5e4));R(this,"_skeletonCache",new $r(5e4));this._init(t.concat())}_init(t){this._mergeData=t,this._createCache(t)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._skeletonCache.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(t){let r=0;for(const s of t){const{rangeType:i}=s;i===we.ROW?this._createRowCache(s,r):i===we.COLUMN?this._createColumnCache(s,r):i===we.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(t){this._clearCache(),this._init(t.concat())}_createRowCache(t,r){const{startRow:s,endRow:i}=t;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(t,r){const{startColumn:s,endColumn:i}=t;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(t){this._hasAll=!0,this._allIndex=t}_createCellCache(t,r){for(let s=t.startRow;s<=t.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=t.startColumn;o<=t.endColumn;o++)i.set(o,r)}}add(t){this._mergeData.push(t),this._clearCache(),this._createCache(this._mergeData)}remove(t,r){const s=this._getMergeDataIndex(t,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(t,r){const s=this._getMergeDataIndex(t,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(t,r){return this._getMergeDataIndex(t,r)}isRowContainsMergedCell(t){return this._hasAll||!G.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=t&&t<=r.endRow)}isColumnContainsMergedCell(t){return this._hasAll||!G.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=t&&t<=r.endColumn)}getMergedCellRange(t,r,s,i){const o=[],a=`${t}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const c=[];for(const h of this._mergeData||[])en.intersects(h,{startRow:t,endRow:s,startColumn:r,endColumn:i})&&(o.push({...h}),c.push(l)),l++;return this._rangeMap.set(a,c),o}getMergedCellRangeForSkeleton(t,r,s,i){const o=[],a=this._mergeData,l=`${t}-${r}-${s}-${i}`;if(this._skeletonCache.has(l))return this._getSkeletonRangeFromCache(l);const c=[];for(let h=0;h<a.length;h++){const{startRow:u,endRow:d,startColumn:f,endColumn:p}=a[h];for(let E=t;E<=s;E++){let v=!1;for(let I=r;I<=i;I++)if(E>=u&&E<=d&&I>=f&&I<=p){o.push({startRow:u,endRow:d,startColumn:f,endColumn:p}),c.push(h),v=!0;break}if(v)break}}return this._skeletonCache.set(l,c),o}_getRangeFromCache(t){const r=this._rangeMap.get(t)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(t){const r=this._skeletonCache.get(t)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(t,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(t);if(o!==void 0)return o}if(this._hasColumn){const o=this._columnCache.get(r);if(o!==void 0)return o}const s=(i=this._cellCache.get(t))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class Ju extends rt{constructor(t){super();R(this,"_cellContentInterceptor",null);R(this,"_rowFilteredInterceptor",null);this.getRawCell=t}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,In.Value|In.Style):this.getRawCell(t,r)}getCellValueOnly(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,In.Value):this.getRawCell(t,r)}getCellStyleOnly(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,In.Style):this.getRawCell(t,r)}getRowFiltered(t){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(t))!=null?s:!1}registerCellContentInterceptor(t){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=t,Je(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(t){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=t,Je(()=>this._rowFilteredInterceptor=null)}}const Lo={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class nr{constructor(n,t,r){R(this,"_sheetId");R(this,"_snapshot");R(this,"_cellData");R(this,"_rowManager");R(this,"_columnManager");R(this,"_viewModel");R(this,"_spanModel");var a;this.unitId=n,this._styles=r,this._snapshot=Qu(t);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:G.generateRandomId(6),this._cellData=new Pt(o),this._viewModel=new Ju((l,c)=>this.getCellRaw(l,c)),this._rowManager=new vE(this._snapshot,this._viewModel,i),this._columnManager=new RE(this._snapshot,s),this._spanModel=new AE(this._snapshot.mergeData)}__interceptViewModel(n){n(this._viewModel)}getSnapshot(){return this._snapshot}setMergeData(n){this._snapshot.mergeData=n,this.getSpanModel().rebuild(n)}getSpanModel(){return this._spanModel}getColumnStyle(n,t=!1){return t?this._columnManager.getColumnStyle(n):this._styles.get(this._columnManager.getColumnStyle(n))}setColumnStyle(n,t){this._columnManager.setColumnStyle(n,t)}getRowStyle(n,t=!1){return t?this._rowManager.getRowStyle(n):this._styles.get(this._rowManager.getRowStyle(n))}setRowStyle(n,t){this._rowManager.setRowStyle(n,t)}mixinDefaultStyleToCellRaw(n,t,r,s){const i=this.getColumnStyle(t),o=this.getRowStyle(n),a=this.getDefaultCellStyleInternal();if(a||i||o){let l=r==null?void 0:r.s;typeof l=="string"&&(l=this._styles.get(l));const c=s?Ts(a,i,o,l):Ts(a,o,i,l);r||(r={}),r.s=c}}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const n=this._snapshot.defaultStyle;return this._styles.get(n)}setDefaultCellStyle(n){this._snapshot.defaultStyle=n}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const n=this.getCellMatrix(),t=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return n.forEach((c,h)=>{Object.keys(h).forEach(u=>{const d=+u,f=n.getValue(c,d),p=f!=null&&f.s?this._styles.get(f.s):null,E=(p==null?void 0:p.bd)&&(p.bd.b||p.bd.l||p.bd.r||p.bd.t||p.bd.bc_tr||p.bd.bl_tr||p.bd.ml_tr||p.bd.tl_bc||p.bd.tl_br||p.bd.tl_mr);(f&&(f.v||f.p)||p!=null&&p.bg||E)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),t.forEach(c=>{a?r=Math.min(r,c.startRow):(r=c.startRow,a=!0),s=Math.max(s,c.endRow),l?i=Math.min(i,c.startColumn):(i=c.startColumn,a=!0),o=Math.max(o,c.endColumn)}),!a||!l?null:{startColumn:i,startRow:r,endColumn:o,endRow:s}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:n}=this,t=G.deepClone(n);return new nr(this.unitId,t,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(n,t){return this._spanModel.getMergedCell(n,t)}getMergedCellRange(n,t,r,s){return this._spanModel.getMergedCellRange(n,t,r,s)}isRowContainsMergedCell(n){return this._spanModel.isRowContainsMergedCell(n)}isColumnContainsMergedCell(n){return this._spanModel.isColumnContainsMergedCell(n)}getCellInfoInMergeData(n,t){const r=this.getMergedCell(n,t);let s=!1,i=!1,o=n,a=t,l=n,c=t;if(r){const{startRow:h,endRow:u,startColumn:d,endColumn:f}=r;n===h&&t===d?(o=u,a=f,l=h,c=d,i=!0):n>=h&&n<=u&&t>=d&&t<=f&&(o=u,a=f,l=h,c=d,s=!0)}return{actualRow:n,actualColumn:t,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}getCell(n,t){return n<0||t<0?null:this._viewModel.getCell(n,t)}getCellValueOnly(n,t){return n<0||t<0?null:this._viewModel.getCellValueOnly(n,t)}getCellStyleOnly(n,t){return n<0||t<0?null:this._viewModel.getCellStyleOnly(n,t)}getCellRaw(n,t){return this.getCellMatrix().getValue(n,t)}getRowFiltered(n){return this._viewModel.getRowFiltered(n)}getMatrixWithMergedCells(n,t,r,s,i=!1){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(n,t,r,s),l=new Pt;return Us(n,r,t,s).forEach((c,h)=>{const u=i?this.getCellRaw(c,h):this.getCell(c,h);u&&l.setValue(c,h,u)}),a.forEach(c=>{const{startColumn:h,startRow:u,endColumn:d,endRow:f}=c;Us(u,f,h,d).forEach((p,E)=>{p===u&&E===h&&l.setValue(p,E,{...o.getValue(p,E),rowSpan:f-u+1,colSpan:d-h+1}),(p!==u||E!==h)&&l.realDeleteValue(p,E)})}),l}getRange(n,t,r,s){return typeof n=="object"?new Tn(this,n,{getStyles:()=>this._styles}):new Tn(this,{startRow:n,startColumn:t,endColumn:s||t,endRow:r||n},{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(){const{_snapshot:n}=this,{columnCount:t}=n;return t}getMaxRows(){const{_snapshot:n}=this,{rowCount:t}=n;return t}getRowCount(){return this._snapshot.rowCount}setRowCount(n){this._snapshot.rowCount=n}getColumnCount(){return this._snapshot.columnCount}setColumnCount(n){this._snapshot.columnCount=n}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:n}=this,{showGridlines:t}=n;return t===0}getTabColor(){const{_snapshot:n}=this,{tabColor:t}=n;return t}getColumnWidth(n){return this.getColumnManager().getColumnWidth(n)}getRowHeight(n){return this._viewModel.getRowFiltered(n)?0:this.getRowManager().getRowHeight(n)}isRowFiltered(n){return this._viewModel.getRowFiltered(n)}getRowVisible(n){return!this.isRowFiltered(n)&&this.getRowRawVisible(n)}getRowRawVisible(n){return this.getRowManager().getRowRawVisible(n)}getHiddenRows(n,t){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(n,t);return s.forEach(i=>i.endColumn=r),s}getColVisible(n){return this._columnManager.getColVisible(n)}getHiddenCols(n,t){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(n,t);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const n=this.getRowCount();return this._rowManager.getVisibleRows(0,n-1)}getVisibleCols(){const n=this.getColumnCount();return this._columnManager.getVisibleCols(0,n-1)}isRightToLeft(){const{_snapshot:n}=this,{rightToLeft:t}=n;return t}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}cellHasValue(n){return n&&(n.v!==void 0||n.f!==void 0||n.p!==void 0)}iterateByRow(n,t=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=n,a=this;return{[Symbol.iterator]:()=>{let l=r,c=s;return{next(){for(;;){if(c>o&&(l+=1,c=s),l>i)return{done:!0,value:void 0};const h=a.getCell(l,c),u=!h,d=a.getMergedCell(l,c);if(d){if(l!==d.startRow||c!==d.startColumn){c=d.endColumn+1;continue}if(u&&t){c=d.endColumn+1;continue}const p={row:l,col:c,value:h};return p.colSpan=d.endColumn-d.startColumn+1,p.rowSpan=d.endRow-d.startRow+1,c=d.endColumn+1,{done:!1,value:p}}if(u&&t)c+=1;else{const f={row:l,col:c,value:h};return c+=1,{done:!1,value:f}}}}}}}}iterateByColumn(n,t=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=n,l=this;return{[Symbol.iterator]:()=>{let c=s,h=i;return{next(){for(;;){if(c>o&&(h+=1,c=s),h>a)return{done:!0,value:void 0};const u=l.getMergedCell(c,h);if(u){const p=c!==u.startRow,E=p||h!==u.startColumn;if(r&&E||!r&&p){c=u.endRow+1;continue}const v=l.getCell(u.startRow,u.startColumn);if(!v&&t){c=u.endRow+1;continue}const M={row:c,col:u.startColumn,value:v};return M.colSpan=u.endColumn-u.startColumn+1,M.rowSpan=u.endRow-u.startRow+1,c=u.endRow+1,{done:!1,value:M}}const d=l.getCell(c,h);if(!d&&t)c+=1;else{const p={row:c,col:h,value:d};return c+=1,{done:!1,value:p}}}}}}}}_getCellDocumentModel(n,t=Lo){var E;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...Lo,...t},o=this._styles.getStyleByCell(n);if(!n)return;let a,l="document";const c=_E(o),h=i?ct.tr:c.textRotation||ct.tr;let u=c.horizontalAlign||ct.ht;const d=c.verticalAlign||ct.vt,f=c.wrapStrategy||ct.tb,p=c.paddingData||Bs;if(n.f&&s)a=Or(n.f.toString(),{},{verticalAlign:d}),u=ct.ht;else if(n.p){const{centerAngle:v,vertexAngle:I}=Wu(h);a=this._updateConfigAndGetDocumentModel(r?G.deepClone(n.p):n.p,u,p,{horizontalAlign:u,verticalAlign:d,centerAngle:v,vertexAngle:I,wrapStrategy:f})}else if(n.v!=null){const v=Mo(o);l=Do(v).fontCache;let I=Zu(n);n.t===Jt.FORCE_STRING&&s&&(I=`'${I}`),a=Or(I,v,{...c,textRotation:h,cellValueType:n.t})}return a&&n.linkUrl&&n.linkId&&Bu(a,n.linkUrl,n.linkId),{documentModel:a,fontString:l,textRotation:h,wrapStrategy:f,verticalAlign:d,horizontalAlign:u,paddingData:p,fill:(E=o==null?void 0:o.bg)==null?void 0:E.rgb}}_updateConfigAndGetDocumentModel(n,t,r,s){var o,a,l,c,h;if(!s||!((o=n.body)!=null&&o.dataStream))return;n.documentStyle||(n.documentStyle={}),n.documentStyle.marginTop=(a=r.t)!=null?a:0,n.documentStyle.marginBottom=(l=r.b)!=null?l:2,n.documentStyle.marginLeft=(c=r.l)!=null?c:2,n.documentStyle.marginRight=(h=r.r)!=null?h:2,n.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},n.documentStyle.renderConfig=s;const i=n.body.paragraphs||[];for(const u of i)u.paragraphStyle||(u.paragraphStyle={}),u.paragraphStyle.horizontalAlign=t;return new Wt(n)}getBlankCellDocumentModel(n){const t=this._getCellDocumentModel(n,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(n),s=Mo(r);if(t!=null)return t.documentModel==null&&(t.documentModel=Or("",s)),t;const i="";let o="document";const a=ct.tr,l=ct.ht,c=ct.vt,h=ct.tb,u=Bs;return o=Do({}).fontCache,{documentModel:Or(i,s),fontString:o,textRotation:a,wrapStrategy:h,verticalAlign:c,horizontalAlign:l,paddingData:u}}getCellDocumentModelWithFormula(n){return this._getCellDocumentModel(n,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}}function Zu(e){var r,s;if(!e)return"";const n=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(n)return Lt.transform.getPlainText(n);const t=e.v;return typeof t=="string"?e.t===Jt.BOOLEAN?t.toUpperCase():t.replace(/[\r\n]/g,""):typeof t=="number"?e.t===Jt.BOOLEAN?t?"TRUE":"FALSE":t.toString():typeof t=="boolean"?t?"TRUE":"FALSE":""}function TE(e){if(e===null)return"";if(e!=null&&e.p){const n=e==null?void 0:e.p.body;if(n==null)return"";const t=n.dataStream;return Lt.transform.getPlainText(t)}return e==null?void 0:e.v}var NE=Object.defineProperty,ME=Object.getOwnPropertyDescriptor,DE=(e,n,t,r)=>{for(var s=r>1?void 0:r?ME(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&NE(n,t,s),s},LE=(e,n)=>(t,r)=>n(t,r,e);function xE(e,n){return`${e.getUnitId()}|${n.getSheetId()}`}exports.Workbook=class extends es{constructor(t={},r){super();R(this,"type",ke.UNIVER_SHEET);R(this,"_sheetCreated$",new Ee.Subject);R(this,"sheetCreated$",this._sheetCreated$.asObservable());R(this,"_sheetDisposed$",new Ee.Subject);R(this,"sheetDisposed$",this._sheetDisposed$.asObservable());R(this,"_activeSheet$",new Ee.BehaviorSubject(null));R(this,"activeSheet$",this._activeSheet$.asObservable());R(this,"_worksheets");R(this,"_styles");R(this,"_snapshot");R(this,"_unitId");R(this,"_count");R(this,"_name$");R(this,"name$");this._logService=r;const s=z_();G.isEmptyObject(t)?this._snapshot=s:this._snapshot=G.commonExtend(s,t);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=G.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new ku(i),this._count=1,this._worksheets=new Map,this._name$=new Ee.BehaviorSubject(t.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(t){return typeof t=="string"||"startRow"in t||"row"in t}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return G.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(t){this._name$.next(t),this._snapshot.name=t}getUnitId(){return this._unitId}getRev(){var t;return(t=this._snapshot.rev)!=null?t:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(t){this._snapshot.rev=t}addWorksheet(t,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[t])return!1;i[t]=s,o.splice(r,0,t);const a=new nr(this._unitId,s,this._styles);return this._worksheets.set(t,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}getConfig(){return this._snapshot}getIndexBySheetId(t){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===t)}getActiveSheet(t){if(!this._activeSheet&&typeof t>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const t=this._activeSheet;if(t)return t;const r=this._snapshot.sheetOrder;for(let i=0,o=r.length;i<o;i++){const a=this._worksheets.get(r[i]);if(a&&a.isSheetHidden()!==Ae.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(t){this._activeSheet$.next(t)}removeSheet(t){const r=this._worksheets.get(t);return r?(this._worksheets.delete(t),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(t),1),delete this._snapshot.sheets[t],this._sheetDisposed$.next(r),!0):!1}getActiveSheetIndex(){const{sheetOrder:t}=this._snapshot;return t.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:t}=this._snapshot;return t.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:t}=this._snapshot,r=[];return t.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(t){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>t.getSheetId()===s)}getSheetBySheetName(t){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===t);return this._worksheets.get(s)}getSheetBySheetId(t){return this._worksheets.get(t)}getSheetByIndex(t){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[t])}getHiddenWorksheets(){return this.getSheets().filter(t=>t.getConfig().hidden===Ae.TRUE).map(t=>t.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(t=>t.getConfig().hidden!==Ae.TRUE).map(t=>t.getConfig().id)}load(t){this._snapshot=t}checkSheetName(t){return this.getSheetsName().includes(t)}uniqueSheetName(t="Sheet1"){let r=t;for(;this.checkSheetName(r);)r=t+this._count,this._count++;return r}generateNewSheetName(t){let r=t+this._count;for(;this.checkSheetName(r);)r=t+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:t,_worksheets:r}=this,{sheets:s,sheetOrder:i}=t;if(G.isEmptyObject(s)){const o=G.generateRandomId();s[o]={id:o}}for(const o in s){const a=s[o],{name:l}=a;a.name=this.uniqueSheetName(l),a.name!==l&&this._logService.debug("[Workbook]",`The worksheet name ${l} is duplicated, we changed it to ${a.name}. Please fix the problem in your snapshot.`);const c=new nr(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}};exports.Workbook=DE([LE(1,Nt)],exports.Workbook);class wi extends es{constructor(t){var r;super();R(this,"type",ke.UNIVER_SLIDE);R(this,"_activePage$",new Ee.BehaviorSubject(null));R(this,"activePage$",this._activePage$.asObservable());R(this,"_name$");R(this,"name$");R(this,"_snapshot");R(this,"_unitId");this._snapshot={...Pl,...t},this._unitId=(r=this._snapshot.id)!=null?r:G.generateRandomId(6),this._name$=new Ee.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const t=this._activePage$.getValue();if(!t){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return t}setName(t){var r;this._snapshot.title=t,this._name$.next(t),this._unitId=(r=this._snapshot.id)!=null?r:hn(6)}getRev(){return 0}incrementRev(){}setRev(t){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var t;return(t=this._snapshot.body)==null?void 0:t.pages}getPageOrder(){var t;return(t=this._snapshot.body)==null?void 0:t.pageOrder}getPage(t){const r=this.getPages();return r==null?void 0:r[t]}getElementsByPage(t){var r;return(r=this.getPage(t))==null?void 0:r.pageElements}getElement(t,r){var s;return(s=this.getElementsByPage(t))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const t=hn(6);return{id:t,pageType:Si.SLIDE,zIndex:10,title:t,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(t){this._activePage$.next(t)}getActivePage(){return this._activePage}updatePage(t,r){this._snapshot.body&&(this._snapshot.body.pages[t]=r)}appendPage(t){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[t.id]=t;const r=this._activePage,s=this._snapshot.body.pageOrder.indexOf((i=r==null?void 0:r.id)!=null?i:"");this._snapshot.body.pageOrder.splice(s+1,0,t.id)}}const Hn="FOCUSING_UNIT",On="FOCUSING_SHEET",Bn="FOCUSING_DOC",Wn="FOCUSING_SLIDE",UE="FOCUSING_EDITOR_BUT_HIDDEN",qu="EDITOR_ACTIVATED",PE="FOCUSING_EDITOR_INPUT_FORMULA",ec="FOCUSING_FX_BAR_EDITOR",kE="FOCUSING_UNIVER_EDITOR",FE="FOCUSING_EDITOR_INPUT_FORMULA",$E="FOCUSING_PANEL_EDITOR",jE="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",HE="FOCUSING_COMMON_DRAWINGS",BE="FORMULA_EDITOR_ACTIVATED";var WE=Object.defineProperty,YE=Object.getOwnPropertyDescriptor,zE=(e,n,t,r)=>{for(var s=r>1?void 0:r?YE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&WE(n,t,s),s},xo=(e,n)=>(t,r)=>n(t,r,e);const gn=wt("univer.current");exports.UniverInstanceService=class extends rt{constructor(t,r){super();R(this,"_unitsByType",new Map);R(this,"_createHandler");R(this,"_ctorByType",new Map);R(this,"_currentUnits",new Map);R(this,"_currentUnits$",new Ee.BehaviorSubject(this._currentUnits));R(this,"currentUnits$",this._currentUnits$.asObservable());R(this,"_unitAdded$",new Ee.Subject);R(this,"unitAdded$",this._unitAdded$.asObservable());R(this,"_unitDisposed$",new Ee.Subject);R(this,"unitDisposed$",this._unitDisposed$.asObservable());R(this,"_focused$",new Ee.BehaviorSubject(null));R(this,"focused$",this._focused$.asObservable());this._injector=t,this._contextService=r}dispose(){super.dispose(),this._focused$.complete()}__setCreateHandler(t){this._createHandler=t}createUnit(t,r,s){return this._createHandler(t,r,this._ctorByType.get(t),s)}registerCtorForType(t,r){return this._ctorByType.set(t,r),{dispose:()=>{this._ctorByType.delete(t)}}}getCurrentTypeOfUnit$(t){return this.currentUnits$.pipe(Ee.map(r=>{var s;return(s=r.get(t))!=null?s:null}),Ee.distinctUntilChanged())}getCurrentUnitForType(t){return this._currentUnits.get(t)}setCurrentUnitForType(t){const r=this._getUnitById(t);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${t}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(t){return this._unitAdded$.pipe(Ee.filter(r=>r.type===t))}__addUnit(t,r){var a;const s=t.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=t.getUnitId();if(i.findIndex(l=>l.getUnitId()===o)!==-1)throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${o}.`);i.push(t),this._unitAdded$.next(t),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(t.getUnitId())}getTypeOfUnitDisposed$(t){return this.unitDisposed$.pipe(Ee.filter(r=>r.type===t))}getUnit(t,r){var i;const s=(i=this._getUnitById(t))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType(ke.UNIVER_DOC)}getUniverDocInstance(t){return this.getUnit(t,ke.UNIVER_DOC)}getUniverSheetInstance(t){return this.getUnit(t,ke.UNIVER_SHEET)}getAllUnitsForType(t){var r;return(r=this._unitsByType.get(t))!=null?r:[]}changeDoc(t,r){const s=this.getAllUnitsForType(ke.UNIVER_DOC),i=s.find(o=>o.getUnitId()===t);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const t=this._focused$.getValue();return t?(r=this._getUnitById(t))==null?void 0:r[0]:null}focusUnit(t){this._focused$.next(t),this.focused instanceof exports.Workbook?(this._contextService.setContextValue(Hn,!0),this._contextService.setContextValue(Bn,!1),this._contextService.setContextValue(On,!0),this._contextService.setContextValue(Wn,!1),this.setCurrentUnitForType(t)):this.focused instanceof Wt?(this._contextService.setContextValue(Hn,!0),this._contextService.setContextValue(Bn,!0),this._contextService.setContextValue(On,!1),this._contextService.setContextValue(Wn,!1),this.setCurrentUnitForType(t)):this.focused instanceof wi?(this._contextService.setContextValue(Hn,!0),this._contextService.setContextValue(Bn,!1),this._contextService.setContextValue(On,!1),this._contextService.setContextValue(Wn,!0),this.setCurrentUnitForType(t)):(this._contextService.setContextValue(Hn,!1),this._contextService.setContextValue(Bn,!1),this._contextService.setContextValue(On,!1),this._contextService.setContextValue(Wn,!1))}getFocusedUnit(){return this.focused}getUnitType(t){const r=this._getUnitById(t);return r?r[1]:ke.UNRECOGNIZED}disposeUnit(t){const r=this._getUnitById(t);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryRemoveCurrentUnitForType(t,i),this._tryBlurUnitOnRemoval(t),this._unitDisposed$.next(s),!0}_tryRemoveCurrentUnitForType(t,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===t&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryBlurUnitOnRemoval(t){var r;((r=this.focused)==null?void 0:r.getUnitId())===t&&this._focused$.next(null)}_getUnitById(t){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===t);if(i)return[i,r]}}};exports.UniverInstanceService=zE([xo(0,Ot(Ft)),xo(1,ur)],exports.UniverInstanceService);var Ve=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(Ve||{});const VE={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var GE=Object.defineProperty,KE=Object.getOwnPropertyDescriptor,XE=(e,n,t,r)=>{for(var s=r>1?void 0:r?KE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&GE(n,t,s),s},QE=(e,n)=>(t,r)=>n(t,r,e);exports.LifecycleService=class extends rt{constructor(t){super();R(this,"_lifecycle$",new Ee.BehaviorSubject(Ve.Starting));R(this,"lifecycle$",this._lifecycle$.asObservable());R(this,"_lock",!1);this._logService=t,this._reportProgress(Ve.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(t){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(t<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");t!==this.stage&&(this._lock=!0,this._reportProgress(t),this._lifecycle$.next(t),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}subscribeWithPrevious(){return Ee.merge(tc(this.stage),this._lifecycle$.pipe(Ee.skip(1))).pipe(za(t=>t===Ve.Steady))}_reportProgress(t){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${VE[t]}".`)}};exports.LifecycleService=XE([QE(0,Nt)],exports.LifecycleService);function tc(e){switch(e){case Ve.Starting:return Ee.of(Ve.Starting);case Ve.Ready:return Ee.of(Ve.Starting,Ve.Ready);case Ve.Rendered:return Ee.of(Ve.Starting,Ve.Ready,Ve.Rendered);default:return Ee.of(Ve.Starting,Ve.Ready,Ve.Rendered,Ve.Steady)}}var JE=Object.defineProperty,ZE=Object.getOwnPropertyDescriptor,qE=(e,n,t,r)=>{for(var s=r>1?void 0:r?ZE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&JE(n,t,s),s},hs=(e,n)=>(t,r)=>n(t,r,e);const Qt=wt("univer.undo-redo.service"),e0=20;class nc{dispose(){}async dispatchToHandlers(){return!1}}const rc="univer.command.redo",sc="univer.command.undo",rr=new class extends nc{constructor(){super(...arguments);R(this,"type",cr.COMMAND);R(this,"id",sc)}async handler(n){const t=n.get(Qt),r=t.pitchTopUndoElement();if(!r)return!1;const s=n.get(Ut);return di(r.undoMutations,s)?(t.popUndoToRedo(),!0):!1}},sr=new class extends nc{constructor(){super(...arguments);R(this,"type",cr.COMMAND);R(this,"id",rc)}async handler(n){const t=n.get(Qt),r=t.pitchTopRedoElement();if(!r)return!1;const s=n.get(Ut);return di(r.redoMutations,s)?(t.popRedoToUndo(),!0):!1}};exports.LocalUndoRedoService=class extends rt{constructor(t,r,s){super();R(this,"undoRedoStatus$");R(this,"_undoRedoStatus$",new Ee.BehaviorSubject({undos:0,redos:0}));R(this,"_undoStacks",new Map);R(this,"_redoStacks",new Map);R(this,"_batchingStatus",new Map);this._univerInstanceService=t,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(rr)),this.disposeWithMe(this._commandService.registerCommand(sr)),this.disposeWithMe(Je(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(Je(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(t){const{unitID:r}=t,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(t.unitID)){const a=this._batchingStatus.get(t.unitID),l=this._pitchUndoElement(t.unitID);a===0||!l?(o(t),this._batchingStatus.set(t.unitID,1)):this._tryBatchingElements(l,t)}else o(t);function o(a){i.push(a),i.length>e0&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(t){const r=this._getRedoStack(t);r&&(r.length=0);const s=this._getUndoStack(t);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const t=this._getFocusedUnitId();return this._pitchUndoElement(t)}pitchTopRedoElement(){const t=this._getFocusedUnitId();return this._pitchRedoElement(t)}_pitchUndoElement(t){const r=this._getUndoStack(t);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(t){const r=this._getRedoStack(t);return r!=null&&r.length?r[r.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}__tempBatchingUndoRedo(t){if(this._batchingStatus.has(t))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(t,0),Je(()=>this._batchingStatus.delete(t))}_updateStatus(){var i,o;const t=this._getFocusedUnitId(),r=t&&((i=this._undoStacks.get(t))==null?void 0:i.length)||0,s=t&&((o=this._redoStacks.get(t))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(t,r=!1){let s=this._undoStacks.get(t);return!s&&r&&(s=[],this._undoStacks.set(t,s)),s||null}_getRedoStack(t,r=!1){let s=this._redoStacks.get(t);return!s&&r&&(s=[],this._redoStacks.set(t,s)),s||null}_getUndoStackForFocused(){const t=this._getFocusedUnitId();if(!t)throw new Error("No focused univer instance!");return this._getUndoStack(t,!0)}_getRedoStackForFocused(){const t=this._getFocusedUnitId();if(!t)throw new Error("No focused univer instance!");return this._getRedoStack(t,!0)}_tryBatchingElements(t,r){t.redoMutations.push(...r.redoMutations),t.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let t="";const r=this._contextService.getContextValue(On),s=this._contextService.getContextValue(ec),i=this._contextService.getContextValue(qu);return r?s?t=si:i?t=ri:t=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":t=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",t}};exports.LocalUndoRedoService=qE([hs(0,gn),hs(1,Ut),hs(2,ur)],exports.LocalUndoRedoService);const ts=wt("core.resource-manager.service"),Ws={[xt.Editor]:"Editor",[xt.Owner]:"Owner",[xt.Reader]:"Reader",[xt.UNRECOGNIZED]:"UNRECOGNIZED"},Hr=e=>e?{userID:`${Ws[e]}_${G.generateRandomId(8)}`,name:Ws[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},t0=(e,n)=>e.startsWith(Ws[n]);class Br{constructor(){R(this,"_model",new Map);R(this,"_userChange$",new Ee.Subject);R(this,"userChange$",this._userChange$.asObservable());R(this,"_currentUser$",new Ee.BehaviorSubject(Hr()));R(this,"currentUser$",this._currentUser$.asObservable())}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(n){this.addUser(n),this._currentUser$.next(n)}addUser(n){this._model.set(n.userID,n),this._userChange$.next({type:"add",user:n})}getUser(n,t){const r=this._model.get(n);if(r)return r;t&&t()}delete(n){const t=this.getUser(n);this._model.delete(n),t&&this._userChange$.next({type:"delete",user:t})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var n0=Object.defineProperty,r0=Object.getOwnPropertyDescriptor,s0=(e,n,t,r)=>{for(var s=r>1?void 0:r?r0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&n0(n,t,s),s},Uo=(e,n)=>(t,r)=>n(t,r,e);exports.AuthzIoLocalService=class{constructor(n,t){R(this,"_permissionMap",new Map([]));this._resourceManagerService=n,this._userManagerService=t,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const n=this._userManagerService.getCurrentUser();n&&n.userID||this._userManagerService.setCurrentUser(Hr(xt.Owner))}_getRole(n){const t=this._userManagerService.getCurrentUser();return t?t0(t.userID,n):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:n=>{const t=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(t)},parseJson:n=>JSON.parse(n),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[ke.UNIVER_SHEET,ke.UNIVER_DOC,ke.UNIVER_SLIDE],onLoad:(n,t)=>{for(const r in t)this._permissionMap.set(r,t[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(n){return hn(8)}async allowed(n){return Promise.resolve([])}async batchAllowed(n){return Promise.resolve([])}async list(n){const t=[];return n.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:n.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:xt.Owner,shareScope:-1,scope:{read:Ps.AllCollaborator,edit:Ps.AllCollaborator},creator:Hr(xt.Owner),strategies:[{action:6,role:1},{action:16,role:1},{action:17,role:1},{action:18,role:1},{action:19,role:1},{action:33,role:1},{action:34,role:1},{action:35,role:1},{action:36,role:1},{action:37,role:1},{action:38,role:1},{action:39,role:1},{action:40,role:1}],actions:n.actions.map(o=>({action:o,allowed:this._getRole(xt.Owner)||this._getRole(xt.Editor)}))};t.push(i)}}),t}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(n){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(n){}};exports.AuthzIoLocalService=s0([Uo(0,ts),Uo(1,Ot(Br))],exports.AuthzIoLocalService);const ic=wt("IAuthzIoIoService"),oc=wt("univer.config-service");class ac{constructor(){R(this,"_configChanged$",new Ee.Subject);R(this,"configChanged$",this._configChanged$.asObservable());R(this,"_config",new Map)}dispose(){this._configChanged$.complete()}getConfig(n){return this._config.get(n)}setConfig(n,t,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(n))!=null?o:{};s?i=G.deepMerge(i,t):i=t,this._config.set(n,i),this._configChanged$.next({[n]:i})}deleteConfig(n){return this._config.delete(n)}subscribeConfigValue$(n){return new Ee.Observable(t=>{Object.prototype.hasOwnProperty.call(this._config,n)&&t.next(this._config.get(n));const r=this.configChanged$.pipe(Ee.filter(s=>Object.prototype.hasOwnProperty.call(s,n))).subscribe(s=>t.next(s[n]));return()=>r.unsubscribe()})}}class lc extends rt{constructor(){super(...arguments);R(this,"_error$",new Ee.Subject);R(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(t){this._error$.next({errorKey:t})}}class Kn extends rt{constructor(){super();R(this,"_currentLocale$",new Ee.BehaviorSubject(hr.ZH_CN));R(this,"currentLocale$",this._currentLocale$.asObservable());R(this,"_locales",null);R(this,"localeChanged$",new Ee.Subject);R(this,"t",(t,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=t.split("."),i=this.resolveKeyPath(this._locales[this._currentLocale],s);if(typeof i=="string"){let o=i;return r.forEach((a,l)=>{o=o.replace(`{${l}}`,a)}),o}else return t});this.disposeWithMe(Je(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(t){var r;this._locales=G.deepMerge((r=this._locales)!=null?r:{},t)}setLocale(t){this._currentLocale$.next(t),this.localeChanged$.next()}getLocales(){var t;return(t=this._locales)==null?void 0:t[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(t,r){const s=r.shift();if(s&&t&&s in t){const i=t[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var bi=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(bi||{});const uc=wt("univer.permission-service");class cc extends rt{constructor(){super(...arguments);R(this,"_permissionPointMap",new Map);R(this,"_permissionPointUpdate$",new Ee.Subject);R(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());R(this,"_showComponents",!0)}setShowComponents(t){this._showComponents=t}getShowComponents(){return this._showComponents}deletePermissionPoint(t){const r=this._permissionPointMap.get(t);r&&(r.complete(),this._permissionPointMap.delete(t))}addPermissionPoint(t){const r=t instanceof Ee.BehaviorSubject,s=r?t.getValue():t;if(!s.id)return!1;if(this._permissionPointMap.get(s.id))throw new Error(`${s.id} PermissionPoint already exists`);return this._permissionPointMap.set(s.id,r?t:new Ee.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(t,r){const s=this._permissionPointMap.get(t);if(!s)return;const i=s.getValue();i.value=r,i.status=bi.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(t){const r=this._permissionPointMap.get(t);if(r)return r.getValue()}getPermissionPoint$(t){const r=this._permissionPointMap.get(t);if(r)return r}composePermission$(t){const r=t.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.asObservable()});return Ee.combineLatest(r).pipe(br.map(s=>s))}composePermission(t){return t.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.getValue()})}getAllPermissionPoint(){const t=new Map;return this._permissionPointMap.forEach((r,s)=>{t.set(s,r)}),t}}const hc=Symbol("DependentOn");class Ys extends rt{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}R(Ys,"pluginName"),R(Ys,"type",ke.UNIVER_UNKNOWN);class i0{constructor(){R(this,"_plugins",[])}addPlugin(n){this._plugins.push(n)}removePlugins(){const n=this._plugins.slice();return this._plugins.length=0,n}forEachPlugin(n){this._plugins.forEach(n)}}class o0{constructor(){R(this,"_pluginsRegistered",[])}registerPlugin(n,t){this._pluginsRegistered.push({plugin:n,options:t})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var a0=Object.defineProperty,l0=Object.getOwnPropertyDescriptor,dc=(e,n,t,r)=>{for(var s=r>1?void 0:r?l0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&a0(n,t,s),s},Mr=(e,n)=>(t,r)=>n(t,r,e);const u0=4;function c0(...e){return function(n){n[hc]=e}}exports.PluginService=class{constructor(n){R(this,"_pluginHolderForUniver");R(this,"_pluginHoldersForTypes",new Map);R(this,"_seenPlugins",new Set);R(this,"_flushTimer");this._injector=n,this._pluginHolderForUniver=this._injector.createInstance(Wr,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this)),this._pluginHoldersForTypes.set(ke.UNIVER_UNKNOWN,this._pluginHolderForUniver),this._pluginHolderForUniver.start()}dispose(){this._clearFlushTimer();for(const n of this._pluginHoldersForTypes.values())n.dispose();this._pluginHolderForUniver.dispose()}registerPlugin(n,t){this._assertPluginValid(n),this._scheduleInitPlugin();const{type:r}=n;r===ke.UNIVER_UNKNOWN?(this._pluginHolderForUniver.register(n,t),this._pluginHolderForUniver.flush()):this._ensurePluginHolderForType(r).register(n,t)}startPluginForType(n){this._ensurePluginHolderForType(n).start()}_ensurePluginHolderForType(n){if(!this._pluginHoldersForTypes.has(n)){const t=this._injector.createInstance(Wr,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this));return this._pluginHoldersForTypes.set(n,t),t}return this._pluginHoldersForTypes.get(n)}_immediateInitPlugin(n){this._seenPlugins.add(n.pluginName),this._ensurePluginHolderForType(n.type).immediateInitPlugin(n)}_checkPluginSeen(n){return this._seenPlugins.has(n.pluginName)}_assertPluginValid(n){const{type:t,pluginName:r}=n;if(t===ke.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${n.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${n.name}. Please assign a "pluginName" to your plugin.`);if(this._seenPlugins.has(r))throw new 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(n.pluginName)}_scheduleInitPlugin(){this._flushTimer===void 0&&(this._flushTimer=setTimeout(()=>{this._pluginHolderForUniver.started||this._pluginHolderForUniver.start(),this._flushPlugins(),this._clearFlushTimer()},u0))}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}_flushPlugins(){this._pluginHolderForUniver.flush();for(const[n,t]of this._pluginHoldersForTypes)t.started&&t.flush()}};exports.PluginService=dc([Mr(0,Ot(Ft))],exports.PluginService);let Wr=class extends rt{constructor(n,t,r,s,i){super();R(this,"_started",!1);R(this,"_warnedAboutOnStartingDeprecation",!1);R(this,"_pluginRegistry",new o0);R(this,"_pluginStore",new i0);R(this,"_pluginsInBatches",[]);this._checkPluginRegistered=n,this._registerPlugin=t,this._logService=r,this._injector=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(Ee.skip(1)).subscribe(o=>{this._pluginsInBatches.forEach(a=>this._runStage(a,o))}))}get started(){return this._started}dispose(){super.dispose(),this._pluginStore.forEachPlugin(n=>n.dispose()),this._pluginStore.removePlugins(),this._pluginRegistry.removePlugins(),this._pluginsInBatches.length=0}register(n,t){this._pluginRegistry.registerPlugin(n,t)}immediateInitPlugin(n){const t=this._initPlugin(n,void 0);this._pluginsRunLifecycle([t])}start(){this._started||(this._started=!0,this.flush())}flush(){if(!this._started)return;const n=this._pluginRegistry.getRegisterPlugins().map(({plugin:t,options:r})=>this._initPlugin(t,r));n.length&&(this._pluginsRunLifecycle(n),this._pluginRegistry.removePlugins())}_initPlugin(n,t){const r=n[hc];if(r){const i=()=>{const o=r.find(a=>!this._checkPluginRegistered(a));return o?(this._logService.debug("[PluginService]",`Plugin "${n.pluginName}" depends on "${o.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._registerPlugin(o,void 0),!0):!1};for(;i(););}const s=this._injector.createInstance(n,t);return this._pluginStore.addPlugin(s),this._logService.debug("[PluginService]",`Plugin "${s.getPluginName()}" registered.`),s}_pluginsRunLifecycle(n){tc(this._lifecycleService.stage).subscribe(t=>this._runStage(n,t)),this._pluginsInBatches.push(n)}_runStage(n,t){n.forEach(r=>{switch(t){case Ve.Starting:r.onStarting();break;case Ve.Ready:r.onReady();break;case Ve.Rendered:r.onRendered();break;case Ve.Steady:r.onSteady();break}})}};Wr=dc([Mr(2,Nt),Mr(3,Ot(Ft)),Mr(4,Ot(exports.LifecycleService))],Wr);function fc(e,n){if(!n)return e;const t=[];for(const r of e){const s=n.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;t.push([r[0],s[1]])}else t.push(r)}return t}var h0=Object.defineProperty,d0=Object.getOwnPropertyDescriptor,f0=(e,n,t,r)=>{for(var s=r>1?void 0:r?d0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&h0(n,t,s),s},Po=(e,n)=>(t,r)=>n(t,r,e);let zs=class extends rt{constructor(e,n){super(),this._resourceManagerService=e,this._univerInstanceService=n,this._init()}_init(){const e=t=>{t.businesses.forEach(r=>{switch(r){case ke.UNRECOGNIZED:case ke.UNIVER_UNKNOWN:case ke.UNIVER_SLIDE:case ke.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType(ke.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===t.pluginName);if(o)try{const a=t.parseJson(o.data);t.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${t.pluginName}} Data Error.`)}});break}case ke.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(ke.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===t.pluginName);if(o)try{const a=t.parseJson(o.data);t.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${t.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(t=>e(t)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(t=>e(t))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(ke.UNIVER_SHEET).subscribe(t=>{this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(ke.UNIVER_DOC).subscribe(t=>{const r=t.getUnitId();_a(r)||this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(ke.UNIVER_SHEET).subscribe(t=>{this._resourceManagerService.unloadResources(t.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(ke.UNIVER_DOC).subscribe(t=>{this._resourceManagerService.unloadResources(t.getUnitId())}))}saveUnit(e){const n=this._univerInstanceService.getUnit(e);if(!n)return null;const t=this._resourceManagerService.getResources(e,n.type),r=G.deepClone(n.getSnapshot());return r.resources=t,r}};zs=f0([Po(0,Ot(ts)),Po(1,Ot(gn))],zs);const Vs=wt("resource-loader-service");class gc extends rt{constructor(){super(...arguments);R(this,"_resourceMap",new Map);R(this,"_register$",new Ee.Subject);R(this,"register$",this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(t,r){return r?this.getResourcesByType(t,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(t);return{name:o.pluginName,data:a}})}getResourcesByType(t,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(t);return{name:o.pluginName,data:a}})}registerPluginResource(t){const r=t.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,t),this._register$.next(t),Je(()=>this._resourceMap.delete(r))}disposePluginResource(t){this._resourceMap.delete(t)}loadResources(t,r){this.getAllResourceHooks().forEach(s=>{var o;const i=(o=r==null?void 0:r.find(a=>a.name===s.pluginName))==null?void 0:o.data;if(i)try{const a=s.parseJson(i);s.onLoad(t,a)}catch{console.error("LoadResources Error!")}})}unloadResources(t){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(t)})}dispose(){this._register$.complete(),this._resourceMap.clear()}}class Ai extends rt{constructor(){super();R(this,"_currentTheme");R(this,"_currentTheme$",new Ee.BehaviorSubject({}));R(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Je(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(t){this._currentTheme=t,this._currentTheme$.next(t)}}class mc{constructor(n={},t){R(this,"_startedTypes",new Set);R(this,"_injector");const r=this._injector=g0(t,n==null?void 0:n.override),{theme:s,locale:i,locales:o,logLevel:a}=n;s&&this._injector.get(Ai).setTheme(s),o&&this._injector.get(Kn).load(o),i&&this._injector.get(Kn).setLocale(i),a&&this._injector.get(Nt).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(gn)}get _pluginService(){return this._injector.get(exports.PluginService)}__getInjector(){return this._injector}dispose(){this._injector.dispose()}setLocale(n){this._injector.get(Kn).setLocale(n)}createUnit(n,t){return this._univerInstanceService.createUnit(n,t)}createUniverSheet(n){return this._injector.get(Nt).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ke.UNIVER_SHEET,n)}createUniverDoc(n){return this._injector.get(Nt).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ke.UNIVER_DOC,n)}createUniverSlide(n){return this._injector.get(Nt).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ke.UNIVER_SLIDE,n)}_init(n){this._univerInstanceService.registerCtorForType(ke.UNIVER_SHEET,exports.Workbook),this._univerInstanceService.registerCtorForType(ke.UNIVER_DOC,Wt),this._univerInstanceService.registerCtorForType(ke.UNIVER_SLIDE,wi);const t=n.get(gn);t.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginForType(r),this._startedTypes.add(r);const l=n.createInstance(i,s);return t.__addUnit(l,o),this._tryProgressToReady(),l}const a=n.createInstance(i,s);return t.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(exports.LifecycleService).stage<Ve.Ready&&(this._injector.get(exports.LifecycleService).stage=Ve.Ready)}registerPlugin(n,t){this._pluginService.registerPlugin(n,t)}}function g0(e,n){const t=fc([[lc],[Kn],[Ai],[exports.LifecycleService],[exports.PluginService],[Br],[gn,{useClass:exports.UniverInstanceService}],[uc,{useClass:cc}],[Nt,{useClass:Ba,lazy:!0}],[Ut,{useClass:exports.CommandService}],[Qt,{useClass:exports.LocalUndoRedoService,lazy:!0}],[oc,{useClass:ac}],[ur,{useClass:ja}],[ts,{useClass:gc,lazy:!0}],[Vs,{useClass:zs,lazy:!0}],[ic,{useClass:exports.AuthzIoLocalService,lazy:!0}]],n),r=e?e.createChild(t):new Ft(t);return xa(r,[[Br],[Vs]]),r}var m0=Object.defineProperty,p0=Object.getOwnPropertyDescriptor,_0=(e,n,t,r)=>{for(var s=r>1?void 0:r?p0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&m0(n,t,s),s},ko=(e,n)=>(t,r)=>n(t,r,e);exports.FHooks=class extends qn{constructor(n,t){super(),this._injector=n,this._lifecycleService=t}onStarting(n){return Je(this._lifecycleService.lifecycle$.pipe(Ee.filter(t=>t===Ve.Starting)).subscribe(n))}onReady(n){return Je(this._lifecycleService.lifecycle$.pipe(Ee.filter(t=>t===Ve.Ready)).subscribe(n))}onRendered(n){return Je(this._lifecycleService.lifecycle$.pipe(Ee.filter(t=>t===Ve.Rendered)).subscribe(n))}onSteady(n){return Je(this._lifecycleService.lifecycle$.pipe(Ee.filter(t=>t===Ve.Steady)).subscribe(n))}onBeforeUndo(n){return this._injector.get(Ut).beforeCommandExecuted(r=>{if(r.id===rr.id){const i=this._injector.get(Qt).pitchTopUndoElement();i&&n(i)}})}onUndo(n){return this._injector.get(Ut).onCommandExecuted(r=>{if(r.id===rr.id){const i=this._injector.get(Qt).pitchTopUndoElement();i&&n(i)}})}onBeforeRedo(n){return this._injector.get(Ut).beforeCommandExecuted(r=>{if(r.id===sr.id){const i=this._injector.get(Qt).pitchTopRedoElement();i&&n(i)}})}onRedo(n){return this._injector.get(Ut).onCommandExecuted(r=>{if(r.id===sr.id){const i=this._injector.get(Qt).pitchTopRedoElement();i&&n(i)}})}};exports.FHooks=_0([ko(0,Ot(Ft)),ko(1,Ot(exports.LifecycleService))],exports.FHooks);var E0=Object.defineProperty,C0=Object.getOwnPropertyDescriptor,R0=(e,n,t,r)=>{for(var s=r>1?void 0:r?C0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&E0(n,t,s),s},ds=(e,n)=>(t,r)=>n(t,r,e);exports.FUniver=class extends qn{constructor(n,t,r){super(),this._injector=n,this._commandService=t,this._univerInstanceService=r}static newAPI(n){return(n instanceof mc?n.__getInjector():n).createInstance(exports.FUniver)}disposeUnit(n){return this._univerInstanceService.disposeUnit(n)}getCurrentLifecycleStage(){return this._injector.get(exports.LifecycleService).stage}undo(){return this._commandService.executeCommand(rr.id)}redo(){return this._commandService.executeCommand(sr.id)}onBeforeCommandExecute(n){return this._commandService.beforeCommandExecuted((t,r)=>{n(t,r)})}onCommandExecuted(n){return this._commandService.onCommandExecuted((t,r)=>{n(t,r)})}executeCommand(n,t,r){return this._commandService.executeCommand(n,t,r)}getHooks(){return this._injector.createInstance(exports.FHooks)}};exports.FUniver=R0([ds(0,Ot(Ft)),ds(1,Ut),ds(2,gn)],exports.FUniver);function pc(e){return/^-?\d+(\.\d+)?$/.test(e)}function v0(e){return pc(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}class Ti{constructor(){R(this,"_data",[])}static create(){return new Ti}add(n){this._data.indexOf(n)>-1||this._data.push(n)}delete(n){const t=this._data.indexOf(n);this._data.splice(t,1)}getData(){return this._data}}class Ni{constructor(){R(this,"_data",new Map)}static create(){return new Ni}add(n,t){this._data.has(n)||this._data.set(n,t)}delete(n){this._data.delete(n)}getData(){return this._data}}function I0(e){const n=new MessageChannel;let t=!1;const r=()=>{t||e()};return n.port1.onmessage=r,n.port2.postMessage(null),()=>{t=!0,n.port1.close(),n.port2.close()}}function S0(e,n){return n.forEach(t=>e.add(t)),e}function O0(e,n,t,r){var c;if(n==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new Wt(s),o=n.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(n))>=0;){const h=new nt,u=fn.getInstance();if(a>0&&h.retain(a),t.length>0){const d=i.sliceBody(a,a+o),f={dataStream:t};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(f.textRuns=[{...d.textRuns[0],st:0,ed:t.length}]),(c=d==null?void 0:d.customRanges)!=null&&c.length){const p=d.customRanges[0];f.customRanges=[{...p,startIndex:0,endIndex:t.length-1}]}h.insert(t.length,f)}h.delete(o),i.apply(u.editOp(h.serialize()))}const l=i.getBody();return i.dispose(),l}const y0="__default_document_sub_component_id20231101__";class _c{constructor(){R(this,"skipNextObservers",!1);R(this,"lastReturnValue");R(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class w0 extends Ee.Subject{constructor(){super(...arguments);R(this,"_sortedObservers",[])}subscribe(){throw new Error("[EventSubject]: please use `subscribeEvent` instead of `subscribe` method for `EventSubject`.")}next(){throw new Error("[EventSubject]: please use `emitEvent` instead of `next` method for `EventSubject`.")}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(t){let r;typeof t=="function"?r={next:([i,o])=>t(i,o)}:r=t;const s=super.subscribe(r);return this._sortedObservers.push(r),this._sortedObservers.sort((i,o)=>{var a,l;return((a=i.priority)!=null?a:0)-((l=o.priority)!=null?l:0)}),s.add(()=>this._sortedObservers=this._sortedObservers.filter(i=>i!==r)),s}clearObservers(){this._sortedObservers.forEach(t=>{var r;return(r=t.complete)==null?void 0:r.call(t)}),this._sortedObservers.length=0}emitEvent(t){var r;if(!this.closed){const s=new _c;s.lastReturnValue=t;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[t,s]);if(s.lastReturnValue=o,s.skipNextObservers)return{handled:!0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}throw new Error("[EventSubject]: cannot emit event on a closed subject.")}}function b0(e){return new Ee.Observable(n=>{const t=e.subscribeEvent(r=>{n.next(r)});return()=>t.unsubscribe()})}const A0=wt("ILocalStorageService");function T0(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function N0(e){return new Promise(n=>setTimeout(n,e))}const M0=["script","style","meta","comment","link"];var Ec=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(Ec||{}),Cc=(e=>(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))(Cc||{}),Rc=(e=>(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))(Rc||{}),vc=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(vc||{}),Ic=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(Ic||{}),Sc=(e=>(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))(Sc||{});const Fo=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],fs=1,Pn=8;class Mi{static from(n){if(!(n instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(n,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==fs)throw new Error(`Got v${s} data when expected v${fs}.`);const i=Fo[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(n,2,1),[a]=new Uint32Array(n,4,1);return new Mi(a,o,i,n)}constructor(n,t=64,r=Float64Array,s){if(isNaN(n)||n<0)throw new Error(`Unpexpected numItems value: ${n}.`);this.numItems=+n,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=n<65536?Uint16Array:Uint32Array;const i=Fo.indexOf(this.ArrayType),o=n*2*this.ArrayType.BYTES_PER_ELEMENT,a=n*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,Pn,n),this.coords=new this.ArrayType(this.data,Pn+a+l,n*2),this._pos=n*2,this._finished=!0):(this.data=new ArrayBuffer(Pn+o+a+l),this.ids=new this.IndexArrayType(this.data,Pn,n),this.coords=new this.ArrayType(this.data,Pn+a+l,n*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(fs<<4)+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=n)}add(n,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=n,this.coords[this._pos++]=t,r}finish(){const n=this._pos>>1;if(n!==this.numItems)throw new Error(`Added ${n} items when expected ${this.numItems}.`);return Gs(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(n,t,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,l=[0,i.length-1,0],c=[];for(;l.length;){const h=l.pop()||0,u=l.pop()||0,d=l.pop()||0;if(u-d<=a){for(let v=d;v<=u;v++){const I=o[2*v],M=o[2*v+1];I>=n&&I<=r&&M>=t&&M<=s&&c.push(i[v])}continue}const f=d+u>>1,p=o[2*f],E=o[2*f+1];p>=n&&p<=r&&E>=t&&E<=s&&c.push(i[f]),(h===0?n<=p:t<=E)&&(l.push(d),l.push(f-1),l.push(1-h)),(h===0?r>=p:s>=E)&&(l.push(f+1),l.push(u),l.push(1-h))}return c}within(n,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:o}=this,a=[0,s.length-1,0],l=[],c=r*r;for(;a.length;){const h=a.pop()||0,u=a.pop()||0,d=a.pop()||0;if(u-d<=o){for(let v=d;v<=u;v++)$o(i[2*v],i[2*v+1],n,t)<=c&&l.push(s[v]);continue}const f=d+u>>1,p=i[2*f],E=i[2*f+1];$o(p,E,n,t)<=c&&l.push(s[f]),(h===0?n-r<=p:t-r<=E)&&(a.push(d),a.push(f-1),a.push(1-h)),(h===0?n+r>=p:t+r>=E)&&(a.push(f+1),a.push(u),a.push(1-h))}return l}}function Gs(e,n,t,r,s,i){if(s-r<=t)return;const o=r+s>>1;Oc(e,n,o,r,s,i),Gs(e,n,t,r,o-1,1-i),Gs(e,n,t,o+1,s,1-i)}function Oc(e,n,t,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,h=t-r+1,u=Math.log(c),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(c-d)/c)*(h-c/2<0?-1:1),p=Math.max(r,Math.floor(t-h*d/c+f)),E=Math.min(s,Math.floor(t+(c-h)*d/c+f));Oc(e,n,t,p,E,i)}const o=n[2*t+i];let a=r,l=s;for(kn(e,n,r,t),n[2*s+i]>o&&kn(e,n,r,s);a<l;){for(kn(e,n,a,l),a++,l--;n[2*a+i]<o;)a++;for(;n[2*l+i]>o;)l--}n[2*r+i]===o?kn(e,n,r,l):(l++,kn(e,n,l,s)),l<=t&&(r=l+1),t<=l&&(s=l-1)}}function kn(e,n,t,r){gs(e,t,r),gs(n,2*t,2*r),gs(n,2*t+1,2*r+1)}function gs(e,n,t){const r=e[n];e[n]=e[t],e[t]=r}function $o(e,n,t,r){const s=e-t,i=n-r;return s*s+i*i}function yc(e,n,t=0,r=e.length-1,s=D0){for(;r>t;){if(r-t>600){const l=r-t+1,c=n-t+1,h=Math.log(l),u=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(t,Math.floor(n-c*u/l+d)),p=Math.min(r,Math.floor(n+(l-c)*u/l+d));yc(e,n,f,p,s)}const i=e[n];let o=t,a=r;for(Fn(e,t,n),s(e[r],i)>0&&Fn(e,t,r);o<a;){for(Fn(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[t],i)===0?Fn(e,t,a):(a++,Fn(e,a,r)),a<=n&&(t=a+1),n<=a&&(r=a-1)}}function Fn(e,n,t){const r=e[n];e[n]=e[t],e[t]=r}function D0(e,n){return e<n?-1:e>n?1:0}class jo{constructor(n=9){this._maxEntries=Math.max(4,n),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(n){let t=this.data;const r=[];if(!wr(n,t))return r;const s=this.toBBox,i=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],l=t.leaf?s(a):a;wr(n,l)&&(t.leaf?r.push(a):ps(n,l)?this._all(a,r):i.push(a))}t=i.pop()}return r}collides(n){let t=this.data;if(!wr(n,t))return!1;const r=[];for(;t;){for(let s=0;s<t.children.length;s++){const i=t.children[s],o=t.leaf?this.toBBox(i):i;if(wr(n,o)){if(t.leaf||ps(n,o))return!0;r.push(i)}}t=r.pop()}return!1}load(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(let r=0;r<n.length;r++)this.insert(n[r]);return this}let t=this._build(n.slice(),0,n.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){const r=this.data;this.data=t,t=r}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(n){return n&&this._insert(n,this.data.height-1),this}clear(){return this.data=vn([]),this}remove(n,t){if(!n)return this;let r=this.data;const s=this.toBBox(n),i=[],o=[];let a,l,c;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],a=o.pop(),c=!0),r.leaf){const h=L0(n,r.children,t);if(h!==-1)return r.children.splice(h,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&ps(r,s)?(i.push(r),o.push(a),a=0,l=r,r=r.children[0]):l?(a++,r=l.children[a],c=!1):r=null}return this}toBBox(n){return n}compareMinX(n,t){return n.minX-t.minX}compareMinY(n,t){return n.minY-t.minY}toJSON(){return this.data}fromJSON(n){return this.data=n,this}_all(n,t){const r=[];for(;n;)n.leaf?t.push(...n.children):r.push(...n.children),n=r.pop();return t}_build(n,t,r,s){const i=r-t+1;let o=this._maxEntries,a;if(i<=o)return a=vn(n.slice(t,r+1)),Cn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=vn([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));Ho(n,t,r,c,this.compareMinX);for(let h=t;h<=r;h+=c){const u=Math.min(h+c-1,r);Ho(n,h,u,l,this.compareMinY);for(let d=h;d<=u;d+=l){const f=Math.min(d+l-1,u);a.children.push(this._build(n,d,f,s-1))}}return Cn(a,this.toBBox),a}_chooseSubtree(n,t,r,s){for(;s.push(t),!(t.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<t.children.length;l++){const c=t.children[l],h=ms(c),u=P0(n,c)-h;u<o?(o=u,i=h<i?h:i,a=c):u===o&&h<i&&(i=h,a=c)}t=a||t.children[0]}return t}_insert(n,t,r){const s=r?n:this.toBBox(n),i=[],o=this._chooseSubtree(s,this.data,t,i);for(o.children.push(n),zn(o,s);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(s,i,t)}_split(n,t){const r=n[t],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);const o=this._chooseSplitIndex(r,i,s),a=vn(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Cn(r,this.toBBox),Cn(a,this.toBBox),t?n[t-1].children.push(a):this._splitRoot(r,a)}_splitRoot(n,t){this.data=vn([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Cn(this.data,this.toBBox)}_chooseSplitIndex(n,t,r){let s,i=1/0,o=1/0;for(let a=t;a<=r-t;a++){const l=Yn(n,0,a,this.toBBox),c=Yn(n,a,r,this.toBBox),h=k0(l,c),u=ms(l)+ms(c);h<i?(i=h,s=a,o=u<o?u:o):h===i&&u<o&&(o=u,s=a)}return s||r-t}_chooseSplitAxis(n,t,r){const s=n.leaf?this.compareMinX:x0,i=n.leaf?this.compareMinY:U0,o=this._allDistMargin(n,t,r,s),a=this._allDistMargin(n,t,r,i);o<a&&n.children.sort(s)}_allDistMargin(n,t,r,s){n.children.sort(s);const i=this.toBBox,o=Yn(n,0,t,i),a=Yn(n,r-t,r,i);let l=yr(o)+yr(a);for(let c=t;c<r-t;c++){const h=n.children[c];zn(o,n.leaf?i(h):h),l+=yr(o)}for(let c=r-t-1;c>=t;c--){const h=n.children[c];zn(a,n.leaf?i(h):h),l+=yr(a)}return l}_adjustParentBBoxes(n,t,r){for(let s=r;s>=0;s--)zn(t[s],n)}_condense(n){for(let t=n.length-1,r;t>=0;t--)n[t].children.length===0?t>0?(r=n[t-1].children,r.splice(r.indexOf(n[t]),1)):this.clear():Cn(n[t],this.toBBox)}}function L0(e,n,t){if(!t)return n.indexOf(e);for(let r=0;r<n.length;r++)if(t(e,n[r]))return r;return-1}function Cn(e,n){Yn(e,0,e.children.length,n,e)}function Yn(e,n,t,r,s){s||(s=vn(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let i=n;i<t;i++){const o=e.children[i];zn(s,e.leaf?r(o):o)}return s}function zn(e,n){return e.minX=Math.min(e.minX,n.minX),e.minY=Math.min(e.minY,n.minY),e.maxX=Math.max(e.maxX,n.maxX),e.maxY=Math.max(e.maxY,n.maxY),e}function x0(e,n){return e.minX-n.minX}function U0(e,n){return e.minY-n.minY}function ms(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function yr(e){return e.maxX-e.minX+(e.maxY-e.minY)}function P0(e,n){return(Math.max(n.maxX,e.maxX)-Math.min(n.minX,e.minX))*(Math.max(n.maxY,e.maxY)-Math.min(n.minY,e.minY))}function k0(e,n){const t=Math.max(e.minX,n.minX),r=Math.max(e.minY,n.minY),s=Math.min(e.maxX,n.maxX),i=Math.min(e.maxY,n.maxY);return Math.max(0,s-t)*Math.max(0,i-r)}function ps(e,n){return e.minX<=n.minX&&e.minY<=n.minY&&n.maxX<=e.maxX&&n.maxY<=e.maxY}function wr(e,n){return n.minX<=e.maxX&&n.minY<=e.maxY&&n.maxX>=e.minX&&n.maxY>=e.minY}function vn(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ho(e,n,t,r,s){const i=[n,t];for(;i.length;){if(t=i.pop(),n=i.pop(),t-n<=r)continue;const o=n+Math.ceil((t-n)/r/2)*r;yc(e,o,n,t,s),i.push(n,o,o,t)}}class F0{constructor(n=!1){R(this,"_tree",new Map);R(this,"_oneCellCache",new Map);R(this,"_kdTree",new Map);this._enableOneCellCache=n}dispose(){this.clear()}getTree(n,t){return this._tree.has(n)||this._tree.set(n,new Map),this._tree.get(n).has(t)||this._tree.get(n).set(t,new jo),this._tree.get(n).get(t)}_getOneCellCache(n,t,r,s){return this._oneCellCache.has(n)||this._oneCellCache.set(n,new Map),this._oneCellCache.get(n).has(t)||this._oneCellCache.get(n).set(t,new Map),this._oneCellCache.get(n).get(t).has(r)||this._oneCellCache.get(n).get(t).set(r,new Map),this._oneCellCache.get(n).get(t).get(r).has(s)||this._oneCellCache.get(n).get(t).get(r).set(s,new Set),this._oneCellCache.get(n).get(t).get(r).get(s)}_removeOneCellCache(n,t,r,s,i){const o=this._oneCellCache.get(n);if(!o)return;const a=o.get(t);if(!a)return;const l=a.get(r);if(!l)return;const c=l.get(s);c&&c.delete(i)}_removeCellCacheByRange(n){const{unitId:t,sheetId:r,range:s,id:i}=n,o=this._oneCellCache.get(t);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:c,endRow:h,endColumn:u}=s;for(let d=l;d<=h;d++){const f=a.get(d);if(f)for(let p=c;p<=u;p++){const E=f.get(p);E&&E.delete(i)}}}_insertOneCellCache(n,t,r,s,i){this._getOneCellCache(n,t,r,s).add(i)}_getRdTreeItems(n){const t=[];for(const[r,s]of n)for(const[i,o]of s)t.push({x:i,y:r,ids:o});return t}_searchByOneCellCache(n){var p;const{unitId:t,sheetId:r,range:s}=n,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(p=this._kdTree.get(t))==null?void 0:p.get(r);if(!c)return[];const{tree:h,items:u}=c,d=h.range(o,i,l,a),f=[];for(const E of d){const v=u[E];f.push(...Array.from(v.ids))}return f}openKdTree(){var n;for(const[t,r]of this._oneCellCache){this._kdTree.has(t)||this._kdTree.set(t,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new Mi(o.length);(n=this._kdTree.get(t))==null||n.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var n;for(const[t,r]of this._oneCellCache)for(const[s,i]of r)(n=this._kdTree.get(t))==null||n.set(s,void 0)}insert(n){const{unitId:t,sheetId:r,range:s,id:i}=n;if(!t||t.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:c}=s;if(this._enableOneCellCache&&o===a&&l===c){this._insertOneCellCache(t,r,o,l,i);return}const h=this.getTree(t,r);Number.isNaN(o)&&(o=0),Number.isNaN(l)&&(l=0),Number.isNaN(a)&&(a=Number.POSITIVE_INFINITY),Number.isNaN(c)&&(c=Number.POSITIVE_INFINITY),h.insert({minX:l,minY:o,maxX:c,maxY:a,id:i})}bulkInsert(n){for(const t of n)this.insert(t)}*searchGenerator(n){var a;const{unitId:t,sheetId:r,range:s}=n;if(this._enableOneCellCache){const l=this._searchByOneCellCache(n);for(const c of l)yield c}const i=(a=this._tree.get(t))==null?void 0:a.get(r);if(!i)return;const o=i.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(const l of o)yield l.id}bulkSearch(n,t){const r=new Set;for(const s of n)for(const i of this.searchGenerator(s))(t==null?void 0:t.has(i))!==!0&&r.add(i);return r}removeById(n,t){var r,s;t?((r=this._tree.get(n))==null||r.delete(t),(s=this._oneCellCache.get(n))==null||s.delete(t)):(this._tree.delete(n),this._oneCellCache.delete(n))}_removeRTreeItem(n){const{unitId:t,sheetId:r,range:s,id:i}=n,o=this.getTree(t,r),a=o.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(let l=0;l<a.length;l++)a[l].id===i&&o.remove(a[l])}remove(n){const{unitId:t,sheetId:r,range:s,id:i}=n,{startRow:o,startColumn:a,endRow:l,endColumn:c}=s;this._enableOneCellCache?o===l&&a===c?this._removeOneCellCache(t,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(n),this._removeRTreeItem(n)):this._removeRTreeItem(n)}bulkRemove(n){for(const t of n)this.remove(t)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const n={};return this._tree.forEach((t,r)=>{n[r]={},t.forEach((s,i)=>{n[r][i]=s.toJSON()})}),n}fromJSON(n){this._tree.clear();for(const t in n){this._tree.set(t,new Map);for(const r in n[t]){const s=new jo;s.fromJSON(n[t][r]),this._tree.get(t).set(r,s)}}}}Nc();exports.ABCToNumber=r_;exports.AbsoluteRefType=tt;exports.ActionIterator=Rn;exports.AlignTypeH=Su;exports.AlignTypeV=Ou;exports.ArrangeTypeEnum=bu;exports.ArrowsAndMarkersShapes=al;exports.AsyncInterceptorManager=Gg;exports.AutoFillSeries=Xa;exports.BaselineOffset=Bt;exports.BasicShapes=ol;exports.BlockType=tu;exports.BooleanNumber=Ae;exports.BorderStyleTypes=Ge;exports.BorderType=Qa;exports.BuildTextUtils=Lt;exports.BulletAlignment=gr;exports.COLORS=Ms;exports.CellValueType=Jt;exports.Color=dn;exports.ColorBuilder=Zr;exports.ColorKit=At;exports.ColorType=It;exports.ColumnSeparatorType=iu;exports.CommandType=cr;exports.CommonHideTypes=Ja;exports.ConfigService=ac;exports.ContextService=ja;exports.CopyPasteType=Za;exports.CustomCommandExecutionError=As;exports.CustomDecorationType=ln;exports.CustomRangeType=tr;exports.DEFAULT_CELL=Wp;exports.DEFAULT_DOC=yi;exports.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=y0;exports.DEFAULT_EMPTY_DOCUMENT_VALUE=pa;exports.DEFAULT_RANGE=Hp;exports.DEFAULT_RANGE_ARRAY=jp;exports.DEFAULT_SELECTION=Bp;exports.DEFAULT_SLIDE=Pl;exports.DEFAULT_STYLES=ct;exports.DEFAULT_WORKSHEET_COLUMN_COUNT=zu;exports.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=SE;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Xu;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=bE;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH=Gu;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=yE;exports.DEFAULT_WORKSHEET_ROW_COUNT=Yu;exports.DEFAULT_WORKSHEET_ROW_COUNT_KEY=IE;exports.DEFAULT_WORKSHEET_ROW_HEIGHT=Vu;exports.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=OE;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Ku;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=wE;exports.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=si;exports.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=ri;exports.DOCS_ZEN_EDITOR_UNIT_ID_KEY=ma;exports.DOC_RANGE_TYPE=Cl;exports.DashStyleType=du;exports.DataStreamTreeNodeType=ju;exports.DataStreamTreeTokenType=jt;exports.DataValidationErrorStyle=Ec;exports.DataValidationImeMode=Cc;exports.DataValidationOperator=Rc;exports.DataValidationRenderMode=vc;exports.DataValidationStatus=Ic;exports.DataValidationType=Sc;exports.DeleteDirection=qa;exports.DependentOn=c0;exports.DesktopLogService=Ba;exports.DeveloperMetadataVisibility=el;exports.Dimension=tl;exports.Direction=nl;exports.Disposable=rt;exports.DisposableCollection=hi;exports.DocStyleType=ql;exports.DocumentDataModel=Wt;exports.DocumentFlavor=nu;exports.DrawingTypeEnum=Au;exports.EDITOR_ACTIVATED=qu;exports.EXTENSION_NAMES=kl;exports.ErrorService=lc;exports.EventState=_c;exports.EventSubject=w0;exports.FBase=qn;exports.FOCUSING_COMMON_DRAWINGS=HE;exports.FOCUSING_DOC=Bn;exports.FOCUSING_EDITOR_BUT_HIDDEN=UE;exports.FOCUSING_EDITOR_INPUT_FORMULA=PE;exports.FOCUSING_EDITOR_STANDALONE=FE;exports.FOCUSING_FX_BAR_EDITOR=ec;exports.FOCUSING_PANEL_EDITOR=$E;exports.FOCUSING_SHEET=On;exports.FOCUSING_SLIDE=Wn;exports.FOCUSING_UNIT=Hn;exports.FOCUSING_UNIVER_EDITOR=kE;exports.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=jE;exports.FORMULA_EDITOR_ACTIVATED=BE;exports.FollowNumberWithType=eu;exports.FontItalic=Ur;exports.FontStyleType=Sn;exports.FontWeight=Pr;exports.FormatType=rl;exports.GlyphType=Se;exports.GridType=ru;exports.HLSColor=pl;exports.HorizontalAlign=Xt;exports.IAuthzIoService=ic;exports.ICommandService=Ut;exports.IConfigService=oc;exports.IContextService=ur;exports.ILocalStorageService=A0;exports.ILogService=Nt;exports.IPermissionService=uc;exports.IResourceLoaderService=Vs;exports.IResourceManagerService=ts;exports.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=Jf;exports.IUndoRedoService=Qt;exports.IUniverInstanceService=gn;exports.Inject=Ot;exports.Injector=Ft;exports.InterceptorEffectEnum=In;exports.InterceptorManager=Yg;exports.InterpolationPointType=sl;exports.JSON1=m_;exports.JSONX=fn;exports.LRUHelper=jn;exports.LRUMap=$r;exports.LifecycleStages=Ve;exports.LocaleService=Kn;exports.LocaleType=hr;exports.LogLevel=Ha;exports.MOVE_BUFFER_VALUE=$n;exports.Many=Sa;exports.MemoryCursor=Ln;exports.NamedStyleType=cu;exports.NilCommand=Wa;exports.NumberUnitType=Iu;exports.ObjectMatrix=Pt;exports.ObjectRelativeFromH=Ru;exports.ObjectRelativeFromV=vu;exports.Optional=Oa;exports.OtherShapes=ll;exports.PRESET_LIST_TYPE=mr;exports.PageElementType=Tu;exports.PageOrientType=wu;exports.PageType=Si;exports.ParagraphElementType=au;exports.PermissionService=cc;exports.PermissionStatus=bi;exports.Plugin=Ys;exports.PositionedObjectLayoutType=uu;exports.PresetListType=kt;exports.ProtectionType=il;exports.QuickListType=Mu;exports.QuickListTypeMap=v_;exports.RANGE_DIRECTION=El;exports.RANGE_TYPE=we;exports.RCDisposable=qg;exports.RGBA_PAREN=Nm;exports.RGB_PAREN=Tm;exports.ROTATE_BUFFER_VALUE=Ka;exports.RTree=F0;exports.Range=Tn;exports.Rectangle=en;exports.RediConsumer=Ma;exports.RediContext=lr;exports.RediError=ot;exports.RediProvider=ci;exports.RedoCommand=sr;exports.RedoCommandId=rc;exports.RefAlias=n_;exports.Registry=Ti;exports.RegistryAsMap=Ni;exports.RelativeDate=cl;exports.RelativeSlideLink=Nu;exports.ResourceManagerService=gc;exports.RgbColor=kr;exports.RxDisposable=Zg;exports.SHEET_EDITOR_UNITS=Yp;exports.SectionType=su;exports.Self=Aa;exports.SheetTypes=hl;exports.SheetViewModel=Ju;exports.SkipSelf=ba;exports.SliceBodyType=Oi;exports.SlideDataModel=wi;exports.SpacingRule=hu;exports.SpecialShapes=ul;exports.Styles=ku;exports.THEME_COLORS=ml;exports.TabStopAlignment=fu;exports.TableAlignmentType=mu;exports.TableLayoutType=pu;exports.TableRowHeightRule=Eu;exports.TableSizeType=gu;exports.TableTextWrapType=_u;exports.TextDecoration=dl;exports.TextDirection=er;exports.TextDirectionType=ou;exports.TextX=nt;exports.TextXActionType=ie;exports.ThemeColor=Fr;exports.ThemeColorType=gt;exports.ThemeColors=Jr;exports.ThemeService=Ai;exports.Tools=G;exports.UndoCommand=rr;exports.UndoCommandId=sc;exports.UnitModel=es;exports.Univer=mc;exports.UniverInstanceType=ke;exports.UpdateDocsAttributeType=Le;exports.UserManagerService=Br;exports.VerticalAlign=an;exports.VerticalAlignmentType=Cu;exports.WithDependency=Ug;exports.WithNew=Ta;exports.Worksheet=nr;exports.WrapStrategy=cn;exports.WrapTextType=lu;exports.addLinkToDocumentModel=Bu;exports.afterInitApply=lm;exports.afterTime=am;exports.awaitTime=N0;exports.binSearchFirstGreaterThanTarget=Ga;exports.binarySearchArray=um;exports.bufferDebounceTime=om;exports.cellToRange=ip;exports.characterSpacingControlType=yu;exports.checkForSubstrings=op;exports.checkIfMove=dm;exports.checkParagraphHasBullet=Op;exports.checkParagraphHasIndent=yp;exports.checkParagraphHasIndentByStyle=Dl;exports.codeToBlob=hm;exports.composeBody=Hs;exports.composeInterceptors=Pa;exports.composeStyles=Ts;exports.concatMatrixArray=Pp;exports.connectDependencies=Dg;exports.connectInjector=Mg;exports.convertBodyToHtml=Am;exports.convertCellToRange=Rl;exports.covertTextRunToHtml=Ns;exports.createAsyncInterceptorKey=zg;exports.createDefaultUser=Hr;exports.createIdentifier=wt;exports.createInterceptorKey=Wg;exports.createInternalEditorID=Zf;exports.createRowColIter=Us;exports.dayjs=zt;exports.debounce=bf;exports.dedupe=zf;exports.deepCompare=gi;exports.deleteContent=xl;exports.extractPureTextFromCell=Zu;exports.forwardRef=ag;exports.fromCallback=Ya;exports.fromEventSubject=b0;exports.fromObservable=Jg;exports.generateRandomId=hn;exports.get=rf;exports.getArrayLength=Zt;exports.getBodySlice=qt;exports.getBodySliceHtml=Nr;exports.getBorderStyleType=np;exports.getCellInfoInMergeData=Xm;exports.getCellValueType=zm;exports.getColorStyle=Dt;exports.getCustomDecorationSlice=xu;exports.getCustomRangeSlice=Lu;exports.getDocsUpdateBody=rp;exports.getIntersectRange=Qp;exports.getOriginCellValue=TE;exports.getReverseDirection=fm;exports.getWorksheetUID=xE;exports.groupBy=Kf;exports.handleStyleToString=tp;exports.hashAlgorithm=Ap;exports.horizontalLineSegmentsSubtraction=qr;exports.insertMatrixArray=Ds;exports.insertTextToContent=Ll;exports.isAsyncDependencyItem=Ss;exports.isAsyncHook=Ar;exports.isBlackColor=Bm;exports.isBooleanString=Qf;exports.isCellCoverable=Zm;exports.isCellV=Gm;exports.isClassDependencyItem=Rs;exports.isCtor=oi;exports.isDisposable=ys;exports.isEmptyCell=vl;exports.isFactoryDependencyItem=vs;exports.isFormulaId=ep;exports.isFormulaString=qm;exports.isICellData=Ym;exports.isInternalEditorID=_a;exports.isNodeEnv=bm;exports.isNullCell=Vm;exports.isNumeric=pc;exports.isRangesEqual=gE;exports.isRealNum=bp;exports.isSafeNumeric=v0;exports.isSameStyleTextRun=Il;exports.isUnitRangesEqual=mE;exports.isValidRange=sp;exports.isValueDependencyItem=Is;exports.isWhiteColor=Wm;exports.makeArray=Xf;exports.makeCellRangeToRangeData=Jm;exports.makeCellToSelection=Qm;exports.makeCustomRangeStream=rE;exports.merge=Df;exports.mergeOverrideWithDependencies=fc;exports.mergeSets=S0;exports.mergeWith=Mf;exports.mergeWorksheetSnapshotWithDefault=Qu;exports.mixinClass=Kg;exports.moveMatrixArray=xs;exports.moveRangeByOffset=zp;exports.nameCharacterCheck=T0;exports.normalizeBody=N_;exports.normalizeTextRuns=fr;exports.numberToABC=i_;exports.numberToListABC=o_;exports.numfmt=Up;exports.queryObjectMatrix=t_;exports.registerDependencies=Hg;exports.remove=or;exports.repeatStringNumTimes=$l;exports.replaceInDocumentBody=O0;exports.requestImmediateMacroTask=I0;exports.rotate=Gf;exports.searchArray=cm;exports.searchInOrderedArray=Va;exports.selectionToArray=Km;exports.sequence=Fa;exports.sequenceAsync=ka;exports.sequenceExecute=di;exports.sequenceExecuteAsync=im;exports.set=xf;exports.setDependencies=Og;exports.shallowEqual=Ua;exports.skipParseTagNames=M0;exports.sliceMatrixArray=kp;exports.sortRules=a_;exports.sortRulesByDesc=l_;exports.sortRulesFactory=dr;exports.spliceArray=Ls;exports.splitIntoGrid=mi;exports.takeAfter=za;exports.textDiff=ga;exports.throttle=Bg;exports.toDisposable=Je;exports.touchDependencies=xa;exports.updateAttributeByDelete=Uu;exports.updateAttributeByInsert=Pu;exports.useDependency=Tg;exports.useDependencyContext=$g;exports.useDependencyContextValue=jg;exports.useDependencyValue=La;exports.useInjector=Da;exports.useObservable=kg;exports.useUpdateBinder=Fg;