vzcode 1.7.0 → 1.8.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.
|
@@ -74,7 +74,7 @@ Source:
|
|
|
74
74
|
`))):Pe=R.stylize("[Circular]","special")),A(he)){if(ge&&de.match(/^\d+$/))return Pe;he=JSON.stringify(""+de),he.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(he=he.slice(1,-1),he=R.stylize(he,"name")):(he=he.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),he=R.stylize(he,"string"))}return he+": "+Pe}function b(R,N,V){var ne=R.reduce(function(de,ge){return ge.indexOf(`
|
|
75
75
|
`)>=0,de+ge.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ne>60?V[0]+(N===""?"":N+`
|
|
76
76
|
`)+" "+R.join(`,
|
|
77
|
-
`)+" "+V[1]:V[0]+N+" "+R.join(", ")+" "+V[1]}i.types=r("./support/types");function w(R){return Array.isArray(R)}i.isArray=w;function _(R){return typeof R=="boolean"}i.isBoolean=_;function C(R){return R===null}i.isNull=C;function P(R){return R==null}i.isNullOrUndefined=P;function k(R){return typeof R=="number"}i.isNumber=k;function x(R){return typeof R=="string"}i.isString=x;function E(R){return typeof R=="symbol"}i.isSymbol=E;function A(R){return R===void 0}i.isUndefined=A;function I(R){return X(R)&&F(R)==="[object RegExp]"}i.isRegExp=I,i.types.isRegExp=I;function X(R){return typeof R=="object"&&R!==null}i.isObject=X;function H(R){return X(R)&&F(R)==="[object Date]"}i.isDate=H,i.types.isDate=H;function j(R){return X(R)&&(F(R)==="[object Error]"||R instanceof Error)}i.isError=j,i.types.isNativeError=j;function W(R){return typeof R=="function"}i.isFunction=W;function Z(R){return R===null||typeof R=="boolean"||typeof R=="number"||typeof R=="string"||typeof R=="symbol"||typeof R>"u"}i.isPrimitive=Z,i.isBuffer=r("./support/isBuffer");function F(R){return Object.prototype.toString.call(R)}function G(R){return R<10?"0"+R.toString(10):R.toString(10)}var se=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ue(){var R=new Date,N=[G(R.getHours()),G(R.getMinutes()),G(R.getSeconds())].join(":");return[R.getDate(),se[R.getMonth()],N].join(" ")}i.log=function(){console.log("%s - %s",ue(),i.format.apply(i,arguments))},i.inherits=r("inherits"),i._extend=function(R,N){if(!N||!X(N))return R;for(var V=Object.keys(N),ne=V.length;ne--;)R[V[ne]]=N[V[ne]];return R};function U(R,N){return Object.prototype.hasOwnProperty.call(R,N)}var K=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;i.promisify=function(N){if(typeof N!="function")throw new TypeError('The "original" argument must be of type Function');if(K&&N[K]){var V=N[K];if(typeof V!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(V,K,{value:V,enumerable:!1,writable:!1,configurable:!0}),V}function V(){for(var ne,de,ge=new Promise(function(Re,it){ne=Re,de=it}),he=[],Pe=0;Pe<arguments.length;Pe++)he.push(arguments[Pe]);he.push(function(Re,it){Re?de(Re):ne(it)});try{N.apply(this,he)}catch(Re){de(Re)}return ge}return Object.setPrototypeOf(V,Object.getPrototypeOf(N)),K&&Object.defineProperty(V,K,{value:V,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(V,s(N))},i.promisify.custom=K;function oe(R,N){if(!R){var V=new Error("Promise was rejected with a falsy value");V.reason=R,R=V}return N(R)}function Me(R){if(typeof R!="function")throw new TypeError('The "original" argument must be of type Function');function N(){for(var V=[],ne=0;ne<arguments.length;ne++)V.push(arguments[ne]);var de=V.pop();if(typeof de!="function")throw new TypeError("The last argument must be of type Function");var ge=this,he=function(){return de.apply(ge,arguments)};R.apply(this,V).then(function(Pe){o.nextTick(he.bind(null,null,Pe))},function(Pe){o.nextTick(oe.bind(null,Pe,he))})}return Object.setPrototypeOf(N,Object.getPrototypeOf(R)),Object.defineProperties(N,s(R)),N}i.callbackify=Me}).call(this)}).call(this,r("_process"))},{"./support/isBuffer":35,"./support/types":36,_process:33,inherits:17}],38:[function(r,n,i){(function(o){(function(){var s=r("for-each"),a=r("available-typed-arrays"),l=r("call-bind/callBound"),c=r("gopd"),u=l("Object.prototype.toString"),f=r("has-tostringtag/shams")(),h=typeof globalThis>"u"?o:globalThis,d=a(),p=l("String.prototype.slice"),g={},m=Object.getPrototypeOf;f&&c&&m&&s(d,function(v){if(typeof h[v]=="function"){var b=new h[v];if(Symbol.toStringTag in b){var w=m(b),_=c(w,Symbol.toStringTag);if(!_){var C=m(w);_=c(C,Symbol.toStringTag)}g[v]=_.get}}});var y=function(b){var w=!1;return s(g,function(_,C){if(!w)try{var P=_.call(b);P===C&&(w=P)}catch{}}),w},O=r("is-typed-array");n.exports=function(b){return O(b)?!f||!(Symbol.toStringTag in b)?p(u(b),8,-1):y(b):!1}}).call(this)}).call(this,typeof Fr<"u"?Fr:typeof self<"u"?self:typeof window<"u"?window:{})},{"available-typed-arrays":5,"call-bind/callBound":6,"for-each":8,gopd:12,"has-tostringtag/shams":15,"is-typed-array":21}],39:[function(r,n,i){const o=r("ot-json1-presence"),s=r("ot-text-unicode");n.exports={json1Presence:o,textUnicode:s}},{"ot-json1-presence":26,"ot-text-unicode":31}]},{},[39])(39)})})(nC);var EM=nC.exports;const QM=_i(EM),{json1Presence:Cv,textUnicode:iC}=QM;function TM(t){return new Worker("/assets/worker-Cs0ZU3m1.js",{name:t==null?void 0:t.name})}function RM(t){return new Worker("/assets/index
|
|
77
|
+
`)+" "+V[1]:V[0]+N+" "+R.join(", ")+" "+V[1]}i.types=r("./support/types");function w(R){return Array.isArray(R)}i.isArray=w;function _(R){return typeof R=="boolean"}i.isBoolean=_;function C(R){return R===null}i.isNull=C;function P(R){return R==null}i.isNullOrUndefined=P;function k(R){return typeof R=="number"}i.isNumber=k;function x(R){return typeof R=="string"}i.isString=x;function E(R){return typeof R=="symbol"}i.isSymbol=E;function A(R){return R===void 0}i.isUndefined=A;function I(R){return X(R)&&F(R)==="[object RegExp]"}i.isRegExp=I,i.types.isRegExp=I;function X(R){return typeof R=="object"&&R!==null}i.isObject=X;function H(R){return X(R)&&F(R)==="[object Date]"}i.isDate=H,i.types.isDate=H;function j(R){return X(R)&&(F(R)==="[object Error]"||R instanceof Error)}i.isError=j,i.types.isNativeError=j;function W(R){return typeof R=="function"}i.isFunction=W;function Z(R){return R===null||typeof R=="boolean"||typeof R=="number"||typeof R=="string"||typeof R=="symbol"||typeof R>"u"}i.isPrimitive=Z,i.isBuffer=r("./support/isBuffer");function F(R){return Object.prototype.toString.call(R)}function G(R){return R<10?"0"+R.toString(10):R.toString(10)}var se=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ue(){var R=new Date,N=[G(R.getHours()),G(R.getMinutes()),G(R.getSeconds())].join(":");return[R.getDate(),se[R.getMonth()],N].join(" ")}i.log=function(){console.log("%s - %s",ue(),i.format.apply(i,arguments))},i.inherits=r("inherits"),i._extend=function(R,N){if(!N||!X(N))return R;for(var V=Object.keys(N),ne=V.length;ne--;)R[V[ne]]=N[V[ne]];return R};function U(R,N){return Object.prototype.hasOwnProperty.call(R,N)}var K=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;i.promisify=function(N){if(typeof N!="function")throw new TypeError('The "original" argument must be of type Function');if(K&&N[K]){var V=N[K];if(typeof V!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(V,K,{value:V,enumerable:!1,writable:!1,configurable:!0}),V}function V(){for(var ne,de,ge=new Promise(function(Re,it){ne=Re,de=it}),he=[],Pe=0;Pe<arguments.length;Pe++)he.push(arguments[Pe]);he.push(function(Re,it){Re?de(Re):ne(it)});try{N.apply(this,he)}catch(Re){de(Re)}return ge}return Object.setPrototypeOf(V,Object.getPrototypeOf(N)),K&&Object.defineProperty(V,K,{value:V,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(V,s(N))},i.promisify.custom=K;function oe(R,N){if(!R){var V=new Error("Promise was rejected with a falsy value");V.reason=R,R=V}return N(R)}function Me(R){if(typeof R!="function")throw new TypeError('The "original" argument must be of type Function');function N(){for(var V=[],ne=0;ne<arguments.length;ne++)V.push(arguments[ne]);var de=V.pop();if(typeof de!="function")throw new TypeError("The last argument must be of type Function");var ge=this,he=function(){return de.apply(ge,arguments)};R.apply(this,V).then(function(Pe){o.nextTick(he.bind(null,null,Pe))},function(Pe){o.nextTick(oe.bind(null,Pe,he))})}return Object.setPrototypeOf(N,Object.getPrototypeOf(R)),Object.defineProperties(N,s(R)),N}i.callbackify=Me}).call(this)}).call(this,r("_process"))},{"./support/isBuffer":35,"./support/types":36,_process:33,inherits:17}],38:[function(r,n,i){(function(o){(function(){var s=r("for-each"),a=r("available-typed-arrays"),l=r("call-bind/callBound"),c=r("gopd"),u=l("Object.prototype.toString"),f=r("has-tostringtag/shams")(),h=typeof globalThis>"u"?o:globalThis,d=a(),p=l("String.prototype.slice"),g={},m=Object.getPrototypeOf;f&&c&&m&&s(d,function(v){if(typeof h[v]=="function"){var b=new h[v];if(Symbol.toStringTag in b){var w=m(b),_=c(w,Symbol.toStringTag);if(!_){var C=m(w);_=c(C,Symbol.toStringTag)}g[v]=_.get}}});var y=function(b){var w=!1;return s(g,function(_,C){if(!w)try{var P=_.call(b);P===C&&(w=P)}catch{}}),w},O=r("is-typed-array");n.exports=function(b){return O(b)?!f||!(Symbol.toStringTag in b)?p(u(b),8,-1):y(b):!1}}).call(this)}).call(this,typeof Fr<"u"?Fr:typeof self<"u"?self:typeof window<"u"?window:{})},{"available-typed-arrays":5,"call-bind/callBound":6,"for-each":8,gopd:12,"has-tostringtag/shams":15,"is-typed-array":21}],39:[function(r,n,i){const o=r("ot-json1-presence"),s=r("ot-text-unicode");n.exports={json1Presence:o,textUnicode:s}},{"ot-json1-presence":26,"ot-text-unicode":31}]},{},[39])(39)})})(nC);var EM=nC.exports;const QM=_i(EM),{json1Presence:Cv,textUnicode:iC}=QM;function TM(t){return new Worker("/assets/worker-Cs0ZU3m1.js",{name:t==null?void 0:t.name})}function RM(t){return new Worker("/assets/index--bvX81xc.js",{name:t==null?void 0:t.name})}const AM=!0,fS=800,oC="vzCodeSidebarWidth",sC="vzCodeCodeEditorWidth",aC=250;let Pg=aC;const lC=800;let kg=lC,ly=!1;if(typeof window<"u"&&AM){const t=window.localStorage.getItem(oC),e=window.localStorage.getItem(sC);t!==null&&(Pg=+t,ly=!0),e!==null&&(kg=+e,ly=!0)}const jM={codeEditorWidth:kg,sidebarWidth:Pg,moveSplitPane:()=>{},isDraggingRight:!1,isDraggingLeft:!1,setIsDragging:()=>{}},xg=q.createContext(jM),MM={sidebarWidth:aC,codeEditorWidth:lC,isDraggingLeft:!1,isDraggingRight:!1,isInitialized:!1},DM=(t,e)=>{switch(e.type){case"initialize":return{...t,sidebarWidth:Pg,codeEditorWidth:kg,isInitialized:!0};case"move":return e.side==="left"?{...t,sidebarWidth:t.sidebarWidth+e.movementX}:{...t,codeEditorWidth:t.codeEditorWidth+e.movementX};case"setIsDragging":return e.side==="left"?{...t,isDraggingLeft:e.isDragging}:{...t,isDraggingRight:e.isDragging};default:return t}},qM=({children:t})=>{const[e,r]=q.useReducer(DM,MM),n=q.useCallback((f,h)=>{r({type:"setIsDragging",isDragging:f,side:h})},[r]),i=q.useCallback((f,h)=>{r({type:"move",movementX:f,side:h})},[r]),{sidebarWidth:o,codeEditorWidth:s,isDraggingLeft:a,isDraggingRight:l,isInitialized:c}=e;typeof window<"u"&&q.useLayoutEffect(()=>{ly&&!c&&r({type:"initialize"})},[c]),q.useEffect(()=>{o!==Pg&&setTimeout(()=>{window.localStorage.setItem(oC,""+o)},fS),s!==kg&&setTimeout(()=>{window.localStorage.setItem(sC,""+s)},fS)},[s,o]);const u={codeEditorWidth:s,sidebarWidth:o,moveSplitPane:i,isDraggingLeft:a,isDraggingRight:l,setIsDragging:n};return Q.jsx(xg.Provider,{value:u,children:t})},ZM=1200,NM=t=>{const e=t.match(/\.([^.]+)$/);return e?e[1]:""},IM=({shareDBDoc:t,submitOperation:e,prettierWorker:r})=>{const n=q.useRef(new Set),[i,o]=q.useState(null),s=q.useRef(!1),a=q.useRef(null);return q.useEffect(()=>{if(!t)return;const l=f=>{const{fileId:h,error:d,fileTextPrettified:p}=f.data;if(d){o(d);return}else o(null);s.current=!0,e(g=>({...g,files:{...g.files,[h]:{...g.files[h],text:p}}})),s.current=!1};r.addEventListener("message",l);const c=async()=>{const h=t.data.files,d=n.current,p=Array.from(d);d.clear();for(const g of p){const m=h[g],y={fileText:m.text,fileExtension:NM(m.name),fileId:g};r.postMessage(y)}};a.current=c;const u=f=>{if(!s.current&&f&&f.length===4&&f[0]==="files"&&typeof f[1]=="string"&&f[2]==="text"){const h=f[1];n.current.add(h)}};return t.on("op batch",u),()=>{r.removeEventListener("message",l),t.removeListener("op batch",u)}},[t]),{prettierError:i,runPrettierRef:a}},WM=500,BM=ZM+WM,LM=({content:t,typeScriptWorker:e})=>{const r=q.useRef(null),n=q.useCallback(i=>{i!==null&&(clearTimeout(r.current),r.current=window.setTimeout(()=>{e.postMessage({event:"update-content",details:i})},BM))},[e]);q.useEffect(()=>{n(t)},[t])},VM=(t,e)=>{if(e.type!=="close_tabs")return t;const r=t.tabList.filter(o=>!e.fileIdsToClose.includes(o.fileId));if(!e.fileIdsToClose.includes(t.activeFileId))return{...t,tabList:r};const n=t.tabList.findIndex(o=>o.fileId===t.activeFileId);let i=null;for(let o=n-1;o>=0;o--)if(!e.fileIdsToClose.includes(t.tabList[o].fileId)){i=t.tabList[o].fileId;break}if(!i){for(let o=n+1;o<t.tabList.length;o++)if(!e.fileIdsToClose.includes(t.tabList[o].fileId)){i=t.tabList[o].fileId;break}}return{...t,tabList:r,activeFileId:i}},XM=(t,e)=>{if(e.type!=="open_tab")return t;const r=t.tabList.findIndex(l=>l.fileId===e.fileId),n=r!==-1,i=n&&t.tabList[r].isTransient,o=t.tabList.findIndex(l=>l.isTransient&&l.fileId!==e.fileId),s={fileId:e.fileId,isTransient:e.isTransient};let a;return n?i?a=t.tabList.map(l=>l.fileId===e.fileId?s:l):a=[...t.tabList]:o!==-1?(a=[...t.tabList],a[o]=s):a=[...t.tabList,s],{...t,activeFileId:e.fileId,tabList:a,editorWantsFocus:!e.isTransient}},FM=(t,e)=>e.type==="set_active_file_id"?{...t,activeFileId:e.activeFileId}:t,UM=(t,e)=>{if(e.type!=="set_active_file_left")return t;let r=t.tabList.findIndex(n=>n.fileId===t.activeFileId);return r-=1,r<0&&(r=t.tabList.length-1),{...t,activeFileId:t.tabList[r].fileId}},YM=(t,e)=>{if(e.type!=="set_active_file_right")return t;let r=t.tabList.findIndex(n=>n.fileId===t.activeFileId);return r+=1,r>t.tabList.length-1&&(r=0),{...t,activeFileId:t.tabList[r].fileId}},zM=(t,e)=>e.type==="set_is_settings_open"?{...t,isSettingsOpen:e.value}:t,GM=(t,e)=>e.type==="set_is_doc_open"?{...t,isDocOpen:e.value}:t,HM=(t,e)=>e.type==="set_theme"?{...t,theme:e.themeLabel}:t,KM=(t,e)=>e.type==="editor_no_longer_wants_focus"?{...t,editorWantsFocus:!1}:t,JM=(t,e)=>e.type==="set_username"?{...t,username:e.username}:t;function eD(t,e){const r=t.data.files,n=Object.keys(t.data.files);let i={};for(let o=0;o<n.length;o++){const s=r[n[o]];if(r[n[o]].text){const a=s.name,l=s.text.split(`
|
|
78
78
|
`),c=[];for(let u=0;u<l.length;u++){const f=l[u].indexOf(e);f!==-1&&c.push({line:u+1,index:f,text:l[u]})}c.length>0&&(i[n[o]]={name:a,matches:c,visibility:"open"})}}return i}function tD(t,e,r){return{...t,[e]:{...t[e],visibility:r}}}const rD=(t,e)=>e.type==="set_is_search_open"?{...t,isSearchOpen:e.value}:t,nD=(t,e)=>e.type==="set_search"?{...t,search:{pattern:e.value,results:{}}}:t,iD=(t,e)=>e.type==="set_search_results"?{...t,search:{pattern:t.search.pattern,results:eD(e.files,t.search.pattern)}}:t,oD=(t,e)=>e.type==="set_search_file_visibility"?{...t,search:{pattern:t.search.pattern,results:tD(t.search.results,e.id,e.visibility)}}:t,sD=(t,e)=>e.type==="toggle_auto_follow"?{...t,enableAutoFollow:!t.enableAutoFollow}:t,aD=({defaultTheme:t,initialUsername:e="Anonymous"})=>({tabList:[],activeFileId:null,theme:t,search:{pattern:"",results:{}},isSearchOpen:!1,isSettingsOpen:!1,isDocOpen:!1,editorWantsFocus:!1,username:e}),lD=[FM,UM,YM,XM,VM,HM,nD,iD,oD,rD,zM,GM,KM,JM,sD],uD=(t,e)=>lD.reduce((r,n)=>n(r,e),t);class Zt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,r,n){[e,r]=Fl(this,e,r);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(r,this.length,i,1),co.from(i,this.length-(r-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,r=this.length){[e,r]=Fl(this,e,r);let n=[];return this.decompose(e,r,n,0),co.from(n,r-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let r=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new vc(this),o=new vc(e);for(let s=r,a=r;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=n)return!0}}iter(e=1){return new vc(this,e)}iterRange(e,r=this.length){return new uC(this,e,r)}iterLines(e,r){let n;if(e==null)n=this.iter();else{r==null&&(r=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,r==this.lines+1?this.length:r<=1?0:this.line(r-1).to))}return new cC(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Zt.empty:e.length<=32?new jr(e):co.from(jr.split(e,[]))}}class jr extends Zt{constructor(e,r=cD(e)){super(),this.text=e,this.length=r}get lines(){return this.text.length}get children(){return null}lineInner(e,r,n,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((r?n:a)>=e)return new fD(i,a,n,s);i=a+1,n++}}decompose(e,r,n,i){let o=e<=0&&r>=this.length?this:new jr(hS(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let s=n.pop(),a=qd(o.text,s.text.slice(),0,o.length);if(a.length<=32)n.push(new jr(a,s.length+o.length));else{let l=a.length>>1;n.push(new jr(a.slice(0,l)),new jr(a.slice(l)))}}else n.push(o)}replace(e,r,n){if(!(n instanceof jr))return super.replace(e,r,n);[e,r]=Fl(this,e,r);let i=qd(this.text,qd(n.text,hS(this.text,0,e)),r),o=this.length+n.length-(r-e);return i.length<=32?new jr(i,o):co.from(jr.split(i,[]),o)}sliceString(e,r=this.length,n=`
|
|
79
79
|
`){[e,r]=Fl(this,e,r);let i="";for(let o=0,s=0;o<=r&&s<this.text.length;s++){let a=this.text[s],l=o+a.length;o>e&&s&&(i+=n),e<l&&r>o&&(i+=a.slice(Math.max(0,e-o),r-o)),o=l+1}return i}flatten(e){for(let r of this.text)e.push(r)}scanIdentical(){return 0}static split(e,r){let n=[],i=-1;for(let o of e)n.push(o),i+=o.length+1,n.length==32&&(r.push(new jr(n,i)),n=[],i=-1);return i>-1&&r.push(new jr(n,i)),r}}class co extends Zt{constructor(e,r){super(),this.children=e,this.length=r,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,r,n,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=n+s.lines-1;if((r?l:a)>=e)return s.lineInner(e,r,n,i);i=a+1,n=l+1}}decompose(e,r,n,i){for(let o=0,s=0;s<=r&&o<this.children.length;o++){let a=this.children[o],l=s+a.length;if(e<=l&&r>=s){let c=i&((s<=e?1:0)|(l>=r?2:0));s>=e&&l<=r&&!c?n.push(a):a.decompose(e-s,r-s,n,c)}s=l+1}}replace(e,r,n){if([e,r]=Fl(this,e,r),n.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let s=this.children[i],a=o+s.length;if(e>=o&&r<=a){let l=s.replace(e-o,r-o,n),c=this.lines-s.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new co(u,this.length-(r-e)+n.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,r,n)}sliceString(e,r=this.length,n=`
|
|
80
80
|
`){[e,r]=Fl(this,e,r);let i="";for(let o=0,s=0;o<this.children.length&&s<=r;o++){let a=this.children[o],l=s+a.length;s>e&&o&&(i+=n),e<l&&r>s&&(i+=a.sliceString(e-s,r-s,n)),s=l+1}return i}flatten(e){for(let r of this.children)r.flatten(e)}scanIdentical(e,r){if(!(e instanceof co))return 0;let n=0,[i,o,s,a]=r>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=r,o+=r){if(i==s||o==a)return n;let l=this.children[i],c=e.children[o];if(l!=c)return n+l.scanIdentical(c,r);n+=l.length+1}}static from(e,r=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let p of e)p.flatten(d);return new jr(d,r)}let i=Math.max(32,n>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function f(d){let p;if(d.lines>o&&d instanceof co)for(let g of d.children)f(g);else d.lines>s&&(l>s||!l)?(h(),a.push(d)):d instanceof jr&&l&&(p=u[u.length-1])instanceof jr&&d.lines+p.lines<=32?(l+=d.lines,c+=d.length+1,u[u.length-1]=new jr(p.text.concat(d.text),p.length+1+d.length)):(l+d.lines>i&&h(),l+=d.lines,c+=d.length+1,u.push(d))}function h(){l!=0&&(a.push(u.length==1?u[0]:co.from(u,c)),c=-1,l=u.length=0)}for(let d of e)f(d);return h(),a.length==1?a[0]:new co(a,r)}}Zt.empty=new jr([""],0);function cD(t){let e=-1;for(let r of t)e+=r.length+1;return e}function qd(t,e,r=0,n=1e9){for(let i=0,o=0,s=!0;o<t.length&&i<=n;o++){let a=t[o],l=i+a.length;l>=r&&(l>n&&(a=a.slice(0,n-i)),i<r&&(a=a.slice(r-i)),s?(e[e.length-1]+=a,s=!1):e.push(a)),i=l+1}return e}function hS(t,e,r){return qd(t,[""],e,r)}class vc{constructor(e,r=1){this.dir=r,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[r>0?1:(e instanceof jr?e.text.length:e.children.length)<<1]}nextInner(e,r){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],o=this.offsets[n],s=o>>1,a=i instanceof jr?i.text.length:i.children.length;if(s==(r>0?a:0)){if(n==0)return this.done=!0,this.value="",this;r>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(r>0?0:1)){if(this.offsets[n]+=r,e==0)return this.lineBreak=!0,this.value=`
|
package/dist/index.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"
|
|
21
21
|
rel="stylesheet"
|
|
22
22
|
/>
|
|
23
|
-
<script type="module" crossorigin src="/assets/index-
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-CU0jqXHm.js"></script>
|
|
24
24
|
<link rel="stylesheet" crossorigin href="/assets/index-BKRpkJER.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
package/package.json
CHANGED