notebook 7.0.0b4__py3-none-any.whl → 7.0.0rc0__py3-none-any.whl
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.
Potentially problematic release.
This version of notebook might be problematic. Click here for more details.
- notebook/_version.py +1 -1
- notebook/app.py +17 -13
- notebook/static/1018.bundle.js +1 -1
- notebook/static/1198.bundle.js +1 -1
- notebook/static/1337.bundle.js +1 -1
- notebook/static/134.bundle.js +1 -0
- notebook/static/1408.bundle.js +1 -1
- notebook/static/1584.bundle.js +1 -1
- notebook/static/162.bundle.js +1 -1
- notebook/static/1647.bundle.js +1 -1
- notebook/static/1650.bundle.js +1 -1
- notebook/static/1682.bundle.js +1 -1
- notebook/static/1684.bundle.js +1 -1
- notebook/static/1809.bundle.js +1 -1
- notebook/static/1827.bundle.js +1 -1
- notebook/static/1833.bundle.js +1 -1
- notebook/static/1835.bundle.js +1 -1
- notebook/static/1950.bundle.js +1 -1
- notebook/static/1958.bundle.js +1 -1
- notebook/static/2007.bundle.js +1 -1
- notebook/static/2067.bundle.js +1 -1
- notebook/static/2088.bundle.js +1 -1
- notebook/static/2089.bundle.js +1 -1
- notebook/static/2122.bundle.js +1 -1
- notebook/static/2167.bundle.js +1 -1
- notebook/static/2184.bundle.js +1 -1
- notebook/static/2251.bundle.js +1 -1
- notebook/static/2311.bundle.js +1 -1
- notebook/static/2323.bundle.js +1 -1
- notebook/static/2330.bundle.js +1 -1
- notebook/static/2401.bundle.js +1 -1
- notebook/static/2479.bundle.js +1 -0
- notebook/static/2512.bundle.js +1 -1
- notebook/static/2607.bundle.js +1 -1
- notebook/static/2913.bundle.js +1 -1
- notebook/static/2924.bundle.js +1 -1
- notebook/static/2955.bundle.js +1 -0
- notebook/static/2979.bundle.js +1 -1
- notebook/static/3146.bundle.js +1 -1
- notebook/static/3213.bundle.js +1 -1
- notebook/static/3340.bundle.js +1 -1
- notebook/static/3360.bundle.js +1 -1
- notebook/static/3466.bundle.js +1 -1
- notebook/static/35.bundle.js +1 -1
- notebook/static/3676.bundle.js +1 -1
- notebook/static/3680.bundle.js +1 -1
- notebook/static/3768.bundle.js +1 -1
- notebook/static/377.bundle.js +1 -1
- notebook/static/3797.bundle.js +1 -1
- notebook/static/3863.bundle.js +1 -1
- notebook/static/3881.bundle.js +1 -1
- notebook/static/4042.bundle.js +1 -0
- notebook/static/4131.bundle.js +1 -1
- notebook/static/4205.bundle.js +1 -1
- notebook/static/4212.bundle.js +1 -1
- notebook/static/4234.bundle.js +1 -1
- notebook/static/4382.bundle.js +1 -1
- notebook/static/4558.bundle.js +1 -1
- notebook/static/4645.bundle.js +1 -1
- notebook/static/4746.bundle.js +1 -0
- notebook/static/4785.bundle.js +1 -1
- notebook/static/4810.bundle.js +1 -1
- notebook/static/4811.bundle.js +1 -1
- notebook/static/4837.bundle.js +1 -0
- notebook/static/5016.bundle.js +1 -1
- notebook/static/5088.bundle.js +1 -1
- notebook/static/5099.bundle.js +1 -1
- notebook/static/5125.bundle.js +2 -0
- notebook/static/5135.bundle.js +1 -1
- notebook/static/5261.bundle.js +1 -0
- notebook/static/5313.bundle.js +1 -1
- notebook/static/5325.bundle.js +1 -1
- notebook/static/5346.bundle.js +1 -1
- notebook/static/5426.bundle.js +1 -1
- notebook/static/5573.bundle.js +1 -1
- notebook/static/5601.bundle.js +1 -1
- notebook/static/5678.bundle.js +1 -1
- notebook/static/5733.bundle.js +1 -1
- notebook/static/5765.bundle.js +1 -1
- notebook/static/5777.bundle.js +1 -1
- notebook/static/5828.bundle.js +1 -1
- notebook/static/5912.bundle.js +1 -1
- notebook/static/5921.bundle.js +1 -1
- notebook/static/6017.bundle.js +1 -1
- notebook/static/6027.bundle.js +1 -1
- notebook/static/6139.bundle.js +1 -1
- notebook/static/62.bundle.js +1 -1
- notebook/static/6256.bundle.js +1 -1
- notebook/static/6271.bundle.js +1 -1
- notebook/static/6345.bundle.js +1 -1
- notebook/static/6604.bundle.js +1 -1
- notebook/static/6621.bundle.js +1 -1
- notebook/static/6627.bundle.js +1 -1
- notebook/static/6774.bundle.js +1 -0
- notebook/static/6815.bundle.js +1 -1
- notebook/static/6853.bundle.js +1 -1
- notebook/static/6893.bundle.js +1 -1
- notebook/static/690.bundle.js +1 -0
- notebook/static/6919.bundle.js +3 -3
- notebook/static/6962.bundle.js +1 -1
- notebook/static/6999.bundle.js +1 -1
- notebook/static/7226.bundle.js +1 -1
- notebook/static/7252.bundle.js +1 -0
- notebook/static/7302.bundle.js +1 -1
- notebook/static/7369.bundle.js +1 -1
- notebook/static/7386.bundle.js +1 -1
- notebook/static/7391.bundle.js +1 -1
- notebook/static/7394.bundle.js +1 -1
- notebook/static/7427.bundle.js +1 -0
- notebook/static/7439.bundle.js +1 -1
- notebook/static/7450.bundle.js +1 -1
- notebook/static/7603.bundle.js +1 -1
- notebook/static/7639.bundle.js +1 -1
- notebook/static/7679.bundle.js +1 -0
- notebook/static/7684.bundle.js +1 -1
- notebook/static/7819.bundle.js +1 -1
- notebook/static/7900.bundle.js +1 -0
- notebook/static/7906.bundle.js +1 -1
- notebook/static/7957.bundle.js +1 -1
- notebook/static/7997.bundle.js +1 -1
- notebook/static/8010.bundle.js +1 -1
- notebook/static/8136.bundle.js +1 -1
- notebook/static/8578.bundle.js +1 -1
- notebook/static/8579.bundle.js +1 -1
- notebook/static/8633.bundle.js +1 -1
- notebook/static/8771.bundle.js +1 -1
- notebook/static/880.bundle.js +1 -1
- notebook/static/8845.bundle.js +1 -1
- notebook/static/8845.bundle.js.LICENSE.txt +2 -2
- notebook/static/8875.bundle.js +1 -1
- notebook/static/8907.bundle.js +1 -1
- notebook/static/8914.bundle.js +1 -1
- notebook/static/8928.bundle.js +1 -0
- notebook/static/893.bundle.js +1 -1
- notebook/static/901.bundle.js +1 -1
- notebook/static/9068.bundle.js +1 -1
- notebook/static/9086.bundle.js +1 -1
- notebook/static/9151.bundle.js +1 -1
- notebook/static/9268.bundle.js +1 -1
- notebook/static/9335.bundle.js +1 -1
- notebook/static/9341.bundle.js +1 -1
- notebook/static/9380.bundle.js +1 -1
- notebook/static/9605.bundle.js +1 -1
- notebook/static/9609.bundle.js +1 -1
- notebook/static/9638.bundle.js +1 -1
- notebook/static/9680.bundle.js +1 -0
- notebook/static/9685.bundle.js +1 -0
- notebook/static/9752.bundle.js +1 -1
- notebook/static/9799.bundle.js +1 -1
- notebook/static/9852.bundle.js +1 -1
- notebook/static/9854.bundle.js +2 -0
- notebook/static/bundle.js +1 -1
- notebook/static/third-party-licenses.json +151 -127
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
- notebook-7.0.0rc0.data/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +34 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
- notebook-7.0.0b4.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.a7e9e50b675118021681.js → notebook-7.0.0rc0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.1b31bd587bea2c1816b1.js +1 -1
- notebook-7.0.0rc0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/7.d4d2f899a93808dccf3d.js +1 -0
- notebook-7.0.0b4.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.2aa8888b3e6b5670842f.js → notebook-7.0.0rc0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.a832439d17633285a072.js +1 -1
- notebook-7.0.0rc0.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.b00379f3c5b2b5eb657f.js +1 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
- {notebook-7.0.0b4.dist-info → notebook-7.0.0rc0.dist-info}/METADATA +2 -2
- notebook-7.0.0rc0.dist-info/RECORD +389 -0
- {notebook-7.0.0b4.dist-info → notebook-7.0.0rc0.dist-info}/WHEEL +1 -1
- notebook/static/2274.bundle.js +0 -1
- notebook/static/3063.bundle.js +0 -2
- notebook/static/3344.bundle.js +0 -1
- notebook/static/4190.bundle.js +0 -1
- notebook/static/435.bundle.js +0 -1
- notebook/static/4964.bundle.js +0 -1
- notebook/static/5282.bundle.js +0 -1
- notebook/static/5975.bundle.js +0 -1
- notebook/static/6695.bundle.js +0 -1
- notebook/static/771.bundle.js +0 -1
- notebook/static/7827.bundle.js +0 -2
- notebook-7.0.0b4.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/7.9bd87123f72aaa959984.js +0 -1
- notebook-7.0.0b4.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.ed19884b54327368a389.js +0 -1
- notebook-7.0.0b4.dist-info/RECORD +0 -381
- /notebook/static/{3063.bundle.js.LICENSE.txt → 5125.bundle.js.LICENSE.txt} +0 -0
- /notebook/static/{7827.bundle.js.LICENSE.txt → 9854.bundle.js.LICENSE.txt} +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/applications/jupyter-notebook.desktop +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/776.c7baadfaddfd4518c935.js +0 -0
- {notebook-7.0.0b4.data → notebook-7.0.0rc0.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
- {notebook-7.0.0b4.dist-info → notebook-7.0.0rc0.dist-info}/entry_points.txt +0 -0
- {notebook-7.0.0b4.dist-info → notebook-7.0.0rc0.dist-info}/licenses/LICENSE +0 -0
notebook/static/2323.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2323],{92323:(t,e,n)=>{n.r(e),n.d(e,{Annotation:()=>ot,AnnotationType:()=>lt,ChangeDesc:()=>E,ChangeSet:()=>A,CharCategory:()=>xt,Compartment:()=>H,EditorSelection:()=>J,EditorState:()=>St,Facet:()=>D,Line:()=>f,MapMode:()=>P,Prec:()=>G,Range:()=>bt,RangeSet:()=>At,RangeSetBuilder:()=>Rt,RangeValue:()=>It,SelectionRange:()=>B,StateEffect:()=>ct,StateEffectType:()=>at,StateField:()=>U,Text:()=>i,Transaction:()=>ft,codePointAt:()=>S,codePointSize:()=>I,combineConfig:()=>yt,countColumn:()=>jt,findClusterBreak:()=>m,findColumn:()=>qt,fromCodePoint:()=>y});class i{constructor(){}lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,n){let i=[];return this.decompose(0,t,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(e,this.length,i,1),r.from(i,this.length-(e-t)+n.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){let n=[];return this.decompose(t,e,n,0),r.from(n,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),n=this.length-this.scanIdentical(t,-1),i=new l(this),s=new l(t);for(let t=e,r=e;;){if(i.next(t),s.next(t),t=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(r+=i.value.length,i.done||r>=n)return!0}}iter(t=1){return new l(this,t)}iterRange(t,e=this.length){return new a(this,t,e)}iterLines(t,e){let n;if(null==t)n=this.iter();else{null==e&&(e=this.lines+1);let i=this.line(t).from;n=this.iterRange(i,Math.max(i,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new c(n)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new s(t):r.from(s.split(t,[])):i.empty}}class s extends i{constructor(t,e=function(t){let e=-1;for(let n of t)e+=n.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,n,i){for(let s=0;;s++){let r=this.text[s],h=i+r.length;if((e?n:h)>=t)return new f(i,h,n,r);i=h+1,n++}}decompose(t,e,n,i){let r=t<=0&&e>=this.length?this:new s(o(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){let t=n.pop(),e=h(r.text,t.text.slice(),0,r.length);if(e.length<=32)n.push(new s(e,t.length+r.length));else{let t=e.length>>1;n.push(new s(e.slice(0,t)),new s(e.slice(t)))}}else n.push(r)}replace(t,e,n){if(!(n instanceof s))return super.replace(t,e,n);let i=h(this.text,h(n.text,o(this.text,0,t)),e),l=this.length+n.length-(e-t);return i.length<=32?new s(i,l):r.from(s.split(i,[]),l)}sliceString(t,e=this.length,n="\n"){let i="";for(let s=0,r=0;s<=e&&r<this.text.length;r++){let h=this.text[r],o=s+h.length;s>t&&r&&(i+=n),t<o&&e>s&&(i+=h.slice(Math.max(0,t-s),e-s)),s=o+1}return i}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let n=[],i=-1;for(let r of t)n.push(r),i+=r.length+1,32==n.length&&(e.push(new s(n,i)),n=[],i=-1);return i>-1&&e.push(new s(n,i)),e}}class r extends i{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,n,i){for(let s=0;;s++){let r=this.children[s],h=i+r.length,o=n+r.lines-1;if((e?o:h)>=t)return r.lineInner(t,e,n,i);i=h+1,n=o+1}}decompose(t,e,n,i){for(let s=0,r=0;r<=e&&s<this.children.length;s++){let h=this.children[s],o=r+h.length;if(t<=o&&e>=r){let s=i&((r<=t?1:0)|(o>=e?2:0));r>=t&&o<=e&&!s?n.push(h):h.decompose(t-r,e-r,n,s)}r=o+1}}replace(t,e,n){if(n.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let h=this.children[i],o=s+h.length;if(t>=s&&e<=o){let l=h.replace(t-s,e-s,n),a=this.lines-h.lines+l.lines;if(l.lines<a>>4&&l.lines>a>>6){let s=this.children.slice();return s[i]=l,new r(s,this.length-(e-t)+n.length)}return super.replace(s,o,l)}s=o+1}return super.replace(t,e,n)}sliceString(t,e=this.length,n="\n"){let i="";for(let s=0,r=0;s<this.children.length&&r<=e;s++){let h=this.children[s],o=r+h.length;r>t&&s&&(i+=n),t<o&&e>r&&(i+=h.sliceString(t-r,e-r,n)),r=o+1}return i}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof r))return 0;let n=0,[i,s,h,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=e,s+=e){if(i==h||s==o)return n;let r=this.children[i],l=t.children[s];if(r!=l)return n+r.scanIdentical(l,e);n+=r.length+1}}static from(t,e=t.reduce(((t,e)=>t+e.length+1),-1)){let n=0;for(let e of t)n+=e.lines;if(n<32){let n=[];for(let e of t)e.flatten(n);return new s(n,e)}let i=Math.max(32,n>>5),h=i<<1,o=i>>1,l=[],a=0,c=-1,f=[];function u(t){let e;if(t.lines>h&&t instanceof r)for(let e of t.children)u(e);else t.lines>o&&(a>o||!a)?(g(),l.push(t)):t instanceof s&&a&&(e=f[f.length-1])instanceof s&&t.lines+e.lines<=32?(a+=t.lines,c+=t.length+1,f[f.length-1]=new s(e.text.concat(t.text),e.length+1+t.length)):(a+t.lines>i&&g(),a+=t.lines,c+=t.length+1,f.push(t))}function g(){0!=a&&(l.push(1==f.length?f[0]:r.from(f,c)),c=-1,a=f.length=0)}for(let e of t)u(e);return g(),1==l.length?l[0]:new r(l,e)}}function h(t,e,n=0,i=1e9){for(let s=0,r=0,h=!0;r<t.length&&s<=i;r++){let o=t[r],l=s+o.length;l>=n&&(l>i&&(o=o.slice(0,i-s)),s<n&&(o=o.slice(n-s)),h?(e[e.length-1]+=o,h=!1):e.push(o)),s=l+1}return e}function o(t,e,n){return h(t,[""],e,n)}i.empty=new s([""],0);class l{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof s?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],h=r>>1,o=i instanceof s?i.text.length:i.children.length;if(h==(e>0?o:0)){if(0==n)return this.done=!0,this.value="",this;e>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(e>0?0:1)){if(this.offsets[n]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(i instanceof s){let s=i.text[h+(e<0?-1:0)];if(this.offsets[n]+=e,s.length>Math.max(0,t))return this.value=0==t?s:e>0?s.slice(t):s.slice(0,s.length-t),this;t-=s.length}else{let r=i.children[h+(e<0?-1:0)];t>r.length?(t-=r.length,this.offsets[n]+=e):(e<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(e>0?1:(r instanceof s?r.text.length:r.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class a{constructor(t,e,n){this.value="",this.done=!1,this.cursor=new l(t,e>n?-1:1),this.pos=e>n?t.length:0,this.from=Math.min(e,n),this.to=Math.max(e,n)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let n=e<0?this.pos-this.from:this.to-this.pos;t>n&&(t=n),n-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*e,this.value=i.length<=n?i:e<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class c{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:n,value:i}=this.inner.next(t);return e?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(i.prototype[Symbol.iterator]=function(){return this.iter()},l.prototype[Symbol.iterator]=a.prototype[Symbol.iterator]=c.prototype[Symbol.iterator]=function(){return this});class f{constructor(t,e,n,i){this.from=t,this.to=e,this.number=n,this.text=i}get length(){return this.to-this.from}}let u="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((t=>t?parseInt(t,36):1));for(let t=1;t<u.length;t++)u[t]+=u[t-1];function g(t){for(let e=1;e<u.length;e+=2)if(u[e]>t)return u[e-1]<=t;return!1}function d(t){return t>=127462&&t<=127487}const p=8205;function m(t,e,n=!0,i=!0){return(n?v:x)(t,e,i)}function v(t,e,n){if(e==t.length)return e;e&&w(t.charCodeAt(e))&&k(t.charCodeAt(e-1))&&e--;let i=S(t,e);for(e+=I(i);e<t.length;){let s=S(t,e);if(i==p||s==p||n&&g(s))e+=I(s),i=s;else{if(!d(s))break;{let n=0,i=e-2;for(;i>=0&&d(S(t,i));)n++,i-=2;if(n%2==0)break;e+=2}}}return e}function x(t,e,n){for(;e>0;){let i=v(t,e-2,n);if(i<e)return i;e--}return 0}function w(t){return t>=56320&&t<57344}function k(t){return t>=55296&&t<56320}function S(t,e){let n=t.charCodeAt(e);if(!k(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return w(i)?i-56320+(n-55296<<10)+65536:n}function y(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function I(t){return t<65536?1:2}const b=/\r\n?|\n/;var P=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(P||(P={}));class E{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e+1];t+=n<0?this.sections[e]:n}return t}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(t){for(let e=0,n=0,i=0;e<this.sections.length;){let s=this.sections[e++],r=this.sections[e++];r<0?(t(n,i,s),i+=s):i+=r,n+=s}}iterChangedRanges(t,e=!1){M(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];i<0?t.push(n,i):t.push(i,n)}return new E(t)}composeDesc(t){return this.empty?t:t.empty?this:T(this,t)}mapDesc(t,e=!1){return t.empty?this:O(this,t,e)}mapPos(t,e=-1,n=P.Simple){let i=0,s=0;for(let r=0;r<this.sections.length;){let h=this.sections[r++],o=this.sections[r++],l=i+h;if(o<0){if(l>t)return s+(t-i);s+=h}else{if(n!=P.Simple&&l>=t&&(n==P.TrackDel&&i<t&&l>t||n==P.TrackBefore&&i<t||n==P.TrackAfter&&l>t))return null;if(l>t||l==t&&e<0&&!h)return t==i||e<0?s:s+o;s+=o}i=l}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return s}touchesRange(t,e=t){for(let n=0,i=0;n<this.sections.length&&i<=e;){let s=i+this.sections[n++];if(this.sections[n++]>=0&&i<=e&&s>=t)return!(i<t&&s>e)||"cover";i=s}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];t+=(t?" ":"")+n+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some((t=>"number"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new E(t)}static create(t){return new E(t)}}class A extends E{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return M(this,((e,n,i,s,r)=>t=t.replace(i,i+(n-e),r)),!1),t}mapDesc(t,e=!1){return O(this,t,e,!0)}invert(t){let e=this.sections.slice(),n=[];for(let s=0,r=0;s<e.length;s+=2){let h=e[s],o=e[s+1];if(o>=0){e[s]=o,e[s+1]=h;let l=s>>1;for(;n.length<l;)n.push(i.empty);n.push(h?t.slice(r,r+h):i.empty)}r+=h}return new A(e,n)}compose(t){return this.empty?t:t.empty?this:T(this,t,!0)}map(t,e=!1){return t.empty?this:O(this,t,e,!0)}iterChanges(t,e=!1){M(this,t,e)}get desc(){return E.create(this.sections)}filter(t){let e=[],n=[],i=[],s=new F(this);t:for(let r=0,h=0;;){let o=r==t.length?1e9:t[r++];for(;h<o||h==o&&0==s.len;){if(s.done)break t;let t=Math.min(s.len,o-h);R(i,t,-1);let r=-1==s.ins?-1:0==s.off?s.ins:0;R(e,t,r),r>0&&C(n,e,s.text),s.forward(t),h+=t}let l=t[r++];for(;h<l;){if(s.done)break t;let t=Math.min(s.len,l-h);R(e,t,-1),R(i,t,-1==s.ins?-1:0==s.off?s.ins:0),s.forward(t),h+=t}}return{changes:new A(e,n),filtered:E.create(i)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e],i=this.sections[e+1];i<0?t.push(n):0==i?t.push([n]):t.push([n].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,n){let s=[],r=[],h=0,o=null;function l(t=!1){if(!t&&!s.length)return;h<e&&R(s,e-h,-1);let n=new A(s,r);o=o?o.compose(n.map(o)):n,s=[],r=[],h=0}return function t(a){if(Array.isArray(a))for(let e of a)t(e);else if(a instanceof A){if(a.length!=e)throw new RangeError(`Mismatched change set length (got ${a.length}, expected ${e})`);l(),o=o?o.compose(a.map(o)):a}else{let{from:t,to:o=t,insert:c}=a;if(t>o||t<0||o>e)throw new RangeError(`Invalid change range ${t} to ${o} (in doc of length ${e})`);let f=c?"string"==typeof c?i.of(c.split(n||b)):c:i.empty,u=f.length;if(t==o&&0==u)return;t<h&&l(),t>h&&R(s,t-h,-1),R(s,o-t,u),C(r,s,f),h=o}}(t),l(!o),o}static empty(t){return new A(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],n=[];for(let s=0;s<t.length;s++){let r=t[s];if("number"==typeof r)e.push(r,-1);else{if(!Array.isArray(r)||"number"!=typeof r[0]||r.some(((t,e)=>e&&"string"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)e.push(r[0],0);else{for(;n.length<s;)n.push(i.empty);n[s]=i.of(r.slice(1)),e.push(r[0],n[s].length)}}}return new A(e,n)}static createSet(t,e){return new A(t,e)}}function R(t,e,n,i=!1){if(0==e&&n<=0)return;let s=t.length-2;s>=0&&n<=0&&n==t[s+1]?t[s]+=e:0==e&&0==t[s]?t[s+1]+=n:i?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function C(t,e,n){if(0==n.length)return;let s=e.length-2>>1;if(s<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<s;)t.push(i.empty);t.push(n)}}function M(t,e,n){let s=t.inserted;for(let r=0,h=0,o=0;o<t.sections.length;){let l=t.sections[o++],a=t.sections[o++];if(a<0)r+=l,h+=l;else{let c=r,f=h,u=i.empty;for(;c+=l,f+=a,a&&s&&(u=u.append(s[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(r,c,h,f,u),r=c,h=f}}}function O(t,e,n,i=!1){let s=[],r=i?[]:null,h=new F(t),o=new F(e);for(let t=-1;;)if(-1==h.ins&&-1==o.ins){let t=Math.min(h.len,o.len);R(s,t,-1),h.forward(t),o.forward(t)}else if(o.ins>=0&&(h.ins<0||t==h.i||0==h.off&&(o.len<h.len||o.len==h.len&&!n))){let e=o.len;for(R(s,o.ins,-1);e;){let n=Math.min(h.len,e);h.ins>=0&&t<h.i&&h.len<=n&&(R(s,0,h.ins),r&&C(r,s,h.text),t=h.i),h.forward(n),e-=n}o.next()}else{if(!(h.ins>=0)){if(h.done&&o.done)return r?A.createSet(s,r):E.create(s);throw new Error("Mismatched change set lengths")}{let e=0,n=h.len;for(;n;)if(-1==o.ins){let t=Math.min(n,o.len);e+=t,n-=t,o.forward(t)}else{if(!(0==o.ins&&o.len<n))break;n-=o.len,o.next()}R(s,e,t<h.i?h.ins:0),r&&t<h.i&&C(r,s,h.text),t=h.i,h.forward(h.len-n)}}}function T(t,e,n=!1){let i=[],s=n?[]:null,r=new F(t),h=new F(e);for(let t=!1;;){if(r.done&&h.done)return s?A.createSet(i,s):E.create(i);if(0==r.ins)R(i,r.len,0,t),r.next();else if(0!=h.len||h.done){if(r.done||h.done)throw new Error("Mismatched change set lengths");{let e=Math.min(r.len2,h.len),n=i.length;if(-1==r.ins){let n=-1==h.ins?-1:h.off?0:h.ins;R(i,e,n,t),s&&n&&C(s,i,h.text)}else-1==h.ins?(R(i,r.off?0:r.len,e,t),s&&C(s,i,r.textBit(e))):(R(i,r.off?0:r.len,h.off?0:h.ins,t),s&&!h.off&&C(s,i,h.text));t=(r.ins>e||h.ins>=0&&h.len>e)&&(t||i.length>n),r.forward2(e),h.forward(e)}}else R(i,0,h.ins,t),s&&C(s,i,h.text),h.next()}}class F{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?i.empty:t[e]}textBit(t){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length&&!t?i.empty:e[n].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class B{constructor(t,e,n){this.from=t,this.to=e,this.flags=n}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){let t=3&this.flags;return 3==t?null:t}get goalColumn(){let t=this.flags>>5;return 33554431==t?void 0:t}map(t,e=-1){let n,i;return this.empty?n=i=t.mapPos(this.from,e):(n=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new B(n,i,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return J.range(t,e);let n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return J.range(this.anchor,n)}eq(t){return this.anchor==t.anchor&&this.head==t.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return J.range(t.anchor,t.head)}static create(t,e,n){return new B(t,e,n)}}class J{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:J.create(this.ranges.map((n=>n.map(t,e))),this.mainIndex)}eq(t){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let e=0;e<this.ranges.length;e++)if(!this.ranges[e].eq(t.ranges[e]))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new J([this.main],0)}addRange(t,e=!0){return J.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let n=this.ranges.slice();return n[e]=t,J.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map((t=>t.toJSON())),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new J(t.ranges.map((t=>B.fromJSON(t))),t.main)}static single(t,e=t){return new J([J.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<t.length;i++){let s=t[i];if(s.empty?s.from<=n:s.from<n)return J.normalized(t.slice(),e);n=s.to}return new J(t,e)}static cursor(t,e=0,n,i){return B.create(t,t,(0==e?0:e<0?4:8)|(null==n?3:Math.min(2,n))|(null!=i?i:33554431)<<5)}static range(t,e,n,i){let s=(null!=n?n:33554431)<<5|(null==i?3:Math.min(2,i));return e<t?B.create(e,t,24|s):B.create(t,e,(e>t?4:0)|s)}static normalized(t,e=0){let n=t[e];t.sort(((t,e)=>t.from-e.from)),e=t.indexOf(n);for(let n=1;n<t.length;n++){let i=t[n],s=t[n-1];if(i.empty?i.from<=s.to:i.from<s.to){let r=s.from,h=Math.max(i.to,s.to);n<=e&&e--,t.splice(--n,2,i.anchor>i.head?J.range(h,r):J.range(r,h))}}return new J(t,e)}}function N(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let L=0;class D{constructor(t,e,n,i,s){this.combine=t,this.compareInput=e,this.compare=n,this.isStatic=i,this.id=L++,this.default=t([]),this.extensions="function"==typeof s?s(this):s}static define(t={}){return new D(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:j),!!t.static,t.enables)}of(t){return new q([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],(n=>e(n.field(t))))}}function j(t,e){return t==e||t.length==e.length&&t.every(((t,n)=>t===e[n]))}class q{constructor(t,e,n,i){this.dependencies=t,this.facet=e,this.type=n,this.value=i,this.id=L++}dynamicSlot(t){var e;let n=this.value,i=this.facet.compareInput,s=this.id,r=t[s]>>1,h=2==this.type,o=!1,l=!1,a=[];for(let n of this.dependencies)"doc"==n?o=!0:"selection"==n?l=!0:0==(1&(null!==(e=t[n.id])&&void 0!==e?e:1))&&a.push(t[n.id]);return{create:t=>(t.values[r]=n(t),1),update(t,e){if(o&&e.docChanged||l&&(e.docChanged||e.selection)||_(t,a)){let e=n(t);if(h?!$(e,t.values[r],i):!i(e,t.values[r]))return t.values[r]=e,1}return 0},reconfigure:(t,e)=>{let o,l=e.config.address[s];if(null!=l){let s=Z(e,l);if(this.dependencies.every((n=>n instanceof D?e.facet(n)===t.facet(n):!(n instanceof U)||e.field(n,!1)==t.field(n,!1)))||(h?$(o=n(t),s,i):i(o=n(t),s)))return t.values[r]=s,0}else o=n(t);return t.values[r]=o,1}}}}function $(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function _(t,e){let n=!1;for(let i of e)1&X(t,i)&&(n=!0);return n}function z(t,e,n){let i=n.map((e=>t[e.id])),s=n.map((t=>t.type)),r=i.filter((t=>!(1&t))),h=t[e.id]>>1;function o(t){let n=[];for(let e=0;e<i.length;e++){let r=Z(t,i[e]);if(2==s[e])for(let t of r)n.push(t);else n.push(r)}return e.combine(n)}return{create(t){for(let e of i)X(t,e);return t.values[h]=o(t),1},update(t,n){if(!_(t,r))return 0;let i=o(t);return e.compare(i,t.values[h])?0:(t.values[h]=i,1)},reconfigure(t,s){let r=_(t,i),l=s.config.facets[e.id],a=s.facet(e);if(l&&!r&&j(n,l))return t.values[h]=a,0;let c=o(t);return e.compare(c,a)?(t.values[h]=a,0):(t.values[h]=c,1)}}}const V=D.define({static:!0});class U{constructor(t,e,n,i,s){this.id=t,this.createF=e,this.updateF=n,this.compareF=i,this.spec=s,this.provides=void 0}static define(t){let e=new U(L++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(V).find((t=>t.field==this));return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,n)=>{let i=t.values[e],s=this.updateF(i,n);return this.compareF(i,s)?0:(t.values[e]=s,1)},reconfigure:(t,n)=>null!=n.config.address[this.id]?(t.values[e]=n.field(this),0):(t.values[e]=this.create(t),1)}}init(t){return[this,V.of({field:this,create:t})]}get extension(){return this}}function W(t){return e=>new Y(e,t)}const G={highest:W(0),high:W(1),default:W(2),low:W(3),lowest:W(4)};class Y{constructor(t,e){this.inner=t,this.prec=e}}class H{of(t){return new K(this,t)}reconfigure(t){return H.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class K{constructor(t,e){this.compartment=t,this.inner=e}}class Q{constructor(t,e,n,i,s,r){for(this.base=t,this.compartments=e,this.dynamicSlots=n,this.address=i,this.staticValues=s,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return null==e?t.default:this.staticValues[e>>1]}static resolve(t,e,n){let i=[],s=Object.create(null),r=new Map;for(let n of function(t,e,n){let i=[[],[],[],[],[]],s=new Map;return function t(r,h){let o=s.get(r);if(null!=o){if(o<=h)return;let t=i[o].indexOf(r);t>-1&&i[o].splice(t,1),r instanceof K&&n.delete(r.compartment)}if(s.set(r,h),Array.isArray(r))for(let e of r)t(e,h);else if(r instanceof K){if(n.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let i=e.get(r.compartment)||r.inner;n.set(r.compartment,i),t(i,h)}else if(r instanceof Y)t(r.inner,r.prec);else if(r instanceof U)i[h].push(r),r.provides&&t(r.provides,h);else if(r instanceof q)i[h].push(r),r.facet.extensions&&t(r.facet.extensions,2);else{let e=r.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);t(e,h)}}(t,2),i.reduce(((t,e)=>t.concat(e)))}(t,e,r))n instanceof U?i.push(n):(s[n.facet.id]||(s[n.facet.id]=[])).push(n);let h=Object.create(null),o=[],l=[];for(let t of i)h[t.id]=l.length<<1,l.push((e=>t.slot(e)));let a=null==n?void 0:n.config.facets;for(let t in s){let e=s[t],i=e[0].facet,r=a&&a[t]||[];if(e.every((t=>0==t.type)))if(h[i.id]=o.length<<1|1,j(r,e))o.push(n.facet(i));else{let t=i.combine(e.map((t=>t.value)));o.push(n&&i.compare(t,n.facet(i))?n.facet(i):t)}else{for(let t of e)0==t.type?(h[t.id]=o.length<<1|1,o.push(t.value)):(h[t.id]=l.length<<1,l.push((e=>t.dynamicSlot(e))));h[i.id]=l.length<<1,l.push((t=>z(t,i,e)))}}let c=l.map((t=>t(h)));return new Q(t,r,c,h,o,s)}}function X(t,e){if(1&e)return 2;let n=e>>1,i=t.status[n];if(4==i)throw new Error("Cyclic dependency between fields and/or facets");if(2&i)return i;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function Z(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const tt=D.define(),et=D.define({combine:t=>t.some((t=>t)),static:!0}),nt=D.define({combine:t=>t.length?t[0]:void 0,static:!0}),it=D.define(),st=D.define(),rt=D.define(),ht=D.define({combine:t=>!!t.length&&t[0]});class ot{constructor(t,e){this.type=t,this.value=e}static define(){return new lt}}class lt{of(t){return new ot(this,t)}}class at{constructor(t){this.map=t}of(t){return new ct(this,t)}}class ct{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new ct(this.type,e)}is(t){return this.type==t}static define(t={}){return new at(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let n=[];for(let i of t){let t=i.map(e);t&&n.push(t)}return n}}ct.reconfigure=ct.define(),ct.appendConfig=ct.define();class ft{constructor(t,e,n,i,s,r){this.startState=t,this.changes=e,this.selection=n,this.effects=i,this.annotations=s,this.scrollIntoView=r,this._doc=null,this._state=null,n&&N(n,e.newLength),s.some((t=>t.type==ft.time))||(this.annotations=s.concat(ft.time.of(Date.now())))}static create(t,e,n,i,s,r){return new ft(t,e,n,i,s,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(ft.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function ut(t,e){let n=[];for(let i=0,s=0;;){let r,h;if(i<t.length&&(s==e.length||e[s]>=t[i]))r=t[i++],h=t[i++];else{if(!(s<e.length))return n;r=e[s++],h=e[s++]}!n.length||n[n.length-1]<r?n.push(r,h):n[n.length-1]<h&&(n[n.length-1]=h)}}function gt(t,e,n){var i;let s,r,h;return n?(s=e.changes,r=A.empty(e.changes.length),h=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),r=t.changes.mapDesc(e.changes,!0),h=t.changes.compose(s)),{changes:h,selection:e.selection?e.selection.map(r):null===(i=t.selection)||void 0===i?void 0:i.map(s),effects:ct.mapEffects(t.effects,s).concat(ct.mapEffects(e.effects,r)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function dt(t,e,n){let i=e.selection,s=vt(e.annotations);return e.userEvent&&(s=s.concat(ft.userEvent.of(e.userEvent))),{changes:e.changes instanceof A?e.changes:A.of(e.changes||[],n,t.facet(nt)),selection:i&&(i instanceof J?i:J.single(i.anchor,i.head)),effects:vt(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function pt(t,e,n){let i=dt(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(n=!1);for(let s=1;s<e.length;s++){!1===e[s].filter&&(n=!1);let r=!!e[s].sequential;i=gt(i,dt(t,e[s],r?i.changes.newLength:t.doc.length),r)}let s=ft.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(t){let e=t.startState,n=e.facet(rt),i=t;for(let s=n.length-1;s>=0;s--){let r=n[s](t);r&&Object.keys(r).length&&(i=gt(i,dt(e,r,t.changes.newLength),!0))}return i==t?t:ft.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}(n?function(t){let e=t.startState,n=!0;for(let i of e.facet(it)){let e=i(t);if(!1===e){n=!1;break}Array.isArray(e)&&(n=!0===n?e:ut(n,e))}if(!0!==n){let i,s;if(!1===n)s=t.changes.invertedDesc,i=A.empty(e.doc.length);else{let e=t.changes.filter(n);i=e.changes,s=e.filtered.mapDesc(e.changes).invertedDesc}t=ft.create(e,i,t.selection&&t.selection.map(s),ct.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(st);for(let n=i.length-1;n>=0;n--){let s=i[n](t);t=s instanceof ft?s:Array.isArray(s)&&1==s.length&&s[0]instanceof ft?s[0]:pt(e,vt(s),!1)}return t}(s):s)}ft.time=ot.define(),ft.userEvent=ot.define(),ft.addToHistory=ot.define(),ft.remote=ot.define();const mt=[];function vt(t){return null==t?mt:Array.isArray(t)?t:[t]}var xt=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(xt||(xt={}));const wt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let kt;try{kt=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}class St{constructor(t,e,n,i,s,r){this.config=t,this.doc=e,this.selection=n,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=s,r&&(r._state=this);for(let t=0;t<this.config.dynamicSlots.length;t++)X(this,t<<1);this.computeSlot=null}field(t,e=!0){let n=this.config.address[t.id];if(null!=n)return X(this,n),Z(this,n);if(e)throw new RangeError("Field is not present in this state")}update(...t){return pt(this,t,!0)}applyTransaction(t){let e,n=this.config,{base:i,compartments:s}=n;for(let e of t.effects)e.is(H.reconfigure)?(n&&(s=new Map,n.compartments.forEach(((t,e)=>s.set(e,t))),n=null),s.set(e.value.compartment,e.value.extension)):e.is(ct.reconfigure)?(n=null,i=e.value):e.is(ct.appendConfig)&&(n=null,i=vt(i).concat(e.value));n?e=t.startState.values.slice():(n=Q.resolve(i,s,this),e=new St(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((t,e)=>e.reconfigure(t,this)),null).values),new St(n,t.newDoc,t.newSelection,e,((e,n)=>n.update(e,t)),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:t},range:J.cursor(e.from+t.length)})))}changeByRange(t){let e=this.selection,n=t(e.ranges[0]),i=this.changes(n.changes),s=[n.range],r=vt(n.effects);for(let n=1;n<e.ranges.length;n++){let h=t(e.ranges[n]),o=this.changes(h.changes),l=o.map(i);for(let t=0;t<n;t++)s[t]=s[t].map(l);let a=i.mapDesc(o,!0);s.push(h.range.map(a)),i=i.compose(l),r=ct.mapEffects(r,l).concat(ct.mapEffects(vt(h.effects),a))}return{changes:i,selection:J.create(s,e.mainIndex),effects:r}}changes(t=[]){return t instanceof A?t:A.of(t,this.doc.length,this.facet(St.lineSeparator))}toText(t){return i.of(t.split(this.facet(St.lineSeparator)||b))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return null==e?t.default:(X(this,e),Z(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let n in t){let i=t[n];i instanceof U&&null!=this.config.address[i.id]&&(e[n]=i.spec.toJSON(this.field(t[n]),this))}return e}static fromJSON(t,e={},n){if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n)for(let e in n)if(Object.prototype.hasOwnProperty.call(t,e)){let s=n[e],r=t[e];i.push(s.init((t=>s.spec.fromJSON(r,t))))}return St.create({doc:t.doc,selection:J.fromJSON(t.selection),extensions:e.extensions?i.concat([e.extensions]):i})}static create(t={}){let e=Q.resolve(t.extensions||[],new Map),n=t.doc instanceof i?t.doc:i.of((t.doc||"").split(e.staticFacet(St.lineSeparator)||b)),s=t.selection?t.selection instanceof J?t.selection:J.single(t.selection.anchor,t.selection.head):J.single(0);return N(s,n.length),e.staticFacet(et)||(s=s.asSingle()),new St(e,n,s,e.dynamicSlots.map((()=>null)),((t,e)=>e.create(t)),null)}get tabSize(){return this.facet(St.tabSize)}get lineBreak(){return this.facet(St.lineSeparator)||"\n"}get readOnly(){return this.facet(ht)}phrase(t,...e){for(let e of this.facet(St.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,((t,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>e.length?t:e[i-1]}))),t}languageDataAt(t,e,n=-1){let i=[];for(let s of this.facet(tt))for(let r of s(this,e,n))Object.prototype.hasOwnProperty.call(r,t)&&i.push(r[t]);return i}charCategorizer(t){return e=this.languageDataAt("wordChars",t).join(""),t=>{if(!/\S/.test(t))return xt.Space;if(function(t){if(kt)return kt.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||wt.test(n)))return!0}return!1}(t))return xt.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return xt.Word;return xt.Other};var e}wordAt(t){let{text:e,from:n,length:i}=this.doc.lineAt(t),s=this.charCategorizer(t),r=t-n,h=t-n;for(;r>0;){let t=m(e,r,!1);if(s(e.slice(t,r))!=xt.Word)break;r=t}for(;h<i;){let t=m(e,h);if(s(e.slice(h,t))!=xt.Word)break;h=t}return r==h?null:J.range(r+n,h+n)}}function yt(t,e,n={}){let i={};for(let e of t)for(let t of Object.keys(e)){let s=e[t],r=i[t];if(void 0===r)i[t]=s;else if(r===s||void 0===s);else{if(!Object.hasOwnProperty.call(n,t))throw new Error("Config merge conflict for field "+t);i[t]=n[t](r,s)}}for(let t in e)void 0===i[t]&&(i[t]=e[t]);return i}St.allowMultipleSelections=et,St.tabSize=D.define({combine:t=>t.length?t[0]:4}),St.lineSeparator=nt,St.readOnly=ht,St.phrases=D.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every((n=>t[n]==e[n]))}}),St.languageData=tt,St.changeFilter=it,St.transactionFilter=st,St.transactionExtender=rt,H.reconfigure=ct.define();class It{eq(t){return this==t}range(t,e=t){return bt.create(t,e,this)}}It.prototype.startSide=It.prototype.endSide=0,It.prototype.point=!1,It.prototype.mapMode=P.TrackDel;class bt{constructor(t,e,n){this.from=t,this.to=e,this.value=n}static create(t,e,n){return new bt(t,e,n)}}function Pt(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Et{constructor(t,e,n,i){this.from=t,this.to=e,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,e,n,i=0){let s=n?this.to:this.from;for(let r=i,h=s.length;;){if(r==h)return r;let i=r+h>>1,o=s[i]-t||(n?this.value[i].endSide:this.value[i].startSide)-e;if(i==r)return o>=0?r:h;o>=0?h=i:r=i+1}}between(t,e,n,i){for(let s=this.findIndex(e,-1e9,!0),r=this.findIndex(n,1e9,!1,s);s<r;s++)if(!1===i(this.from[s]+t,this.to[s]+t,this.value[s]))return!1}map(t,e){let n=[],i=[],s=[],r=-1,h=-1;for(let o=0;o<this.value.length;o++){let l,a,c=this.value[o],f=this.from[o]+t,u=this.to[o]+t;if(f==u){let t=e.mapPos(f,c.startSide,c.mapMode);if(null==t)continue;if(l=a=t,c.startSide!=c.endSide&&(a=e.mapPos(f,c.endSide),a<l))continue}else if(l=e.mapPos(f,c.startSide),a=e.mapPos(u,c.endSide),l>a||l==a&&c.startSide>0&&c.endSide<=0)continue;(a-l||c.endSide-c.startSide)<0||(r<0&&(r=l),c.point&&(h=Math.max(h,a-l)),n.push(c),i.push(l-r),s.push(a-r))}return{mapped:n.length?new Et(i,s,n,h):null,pos:r}}}class At{constructor(t,e,n,i){this.chunkPos=t,this.chunk=e,this.nextLayer=n,this.maxPoint=i}static create(t,e,n,i){return new At(t,e,n,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:n=!1,filterFrom:i=0,filterTo:s=this.length}=t,r=t.filter;if(0==e.length&&!r)return this;if(n&&(e=e.slice().sort(Pt)),this.isEmpty)return e.length?At.of(e):this;let h=new Mt(this,null,-1).goto(0),o=0,l=[],a=new Rt;for(;h.value||o<e.length;)if(o<e.length&&(h.from-e[o].from||h.startSide-e[o].value.startSide)>=0){let t=e[o++];a.addInner(t.from,t.to,t.value)||l.push(t)}else 1==h.rangeIndex&&h.chunkIndex<this.chunk.length&&(o==e.length||this.chunkEnd(h.chunkIndex)<e[o].from)&&(!r||i>this.chunkEnd(h.chunkIndex)||s<this.chunkPos[h.chunkIndex])&&a.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!r||i>h.to||s<h.from||r(h.from,h.to,h.value))&&(a.addInner(h.from,h.to,h.value)||l.push(bt.create(h.from,h.to,h.value))),h.next());return a.finishInner(this.nextLayer.isEmpty&&!l.length?At.empty:this.nextLayer.update({add:l,filter:r,filterFrom:i,filterTo:s}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],n=[],i=-1;for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],h=this.chunk[s],o=t.touchesRange(r,r+h.length);if(!1===o)i=Math.max(i,h.maxPoint),e.push(h),n.push(t.mapPos(r));else if(!0===o){let{mapped:s,pos:o}=h.map(r,t);s&&(i=Math.max(i,s.maxPoint),e.push(s),n.push(o))}}let s=this.nextLayer.map(t);return 0==e.length?s:new At(n,e,s||At.empty,i)}between(t,e,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],r=this.chunk[i];if(e>=s&&t<=s+r.length&&!1===r.between(s,t-s,e-s,n))return}this.nextLayer.between(t,e,n)}}iter(t=0){return Ot.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Ot.from(t).goto(e)}static compare(t,e,n,i,s=-1){let r=t.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),h=e.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),o=Ct(r,h,n),l=new Ft(r,o,s),a=new Ft(h,o,s);n.iterGaps(((t,e,n)=>Bt(l,t,a,e,n,i))),n.empty&&0==n.length&&Bt(l,0,a,0,0,i)}static eq(t,e,n=0,i){null==i&&(i=999999999);let s=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0)),r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0));if(s.length!=r.length)return!1;if(!s.length)return!0;let h=Ct(s,r),o=new Ft(s,h,0).goto(n),l=new Ft(r,h,0).goto(n);for(;;){if(o.to!=l.to||!Jt(o.active,l.active)||o.point&&(!l.point||!o.point.eq(l.point)))return!1;if(o.to>i)return!0;o.next(),l.next()}}static spans(t,e,n,i,s=-1){let r=new Ft(t,null,s).goto(e),h=e,o=r.openStart;for(;;){let t=Math.min(r.to,n);if(r.point){let n=r.activeForPoint(r.to),s=r.pointFrom<e?n.length+1:Math.min(n.length,o);i.point(h,t,r.point,n,s,r.pointRank),o=Math.min(r.openEnd(t),n.length)}else t>h&&(i.span(h,t,r.active,o),o=r.openEnd(t));if(r.to>n)return o+(r.point&&r.to>n?1:0);h=r.to,r.next()}}static of(t,e=!1){let n=new Rt;for(let i of t instanceof bt?[t]:e?function(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(Pt(e,i)>0)return t.slice().sort(Pt);e=i}return t}(t):t)n.add(i.from,i.to,i.value);return n.finish()}}At.empty=new At([],[],null,-1),At.empty.nextLayer=At.empty;class Rt{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(t){this.chunks.push(new Et(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}add(t,e,n){this.addInner(t,e,n)||(this.nextLayer||(this.nextLayer=new Rt)).add(t,e,n)}addInner(t,e,n){let i=t-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=n,this.lastFrom=t,this.lastTo=e,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),0))}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let n=e.value.length-1;return this.last=e.value[n],this.lastFrom=e.from[n]+t,this.lastTo=e.to[n]+t,!0}finish(){return this.finishInner(At.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=At.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Ct(t,e,n){let i=new Map;for(let e of t)for(let t=0;t<e.chunk.length;t++)e.chunk[t].maxPoint<=0&&i.set(e.chunk[t],e.chunkPos[t]);let s=new Set;for(let t of e)for(let e=0;e<t.chunk.length;e++){let r=i.get(t.chunk[e]);null==r||(n?n.mapPos(r):r)!=t.chunkPos[e]||(null==n?void 0:n.touchesRange(r,r+t.chunk[e].length))||s.add(t.chunk[e])}return s}class Mt{constructor(t,e,n,i=0){this.layer=t,this.skip=e,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,n){for(;this.chunkIndex<this.layer.chunk.length;){let e=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(e)||this.layer.chunkEnd(this.chunkIndex)<t||e.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],n=t+e.from[this.rangeIndex];if(this.from=n,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class Ot{constructor(t){this.heap=t}static from(t,e=null,n=-1){let i=[];for(let s=0;s<t.length;s++)for(let r=t[s];!r.isEmpty;r=r.nextLayer)r.maxPoint>=n&&i.push(new Mt(r,e,n,s));return 1==i.length?i[0]:new Ot(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let n of this.heap)n.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)Tt(this.heap,t);return this.next(),this}forward(t,e){for(let n of this.heap)n.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)Tt(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Tt(this.heap,0)}}}function Tt(t,e){for(let n=t[e];;){let i=1+(e<<1);if(i>=t.length)break;let s=t[i];if(i+1<t.length&&s.compare(t[i+1])>=0&&(s=t[i+1],i++),n.compare(s)<0)break;t[i]=n,t[e]=s,e=i}}class Ft{constructor(t,e,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ot.from(t,e,n)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){Nt(this.active,t),Nt(this.activeTo,t),Nt(this.activeRank,t),this.minActive=Dt(this.active,this.activeTo)}addActive(t){let e=0,{value:n,to:i,rank:s}=this.cursor;for(;e<this.activeRank.length&&this.activeRank[e]<=s;)e++;Lt(this.active,e,n),Lt(this.activeTo,e,i),Lt(this.activeRank,e,s),t&&Lt(t,e,this.cursor.from),this.minActive=Dt(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&Nt(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=t,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=t.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}}if(n){this.openStart=0;for(let e=n.length-1;e>=0&&n[e]<t;e--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>t||this.activeTo[n]==t&&this.active[n].endSide>=this.point.endSide)&&e.push(this.active[n]);return e.reverse()}openEnd(t){let e=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>t;n--)e++;return e}}function Bt(t,e,n,i,s,r){t.goto(e),n.goto(i);let h=i+s,o=i,l=i-e;for(;;){let e=t.to+l-n.to||t.endSide-n.endSide,i=e<0?t.to+l:n.to,s=Math.min(i,h);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&Jt(t.activeForPoint(t.to+l),n.activeForPoint(n.to))||r.comparePoint(o,s,t.point,n.point):s>o&&!Jt(t.active,n.active)&&r.compareRange(o,s,t.active,n.active),i>h)break;o=i,e<=0&&t.next(),e>=0&&n.next()}}function Jt(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function Nt(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function Lt(t,e,n){for(let n=t.length-1;n>=e;n--)t[n+1]=t[n];t[e]=n}function Dt(t,e){let n=-1,i=1e9;for(let s=0;s<e.length;s++)(e[s]-i||t[s].endSide-t[n].endSide)<0&&(n=s,i=e[s]);return n}function jt(t,e,n=t.length){let i=0;for(let s=0;s<n;)9==t.charCodeAt(s)?(i+=e-i%e,s++):(i++,s=m(t,s));return i}function qt(t,e,n,i){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=9==t.charCodeAt(i)?n-s%n:1,i=m(t,i)}return!0===i?-1:t.length}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2323],{92323:(t,e,n)=>{n.r(e),n.d(e,{Annotation:()=>ot,AnnotationType:()=>lt,ChangeDesc:()=>E,ChangeSet:()=>A,CharCategory:()=>xt,Compartment:()=>H,EditorSelection:()=>J,EditorState:()=>St,Facet:()=>D,Line:()=>f,MapMode:()=>P,Prec:()=>G,Range:()=>bt,RangeSet:()=>At,RangeSetBuilder:()=>Rt,RangeValue:()=>It,SelectionRange:()=>B,StateEffect:()=>ct,StateEffectType:()=>at,StateField:()=>U,Text:()=>i,Transaction:()=>ft,codePointAt:()=>S,codePointSize:()=>I,combineConfig:()=>yt,countColumn:()=>jt,findClusterBreak:()=>m,findColumn:()=>qt,fromCodePoint:()=>y});class i{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,n){let i=[];return this.decompose(0,t,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(e,this.length,i,1),r.from(i,this.length-(e-t)+n.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){let n=[];return this.decompose(t,e,n,0),r.from(n,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),n=this.length-this.scanIdentical(t,-1),i=new l(this),s=new l(t);for(let t=e,r=e;;){if(i.next(t),s.next(t),t=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(r+=i.value.length,i.done||r>=n)return!0}}iter(t=1){return new l(this,t)}iterRange(t,e=this.length){return new a(this,t,e)}iterLines(t,e){let n;if(null==t)n=this.iter();else{null==e&&(e=this.lines+1);let i=this.line(t).from;n=this.iterRange(i,Math.max(i,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new c(n)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new s(t):r.from(s.split(t,[])):i.empty}}class s extends i{constructor(t,e=function(t){let e=-1;for(let n of t)e+=n.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,n,i){for(let s=0;;s++){let r=this.text[s],h=i+r.length;if((e?n:h)>=t)return new f(i,h,n,r);i=h+1,n++}}decompose(t,e,n,i){let r=t<=0&&e>=this.length?this:new s(o(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){let t=n.pop(),e=h(r.text,t.text.slice(),0,r.length);if(e.length<=32)n.push(new s(e,t.length+r.length));else{let t=e.length>>1;n.push(new s(e.slice(0,t)),new s(e.slice(t)))}}else n.push(r)}replace(t,e,n){if(!(n instanceof s))return super.replace(t,e,n);let i=h(this.text,h(n.text,o(this.text,0,t)),e),l=this.length+n.length-(e-t);return i.length<=32?new s(i,l):r.from(s.split(i,[]),l)}sliceString(t,e=this.length,n="\n"){let i="";for(let s=0,r=0;s<=e&&r<this.text.length;r++){let h=this.text[r],o=s+h.length;s>t&&r&&(i+=n),t<o&&e>s&&(i+=h.slice(Math.max(0,t-s),e-s)),s=o+1}return i}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let n=[],i=-1;for(let r of t)n.push(r),i+=r.length+1,32==n.length&&(e.push(new s(n,i)),n=[],i=-1);return i>-1&&e.push(new s(n,i)),e}}class r extends i{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,n,i){for(let s=0;;s++){let r=this.children[s],h=i+r.length,o=n+r.lines-1;if((e?o:h)>=t)return r.lineInner(t,e,n,i);i=h+1,n=o+1}}decompose(t,e,n,i){for(let s=0,r=0;r<=e&&s<this.children.length;s++){let h=this.children[s],o=r+h.length;if(t<=o&&e>=r){let s=i&((r<=t?1:0)|(o>=e?2:0));r>=t&&o<=e&&!s?n.push(h):h.decompose(t-r,e-r,n,s)}r=o+1}}replace(t,e,n){if(n.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let h=this.children[i],o=s+h.length;if(t>=s&&e<=o){let l=h.replace(t-s,e-s,n),a=this.lines-h.lines+l.lines;if(l.lines<a>>4&&l.lines>a>>6){let s=this.children.slice();return s[i]=l,new r(s,this.length-(e-t)+n.length)}return super.replace(s,o,l)}s=o+1}return super.replace(t,e,n)}sliceString(t,e=this.length,n="\n"){let i="";for(let s=0,r=0;s<this.children.length&&r<=e;s++){let h=this.children[s],o=r+h.length;r>t&&s&&(i+=n),t<o&&e>r&&(i+=h.sliceString(t-r,e-r,n)),r=o+1}return i}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof r))return 0;let n=0,[i,s,h,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=e,s+=e){if(i==h||s==o)return n;let r=this.children[i],l=t.children[s];if(r!=l)return n+r.scanIdentical(l,e);n+=r.length+1}}static from(t,e=t.reduce(((t,e)=>t+e.length+1),-1)){let n=0;for(let e of t)n+=e.lines;if(n<32){let n=[];for(let e of t)e.flatten(n);return new s(n,e)}let i=Math.max(32,n>>5),h=i<<1,o=i>>1,l=[],a=0,c=-1,f=[];function u(t){let e;if(t.lines>h&&t instanceof r)for(let e of t.children)u(e);else t.lines>o&&(a>o||!a)?(g(),l.push(t)):t instanceof s&&a&&(e=f[f.length-1])instanceof s&&t.lines+e.lines<=32?(a+=t.lines,c+=t.length+1,f[f.length-1]=new s(e.text.concat(t.text),e.length+1+t.length)):(a+t.lines>i&&g(),a+=t.lines,c+=t.length+1,f.push(t))}function g(){0!=a&&(l.push(1==f.length?f[0]:r.from(f,c)),c=-1,a=f.length=0)}for(let e of t)u(e);return g(),1==l.length?l[0]:new r(l,e)}}function h(t,e,n=0,i=1e9){for(let s=0,r=0,h=!0;r<t.length&&s<=i;r++){let o=t[r],l=s+o.length;l>=n&&(l>i&&(o=o.slice(0,i-s)),s<n&&(o=o.slice(n-s)),h?(e[e.length-1]+=o,h=!1):e.push(o)),s=l+1}return e}function o(t,e,n){return h(t,[""],e,n)}i.empty=new s([""],0);class l{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof s?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],h=r>>1,o=i instanceof s?i.text.length:i.children.length;if(h==(e>0?o:0)){if(0==n)return this.done=!0,this.value="",this;e>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(e>0?0:1)){if(this.offsets[n]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(i instanceof s){let s=i.text[h+(e<0?-1:0)];if(this.offsets[n]+=e,s.length>Math.max(0,t))return this.value=0==t?s:e>0?s.slice(t):s.slice(0,s.length-t),this;t-=s.length}else{let r=i.children[h+(e<0?-1:0)];t>r.length?(t-=r.length,this.offsets[n]+=e):(e<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(e>0?1:(r instanceof s?r.text.length:r.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class a{constructor(t,e,n){this.value="",this.done=!1,this.cursor=new l(t,e>n?-1:1),this.pos=e>n?t.length:0,this.from=Math.min(e,n),this.to=Math.max(e,n)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let n=e<0?this.pos-this.from:this.to-this.pos;t>n&&(t=n),n-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*e,this.value=i.length<=n?i:e<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class c{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:n,value:i}=this.inner.next(t);return e?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(i.prototype[Symbol.iterator]=function(){return this.iter()},l.prototype[Symbol.iterator]=a.prototype[Symbol.iterator]=c.prototype[Symbol.iterator]=function(){return this});class f{constructor(t,e,n,i){this.from=t,this.to=e,this.number=n,this.text=i}get length(){return this.to-this.from}}let u="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((t=>t?parseInt(t,36):1));for(let t=1;t<u.length;t++)u[t]+=u[t-1];function g(t){for(let e=1;e<u.length;e+=2)if(u[e]>t)return u[e-1]<=t;return!1}function d(t){return t>=127462&&t<=127487}const p=8205;function m(t,e,n=!0,i=!0){return(n?v:x)(t,e,i)}function v(t,e,n){if(e==t.length)return e;e&&w(t.charCodeAt(e))&&k(t.charCodeAt(e-1))&&e--;let i=S(t,e);for(e+=I(i);e<t.length;){let s=S(t,e);if(i==p||s==p||n&&g(s))e+=I(s),i=s;else{if(!d(s))break;{let n=0,i=e-2;for(;i>=0&&d(S(t,i));)n++,i-=2;if(n%2==0)break;e+=2}}}return e}function x(t,e,n){for(;e>0;){let i=v(t,e-2,n);if(i<e)return i;e--}return 0}function w(t){return t>=56320&&t<57344}function k(t){return t>=55296&&t<56320}function S(t,e){let n=t.charCodeAt(e);if(!k(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return w(i)?i-56320+(n-55296<<10)+65536:n}function y(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function I(t){return t<65536?1:2}const b=/\r\n?|\n/;var P=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(P||(P={}));class E{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e+1];t+=n<0?this.sections[e]:n}return t}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(t){for(let e=0,n=0,i=0;e<this.sections.length;){let s=this.sections[e++],r=this.sections[e++];r<0?(t(n,i,s),i+=s):i+=r,n+=s}}iterChangedRanges(t,e=!1){M(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];i<0?t.push(n,i):t.push(i,n)}return new E(t)}composeDesc(t){return this.empty?t:t.empty?this:T(this,t)}mapDesc(t,e=!1){return t.empty?this:O(this,t,e)}mapPos(t,e=-1,n=P.Simple){let i=0,s=0;for(let r=0;r<this.sections.length;){let h=this.sections[r++],o=this.sections[r++],l=i+h;if(o<0){if(l>t)return s+(t-i);s+=h}else{if(n!=P.Simple&&l>=t&&(n==P.TrackDel&&i<t&&l>t||n==P.TrackBefore&&i<t||n==P.TrackAfter&&l>t))return null;if(l>t||l==t&&e<0&&!h)return t==i||e<0?s:s+o;s+=o}i=l}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return s}touchesRange(t,e=t){for(let n=0,i=0;n<this.sections.length&&i<=e;){let s=i+this.sections[n++];if(this.sections[n++]>=0&&i<=e&&s>=t)return!(i<t&&s>e)||"cover";i=s}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let n=this.sections[e++],i=this.sections[e++];t+=(t?" ":"")+n+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some((t=>"number"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new E(t)}static create(t){return new E(t)}}class A extends E{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return M(this,((e,n,i,s,r)=>t=t.replace(i,i+(n-e),r)),!1),t}mapDesc(t,e=!1){return O(this,t,e,!0)}invert(t){let e=this.sections.slice(),n=[];for(let s=0,r=0;s<e.length;s+=2){let h=e[s],o=e[s+1];if(o>=0){e[s]=o,e[s+1]=h;let l=s>>1;for(;n.length<l;)n.push(i.empty);n.push(h?t.slice(r,r+h):i.empty)}r+=h}return new A(e,n)}compose(t){return this.empty?t:t.empty?this:T(this,t,!0)}map(t,e=!1){return t.empty?this:O(this,t,e,!0)}iterChanges(t,e=!1){M(this,t,e)}get desc(){return E.create(this.sections)}filter(t){let e=[],n=[],i=[],s=new F(this);t:for(let r=0,h=0;;){let o=r==t.length?1e9:t[r++];for(;h<o||h==o&&0==s.len;){if(s.done)break t;let t=Math.min(s.len,o-h);R(i,t,-1);let r=-1==s.ins?-1:0==s.off?s.ins:0;R(e,t,r),r>0&&C(n,e,s.text),s.forward(t),h+=t}let l=t[r++];for(;h<l;){if(s.done)break t;let t=Math.min(s.len,l-h);R(e,t,-1),R(i,t,-1==s.ins?-1:0==s.off?s.ins:0),s.forward(t),h+=t}}return{changes:new A(e,n),filtered:E.create(i)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let n=this.sections[e],i=this.sections[e+1];i<0?t.push(n):0==i?t.push([n]):t.push([n].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,n){let s=[],r=[],h=0,o=null;function l(t=!1){if(!t&&!s.length)return;h<e&&R(s,e-h,-1);let n=new A(s,r);o=o?o.compose(n.map(o)):n,s=[],r=[],h=0}return function t(a){if(Array.isArray(a))for(let e of a)t(e);else if(a instanceof A){if(a.length!=e)throw new RangeError(`Mismatched change set length (got ${a.length}, expected ${e})`);l(),o=o?o.compose(a.map(o)):a}else{let{from:t,to:o=t,insert:c}=a;if(t>o||t<0||o>e)throw new RangeError(`Invalid change range ${t} to ${o} (in doc of length ${e})`);let f=c?"string"==typeof c?i.of(c.split(n||b)):c:i.empty,u=f.length;if(t==o&&0==u)return;t<h&&l(),t>h&&R(s,t-h,-1),R(s,o-t,u),C(r,s,f),h=o}}(t),l(!o),o}static empty(t){return new A(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],n=[];for(let s=0;s<t.length;s++){let r=t[s];if("number"==typeof r)e.push(r,-1);else{if(!Array.isArray(r)||"number"!=typeof r[0]||r.some(((t,e)=>e&&"string"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)e.push(r[0],0);else{for(;n.length<s;)n.push(i.empty);n[s]=i.of(r.slice(1)),e.push(r[0],n[s].length)}}}return new A(e,n)}static createSet(t,e){return new A(t,e)}}function R(t,e,n,i=!1){if(0==e&&n<=0)return;let s=t.length-2;s>=0&&n<=0&&n==t[s+1]?t[s]+=e:0==e&&0==t[s]?t[s+1]+=n:i?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function C(t,e,n){if(0==n.length)return;let s=e.length-2>>1;if(s<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<s;)t.push(i.empty);t.push(n)}}function M(t,e,n){let s=t.inserted;for(let r=0,h=0,o=0;o<t.sections.length;){let l=t.sections[o++],a=t.sections[o++];if(a<0)r+=l,h+=l;else{let c=r,f=h,u=i.empty;for(;c+=l,f+=a,a&&s&&(u=u.append(s[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(r,c,h,f,u),r=c,h=f}}}function O(t,e,n,i=!1){let s=[],r=i?[]:null,h=new F(t),o=new F(e);for(let t=-1;;)if(-1==h.ins&&-1==o.ins){let t=Math.min(h.len,o.len);R(s,t,-1),h.forward(t),o.forward(t)}else if(o.ins>=0&&(h.ins<0||t==h.i||0==h.off&&(o.len<h.len||o.len==h.len&&!n))){let e=o.len;for(R(s,o.ins,-1);e;){let n=Math.min(h.len,e);h.ins>=0&&t<h.i&&h.len<=n&&(R(s,0,h.ins),r&&C(r,s,h.text),t=h.i),h.forward(n),e-=n}o.next()}else{if(!(h.ins>=0)){if(h.done&&o.done)return r?A.createSet(s,r):E.create(s);throw new Error("Mismatched change set lengths")}{let e=0,n=h.len;for(;n;)if(-1==o.ins){let t=Math.min(n,o.len);e+=t,n-=t,o.forward(t)}else{if(!(0==o.ins&&o.len<n))break;n-=o.len,o.next()}R(s,e,t<h.i?h.ins:0),r&&t<h.i&&C(r,s,h.text),t=h.i,h.forward(h.len-n)}}}function T(t,e,n=!1){let i=[],s=n?[]:null,r=new F(t),h=new F(e);for(let t=!1;;){if(r.done&&h.done)return s?A.createSet(i,s):E.create(i);if(0==r.ins)R(i,r.len,0,t),r.next();else if(0!=h.len||h.done){if(r.done||h.done)throw new Error("Mismatched change set lengths");{let e=Math.min(r.len2,h.len),n=i.length;if(-1==r.ins){let n=-1==h.ins?-1:h.off?0:h.ins;R(i,e,n,t),s&&n&&C(s,i,h.text)}else-1==h.ins?(R(i,r.off?0:r.len,e,t),s&&C(s,i,r.textBit(e))):(R(i,r.off?0:r.len,h.off?0:h.ins,t),s&&!h.off&&C(s,i,h.text));t=(r.ins>e||h.ins>=0&&h.len>e)&&(t||i.length>n),r.forward2(e),h.forward(e)}}else R(i,0,h.ins,t),s&&C(s,i,h.text),h.next()}}class F{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?i.empty:t[e]}textBit(t){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length&&!t?i.empty:e[n].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class B{constructor(t,e,n){this.from=t,this.to=e,this.flags=n}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){let t=3&this.flags;return 3==t?null:t}get goalColumn(){let t=this.flags>>5;return 33554431==t?void 0:t}map(t,e=-1){let n,i;return this.empty?n=i=t.mapPos(this.from,e):(n=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new B(n,i,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return J.range(t,e);let n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return J.range(this.anchor,n)}eq(t){return this.anchor==t.anchor&&this.head==t.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return J.range(t.anchor,t.head)}static create(t,e,n){return new B(t,e,n)}}class J{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:J.create(this.ranges.map((n=>n.map(t,e))),this.mainIndex)}eq(t){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let e=0;e<this.ranges.length;e++)if(!this.ranges[e].eq(t.ranges[e]))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new J([this.main],0)}addRange(t,e=!0){return J.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let n=this.ranges.slice();return n[e]=t,J.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map((t=>t.toJSON())),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new J(t.ranges.map((t=>B.fromJSON(t))),t.main)}static single(t,e=t){return new J([J.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<t.length;i++){let s=t[i];if(s.empty?s.from<=n:s.from<n)return J.normalized(t.slice(),e);n=s.to}return new J(t,e)}static cursor(t,e=0,n,i){return B.create(t,t,(0==e?0:e<0?4:8)|(null==n?3:Math.min(2,n))|(null!=i?i:33554431)<<5)}static range(t,e,n,i){let s=(null!=n?n:33554431)<<5|(null==i?3:Math.min(2,i));return e<t?B.create(e,t,24|s):B.create(t,e,(e>t?4:0)|s)}static normalized(t,e=0){let n=t[e];t.sort(((t,e)=>t.from-e.from)),e=t.indexOf(n);for(let n=1;n<t.length;n++){let i=t[n],s=t[n-1];if(i.empty?i.from<=s.to:i.from<s.to){let r=s.from,h=Math.max(i.to,s.to);n<=e&&e--,t.splice(--n,2,i.anchor>i.head?J.range(h,r):J.range(r,h))}}return new J(t,e)}}function N(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let L=0;class D{constructor(t,e,n,i,s){this.combine=t,this.compareInput=e,this.compare=n,this.isStatic=i,this.id=L++,this.default=t([]),this.extensions="function"==typeof s?s(this):s}static define(t={}){return new D(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:j),!!t.static,t.enables)}of(t){return new q([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],(n=>e(n.field(t))))}}function j(t,e){return t==e||t.length==e.length&&t.every(((t,n)=>t===e[n]))}class q{constructor(t,e,n,i){this.dependencies=t,this.facet=e,this.type=n,this.value=i,this.id=L++}dynamicSlot(t){var e;let n=this.value,i=this.facet.compareInput,s=this.id,r=t[s]>>1,h=2==this.type,o=!1,l=!1,a=[];for(let n of this.dependencies)"doc"==n?o=!0:"selection"==n?l=!0:0==(1&(null!==(e=t[n.id])&&void 0!==e?e:1))&&a.push(t[n.id]);return{create:t=>(t.values[r]=n(t),1),update(t,e){if(o&&e.docChanged||l&&(e.docChanged||e.selection)||_(t,a)){let e=n(t);if(h?!$(e,t.values[r],i):!i(e,t.values[r]))return t.values[r]=e,1}return 0},reconfigure:(t,e)=>{let o,l=e.config.address[s];if(null!=l){let s=Z(e,l);if(this.dependencies.every((n=>n instanceof D?e.facet(n)===t.facet(n):!(n instanceof U)||e.field(n,!1)==t.field(n,!1)))||(h?$(o=n(t),s,i):i(o=n(t),s)))return t.values[r]=s,0}else o=n(t);return t.values[r]=o,1}}}}function $(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function _(t,e){let n=!1;for(let i of e)1&X(t,i)&&(n=!0);return n}function z(t,e,n){let i=n.map((e=>t[e.id])),s=n.map((t=>t.type)),r=i.filter((t=>!(1&t))),h=t[e.id]>>1;function o(t){let n=[];for(let e=0;e<i.length;e++){let r=Z(t,i[e]);if(2==s[e])for(let t of r)n.push(t);else n.push(r)}return e.combine(n)}return{create(t){for(let e of i)X(t,e);return t.values[h]=o(t),1},update(t,n){if(!_(t,r))return 0;let i=o(t);return e.compare(i,t.values[h])?0:(t.values[h]=i,1)},reconfigure(t,s){let r=_(t,i),l=s.config.facets[e.id],a=s.facet(e);if(l&&!r&&j(n,l))return t.values[h]=a,0;let c=o(t);return e.compare(c,a)?(t.values[h]=a,0):(t.values[h]=c,1)}}}const V=D.define({static:!0});class U{constructor(t,e,n,i,s){this.id=t,this.createF=e,this.updateF=n,this.compareF=i,this.spec=s,this.provides=void 0}static define(t){let e=new U(L++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(V).find((t=>t.field==this));return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,n)=>{let i=t.values[e],s=this.updateF(i,n);return this.compareF(i,s)?0:(t.values[e]=s,1)},reconfigure:(t,n)=>null!=n.config.address[this.id]?(t.values[e]=n.field(this),0):(t.values[e]=this.create(t),1)}}init(t){return[this,V.of({field:this,create:t})]}get extension(){return this}}function W(t){return e=>new Y(e,t)}const G={highest:W(0),high:W(1),default:W(2),low:W(3),lowest:W(4)};class Y{constructor(t,e){this.inner=t,this.prec=e}}class H{of(t){return new K(this,t)}reconfigure(t){return H.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class K{constructor(t,e){this.compartment=t,this.inner=e}}class Q{constructor(t,e,n,i,s,r){for(this.base=t,this.compartments=e,this.dynamicSlots=n,this.address=i,this.staticValues=s,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return null==e?t.default:this.staticValues[e>>1]}static resolve(t,e,n){let i=[],s=Object.create(null),r=new Map;for(let n of function(t,e,n){let i=[[],[],[],[],[]],s=new Map;return function t(r,h){let o=s.get(r);if(null!=o){if(o<=h)return;let t=i[o].indexOf(r);t>-1&&i[o].splice(t,1),r instanceof K&&n.delete(r.compartment)}if(s.set(r,h),Array.isArray(r))for(let e of r)t(e,h);else if(r instanceof K){if(n.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let i=e.get(r.compartment)||r.inner;n.set(r.compartment,i),t(i,h)}else if(r instanceof Y)t(r.inner,r.prec);else if(r instanceof U)i[h].push(r),r.provides&&t(r.provides,h);else if(r instanceof q)i[h].push(r),r.facet.extensions&&t(r.facet.extensions,2);else{let e=r.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);t(e,h)}}(t,2),i.reduce(((t,e)=>t.concat(e)))}(t,e,r))n instanceof U?i.push(n):(s[n.facet.id]||(s[n.facet.id]=[])).push(n);let h=Object.create(null),o=[],l=[];for(let t of i)h[t.id]=l.length<<1,l.push((e=>t.slot(e)));let a=null==n?void 0:n.config.facets;for(let t in s){let e=s[t],i=e[0].facet,r=a&&a[t]||[];if(e.every((t=>0==t.type)))if(h[i.id]=o.length<<1|1,j(r,e))o.push(n.facet(i));else{let t=i.combine(e.map((t=>t.value)));o.push(n&&i.compare(t,n.facet(i))?n.facet(i):t)}else{for(let t of e)0==t.type?(h[t.id]=o.length<<1|1,o.push(t.value)):(h[t.id]=l.length<<1,l.push((e=>t.dynamicSlot(e))));h[i.id]=l.length<<1,l.push((t=>z(t,i,e)))}}let c=l.map((t=>t(h)));return new Q(t,r,c,h,o,s)}}function X(t,e){if(1&e)return 2;let n=e>>1,i=t.status[n];if(4==i)throw new Error("Cyclic dependency between fields and/or facets");if(2&i)return i;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function Z(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const tt=D.define(),et=D.define({combine:t=>t.some((t=>t)),static:!0}),nt=D.define({combine:t=>t.length?t[0]:void 0,static:!0}),it=D.define(),st=D.define(),rt=D.define(),ht=D.define({combine:t=>!!t.length&&t[0]});class ot{constructor(t,e){this.type=t,this.value=e}static define(){return new lt}}class lt{of(t){return new ot(this,t)}}class at{constructor(t){this.map=t}of(t){return new ct(this,t)}}class ct{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new ct(this.type,e)}is(t){return this.type==t}static define(t={}){return new at(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let n=[];for(let i of t){let t=i.map(e);t&&n.push(t)}return n}}ct.reconfigure=ct.define(),ct.appendConfig=ct.define();class ft{constructor(t,e,n,i,s,r){this.startState=t,this.changes=e,this.selection=n,this.effects=i,this.annotations=s,this.scrollIntoView=r,this._doc=null,this._state=null,n&&N(n,e.newLength),s.some((t=>t.type==ft.time))||(this.annotations=s.concat(ft.time.of(Date.now())))}static create(t,e,n,i,s,r){return new ft(t,e,n,i,s,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(ft.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function ut(t,e){let n=[];for(let i=0,s=0;;){let r,h;if(i<t.length&&(s==e.length||e[s]>=t[i]))r=t[i++],h=t[i++];else{if(!(s<e.length))return n;r=e[s++],h=e[s++]}!n.length||n[n.length-1]<r?n.push(r,h):n[n.length-1]<h&&(n[n.length-1]=h)}}function gt(t,e,n){var i;let s,r,h;return n?(s=e.changes,r=A.empty(e.changes.length),h=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),r=t.changes.mapDesc(e.changes,!0),h=t.changes.compose(s)),{changes:h,selection:e.selection?e.selection.map(r):null===(i=t.selection)||void 0===i?void 0:i.map(s),effects:ct.mapEffects(t.effects,s).concat(ct.mapEffects(e.effects,r)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function dt(t,e,n){let i=e.selection,s=vt(e.annotations);return e.userEvent&&(s=s.concat(ft.userEvent.of(e.userEvent))),{changes:e.changes instanceof A?e.changes:A.of(e.changes||[],n,t.facet(nt)),selection:i&&(i instanceof J?i:J.single(i.anchor,i.head)),effects:vt(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function pt(t,e,n){let i=dt(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(n=!1);for(let s=1;s<e.length;s++){!1===e[s].filter&&(n=!1);let r=!!e[s].sequential;i=gt(i,dt(t,e[s],r?i.changes.newLength:t.doc.length),r)}let s=ft.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(t){let e=t.startState,n=e.facet(rt),i=t;for(let s=n.length-1;s>=0;s--){let r=n[s](t);r&&Object.keys(r).length&&(i=gt(i,dt(e,r,t.changes.newLength),!0))}return i==t?t:ft.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}(n?function(t){let e=t.startState,n=!0;for(let i of e.facet(it)){let e=i(t);if(!1===e){n=!1;break}Array.isArray(e)&&(n=!0===n?e:ut(n,e))}if(!0!==n){let i,s;if(!1===n)s=t.changes.invertedDesc,i=A.empty(e.doc.length);else{let e=t.changes.filter(n);i=e.changes,s=e.filtered.mapDesc(e.changes).invertedDesc}t=ft.create(e,i,t.selection&&t.selection.map(s),ct.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(st);for(let n=i.length-1;n>=0;n--){let s=i[n](t);t=s instanceof ft?s:Array.isArray(s)&&1==s.length&&s[0]instanceof ft?s[0]:pt(e,vt(s),!1)}return t}(s):s)}ft.time=ot.define(),ft.userEvent=ot.define(),ft.addToHistory=ot.define(),ft.remote=ot.define();const mt=[];function vt(t){return null==t?mt:Array.isArray(t)?t:[t]}var xt=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(xt||(xt={}));const wt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let kt;try{kt=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}class St{constructor(t,e,n,i,s,r){this.config=t,this.doc=e,this.selection=n,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=s,r&&(r._state=this);for(let t=0;t<this.config.dynamicSlots.length;t++)X(this,t<<1);this.computeSlot=null}field(t,e=!0){let n=this.config.address[t.id];if(null!=n)return X(this,n),Z(this,n);if(e)throw new RangeError("Field is not present in this state")}update(...t){return pt(this,t,!0)}applyTransaction(t){let e,n=this.config,{base:i,compartments:s}=n;for(let e of t.effects)e.is(H.reconfigure)?(n&&(s=new Map,n.compartments.forEach(((t,e)=>s.set(e,t))),n=null),s.set(e.value.compartment,e.value.extension)):e.is(ct.reconfigure)?(n=null,i=e.value):e.is(ct.appendConfig)&&(n=null,i=vt(i).concat(e.value));n?e=t.startState.values.slice():(n=Q.resolve(i,s,this),e=new St(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((t,e)=>e.reconfigure(t,this)),null).values),new St(n,t.newDoc,t.newSelection,e,((e,n)=>n.update(e,t)),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:t},range:J.cursor(e.from+t.length)})))}changeByRange(t){let e=this.selection,n=t(e.ranges[0]),i=this.changes(n.changes),s=[n.range],r=vt(n.effects);for(let n=1;n<e.ranges.length;n++){let h=t(e.ranges[n]),o=this.changes(h.changes),l=o.map(i);for(let t=0;t<n;t++)s[t]=s[t].map(l);let a=i.mapDesc(o,!0);s.push(h.range.map(a)),i=i.compose(l),r=ct.mapEffects(r,l).concat(ct.mapEffects(vt(h.effects),a))}return{changes:i,selection:J.create(s,e.mainIndex),effects:r}}changes(t=[]){return t instanceof A?t:A.of(t,this.doc.length,this.facet(St.lineSeparator))}toText(t){return i.of(t.split(this.facet(St.lineSeparator)||b))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return null==e?t.default:(X(this,e),Z(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let n in t){let i=t[n];i instanceof U&&null!=this.config.address[i.id]&&(e[n]=i.spec.toJSON(this.field(t[n]),this))}return e}static fromJSON(t,e={},n){if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n)for(let e in n)if(Object.prototype.hasOwnProperty.call(t,e)){let s=n[e],r=t[e];i.push(s.init((t=>s.spec.fromJSON(r,t))))}return St.create({doc:t.doc,selection:J.fromJSON(t.selection),extensions:e.extensions?i.concat([e.extensions]):i})}static create(t={}){let e=Q.resolve(t.extensions||[],new Map),n=t.doc instanceof i?t.doc:i.of((t.doc||"").split(e.staticFacet(St.lineSeparator)||b)),s=t.selection?t.selection instanceof J?t.selection:J.single(t.selection.anchor,t.selection.head):J.single(0);return N(s,n.length),e.staticFacet(et)||(s=s.asSingle()),new St(e,n,s,e.dynamicSlots.map((()=>null)),((t,e)=>e.create(t)),null)}get tabSize(){return this.facet(St.tabSize)}get lineBreak(){return this.facet(St.lineSeparator)||"\n"}get readOnly(){return this.facet(ht)}phrase(t,...e){for(let e of this.facet(St.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,((t,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>e.length?t:e[i-1]}))),t}languageDataAt(t,e,n=-1){let i=[];for(let s of this.facet(tt))for(let r of s(this,e,n))Object.prototype.hasOwnProperty.call(r,t)&&i.push(r[t]);return i}charCategorizer(t){return e=this.languageDataAt("wordChars",t).join(""),t=>{if(!/\S/.test(t))return xt.Space;if(function(t){if(kt)return kt.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||wt.test(n)))return!0}return!1}(t))return xt.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return xt.Word;return xt.Other};var e}wordAt(t){let{text:e,from:n,length:i}=this.doc.lineAt(t),s=this.charCategorizer(t),r=t-n,h=t-n;for(;r>0;){let t=m(e,r,!1);if(s(e.slice(t,r))!=xt.Word)break;r=t}for(;h<i;){let t=m(e,h);if(s(e.slice(h,t))!=xt.Word)break;h=t}return r==h?null:J.range(r+n,h+n)}}function yt(t,e,n={}){let i={};for(let e of t)for(let t of Object.keys(e)){let s=e[t],r=i[t];if(void 0===r)i[t]=s;else if(r===s||void 0===s);else{if(!Object.hasOwnProperty.call(n,t))throw new Error("Config merge conflict for field "+t);i[t]=n[t](r,s)}}for(let t in e)void 0===i[t]&&(i[t]=e[t]);return i}St.allowMultipleSelections=et,St.tabSize=D.define({combine:t=>t.length?t[0]:4}),St.lineSeparator=nt,St.readOnly=ht,St.phrases=D.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every((n=>t[n]==e[n]))}}),St.languageData=tt,St.changeFilter=it,St.transactionFilter=st,St.transactionExtender=rt,H.reconfigure=ct.define();class It{eq(t){return this==t}range(t,e=t){return bt.create(t,e,this)}}It.prototype.startSide=It.prototype.endSide=0,It.prototype.point=!1,It.prototype.mapMode=P.TrackDel;class bt{constructor(t,e,n){this.from=t,this.to=e,this.value=n}static create(t,e,n){return new bt(t,e,n)}}function Pt(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Et{constructor(t,e,n,i){this.from=t,this.to=e,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,e,n,i=0){let s=n?this.to:this.from;for(let r=i,h=s.length;;){if(r==h)return r;let i=r+h>>1,o=s[i]-t||(n?this.value[i].endSide:this.value[i].startSide)-e;if(i==r)return o>=0?r:h;o>=0?h=i:r=i+1}}between(t,e,n,i){for(let s=this.findIndex(e,-1e9,!0),r=this.findIndex(n,1e9,!1,s);s<r;s++)if(!1===i(this.from[s]+t,this.to[s]+t,this.value[s]))return!1}map(t,e){let n=[],i=[],s=[],r=-1,h=-1;for(let o=0;o<this.value.length;o++){let l,a,c=this.value[o],f=this.from[o]+t,u=this.to[o]+t;if(f==u){let t=e.mapPos(f,c.startSide,c.mapMode);if(null==t)continue;if(l=a=t,c.startSide!=c.endSide&&(a=e.mapPos(f,c.endSide),a<l))continue}else if(l=e.mapPos(f,c.startSide),a=e.mapPos(u,c.endSide),l>a||l==a&&c.startSide>0&&c.endSide<=0)continue;(a-l||c.endSide-c.startSide)<0||(r<0&&(r=l),c.point&&(h=Math.max(h,a-l)),n.push(c),i.push(l-r),s.push(a-r))}return{mapped:n.length?new Et(i,s,n,h):null,pos:r}}}class At{constructor(t,e,n,i){this.chunkPos=t,this.chunk=e,this.nextLayer=n,this.maxPoint=i}static create(t,e,n,i){return new At(t,e,n,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:n=!1,filterFrom:i=0,filterTo:s=this.length}=t,r=t.filter;if(0==e.length&&!r)return this;if(n&&(e=e.slice().sort(Pt)),this.isEmpty)return e.length?At.of(e):this;let h=new Mt(this,null,-1).goto(0),o=0,l=[],a=new Rt;for(;h.value||o<e.length;)if(o<e.length&&(h.from-e[o].from||h.startSide-e[o].value.startSide)>=0){let t=e[o++];a.addInner(t.from,t.to,t.value)||l.push(t)}else 1==h.rangeIndex&&h.chunkIndex<this.chunk.length&&(o==e.length||this.chunkEnd(h.chunkIndex)<e[o].from)&&(!r||i>this.chunkEnd(h.chunkIndex)||s<this.chunkPos[h.chunkIndex])&&a.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!r||i>h.to||s<h.from||r(h.from,h.to,h.value))&&(a.addInner(h.from,h.to,h.value)||l.push(bt.create(h.from,h.to,h.value))),h.next());return a.finishInner(this.nextLayer.isEmpty&&!l.length?At.empty:this.nextLayer.update({add:l,filter:r,filterFrom:i,filterTo:s}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],n=[],i=-1;for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],h=this.chunk[s],o=t.touchesRange(r,r+h.length);if(!1===o)i=Math.max(i,h.maxPoint),e.push(h),n.push(t.mapPos(r));else if(!0===o){let{mapped:s,pos:o}=h.map(r,t);s&&(i=Math.max(i,s.maxPoint),e.push(s),n.push(o))}}let s=this.nextLayer.map(t);return 0==e.length?s:new At(n,e,s||At.empty,i)}between(t,e,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],r=this.chunk[i];if(e>=s&&t<=s+r.length&&!1===r.between(s,t-s,e-s,n))return}this.nextLayer.between(t,e,n)}}iter(t=0){return Ot.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Ot.from(t).goto(e)}static compare(t,e,n,i,s=-1){let r=t.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),h=e.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),o=Ct(r,h,n),l=new Ft(r,o,s),a=new Ft(h,o,s);n.iterGaps(((t,e,n)=>Bt(l,t,a,e,n,i))),n.empty&&0==n.length&&Bt(l,0,a,0,0,i)}static eq(t,e,n=0,i){null==i&&(i=999999999);let s=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0)),r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0));if(s.length!=r.length)return!1;if(!s.length)return!0;let h=Ct(s,r),o=new Ft(s,h,0).goto(n),l=new Ft(r,h,0).goto(n);for(;;){if(o.to!=l.to||!Jt(o.active,l.active)||o.point&&(!l.point||!o.point.eq(l.point)))return!1;if(o.to>i)return!0;o.next(),l.next()}}static spans(t,e,n,i,s=-1){let r=new Ft(t,null,s).goto(e),h=e,o=r.openStart;for(;;){let t=Math.min(r.to,n);if(r.point){let n=r.activeForPoint(r.to),s=r.pointFrom<e?n.length+1:Math.min(n.length,o);i.point(h,t,r.point,n,s,r.pointRank),o=Math.min(r.openEnd(t),n.length)}else t>h&&(i.span(h,t,r.active,o),o=r.openEnd(t));if(r.to>n)return o+(r.point&&r.to>n?1:0);h=r.to,r.next()}}static of(t,e=!1){let n=new Rt;for(let i of t instanceof bt?[t]:e?function(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(Pt(e,i)>0)return t.slice().sort(Pt);e=i}return t}(t):t)n.add(i.from,i.to,i.value);return n.finish()}}At.empty=new At([],[],null,-1),At.empty.nextLayer=At.empty;class Rt{finishChunk(t){this.chunks.push(new Et(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,n){this.addInner(t,e,n)||(this.nextLayer||(this.nextLayer=new Rt)).add(t,e,n)}addInner(t,e,n){let i=t-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=n,this.lastFrom=t,this.lastTo=e,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),0))}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let n=e.value.length-1;return this.last=e.value[n],this.lastFrom=e.from[n]+t,this.lastTo=e.to[n]+t,!0}finish(){return this.finishInner(At.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=At.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function Ct(t,e,n){let i=new Map;for(let e of t)for(let t=0;t<e.chunk.length;t++)e.chunk[t].maxPoint<=0&&i.set(e.chunk[t],e.chunkPos[t]);let s=new Set;for(let t of e)for(let e=0;e<t.chunk.length;e++){let r=i.get(t.chunk[e]);null==r||(n?n.mapPos(r):r)!=t.chunkPos[e]||(null==n?void 0:n.touchesRange(r,r+t.chunk[e].length))||s.add(t.chunk[e])}return s}class Mt{constructor(t,e,n,i=0){this.layer=t,this.skip=e,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,n){for(;this.chunkIndex<this.layer.chunk.length;){let e=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(e)||this.layer.chunkEnd(this.chunkIndex)<t||e.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],n=t+e.from[this.rangeIndex];if(this.from=n,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class Ot{constructor(t){this.heap=t}static from(t,e=null,n=-1){let i=[];for(let s=0;s<t.length;s++)for(let r=t[s];!r.isEmpty;r=r.nextLayer)r.maxPoint>=n&&i.push(new Mt(r,e,n,s));return 1==i.length?i[0]:new Ot(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let n of this.heap)n.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)Tt(this.heap,t);return this.next(),this}forward(t,e){for(let n of this.heap)n.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)Tt(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Tt(this.heap,0)}}}function Tt(t,e){for(let n=t[e];;){let i=1+(e<<1);if(i>=t.length)break;let s=t[i];if(i+1<t.length&&s.compare(t[i+1])>=0&&(s=t[i+1],i++),n.compare(s)<0)break;t[i]=n,t[e]=s,e=i}}class Ft{constructor(t,e,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ot.from(t,e,n)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){Nt(this.active,t),Nt(this.activeTo,t),Nt(this.activeRank,t),this.minActive=Dt(this.active,this.activeTo)}addActive(t){let e=0,{value:n,to:i,rank:s}=this.cursor;for(;e<this.activeRank.length&&this.activeRank[e]<=s;)e++;Lt(this.active,e,n),Lt(this.activeTo,e,i),Lt(this.activeRank,e,s),t&&Lt(t,e,this.cursor.from),this.minActive=Dt(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&Nt(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=t,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=t.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}}if(n){this.openStart=0;for(let e=n.length-1;e>=0&&n[e]<t;e--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>t||this.activeTo[n]==t&&this.active[n].endSide>=this.point.endSide)&&e.push(this.active[n]);return e.reverse()}openEnd(t){let e=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>t;n--)e++;return e}}function Bt(t,e,n,i,s,r){t.goto(e),n.goto(i);let h=i+s,o=i,l=i-e;for(;;){let e=t.to+l-n.to||t.endSide-n.endSide,i=e<0?t.to+l:n.to,s=Math.min(i,h);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&Jt(t.activeForPoint(t.to),n.activeForPoint(n.to))||r.comparePoint(o,s,t.point,n.point):s>o&&!Jt(t.active,n.active)&&r.compareRange(o,s,t.active,n.active),i>h)break;o=i,e<=0&&t.next(),e>=0&&n.next()}}function Jt(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function Nt(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function Lt(t,e,n){for(let n=t.length-1;n>=e;n--)t[n+1]=t[n];t[e]=n}function Dt(t,e){let n=-1,i=1e9;for(let s=0;s<e.length;s++)(e[s]-i||t[s].endSide-t[n].endSide)<0&&(n=s,i=e[s]);return n}function jt(t,e,n=t.length){let i=0;for(let s=0;s<n;)9==t.charCodeAt(s)?(i+=e-i%e,s++):(i++,s=m(t,s));return i}function qt(t,e,n,i){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=9==t.charCodeAt(i)?n-s%n:1,i=m(t,i)}return!0===i?-1:t.length}}}]);
|
notebook/static/2330.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2330],{92330:(e,t,i)=>{i.r(t),i.d(t,{INotebookShell:()=>k,NotebookApp:()=>y,NotebookShell:()=>v,PanelHandler:()=>f,Private:()=>H,SidePanelHandler:()=>w,SidePanelPalette:()=>W});var s,n=i(79643),r=i(64392),a=i(75677),d=i(20389),o=i(79452),l=i(70176),h=i(80259),p=i(20882),g=i(49501),c=i(47479),_=i(46947),u=i(9768),m=i(30807);class f{constructor(){this._panelChildHook=(e,t)=>{if("child-removed"===t.type){const e=t.child;p.ArrayExt.removeFirstWhere(this._items,(t=>t.widget===e))}return!0},this._items=new Array,this._panel=new _.Panel,m.MessageLoop.installMessageHook(this._panel,this._panelChildHook)}get panel(){return this._panel}addWidget(e,t){e.parent=null;const i={widget:e,rank:t},n=p.ArrayExt.upperBound(this._items,i,s.itemCmp);p.ArrayExt.insert(this._items,n,i),this._panel.insertWidget(n,e)}}class w extends f{constructor(e){super(),this._isHiddenByUser=!1,this._widgetAdded=new c.Signal(this),this._widgetRemoved=new c.Signal(this),this._area=e,this._panel.hide(),this._currentWidget=null,this._lastCurrentWidget=null,this._widgetPanel=new _.StackedPanel,this._widgetPanel.widgetRemoved.connect(this._onWidgetRemoved,this),this._closeButton=document.createElement("button"),u.closeIcon.element({container:this._closeButton,height:"16px",width:"auto"}),this._closeButton.onclick=()=>{this.collapse(),this.hide()},this._closeButton.className="jp-Button jp-SidePanel-collapse",this._closeButton.title="Collapse side panel";const t=new _.Widget({node:this._closeButton});this._panel.addWidget(t),this._panel.addWidget(this._widgetPanel)}get currentWidget(){return this._currentWidget||this._lastCurrentWidget||(this._items.length>0?this._items[0].widget:null)}get area(){return this._area}get isVisible(){return this._panel.isVisible}get panel(){return this._panel}get widgets(){return this._items.map((e=>e.widget))}get widgetAdded(){return this._widgetAdded}get widgetRemoved(){return this._widgetRemoved}get closeButton(){return this._closeButton}expand(e){if(this._currentWidget&&this.collapse(),e)this.activate(e);else{const e=this.currentWidget;e&&(this._currentWidget=e,this.activate(e.id))}}activate(e){const t=this._findWidgetByID(e);t&&(this._currentWidget=t,t.show(),t.activate())}has(e){return null!==this._findWidgetByID(e)}collapse(){var e;null===(e=this._currentWidget)||void 0===e||e.hide(),this._currentWidget=null}addWidget(e,t){e.parent=null,e.hide();const i={widget:e,rank:t},s=this._findInsertIndex(i);p.ArrayExt.insert(this._items,s,i),this._widgetPanel.insertWidget(s,e),this._refreshVisibility(),this._widgetAdded.emit(e)}hide(){this._isHiddenByUser=!0,this._refreshVisibility()}show(){this._isHiddenByUser=!1,this._refreshVisibility()}_findInsertIndex(e){return p.ArrayExt.upperBound(this._items,e,s.itemCmp)}_findWidgetIndex(e){return p.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e))}_findWidgetByID(e){const t=(0,p.find)(this._items,(t=>t.widget.id===e));return t?t.widget:null}_refreshVisibility(){this._panel.setHidden(this._isHiddenByUser)}_onWidgetRemoved(e,t){t===this._lastCurrentWidget&&(this._lastCurrentWidget=null),p.ArrayExt.removeAt(this._items,this._findWidgetIndex(t)),this._refreshVisibility(),this._widgetRemoved.emit(t)}}class W{constructor(e){this._items=[],this._commandPalette=e.commandPalette,this._command=e.command}getItem(e,t){const i=this._items;for(let s=0;s<i.length;s++){const n=i[s];if(n.widgetId===e.id&&n.area===t)return n}return null}addItem(e,t){if(this.getItem(e,t))return;const i=this._commandPalette.addItem({command:this._command,category:"View",args:{side:t,title:`Show ${e.title.caption}`,id:e.id}});this._items.push({widgetId:e.id,area:t,disposable:i})}removeItem(e,t){const i=this.getItem(e,t);i&&i.disposable.dispose()}}!function(e){e.itemCmp=function(e,t){return e.rank-t.rank}}(s||(s={}));const k=new g.Token("@jupyter-notebook/application:INotebookShell");class v extends _.Widget{constructor(){super(),this._translator=h.nullTranslator,this._currentChanged=new c.Signal(this),this._mainWidgetLoaded=new g.PromiseDelegate,this.id="main",this._topHandler=new f,this._menuHandler=new f,this._leftHandler=new w("left"),this._rightHandler=new w("right"),this._main=new _.Panel;const e=this._topWrapper=new _.Panel,t=this._menuWrapper=new _.Panel;this._topHandler.panel.id="top-panel",this._topHandler.panel.node.setAttribute("role","banner"),this._menuHandler.panel.id="menu-panel",this._menuHandler.panel.node.setAttribute("role","navigation"),this._main.id="main-panel",this._main.node.setAttribute("role","main"),this._spacer_top=new _.Widget,this._spacer_top.id="spacer-widget-top",this._spacer_bottom=new _.Widget,this._spacer_bottom.id="spacer-widget-bottom",e.id="top-panel-wrapper",e.addWidget(this._topHandler.panel),t.id="menu-panel-wrapper",t.addWidget(this._menuHandler.panel);const i=new _.BoxLayout,s=this._leftHandler,n=this._rightHandler;s.panel.id="jp-left-stack",s.panel.node.setAttribute("role","complementary"),n.panel.id="jp-right-stack",n.panel.node.setAttribute("role","complementary"),s.hide(),n.hide();const r=new _.BoxLayout({spacing:0,direction:"top-to-bottom"});_.BoxLayout.setStretch(this._topWrapper,0),_.BoxLayout.setStretch(this._menuWrapper,0),_.BoxLayout.setStretch(this._main,1);const a=new _.Panel({layout:r});a.addWidget(this._topWrapper),a.addWidget(this._menuWrapper),a.addWidget(this._spacer_top),a.addWidget(this._main),a.addWidget(this._spacer_bottom),a.layout=r;const d=new _.SplitPanel;d.id="main-split-panel",d.spacing=1,_.BoxLayout.setStretch(d,1),_.SplitPanel.setStretch(s.panel,0),_.SplitPanel.setStretch(n.panel,0),_.SplitPanel.setStretch(a,1),d.addWidget(s.panel),d.addWidget(a),d.addWidget(n.panel),d.setRelativeSizes([1,2.5,1]),i.spacing=0,i.addWidget(d),this.layout=i;const o=this._skipLinkWidgetHandler=new H.SkipLinkWidgetHandler(this);this.add(o.skipLinkWidget,"top",{rank:0}),this._skipLinkWidgetHandler.show()}get currentChanged(){return this._currentChanged}get currentWidget(){var e;return null!==(e=this._main.widgets[0])&&void 0!==e?e:null}get top(){return this._topWrapper}get menu(){return this._menuWrapper}get leftHandler(){return this._leftHandler}get rightHandler(){return this._rightHandler}get leftCollapsed(){return!(this._leftHandler.isVisible&&this._leftHandler.panel.isVisible)}get rightCollapsed(){return!(this._rightHandler.isVisible&&this._rightHandler.panel.isVisible)}get restored(){return this._mainWidgetLoaded.promise}get translator(){var e;return null!==(e=this._translator)&&void 0!==e?e:h.nullTranslator}set translator(e){if(e!==this._translator){this._translator=e;const t=e.load("notebook");this._leftHandler.closeButton.title=t.__("Collapse %1 side panel",this._leftHandler.area),this._rightHandler.closeButton.title=t.__("Collapse %1 side panel",this._rightHandler.area)}}activateById(e){for(const t of["main","top","left","right","menu"]){const i=(0,p.find)(this.widgets(t),(t=>t.id===e));i&&("left"===t?this.expandLeft(e):"right"===t?this.expandRight(e):i.activate())}}add(e,t,i){var s;const n=null!==(s=null==i?void 0:i.rank)&&void 0!==s?s:900;switch(t){case"top":return this._topHandler.addWidget(e,n);case"menu":return this._menuHandler.addWidget(e,n);case"main":case void 0:if(this._main.widgets.length>0)return;this._main.addWidget(e),this._main.update(),this._currentChanged.emit(void 0),this._mainWidgetLoaded.resolve();break;case"left":return this._leftHandler.addWidget(e,n);case"right":return this._rightHandler.addWidget(e,n);default:console.warn(`Cannot add widget to area: ${t}`)}}collapseTop(){this._topWrapper.setHidden(!0),this._spacer_top.setHidden(!0)}expandTop(){this._topWrapper.setHidden(!1),this._spacer_top.setHidden(!1)}*widgets(e){switch(null!=e?e:"main"){case"top":return void(yield*this._topHandler.panel.widgets);case"menu":return void(yield*this._menuHandler.panel.widgets);case"main":return void(yield*this._main.widgets);case"left":return void(yield*this._leftHandler.widgets);case"right":return void(yield*this._rightHandler.widgets);default:return void console.error(`This shell has no area called "${e}"`)}}expandLeft(e){this._leftHandler.panel.show(),this._leftHandler.expand(e)}collapseLeft(){this._leftHandler.collapse(),this._leftHandler.panel.hide()}expandRight(e){this._rightHandler.panel.show(),this._rightHandler.expand(e)}collapseRight(){this._rightHandler.collapse(),this._rightHandler.panel.hide()}}var H,P;!function(e){e.SkipLinkWidgetHandler=class{constructor(e){this._isDisposed=!1;const t=this._skipLinkWidget=new _.Widget,i=document.createElement("a");i.href="#first-cell",i.tabIndex=1,i.text="Skip to Main",i.className="skip-link",i.addEventListener("click",this),t.addClass("jp-skiplink"),t.id="jp-skiplink",t.node.appendChild(i)}handleEvent(e){"click"===e.type&&this._focusMain()}_focusMain(){const e=document.querySelector("#main-panel .jp-InputArea-editor");e.tabIndex=1,e.focus()}get skipLinkWidget(){return this._skipLinkWidget}dispose(){this.isDisposed||(this._isDisposed=!0,this._skipLinkWidget.node.removeEventListener("click",this),this._skipLinkWidget.dispose())}hide(){this._skipLinkWidget.hide()}show(){this._skipLinkWidget.show()}get isDisposed(){return this._isDisposed}}}(H||(H={}));class y extends n.JupyterFrontEnd{constructor(e={shell:new v}){var t,i;if(super({...e,shell:null!==(t=e.shell)&&void 0!==t?t:new v}),this.name="Jupyter Notebook",this.namespace=this.name,this.status=new d.J(this),this.version=null!==(i=o.PageConfig.getOption("appVersion"))&&void 0!==i?i:"unknown",this._formatter=new l.Throttler((()=>{P.setFormat(this)}),250),this.docRegistry.addModelFactory(new r.Base64ModelFactory),e.mimeExtensions)for(const t of(0,a.as)(e.mimeExtensions))this.registerPlugin(t);this.restored=this.shell.restored,this.restored.then((()=>this._formatter.invoke()))}get paths(){return{urls:{base:o.PageConfig.getOption("baseUrl"),notFound:o.PageConfig.getOption("notFoundUrl"),app:o.PageConfig.getOption("appUrl"),static:o.PageConfig.getOption("staticUrl"),settings:o.PageConfig.getOption("settingsUrl"),themes:o.PageConfig.getOption("themesUrl"),doc:o.PageConfig.getOption("docUrl"),translations:o.PageConfig.getOption("translationsApiUrl"),hubHost:o.PageConfig.getOption("hubHost")||void 0,hubPrefix:o.PageConfig.getOption("hubPrefix")||void 0,hubUser:o.PageConfig.getOption("hubUser")||void 0,hubServerName:o.PageConfig.getOption("hubServerName")||void 0},directories:{appSettings:o.PageConfig.getOption("appSettingsDir"),schemas:o.PageConfig.getOption("schemasDir"),static:o.PageConfig.getOption("staticDir"),templates:o.PageConfig.getOption("templatesDir"),themes:o.PageConfig.getOption("themesDir"),userSettings:o.PageConfig.getOption("userSettingsDir"),serverRoot:o.PageConfig.getOption("serverRoot"),workspaces:o.PageConfig.getOption("workspacesDir")}}}handleEvent(e){super.handleEvent(e),"resize"===e.type&&this._formatter.invoke()}registerPluginModule(e){let t=e.default;Object.prototype.hasOwnProperty.call(e,"__esModule")||(t=e),Array.isArray(t)||(t=[t]),t.forEach((e=>{try{this.registerPlugin(e)}catch(e){console.error(e)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}}!function(e){e.setFormat=function(e){e.format=window.matchMedia("only screen and (max-width: 760px)").matches?"mobile":"desktop"}}(P||(P={}))}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2330],{92330:(e,t,i)=>{i.r(t),i.d(t,{INotebookShell:()=>y,NotebookApp:()=>P,NotebookShell:()=>k,PanelHandler:()=>f,Private:()=>v,SidePanelHandler:()=>w,SidePanelPalette:()=>W});var s,n=i(5452),r=i(64846),a=i(75677),d=i(20389),o=i(8630),l=i(70176),h=i(6614),p=i(20882),g=i(49501),u=i(47479),_=i(46947),c=i(5020),m=i(30807);class f{constructor(){this._panelChildHook=(e,t)=>{if("child-removed"===t.type){const e=t.child;p.ArrayExt.removeFirstWhere(this._items,(t=>t.widget===e))}return!0},this._items=new Array,this._panel=new _.Panel,m.MessageLoop.installMessageHook(this._panel,this._panelChildHook)}get panel(){return this._panel}addWidget(e,t){e.parent=null;const i={widget:e,rank:t},n=p.ArrayExt.upperBound(this._items,i,s.itemCmp);p.ArrayExt.insert(this._items,n,i),this._panel.insertWidget(n,e)}}class w extends f{constructor(e){super(),this._isHiddenByUser=!1,this._widgetAdded=new u.Signal(this),this._widgetRemoved=new u.Signal(this),this._area=e,this._panel.hide(),this._currentWidget=null,this._lastCurrentWidget=null,this._widgetPanel=new _.StackedPanel,this._widgetPanel.widgetRemoved.connect(this._onWidgetRemoved,this),this._closeButton=document.createElement("button"),c.closeIcon.element({container:this._closeButton,height:"16px",width:"auto"}),this._closeButton.onclick=()=>{this.collapse(),this.hide()},this._closeButton.className="jp-Button jp-SidePanel-collapse",this._closeButton.title="Collapse side panel";const t=new _.Widget({node:this._closeButton});this._panel.addWidget(t),this._panel.addWidget(this._widgetPanel)}get currentWidget(){return this._currentWidget||this._lastCurrentWidget||(this._items.length>0?this._items[0].widget:null)}get area(){return this._area}get isVisible(){return this._panel.isVisible}get panel(){return this._panel}get widgets(){return this._items.map((e=>e.widget))}get widgetAdded(){return this._widgetAdded}get widgetRemoved(){return this._widgetRemoved}get closeButton(){return this._closeButton}expand(e){if(this._currentWidget&&this.collapse(),e)this.activate(e);else{const e=this.currentWidget;e&&(this._currentWidget=e,this.activate(e.id))}}activate(e){const t=this._findWidgetByID(e);t&&(this._currentWidget=t,t.show(),t.activate())}has(e){return null!==this._findWidgetByID(e)}collapse(){var e;null===(e=this._currentWidget)||void 0===e||e.hide(),this._currentWidget=null}addWidget(e,t){e.parent=null,e.hide();const i={widget:e,rank:t},s=this._findInsertIndex(i);p.ArrayExt.insert(this._items,s,i),this._widgetPanel.insertWidget(s,e),this._refreshVisibility(),this._widgetAdded.emit(e)}hide(){this._isHiddenByUser=!0,this._refreshVisibility()}show(){this._isHiddenByUser=!1,this._refreshVisibility()}_findInsertIndex(e){return p.ArrayExt.upperBound(this._items,e,s.itemCmp)}_findWidgetIndex(e){return p.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e))}_findWidgetByID(e){const t=(0,p.find)(this._items,(t=>t.widget.id===e));return t?t.widget:null}_refreshVisibility(){this._panel.setHidden(this._isHiddenByUser)}_onWidgetRemoved(e,t){t===this._lastCurrentWidget&&(this._lastCurrentWidget=null),p.ArrayExt.removeAt(this._items,this._findWidgetIndex(t)),this._refreshVisibility(),this._widgetRemoved.emit(t)}}class W{constructor(e){this._items=[],this._commandPalette=e.commandPalette,this._command=e.command}getItem(e,t){const i=this._items;for(let s=0;s<i.length;s++){const n=i[s];if(n.widgetId===e.id&&n.area===t)return n}return null}addItem(e,t){if(this.getItem(e,t))return;const i=this._commandPalette.addItem({command:this._command,category:"View",args:{side:t,title:`Show ${e.title.caption}`,id:e.id}});this._items.push({widgetId:e.id,area:t,disposable:i})}removeItem(e,t){const i=this.getItem(e,t);i&&i.disposable.dispose()}}!function(e){e.itemCmp=function(e,t){return e.rank-t.rank}}(s||(s={}));const y=new g.Token("@jupyter-notebook/application:INotebookShell");class k extends _.Widget{constructor(){super(),this._translator=h.nullTranslator,this._currentChanged=new u.Signal(this),this._mainWidgetLoaded=new g.PromiseDelegate,this.id="main",this._userLayout={},this._topHandler=new f,this._menuHandler=new f,this._leftHandler=new w("left"),this._rightHandler=new w("right"),this._main=new _.Panel;const e=this._topWrapper=new _.Panel,t=this._menuWrapper=new _.Panel;this._topHandler.panel.id="top-panel",this._topHandler.panel.node.setAttribute("role","banner"),this._menuHandler.panel.id="menu-panel",this._menuHandler.panel.node.setAttribute("role","navigation"),this._main.id="main-panel",this._main.node.setAttribute("role","main"),this._spacer_top=new _.Widget,this._spacer_top.id="spacer-widget-top",this._spacer_bottom=new _.Widget,this._spacer_bottom.id="spacer-widget-bottom",e.id="top-panel-wrapper",e.addWidget(this._topHandler.panel),t.id="menu-panel-wrapper",t.addWidget(this._menuHandler.panel);const i=new _.BoxLayout,s=this._leftHandler,n=this._rightHandler;s.panel.id="jp-left-stack",s.panel.node.setAttribute("role","complementary"),n.panel.id="jp-right-stack",n.panel.node.setAttribute("role","complementary"),s.hide(),n.hide();const r=new _.BoxLayout({spacing:0,direction:"top-to-bottom"});_.BoxLayout.setStretch(this._topWrapper,0),_.BoxLayout.setStretch(this._menuWrapper,0),_.BoxLayout.setStretch(this._main,1);const a=new _.Panel({layout:r});a.addWidget(this._topWrapper),a.addWidget(this._menuWrapper),a.addWidget(this._spacer_top),a.addWidget(this._main),a.addWidget(this._spacer_bottom),a.layout=r;const d=new _.SplitPanel;d.id="main-split-panel",d.spacing=1,_.BoxLayout.setStretch(d,1),_.SplitPanel.setStretch(s.panel,0),_.SplitPanel.setStretch(n.panel,0),_.SplitPanel.setStretch(a,1),d.addWidget(s.panel),d.addWidget(a),d.addWidget(n.panel),d.setRelativeSizes([1,2.5,1]),i.spacing=0,i.addWidget(d),this.layout=i;const o=this._skipLinkWidgetHandler=new v.SkipLinkWidgetHandler(this);this.add(o.skipLinkWidget,"top",{rank:0}),this._skipLinkWidgetHandler.show()}get currentChanged(){return this._currentChanged}get currentWidget(){var e;return null!==(e=this._main.widgets[0])&&void 0!==e?e:null}get top(){return this._topWrapper}get menu(){return this._menuWrapper}get leftHandler(){return this._leftHandler}get rightHandler(){return this._rightHandler}get leftCollapsed(){return!(this._leftHandler.isVisible&&this._leftHandler.panel.isVisible)}get rightCollapsed(){return!(this._rightHandler.isVisible&&this._rightHandler.panel.isVisible)}get restored(){return this._mainWidgetLoaded.promise}get translator(){var e;return null!==(e=this._translator)&&void 0!==e?e:h.nullTranslator}set translator(e){if(e!==this._translator){this._translator=e;const t=e.load("notebook");this._leftHandler.closeButton.title=t.__("Collapse %1 side panel",this._leftHandler.area),this._rightHandler.closeButton.title=t.__("Collapse %1 side panel",this._rightHandler.area)}}get userLayout(){return g.JSONExt.deepCopy(this._userLayout)}activateById(e){for(const t of["main","top","left","right","menu"]){const i=(0,p.find)(this.widgets(t),(t=>t.id===e));i&&("left"===t?this.expandLeft(e):"right"===t?this.expandRight(e):i.activate())}}add(e,t,i){var s,n;let r;r=(null==i?void 0:i.type)&&this._userLayout[i.type]?this._userLayout[i.type]:this._userLayout[e.id],t=null!==(s=null==r?void 0:r.area)&&void 0!==s?s:t;const a=null!==(n=null==(i=i||(null==r?void 0:r.options)?{...i,...null==r?void 0:r.options}:void 0)?void 0:i.rank)&&void 0!==n?n:900;switch(t){case"top":return this._topHandler.addWidget(e,a);case"menu":return this._menuHandler.addWidget(e,a);case"main":case void 0:if(this._main.widgets.length>0)return;this._main.addWidget(e),this._main.update(),this._currentChanged.emit(void 0),this._mainWidgetLoaded.resolve();break;case"left":return this._leftHandler.addWidget(e,a);case"right":return this._rightHandler.addWidget(e,a);default:console.warn(`Cannot add widget to area: ${t}`)}}collapseTop(){this._topWrapper.setHidden(!0),this._spacer_top.setHidden(!0)}expandTop(){this._topWrapper.setHidden(!1),this._spacer_top.setHidden(!1)}*widgets(e){switch(null!=e?e:"main"){case"top":return void(yield*this._topHandler.panel.widgets);case"menu":return void(yield*this._menuHandler.panel.widgets);case"main":return void(yield*this._main.widgets);case"left":return void(yield*this._leftHandler.widgets);case"right":return void(yield*this._rightHandler.widgets);default:return void console.error(`This shell has no area called "${e}"`)}}expandLeft(e){this._leftHandler.panel.show(),this._leftHandler.expand(e)}collapseLeft(){this._leftHandler.collapse(),this._leftHandler.panel.hide()}expandRight(e){this._rightHandler.panel.show(),this._rightHandler.expand(e)}collapseRight(){this._rightHandler.collapse(),this._rightHandler.panel.hide()}async restoreLayout(e){this._userLayout=e}}var v,H;!function(e){e.SkipLinkWidgetHandler=class{constructor(e){this._isDisposed=!1;const t=this._skipLinkWidget=new _.Widget,i=document.createElement("a");i.href="#first-cell",i.tabIndex=1,i.text="Skip to Main",i.className="skip-link",i.addEventListener("click",this),t.addClass("jp-skiplink"),t.id="jp-skiplink",t.node.appendChild(i)}handleEvent(e){"click"===e.type&&this._focusMain()}_focusMain(){const e=document.querySelector("#main-panel .jp-InputArea-editor");e.tabIndex=1,e.focus()}get skipLinkWidget(){return this._skipLinkWidget}dispose(){this.isDisposed||(this._isDisposed=!0,this._skipLinkWidget.node.removeEventListener("click",this),this._skipLinkWidget.dispose())}hide(){this._skipLinkWidget.hide()}show(){this._skipLinkWidget.show()}get isDisposed(){return this._isDisposed}}}(v||(v={}));class P extends n.JupyterFrontEnd{constructor(e={shell:new k}){var t,i;if(super({...e,shell:null!==(t=e.shell)&&void 0!==t?t:new k}),this.name="Jupyter Notebook",this.namespace=this.name,this.status=new d.J(this),this.version=null!==(i=o.PageConfig.getOption("appVersion"))&&void 0!==i?i:"unknown",this._formatter=new l.Throttler((()=>{H.setFormat(this)}),250),this.docRegistry.addModelFactory(new r.Base64ModelFactory),e.mimeExtensions)for(const t of(0,a.as)(e.mimeExtensions))this.registerPlugin(t);this.restored=this.shell.restored,this.restored.then((()=>this._formatter.invoke()))}get paths(){return{urls:{base:o.PageConfig.getOption("baseUrl"),notFound:o.PageConfig.getOption("notFoundUrl"),app:o.PageConfig.getOption("appUrl"),static:o.PageConfig.getOption("staticUrl"),settings:o.PageConfig.getOption("settingsUrl"),themes:o.PageConfig.getOption("themesUrl"),doc:o.PageConfig.getOption("docUrl"),translations:o.PageConfig.getOption("translationsApiUrl"),hubHost:o.PageConfig.getOption("hubHost")||void 0,hubPrefix:o.PageConfig.getOption("hubPrefix")||void 0,hubUser:o.PageConfig.getOption("hubUser")||void 0,hubServerName:o.PageConfig.getOption("hubServerName")||void 0},directories:{appSettings:o.PageConfig.getOption("appSettingsDir"),schemas:o.PageConfig.getOption("schemasDir"),static:o.PageConfig.getOption("staticDir"),templates:o.PageConfig.getOption("templatesDir"),themes:o.PageConfig.getOption("themesDir"),userSettings:o.PageConfig.getOption("userSettingsDir"),serverRoot:o.PageConfig.getOption("serverRoot"),workspaces:o.PageConfig.getOption("workspacesDir")}}}handleEvent(e){super.handleEvent(e),"resize"===e.type&&this._formatter.invoke()}registerPluginModule(e){let t=e.default;Object.prototype.hasOwnProperty.call(e,"__esModule")||(t=e),Array.isArray(t)||(t=[t]),t.forEach((e=>{try{this.registerPlugin(e)}catch(e){console.error(e)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}}!function(e){e.setFormat=function(e){e.format=window.matchMedia("only screen and (max-width: 760px)").matches?"mobile":"desktop"}}(H||(H={}))}}]);
|
notebook/static/2401.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2401],{43967:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var s,r=n(23899),a=n(49501),i=n(47479);class o{constructor(e){this.trusted=!1,this._changed=new i.Signal(this),this._raw={};const t=s.getData(e.value);this._data=new r.ObservableJSON({values:t}),this._rawData=t;const n=e.value;for(const e in n)"data"===e||(this._raw[e]=s.extract(n,e))}get changed(){return this._changed}dispose(){this._data.dispose(),i.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return{}}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),this._changed.emit(void 0)}toJSON(){const e={};for(const t in this._raw)e[t]=s.extract(this._raw,t);return e}_updateObservable(e,t){const n=e.keys(),s=Object.keys(t);for(const t of n)-1===s.indexOf(t)&&e.delete(t);for(const n of s){const s=e.get(n),r=t[n];s!==r&&e.set(n,r)}}}!function(e){e.getData=function(e){return s.getData(e)}}(o||(o={})),function(e){function t(e){return function(e){const t=Object.create(null);for(const s in e)t[s]=n(e,s);return t}(e)}function n(e,t){const n=e[t];return void 0===n||a.JSONExt.isPrimitive(n)?n:a.JSONExt.deepCopy(n)}e.getData=t,e.getBundleOptions=function(e){return{data:t(e.value)}},e.extract=n}(s||(s={}))},15862:(e,t,n)=>{"use strict";n.d(t,{BJ:()=>d,F:()=>l,Lz:()=>a,Nf:()=>u,hJ:()=>i,nF:()=>c,vy:()=>r,xr:()=>o});var s=n(28182);const r={safe:!0,mimeTypes:["text/html"],defaultRank:50,createRenderer:e=>new s.oI(e)},a={safe:!0,mimeTypes:["image/bmp","image/png","image/jpeg","image/gif","image/webp"],defaultRank:90,createRenderer:e=>new s.UH(e)},i={safe:!0,mimeTypes:["text/latex"],defaultRank:70,createRenderer:e=>new s.FK(e)},o={safe:!0,mimeTypes:["text/markdown"],defaultRank:60,createRenderer:e=>new s.cw(e)},l={safe:!1,mimeTypes:["image/svg+xml"],defaultRank:80,createRenderer:e=>new s.zt(e)},d={safe:!0,mimeTypes:["text/plain","application/vnd.jupyter.stdout","application/vnd.jupyter.stderr"],defaultRank:120,createRenderer:e=>new s.lH(e)},c={safe:!1,mimeTypes:["text/javascript","application/javascript"],defaultRank:110,createRenderer:e=>new s.ND(e)},u=[r,o,i,l,a,c,d]},72401:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AttachmentModel:()=>a.g,ILatexTypesetter:()=>h._y,IMarkdownParser:()=>h.sc,IRenderMimeRegistry:()=>h.ZD,MimeModel:()=>l.a,OutputModel:()=>d.M,RenderMimeRegistry:()=>c.D,RenderedCommon:()=>p.pY,RenderedHTML:()=>p.oI,RenderedHTMLCommon:()=>p.BP,RenderedImage:()=>p.UH,RenderedJavaScript:()=>p.ND,RenderedLatex:()=>p.FK,RenderedMarkdown:()=>p.cw,RenderedSVG:()=>p.zt,RenderedText:()=>p.lH,htmlRendererFactory:()=>i.vy,imageRendererFactory:()=>i.Lz,javaScriptRendererFactory:()=>i.nF,latexRendererFactory:()=>i.hJ,markdownRendererFactory:()=>i.xr,removeMath:()=>o.D,renderHTML:()=>u.NN,renderImage:()=>u.co,renderLatex:()=>u.K3,renderMarkdown:()=>u.ap,renderSVG:()=>u.KB,renderText:()=>u.IY,replaceMath:()=>o.b,standardRendererFactories:()=>i.Nf,svgRendererFactory:()=>i.F,textRendererFactory:()=>i.BJ});var s=n(31874),r={};for(const e in s)"default"!==e&&(r[e]=()=>s[e]);n.d(t,r);var a=n(43967),i=n(15862),o=n(69837),l=n(32021),d=n(4800),c=n(32549),u=n(3328),h=n(2186),p=n(28182)},69837:(e,t,n)=>{"use strict";n.d(t,{D:()=>a,b:()=>i});const s="$",r=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[{}$]|[{}]|(?:\n\s*)+|@@\d+@@|\\\\(?:\(|\)|\[|\]))/i;function a(e){const t=[];let n,a=null,i=null,l=null,d=0;e.includes("`")||e.includes("~~~")?(e=e.replace(/~/g,"~T").replace(/^(?<fence>`{3,}|(~T){3,})[^`\n]*\n([\s\S]*?)^\k<fence>`*$/gm,(e=>e.replace(/\$/g,"~D"))).replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,(e=>e.replace(/\$/g,"~D"))),n=e=>e.replace(/~([TD])/g,((e,t)=>"T"===t?"~":s))):n=e=>e;let c=e.replace(/\r\n?/g,"\n").split(r);for(let e=1,r=c.length;e<r;e+=2){const r=c[e];"@"===r.charAt(0)?(c[e]="@@"+t.length+"@@",t.push(r)):null!==a?r===i?d?l=e:(c=o(a,e,n,t,c),a=null,i=null,l=null):r.match(/\n.*\n/)?(null!==l&&(e=l,c=o(a,e,n,t,c)),a=null,i=null,l=null,d=0):"{"===r?d++:"}"===r&&d&&d--:r===s||"$$"===r?(a=e,i=r,d=0):"\\\\("===r||"\\\\["===r?(a=e,i="("===r.slice(-1)?"\\\\)":"\\\\]",d=0):"begin"===r.substr(1,5)&&(a=e,i="\\end"+r.substr(6),d=0)}return null!==a&&null!==l&&(c=o(a,l,n,t,c),a=null,i=null,l=null),{text:n(c.join("")),math:t}}function i(e,t){return e.replace(/@@(\d+)@@/g,((e,n)=>{let s=t[n];return"\\\\("===s.substr(0,3)&&"\\\\)"===s.substr(s.length-3)?s="\\("+s.substring(3,s.length-3)+"\\)":"\\\\["===s.substr(0,3)&&"\\\\]"===s.substr(s.length-3)&&(s="\\["+s.substring(3,s.length-3)+"\\]"),s}))}function o(e,t,n,s,r){let a=r.slice(e,t+1).join("").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");for(navigator&&"Microsoft Internet Explorer"===navigator.appName&&(a=a.replace(/(%[^\n]*)\n/g,"$1<br/>\n"));t>e;)r[t]="",t--;return r[e]="@@"+s.length+"@@",n&&(a=n(a)),s.push(a),r}},32021:(e,t,n)=>{"use strict";n.d(t,{a:()=>s});class s{constructor(e={}){this.trusted=!!e.trusted,this._data=e.data||{},this._metadata=e.metadata||{},this._callback=e.callback||r.noOp}get data(){return this._data}get metadata(){return this._metadata}setData(e){this._data=e.data||this._data,this._metadata=e.metadata||this._metadata,this._callback(e)}}var r;!function(e){e.noOp=function(){}}(r||(r={}))},4800:(e,t,n)=>{"use strict";n.d(t,{M:()=>l});var s,r=n(90431),a=n(23899),i=n(49501),o=n(47479);class l{constructor(e){this._changed=new o.Signal(this),this._raw={};const{data:t,metadata:n,trusted:i}=s.getBundleOptions(e);this._data=new a.ObservableJSON({values:t}),this._rawData=t,this._metadata=new a.ObservableJSON({values:n}),this._rawMetadata=n,this.trusted=i;const l=e.value;for(const e in l)switch(e){case"data":case"metadata":break;default:this._raw[e]=s.extract(l,e)}this.type=l.output_type,r.isExecuteResult(l)?this.executionCount=l.execution_count:this.executionCount=null}get changed(){return this._changed}dispose(){this._data.dispose(),this._metadata.dispose(),o.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return this._rawMetadata}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),e.metadata&&(this._updateObservable(this._metadata,e.metadata),this._rawMetadata=e.metadata),this._changed.emit()}toJSON(){const e={};for(const t in this._raw)e[t]=s.extract(this._raw,t);switch(this.type){case"display_data":case"execute_result":case"update_display_data":e.data=this.data,e.metadata=this.metadata}return delete e.transient,e}_updateObservable(e,t){const n=e.keys(),s=Object.keys(t);for(const t of n)-1===s.indexOf(t)&&e.delete(t);for(const n of s){const s=e.get(n),r=t[n];s!==r&&e.set(n,r)}}}!function(e){e.getData=function(e){return s.getData(e)},e.getMetadata=function(e){return s.getMetadata(e)}}(l||(l={})),function(e){function t(e){let t={};if(r.isExecuteResult(e)||r.isDisplayData(e)||r.isDisplayUpdate(e))t=e.data;else if(r.isStream(e))"stderr"===e.name?t["application/vnd.jupyter.stderr"]=e.text:t["application/vnd.jupyter.stdout"]=e.text;else if(r.isError(e)){t["application/vnd.jupyter.error"]=e;const n=e.traceback.join("\n");t["application/vnd.jupyter.stderr"]=n||`${e.ename}: ${e.evalue}`}return function(e){const t=Object.create(null);for(const n in e)t[n]=s(e,n);return t}(t)}function n(e){const t=Object.create(null);if(r.isExecuteResult(e)||r.isDisplayData(e))for(const n in e.metadata)t[n]=s(e.metadata,n);return t}function s(e,t){const n=e[t];return void 0===n||i.JSONExt.isPrimitive(n)?n:JSON.parse(JSON.stringify(n))}e.getData=t,e.getMetadata=n,e.getBundleOptions=function(e){return{data:t(e.value),metadata:n(e.value),trusted:!!e.trusted}},e.extract=s}(s||(s={}))},32549:(e,t,n)=>{"use strict";n.d(t,{D:()=>l});var s,r=n(61153),a=n(79452),i=n(80259),o=n(32021);class l{constructor(e={}){var t,n,s,a,o,l;if(this._id=0,this._ranks={},this._types=null,this._factories={},this.translator=null!==(t=e.translator)&&void 0!==t?t:i.nullTranslator,this.resolver=null!==(n=e.resolver)&&void 0!==n?n:null,this.linkHandler=null!==(s=e.linkHandler)&&void 0!==s?s:null,this.latexTypesetter=null!==(a=e.latexTypesetter)&&void 0!==a?a:null,this.markdownParser=null!==(o=e.markdownParser)&&void 0!==o?o:null,this.sanitizer=null!==(l=e.sanitizer)&&void 0!==l?l:new r.Sanitizer,e.initialFactories)for(const t of e.initialFactories)this.addFactory(t)}get mimeTypes(){return this._types||(this._types=s.sortedTypes(this._ranks))}preferredMimeType(e,t="ensure"){if("ensure"===t||"prefer"===t)for(const t of this.mimeTypes)if(t in e&&this._factories[t].safe)return t;if("ensure"!==t)for(const t of this.mimeTypes)if(t in e)return t}createRenderer(e){if(!(e in this._factories))throw new Error(`No factory for mime type: '${e}'`);return this._factories[e].createRenderer({mimeType:e,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}createModel(e={}){return new o.a(e)}clone(e={}){var t,n,s,r,a,i,o,d,c,u;const h=new l({resolver:null!==(n=null!==(t=e.resolver)&&void 0!==t?t:this.resolver)&&void 0!==n?n:void 0,sanitizer:null!==(r=null!==(s=e.sanitizer)&&void 0!==s?s:this.sanitizer)&&void 0!==r?r:void 0,linkHandler:null!==(i=null!==(a=e.linkHandler)&&void 0!==a?a:this.linkHandler)&&void 0!==i?i:void 0,latexTypesetter:null!==(d=null!==(o=e.latexTypesetter)&&void 0!==o?o:this.latexTypesetter)&&void 0!==d?d:void 0,markdownParser:null!==(u=null!==(c=e.markdownParser)&&void 0!==c?c:this.markdownParser)&&void 0!==u?u:void 0,translator:this.translator});return h._factories={...this._factories},h._ranks={...this._ranks},h._id=this._id,h}getFactory(e){return this._factories[e]}addFactory(e,t){void 0===t&&void 0===(t=e.defaultRank)&&(t=100);for(const n of e.mimeTypes)this._factories[n]=e,this._ranks[n]={rank:t,id:this._id++};this._types=null}removeMimeType(e){delete this._factories[e],delete this._ranks[e],this._types=null}getRank(e){const t=this._ranks[e];return t&&t.rank}setRank(e,t){if(!this._ranks[e])return;const n=this._id++;this._ranks[e]={rank:t,id:n},this._types=null}}!function(e){e.UrlResolver=class{constructor(e){this._path=e.path,this._contents=e.contents}get path(){return this._path}set path(e){this._path=e}async resolveUrl(e){if(this.isLocal(e)){const t=encodeURI(a.PathExt.dirname(this.path));e=a.PathExt.resolve(t,e)}return e}async getDownloadUrl(e){return this.isLocal(e)?this._contents.getDownloadUrl(decodeURIComponent(e)):e}isLocal(e){return!this.isMalformed(e)&&(a.URLExt.isLocal(e)||!!this._contents.driveName(decodeURI(e)))}isMalformed(e){try{return decodeURI(e),!1}catch(e){if(e instanceof URIError)return!0;throw e}}}}(l||(l={})),function(e){e.sortedTypes=function(e){return Object.keys(e).sort(((t,n)=>{const s=e[t],r=e[n];return s.rank!==r.rank?s.rank-r.rank:s.id-r.id}))}}(s||(s={}))},3328:(e,t,n)=>{"use strict";n.d(t,{IY:()=>g,K3:()=>u,KB:()=>p,NN:()=>d,ap:()=>h,co:()=>c});var s,r=n(79452),a=n(80259),i=n(8872),o=n.n(i),l=n(69837);function d(e){let{host:t,source:n,trusted:r,sanitizer:i,resolver:o,linkHandler:l,shouldTypeset:d,latexTypesetter:c,translator:u}=e;u=u||a.nullTranslator;const h=null==u?void 0:u.load("jupyterlab");let p,f=n;if(!n)return t.textContent="",Promise.resolve(void 0);if(r||(f=`${n}`,n=i.sanitize(n)),t.innerHTML=n,t.getElementsByTagName("script").length>0)if(r)s.evalInnerHTMLScriptTags(t);else{const e=document.createElement("div"),n=document.createElement("pre");n.textContent=h.__("This HTML output contains inline scripts. Are you sure that you want to run arbitrary Javascript within your JupyterLab session?");const r=document.createElement("button");r.textContent=h.__("Run"),r.onclick=e=>{t.innerHTML=f,s.evalInnerHTMLScriptTags(t),t.firstChild&&t.removeChild(t.firstChild)},e.appendChild(n),e.appendChild(r),t.insertBefore(e,t.firstChild)}return s.handleDefaults(t,o),p=o?s.handleUrls(t,o,l):Promise.resolve(void 0),p.then((()=>{d&&c&&c.typeset(t)}))}function c(e){const{host:t,mimeType:n,source:s,width:r,height:a,needsBackground:i,unconfined:o}=e;t.textContent="";const l=document.createElement("img");return l.src=`data:${n};base64,${s}`,"number"==typeof a&&(l.height=a),"number"==typeof r&&(l.width=r),"light"===i?l.classList.add("jp-needs-light-background"):"dark"===i&&l.classList.add("jp-needs-dark-background"),!0===o&&l.classList.add("jp-mod-unconfined"),t.appendChild(l),Promise.resolve(void 0)}function u(e){const{host:t,source:n,shouldTypeset:s,latexTypesetter:r}=e;return t.textContent=n,s&&r&&r.typeset(t),Promise.resolve(void 0)}async function h(e){const{host:t,source:n,markdownParser:r,...a}=e;if(!n)return void(t.textContent="");let i="";if(r){const e=(0,l.D)(n);i=await r.render(e.text),i=(0,l.b)(i,e.math)}else i=`<pre>${n}</pre>`;await d({host:t,source:i,...a}),s.headerAnchors(t)}function p(e){let{host:t,source:n,trusted:s,unconfined:r}=e;if(!n)return t.textContent="",Promise.resolve(void 0);if(!s)return t.textContent="Cannot display an untrusted SVG. Maybe you need to run the cell?",Promise.resolve(void 0);n.search("<svg[^>]+xmlns=[^>]+svg")<0&&(n=n.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));const a=new Image;return a.src=`data:image/svg+xml,${encodeURIComponent(n)}`,t.appendChild(a),!0===r&&t.classList.add("jp-mod-unconfined"),Promise.resolve()}function f(e,t){var n,s;const r=e.cloneNode();r.textContent=null===(n=e.textContent)||void 0===n?void 0:n.slice(0,t);const a=e.cloneNode();return a.textContent=null===(s=e.textContent)||void 0===s?void 0:s.slice(t),{pre:r,post:a}}function*m(e){var t;let n,s=0;for(let r of e)n=s+((null===(t=r.textContent)||void 0===t?void 0:t.length)||0),yield{node:r,start:s,end:n,isText:r.nodeType===Node.TEXT_NODE},s=n}function g(e){var t,n;const{host:r,sanitizer:a,source:i}=e,o=a.sanitize(s.ansiSpan(i),{allowedTags:["span"]}),l=document.createElement("pre"),d=document.createElement("pre");d.innerHTML=o;const c=d.textContent;if(c){const e=null===(n=null===(t=a.getAutolink)||void 0===t?void 0:t.call(a))||void 0===n||n?function(e){const t="\\u0000-\\u0020\\u007f-\\u009f",n=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|data:|www\\.)[^\\s"+t+'"]{2,}[^\\s'+t+"\"'(){}\\[\\],:;.!?]","ug"),s=[];let r,a=0;for(;null!=(r=n.exec(e));){r.index!==a&&s.push(document.createTextNode(e.slice(a,r.index)));let t=r[0];const n=t.slice(-1),i=-1!==[">","<"].indexOf(n)?t.length-1:t.length,o=document.createElement("a");t=t.slice(0,i),o.href=t.startsWith("www.")?"https://"+t:t,o.rel="noopener",o.target="_blank",o.appendChild(document.createTextNode(t.slice(0,i))),s.push(o),a=r.index+i}return a!==e.length&&s.push(document.createTextNode(e.slice(a,e.length))),s}(c):[document.createTextNode(o)];let s=!1;const r=[],i=Array.from(d.childNodes);for(let t of function*(e,t){var n,s;let r=m(e),a=m(t),i=r.next(),o=a.next();for(;!i.done&&!o.done;){let e=i.value,t=o.value;if(e.isText&&e.start<=t.start&&e.end>=t.end)yield[null,t.node],o=a.next();else if(t.isText&&t.start<=e.start&&t.end>=e.end)yield[e.node,null],i=r.next();else if(e.end===t.end&&e.start===t.start)yield[e.node,t.node],i=r.next(),o=a.next();else if(e.end>t.end){let{pre:s,post:r}=f(e.node,t.end-e.start);t.start<e.start&&(t.node.textContent=null===(n=t.node.textContent)||void 0===n?void 0:n.slice(e.start-t.start)),yield[s,t.node],e.node=r,e.start=t.end,o=a.next()}else{if(!(t.end>e.end))throw new Error(`Unexpected intersection: ${JSON.stringify(e)} ${JSON.stringify(t)}`);{let{pre:n,post:a}=f(t.node,e.end-t.start);e.start<t.start&&(e.node.textContent=null===(s=e.node.textContent)||void 0===s?void 0:s.slice(t.start-e.start)),yield[e.node,n],t.node=a,t.start=e.end,i=r.next()}}}}(i,e)){if(!t[0]){r.push(t[1]),s=t[1].nodeType!==Node.TEXT_NODE;continue}if(!t[1]){r.push(t[0]),s=!1;continue}let[e,n]=t;const a=r[r.length-1];s&&n.href===a.href?a.appendChild(e):n.nodeType!==Node.TEXT_NODE?(n.textContent="",n.appendChild(e),r.push(n),s=!0):(r.push(e),s=!1)}for(const e of r)l.appendChild(e)}return r.appendChild(l),Promise.resolve(void 0)}!function(e){e.createHeaderId=function(e){var t;return(null!==(t=e.textContent)&&void 0!==t?t:"").replace(/ /g,"-")}}(h||(h={})),function(e){async function t(e,t,n){const s=e.getAttribute(t)||"",a=n.isLocal?n.isLocal(s):r.URLExt.isLocal(s);if(s&&a)try{const a=await n.resolveUrl(s);let i=await n.getDownloadUrl(a);"data:"!==r.URLExt.parse(i).protocol&&(i+=(/\?/.test(i)?"&":"?")+(new Date).getTime()),e.setAttribute(t,i)}catch(n){throw e.setAttribute(t,""),n}}function n(e,t,n){let s=e.getAttribute("href")||"";const a=t.isLocal?t.isLocal(s):r.URLExt.isLocal(s);if(!s||!a)return Promise.resolve(void 0);const i=e.hash;if(i){if(i===s)return e.target="_self",Promise.resolve(void 0);s=s.replace(i,"")}return t.resolveUrl(s).then((s=>{const r=decodeURIComponent(s);return n&&n.handleLink(e,r,i),t.getDownloadUrl(s)})).then((t=>{e.href=t+i})).catch((t=>{e.href=""}))}e.evalInnerHTMLScriptTags=function(e){const t=Array.from(e.getElementsByTagName("script"));for(const e of t){if(!e.parentNode)continue;const t=document.createElement("script"),n=e.attributes;for(let e=0,s=n.length;e<s;++e){const{name:s,value:r}=n[e];t.setAttribute(s,r)}t.textContent=e.textContent,e.parentNode.replaceChild(t,e)}},e.handleDefaults=function(e,t){const n=e.getElementsByTagName("a");for(let e=0;e<n.length;e++){const s=n[e];if(!(s instanceof HTMLAnchorElement))continue;const a=s.href,i=t&&t.isLocal?t.isLocal(a):r.URLExt.isLocal(a);s.target||(s.target=i?"_self":"_blank"),i||(s.rel="noopener")}const s=e.getElementsByTagName("img");for(let e=0;e<s.length;e++)s[e].alt||(s[e].alt="Image")},e.handleUrls=function(e,s,r){const a=[],i=e.querySelectorAll("*[src]");for(let e=0;e<i.length;e++)a.push(t(i[e],"src",s));const o=e.getElementsByTagName("a");for(let e=0;e<o.length;e++)a.push(n(o[e],s,r));const l=e.getElementsByTagName("link");for(let e=0;e<l.length;e++)a.push(t(l[e],"href",s));return Promise.all(a).then((()=>{}))},e.headerAnchors=function(e){const t=["h1","h2","h3","h4","h5","h6"];for(const n of t){const t=e.getElementsByTagName(n);for(let e=0;e<t.length;e++){const n=t[e];n.id=h.createHeaderId(n);const s=document.createElement("a");s.target="_self",s.textContent="¶",s.href="#"+n.id,s.classList.add("jp-InternalAnchorLink"),n.appendChild(s)}}};const s=["ansi-black","ansi-red","ansi-green","ansi-yellow","ansi-blue","ansi-magenta","ansi-cyan","ansi-white","ansi-black-intense","ansi-red-intense","ansi-green-intense","ansi-yellow-intense","ansi-blue-intense","ansi-magenta-intense","ansi-cyan-intense","ansi-white-intense"];function a(e,t,n,r,a,i,o){if(e){const l=[],d=[];r&&"number"==typeof t&&0<=t&&t<8&&(t+=8),i&&([t,n]=[n,t]),"number"==typeof t?l.push(s[t]+"-fg"):t.length?d.push(`color: rgb(${t})`):i&&l.push("ansi-default-inverse-fg"),"number"==typeof n?l.push(s[n]+"-bg"):n.length?d.push(`background-color: rgb(${n})`):i&&l.push("ansi-default-inverse-bg"),r&&l.push("ansi-bold"),a&&l.push("ansi-underline"),l.length||d.length?(o.push("<span"),l.length&&o.push(` class="${l.join(" ")}"`),d.length&&o.push(` style="${d.join("; ")}"`),o.push(">"),o.push(e),o.push("</span>")):o.push(e)}}function i(e){let t,n,s;const r=e.shift();if(2===r&&e.length>=3){if(t=e.shift(),n=e.shift(),s=e.shift(),[t,n,s].some((e=>e<0||255<e)))throw new RangeError("Invalid range for RGB colors")}else{if(!(5===r&&e.length>=1))throw new RangeError("Invalid extended color specification");{const r=e.shift();if(r<0)throw new RangeError("Color index must be >= 0");if(r<16)return r;if(r<232)t=Math.floor((r-16)/36),t=t>0?55+40*t:0,n=Math.floor((r-16)%36/6),n=n>0?55+40*n:0,s=(r-16)%6,s=s>0?55+40*s:0;else{if(!(r<256))throw new RangeError("Color index must be < 256");t=n=s=10*(r-232)+8}}}return[t,n,s]}e.ansiSpan=function(e){const t=/\x1b\[(.*?)([@-~])/g;let n,s=[],r=[],l=!1,d=!1,c=!1;const u=[],h=[];let p=0;for(e=o()(e),e+="[m";n=t.exec(e);){if("m"===n[2]){const e=n[1].split(";");for(let t=0;t<e.length;t++){const n=e[t];if(""===n)h.push(0);else{if(-1===n.search(/^\d+$/)){h.length=0;break}h.push(parseInt(n,10))}}}for(a(e.substring(p,n.index),s,r,l,d,c,u),p=t.lastIndex;h.length;){const e=h.shift();switch(e){case 0:s=r=[],l=!1,d=!1,c=!1;break;case 1:case 5:l=!0;break;case 4:d=!0;break;case 7:c=!0;break;case 21:case 22:l=!1;break;case 24:d=!1;break;case 27:c=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:s=e-30;break;case 38:try{s=i(h)}catch(e){h.length=0}break;case 39:s=[];break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:r=e-40;break;case 48:try{r=i(h)}catch(e){h.length=0}break;case 49:r=[];break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:s=e-90+8;break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:r=e-100+8}}}return u.join("")}}(s||(s={}))},2186:(e,t,n)=>{"use strict";n.d(t,{ZD:()=>r,_y:()=>a,sc:()=>i});var s=n(49501);const r=new s.Token("@jupyterlab/rendermime:IRenderMimeRegistry",'A service for the rendermime registry for the application. Use this to create renderers for various mime-types in your extension. Many times it will be easier to create a "mime renderer extension" rather than using this service directly.'),a=new s.Token("@jupyterlab/rendermime:ILatexTypesetter","A service for the LaTeX typesetter for the application. Use this if you want to typeset math in your extension."),i=new s.Token("@jupyterlab/rendermime:IMarkdownParser","A service for rendering markdown syntax as HTML content.")},28182:(e,t,n)=>{"use strict";n.d(t,{BP:()=>o,FK:()=>d,ND:()=>f,UH:()=>c,cw:()=>u,lH:()=>p,oI:()=>l,pY:()=>i,zt:()=>h});var s=n(80259),r=n(46947),a=n(3328);class i extends r.Widget{constructor(e){var t,n;super(),this.mimeType=e.mimeType,this.sanitizer=e.sanitizer,this.resolver=e.resolver,this.linkHandler=e.linkHandler,this.translator=null!==(t=e.translator)&&void 0!==t?t:s.nullTranslator,this.latexTypesetter=e.latexTypesetter,this.markdownParser=null!==(n=e.markdownParser)&&void 0!==n?n:null,this.node.dataset.mimeType=this.mimeType}async renderModel(e,t){if(!t)for(;this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.toggleClass("jp-mod-trusted",e.trusted),await this.render(e);const{fragment:n}=e.metadata;n&&this.setFragment(n)}setFragment(e){}}class o extends i{constructor(e){super(e),this.addClass("jp-RenderedHTMLCommon")}setFragment(e){let t;try{t=this.node.querySelector(e.startsWith("#")?`#${CSS.escape(e.slice(1))}`:e)}catch(e){console.warn("Unable to set URI fragment identifier.",e)}t&&t.scrollIntoView()}}class l extends o{constructor(e){super(e),this.addClass("jp-RenderedHTML")}render(e){return a.NN({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,translator:this.translator})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class d extends i{constructor(e){super(e),this.addClass("jp-RenderedLatex")}render(e){return a.K3({host:this.node,source:String(e.data[this.mimeType]),shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class c extends i{constructor(e){super(e),this.addClass("jp-RenderedImage")}render(e){const t=e.metadata[this.mimeType];return a.co({host:this.node,mimeType:this.mimeType,source:String(e.data[this.mimeType]),width:t&&t.width,height:t&&t.height,needsBackground:e.metadata.needs_background,unconfined:t&&t.unconfined})}}class u extends o{constructor(e){super(e),this.addClass("jp-RenderedMarkdown")}render(e){return a.ap({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}async renderModel(e){await super.renderModel(e,!0)}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class h extends i{constructor(e){super(e),this.addClass("jp-RenderedSVG")}render(e){const t=e.metadata[this.mimeType];return a.KB({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,unconfined:t&&t.unconfined,translator:this.translator})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class p extends i{constructor(e){super(e),this.addClass("jp-RenderedText")}render(e){return a.IY({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),translator:this.translator})}}class f extends i{constructor(e){super(e),this.addClass("jp-RenderedJavaScript")}render(e){const t=this.translator.load("jupyterlab");return a.IY({host:this.node,sanitizer:this.sanitizer,source:t.__("JavaScript output is disabled in JupyterLab"),translator:this.translator})}}},8872:(e,t,n)=>{var s,r=/[&<>"'`]/g,a=RegExp(r.source),i="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,o="object"==typeof self&&self&&self.Object===Object&&self,l=i||o||Function("return this")(),d=(s={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},function(e){return null==s?void 0:s[e]}),c=Object.prototype.toString,u=l.Symbol,h=u?u.prototype:void 0,p=h?h.toString:void 0;e.exports=function(e){var t;return(e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==c.call(e)}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t))&&a.test(e)?e.replace(r,d):e}}}]);
|
|
1
|
+
(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2401],{43967:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var s,r=n(24974),a=n(49501),i=n(47479);class o{constructor(e){this.trusted=!1,this._changed=new i.Signal(this),this._raw={};const t=s.getData(e.value);this._data=new r.ObservableJSON({values:t}),this._rawData=t;const n=e.value;for(const e in n)"data"===e||(this._raw[e]=s.extract(n,e))}get changed(){return this._changed}dispose(){this._data.dispose(),i.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return{}}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),this._changed.emit(void 0)}toJSON(){const e={};for(const t in this._raw)e[t]=s.extract(this._raw,t);return e}_updateObservable(e,t){const n=e.keys(),s=Object.keys(t);for(const t of n)-1===s.indexOf(t)&&e.delete(t);for(const n of s){const s=e.get(n),r=t[n];s!==r&&e.set(n,r)}}}!function(e){e.getData=function(e){return s.getData(e)}}(o||(o={})),function(e){function t(e){return function(e){const t=Object.create(null);for(const s in e)t[s]=n(e,s);return t}(e)}function n(e,t){const n=e[t];return void 0===n||a.JSONExt.isPrimitive(n)?n:a.JSONExt.deepCopy(n)}e.getData=t,e.getBundleOptions=function(e){return{data:t(e.value)}},e.extract=n}(s||(s={}))},15862:(e,t,n)=>{"use strict";n.d(t,{BJ:()=>d,F:()=>l,Lz:()=>a,Nf:()=>u,hJ:()=>i,nF:()=>c,vy:()=>r,xr:()=>o});var s=n(28182);const r={safe:!0,mimeTypes:["text/html"],defaultRank:50,createRenderer:e=>new s.oI(e)},a={safe:!0,mimeTypes:["image/bmp","image/png","image/jpeg","image/gif","image/webp"],defaultRank:90,createRenderer:e=>new s.UH(e)},i={safe:!0,mimeTypes:["text/latex"],defaultRank:70,createRenderer:e=>new s.FK(e)},o={safe:!0,mimeTypes:["text/markdown"],defaultRank:60,createRenderer:e=>new s.cw(e)},l={safe:!1,mimeTypes:["image/svg+xml"],defaultRank:80,createRenderer:e=>new s.zt(e)},d={safe:!0,mimeTypes:["text/plain","application/vnd.jupyter.stdout","application/vnd.jupyter.stderr"],defaultRank:120,createRenderer:e=>new s.lH(e)},c={safe:!1,mimeTypes:["text/javascript","application/javascript"],defaultRank:110,createRenderer:e=>new s.ND(e)},u=[r,o,i,l,a,c,d]},72401:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AttachmentModel:()=>a.g,ILatexTypesetter:()=>h._y,IMarkdownParser:()=>h.sc,IRenderMimeRegistry:()=>h.ZD,MimeModel:()=>l.a,OutputModel:()=>d.M,RenderMimeRegistry:()=>c.D,RenderedCommon:()=>p.pY,RenderedHTML:()=>p.oI,RenderedHTMLCommon:()=>p.BP,RenderedImage:()=>p.UH,RenderedJavaScript:()=>p.ND,RenderedLatex:()=>p.FK,RenderedMarkdown:()=>p.cw,RenderedSVG:()=>p.zt,RenderedText:()=>p.lH,htmlRendererFactory:()=>i.vy,imageRendererFactory:()=>i.Lz,javaScriptRendererFactory:()=>i.nF,latexRendererFactory:()=>i.hJ,markdownRendererFactory:()=>i.xr,removeMath:()=>o.D,renderHTML:()=>u.NN,renderImage:()=>u.co,renderLatex:()=>u.K3,renderMarkdown:()=>u.ap,renderSVG:()=>u.KB,renderText:()=>u.IY,replaceMath:()=>o.b,standardRendererFactories:()=>i.Nf,svgRendererFactory:()=>i.F,textRendererFactory:()=>i.BJ});var s=n(67702),r={};for(const e in s)"default"!==e&&(r[e]=()=>s[e]);n.d(t,r);var a=n(43967),i=n(15862),o=n(69837),l=n(32021),d=n(4800),c=n(32549),u=n(3328),h=n(2186),p=n(28182)},69837:(e,t,n)=>{"use strict";n.d(t,{D:()=>a,b:()=>i});const s="$",r=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[{}$]|[{}]|(?:\n\s*)+|@@\d+@@|\\\\(?:\(|\)|\[|\]))/i;function a(e){const t=[];let n,a=null,i=null,l=null,d=0;e.includes("`")||e.includes("~~~")?(e=e.replace(/~/g,"~T").replace(/^(?<fence>`{3,}|(~T){3,})[^`\n]*\n([\s\S]*?)^\k<fence>`*$/gm,(e=>e.replace(/\$/g,"~D"))).replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,(e=>e.replace(/\$/g,"~D"))),n=e=>e.replace(/~([TD])/g,((e,t)=>"T"===t?"~":s))):n=e=>e;let c=e.replace(/\r\n?/g,"\n").split(r);for(let e=1,r=c.length;e<r;e+=2){const r=c[e];"@"===r.charAt(0)?(c[e]="@@"+t.length+"@@",t.push(r)):null!==a?r===i?d?l=e:(c=o(a,e,n,t,c),a=null,i=null,l=null):r.match(/\n.*\n/)?(null!==l&&(e=l,c=o(a,e,n,t,c)),a=null,i=null,l=null,d=0):"{"===r?d++:"}"===r&&d&&d--:r===s||"$$"===r?(a=e,i=r,d=0):"\\\\("===r||"\\\\["===r?(a=e,i="("===r.slice(-1)?"\\\\)":"\\\\]",d=0):"begin"===r.substr(1,5)&&(a=e,i="\\end"+r.substr(6),d=0)}return null!==a&&null!==l&&(c=o(a,l,n,t,c),a=null,i=null,l=null),{text:n(c.join("")),math:t}}function i(e,t){return e.replace(/@@(\d+)@@/g,((e,n)=>{let s=t[n];return"\\\\("===s.substr(0,3)&&"\\\\)"===s.substr(s.length-3)?s="\\("+s.substring(3,s.length-3)+"\\)":"\\\\["===s.substr(0,3)&&"\\\\]"===s.substr(s.length-3)&&(s="\\["+s.substring(3,s.length-3)+"\\]"),s}))}function o(e,t,n,s,r){let a=r.slice(e,t+1).join("").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");for(navigator&&"Microsoft Internet Explorer"===navigator.appName&&(a=a.replace(/(%[^\n]*)\n/g,"$1<br/>\n"));t>e;)r[t]="",t--;return r[e]="@@"+s.length+"@@",n&&(a=n(a)),s.push(a),r}},32021:(e,t,n)=>{"use strict";n.d(t,{a:()=>s});class s{constructor(e={}){this.trusted=!!e.trusted,this._data=e.data||{},this._metadata=e.metadata||{},this._callback=e.callback||r.noOp}get data(){return this._data}get metadata(){return this._metadata}setData(e){this._data=e.data||this._data,this._metadata=e.metadata||this._metadata,this._callback(e)}}var r;!function(e){e.noOp=function(){}}(r||(r={}))},4800:(e,t,n)=>{"use strict";n.d(t,{M:()=>l});var s,r=n(48971),a=n(24974),i=n(49501),o=n(47479);class l{constructor(e){this._changed=new o.Signal(this),this._raw={};const{data:t,metadata:n,trusted:i}=s.getBundleOptions(e);this._data=new a.ObservableJSON({values:t}),this._rawData=t,this._metadata=new a.ObservableJSON({values:n}),this._rawMetadata=n,this.trusted=i;const l=e.value;for(const e in l)switch(e){case"data":case"metadata":break;default:this._raw[e]=s.extract(l,e)}this.type=l.output_type,r.isExecuteResult(l)?this.executionCount=l.execution_count:this.executionCount=null}get changed(){return this._changed}dispose(){this._data.dispose(),this._metadata.dispose(),o.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return this._rawMetadata}setData(e){e.data&&(this._updateObservable(this._data,e.data),this._rawData=e.data),e.metadata&&(this._updateObservable(this._metadata,e.metadata),this._rawMetadata=e.metadata),this._changed.emit()}toJSON(){const e={};for(const t in this._raw)e[t]=s.extract(this._raw,t);switch(this.type){case"display_data":case"execute_result":case"update_display_data":e.data=this.data,e.metadata=this.metadata}return delete e.transient,e}_updateObservable(e,t){const n=e.keys(),s=Object.keys(t);for(const t of n)-1===s.indexOf(t)&&e.delete(t);for(const n of s){const s=e.get(n),r=t[n];s!==r&&e.set(n,r)}}}!function(e){e.getData=function(e){return s.getData(e)},e.getMetadata=function(e){return s.getMetadata(e)}}(l||(l={})),function(e){function t(e){let t={};if(r.isExecuteResult(e)||r.isDisplayData(e)||r.isDisplayUpdate(e))t=e.data;else if(r.isStream(e))"stderr"===e.name?t["application/vnd.jupyter.stderr"]=e.text:t["application/vnd.jupyter.stdout"]=e.text;else if(r.isError(e)){t["application/vnd.jupyter.error"]=e;const n=e.traceback.join("\n");t["application/vnd.jupyter.stderr"]=n||`${e.ename}: ${e.evalue}`}return function(e){const t=Object.create(null);for(const n in e)t[n]=s(e,n);return t}(t)}function n(e){const t=Object.create(null);if(r.isExecuteResult(e)||r.isDisplayData(e))for(const n in e.metadata)t[n]=s(e.metadata,n);return t}function s(e,t){const n=e[t];return void 0===n||i.JSONExt.isPrimitive(n)?n:JSON.parse(JSON.stringify(n))}e.getData=t,e.getMetadata=n,e.getBundleOptions=function(e){return{data:t(e.value),metadata:n(e.value),trusted:!!e.trusted}},e.extract=s}(s||(s={}))},32549:(e,t,n)=>{"use strict";n.d(t,{D:()=>l});var s,r=n(25314),a=n(8630),i=n(6614),o=n(32021);class l{constructor(e={}){var t,n,s,a,o,l;if(this._id=0,this._ranks={},this._types=null,this._factories={},this.translator=null!==(t=e.translator)&&void 0!==t?t:i.nullTranslator,this.resolver=null!==(n=e.resolver)&&void 0!==n?n:null,this.linkHandler=null!==(s=e.linkHandler)&&void 0!==s?s:null,this.latexTypesetter=null!==(a=e.latexTypesetter)&&void 0!==a?a:null,this.markdownParser=null!==(o=e.markdownParser)&&void 0!==o?o:null,this.sanitizer=null!==(l=e.sanitizer)&&void 0!==l?l:new r.Sanitizer,e.initialFactories)for(const t of e.initialFactories)this.addFactory(t)}get mimeTypes(){return this._types||(this._types=s.sortedTypes(this._ranks))}preferredMimeType(e,t="ensure"){if("ensure"===t||"prefer"===t)for(const t of this.mimeTypes)if(t in e&&this._factories[t].safe)return t;if("ensure"!==t)for(const t of this.mimeTypes)if(t in e)return t}createRenderer(e){if(!(e in this._factories))throw new Error(`No factory for mime type: '${e}'`);return this._factories[e].createRenderer({mimeType:e,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}createModel(e={}){return new o.a(e)}clone(e={}){var t,n,s,r,a,i,o,d,c,u;const h=new l({resolver:null!==(n=null!==(t=e.resolver)&&void 0!==t?t:this.resolver)&&void 0!==n?n:void 0,sanitizer:null!==(r=null!==(s=e.sanitizer)&&void 0!==s?s:this.sanitizer)&&void 0!==r?r:void 0,linkHandler:null!==(i=null!==(a=e.linkHandler)&&void 0!==a?a:this.linkHandler)&&void 0!==i?i:void 0,latexTypesetter:null!==(d=null!==(o=e.latexTypesetter)&&void 0!==o?o:this.latexTypesetter)&&void 0!==d?d:void 0,markdownParser:null!==(u=null!==(c=e.markdownParser)&&void 0!==c?c:this.markdownParser)&&void 0!==u?u:void 0,translator:this.translator});return h._factories={...this._factories},h._ranks={...this._ranks},h._id=this._id,h}getFactory(e){return this._factories[e]}addFactory(e,t){void 0===t&&void 0===(t=e.defaultRank)&&(t=100);for(const n of e.mimeTypes)this._factories[n]=e,this._ranks[n]={rank:t,id:this._id++};this._types=null}removeMimeType(e){delete this._factories[e],delete this._ranks[e],this._types=null}getRank(e){const t=this._ranks[e];return t&&t.rank}setRank(e,t){if(!this._ranks[e])return;const n=this._id++;this._ranks[e]={rank:t,id:n},this._types=null}}!function(e){e.UrlResolver=class{constructor(e){this._path=e.path,this._contents=e.contents}get path(){return this._path}set path(e){this._path=e}async resolveUrl(e){if(this.isLocal(e)){const t=encodeURI(a.PathExt.dirname(this.path));e=a.PathExt.resolve(t,e)}return e}async getDownloadUrl(e){return this.isLocal(e)?this._contents.getDownloadUrl(decodeURIComponent(e)):e}isLocal(e){return!this.isMalformed(e)&&(a.URLExt.isLocal(e)||!!this._contents.driveName(decodeURI(e)))}isMalformed(e){try{return decodeURI(e),!1}catch(e){if(e instanceof URIError)return!0;throw e}}}}(l||(l={})),function(e){e.sortedTypes=function(e){return Object.keys(e).sort(((t,n)=>{const s=e[t],r=e[n];return s.rank!==r.rank?s.rank-r.rank:s.id-r.id}))}}(s||(s={}))},3328:(e,t,n)=>{"use strict";n.d(t,{IY:()=>g,K3:()=>u,KB:()=>p,NN:()=>d,ap:()=>h,co:()=>c});var s,r=n(8630),a=n(6614),i=n(8872),o=n.n(i),l=n(69837);function d(e){let{host:t,source:n,trusted:r,sanitizer:i,resolver:o,linkHandler:l,shouldTypeset:d,latexTypesetter:c,translator:u}=e;u=u||a.nullTranslator;const h=null==u?void 0:u.load("jupyterlab");let p,f=n;if(!n)return t.textContent="",Promise.resolve(void 0);if(r||(f=`${n}`,n=i.sanitize(n)),t.innerHTML=n,t.getElementsByTagName("script").length>0)if(r)s.evalInnerHTMLScriptTags(t);else{const e=document.createElement("div"),n=document.createElement("pre");n.textContent=h.__("This HTML output contains inline scripts. Are you sure that you want to run arbitrary Javascript within your JupyterLab session?");const r=document.createElement("button");r.textContent=h.__("Run"),r.onclick=e=>{t.innerHTML=f,s.evalInnerHTMLScriptTags(t),t.firstChild&&t.removeChild(t.firstChild)},e.appendChild(n),e.appendChild(r),t.insertBefore(e,t.firstChild)}return s.handleDefaults(t,o),p=o?s.handleUrls(t,o,l):Promise.resolve(void 0),p.then((()=>{d&&c&&c.typeset(t)}))}function c(e){const{host:t,mimeType:n,source:s,width:r,height:a,needsBackground:i,unconfined:o}=e;t.textContent="";const l=document.createElement("img");return l.src=`data:${n};base64,${s}`,"number"==typeof a&&(l.height=a),"number"==typeof r&&(l.width=r),"light"===i?l.classList.add("jp-needs-light-background"):"dark"===i&&l.classList.add("jp-needs-dark-background"),!0===o&&l.classList.add("jp-mod-unconfined"),t.appendChild(l),Promise.resolve(void 0)}function u(e){const{host:t,source:n,shouldTypeset:s,latexTypesetter:r}=e;return t.textContent=n,s&&r&&r.typeset(t),Promise.resolve(void 0)}async function h(e){const{host:t,source:n,markdownParser:r,...a}=e;if(!n)return void(t.textContent="");let i="";if(r){const e=(0,l.D)(n);i=await r.render(e.text),i=(0,l.b)(i,e.math)}else i=`<pre>${n}</pre>`;await d({host:t,source:i,...a}),s.headerAnchors(t)}function p(e){let{host:t,source:n,trusted:s,unconfined:r}=e;if(!n)return t.textContent="",Promise.resolve(void 0);if(!s)return t.textContent="Cannot display an untrusted SVG. Maybe you need to run the cell?",Promise.resolve(void 0);n.search("<svg[^>]+xmlns=[^>]+svg")<0&&(n=n.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));const a=new Image;return a.src=`data:image/svg+xml,${encodeURIComponent(n)}`,t.appendChild(a),!0===r&&t.classList.add("jp-mod-unconfined"),Promise.resolve()}function f(e,t){var n,s;const r=e.cloneNode();r.textContent=null===(n=e.textContent)||void 0===n?void 0:n.slice(0,t);const a=e.cloneNode();return a.textContent=null===(s=e.textContent)||void 0===s?void 0:s.slice(t),{pre:r,post:a}}function*m(e){var t;let n,s=0;for(let r of e)n=s+((null===(t=r.textContent)||void 0===t?void 0:t.length)||0),yield{node:r,start:s,end:n,isText:r.nodeType===Node.TEXT_NODE},s=n}function g(e){var t,n;const{host:r,sanitizer:a,source:i}=e,o=a.sanitize(s.ansiSpan(i),{allowedTags:["span"]}),l=document.createElement("pre"),d=document.createElement("pre");d.innerHTML=o;const c=d.textContent;if(c){const e=null===(n=null===(t=a.getAutolink)||void 0===t?void 0:t.call(a))||void 0===n||n?function(e){const t="\\u0000-\\u0020\\u007f-\\u009f",n=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|data:|www\\.)[^\\s"+t+'"]{2,}[^\\s'+t+"\"'(){}\\[\\],:;.!?]","ug"),s=[];let r,a=0;for(;null!=(r=n.exec(e));){r.index!==a&&s.push(document.createTextNode(e.slice(a,r.index)));let t=r[0];const n=t.slice(-1),i=-1!==[">","<"].indexOf(n)?t.length-1:t.length,o=document.createElement("a");t=t.slice(0,i),o.href=t.startsWith("www.")?"https://"+t:t,o.rel="noopener",o.target="_blank",o.appendChild(document.createTextNode(t.slice(0,i))),s.push(o),a=r.index+i}return a!==e.length&&s.push(document.createTextNode(e.slice(a,e.length))),s}(c):[document.createTextNode(o)];let s=!1;const r=[],i=Array.from(d.childNodes);for(let t of function*(e,t){var n,s;let r=m(e),a=m(t),i=r.next(),o=a.next();for(;!i.done&&!o.done;){let e=i.value,t=o.value;if(e.isText&&e.start<=t.start&&e.end>=t.end)yield[null,t.node],o=a.next();else if(t.isText&&t.start<=e.start&&t.end>=e.end)yield[e.node,null],i=r.next();else if(e.end===t.end&&e.start===t.start)yield[e.node,t.node],i=r.next(),o=a.next();else if(e.end>t.end){let{pre:s,post:r}=f(e.node,t.end-e.start);t.start<e.start&&(t.node.textContent=null===(n=t.node.textContent)||void 0===n?void 0:n.slice(e.start-t.start)),yield[s,t.node],e.node=r,e.start=t.end,o=a.next()}else{if(!(t.end>e.end))throw new Error(`Unexpected intersection: ${JSON.stringify(e)} ${JSON.stringify(t)}`);{let{pre:n,post:a}=f(t.node,e.end-t.start);e.start<t.start&&(e.node.textContent=null===(s=e.node.textContent)||void 0===s?void 0:s.slice(t.start-e.start)),yield[e.node,n],t.node=a,t.start=e.end,i=r.next()}}}}(i,e)){if(!t[0]){r.push(t[1]),s=t[1].nodeType!==Node.TEXT_NODE;continue}if(!t[1]){r.push(t[0]),s=!1;continue}let[e,n]=t;const a=r[r.length-1];s&&n.href===a.href?a.appendChild(e):n.nodeType!==Node.TEXT_NODE?(n.textContent="",n.appendChild(e),r.push(n),s=!0):(r.push(e),s=!1)}for(const e of r)l.appendChild(e)}return r.appendChild(l),Promise.resolve(void 0)}!function(e){e.createHeaderId=function(e){var t;return(null!==(t=e.textContent)&&void 0!==t?t:"").replace(/ /g,"-")}}(h||(h={})),function(e){async function t(e,t,n){const s=e.getAttribute(t)||"",a=n.isLocal?n.isLocal(s):r.URLExt.isLocal(s);if(s&&a)try{const a=await n.resolveUrl(s);let i=await n.getDownloadUrl(a);"data:"!==r.URLExt.parse(i).protocol&&(i+=(/\?/.test(i)?"&":"?")+(new Date).getTime()),e.setAttribute(t,i)}catch(n){throw e.setAttribute(t,""),n}}function n(e,t,n){let s=e.getAttribute("href")||"";const a=t.isLocal?t.isLocal(s):r.URLExt.isLocal(s);if(!s||!a)return Promise.resolve(void 0);const i=e.hash;if(i){if(i===s)return e.target="_self",Promise.resolve(void 0);s=s.replace(i,"")}return t.resolveUrl(s).then((s=>{const r=decodeURIComponent(s);return n&&n.handleLink(e,r,i),t.getDownloadUrl(s)})).then((t=>{e.href=t+i})).catch((t=>{e.href=""}))}e.evalInnerHTMLScriptTags=function(e){const t=Array.from(e.getElementsByTagName("script"));for(const e of t){if(!e.parentNode)continue;const t=document.createElement("script"),n=e.attributes;for(let e=0,s=n.length;e<s;++e){const{name:s,value:r}=n[e];t.setAttribute(s,r)}t.textContent=e.textContent,e.parentNode.replaceChild(t,e)}},e.handleDefaults=function(e,t){const n=e.getElementsByTagName("a");for(let e=0;e<n.length;e++){const s=n[e];if(!(s instanceof HTMLAnchorElement))continue;const a=s.href,i=t&&t.isLocal?t.isLocal(a):r.URLExt.isLocal(a);s.target||(s.target=i?"_self":"_blank"),i||(s.rel="noopener")}const s=e.getElementsByTagName("img");for(let e=0;e<s.length;e++)s[e].alt||(s[e].alt="Image")},e.handleUrls=function(e,s,r){const a=[],i=e.querySelectorAll("*[src]");for(let e=0;e<i.length;e++)a.push(t(i[e],"src",s));const o=e.getElementsByTagName("a");for(let e=0;e<o.length;e++)a.push(n(o[e],s,r));const l=e.getElementsByTagName("link");for(let e=0;e<l.length;e++)a.push(t(l[e],"href",s));return Promise.all(a).then((()=>{}))},e.headerAnchors=function(e){const t=["h1","h2","h3","h4","h5","h6"];for(const n of t){const t=e.getElementsByTagName(n);for(let e=0;e<t.length;e++){const n=t[e];n.id=h.createHeaderId(n);const s=document.createElement("a");s.target="_self",s.textContent="¶",s.href="#"+n.id,s.classList.add("jp-InternalAnchorLink"),n.appendChild(s)}}};const s=["ansi-black","ansi-red","ansi-green","ansi-yellow","ansi-blue","ansi-magenta","ansi-cyan","ansi-white","ansi-black-intense","ansi-red-intense","ansi-green-intense","ansi-yellow-intense","ansi-blue-intense","ansi-magenta-intense","ansi-cyan-intense","ansi-white-intense"];function a(e,t,n,r,a,i,o){if(e){const l=[],d=[];r&&"number"==typeof t&&0<=t&&t<8&&(t+=8),i&&([t,n]=[n,t]),"number"==typeof t?l.push(s[t]+"-fg"):t.length?d.push(`color: rgb(${t})`):i&&l.push("ansi-default-inverse-fg"),"number"==typeof n?l.push(s[n]+"-bg"):n.length?d.push(`background-color: rgb(${n})`):i&&l.push("ansi-default-inverse-bg"),r&&l.push("ansi-bold"),a&&l.push("ansi-underline"),l.length||d.length?(o.push("<span"),l.length&&o.push(` class="${l.join(" ")}"`),d.length&&o.push(` style="${d.join("; ")}"`),o.push(">"),o.push(e),o.push("</span>")):o.push(e)}}function i(e){let t,n,s;const r=e.shift();if(2===r&&e.length>=3){if(t=e.shift(),n=e.shift(),s=e.shift(),[t,n,s].some((e=>e<0||255<e)))throw new RangeError("Invalid range for RGB colors")}else{if(!(5===r&&e.length>=1))throw new RangeError("Invalid extended color specification");{const r=e.shift();if(r<0)throw new RangeError("Color index must be >= 0");if(r<16)return r;if(r<232)t=Math.floor((r-16)/36),t=t>0?55+40*t:0,n=Math.floor((r-16)%36/6),n=n>0?55+40*n:0,s=(r-16)%6,s=s>0?55+40*s:0;else{if(!(r<256))throw new RangeError("Color index must be < 256");t=n=s=10*(r-232)+8}}}return[t,n,s]}e.ansiSpan=function(e){const t=/\x1b\[(.*?)([@-~])/g;let n,s=[],r=[],l=!1,d=!1,c=!1;const u=[],h=[];let p=0;for(e=o()(e),e+="[m";n=t.exec(e);){if("m"===n[2]){const e=n[1].split(";");for(let t=0;t<e.length;t++){const n=e[t];if(""===n)h.push(0);else{if(-1===n.search(/^\d+$/)){h.length=0;break}h.push(parseInt(n,10))}}}for(a(e.substring(p,n.index),s,r,l,d,c,u),p=t.lastIndex;h.length;){const e=h.shift();switch(e){case 0:s=r=[],l=!1,d=!1,c=!1;break;case 1:case 5:l=!0;break;case 4:d=!0;break;case 7:c=!0;break;case 21:case 22:l=!1;break;case 24:d=!1;break;case 27:c=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:s=e-30;break;case 38:try{s=i(h)}catch(e){h.length=0}break;case 39:s=[];break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:r=e-40;break;case 48:try{r=i(h)}catch(e){h.length=0}break;case 49:r=[];break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:s=e-90+8;break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:r=e-100+8}}}return u.join("")}}(s||(s={}))},2186:(e,t,n)=>{"use strict";n.d(t,{ZD:()=>r,_y:()=>a,sc:()=>i});var s=n(49501);const r=new s.Token("@jupyterlab/rendermime:IRenderMimeRegistry",'A service for the rendermime registry for the application. Use this to create renderers for various mime-types in your extension. Many times it will be easier to create a "mime renderer extension" rather than using this service directly.'),a=new s.Token("@jupyterlab/rendermime:ILatexTypesetter","A service for the LaTeX typesetter for the application. Use this if you want to typeset math in your extension."),i=new s.Token("@jupyterlab/rendermime:IMarkdownParser","A service for rendering markdown syntax as HTML content.")},28182:(e,t,n)=>{"use strict";n.d(t,{BP:()=>o,FK:()=>d,ND:()=>f,UH:()=>c,cw:()=>u,lH:()=>p,oI:()=>l,pY:()=>i,zt:()=>h});var s=n(6614),r=n(46947),a=n(3328);class i extends r.Widget{constructor(e){var t,n;super(),this.mimeType=e.mimeType,this.sanitizer=e.sanitizer,this.resolver=e.resolver,this.linkHandler=e.linkHandler,this.translator=null!==(t=e.translator)&&void 0!==t?t:s.nullTranslator,this.latexTypesetter=e.latexTypesetter,this.markdownParser=null!==(n=e.markdownParser)&&void 0!==n?n:null,this.node.dataset.mimeType=this.mimeType}async renderModel(e,t){if(!t)for(;this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.toggleClass("jp-mod-trusted",e.trusted),await this.render(e);const{fragment:n}=e.metadata;n&&this.setFragment(n)}setFragment(e){}}class o extends i{constructor(e){super(e),this.addClass("jp-RenderedHTMLCommon")}setFragment(e){let t;try{t=this.node.querySelector(e.startsWith("#")?`#${CSS.escape(e.slice(1))}`:e)}catch(e){console.warn("Unable to set URI fragment identifier.",e)}t&&t.scrollIntoView()}}class l extends o{constructor(e){super(e),this.addClass("jp-RenderedHTML")}render(e){return a.NN({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,translator:this.translator})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class d extends i{constructor(e){super(e),this.addClass("jp-RenderedLatex")}render(e){return a.K3({host:this.node,source:String(e.data[this.mimeType]),shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class c extends i{constructor(e){super(e),this.addClass("jp-RenderedImage")}render(e){const t=e.metadata[this.mimeType];return a.co({host:this.node,mimeType:this.mimeType,source:String(e.data[this.mimeType]),width:t&&t.width,height:t&&t.height,needsBackground:e.metadata.needs_background,unconfined:t&&t.unconfined})}}class u extends o{constructor(e){super(e),this.addClass("jp-RenderedMarkdown")}render(e){return a.ap({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}async renderModel(e){await super.renderModel(e,!0)}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class h extends i{constructor(e){super(e),this.addClass("jp-RenderedSVG")}render(e){const t=e.metadata[this.mimeType];return a.KB({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,unconfined:t&&t.unconfined,translator:this.translator})}onAfterAttach(e){this.latexTypesetter&&this.latexTypesetter.typeset(this.node)}}class p extends i{constructor(e){super(e),this.addClass("jp-RenderedText")}render(e){return a.IY({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),translator:this.translator})}}class f extends i{constructor(e){super(e),this.addClass("jp-RenderedJavaScript")}render(e){const t=this.translator.load("jupyterlab");return a.IY({host:this.node,sanitizer:this.sanitizer,source:t.__("JavaScript output is disabled in JupyterLab"),translator:this.translator})}}},8872:(e,t,n)=>{var s,r=/[&<>"'`]/g,a=RegExp(r.source),i="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,o="object"==typeof self&&self&&self.Object===Object&&self,l=i||o||Function("return this")(),d=(s={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},function(e){return null==s?void 0:s[e]}),c=Object.prototype.toString,u=l.Symbol,h=u?u.prototype:void 0,p=h?h.toString:void 0;e.exports=function(e){var t;return(e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==c.call(e)}(e))return p?p.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t))&&a.test(e)?e.replace(r,d):e}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[2479],{72479:(e,t,s)=>{s.r(t),s.d(t,{AttachmentsCell:()=>pe,AttachmentsCellModel:()=>D,Cell:()=>he,CellDragUtils:()=>l,CellFooter:()=>v,CellHeader:()=>_,CellModel:()=>E,CellSearchProvider:()=>z,CodeCell:()=>ce,CodeCellLayout:()=>ue,CodeCellModel:()=>j,Collapser:()=>p,InputArea:()=>w,InputCollapser:()=>g,InputPlaceholder:()=>W,InputPrompt:()=>M,MarkdownCell:()=>ge,MarkdownCellModel:()=>k,OutputCollapser:()=>m,OutputPlaceholder:()=>T,Placeholder:()=>F,RawCell:()=>me,RawCellModel:()=>I,SELECTED_HIGHLIGHT_CLASS:()=>B,createCellSearchProvider:()=>J,isCodeCellModel:()=>b,isMarkdownCellModel:()=>A,isRawCellModel:()=>H});var i=s(98215);const n="jp-dragImage",r="jp-dragImage-singlePrompt",o="jp-dragImage-content",a="jp-dragImage-prompt",d="jp-dragImage-multipleBack";var l;!function(e){e.findCell=function(e,t,s){let i=-1;for(;e&&e.parentElement;){if(s(e)){let s=-1;for(const n of t)if(n.node===e){i=++s;break}break}e=e.parentElement}return i},e.detectTargetArea=function(e,t){var s,i;let n;return n=e?(null===(s=e.editorWidget)||void 0===s?void 0:s.node.contains(t))?"input":(null===(i=e.promptNode)||void 0===i?void 0:i.contains(t))?"prompt":"cell":"unknown",n},e.shouldStartDrag=function(e,t,s,i){const n=Math.abs(s-e),r=Math.abs(i-t);return n>=5||r>=5},e.createCellDragImage=function(e,t){const s=t.length;let l;if("code"===e.model.type){const t=e.model.executionCount;l=" ",t&&(l=t.toString())}else l="";const h=e.model.sharedModel.getSource().split("\n")[0].slice(0,26);return s>1?""!==l?i.VirtualDOM.realize(i.h.div(i.h.div({className:n},i.h.span({className:a},"["+l+"]:"),i.h.span({className:o},h)),i.h.div({className:d},""))):i.VirtualDOM.realize(i.h.div(i.h.div({className:n},i.h.span({className:a}),i.h.span({className:o},h)),i.h.div({className:d},""))):""!==l?i.VirtualDOM.realize(i.h.div(i.h.div({className:`${n} ${r}`},i.h.span({className:a},"["+l+"]:"),i.h.span({className:o},h)))):i.VirtualDOM.realize(i.h.div(i.h.div({className:`${n} ${r}`},i.h.span({className:a}),i.h.span({className:o},h))))}}(l||(l={}));var h=s(5020),u=s(38e3),c=s(78156);class p extends h.ReactWidget{constructor(){super(),this.addClass("jp-Collapser")}get collapsed(){return!1}render(){return c.createElement("div",{className:"jp-Collapser-child",onClick:e=>this.handleClick(e)})}}class g extends p{constructor(){super(),this.addClass("jp-InputCollapser")}get collapsed(){var e;const t=null===(e=this.parent)||void 0===e?void 0:e.parent;return!!t&&t.inputHidden}handleClick(e){var t;const s=null===(t=this.parent)||void 0===t?void 0:t.parent;s&&(s.inputHidden=!s.inputHidden),this.update()}}class m extends p{constructor(){super(),this.addClass("jp-OutputCollapser")}get collapsed(){var e;const t=null===(e=this.parent)||void 0===e?void 0:e.parent;return!!t&&t.outputHidden}handleClick(e){var t,s;const i=null===(t=this.parent)||void 0===t?void 0:t.parent;if(i&&(i.outputHidden=!i.outputHidden,i.outputHidden)){let e=null===(s=i.parent)||void 0===s?void 0:s.node;e&&u.ElementExt.scrollIntoViewIfNeeded(e,i.node)}this.update()}}var C=s(46947);class _ extends C.Widget{constructor(){super(),this.addClass("jp-CellHeader")}}class v extends C.Widget{constructor(){super(),this.addClass("jp-CellFooter")}}var y=s(77842);class w extends C.Widget{constructor(e){super(),this.addClass("jp-InputArea");const{contentFactory:t,editorOptions:s,model:i}=e;this.model=i,this.contentFactory=t;const n=this._prompt=t.createInputPrompt();n.addClass("jp-InputArea-prompt");const r=this._editor=new y.CodeEditorWrapper({factory:t.editorFactory,model:i,editorOptions:s});r.addClass("jp-InputArea-editor");const o=this.layout=new C.PanelLayout;o.addWidget(n),o.addWidget(r)}get editorWidget(){return this._editor}get editor(){return this._editor.editor}get promptNode(){return this._prompt.node}get renderedInput(){return this._rendered}renderInput(e){const t=this.layout;this._rendered&&(this._rendered.parent=null),this._editor.hide(),this._rendered=e,t.addWidget(e)}showEditor(){this._rendered&&(this._rendered.parent=null),this._editor.show()}setPrompt(e){this._prompt.executionCount=e}dispose(){this.isDisposed||(this._prompt=null,this._editor=null,this._rendered=null,super.dispose())}}!function(e){e.ContentFactory=class{constructor(e){this._editor=e.editorFactory}get editorFactory(){return this._editor}createInputPrompt(){return new M}}}(w||(w={}));class M extends C.Widget{constructor(){super(),this._executionCount=null,this.addClass("jp-InputPrompt")}get executionCount(){return this._executionCount}set executionCount(e){this._executionCount=e,this.node.textContent=null===e?" ":`[${e||" "}]:`}}var f=s(47479),x=s(73965),P=s(12695),S=s(69688);const O=(0,S.createMutex)();function b(e){return"code"===e.type}function A(e){return"markdown"===e.type}function H(e){return"raw"===e.type}class E extends y.CodeEditor.Model{constructor(e={}){const{cell_type:t,sharedModel:s,...i}=e;super({sharedModel:null!=s?s:(0,S.createStandaloneCell)({cell_type:null!=t?t:"raw",id:e.id}),...i}),this.contentChanged=new f.Signal(this),this.stateChanged=new f.Signal(this),this._metadataChanged=new f.Signal(this),this._trusted=!1,this.standaloneModel=void 0===e.sharedModel,this.trusted=!!this.getMetadata("trusted")||!!e.trusted,this.sharedModel.changed.connect(this.onGenericChange,this),this.sharedModel.metadataChanged.connect(this._onMetadataChanged,this)}get metadataChanged(){return this._metadataChanged}get id(){return this.sharedModel.getId()}get metadata(){return this.sharedModel.metadata}get trusted(){return this._trusted}set trusted(e){const t=this.trusted;t!==e&&(this._trusted=e,this.onTrustedChanged(this,{newValue:e,oldValue:t}))}dispose(){this.isDisposed||(this.sharedModel.changed.disconnect(this.onGenericChange,this),this.sharedModel.metadataChanged.disconnect(this._onMetadataChanged,this),super.dispose())}onTrustedChanged(e,t){}deleteMetadata(e){return this.sharedModel.deleteMetadata(e)}getMetadata(e){return this.sharedModel.getMetadata(e)}setMetadata(e,t){void 0===t?this.sharedModel.deleteMetadata(e):this.sharedModel.setMetadata(e,t)}toJSON(){return this.sharedModel.toJSON()}onGenericChange(){this.contentChanged.emit(void 0)}_onMetadataChanged(e,t){this._metadataChanged.emit(t)}}class D extends E{constructor(e){var t;super(e);const s=null!==(t=e.contentFactory)&&void 0!==t?t:D.defaultContentFactory,i=this.sharedModel.getAttachments();this._attachments=s.createAttachmentsModel({values:i}),this._attachments.stateChanged.connect(this.onGenericChange,this),this._attachments.changed.connect(this._onAttachmentsChange,this),this.sharedModel.changed.connect(this._onSharedModelChanged,this)}get attachments(){return this._attachments}dispose(){this.isDisposed||(this._attachments.stateChanged.disconnect(this.onGenericChange,this),this._attachments.changed.disconnect(this._onAttachmentsChange,this),this._attachments.dispose(),this.sharedModel.changed.disconnect(this._onSharedModelChanged,this),super.dispose())}toJSON(){return super.toJSON()}_onAttachmentsChange(e,t){const s=this.sharedModel;O((()=>s.setAttachments(e.toJSON())))}_onSharedModelChanged(e,t){if(t.attachmentsChange){const e=this.sharedModel;O((()=>{var t;return this._attachments.fromJSON(null!==(t=e.getAttachments())&&void 0!==t?t:{})}))}}}!function(e){class t{createAttachmentsModel(e){return new x.AttachmentsModel(e)}}e.ContentFactory=t,e.defaultContentFactory=new t}(D||(D={}));class I extends D{constructor(e={}){super({cell_type:"raw",...e})}get type(){return"raw"}toJSON(){return super.toJSON()}}class k extends D{constructor(e={}){super({cell_type:"markdown",...e}),this.mimeType="text/x-ipythongfm"}get type(){return"markdown"}toJSON(){return super.toJSON()}}class j extends E{constructor(e={}){var t;super({cell_type:"code",...e}),this._executedCode="",this._isDirty=!1;const s=null!==(t=null==e?void 0:e.contentFactory)&&void 0!==t?t:j.defaultContentFactory,i=this.trusted,n=this.sharedModel.getOutputs();this._outputs=s.createOutputArea({trusted:i,values:n}),this.sharedModel.changed.connect(this._onSharedModelChanged,this),this._outputs.changed.connect(this.onGenericChange,this),this._outputs.changed.connect(this.onOutputsChange,this)}get type(){return"code"}get executionCount(){return this.sharedModel.execution_count||null}set executionCount(e){this.sharedModel.execution_count=e||null}get isDirty(){return this._isDirty}get outputs(){return this._outputs}clearExecution(){this.outputs.clear(),this.executionCount=null,this._setDirty(!1),this.sharedModel.deleteMetadata("execution"),this.trusted=!0}dispose(){this.isDisposed||(this.sharedModel.changed.disconnect(this._onSharedModelChanged,this),this._outputs.changed.disconnect(this.onGenericChange,this),this._outputs.changed.disconnect(this.onOutputsChange,this),this._outputs.dispose(),this._outputs=null,super.dispose())}onTrustedChanged(e,t){const s=t.newValue;if(this._outputs&&(this._outputs.trusted=s),s){const e=this.sharedModel,t=e.getMetadata();t.trusted=!0,e.setMetadata(t)}this.stateChanged.emit({name:"trusted",oldValue:t.oldValue,newValue:s})}toJSON(){return super.toJSON()}onOutputsChange(e,t){const s=this.sharedModel;O((()=>{switch(t.type){case"add":{const e=t.newValues.map((e=>e.toJSON()));s.updateOutputs(t.newIndex,t.newIndex,e);break}case"set":{const e=t.newValues.map((e=>e.toJSON()));s.updateOutputs(t.oldIndex,t.oldIndex+e.length,e);break}case"remove":s.updateOutputs(t.oldIndex,t.oldValues.length);break;default:throw new Error(`Invalid event type: ${t.type}`)}}))}_onSharedModelChanged(e,t){t.outputsChange&&O((()=>{this.outputs.clear(),e.getOutputs().forEach((e=>this._outputs.add(e)))})),t.executionCountChange&&(!t.executionCountChange.newValue||!this.isDirty&&t.executionCountChange.oldValue||this._setDirty(!1),this.stateChanged.emit({name:"executionCount",oldValue:t.executionCountChange.oldValue,newValue:t.executionCountChange.newValue})),t.sourceChange&&null!==this.executionCount&&this._setDirty(this._executedCode!==this.sharedModel.getSource().trim())}_setDirty(e){e||(this._executedCode=this.sharedModel.getSource().trim()),e!==this._isDirty&&(this._isDirty=e,this.stateChanged.emit({name:"isDirty",oldValue:!e,newValue:e}))}}!function(e){class t{createOutputArea(e){return new P.OutputAreaModel(e)}}e.ContentFactory=t,e.defaultContentFactory=new t}(j||(j={}));var N=s(6614);class F extends C.Widget{constructor(e){var t,s,i;const n=document.createElement("div");super({node:n});const r=(null!==(t=e.translator)&&void 0!==t?t:N.nullTranslator).load("jupyterlab"),o=document.createElement("div");o.className=null!==(s=e.promptClass)&&void 0!==s?s:"",n.insertAdjacentHTML("afterbegin",o.outerHTML),this._cell=document.createElement("div"),this._cell.classList.add("jp-Placeholder-content"),this._cell.title=r.__("Click to expand");const a=this._cell.appendChild(document.createElement("div"));a.classList.add("jp-Placeholder-contentContainer"),this._textContent=a.appendChild(document.createElement("span")),this._textContent.className="jp-PlaceholderText",this._textContent.innerText=null!==(i=e.text)&&void 0!==i?i:"",n.appendChild(this._cell),h.ellipsesIcon.element({container:a.appendChild(document.createElement("span")),className:"jp-MoreHorizIcon",elementPosition:"center",height:"auto",width:"32px"}),this.addClass("jp-Placeholder"),this._callback=e.callback}set text(e){this._textContent.innerText=e}get text(){return this._textContent.innerText}onAfterAttach(e){super.onAfterAttach(e),this.node.addEventListener("click",this._callback)}onBeforeDetach(e){this.node.removeEventListener("click",this._callback),super.onBeforeDetach(e)}}class W extends F{constructor(e){super({...e,promptClass:"jp-Placeholder-prompt jp-InputPrompt"}),this.addClass("jp-InputPlaceholder")}}class T extends F{constructor(e){super({...e,promptClass:"jp-Placeholder-prompt jp-OutputPrompt"}),this.addClass("jp-OutputPlaceholder")}}var L=s(3206),R=s(8630),V=s(22459);const B="jp-mod-selected";class z extends L.EditorSearchProvider{constructor(e){super(),this.cell=e,this.cell.inViewport||this.cell.editor||(0,R.signalToPromise)(e.inViewportChanged).then((([,e])=>{e&&this.cmHandler.setEditor(this.editor)}))}get editor(){return this.cell.editor}get model(){return this.cell.model}}class U extends z{constructor(e){super(e),this.currentProviderIndex=-1,this.outputsProvider=[];const t=this.cell.outputArea;this._onOutputsChanged(t,t.widgets.length).catch((e=>{console.error("Failed to initialize search on cell outputs.",e)})),t.outputLengthChanged.connect(this._onOutputsChanged,this),t.disposed.connect((()=>{t.outputLengthChanged.disconnect(this._onOutputsChanged)}),this)}get matchesCount(){return this.isActive?super.matchesCount+this.outputsProvider.reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0):0}async clearHighlight(){await super.clearHighlight(),await Promise.all(this.outputsProvider.map((e=>e.clearHighlight())))}dispose(){this.isDisposed||(super.dispose(),this.outputsProvider.map((e=>{e.dispose()})),this.outputsProvider.length=0)}async highlightNext(e,t){if(0!==this.matchesCount&&this.isActive){if(-1===this.currentProviderIndex){const e=await super.highlightNext(!0,t);if(e)return this.currentIndex=this.cmHandler.currentIndex,e;this.currentProviderIndex=0}for(;this.currentProviderIndex<this.outputsProvider.length;){const e=this.outputsProvider[this.currentProviderIndex],t=await e.highlightNext(!1);if(t)return this.currentIndex=super.matchesCount+this.outputsProvider.slice(0,this.currentProviderIndex).reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0)+e.currentMatchIndex,t;this.currentProviderIndex+=1}return this.currentProviderIndex=-1,void(this.currentIndex=null)}this.currentIndex=null}async highlightPrevious(){if(0!==this.matchesCount&&this.isActive){for(null===this.currentIndex&&(this.currentProviderIndex=this.outputsProvider.length-1);this.currentProviderIndex>=0;){const e=this.outputsProvider[this.currentProviderIndex],t=await e.highlightPrevious(!1);if(t)return this.currentIndex=super.matchesCount+this.outputsProvider.slice(0,this.currentProviderIndex).reduce(((e,t)=>{var s;return e+(null!==(s=t.matchesCount)&&void 0!==s?s:0)}),0)+e.currentMatchIndex,t;this.currentProviderIndex-=1}const e=await super.highlightPrevious();return e?(this.currentIndex=this.cmHandler.currentIndex,e):void(this.currentIndex=null)}this.currentIndex=null}async startQuery(e,t){await super.startQuery(e,t),!1!==(null==t?void 0:t.output)&&this.isActive&&await Promise.all(this.outputsProvider.map((t=>t.startQuery(e))))}async endQuery(){var e;await super.endQuery(),!1!==(null===(e=this.filters)||void 0===e?void 0:e.output)&&this.isActive&&await Promise.all(this.outputsProvider.map((e=>e.endQuery())))}async _onOutputsChanged(e,t){var s;this.outputsProvider.forEach((e=>{e.dispose()})),this.outputsProvider.length=0,this.currentProviderIndex=-1,this.outputsProvider=this.cell.outputArea.widgets.map((e=>new V.GenericSearchProvider(e))),this.isActive&&this.query&&!1!==(null===(s=this.filters)||void 0===s?void 0:s.output)&&await Promise.all([this.outputsProvider.map((e=>{e.startQuery(this.query)}))]),this._stateChanged.emit()}}class $ extends z{constructor(e){super(e),this._unrenderedByHighligh=!1,this.renderedProvider=new V.GenericSearchProvider(e.renderer)}async clearHighlight(){await super.clearHighlight(),await this.renderedProvider.clearHighlight()}dispose(){this.isDisposed||(super.dispose(),this.renderedProvider.dispose())}async endQuery(){await super.endQuery(),await this.renderedProvider.endQuery()}async highlightNext(){let e;if(!this.isActive)return e;const t=this.cell;if(t.rendered&&this.matchesCount>0){this._unrenderedByHighligh=!0;const e=(0,R.signalToPromise)(t.renderedChanged);t.rendered=!1,await e}return e=await super.highlightNext(),e}async highlightPrevious(){let e;const t=this.cell;if(t.rendered&&this.matchesCount>0){this._unrenderedByHighligh=!0;const e=(0,R.signalToPromise)(t.renderedChanged);t.rendered=!1,await e}return e=await super.highlightPrevious(),e}async startQuery(e,t){await super.startQuery(e,t);const s=this.cell;s.rendered&&this.onRenderedChanged(s,s.rendered),s.renderedChanged.connect(this.onRenderedChanged,this)}async replaceAllMatches(e){const t=await super.replaceAllMatches(e);return this.cell.rendered&&this.cell.update(),t}onRenderedChanged(e,t){var s;this._unrenderedByHighligh||(this.currentIndex=null),this._unrenderedByHighligh=!1,this.isActive&&(t?this.renderedProvider.startQuery(this.query):(null===(s=e.editor)||void 0===s||s.setCursorPosition({column:0,line:0}),this.renderedProvider.endQuery()))}}function J(e){if(e.isPlaceholder())return new z(e);switch(e.model.type){case"code":return new U(e);case"markdown":return new $(e);default:return new z(e)}}var Q=s(31013),G=s(18932),q=s(65684),X=s(49501),Y=s(20882),K=s(30807),Z=s(70176);const ee="jp-mod-resizedCell";class te extends C.Widget{constructor(e){super(),this.targetNode=e,this._isActive=!1,this._isDragging=!1,this.addClass("jp-CellResizeHandle"),this._resizer=new Z.Throttler((e=>this._resize(e)),50)}dispose(){this._resizer.dispose(),super.dispose()}handleEvent(e){var t,s;switch(e.type){case"dblclick":null===(t=this.targetNode.parentNode)||void 0===t||t.childNodes.forEach((e=>{e.classList.remove(ee)})),document.documentElement.style.setProperty("--jp-side-by-side-output-size","1fr"),this._isActive=!1;break;case"mousedown":this._isDragging=!0,this._isActive||(null===(s=this.targetNode.parentNode)||void 0===s||s.childNodes.forEach((e=>{e.classList.add(ee)})),this._isActive=!0),window.addEventListener("mousemove",this),window.addEventListener("mouseup",this);break;case"mousemove":this._isActive&&this._isDragging&&this._resizer.invoke(e);break;case"mouseup":this._isDragging=!1,window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this)}}onAfterAttach(e){this.node.addEventListener("dblclick",this),this.node.addEventListener("mousedown",this),super.onAfterAttach(e)}onBeforeDetach(e){this.node.removeEventListener("dblclick",this),this.node.removeEventListener("mousedown",this),super.onBeforeDetach(e)}_resize(e){const{width:t,x:s}=this.targetNode.getBoundingClientRect(),i=t/(e.clientX-s)-1;if(0<i){const e=Math.max(Math.min(Math.abs(i),50),.05);document.documentElement.style.setProperty("--jp-side-by-side-output-size",`${e}fr`)}}}const se="jp-Cell-outputWrapper",ie="jp-mod-dirty",ne="jp-MarkdownHeadingCollapsed",re="jp-collapseHeadingButton",oe="jp-showHiddenCellsButton",ae="jp-mod-rendered",de="jp-mod-noOutputs",le="application/x-jupyter-icontentsrich";class he extends C.Widget{constructor(e){var t,s,i,n;super(),this.prompt="",this._displayChanged=new f.Signal(this),this._editorConfig={},this._inputHidden=!1,this._inViewportChanged=new f.Signal(this),this._readOnly=!1,this._ready=new X.PromiseDelegate,this._resizeDebouncer=new Z.Debouncer((()=>{this._displayChanged.emit()}),0),this._syncCollapse=!1,this._syncEditable=!1,this.addClass("jp-Cell");const r=this._model=e.model;this.contentFactory=e.contentFactory,this.layout=null!==(t=e.layout)&&void 0!==t?t:new C.PanelLayout,this.translator=null!==(s=e.translator)&&void 0!==s?s:N.nullTranslator,this._editorConfig=null!==(i=e.editorConfig)&&void 0!==i?i:{},this._placeholder=!0,this._inViewport=!1,this.placeholder=null===(n=e.placeholder)||void 0===n||n,r.metadataChanged.connect(this.onMetadataChanged,this)}initializeState(){return this.loadCollapseState(),this.loadEditableState(),this}get displayChanged(){return this._displayChanged}get inViewport(){return this._inViewport}set inViewport(e){this._inViewport!==e&&(this._inViewport=e,this._inViewportChanged.emit(this._inViewport))}get inViewportChanged(){return this._inViewportChanged}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder!==e&&!1===e&&(this.initializeDOM(),this._placeholder=e,this._ready.resolve())}get promptNode(){return this.placeholder?null:this._inputHidden?this._inputPlaceholder.node.firstElementChild:this._input.promptNode}get editorWidget(){var e,t;return null!==(t=null===(e=this._input)||void 0===e?void 0:e.editorWidget)&&void 0!==t?t:null}get editor(){var e,t;return null!==(t=null===(e=this._input)||void 0===e?void 0:e.editor)&&void 0!==t?t:null}get editorConfig(){return this._editorConfig}get headings(){return new Array}get model(){return this._model}get inputArea(){return this._input}get readOnly(){return this._readOnly}set readOnly(e){e!==this._readOnly&&(this._readOnly=e,this.syncEditable&&this.saveEditableState(),this.update())}isPlaceholder(){return this.placeholder}saveEditableState(){const{sharedModel:e}=this.model,t=e.getMetadata("editable");this.readOnly&&!1===t||!this.readOnly&&void 0===t||(this.readOnly?e.setMetadata("editable",!1):e.deleteMetadata("editable"))}loadEditableState(){this.readOnly=!1===this.model.sharedModel.getMetadata("editable")}get ready(){return this._ready.promise}setPrompt(e){var t;this.prompt=e,null===(t=this._input)||void 0===t||t.setPrompt(e)}get inputHidden(){return this._inputHidden}set inputHidden(e){var t;if(this._inputHidden!==e){if(!this.placeholder){const s=this._inputWrapper.layout;e?(this._input.parent=null,this._inputPlaceholder&&(this._inputPlaceholder.text=null===(t=this.model.sharedModel.getSource().split("\n"))||void 0===t?void 0:t[0]),s.addWidget(this._inputPlaceholder)):(this._inputPlaceholder.parent=null,s.addWidget(this._input))}this._inputHidden=e,this.syncCollapse&&this.saveCollapseState(),this.handleInputHidden(e)}}saveCollapseState(){const e={...this.model.getMetadata("jupyter")};this.inputHidden&&!0===e.source_hidden||!this.inputHidden&&void 0===e.source_hidden||(this.inputHidden?e.source_hidden=!0:delete e.source_hidden,0===Object.keys(e).length?this.model.deleteMetadata("jupyter"):this.model.setMetadata("jupyter",e))}loadCollapseState(){var e;const t=null!==(e=this.model.getMetadata("jupyter"))&&void 0!==e?e:{};this.inputHidden=!!t.source_hidden}handleInputHidden(e){}get syncCollapse(){return this._syncCollapse}set syncCollapse(e){this._syncCollapse!==e&&(this._syncCollapse=e,e&&this.loadCollapseState())}get syncEditable(){return this._syncEditable}set syncEditable(e){this._syncEditable!==e&&(this._syncEditable=e,e&&this.loadEditableState())}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,placeholder:!1,translator:this.translator})}dispose(){this.isDisposed||(this._resizeDebouncer.dispose(),this._input=null,this._model=null,this._inputWrapper=null,this._inputPlaceholder=null,super.dispose())}updateEditorConfig(e){this._editorConfig={...this._editorConfig,...e},this.editor&&this.editor.setOptions(this._editorConfig)}initializeDOM(){if(!this.placeholder)return;const e=this.contentFactory,t=this._model,s=e.createCellHeader();s.addClass("jp-Cell-header"),this.layout.addWidget(s);const i=this._inputWrapper=new C.Panel;i.addClass("jp-Cell-inputWrapper");const n=new g;n.addClass("jp-Cell-inputCollapser");const r=this._input=new w({model:t,contentFactory:e,editorOptions:this.getEditorOptions()});r.addClass("jp-Cell-inputArea"),i.addWidget(n),i.addWidget(r),this.layout.addWidget(i),this._inputPlaceholder=new W({callback:()=>{this.inputHidden=!this.inputHidden},text:r.model.sharedModel.getSource().split("\n")[0],translator:this.translator}),r.model.contentChanged.connect(((e,t)=>{var s;this._inputPlaceholder&&this.inputHidden&&(this._inputPlaceholder.text=null===(s=e.sharedModel.getSource().split("\n"))||void 0===s?void 0:s[0])})),this.inputHidden&&(r.parent=null,i.layout.addWidget(this._inputPlaceholder));const o=this.contentFactory.createCellFooter();o.addClass("jp-Cell-footer"),this.layout.addWidget(o)}getEditorOptions(){return{config:this.editorConfig}}onBeforeAttach(e){this.placeholder&&(this.placeholder=!1)}onAfterAttach(e){this.update()}onActivateRequest(e){var t;null===(t=this.editor)||void 0===t||t.focus()}onResize(e){this._resizeDebouncer.invoke()}onUpdateRequest(e){var t,s;this._model&&(null===(t=this.editor)||void 0===t?void 0:t.getOption("readOnly"))!==this._readOnly&&(null===(s=this.editor)||void 0===s||s.setOption("readOnly",this._readOnly))}onContentChanged(){var e;this.inputHidden&&this._inputPlaceholder&&(this._inputPlaceholder.text=null===(e=this.model.sharedModel.getSource().split("\n"))||void 0===e?void 0:e[0])}onMetadataChanged(e,t){switch(t.key){case"jupyter":this.syncCollapse&&this.loadCollapseState();break;case"editable":this.syncEditable&&this.loadEditableState()}}}!function(e){let t;!function(e){e[e.HTML=0]="HTML",e[e.Markdown=1]="Markdown"}(t=e.HeadingType||(e.HeadingType={})),e.ContentFactory=class{constructor(e){this._editorFactory=e.editorFactory}get editorFactory(){return this._editorFactory}createCellHeader(){return new _}createCellFooter(){return new v}createInputPrompt(){return new M}createOutputPrompt(){return new P.OutputPrompt}createStdin(e){return new P.Stdin(e)}}}(he||(he={}));class ue extends C.PanelLayout{onBeforeAttach(e){let t=!0;const s=this.parent.node.firstElementChild;for(const i of this)s&&(i.node===s?t=!1:(K.MessageLoop.sendMessage(i,e),t?this.parent.node.insertBefore(i.node,s):this.parent.node.appendChild(i.node),this.parent.isHidden||i.setFlag(C.Widget.Flag.IsVisible),K.MessageLoop.sendMessage(i,C.Widget.Msg.AfterAttach)))}onAfterDetach(e){for(const t of this)!t.hasClass(se)&&t.node.isConnected&&(K.MessageLoop.sendMessage(t,C.Widget.Msg.BeforeDetach),this.parent.node.removeChild(t.node),K.MessageLoop.sendMessage(t,e))}}class ce extends he{constructor(e){var t;super({layout:new ue,...e,placeholder:!0}),this._headingsCache=null,this._outputHidden=!1,this._outputWrapper=null,this._outputPlaceholder=null,this._syncScrolled=!1,this.addClass("jp-CodeCell");const s=this.translator.load("jupyterlab"),i=this._rendermime=e.rendermime,n=this.contentFactory,r=this.model;this.maxNumberOutputs=e.maxNumberOutputs;const o=0===r.outputs.length?s.__("Code Cell Content"):s.__("Code Cell Content with Output");this.node.setAttribute("aria-label",o);const a=this._output=new P.OutputArea({model:this.model.outputs,rendermime:i,contentFactory:n,maxNumberOutputs:this.maxNumberOutputs,translator:this.translator,promptOverlay:!0,inputHistoryScope:e.inputHistoryScope});a.addClass("jp-Cell-outputArea"),a.toggleScrolling.connect((()=>{this.outputsScrolled=!this.outputsScrolled})),this.placeholder=null===(t=e.placeholder)||void 0===t||t,r.outputs.changed.connect(this.onOutputChanged,this),r.outputs.stateChanged.connect(this.onOutputChanged,this),r.stateChanged.connect(this.onStateChanged,this)}initializeDOM(){if(!this.placeholder)return;super.initializeDOM(),this.setPrompt(this.prompt);const e=this._outputWrapper=new C.Panel;e.addClass(se);const t=new m;t.addClass("jp-Cell-outputCollapser"),e.addWidget(t),0===this.model.outputs.length&&this.addClass(de),this._output.outputLengthChanged.connect(this._outputLengthHandler,this),e.addWidget(this._output);const s=this.layout;s.insertWidget(s.widgets.length-1,new te(this.node)),s.insertWidget(s.widgets.length-1,e),this.model.isDirty&&this.addClass(ie),this._outputPlaceholder=new T({callback:()=>{this.outputHidden=!this.outputHidden},text:this.getOutputPlaceholderText(),translator:this.translator});const i=e.layout;this.outputHidden&&(i.removeWidget(this._output),i.addWidget(this._outputPlaceholder),this.inputHidden&&!e.isHidden&&this._outputWrapper.hide());const n=this.translator.load("jupyterlab"),r=0===this.model.outputs.length?n.__("Code Cell Content"):n.__("Code Cell Content with Output");this.node.setAttribute("aria-label",r)}getOutputPlaceholderText(){var e;const t=this.model.outputs.get(0);if(!(null==t?void 0:t.data))return;const s=["text/html","image/svg+xml","application/pdf","text/markdown","text/plain","application/vnd.jupyter.stderr","application/vnd.jupyter.stdout","text"].find((e=>{const s=t.data[e];return"string"==(Array.isArray(s)?typeof s[0]:typeof s)})),i=t.data[null!=s?s:""];return void 0!==i?null===(e=Array.isArray(i)?i:null==i?void 0:i.split("\n"))||void 0===e?void 0:e.find((e=>""!==e)):void 0}initializeState(){return super.initializeState(),this.loadScrolledState(),this.setPrompt(`${this.model.executionCount||""}`),this}get headings(){if(!this._headingsCache){const e=[],t=this.model.outputs;for(let s=0;s<t.length;s++){const i=t.get(s);let n=null,r=null;Object.keys(i.data).forEach((e=>{!r&&q.TableOfContentsUtils.Markdown.isMarkdown(e)?r=e:!n&&q.TableOfContentsUtils.isHTML(e)&&(n=e)})),n?e.push(...q.TableOfContentsUtils.getHTMLHeadings(this._rendermime.sanitizer.sanitize(i.data[n])).map((e=>({...e,outputIndex:s,type:he.HeadingType.HTML})))):r&&e.push(...q.TableOfContentsUtils.Markdown.getHeadings(i.data[r]).map((e=>({...e,outputIndex:s,type:he.HeadingType.Markdown}))))}this._headingsCache=e}return[...this._headingsCache]}get outputArea(){return this._output}get outputHidden(){return this._outputHidden}set outputHidden(e){var t;if(this._outputHidden!==e){if(!this.placeholder){const s=this._outputWrapper.layout;e?(s.removeWidget(this._output),s.addWidget(this._outputPlaceholder),this.inputHidden&&!this._outputWrapper.isHidden&&this._outputWrapper.hide(),this._outputPlaceholder&&(this._outputPlaceholder.text=null!==(t=this.getOutputPlaceholderText())&&void 0!==t?t:"")):(this._outputWrapper.isHidden&&this._outputWrapper.show(),s.removeWidget(this._outputPlaceholder),s.addWidget(this._output))}this._outputHidden=e,this.syncCollapse&&this.saveCollapseState()}}saveCollapseState(){this.model.sharedModel.transact((()=>{super.saveCollapseState();const e=this.model.getMetadata("collapsed");this.outputHidden&&!0===e||!this.outputHidden&&void 0===e||(this.outputHidden?this.model.setMetadata("collapsed",!0):this.model.deleteMetadata("collapsed"))}),!1)}loadCollapseState(){super.loadCollapseState(),this.outputHidden=!!this.model.getMetadata("collapsed")}get outputsScrolled(){return this._outputsScrolled}set outputsScrolled(e){this.toggleClass("jp-mod-outputsScrolled",e),this._outputsScrolled=e,this.syncScrolled&&this.saveScrolledState()}saveScrolledState(){const e=this.model.getMetadata("scrolled");this.outputsScrolled&&!0===e||!this.outputsScrolled&&void 0===e||(this.outputsScrolled?this.model.setMetadata("scrolled",!0):this.model.deleteMetadata("scrolled"))}loadScrolledState(){"auto"===this.model.getMetadata("scrolled")?this.outputsScrolled=!1:this.outputsScrolled=!!this.model.getMetadata("scrolled")}get syncScrolled(){return this._syncScrolled}set syncScrolled(e){this._syncScrolled!==e&&(this._syncScrolled=e,e&&this.loadScrolledState())}handleInputHidden(e){this.placeholder||(!e&&this._outputWrapper.isHidden?this._outputWrapper.show():e&&!this._outputWrapper.isHidden&&this._outputHidden&&this._outputWrapper.hide())}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:!1,translator:this.translator})}cloneOutputArea(){return new P.SimplifiedOutputArea({model:this.model.outputs,contentFactory:this.contentFactory,rendermime:this._rendermime})}dispose(){this.isDisposed||(this._output.outputLengthChanged.disconnect(this._outputLengthHandler,this),this._rendermime=null,this._output=null,this._outputWrapper=null,this._outputPlaceholder=null,super.dispose())}onStateChanged(e,t){switch(t.name){case"executionCount":this.setPrompt(`${e.executionCount||""}`);break;case"isDirty":e.isDirty?this.addClass(ie):this.removeClass(ie)}}onOutputChanged(){var e;this._headingsCache=null,this._outputPlaceholder&&this.outputHidden&&(this._outputPlaceholder.text=null!==(e=this.getOutputPlaceholderText())&&void 0!==e?e:"")}onMetadataChanged(e,t){switch(t.key){case"scrolled":this.syncScrolled&&this.loadScrolledState();break;case"collapsed":this.syncCollapse&&this.loadCollapseState()}super.onMetadataChanged(e,t)}_outputLengthHandler(e,t){const s=0===t;this.toggleClass(de,s);const i=this.translator.load("jupyterlab"),n=s?i.__("Code Cell Content"):i.__("Code Cell Content with Output");this.node.setAttribute("aria-label",n)}}!function(e){e.execute=async function(e,t,s){var i;const n=e.model,r=n.sharedModel.getSource();if(!r.trim()||!(null===(i=t.session)||void 0===i?void 0:i.kernel))return void n.sharedModel.transact((()=>{n.clearExecution()}),!1);const o={cellId:n.sharedModel.getId()};s={...n.metadata,...s,...o};const{recordTiming:a}=s;let d;n.sharedModel.transact((()=>{n.clearExecution(),e.outputHidden=!1}),!1),e.setPrompt("*"),n.trusted=!0;try{const i=P.OutputArea.execute(r,e.outputArea,t,s);if(a){const t=e=>{let t;switch(e.header.msg_type){case"status":t=`status.${e.content.execution_state}`;break;case"execute_input":t="execute_input";break;default:return!0}const s=e.header.date||(new Date).toISOString(),i=Object.assign({},n.getMetadata("execution"));return i[`iopub.${t}`]=s,n.setMetadata("execution",i),!0};e.outputArea.future.registerMessageHook(t)}else n.deleteMetadata("execution");d=e.outputArea.future;const o=await i;if(n.executionCount=o.content.execution_count,a){const e=Object.assign({},n.getMetadata("execution")),t=o.metadata.started;t&&(e["shell.execute_reply.started"]=t);const s=o.header.date;e["shell.execute_reply"]=s||(new Date).toISOString(),n.setMetadata("execution",e)}return o}catch(t){throw d&&!e.isDisposed&&e.outputArea.future===d&&e.setPrompt(""),t}}}(ce||(ce={}));class pe extends he{handleEvent(e){switch(e.type){case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e)}}getEditorOptions(){var e,t;const s=null!==(e=super.getEditorOptions())&&void 0!==e?e:{};return s.extensions=[...null!==(t=s.extensions)&&void 0!==t?t:[],Q.EditorView.domEventHandlers({dragenter:e=>{e.preventDefault()},dragover:e=>{e.preventDefault()},drop:e=>{this._evtNativeDrop(e)},paste:e=>{this._evtPaste(e)}})],s}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;t.addEventListener("lm-dragover",this),t.addEventListener("lm-drop",this)}onBeforeDetach(e){const t=this.node;t.removeEventListener("lm-dragover",this),t.removeEventListener("lm-drop",this),super.onBeforeDetach(e)}_evtDragOver(e){(0,Y.some)(G.imageRendererFactory.mimeTypes,(t=>!!e.mimeData.hasData(le)&&e.mimeData.getData(le).model.mimetype===t))&&(e.preventDefault(),e.stopPropagation(),e.dropAction=e.proposedAction)}_evtPaste(e){if(e.clipboardData){const t=e.clipboardData.items;for(let s=0;s<t.length;s++){if("text/plain"===t[s].type){if(s<t.length-1&&"file"===t[s+1].kind)continue;t[s].getAsString((e=>{var t,s;null===(s=(t=this.editor).replaceSelection)||void 0===s||s.call(t,e)}))}this._attachFiles(e.clipboardData.items)}}e.preventDefault()}_evtNativeDrop(e){e.dataTransfer&&this._attachFiles(e.dataTransfer.items),e.preventDefault()}_evtDrop(e){const t=e.mimeData.types().filter((t=>{if(t===le){const t=e.mimeData.getData(le);return-1!==G.imageRendererFactory.mimeTypes.indexOf(t.model.mimetype)}return-1!==G.imageRendererFactory.mimeTypes.indexOf(t)}));if(0!==t.length)if(e.preventDefault(),e.stopPropagation(),"none"!==e.proposedAction){e.dropAction="copy";for(const s of t)if(s===le){const{model:t,withContent:s}=e.mimeData.getData(le);if("file"===t.type){const e=this._generateURI(t.name);this.updateCellSourceWithAttachment(t.name,e),s().then((t=>{this.model.attachments.set(e,{[t.mimetype]:t.content})}))}}else{const t=this._generateURI();this.model.attachments.set(t,{[s]:e.mimeData.getData(s)}),this.updateCellSourceWithAttachment(t,t)}}else e.dropAction="none"}_attachFiles(e){for(let t=0;t<e.length;t++){const s=e[t];if("file"===s.kind){const e=s.getAsFile();e&&this._attachFile(e)}}}_attachFile(e){const t=new FileReader;t.onload=s=>{const{href:i,protocol:n}=R.URLExt.parse(t.result);if("data:"!==n)return;const r=/([\w+\/\+]+)?(?:;(charset=[\w\d-]*|base64))?,(.*)/.exec(i);if(!r||4!==r.length)return;const o=r[1],a={[o]:r[3]},d=this._generateURI(e.name);o.startsWith("image/")&&(this.model.attachments.set(d,a),this.updateCellSourceWithAttachment(e.name,d))},t.onerror=t=>{console.error(`Failed to attach ${e.name}`+t)},t.readAsDataURL(e)}_generateURI(e=""){const t=e.lastIndexOf(".");return-1!==t?X.UUID.uuid4().concat(e.substring(t)):X.UUID.uuid4()}}class ge extends pe{constructor(e){var t,s,i,n;super({...e,placeholder:!0}),this._headingsCache=null,this._headingCollapsedChanged=new f.Signal(this),this._prevText="",this._rendered=!0,this._renderedChanged=new f.Signal(this),this._showEditorForReadOnlyMarkdown=!0,this.addClass("jp-MarkdownCell"),this.model.contentChanged.connect(this.onContentChanged,this);const r=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",r.__("Markdown Cell Content")),this._rendermime=e.rendermime.clone({resolver:new x.AttachmentsResolver({parent:null!==(t=e.rendermime.resolver)&&void 0!==t?t:void 0,model:this.model.attachments})}),this._renderer=this._rendermime.createRenderer("text/markdown"),this._renderer.addClass("jp-MarkdownOutput"),this._headingCollapsed=null!==(s=this.model.getMetadata(ne))&&void 0!==s&&s,this._showEditorForReadOnlyMarkdown=null!==(i=e.showEditorForReadOnlyMarkdown)&&void 0!==i?i:ge.defaultShowEditorForReadOnlyMarkdown,this.placeholder=null===(n=e.placeholder)||void 0===n||n,this._monitor=new R.ActivityMonitor({signal:this.model.contentChanged,timeout:1e3}),this.ready.then((()=>{this.isDisposed||this._monitor.activityStopped.connect((()=>{this._rendered&&this.update()}),this)})).catch((e=>{console.error("Failed to be ready",e)}))}get headingInfo(){const e=this.headings;if(e.length>0){const{text:t,level:s}=e.reduce(((e,t)=>e.level<=t.level?e:t),e[0]);return{text:t,level:s}}return{text:"",level:-1}}get headings(){if(!this._headingsCache){const e=q.TableOfContentsUtils.Markdown.getHeadings(this.model.sharedModel.getSource());this._headingsCache=e.map((e=>({...e,type:he.HeadingType.Markdown})))}return[...this._headingsCache]}get headingCollapsed(){return this._headingCollapsed}set headingCollapsed(e){var t;if(this._headingCollapsed!==e){this._headingCollapsed=e,e?this.model.setMetadata(ne,e):"undefined"!==this.model.getMetadata(ne)&&this.model.deleteMetadata(ne);const s=null===(t=this.inputArea)||void 0===t?void 0:t.promptNode.getElementsByClassName(re)[0];s&&(e?s.classList.add("jp-mod-collapsed"):s.classList.remove("jp-mod-collapsed")),this.renderCollapseButtons(this._renderer),this._headingCollapsedChanged.emit(this._headingCollapsed)}}get numberChildNodes(){return this._numberChildNodes}set numberChildNodes(e){this._numberChildNodes=e,this.renderCollapseButtons(this._renderer)}get headingCollapsedChanged(){return this._headingCollapsedChanged}get rendered(){return this._rendered}set rendered(e){this.readOnly&&!1===this._showEditorForReadOnlyMarkdown&&(e=!0),e!==this._rendered&&(this._rendered=e,this._handleRendered().then((()=>{this._displayChanged.emit(),this._renderedChanged.emit(this._rendered)})).catch((e=>{console.error("Failed to render",e)})))}get renderedChanged(){return this._renderedChanged}get showEditorForReadOnly(){return this._showEditorForReadOnlyMarkdown}set showEditorForReadOnly(e){this._showEditorForReadOnlyMarkdown=e,!1===e&&(this.rendered=!0)}get renderer(){return this._renderer}dispose(){this.isDisposed||(this._monitor.dispose(),super.dispose())}initializeDOM(){this.placeholder&&(super.initializeDOM(),this.renderCollapseButtons(this._renderer),this._handleRendered().catch((e=>{console.error("Failed to render",e)})))}maybeCreateCollapseButton(){var e;const{level:t}=this.headingInfo;if(t>0&&0==(null===(e=this.inputArea)||void 0===e?void 0:e.promptNode.getElementsByClassName(re).length)){let e=this.inputArea.promptNode.appendChild(document.createElement("button"));e.className=`jp-Button ${re}`,e.setAttribute("data-heading-level",t.toString()),this._headingCollapsed?e.classList.add("jp-mod-collapsed"):e.classList.remove("jp-mod-collapsed"),e.onclick=e=>{this.headingCollapsed=!this.headingCollapsed}}}maybeCreateOrUpdateExpandButton(){const e=this.node.getElementsByClassName(oe);let t=this.translator.load("jupyterlab")._n("%1 cell hidden","%1 cells hidden",this._numberChildNodes);if(this.headingCollapsed&&this._numberChildNodes>0&&0==e.length){const e=document.createElement("button");e.className=`jp-mod-minimal jp-Button ${oe}`,h.addIcon.render(e);const s=document.createElement("div");s.textContent=t,e.appendChild(s),e.onclick=()=>{this.headingCollapsed=!1},this.node.appendChild(e)}if(this.headingCollapsed&&this._numberChildNodes>0&&1==e.length&&(e[0].childNodes[1].textContent=t),!(this.headingCollapsed&&this._numberChildNodes>0))for(const t of e)this.node.removeChild(t)}onContentChanged(){super.onContentChanged(),this._headingsCache=null}renderCollapseButtons(e){this.node.classList.toggle(ne,this._headingCollapsed),this.maybeCreateCollapseButton(),this.maybeCreateOrUpdateExpandButton()}renderInput(e){this.addClass(ae),this.placeholder||this.isDisposed||(this.renderCollapseButtons(e),this.inputArea.renderInput(e))}showEditor(){if(this.removeClass(ae),!this.placeholder&&!this.isDisposed){this.inputArea.showEditor();let e=(this.model.sharedModel.getSource().match(/^#+/g)||[""])[0].length;e>0&&this.inputArea.editor.setCursorPosition({column:e+1,line:0})}}onUpdateRequest(e){this._handleRendered().catch((e=>{console.error("Failed to render",e)})),super.onUpdateRequest(e)}updateCellSourceWithAttachment(e,t){var s,i;const n=``;null===(i=null===(s=this.editor)||void 0===s?void 0:s.replaceSelection)||void 0===i||i.call(s,n)}async _handleRendered(){this._rendered?(await this._updateRenderedInput(),this._rendered&&this.renderInput(this._renderer)):this.showEditor()}_updateRenderedInput(){if(this.placeholder)return Promise.resolve();const e=this.model,t=e&&e.sharedModel.getSource()||"Type Markdown and LaTeX: $ α^2 $";if(t!==this._prevText){const e=new G.MimeModel({data:{"text/markdown":t}});return this._prevText=t,this._renderer.renderModel(e)}return Promise.resolve()}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:!1,translator:this.translator})}}!function(e){e.defaultShowEditorForReadOnlyMarkdown=!0}(ge||(ge={}));class me extends he{constructor(e){super(e),this.addClass("jp-RawCell");const t=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",t.__("Raw Cell Content"))}clone(){return new(0,this.constructor)({model:this.model,contentFactory:this.contentFactory,placeholder:!1,translator:this.translator})}}}}]);
|