chore(build): 更新 embed 前端静态资源
同步 ./run.sh build 产出的 backend/static 哈希资源与 index.html。
This commit is contained in:
1 parent
8df0acb338
commit
1fd9a631e5
108 files changed
+142
-139
No files matched your search
@@ -0,0 +1,12 @@
|
||||
function Ou(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in n)){const r=Object.getOwnPropertyDescriptor(i,s);r&&Object.defineProperty(n,s,r.get?r:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var q1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var $s={exports:{}},Ti={};var cl;function Au(){if(cl)return Ti;cl=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,s,r){var o=null;if(r!==void 0&&(o=""+r),s.key!==void 0&&(o=""+s.key),"key"in s){r={};for(var l in s)l!=="key"&&(r[l]=s[l])}else r=s;return s=r.ref,{$$typeof:n,type:i,key:o,ref:s!==void 0?s:null,props:r}}return Ti.Fragment=e,Ti.jsx=t,Ti.jsxs=t,Ti}var fl;function Mu(){return fl||(fl=1,$s.exports=Au()),$s.exports}var Tu=Mu(),qs={exports:{}},F={};var ul;function Pu(){if(ul)return F;ul=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),u=Symbol.iterator;function d(g){return g===null||typeof g!="object"?null:(g=u&&g[u]||g["@@iterator"],typeof g=="function"?g:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,b={};function y(g,O,L){this.props=g,this.context=O,this.refs=b,this.updater=L||p}y.prototype.isReactComponent={},y.prototype.setState=function(g,O){if(typeof g!="object"&&typeof g!="function"&&g!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,g,O,"setState")},y.prototype.forceUpdate=function(g){this.updater.enqueueForceUpdate(this,g,"forceUpdate")};function v(){}v.prototype=y.prototype;function S(g,O,L){this.props=g,this.context=O,this.refs=b,this.updater=L||p}var T=S.prototype=new v;T.constructor=S,m(T,y.prototype),T.isPureReactComponent=!0;var C=Array.isArray;function A(){}var w={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function H(g,O,L){var R=L.ref;return{$$typeof:n,type:g,key:O,ref:R!==void 0?R:null,props:L}}function j(g,O){return H(g.type,O,g.props)}function W(g){return typeof g=="object"&&g!==null&&g.$$typeof===n}function B(g){var O={"=":"=0",":":"=2"};return"$"+g.replace(/[=:]/g,function(L){return O[L]})}var $=/\/+/g;function V(g,O){return typeof g=="object"&&g!==null&&g.key!=null?B(""+g.key):O.toString(36)}function K(g){switch(g.status){case"fulfilled":return g.value;case"rejected":throw g.reason;default:switch(typeof g.status=="string"?g.then(A,A):(g.status="pending",g.then(function(O){g.status==="pending"&&(g.status="fulfilled",g.value=O)},function(O){g.status==="pending"&&(g.status="rejected",g.reason=O)})),g.status){case"fulfilled":return g.value;case"rejected":throw g.reason}}throw g}function J(g,O,L,R,z){var X=typeof g;(X==="undefined"||X==="boolean")&&(g=null);var Y=!1;if(g===null)Y=!0;else switch(X){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(g.$$typeof){case n:case e:Y=!0;break;case c:return Y=g._init,J(Y(g._payload),O,L,R,z)}}if(Y)return z=z(g),Y=R===""?"."+V(g,0):R,C(z)?(L="",Y!=null&&(L=Y.replace($,"$&/")+"/"),J(z,O,L,"",function(ei){return ei})):z!=null&&(W(z)&&(z=j(z,L+(z.key==null||g&&g.key===z.key?"":(""+z.key).replace($,"$&/")+"/")+Y)),O.push(z)),1;Y=0;var Pe=R===""?".":R+":";if(C(g))for(var se=0;se<g.length;se++)R=g[se],X=Pe+V(R,se),Y+=J(R,O,L,X,z);else if(se=d(g),typeof se=="function")for(g=se.call(g),se=0;!(R=g.next()).done;)R=R.value,X=Pe+V(R,se++),Y+=J(R,O,L,X,z);else if(X==="object"){if(typeof g.then=="function")return J(K(g),O,L,R,z);throw O=String(g),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(g).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return Y}function oe(g,O,L){if(g==null)return g;var R=[],z=0;return J(g,R,"","",function(X){return O.call(L,X,z++)}),R}function be(g){if(g._status===-1){var O=g._result;O=O(),O.then(function(L){(g._status===0||g._status===-1)&&(g._status=1,g._result=L)},function(L){(g._status===0||g._status===-1)&&(g._status=2,g._result=L)}),g._status===-1&&(g._status=0,g._result=O)}if(g._status===1)return g._result.default;throw g._result}var ie=typeof reportError=="function"?reportError:function(g){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof g=="object"&Line truncated
|
||||
`){[e,t]=gi(this,e,t);let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new ce(i,s)),i=[],s=-1);return s>-1&&t.push(new ce(i,s)),t}}class nt extends G{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=gi(this,e,t),i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[s]=a,new nt(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
||||
`){[e,t]=gi(this,e,t);let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof nt))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new ce(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof nt)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof ce&&a&&(p=c[c.length-1])instanceof ce&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new ce(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:nt.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new nt(l,t)}}G.empty=new ce([""],0);function Nu(n){let e=-1;for(let t of n)e+=t.length+1;return e}function zn(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function bl(n,e,t){return zn(n,[""],e,t)}class Wi{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof ce?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof ce?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
||||
`,this;e--}else if(s instanceof ce){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof ce?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class xh{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Wi(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class kh{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(G.prototype[Symbol.iterator]=function(){return this.iter()},Wi.prototype[Symbol.iterator]=xh.prototype[Symbol.iterator]=kh.prototype[Symbol.iterator]=function(){return this});class Wu{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}function gi(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function ge(n,e,t=!0,i=!0){return Lu(n,e,t,i)}function Hu(n){return n>=56320&&n<57344}function Fu(n){return n>=55296&&n<56320}function De(n,e){let t=n.charCodeAt(e);if(!Fu(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Hu(i)?(t-55296<<10)+(i-56320)+65536:t}function Co(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function st(n){return n<65536?1:2}const Mr=/\r\n?|\n/;var Me=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(Me||(Me={}));class ht{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){Tr(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s,i)}return new ht(e)}composeDesc(e){return this.empty?e:e.empty?this:vh(this,e)}mapDesc(e,t=!1){return e.empty?this:Pr(this,e,t)}mapPos(e,t=-1,i=Me.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=s+l;if(a<0){if(h>e)return r+(e-s);r+=l}else{if(i!=Me.Simple&&h>=e&&(i==Me.TrackDel&&s<e&&h>e||i==Me.TrackBefore&&s<e||i==Me.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+i+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ht(e)}static create(e){return new ht(e)}}class de extends ht{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Tr(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return Pr(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s<t.length;s+=2){let o=t[s],l=t[s+1];if(l>=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length<a;)i.push(G.empty);i.push(o?e.slice(r,r+o):G.empty)}r+=o}return new de(t,i)}compose(e){return this.empty?e:e.empty?this:vh(this,e,!0)}map(e,t=!1){return e.empty?this:Pr(this,e,t,!0)}iterChanges(e,t=!1){Tr(this,e,t)}get desc(){return ht.cr
Line truncated
|
||||
`}get readOnly(){return this.facet(Ph)}phrase(e,...t){for(let i of this.facet(U.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(Oh))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return Gu(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=ge(t,o,!1);if(r(t.slice(a,o))!=re.Word)break;o=a}for(;l<s;){let a=ge(t,l);if(r(t.slice(l,a))!=re.Word)break;l=a}return o==l?null:k.range(o+i,l+i)}}U.allowMultipleSelections=Er;U.tabSize=D.define({combine:n=>n.length?n[0]:4});U.lineSeparator=Ch;U.readOnly=Ph;U.phrases=D.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});U.languageData=Oh;U.changeFilter=Ah;U.transactionFilter=Mh;U.transactionExtender=Th;Cs.reconfigure=Q.define();function ft(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class Mt{eq(e){return this==e}range(e,t=e){return Ir.create(e,t,this)}}Mt.prototype.startSide=Mt.prototype.endSide=0;Mt.prototype.point=!1;Mt.prototype.mapMode=Me.TrackDel;function To(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let Ir=class Eh{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Eh(e,t,i)}};function Nr(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Po{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let h=this.value[a],c=this.from[a]+e,f=this.to[a]+e,u,d;if(c==f){let p=t.mapPos(c,h.startSide,h.mapMode);if(p==null||(u=d=p,h.startSide!=h.endSide&&(d=t.mapPos(c,h.endSide),d<u)))continue}else if(u=t.mapPos(c,h.startSide),d=t.mapPos(f,h.endSide),u>d||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Po(s,r,i,l):null,pos:o}}}class _{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new _(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Nr)),this.isEmpty)return t.length?_.of(t):this;let l=new Bh(this,null,-1).goto(0),a=0,h=[],c=new bt;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||h.push(Ir.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!h.length?_.empty:this.nextLayer.update({add:h,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],h=e.touchesRange(l,l+a.length);if(h===!1)s=Math.max(s,a.maxPoint),t.push(a),i.push(e.mapPos(l));else if(h===!0){let{mapped:c,pos:f}=a.map(l,e);c&&(s=Math.max(s,c.maxPoint),t.push(c),i.push(f))}}let r=this.nextLayer.map(e);return t.length==0?r:new _(i,t,r||_.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Ui.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ui.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t
Line truncated
|
||||
`)}static newName(){let e=Sl[wl]||1;return Sl[wl]=e+1,Fr+e.toString(36)}static mount(e,t,i){let s=e[Vr],r=i&&i.nonce;s?r&&s.setNonce(r):s=new Ju(e,r),s.mount(Array.isArray(t)?t:[t],e)}}let Ol=new Map;class Ju{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=Ol.get(i);if(r)return e[Vr]=r;this.sheet=new s.CSSStyleSheet,Ol.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Vr]=this}mount(e,t){let i=this.sheet,s=0,r=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<r&&a>-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let h=0;h<l.rules.length;h++)i.insertRule(l.rules[h],s++)}else{for(;r<a;)s+=this.modules[r++].rules.length;s+=l.rules.length,r++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
|
||||
`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Pt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ji={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Zu=typeof navigator<"u"&&/Mac/.test(navigator.platform),ed=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ke=0;ke<10;ke++)Pt[48+ke]=Pt[96+ke]=String(ke);for(var ke=1;ke<=24;ke++)Pt[ke+111]="F"+ke;for(var ke=65;ke<=90;ke++)Pt[ke]=String.fromCharCode(ke+32),ji[ke]=String.fromCharCode(ke);for(var Us in Pt)ji.hasOwnProperty(Us)||(ji[Us]=Pt[Us]);function td(n){var e=Zu&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||ed&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ji:Pt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Z(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;e<arguments.length;e++)Lh(n,arguments[e]);return n}function Lh(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)Lh(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}let Ae=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},zr=typeof document<"u"?document:{documentElement:{style:{}}};const Qr=/Edge\/(\d+)/.exec(Ae.userAgent),Ih=/MSIE \d/.test(Ae.userAgent),$r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ae.userAgent),As=!!(Ih||$r||Qr),Cl=!As&&/gecko\/(\d+)/i.test(Ae.userAgent),js=!As&&/Chrome\/(\d+)/.exec(Ae.userAgent),Al="webkitFontSmoothing"in zr.documentElement.style,qr=!As&&/Apple Computer/.test(Ae.vendor),Ml=qr&&(/Mobile\/\w+/.test(Ae.userAgent)||Ae.maxTouchPoints>2);var E={mac:Ml||/Mac/.test(Ae.platform),windows:/Win/.test(Ae.platform),linux:/Linux|X11/.test(Ae.platform),ie:As,ie_version:Ih?zr.documentMode||6:$r?+$r[1]:Qr?+Qr[1]:0,gecko:Cl,gecko_version:Cl?+(/Firefox\/(\d+)/.exec(Ae.userAgent)||[0,0])[1]:0,chrome:!!js,chrome_version:js?+js[1]:0,ios:Ml,android:/Android\b/.test(Ae.userAgent),webkit:Al,webkit_version:Al?+(/\bAppleWebKit\/(\d+)/.exec(Ae.userAgent)||[0,0])[1]:0,safari:qr,safari_version:qr?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Ae.userAgent)||[0,0])[1]:0,tabSize:zr.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Do(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const Jn=Object.create(null);function Ro(n,e,t){if(n==e)return!0;n||(n=Jn),e||(e=Jn);let i=Object.keys(n),s=Object.keys(e);if(i.length-0!=s.length-0)return!1;for(let r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function id(n,e){for(let t=n.attributes.length-1;t>=0;t--){let i=n.attributes[t].name;e[i]==null&&n.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?n.style.cssText=i:n.getAttribute(t)!=i&&n.setAttribute(t,i)}}function Tl(n,e,t){let i=!1;if(e)for(let s in e)t&&s in t||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(i=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return i}function nd(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let i=n.attributes[t];e[i.name]=i.value}return e}class ut{eq(e){return!1}updateDOM(e,t,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var ve=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(ve||(ve={}));class I extends Mt{constructor(e,t,i,s){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return nLine truncated
|
||||
`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=n.visualLineSide(s,!t)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function qd(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==re.Space&&(s=o),s==o}}function _d(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return k.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let p=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-p.from))),l=(r<0?p.top:p.bottom)+c}let f=a.left+o,u=n.viewState.heightOracle.textHeight>>1,d=i??u;for(let p=0;;p+=u){let m=l+(d+p)*r,b=Jr(n,{x:f,y:m},!1,r);if(t?m>a.bottom:m<a.top)return k.cursor(b.pos,b.assoc);let y=n.coordsAtPos(b.pos,b.assoc),v=y?(y.top+y.bottom)/2:0;if(!y||(t?v>l:v<l))return k.cursor(b.pos,b.assoc,void 0,o)}}function Qi(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let a=i||t||(e-r<o-e?-1:1);e=a<0?r:o,i=a}});if(!i)return e}}function cc(n,e){let t=null;for(let i=0;i<e.ranges.length;i++){let s=e.ranges[i],r=null;if(s.empty){let o=Qi(n,s.from,0);o!=s.from&&(r=k.cursor(o,-1))}else{let o=Qi(n,s.from,-1),l=Qi(n,s.to,1);(o!=s.from||l!=s.to)&&(r=k.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(t||(t=e.ranges.slice()),t[i]=r)}return t?k.create(t,e.mainIndex):e}function Zs(n,e,t){let i=Qi(n.state.facet(un).map(s=>s(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:k.cursor(i,i<t.from?1:-1)}class rt{constructor(e,t){this.pos=e,this.assoc=t}}function Jr(n,e,t,i){let s=n.contentDOM.getBoundingClientRect(),r=s.top+n.viewState.paddingTop,{x:o,y:l}=e,a=l-r,h;for(;;){if(a<0)return new rt(0,1);if(a>n.viewState.docHeight)return new rt(n.state.doc.length,-1);if(h=n.elementAtHeight(a),i==null)break;if(h.type==ve.Text){if(i<0?h.to<n.viewport.from:h.from>n.viewport.to)break;let u=n.docView.coordsAt(i<0?h.from:h.to,i>0?-1:1);if(u&&(i<0?u.top<=a+r:u.bottom>=a+r))break}let f=n.viewState.heightOracle.textHeight/2;a=i>0?h.bottom+f:h.top-f}if(n.viewport.from>=h.to||n.viewport.to<=h.from){if(t)return null;if(h.type==ve.Text){let f=Qd(n,s,h,o,l);return new rt(f,f==h.from?1:-1)}}if(h.type!=ve.Text)return a<(h.top+h.bottom)/2?new rt(h.from,1):new rt(h.to,-1);let c=n.docView.lineAt(h.from,2);return(!c||c.length!=h.length)&&(c=n.docView.lineAt(h.from,-2)),new Xd(n,o,l,n.textDirectionAt(h.from)).scanTile(c,h.from)}class Xd{constructor(e,t,i,s){this.view=e,this.x=t,this.y=i,this.baseDir=s,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:i,spans:s}=this.bidiSpansAt(e);return s[ot.find(s,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:s}=this.bidiSpansAt(e);return s[ot.find(s,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:s}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+s.from<t)}scan(e,t,i=!1){let s=0,r=e.length-1,o=new Set,l=this.bidiIn(e[0],e[r]),a,h,c=-1,f=1e9,u;e:for(;s<r;){let p=r-s,m=s+r>>1;t:if(o.has(m)){let y=s+Math.floor(Math.random()*p);for(let v=0;v<p;v++){if(!o.has(y)){m=y;break t}y++,y==r&&(y=s)}break e}o.add(m);let b=t(m);if(b)for(let y=0;y<b.length;y++){let v=b[y],S=0;if(!(v.width==0&&b.length>1)){if(v.bottom<this.y)(!a||a.bottom<v.bottom)&&(a=v),S=1;else if(v.top>this.y)(!h||h.top>v.top)&&(h=v),S=-1;else{let T=v.left>this.x?this.x-v.left:v.right<this.x?this.x-v.right:0,C=Math.abs(T);C<f&&(c=m,f=C,u=v),T&&(S=T<0==(this.baseDir==te.LTR)?-1:1)}S==-1&&(!l||this.baseDirAt(e[m],1))?r=m:S==1&&(!l||this.baseDirAt(e[m+1],-1))&&(s=m+1)}}}if(!u){if(!h&&!a)return{i:e[0],after:!1};let p=a&&(!h||this.y-a.bottom<h.top-this.y)?a:h;return this.y=(p.top+p.bottom)/2,this.scan(e,t,!0)}if(f&&!i){let{top:p,bottom:m}=u;if(a&&a.bottom>(p+p+m)/3)return this.y=a.bottom-1,this.scan(e,t,!0);if(h&&h.top<(p+m+m)/3)return this.y=h.top+1,this.scan(e,t,!0)}let d=(l?this.dirAt(e[c],1):this.baseDir)==te.LTR;return{i:c,after:this.x>(u.left+u.right)/2==d}}scanText(e,t){let i=[];for(let r=0;r<e.length;r=ge(e.text,r))i.push(t+r);i.push(t+e.length);let s=this.scan(i,r=>{let o=i[r]-t,l=i[r+1]-t;return Ji(e.dom,o,l).getClientRects()});return s.after?new rt(i[s.i+1],-1):new rt(i[s.i],1)}scanTile(e,t){if(!e.length)return new rt(t,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,t);if(l.isComposite())return this.scanTile(l,t)}let i=[t];for(let l=0,a=t;l<e.children.length;l++)i.push(a+=e.children[l].length);let s=this.scan(i,l=>{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:Ji(a.dom,0,a.length)).getClientRects()}),r=e.children[s.i],o=i[s.i];return r.isText()?this.scanText(r,o):r.isComposite()?this.scanTile(r,o):s.after?new rt(i[s.i+1],-1):new rt(o,1)}}const ti="";class Ud{constructor(e,t){this.points=e,this.
Line truncated
|
||||
`&&n.lineWrapping&&(i&&(i=k.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:G.of([" "])}),t)return Ho(n,t,i,o);if(i&&!ns(i,r)){let l=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(l=!0),a=n.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=cc(s.facet(un).map(h=>h(n)),i))),n.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function Ho(n,e,t,i=-1){if(E.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(E.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&n.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&fi(n.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&fi(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&fi(n.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=Yd(n,e,t));return n.state.facet(Jh).some(a=>a(n,e.from,e.to,r,l))||n.dispatch(l()),!0}function Yd(n,e,t){let i,s=n.state,r=s.selection.main,o=-1;if(e.from==e.to&&e.from<r.from||e.from>r.to){let a=e.from<r.from?-1:1,h=a<0?r.from:r.to,c=Qi(s.facet(un).map(f=>f(n)),h,a);e.from==c&&(o=c)}if(o>-1)i={changes:e,selection:k.cursor(e.from+e.insert.length,-1)};else if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let a=r.from<e.from?s.sliceDoc(r.from,e.from):"",h=r.to>e.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(a+e.insert.sliceString(0,void 0,n.state.lineBreak)+h))}else{let a=s.changes(e),h=t&&t.main.to<=a.newLength?t.main:void 0;if(s.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=r.to+10&&e.to>=r.to-10){let c=n.state.sliceDoc(e.from,e.to),f,u=t&&hc(n,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);f={from:u.from,to:u.to-p}}else f=n.state.doc.lineAt(r.head);let d=r.to-e.to;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:a,range:h||p.map(a)};let m=p.to-d,b=m-c.length;if(n.state.sliceDoc(b,m)!=c||m>=f.from&&b<=f.to)return{range:p};let y=s.changes({from:b,to:m,insert:e.insert}),v=p.to-r.to;return{changes:y,range:h?k.range(Math.max(0,h.anchor+v),Math.max(0,h.head+v)):p.map(y)}})}else i={changes:a,selection:h&&s.selection.replaceRange(h)}}let l="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,l+=".compose",n.inputState.compositionFirstChange&&(l+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:l,scrollIntoView:!0})}function dc(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o<r&&n.length<e.length){let a=t<=r&&t>=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=t<=r&&t>=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Jd(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new Nl(t,i)),(s!=t||r!=i)&&e.push(new Nl(s,r))),e}function Zd(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?k.single(t+e,i+e):null}function ns(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class ep{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,E.safari&&e.contentDOM.addEventListener("input",()=>null),E.gecko&&mp(e.contentDOM.ownerDocument)}handleEvent(e){!ap(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let s of i.observers)s(this.view,t);for(let s of i.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=tp(e),i=this.handlers,s=this.view.contentDOM;
Line truncated
|
||||
`))};if((E.mac||E.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:G.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let u=this.to-this.from+(f.to-f.from+f.insert.length);Ho(e,f,k.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}t.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(r.rangeStart),h=this.toEditorPos(r.rangeEnd);if(a<h){let c=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;s.push(I.mark({attributes:{style:c}}).range(a,h))}}}e.dispatch({effects:nc.of(I.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=Gi(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,s=this.pendingContextChange;return e.changes.iterChanges((r,o,l,a,h)=>{if(i)return;let c=h.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(h)){s=this.pendingContextChange=null,t+=c,this.to+=c;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class P{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureReque
Line truncated
|
||||
--\u2028\u2029\uFEFF-]`,so),Zp={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let ir=null;function em(){var n;if(ir==null&&typeof document<"u"&&document.body){let e=document.body.style;ir=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return ir||!1}const _n=D.define({combine(n){let e=ft(n,{render:null,specialChars:Jp,addSpecialChars:null});return(e.replaceTabs=!em())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,so)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,so)),e}});function tm(n={}){return[_n.of(n),im()]}let sa=null;function im(){return sa||(sa=he.fromClass(class{constructor(n){this.view=n,this.decorations=I.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(_n)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Yp({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=De(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=Oi(o.text,l,i-o.from);return I.replace({widget:new om((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=I.replace({widget:new rm(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(_n);n.startState.facet(_n)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const nm="•";function sm(n){return n>=32?nm:n==10?"":String.fromCharCode(9216+n)}class rm extends ut{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=sm(this.code),i=e.state.phrase("Control character")+" "+(Zp[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class om extends ut{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function lm(){return hm}const am=I.line({class:"cm-activeLine"}),hm=he.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let s=n.lineBlockAt(i.head);s.from>e&&(t.push(am.range(s.from)),e=s.from)}return I.set(t)}},{decorations:n=>n.decorations});class cm extends ut{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?Vi(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=Yi(t[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function fm(n){let e=he.fromClass(class{constructor(t){this.view=t,this.placeholder=n?I.set([I.widget({widget:new cm(n),side:1}).range(0)]):I.none}get decorations(){return this.view.state.doc.length?I.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,P.contentAttributes.of({"aria-placeholder":n})]:e}const ro=2e3;function um(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>ro||t.off>ro||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(k.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=Hr(h.text,o,n.tabSize,!0);if(c<0)r.push(k.cursor(h.to));else{let f=Hr(h.text,l,n.tabSize);r.push(k.range(h.from+c,h.from+f))}}}return r}function dm(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function ra(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>ro?-1:s==i.length?dm(n,e.clientX):Oi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function pm(n,e){let t=ra(n,e),i=n.s
Line truncated
|
||||
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Mb(this):new Ob(this)}getCursor(e,t=0,i){let s=e.doc?e:U.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?ni(this,s,t,i):ii(this,s,t,i)}}class Kf{constructor(e){this.spec=e}}function wb(n,e,t){return(i,s,r,o)=>{if(t&&!t(i,s,r,o))return!1;let l=i>=o&&s<=o+r.length?r.slice(i-o,s-o):e.doc.sliceString(i,s);return n(l,e,i,s)}}function ii(n,e,t,i){let s;return n.wholeWord&&(s=Sb(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(s=wb(n.test,e,s)),new wi(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:r=>r.toLowerCase(),s)}function Sb(n,e){return(t,i,s,r)=>((r>t||r+s.length<i)&&(r=Math.max(0,t-2),s=n.sliceString(r,Math.min(n.length,i+2))),(e(ms(s,t-r))!=re.Word||e(gs(s,t-r))!=re.Word)&&(e(gs(s,i-r))!=re.Word||e(ms(s,i-r))!=re.Word))}class Ob extends Kf{constructor(e){super(e)}nextMatch(e,t,i){let s=ii(this.spec,e,i,e.doc.length).nextOverlapping();if(s.done){let r=Math.min(e.doc.length,t+this.spec.unquoted.length);s=ii(this.spec,e,0,r).nextOverlapping()}return s.done||s.value.from==t&&s.value.to==i?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=ii(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){let s=this.prevMatchInRange(e,0,t);return s||(s=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=t||s.to!=i)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=ii(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=ii(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Cb(n,e,t){return(i,s,r)=>(!t||t(i,s,r))&&n(r[0],e,i,s)}function ni(n,e,t,i){let s;return n.wholeWord&&(s=Ab(e.charCategorizer(e.selection.main.head))),n.test&&(s=Cb(n.test,e,s)),new Xf(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:s},t,i)}function ms(n,e){return n.slice(ge(n,e,!1),e)}function gs(n,e){return n.slice(e,ge(n,e))}function Ab(n){return(e,t,i)=>!i[0].length||(n(ms(i.input,i.index))!=re.Word||n(gs(i.input,i.index))!=re.Word)&&(n(gs(i.input,i.index+i[0].length))!=re.Word||n(ms(i.input,i.index+i[0].length))!=re.Word)}class Mb extends Kf{nextMatch(e,t,i){let s=ni(this.spec,e,i,e.doc.length).next();return s.done&&(s=ni(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=ni(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let s=i.length;s>0;s--){let r=+i.slice(0,s);if(r>0&&r<e.match.length)return e.match[r]+i.slice(s)}return t})}matchAll(e,t){let i=ni(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=ni(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const sn=Q.define(),el=Q.define(),At=Oe.define({create(n){return new gr(xo(n).create(),null)},update(n,e){for(let t of e.effects)t.is(sn)?n=new gr(t.value.create(),n.panel):t.is(el)&&(n=new gr(n.query,t.value?tl:null));return n},provide:n=>Zi.from(n,e=>e.panel)});class gr{constructor(e,t){this.query=e,this.panel=t}}const Tb=I.mark({class:"cm-searchMatch"}),Pb=I.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Db=he.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(At))}update(n){let e=n.state.field(At);(e!=n.startState.field(At)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return I.none;let{view:t}=this,i=new bt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-500;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Pb:Tb)})}return i.finish()}},{decorations:n=>n.decorations});function gn(n){return e=>{let t=e.state.field(At,!1);return t&&t.query.spec.valid?n(e,t):Jf(e)}}const bs=gn((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=k.single(i.from,i.to),r=n.state.facet(Ai);return n.dispatch({selection:s,effects:[il(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),Yf(n),!0}),ys=gn((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return
Line truncated
|
||||
Reference in new issue
Block a user