@sync-in/server 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +164 -58
- package/environment/environment.dist.yaml +6 -3
- package/migrations/0003_giant_luckman.sql +6 -0
- package/migrations/meta/0003_snapshot.json +2463 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +16 -15
- package/server/app.bootstrap.js +1 -0
- package/server/app.bootstrap.js.map +1 -1
- package/server/app.constants.js +0 -4
- package/server/app.constants.js.map +1 -1
- package/server/app.service.js +7 -6
- package/server/app.service.js.map +1 -1
- package/server/applications/files/constants/only-office.js +12 -0
- package/server/applications/files/constants/only-office.js.map +1 -1
- package/server/applications/files/files.config.js +5 -0
- package/server/applications/files/files.config.js.map +1 -1
- package/server/applications/files/services/files-content-manager.service.js +6 -6
- package/server/applications/files/services/files-content-manager.service.js.map +1 -1
- package/server/applications/files/services/files-manager.service.js +4 -4
- package/server/applications/files/services/files-manager.service.js.map +1 -1
- package/server/applications/files/services/files-methods.service.js +5 -3
- package/server/applications/files/services/files-methods.service.js.map +1 -1
- package/server/applications/files/services/files-only-office-manager.service.js +2 -2
- package/server/applications/files/services/files-only-office-manager.service.js.map +1 -1
- package/server/applications/files/services/files-parser.service.js +6 -3
- package/server/applications/files/services/files-parser.service.js.map +1 -1
- package/server/applications/files/services/files-scheduler.service.js +51 -3
- package/server/applications/files/services/files-scheduler.service.js.map +1 -1
- package/server/applications/files/services/files-search-manager.service.js +4 -0
- package/server/applications/files/services/files-search-manager.service.js.map +1 -1
- package/server/applications/files/utils/doc-textify/adapters/pdf.js +10 -1
- package/server/applications/files/utils/doc-textify/adapters/pdf.js.map +1 -1
- package/server/applications/notifications/i18n/de.js +56 -0
- package/server/applications/notifications/i18n/de.js.map +1 -0
- package/server/applications/notifications/i18n/es.js +52 -0
- package/server/applications/notifications/i18n/es.js.map +1 -0
- package/server/applications/notifications/i18n/hi.js +52 -0
- package/server/applications/notifications/i18n/hi.js.map +1 -0
- package/server/applications/notifications/i18n/index.js +73 -8
- package/server/applications/notifications/i18n/index.js.map +1 -1
- package/server/applications/notifications/i18n/it.js +52 -0
- package/server/applications/notifications/i18n/it.js.map +1 -0
- package/server/applications/notifications/i18n/ja.js +52 -0
- package/server/applications/notifications/i18n/ja.js.map +1 -0
- package/server/applications/notifications/i18n/ko.js +52 -0
- package/server/applications/notifications/i18n/ko.js.map +1 -0
- package/server/applications/notifications/i18n/pl.js +52 -0
- package/server/applications/notifications/i18n/pl.js.map +1 -0
- package/server/applications/notifications/i18n/pt.js +52 -0
- package/server/applications/notifications/i18n/pt.js.map +1 -0
- package/server/applications/notifications/i18n/pt_br.js +52 -0
- package/server/applications/notifications/i18n/pt_br.js.map +1 -0
- package/server/applications/notifications/i18n/ru.js +52 -0
- package/server/applications/notifications/i18n/ru.js.map +1 -0
- package/server/applications/notifications/i18n/tr.js +52 -0
- package/server/applications/notifications/i18n/tr.js.map +1 -0
- package/server/applications/notifications/i18n/zh.js +52 -0
- package/server/applications/notifications/i18n/zh.js.map +1 -0
- package/server/applications/notifications/mails/models.js +6 -7
- package/server/applications/notifications/mails/models.js.map +1 -1
- package/server/applications/notifications/services/notifications-manager.service.js.map +1 -1
- package/server/applications/shares/dto/create-or-update-share.dto.js +11 -0
- package/server/applications/shares/dto/create-or-update-share.dto.js.map +1 -1
- package/server/applications/shares/interfaces/share-props.interface.js.map +1 -1
- package/server/applications/shares/schemas/share.interface.js.map +1 -1
- package/server/applications/shares/schemas/shares.schema.js +9 -0
- package/server/applications/shares/schemas/shares.schema.js.map +1 -1
- package/server/applications/shares/services/shares-manager.service.js +46 -17
- package/server/applications/shares/services/shares-manager.service.js.map +1 -1
- package/server/applications/shares/services/shares-queries.service.js +24 -5
- package/server/applications/shares/services/shares-queries.service.js.map +1 -1
- package/server/applications/spaces/constants/cache.js +4 -0
- package/server/applications/spaces/constants/cache.js.map +1 -1
- package/server/applications/spaces/dto/create-or-update-space.dto.js +5 -0
- package/server/applications/spaces/dto/create-or-update-space.dto.js.map +1 -1
- package/server/applications/spaces/guards/space.guard.js +3 -3
- package/server/applications/spaces/guards/space.guard.js.map +1 -1
- package/server/applications/spaces/models/space-props.model.js.map +1 -1
- package/server/applications/spaces/models/space.model.js.map +1 -1
- package/server/applications/spaces/schemas/space.interface.js.map +1 -1
- package/server/applications/spaces/schemas/spaces.schema.js +1 -0
- package/server/applications/spaces/schemas/spaces.schema.js.map +1 -1
- package/server/applications/spaces/services/spaces-browser.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-manager.service.js +34 -31
- package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-queries.service.js +23 -7
- package/server/applications/spaces/services/spaces-queries.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-scheduler.service.js +21 -20
- package/server/applications/spaces/services/spaces-scheduler.service.js.map +1 -1
- package/server/applications/spaces/spaces.controller.js +4 -2
- package/server/applications/spaces/spaces.controller.js.map +1 -1
- package/server/applications/spaces/utils/paths.js +14 -16
- package/server/applications/spaces/utils/paths.js.map +1 -1
- package/server/applications/sync/services/sync-manager.service.js +4 -3
- package/server/applications/sync/services/sync-manager.service.js.map +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.js +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.js.map +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.spec.js +1 -1
- package/server/applications/sync/services/sync-paths-manager.service.spec.js.map +1 -1
- package/server/applications/sync/sync.controller.js +2 -1
- package/server/applications/sync/sync.controller.js.map +1 -1
- package/server/applications/users/constants/routes.js +5 -0
- package/server/applications/users/constants/routes.js.map +1 -1
- package/server/applications/users/constants/user.js +0 -16
- package/server/applications/users/constants/user.js.map +1 -1
- package/server/applications/users/dto/user-properties.dto.js +10 -0
- package/server/applications/users/dto/user-properties.dto.js.map +1 -1
- package/server/applications/users/models/user.model.js.map +1 -1
- package/server/applications/users/schemas/user.interface.js.map +1 -1
- package/server/applications/users/schemas/users.schema.js +3 -2
- package/server/applications/users/schemas/users.schema.js.map +1 -1
- package/server/applications/users/services/admin-users-manager.service.js +1 -0
- package/server/applications/users/services/admin-users-manager.service.js.map +1 -1
- package/server/applications/users/services/admin-users-manager.service.spec.js +2 -1
- package/server/applications/users/services/admin-users-manager.service.spec.js.map +1 -1
- package/server/applications/users/services/users-manager.service.js +8 -2
- package/server/applications/users/services/users-manager.service.js.map +1 -1
- package/server/applications/users/services/users-manager.service.spec.js +1 -0
- package/server/applications/users/services/users-manager.service.spec.js.map +1 -1
- package/server/applications/users/services/users-queries.service.js +18 -4
- package/server/applications/users/services/users-queries.service.js.map +1 -1
- package/server/applications/users/users.controller.js +15 -0
- package/server/applications/users/users.controller.js.map +1 -1
- package/server/applications/users/utils/test.js +2 -2
- package/server/applications/users/utils/test.js.map +1 -1
- package/server/applications/webdav/constants/routes.js +2 -2
- package/server/applications/webdav/constants/routes.js.map +1 -1
- package/server/applications/webdav/constants/webdav.js +2 -2
- package/server/applications/webdav/constants/webdav.js.map +1 -1
- package/server/applications/webdav/filters/webdav.filter.js +2 -2
- package/server/applications/webdav/filters/webdav.filter.js.map +1 -1
- package/server/applications/webdav/filters/webdav.filter.spec.js +2 -2
- package/server/applications/webdav/filters/webdav.filter.spec.js.map +1 -1
- package/server/applications/webdav/services/webdav-methods.service.js +3 -2
- package/server/applications/webdav/services/webdav-methods.service.js.map +1 -1
- package/server/applications/webdav/utils/webdav.js +1 -2
- package/server/applications/webdav/utils/webdav.js.map +1 -1
- package/server/authentication/auth.config.js +2 -2
- package/server/authentication/auth.config.js.map +1 -1
- package/server/authentication/guards/auth-basic.strategy.js +2 -2
- package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
- package/server/common/i18n.js +52 -0
- package/server/common/i18n.js.map +1 -0
- package/server/common/image.js +49 -33
- package/server/common/image.js.map +1 -1
- package/server/common/interfaces.js.map +1 -1
- package/server/common/shared.js +5 -2
- package/server/common/shared.js.map +1 -1
- package/server/configuration/config.validation.js +3 -3
- package/server/configuration/config.validation.js.map +1 -1
- package/server/infrastructure/cache/adapters/mysql-cache.adapter.js +8 -6
- package/server/infrastructure/cache/adapters/mysql-cache.adapter.js.map +1 -1
- package/server/infrastructure/cache/adapters/redis-cache.adapter.js +22 -17
- package/server/infrastructure/cache/adapters/redis-cache.adapter.js.map +1 -1
- package/server/infrastructure/cache/cache.e2e-spec.js +1 -0
- package/server/infrastructure/cache/cache.e2e-spec.js.map +1 -1
- package/server/infrastructure/cache/cache.module.js +1 -14
- package/server/infrastructure/cache/cache.module.js.map +1 -1
- package/server/infrastructure/cache/services/cache.service.js.map +1 -1
- package/server/infrastructure/database/database.module.js +20 -1
- package/server/infrastructure/database/database.module.js.map +1 -1
- package/server/infrastructure/database/utils.js +48 -0
- package/server/infrastructure/database/utils.js.map +1 -1
- package/server/infrastructure/scheduler/scheduler.module.js +1 -1
- package/server/infrastructure/scheduler/scheduler.module.js.map +1 -1
- package/server/infrastructure/websocket/adapters/cluster.adapter.js +1 -3
- package/server/infrastructure/websocket/adapters/cluster.adapter.js.map +1 -1
- package/static/3rdpartylicenses.txt +137 -137
- package/static/chunk-2KLC4T2Z.js +1 -0
- package/static/chunk-373XVRXW.js +1 -0
- package/static/chunk-3GMLWAFZ.js +1 -0
- package/static/chunk-3XVM35O2.js +1 -0
- package/static/chunk-3YVRP3VM.js +2 -0
- package/static/chunk-5NMSIIQB.js +1 -0
- package/static/chunk-AF24EYXU.js +1 -0
- package/static/chunk-AKQVEHO6.js +2 -0
- package/static/{chunk-PTGDOWV3.js → chunk-AY2SZ3G6.js} +1 -1
- package/static/chunk-BCVX464U.js +2 -0
- package/static/{chunk-IPAC4VAF.js → chunk-BIKLW4YS.js} +1 -1
- package/static/chunk-C36MW4ME.js +562 -0
- package/static/chunk-CHJ64RJM.js +1 -0
- package/static/chunk-DKSEQTMX.js +1 -0
- package/static/chunk-DM4NXKEP.js +1 -0
- package/static/chunk-DPUVSXRB.js +1 -0
- package/static/chunk-DSWEWLXJ.js +1 -0
- package/static/chunk-FJE6BOFL.js +1 -0
- package/static/chunk-FZ3JPGYZ.js +1 -0
- package/static/chunk-GUGNR5TF.js +3 -0
- package/static/chunk-H6NE33VX.js +1 -0
- package/static/{chunk-DJYJ66UF.js → chunk-HAS5ZOTR.js} +1 -1
- package/static/chunk-HNQRZALS.js +1 -0
- package/static/chunk-JPT5WEAT.js +1 -0
- package/static/{chunk-QNJFQVYI.js → chunk-JSWCNGXJ.js} +1 -1
- package/static/chunk-KFJIQIGR.js +1 -0
- package/static/chunk-LNTUR3GU.js +1 -0
- package/static/chunk-LVM4QB22.js +1 -0
- package/static/chunk-M3XVNQZQ.js +1 -0
- package/static/{chunk-EVIE5F2U.js → chunk-MFLIJH6T.js} +1 -1
- package/static/{chunk-IQOALFYU.js → chunk-MSUHTBB2.js} +1 -1
- package/static/chunk-N3U6637P.js +1 -0
- package/static/chunk-NNV4OXSB.js +1 -0
- package/static/chunk-NO2LTNW3.js +1 -0
- package/static/chunk-OOGP4WSH.js +2 -0
- package/static/chunk-PB4AIT7O.js +1 -0
- package/static/chunk-PCWDQPOM.js +2 -0
- package/static/chunk-PGZZP5W3.js +1 -0
- package/static/chunk-PVDHBQRM.js +1 -0
- package/static/chunk-Q5KM7LTX.js +1 -0
- package/static/chunk-QHC6ZPQ4.js +1 -0
- package/static/chunk-QO6BTONN.js +1 -0
- package/static/chunk-QZU2S5CV.js +1 -0
- package/static/chunk-SBZ572Q4.js +2 -0
- package/static/chunk-SHIVUDP3.js +1 -0
- package/static/chunk-SLHTEGRU.js +1 -0
- package/static/{chunk-SH5EVL4E.js → chunk-SSFF27P2.js} +1 -1
- package/static/chunk-TPYBFZS5.js +1 -0
- package/static/chunk-UEQCWMXD.js +1 -0
- package/static/chunk-UG5DMXYO.js +1 -0
- package/static/chunk-UJPPR4MX.js +1 -0
- package/static/chunk-UNCPXHHT.js +1 -0
- package/static/chunk-URHTCJ7G.js +1 -0
- package/static/chunk-V3AT2BKP.js +1 -0
- package/static/chunk-VKK5BSLX.js +1 -0
- package/static/{chunk-SIPE37PA.js → chunk-VM4YX6Q7.js} +1 -1
- package/static/chunk-WJW7CT6G.js +27 -0
- package/static/{chunk-7ITZXYYJ.js → chunk-WLMNXRBS.js} +1 -1
- package/static/chunk-X5XGK6T7.js +4 -0
- package/static/chunk-YEKR5OPO.js +1 -0
- package/static/chunk-YW57T2PF.js +1 -0
- package/static/chunk-Z5J5F5SX.js +1 -0
- package/static/chunk-ZIJQRARU.js +1 -0
- package/static/chunk-ZPF2DSQV.js +1 -0
- package/static/chunk-ZTCRGJ6Y.js +7 -0
- package/static/index.html +2 -2
- package/static/main-VOL6OMJ5.js +9 -0
- package/static/scripts-WRDOQIU5.js +24 -0
- package/static/{styles-A5VYX3CE.css → styles-2C2UNCNB.css} +1 -1
- package/server/applications/spaces/interfaces/space-quota.interface.js +0 -10
- package/server/applications/spaces/interfaces/space-quota.interface.js.map +0 -1
- package/static/chunk-22EANI6R.js +0 -1
- package/static/chunk-3GFGJYMK.js +0 -1
- package/static/chunk-4YGJGZZZ.js +0 -1
- package/static/chunk-5K7HEX3C.js +0 -27
- package/static/chunk-5KLMS6A4.js +0 -1
- package/static/chunk-ATP3BFHV.js +0 -562
- package/static/chunk-BB4G55KE.js +0 -1
- package/static/chunk-EWKSX76T.js +0 -1
- package/static/chunk-FHLACA7V.js +0 -1
- package/static/chunk-GCATNU55.js +0 -1
- package/static/chunk-GYODPCIE.js +0 -1
- package/static/chunk-HZTFYLM5.js +0 -1
- package/static/chunk-JSUKJT6Z.js +0 -1
- package/static/chunk-JXZCNFW7.js +0 -1
- package/static/chunk-LTGFCQR7.js +0 -1
- package/static/chunk-LV3PYKWO.js +0 -1
- package/static/chunk-N2WFNW6M.js +0 -7
- package/static/chunk-ORMRCEGT.js +0 -1
- package/static/chunk-OUTBJSMW.js +0 -1
- package/static/chunk-RS2PX32L.js +0 -1
- package/static/chunk-RSSWH3S2.js +0 -1
- package/static/chunk-RTRJ3KFH.js +0 -1
- package/static/chunk-TKTCBDOG.js +0 -1
- package/static/chunk-V6K2N46L.js +0 -1
- package/static/chunk-XLCCZSQL.js +0 -4
- package/static/chunk-YPEH66GG.js +0 -1
- package/static/chunk-YPOIUQ57.js +0 -1
- package/static/chunk-ZKCFO2OA.js +0 -4
- package/static/main-MZ7HWZXO.js +0 -9
- package/static/scripts-VZVAP2P4.js +0 -30
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
(function(L,G){typeof exports=="object"&&typeof module<"u"?module.exports=G():typeof define=="function"&&define.amd?define(G):(L=L||self,L.CodeMirror=G())})(this,(function(){"use strict";var L=navigator.userAgent,G=navigator.platform,X=/gecko\/\d/i.test(L),R=/MSIE \d/.test(L),O=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(L),b=/Edge\/(\d+)/.exec(L),C=R||O||b,H=C&&(R?document.documentMode||6:+(b||O)[1]),q=!b&&/WebKit\//.test(L),He=q&&/Qt\/\d+\.\d+/.test(L),oe=!b&&/Chrome\/(\d+)/.exec(L),xe=oe&&+oe[1],ae=/Opera\//.test(L),Wr=/Apple Computer/.test(navigator.vendor),Xo=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(L),_o=/PhantomJS/.test(L),Zt=Wr&&(/Mobile\/\w+/.test(L)||navigator.maxTouchPoints>2),Hr=/Android/.test(L),Qt=Zt||Hr||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(L),ke=Zt||/Mac/.test(G),jo=/\bCrOS\b/.test(L),Yo=/win/i.test(G),lt=ae&&L.match(/Version\/(\d*\.\d*)/);lt&&(lt=Number(lt[1])),lt&<>=15&&(ae=!1,q=!0);var Pn=ke&&(He||ae&&(lt==null||lt<12.11)),yi=X||C&&H>=9;function Lt(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ot=function(e,t){var i=e.className,r=Lt(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function je(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function we(e,t){return je(e).appendChild(t)}function D(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var l=0;l<t.length;++l)n.appendChild(t[l]);return n}function kt(e,t,i,r){var n=D(e,t,i,r);return n.setAttribute("role","presentation"),n}var at;document.createRange?at=function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:at=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function Ye(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function Te(e){var t=e.ownerDocument||e,i;try{i=e.activeElement}catch{i=t.body||null}for(;i&&i.shadowRoot&&i.shadowRoot.activeElement;)i=i.shadowRoot.activeElement;return i}function st(e,t){var i=e.className;Lt(t).test(i)||(e.className+=(i?" ":"")+t)}function xi(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!Lt(i[r]).test(t)&&(t+=" "+i[r]);return t}var Jt=function(e){e.select()};Zt?Jt=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:C&&(Jt=function(e){try{e.select()}catch{}});function Vt(e){return e.display.wrapper.ownerDocument}function Tt(e){return ut(e.display.wrapper)}function ut(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function Pr(e){return Vt(e).defaultView}function bi(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ft(e,t,i){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Me(e,t,i,r,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var l=r||0,o=n||0;;){var a=e.indexOf(" ",l);if(a<0||a>=t)return o+(t-l);o+=a-l,o+=i-o%i,l=a+1}}var Ze=function(){this.id=null,this.f=null,this.time=0,this.handler=bi(this.onTimeout,this)};Ze.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ze.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function se(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Fn=50,Fr={toString:function(){return"CodeMirror.Pass"}},Pe={scroll:!1},Si={origin:"*mouse"},$t={origin:"+move"};function wi(e,t,i){for(var r=0,n=0;;){var l=e.indexOf(" ",r);l==-1&&(l=e.length);var o=l-r;if(l==e.length||n+o>=t)return r+Math.min(o,t-n);if(n+=l-r,n+=i-n%i,r=l+1,n>=t)return r}}var Er=[""];function Ci(e){for(;Er.length<=e;)Er.push(E(Er)+" ");return Er[e]}function E(e){return e[e.length-1]}function Ir(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function Zo(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}function En(){}function In(e,t){var i;return Object.create?i=Object.create(e):(En.prototype=e,i=new En),t&&ft(t,i),i}var Qo=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Li(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Qo.test(e))}function Br(e,t){return t?t.source.indexOf("\\w")>-1&&Li(e)?!0:t.test(e):Li(e)}function Bn(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Jo=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ki(e){return e.charCodeAt(0)>=768&&Jo.test(e)}function Rn(e,t,i){for(;(i<0?t>0:t<e.length)&&ki(e.charAt(t));)t+=i;return t}function er(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var n=(t+i)/2,l=r<0?Math.ceil(n):Math.floor(n);if(l==t)return e(l)?t:i;e(l)?i=l:t=l+r}}function Vo(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,l=0;l<e.length;++l){var o=e[l];(o.from<i&&o.to>t||t==i&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,i),o.level==1?"rtl":"ltr",l),n=!0)}n||r(t,i,"ltr")}var tr=null;function rr(e,t,i){var r;tr=null;for(var n=0;n<e.length;++n){var l=e[n];if(l.from<t&&l.to>t)return n;l.to==t&&(l.from!=l.to&&i=="before"?r=n:tr=n),l.from==t&&(l.from!=l.to&&i!="before"?r=n:tr=n)}return r??tr}var $o=(function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,l=/[LRr]/,o=/[Lb1n]/,a=/[1n]/;function s(u,f,h){this.level=u,this.from=f,this.to=h}return function(u,f){var h=f=="ltr"?"L":"R";if(u.length==0||f=="ltr"&&!r.test(u))return!1;for(var d=u.length,c=[],p=0;p<d;++p)c.push(i(u.charCodeAt(p)));for(var v=0,m=h;v<d;++v){var y=c[v];y=="m"?c[v]=m:m=y}for(var S=0,x=h;S<d;++S){var w=c[S];w=="1"&&x=="r"?c[S]="n":l.test(w)&&(x=w,w=="r"&&(c[S]="R"))}for(var M=1,T=c[0];M<d-1;++M){var P=c[M];P=="+"&&T=="1"&&c[M+1]=="1"?c[M]="1":P==","&&T==c[M+1]&&(T=="1"||T=="n")&&(c[M]=T),T=P}for(var z=0;z<d;++z){var ie=c[z];if(ie==",")c[z]="N";else if(ie=="%"){var K=void 0;for(K=z+1;K<d&&c[K]=="%";++K);for(var Se=z&&c[z-1]=="!"||K<d&&c[K]=="1"?"1":"N",ge=z;ge<K;++ge)c[ge]=Se;z=K-1}}for(var Q=0,me=h;Q<d;++Q){var le=c[Q];me=="L"&&le=="1"?c[Q]="L":l.test(le)&&(me=le)}for(var V=0;V<d;++V)if(n.test(c[V])){var J=void 0;for(J=V+1;J<d&&n.test(c[J]);++J);for(var _=(V?c[V-1]:h)=="L",ye=(J<d?c[J]:h)=="L",jt=_==ye?_?"L":"R":h,nt=V;nt<J;++nt)c[nt]=jt;V=J-1}for(var fe=[],Re,ne=0;ne<d;)if(o.test(c[ne])){var Wn=ne;for(++ne;ne<d&&o.test(c[ne]);++ne);fe.push(new s(0,Wn,ne))}else{var _e=ne,wt=fe.length,Ct=f=="rtl"?1:0;for(++ne;ne<d&&c[ne]!="L";++ne);for(var ce=_e;ce<ne;)if(a.test(c[ce])){_e<ce&&(fe.splice(wt,0,new s(1,_e,ce)),wt+=Ct);var Yt=ce;for(++ce;ce<ne&&a.test(c[ce]);++ce);fe.splice(wt,0,new s(2,Yt,ce)),wt+=Ct,_e=ce}else++ce;_e<ne&&fe.splice(wt,0,new s(1,_e,ne))}return f=="ltr"&&(fe[0].level==1&&(Re=u.match(/^\s+/))&&(fe[0].from=Re[0].length,fe.unshift(new s(0,0,Re[0].length))),E(fe).level==1&&(Re=u.match(/\s+$/))&&(E(fe).to-=Re[0].length,fe.push(new s(0,d-Re[0].length,d)))),f=="rtl"?fe.reverse():fe}})();function ze(e,t){var i=e.order;return i==null&&(i=e.order=$o(e.text,t)),i}var zn=[],N=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||zn).concat(i)}};function Ti(e,t){return e._handlers&&e._handlers[t]||zn}function Ce(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,n=r&&r[t];if(n){var l=se(n,i);l>-1&&(r[t]=n.slice(0,l).concat(n.slice(l+1)))}}}function Y(e,t){var i=Ti(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n<i.length;++n)i[n].apply(null,r)}function $(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Y(e,i||t.type,e,t),Mi(t)||t.codemirrorIgnore}function Gn(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)se(i,t[r])==-1&&i.push(t[r])}function De(e,t){return Ti(e,t).length>0}function Mt(e){e.prototype.on=function(t,i){N(this,t,i)},e.prototype.off=function(t,i){Ce(this,t,i)}}function de(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Un(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Mi(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ir(e){de(e),Un(e)}function Di(e){return e.target||e.srcElement}function qn(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ke&&e.ctrlKey&&t==1&&(t=3),t}var ea=(function(){if(C&&H<9)return!1;var e=D("div");return"draggable"in e||"dragDrop"in e})(),Ni;function ta(e){if(Ni==null){var t=D("span","\u200B");we(e,D("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ni=t.offsetWidth<=1&&t.offsetHeight>2&&!(C&&H<8))}var i=Ni?D("span","\u200B"):D("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Oi;function ra(e){if(Oi!=null)return Oi;var t=we(e,document.createTextNode("A\u062EA")),i=at(t,0,1).getBoundingClientRect(),r=at(t,1,2).getBoundingClientRect();return je(e),!i||i.left==i.right?!1:Oi=r.right-i.right<3}var Ai=`
|
|
2
|
+
|
|
3
|
+
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(`
|
|
4
|
+
`,t);n==-1&&(n=e.length);var l=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),o=l.indexOf("\r");o!=-1?(i.push(l.slice(0,o)),t+=o+1):(i.push(l),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ia=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},na=(function(){var e=D("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),Wi=null;function la(e){if(Wi!=null)return Wi;var t=we(e,D("span","x")),i=t.getBoundingClientRect(),r=at(t,0,1).getBoundingClientRect();return Wi=Math.abs(i.left-r.left)>1}var Hi={},Dt={};function oa(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Hi[e]=t}function aa(e,t){Dt[e]=t}function Rr(e){if(typeof e=="string"&&Dt.hasOwnProperty(e))e=Dt[e];else if(e&&typeof e.name=="string"&&Dt.hasOwnProperty(e.name)){var t=Dt[e.name];typeof t=="string"&&(t={name:t}),e=In(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Rr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Rr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Pi(e,t){t=Rr(t);var i=Hi[t.name];if(!i)return Pi(e,"text/plain");var r=i(e,t);if(Nt.hasOwnProperty(t.name)){var n=Nt[t.name];for(var l in n)n.hasOwnProperty(l)&&(r.hasOwnProperty(l)&&(r["_"+l]=r[l]),r[l]=n[l])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}var Nt={};function sa(e,t){var i=Nt.hasOwnProperty(e)?Nt[e]:Nt[e]={};ft(t,i)}function ht(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Fi(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Kn(e,t,i){return e.startState?e.startState(t,i):!0}var Z=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Z.prototype.eol=function(){return this.pos>=this.string.length},Z.prototype.sol=function(){return this.pos==this.lineStart},Z.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Z.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Z.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Z.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Z.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Z.prototype.skipToEnd=function(){this.pos=this.string.length},Z.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Z.prototype.backUp=function(e){this.pos-=e},Z.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Me(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Me(this.string,this.lineStart,this.tabSize):0)},Z.prototype.indentation=function(){return Me(this.string,null,this.tabSize)-(this.lineStart?Me(this.string,this.lineStart,this.tabSize):0)},Z.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(o){return i?o.toLowerCase():o},n=this.string.substr(this.pos,e.length);if(r(n)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var l=this.string.slice(this.pos).match(e);return l&&l.index>0?null:(l&&t!==!1&&(this.pos+=l[0].length),l)}},Z.prototype.current=function(){return this.string.slice(this.start,this.pos)},Z.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Z.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Z.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function k(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],l=n.chunkSize();if(t<l){i=n;break}t-=l}return i.lines[t]}function ct(e,t,i){var r=[],n=t.line;return e.iter(t.line,i.line+1,function(l){var o=l.text;n==i.line&&(o=o.slice(0,i.ch)),n==t.line&&(o=o.slice(t.ch)),r.push(o),++n}),r}function Ei(e,t,i){var r=[];return e.iter(t,i,function(n){r.push(n.text)}),r}function Fe(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function I(e){if(e.parent==null)return null;for(var t=e.parent,i=se(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var n=0;r.children[n]!=t;++n)i+=r.children[n].chunkSize();return i+t.first}function dt(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var n=e.children[r],l=n.height;if(t<l){e=n;continue e}t-=l,i+=n.chunkSize()}return i}while(!e.lines);for(var o=0;o<e.lines.length;++o){var a=e.lines[o],s=a.height;if(t<s)break;t-=s}return i+o}function nr(e,t){return t>=e.first&&t<e.first+e.size}function Ii(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function g(e,t,i){if(i===void 0&&(i=null),!(this instanceof g))return new g(e,t,i);this.line=e,this.ch=t,this.sticky=i}function A(e,t){return e.line-t.line||e.ch-t.ch}function Bi(e,t){return e.sticky==t.sticky&&A(e,t)==0}function Ri(e){return g(e.line,e.ch)}function zr(e,t){return A(e,t)<0?t:e}function Gr(e,t){return A(e,t)<0?e:t}function Xn(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function W(e,t){if(t.line<e.first)return g(e.first,0);var i=e.first+e.size-1;return t.line>i?g(i,k(e,i).text.length):ua(t,k(e,t.line).text.length)}function ua(e,t){var i=e.ch;return i==null||i>t?g(e.line,t):i<0?g(e.line,0):e}function _n(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=W(e,t[r]);return i}var Ur=function(e,t){this.state=e,this.lookAhead=t},Ee=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Ee.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ee.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Ee.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ee.fromSaved=function(e,t,i){return t instanceof Ur?new Ee(e,ht(e.mode,t.state),i,t.lookAhead):new Ee(e,ht(e.mode,t),i)},Ee.prototype.save=function(e){var t=e!==!1?ht(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ur(t,this.maxLookAhead):t};function jn(e,t,i,r){var n=[e.state.modeGen],l={};$n(e,t.text,e.doc.mode,i,function(u,f){return n.push(u,f)},l,r);for(var o=i.state,a=function(u){i.baseTokens=n;var f=e.state.overlays[u],h=1,d=0;i.state=!0,$n(e,t.text,f.mode,i,function(c,p){for(var v=h;d<c;){var m=n[h];m>c&&n.splice(h,1,c,n[h+1],m),h+=2,d=Math.min(c,m)}if(p)if(f.opaque)n.splice(v,h-v,c,"overlay "+p),h=v+2;else for(;v<h;v+=2){var y=n[v+1];n[v+1]=(y?y+" ":"")+"overlay "+p}},l),i.state=o,i.baseTokens=null,i.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:n,classes:l.bgClass||l.textClass?l:null}}function Yn(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=lr(e,I(t)),n=t.text.length>e.options.maxHighlightLength&&ht(e.doc.mode,r.state),l=jn(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=l.styles,l.classes?t.styleClasses=l.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function lr(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new Ee(r,!0,t);var l=fa(e,t,i),o=l>r.first&&k(r,l-1).stateAfter,a=o?Ee.fromSaved(r,o,l):new Ee(r,Kn(r.mode),l);return r.iter(l,t,function(s){zi(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=n.viewFrom&&u<n.viewTo?a.save():null,a.nextLine()}),i&&(r.modeFrontier=a.line),a}function zi(e,t,i,r){var n=e.doc.mode,l=new Z(t,e.options.tabSize,i);for(l.start=l.pos=r||0,t==""&&Zn(n,i.state);!l.eol();)Gi(n,l,i.state),l.start=l.pos}function Zn(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var i=Fi(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}}function Gi(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=Fi(e,i).mode);var l=e.token(t,i);if(t.pos>t.start)return l}throw new Error("Mode "+e.name+" failed to advance stream.")}var Qn=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Jn(e,t,i,r){var n=e.doc,l=n.mode,o;t=W(n,t);var a=k(n,t.line),s=lr(e,t.line,i),u=new Z(a.text,e.options.tabSize,s),f;for(r&&(f=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=Gi(l,u,s.state),r&&f.push(new Qn(u,o,ht(n.mode,s.state)));return r?f:new Qn(u,o,s.state)}function Vn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function $n(e,t,i,r,n,l,o){var a=i.flattenSpans;a==null&&(a=e.options.flattenSpans);var s=0,u=null,f=new Z(t,e.options.tabSize,r),h,d=e.options.addModeClass&&[null];for(t==""&&Vn(Zn(i,r.state),l);!f.eol();){if(f.pos>e.options.maxHighlightLength?(a=!1,o&&zi(e,t,r,f.pos),f.pos=t.length,h=null):h=Vn(Gi(i,f,r.state,d),l),d){var c=d[0].name;c&&(h="m-"+(h?c+" "+h:c))}if(!a||u!=h){for(;s<f.start;)s=Math.min(f.start,s+5e3),n(s,u);u=h}f.start=f.pos}for(;s<f.pos;){var p=Math.min(f.pos,s+5e3);n(p,u),s=p}}function fa(e,t,i){for(var r,n,l=e.doc,o=i?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>o;--a){if(a<=l.first)return l.first;var s=k(l,a-1),u=s.stateAfter;if(u&&(!i||a+(u instanceof Ur?u.lookAhead:0)<=l.modeFrontier))return a;var f=Me(s.text,null,e.options.tabSize);(n==null||r>f)&&(n=a-1,r=f)}return n}function ha(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var i=e.first,r=t-1;r>i;r--){var n=k(e,r).stateAfter;if(n&&(!(n instanceof Ur)||r+n.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}}var el=!1,Ge=!1;function ca(){el=!0}function da(){Ge=!0}function qr(e,t,i){this.marker=e,this.from=t,this.to=i}function or(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function pa(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function va(e,t,i){var r=i&&window.WeakSet&&(i.markedSpans||(i.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function ga(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var l=e[n],o=l.marker,a=l.from==null||(o.inclusiveLeft?l.from<=t:l.from<t);if(a||l.from==t&&o.type=="bookmark"&&(!i||!l.marker.insertLeft)){var s=l.to==null||(o.inclusiveRight?l.to>=t:l.to>t);(r||(r=[])).push(new qr(o,l.from,s?null:l.to))}}return r}function ma(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var l=e[n],o=l.marker,a=l.to==null||(o.inclusiveRight?l.to>=t:l.to>t);if(a||l.from==t&&o.type=="bookmark"&&(!i||l.marker.insertLeft)){var s=l.from==null||(o.inclusiveLeft?l.from<=t:l.from<t);(r||(r=[])).push(new qr(o,s?null:l.from-t,l.to==null?null:l.to-t))}}return r}function Ui(e,t){if(t.full)return null;var i=nr(e,t.from.line)&&k(e,t.from.line).markedSpans,r=nr(e,t.to.line)&&k(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,l=t.to.ch,o=A(t.from,t.to)==0,a=ga(i,n,o),s=ma(r,l,o),u=t.text.length==1,f=E(t.text).length+(u?n:0);if(a)for(var h=0;h<a.length;++h){var d=a[h];if(d.to==null){var c=or(s,d.marker);c?u&&(d.to=c.to==null?null:c.to+f):d.to=n}}if(s)for(var p=0;p<s.length;++p){var v=s[p];if(v.to!=null&&(v.to+=f),v.from==null){var m=or(a,v.marker);m||(v.from=f,u&&(a||(a=[])).push(v))}else v.from+=f,u&&(a||(a=[])).push(v)}a&&(a=tl(a)),s&&s!=a&&(s=tl(s));var y=[a];if(!u){var S=t.text.length-2,x;if(S>0&&a)for(var w=0;w<a.length;++w)a[w].to==null&&(x||(x=[])).push(new qr(a[w].marker,null,null));for(var M=0;M<S;++M)y.push(x);y.push(s)}return y}function tl(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ya(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(c){if(c.markedSpans)for(var p=0;p<c.markedSpans.length;++p){var v=c.markedSpans[p].marker;v.readOnly&&(!r||se(r,v)==-1)&&(r||(r=[])).push(v)}}),!r)return null;for(var n=[{from:t,to:i}],l=0;l<r.length;++l)for(var o=r[l],a=o.find(0),s=0;s<n.length;++s){var u=n[s];if(!(A(u.to,a.from)<0||A(u.from,a.to)>0)){var f=[s,1],h=A(u.from,a.from),d=A(u.to,a.to);(h<0||!o.inclusiveLeft&&!h)&&f.push({from:u.from,to:a.from}),(d>0||!o.inclusiveRight&&!d)&&f.push({from:a.to,to:u.to}),n.splice.apply(n,f),s+=f.length-3}}return n}function rl(e){var t=e.markedSpans;if(t){for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}}function il(e,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}}function Kr(e){return e.inclusiveLeft?-1:0}function Xr(e){return e.inclusiveRight?1:0}function qi(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),n=t.find(),l=A(r.from,n.from)||Kr(e)-Kr(t);if(l)return-l;var o=A(r.to,n.to)||Xr(e)-Xr(t);return o||t.id-e.id}function nl(e,t){var i=Ge&&e.markedSpans,r;if(i)for(var n=void 0,l=0;l<i.length;++l)n=i[l],n.marker.collapsed&&(t?n.from:n.to)==null&&(!r||qi(r,n.marker)<0)&&(r=n.marker);return r}function ll(e){return nl(e,!0)}function _r(e){return nl(e,!1)}function xa(e,t){var i=Ge&&e.markedSpans,r;if(i)for(var n=0;n<i.length;++n){var l=i[n];l.marker.collapsed&&(l.from==null||l.from<t)&&(l.to==null||l.to>t)&&(!r||qi(r,l.marker)<0)&&(r=l.marker)}return r}function ol(e,t,i,r,n){var l=k(e,t),o=Ge&&l.markedSpans;if(o)for(var a=0;a<o.length;++a){var s=o[a];if(s.marker.collapsed){var u=s.marker.find(0),f=A(u.from,i)||Kr(s.marker)-Kr(n),h=A(u.to,r)||Xr(s.marker)-Xr(n);if(!(f>=0&&h<=0||f<=0&&h>=0)&&(f<=0&&(s.marker.inclusiveRight&&n.inclusiveLeft?A(u.to,i)>=0:A(u.to,i)>0)||f>=0&&(s.marker.inclusiveRight&&n.inclusiveLeft?A(u.from,r)<=0:A(u.from,r)<0)))return!0}}}function Ne(e){for(var t;t=ll(e);)e=t.find(-1,!0).line;return e}function ba(e){for(var t;t=_r(e);)e=t.find(1,!0).line;return e}function Sa(e){for(var t,i;t=_r(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Ki(e,t){var i=k(e,t),r=Ne(i);return i==r?t:I(r)}function al(e,t){if(t>e.lastLine())return t;var i=k(e,t),r;if(!Qe(e,i))return t;for(;r=_r(i);)i=r.find(1,!0).line;return I(i)+1}function Qe(e,t){var i=Ge&&t.markedSpans;if(i){for(var r=void 0,n=0;n<i.length;++n)if(r=i[n],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Xi(e,t,r))return!0}}}function Xi(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return Xi(e,r.line,or(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,l=0;l<t.markedSpans.length;++l)if(n=t.markedSpans[l],n.marker.collapsed&&!n.marker.widgetNode&&n.from==i.to&&(n.to==null||n.to!=i.from)&&(n.marker.inclusiveLeft||i.marker.inclusiveRight)&&Xi(e,t,n))return!0}function Ue(e){e=Ne(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var n=i.lines[r];if(n==e)break;t+=n.height}for(var l=i.parent;l;i=l,l=i.parent)for(var o=0;o<l.children.length;++o){var a=l.children[o];if(a==i)break;t+=a.height}return t}function jr(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=ll(r);){var n=i.find(0,!0);r=n.from.line,t+=n.from.ch-n.to.ch}for(r=e;i=_r(r);){var l=i.find(0,!0);t-=r.text.length-l.from.ch,r=l.to.line,t+=r.text.length-l.to.ch}return t}function _i(e){var t=e.display,i=e.doc;t.maxLine=k(i,i.first),t.maxLineLength=jr(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var n=jr(r);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var Ot=function(e,t,i){this.text=e,il(this,t),this.height=i?i(this):1};Ot.prototype.lineNo=function(){return I(this)},Mt(Ot);function wa(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),rl(e),il(e,i);var n=r?r(e):1;n!=e.height&&Fe(e,n)}function Ca(e){e.parent=null,rl(e)}var La={},ka={};function sl(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?ka:La;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function ul(e,t){var i=kt("span",null,null,q?"padding-right: .1px":null),r={pre:kt("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var l=n?t.rest[n-1]:t.line,o=void 0;r.pos=0,r.addToken=Ma,ra(e.display.measure)&&(o=ze(l,e.doc.direction))&&(r.addToken=Na(r.addToken,o)),r.map=[];var a=t!=e.display.externalMeasured&&I(l);Oa(l,r,Yn(e,l,a)),l.styleClasses&&(l.styleClasses.bgClass&&(r.bgClass=xi(l.styleClasses.bgClass,r.bgClass||"")),l.styleClasses.textClass&&(r.textClass=xi(l.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(ta(e.display.measure))),n==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(q){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Y(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=xi(r.pre.className,r.textClass||"")),r}function Ta(e){var t=D("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ma(e,t,i,r,n,l,o){if(t){var a=e.splitSpaces?Da(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,f;if(!s.test(t))e.col+=t.length,f=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,f),C&&H<9&&(u=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var h=0;;){s.lastIndex=h;var d=s.exec(t),c=d?d.index-h:t.length-h;if(c){var p=document.createTextNode(a.slice(h,h+c));C&&H<9?f.appendChild(D("span",[p])):f.appendChild(p),e.map.push(e.pos,e.pos+c,p),e.col+=c,e.pos+=c}if(!d)break;h+=c+1;var v=void 0;if(d[0]==" "){var m=e.cm.options.tabSize,y=m-e.col%m;v=f.appendChild(D("span",Ci(y),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text"," "),e.col+=y}else d[0]=="\r"||d[0]==`
|
|
5
|
+
`?(v=f.appendChild(D("span",d[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),v.setAttribute("cm-text",d[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(d[0]),v.setAttribute("cm-text",d[0]),C&&H<9?f.appendChild(D("span",[v])):f.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,i||r||n||u||l||o){var S=i||"";r&&(S+=r),n&&(S+=n);var x=D("span",[f],S,l);if(o)for(var w in o)o.hasOwnProperty(w)&&w!="style"&&w!="class"&&x.setAttribute(w,o[w]);return e.content.appendChild(x)}e.content.appendChild(f)}}function Da(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;n<e.length;n++){var l=e.charAt(n);l==" "&&i&&(n==e.length-1||e.charCodeAt(n+1)==32)&&(l="\xA0"),r+=l,i=l==" "}return r}function Na(e,t){return function(i,r,n,l,o,a,s){n=n?n+" cm-force-border":"cm-force-border";for(var u=i.pos,f=u+r.length;;){for(var h=void 0,d=0;d<t.length&&(h=t[d],!(h.to>u&&h.from<=u));d++);if(h.to>=f)return e(i,r,n,l,o,a,s);e(i,r.slice(0,h.to-u),n,l,null,a,s),l=null,r=r.slice(h.to-u),u=h.to}}}function fl(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function Oa(e,t,i){var r=e.markedSpans,n=e.text,l=0;if(!r){for(var o=1;o<i.length;o+=2)t.addToken(t,n.slice(l,l=i[o]),sl(i[o+1],t.cm.options));return}for(var a=n.length,s=0,u=1,f="",h,d,c=0,p,v,m,y,S;;){if(c==s){p=v=m=d="",S=null,y=null,c=1/0;for(var x=[],w=void 0,M=0;M<r.length;++M){var T=r[M],P=T.marker;if(P.type=="bookmark"&&T.from==s&&P.widgetNode)x.push(P);else if(T.from<=s&&(T.to==null||T.to>s||P.collapsed&&T.to==s&&T.from==s)){if(T.to!=null&&T.to!=s&&c>T.to&&(c=T.to,v=""),P.className&&(p+=" "+P.className),P.css&&(d=(d?d+";":"")+P.css),P.startStyle&&T.from==s&&(m+=" "+P.startStyle),P.endStyle&&T.to==c&&(w||(w=[])).push(P.endStyle,T.to),P.title&&((S||(S={})).title=P.title),P.attributes)for(var z in P.attributes)(S||(S={}))[z]=P.attributes[z];P.collapsed&&(!y||qi(y.marker,P)<0)&&(y=T)}else T.from>s&&c>T.from&&(c=T.from)}if(w)for(var ie=0;ie<w.length;ie+=2)w[ie+1]==c&&(v+=" "+w[ie]);if(!y||y.from==s)for(var K=0;K<x.length;++K)fl(t,0,x[K]);if(y&&(y.from||0)==s){if(fl(t,(y.to==null?a+1:y.to)-s,y.marker,y.from==null),y.to==null)return;y.to==s&&(y=!1)}}if(s>=a)break;for(var Se=Math.min(a,c);;){if(f){var ge=s+f.length;if(!y){var Q=ge>Se?f.slice(0,Se-s):f;t.addToken(t,Q,h?h+p:p,m,s+Q.length==c?v:"",d,S)}if(ge>=Se){f=f.slice(Se-s),s=Se;break}s=ge,m=""}f=n.slice(l,l=i[u++]),h=sl(i[u++],t.cm.options)}}}function hl(e,t,i){this.line=t,this.rest=Sa(t),this.size=this.rest?I(E(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Qe(e,t)}function Yr(e,t,i){for(var r=[],n,l=t;l<i;l=n){var o=new hl(e.doc,k(e.doc,l),l);n=l+o.size,r.push(o)}return r}var At=null;function Aa(e){At?At.ops.push(e):e.ownsGroup=At={ops:[e],delayedCallbacks:[]}}function Wa(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var n=e.ops[r];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(i<t.length)}function Ha(e,t){var i=e.ownsGroup;if(i)try{Wa(i)}finally{At=null,t(i)}}var ar=null;function ee(e,t){var i=Ti(e,t);if(i.length){var r=Array.prototype.slice.call(arguments,2),n;At?n=At.delayedCallbacks:ar?n=ar:(n=ar=[],setTimeout(Pa,0));for(var l=function(a){n.push(function(){return i[a].apply(null,r)})},o=0;o<i.length;++o)l(o)}}function Pa(){var e=ar;ar=null;for(var t=0;t<e.length;++t)e[t]()}function cl(e,t,i,r){for(var n=0;n<t.changes.length;n++){var l=t.changes[n];l=="text"?Ea(e,t):l=="gutter"?pl(e,t,i,r):l=="class"?ji(e,t):l=="widget"&&Ia(e,t,r)}t.changes=null}function sr(e){return e.node==e.text&&(e.node=D("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),C&&H<8&&(e.node.style.zIndex=2)),e.node}function Fa(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=sr(t);t.background=r.insertBefore(D("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function dl(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):ul(e,t)}function Ea(e,t){var i=t.text.className,r=dl(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,ji(e,t)):i&&(t.text.className=i)}function ji(e,t){Fa(e,t),t.line.wrapClass?sr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function pl(e,t,i,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var n=sr(t);t.gutterBackground=D("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),n.insertBefore(t.gutterBackground,t.text)}var l=t.line.gutterMarkers;if(e.options.lineNumbers||l){var o=sr(t),a=t.gutter=D("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),o.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!l||!l["CodeMirror-linenumbers"])&&(t.lineNumber=a.appendChild(D("div",Ii(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),l)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,f=l.hasOwnProperty(u)&&l[u];f&&a.appendChild(D("div",[f],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Ia(e,t,i){t.alignable&&(t.alignable=null);for(var r=Lt("CodeMirror-linewidget"),n=t.node.firstChild,l=void 0;n;n=l)l=n.nextSibling,r.test(n.className)&&t.node.removeChild(n);vl(e,t,i)}function Ba(e,t,i,r){var n=dl(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),ji(e,t),pl(e,t,i,r),vl(e,t,r),t.node}function vl(e,t,i){if(gl(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)gl(e,t.rest[r],t,i,!1)}function gl(e,t,i,r,n){if(t.widgets)for(var l=sr(i),o=0,a=t.widgets;o<a.length;++o){var s=a[o],u=D("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Ra(s,u,i,r),e.display.input.setUneditable(u),n&&s.above?l.insertBefore(u,i.gutter||i.text):l.appendChild(u),ee(s,"redraw")}}function Ra(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var n=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(n-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=n+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function ur(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Ye(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),we(t.display.measure,D("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function qe(e,t){for(var i=Di(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Zr(e){return e.lineSpace.offsetTop}function Yi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ml(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=we(e.measure,D("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Ie(e){return Fn-e.display.nativeBarWidth}function pt(e){return e.display.scroller.clientWidth-Ie(e)-e.display.barWidth}function Zi(e){return e.display.scroller.clientHeight-Ie(e)-e.display.barHeight}function za(e,t,i){var r=e.options.lineWrapping,n=r&&pt(e);if(!t.measure.heights||r&&t.measure.width!=n){var l=t.measure.heights=[];if(r){t.measure.width=n;for(var o=t.text.firstChild.getClientRects(),a=0;a<o.length-1;a++){var s=o[a],u=o[a+1];Math.abs(s.bottom-u.bottom)>2&&l.push((s.bottom+u.top)/2-i.top)}}l.push(i.bottom-i.top)}}function yl(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var n=0;n<e.rest.length;n++)if(I(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}}function Ga(e,t){t=Ne(t);var i=I(t),r=e.display.externalMeasured=new hl(e.doc,t,i);r.lineN=i;var n=r.built=ul(e,r);return r.text=n.pre,we(e.display.lineMeasure,n.pre),r}function xl(e,t,i,r){return Be(e,Wt(e,t),i,r)}function Qi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[mt(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Wt(e,t){var i=I(t),r=Qi(e,i);r&&!r.text?r=null:r&&r.changes&&(cl(e,r,i,tn(e)),e.curOp.forceUpdate=!0),r||(r=Ga(e,t));var n=yl(r,t,i);return{line:t,view:r,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Be(e,t,i,r,n){t.before&&(i=-1);var l=i+(r||""),o;return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(za(e,t.view,t.rect),t.hasHeights=!0),o=qa(e,t,i,r),o.bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:n?o.rtop:o.top,bottom:n?o.rbottom:o.bottom}}var bl={left:0,right:0,top:0,bottom:0};function Sl(e,t,i){for(var r,n,l,o,a,s,u=0;u<e.length;u+=3)if(a=e[u],s=e[u+1],t<a?(n=0,l=1,o="left"):t<s?(n=t-a,l=n+1):(u==e.length-3||t==s&&e[u+3]>t)&&(l=s-a,n=l-1,t>=s&&(o="right")),n!=null){if(r=e[u+2],a==s&&i==(r.insertLeft?"left":"right")&&(o=i),i=="left"&&n==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],o="left";if(i=="right"&&n==s-a)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],o="right";break}return{node:r,start:n,end:l,collapse:o,coverStart:a,coverEnd:s}}function Ua(e,t){var i=bl;if(t=="left")for(var r=0;r<e.length&&(i=e[r]).left==i.right;r++);else for(var n=e.length-1;n>=0&&(i=e[n]).left==i.right;n--);return i}function qa(e,t,i,r){var n=Sl(t.map,i,r),l=n.node,o=n.start,a=n.end,s=n.collapse,u;if(l.nodeType==3){for(var f=0;f<4;f++){for(;o&&ki(t.line.text.charAt(n.coverStart+o));)--o;for(;n.coverStart+a<n.coverEnd&&ki(t.line.text.charAt(n.coverStart+a));)++a;if(C&&H<9&&o==0&&a==n.coverEnd-n.coverStart?u=l.parentNode.getBoundingClientRect():u=Ua(at(l,o,a).getClientRects(),r),u.left||u.right||o==0)break;a=o,o=o-1,s="right"}C&&H<11&&(u=Ka(e.display.measure,u))}else{o>0&&(s=r="right");var h;e.options.lineWrapping&&(h=l.getClientRects()).length>1?u=h[r=="right"?h.length-1:0]:u=l.getBoundingClientRect()}if(C&&H<9&&!o&&(!u||!u.left&&!u.right)){var d=l.parentNode.getClientRects()[0];d?u={left:d.left,right:d.left+Pt(e.display),top:d.top,bottom:d.bottom}:u=bl}for(var c=u.top-t.rect.top,p=u.bottom-t.rect.top,v=(c+p)/2,m=t.view.measure.heights,y=0;y<m.length-1&&!(v<m[y]);y++);var S=y?m[y-1]:0,x=m[y],w={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:S,bottom:x};return!u.left&&!u.right&&(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=c,w.rbottom=p),w}function Ka(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!la(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function wl(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Cl(e){e.display.externalMeasure=null,je(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)wl(e.display.view[t])}function fr(e){Cl(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ll(e){return oe&&Hr?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function kl(e){return oe&&Hr?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Ji(e){var t=Ne(e),i=t.widgets,r=0;if(i)for(var n=0;n<i.length;++n)i[n].above&&(r+=ur(i[n]));return r}function Qr(e,t,i,r,n){if(!n){var l=Ji(t);i.top+=l,i.bottom+=l}if(r=="line")return i;r||(r="local");var o=Ue(t);if(r=="local"?o+=Zr(e.display):o-=e.display.viewOffset,r=="page"||r=="window"){var a=e.display.lineSpace.getBoundingClientRect();o+=a.top+(r=="window"?0:kl(Vt(e)));var s=a.left+(r=="window"?0:Ll(Vt(e)));i.left+=s,i.right+=s}return i.top+=o,i.bottom+=o,i}function Tl(e,t,i){if(i=="div")return t;var r=t.left,n=t.top;if(i=="page")r-=Ll(Vt(e)),n-=kl(Vt(e));else if(i=="local"||!i){var l=e.display.sizer.getBoundingClientRect();r+=l.left,n+=l.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:n-o.top}}function Jr(e,t,i,r,n){return r||(r=k(e.doc,t.line)),Qr(e,r,xl(e,r,t.ch,n),i)}function Oe(e,t,i,r,n,l){r=r||k(e.doc,t.line),n||(n=Wt(e,r));function o(p,v){var m=Be(e,n,p,v?"right":"left",l);return v?m.left=m.right:m.right=m.left,Qr(e,r,m,i)}var a=ze(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return o(u=="before"?s-1:s,u=="before");function f(p,v,m){var y=a[v],S=y.level==1;return o(m?p-1:p,S!=m)}var h=rr(a,s,u),d=tr,c=f(s,h,u=="before");return d!=null&&(c.other=f(s,d,u!="before")),c}function Ml(e,t){var i=0;t=W(e.doc,t),e.options.lineWrapping||(i=Pt(e.display)*t.ch);var r=k(e.doc,t.line),n=Ue(r)+Zr(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function Vi(e,t,i,r,n){var l=g(e,t,i);return l.xRel=n,r&&(l.outside=r),l}function $i(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return Vi(r.first,0,null,-1,-1);var n=dt(r,i),l=r.first+r.size-1;if(n>l)return Vi(r.first+r.size-1,k(r,l).text.length,null,1,1);t<0&&(t=0);for(var o=k(r,n);;){var a=Xa(e,o,n,t,i),s=xa(o,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==n)return u;o=k(r,n=u.line)}}function Dl(e,t,i,r){r-=Ji(t);var n=t.text.length,l=er(function(o){return Be(e,i,o-1).bottom<=r},n,0);return n=er(function(o){return Be(e,i,o).top>r},l,n),{begin:l,end:n}}function Nl(e,t,i,r){i||(i=Wt(e,t));var n=Qr(e,t,Be(e,i,r),"line").top;return Dl(e,t,i,n)}function en(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Xa(e,t,i,r,n){n-=Ue(t);var l=Wt(e,t),o=Ji(t),a=0,s=t.text.length,u=!0,f=ze(t,e.doc.direction);if(f){var h=(e.options.lineWrapping?ja:_a)(e,t,i,l,f,r,n);u=h.level!=1,a=u?h.from:h.to-1,s=u?h.to:h.from-1}var d=null,c=null,p=er(function(M){var T=Be(e,l,M);return T.top+=o,T.bottom+=o,en(T,r,n,!1)?(T.top<=n&&T.left<=r&&(d=M,c=T),!0):!1},a,s),v,m,y=!1;if(c){var S=r-c.left<c.right-r,x=S==u;p=d+(x?0:1),m=x?"after":"before",v=S?c.left:c.right}else{!u&&(p==s||p==a)&&p++,m=p==0?"after":p==t.text.length?"before":Be(e,l,p-(u?1:0)).bottom+o<=n==u?"after":"before";var w=Oe(e,g(i,p,m),"line",t,l);v=w.left,y=n<w.top?-1:n>=w.bottom?1:0}return p=Rn(t.text,p,1),Vi(i,p,m,y,r-v)}function _a(e,t,i,r,n,l,o){var a=er(function(h){var d=n[h],c=d.level!=1;return en(Oe(e,g(i,c?d.to:d.from,c?"before":"after"),"line",t,r),l,o,!0)},0,n.length-1),s=n[a];if(a>0){var u=s.level!=1,f=Oe(e,g(i,u?s.from:s.to,u?"after":"before"),"line",t,r);en(f,l,o,!0)&&f.top>o&&(s=n[a-1])}return s}function ja(e,t,i,r,n,l,o){var a=Dl(e,t,r,o),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var f=null,h=null,d=0;d<n.length;d++){var c=n[d];if(!(c.from>=u||c.to<=s)){var p=c.level!=1,v=Be(e,r,p?Math.min(u,c.to)-1:Math.max(s,c.from)).right,m=v<l?l-v+1e9:v-l;(!f||h>m)&&(f=c,h=m)}}return f||(f=n[n.length-1]),f.from<s&&(f={from:s,to:f.to,level:f.level}),f.to>u&&(f={from:f.from,to:u,level:f.level}),f}var vt;function Ht(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(vt==null){vt=D("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)vt.appendChild(document.createTextNode("x")),vt.appendChild(D("br"));vt.appendChild(document.createTextNode("x"))}we(e.measure,vt);var i=vt.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),je(e.measure),i||1}function Pt(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=D("span","xxxxxxxxxx"),i=D("pre",[t],"CodeMirror-line-like");we(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function tn(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,l=t.gutters.firstChild,o=0;l;l=l.nextSibling,++o){var a=e.display.gutterSpecs[o].className;i[a]=l.offsetLeft+l.clientLeft+n,r[a]=l.clientWidth}return{fixedPos:rn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function rn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ol(e){var t=Ht(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Pt(e.display)-3);return function(n){if(Qe(e.doc,n))return 0;var l=0;if(n.widgets)for(var o=0;o<n.widgets.length;o++)n.widgets[o].height&&(l+=n.widgets[o].height);return i?l+(Math.ceil(n.text.length/r)||1)*t:l+t}}function nn(e){var t=e.doc,i=Ol(e);t.iter(function(r){var n=i(r);n!=r.height&&Fe(r,n)})}function gt(e,t,i,r){var n=e.display;if(!i&&Di(t).getAttribute("cm-not-content")=="true")return null;var l,o,a=n.lineSpace.getBoundingClientRect();try{l=t.clientX-a.left,o=t.clientY-a.top}catch{return null}var s=$i(e,l,o),u;if(r&&s.xRel>0&&(u=k(e.doc,s.line).text).length==s.ch){var f=Me(u,u.length,e.options.tabSize)-u.length;s=g(s.line,Math.max(0,Math.round((l-ml(e.display).left)/Pt(e.display))-f))}return s}function mt(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function pe(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var n=e.display;if(r&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)Ge&&Ki(e.doc,t)<n.viewTo&&Ve(e);else if(i<=n.viewFrom)Ge&&al(e.doc,i+r)>n.viewFrom?Ve(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Ve(e);else if(t<=n.viewFrom){var l=Vr(e,i,i+r,1);l?(n.view=n.view.slice(l.index),n.viewFrom=l.lineN,n.viewTo+=r):Ve(e)}else if(i>=n.viewTo){var o=Vr(e,t,t,-1);o?(n.view=n.view.slice(0,o.index),n.viewTo=o.lineN):Ve(e)}else{var a=Vr(e,t,t,-1),s=Vr(e,i,i+r,1);a&&s?(n.view=n.view.slice(0,a.index).concat(Yr(e,a.lineN,s.lineN)).concat(n.view.slice(s.index)),n.viewTo+=r):Ve(e)}var u=n.externalMeasured;u&&(i<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(n.externalMeasured=null))}function Je(e,t,i){e.curOp.viewChanged=!0;var r=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var l=r.view[mt(e,t)];if(l.node!=null){var o=l.changes||(l.changes=[]);se(o,i)==-1&&o.push(i)}}}function Ve(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Vr(e,t,i,r){var n=mt(e,t),l,o=e.display.view;if(!Ge||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var a=e.display.viewFrom,s=0;s<n;s++)a+=o[s].size;if(a!=t){if(r>0){if(n==o.length-1)return null;l=a+o[n].size-t,n++}else l=a-t;t+=l,i+=l}for(;Ki(e.doc,i)!=i;){if(n==(r<0?0:o.length-1))return null;i+=r*o[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function Ya(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Yr(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Yr(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(mt(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(Yr(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,mt(e,i)))),r.viewTo=i}function Al(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var n=t[r];!n.hidden&&(!n.node||n.changes)&&++i}return i}function hr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Wl(e,t){t===void 0&&(t=!0);var i=e.doc,r={},n=r.cursors=document.createDocumentFragment(),l=r.selection=document.createDocumentFragment(),o=e.options.$customCursor;o&&(t=!0);for(var a=0;a<i.sel.ranges.length;a++)if(!(!t&&a==i.sel.primIndex)){var s=i.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(o){var f=o(e,s);f&&ln(e,f,n)}else(u||e.options.showCursorWhenSelecting)&&ln(e,s.head,n);u||Za(e,s,l)}}return r}function ln(e,t,i){var r=Oe(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),n=i.appendChild(D("div","\xA0","CodeMirror-cursor"));if(n.style.left=r.left+"px",n.style.top=r.top+"px",n.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var l=Jr(e,t,"div",null,null),o=l.right-l.left;n.style.width=(o>0?o:e.defaultCharWidth())+"px"}if(r.other){var a=i.appendChild(D("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function $r(e,t){return e.top-t.top||e.left-t.left}function Za(e,t,i){var r=e.display,n=e.doc,l=document.createDocumentFragment(),o=ml(e.display),a=o.left,s=Math.max(r.sizerWidth,pt(e)-r.sizer.offsetLeft)-o.right,u=n.direction=="ltr";function f(x,w,M,T){w<0&&(w=0),w=Math.round(w),T=Math.round(T),l.appendChild(D("div",null,"CodeMirror-selected","position: absolute; left: "+x+`px;
|
|
6
|
+
top: `+w+"px; width: "+(M??s-x)+`px;
|
|
7
|
+
height: `+(T-w)+"px"))}function h(x,w,M){var T=k(n,x),P=T.text.length,z,ie;function K(Q,me){return Jr(e,g(x,Q),"div",T,me)}function Se(Q,me,le){var V=Nl(e,T,null,Q),J=me=="ltr"==(le=="after")?"left":"right",_=le=="after"?V.begin:V.end-(/\s/.test(T.text.charAt(V.end-1))?2:1);return K(_,J)[J]}var ge=ze(T,n.direction);return Vo(ge,w||0,M??P,function(Q,me,le,V){var J=le=="ltr",_=K(Q,J?"left":"right"),ye=K(me-1,J?"right":"left"),jt=w==null&&Q==0,nt=M==null&&me==P,fe=V==0,Re=!ge||V==ge.length-1;if(ye.top-_.top<=3){var ne=(u?jt:nt)&&fe,Wn=(u?nt:jt)&&Re,_e=ne?a:(J?_:ye).left,wt=Wn?s:(J?ye:_).right;f(_e,_.top,wt-_e,_.bottom)}else{var Ct,ce,Yt,Hn;J?(Ct=u&&jt&&fe?a:_.left,ce=u?s:Se(Q,le,"before"),Yt=u?a:Se(me,le,"after"),Hn=u&&nt&&Re?s:ye.right):(Ct=u?Se(Q,le,"before"):a,ce=!u&&jt&&fe?s:_.right,Yt=!u&&nt&&Re?a:ye.left,Hn=u?Se(me,le,"after"):s),f(Ct,_.top,ce-Ct,_.bottom),_.bottom<ye.top&&f(a,_.bottom,null,ye.top),f(Yt,ye.top,Hn-Yt,ye.bottom)}(!z||$r(_,z)<0)&&(z=_),$r(ye,z)<0&&(z=ye),(!ie||$r(_,ie)<0)&&(ie=_),$r(ye,ie)<0&&(ie=ye)}),{start:z,end:ie}}var d=t.from(),c=t.to();if(d.line==c.line)h(d.line,d.ch,c.ch);else{var p=k(n,d.line),v=k(n,c.line),m=Ne(p)==Ne(v),y=h(d.line,d.ch,m?p.text.length+1:null).end,S=h(c.line,m?0:null,c.ch).start;m&&(y.top<S.top-2?(f(y.right,y.top,null,y.bottom),f(a,S.top,S.left,S.bottom)):f(y.right,y.top,S.left-y.right,y.bottom)),y.bottom<S.top&&f(a,y.bottom,null,S.top)}i.appendChild(l)}function on(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ft(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Hl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||sn(e))}function an(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Ft(e))},100)}function sn(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Y(e,"focus",e,t),e.state.focused=!0,st(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),q&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),on(e))}function Ft(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Y(e,"blur",e,t),e.state.focused=!1,ot(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function ei(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),n=t.lineDiv.getBoundingClientRect().top,l=0,o=0;o<t.view.length;o++){var a=t.view[o],s=e.options.lineWrapping,u=void 0,f=0;if(!a.hidden){if(n+=a.line.height,C&&H<8){var h=a.node.offsetTop+a.node.offsetHeight;u=h-i,i=h}else{var d=a.node.getBoundingClientRect();u=d.bottom-d.top,!s&&a.text.firstChild&&(f=a.text.firstChild.getBoundingClientRect().right-d.left-1)}var c=a.line.height-u;if((c>.005||c<-.005)&&(n<r&&(l-=c),Fe(a.line,u),Pl(a.line),a.rest))for(var p=0;p<a.rest.length;p++)Pl(a.rest[p]);if(f>e.display.sizerWidth){var v=Math.ceil(f/Pt(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(l)>2&&(t.scroller.scrollTop+=l)}function Pl(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function ti(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-Zr(e));var n=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,l=dt(t,r),o=dt(t,n);if(i&&i.ensure){var a=i.ensure.from.line,s=i.ensure.to.line;a<l?(l=a,o=dt(t,Ue(k(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=o&&(l=dt(t,Ue(k(t,s))-e.wrapper.clientHeight),o=s)}return{from:l,to:Math.max(o,l+1)}}function Qa(e,t){if(!$(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null,l=i.wrapper.ownerDocument;if(t.top+r.top<0?n=!0:t.bottom+r.top>(l.defaultView.innerHeight||l.documentElement.clientHeight)&&(n=!1),n!=null&&!_o){var o=D("div","\u200B",null,`position: absolute;
|
|
8
|
+
top: `+(t.top-i.viewOffset-Zr(e.display))+`px;
|
|
9
|
+
height: `+(t.bottom-t.top+Ie(e)+i.barHeight)+`px;
|
|
10
|
+
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(n),e.display.lineSpace.removeChild(o)}}}function Ja(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?g(t.line,t.ch+1,"before"):t,t=t.ch?g(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var l=0;l<5;l++){var o=!1,a=Oe(e,t),s=!i||i==t?a:Oe(e,i);n={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=un(e,n),f=e.doc.scrollTop,h=e.doc.scrollLeft;if(u.scrollTop!=null&&(dr(e,u.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(o=!0)),u.scrollLeft!=null&&(yt(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(o=!0)),!o)break}return n}function Va(e,t){var i=un(e,t);i.scrollTop!=null&&dr(e,i.scrollTop),i.scrollLeft!=null&&yt(e,i.scrollLeft)}function un(e,t){var i=e.display,r=Ht(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,l=Zi(e),o={};t.bottom-t.top>l&&(t.bottom=t.top+l);var a=e.doc.height+Yi(i),s=t.top<r,u=t.bottom>a-r;if(t.top<n)o.scrollTop=s?0:t.top;else if(t.bottom>n+l){var f=Math.min(t.top,(u?a:t.bottom)-l);f!=n&&(o.scrollTop=f)}var h=e.options.fixedGutter?0:i.gutters.offsetWidth,d=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-h,c=pt(e)-i.gutters.offsetWidth,p=t.right-t.left>c;return p&&(t.right=t.left+c),t.left<10?o.scrollLeft=0:t.left<d?o.scrollLeft=Math.max(0,t.left+h-(p?0:10)):t.right>c+d-3&&(o.scrollLeft=t.right+(p?0:10)-c),o}function fn(e,t){t!=null&&(ri(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Et(e){ri(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function cr(e,t,i){(t!=null||i!=null)&&ri(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function $a(e,t){ri(e),e.curOp.scrollToPos=t}function ri(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Ml(e,t.from),r=Ml(e,t.to);Fl(e,i,r,t.margin)}}function Fl(e,t,i,r){var n=un(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});cr(e,n.scrollLeft,n.scrollTop)}function dr(e,t){Math.abs(e.doc.scrollTop-t)<2||(X||cn(e,{top:t}),El(e,t,!0),X&&cn(e),gr(e,100))}function El(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function yt(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Gl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function pr(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+Yi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+Ie(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var xt=function(e,t,i){this.cm=i;var r=this.vert=D("div",[D("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=D("div",[D("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),N(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),N(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,C&&H<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};xt.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var l=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+l)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},xt.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},xt.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},xt.prototype.zeroWidthHack=function(){var e=ke&&!Xo?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ze,this.disableVert=new Ze},xt.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),l=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);l!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},xt.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var vr=function(){};vr.prototype.update=function(){return{bottom:0,right:0}},vr.prototype.setScrollLeft=function(){},vr.prototype.setScrollTop=function(){},vr.prototype.clear=function(){};function It(e,t){t||(t=pr(e));var i=e.display.barWidth,r=e.display.barHeight;Il(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&ei(e),Il(e,pr(e)),i=e.display.barWidth,r=e.display.barHeight}function Il(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Bl={native:xt,null:vr};function Rl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ot(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Bl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),N(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?yt(e,t):dr(e,t)},e),e.display.scrollbars.addClass&&st(e.display.wrapper,e.display.scrollbars.addClass)}var es=0;function bt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++es,markArrays:null},Aa(e.curOp)}function St(e){var t=e.curOp;t&&Ha(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;ts(i)})}function ts(e){for(var t=e.ops,i=0;i<t.length;i++)rs(t[i]);for(var r=0;r<t.length;r++)is(t[r]);for(var n=0;n<t.length;n++)ns(t[n]);for(var l=0;l<t.length;l++)ls(t[l]);for(var o=0;o<t.length;o++)os(t[o])}function rs(e){var t=e.cm,i=t.display;ss(t),e.updateMaxLine&&_i(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function is(e){e.updatedDisplay=e.mustUpdate&&hn(e.cm,e.update)}function ns(e){var t=e.cm,i=t.display;e.updatedDisplay&&ei(t),e.barMeasure=pr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=xl(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Ie(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-pt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function ls(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&yt(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==Te(Tt(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&It(t,e.barMeasure),e.updatedDisplay&&pn(t,e.barMeasure),e.selectionChanged&&on(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Hl(e.cm)}function os(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&zl(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&El(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&yt(t,e.scrollLeft,!0,!0),e.scrollToPos){var n=Ja(t,W(r,e.scrollToPos.from),W(r,e.scrollToPos.to),e.scrollToPos.margin);Qa(t,n)}var l=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(l)for(var a=0;a<l.length;++a)l[a].lines.length||Y(l[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&Y(o[s],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Y(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function be(e,t){if(e.curOp)return t();bt(e);try{return t()}finally{St(e)}}function te(e,t){return function(){if(e.curOp)return t.apply(e,arguments);bt(e);try{return t.apply(e,arguments)}finally{St(e)}}}function he(e){return function(){if(this.curOp)return e.apply(this,arguments);bt(this);try{return e.apply(this,arguments)}finally{St(this)}}}function re(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);bt(t);try{return e.apply(this,arguments)}finally{St(t)}}}function gr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,bi(as,e))}function as(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var i=+new Date+e.options.workTime,r=lr(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(l){if(r.line>=e.display.viewFrom){var o=l.styles,a=l.text.length>e.options.maxHighlightLength?ht(t.mode,r.state):null,s=jn(e,l,r,!0);a&&(r.state=a),l.styles=s.styles;var u=l.styleClasses,f=s.classes;f?l.styleClasses=f:u&&(l.styleClasses=null);for(var h=!o||o.length!=l.styles.length||u!=f&&(!u||!f||u.bgClass!=f.bgClass||u.textClass!=f.textClass),d=0;!h&&d<o.length;++d)h=o[d]!=l.styles[d];h&&n.push(r.line),l.stateAfter=r.save(),r.nextLine()}else l.text.length<=e.options.maxHighlightLength&&zi(e,l.text,r),l.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return gr(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&be(e,function(){for(var l=0;l<n.length;l++)Je(e,n[l],"text")})}}var ii=function(e,t,i){var r=e.display;this.viewport=t,this.visible=ti(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=pt(e),this.force=i,this.dims=tn(e),this.events=[]};ii.prototype.signal=function(e,t){De(e,t)&&this.events.push(arguments)},ii.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Y.apply(null,this.events[e])};function ss(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ie(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ie(e)+"px",t.scrollbarsClipped=!0)}function us(e){if(e.hasFocus())return null;var t=Te(Tt(e));if(!t||!Ye(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=Pr(e).getSelection();r.anchorNode&&r.extend&&Ye(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function fs(e){if(!(!e||!e.activeElt||e.activeElt==Te(ut(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&Ye(document.body,e.anchorNode)&&Ye(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,i=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),i.removeAllRanges(),i.addRange(r),i.extend(e.focusNode,e.focusOffset)}}function hn(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return Ve(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Al(e)==0)return!1;Ul(e)&&(Ve(e),t.dims=tn(e));var n=r.first+r.size,l=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<l&&l-i.viewFrom<20&&(l=Math.max(r.first,i.viewFrom)),i.viewTo>o&&i.viewTo-o<20&&(o=Math.min(n,i.viewTo)),Ge&&(l=Ki(e.doc,l),o=al(e.doc,o));var a=l!=i.viewFrom||o!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Ya(e,l,o),i.viewOffset=Ue(k(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var s=Al(e);if(!a&&s==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var u=us(e);return s>4&&(i.lineDiv.style.display="none"),hs(e,i.updateLineNumbers,t.dims),s>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,fs(u),je(i.cursorDiv),je(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,a&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,gr(e,400)),i.updateLineNumbers=null,!0}function zl(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==pt(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+Yi(e.display)-Zi(e),i.top)}),t.visible=ti(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ti(e.display,e.doc,i));if(!hn(e,t))break;ei(e);var n=pr(e);hr(e),It(e,n),pn(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function cn(e,t){var i=new ii(e,t);if(hn(e,i)){ei(e),zl(e,i);var r=pr(e);hr(e),It(e,r),pn(e,r),i.finish()}}function hs(e,t,i){var r=e.display,n=e.options.lineNumbers,l=r.lineDiv,o=l.firstChild;function a(p){var v=p.nextSibling;return q&&ke&&e.display.currentWheelTarget==p?p.style.display="none":p.parentNode.removeChild(p),v}for(var s=r.view,u=r.viewFrom,f=0;f<s.length;f++){var h=s[f];if(!h.hidden)if(!h.node||h.node.parentNode!=l){var d=Ba(e,h,u,i);l.insertBefore(d,o)}else{for(;o!=h.node;)o=a(o);var c=n&&t!=null&&t<=u&&h.lineNumber;h.changes&&(se(h.changes,"gutter")>-1&&(c=!1),cl(e,h,u,i)),c&&(je(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(Ii(e.options,u)))),o=h.node.nextSibling}u+=h.size}for(;o;)o=a(o)}function dn(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ee(e,"gutterChanged",e)}function pn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ie(e)+"px"}function Gl(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=rn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,l=r+"px",o=0;o<i.length;o++)if(!i[o].hidden){e.options.fixedGutter&&(i[o].gutter&&(i[o].gutter.style.left=l),i[o].gutterBackground&&(i[o].gutterBackground.style.left=l));var a=i[o].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=l}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}}function Ul(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Ii(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(D("div",[D("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),l=n.firstChild.offsetWidth,o=n.offsetWidth-l;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(l,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",dn(e.display),!0}return!1}function vn(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var l=e[n],o=null;if(typeof l!="string"&&(o=l.style,l=l.className),l=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:l,style:o})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function ql(e){var t=e.gutters,i=e.gutterSpecs;je(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],l=n.className,o=n.style,a=t.appendChild(D("div",null,"CodeMirror-gutter "+l));o&&(a.style.cssText=o),l=="CodeMirror-linenumbers"&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",dn(e)}function mr(e){ql(e.display),pe(e),Gl(e)}function cs(e,t,i,r){var n=this;this.input=i,n.scrollbarFiller=D("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=D("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=kt("div",null,"CodeMirror-code"),n.selectionDiv=D("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=D("div",null,"CodeMirror-cursors"),n.measure=D("div",null,"CodeMirror-measure"),n.lineMeasure=D("div",null,"CodeMirror-measure"),n.lineSpace=kt("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var l=kt("div",[n.lineSpace],"CodeMirror-lines");n.mover=D("div",[l],null,"position: relative"),n.sizer=D("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=D("div",null,null,"position: absolute; height: "+Fn+"px; width: 1px;"),n.gutters=D("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=D("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=D("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),oe&&xe===105&&(n.wrapper.style.clipPath="inset(0px)"),n.wrapper.setAttribute("translate","no"),C&&H<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!q&&!(X&&Qt)&&(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,n.gutterSpecs=vn(r.gutters,r.lineNumbers),ql(n),i.init(n)}var ni=0,Ke=null;C?Ke=-.53:X?Ke=15:oe?Ke=-.7:Wr&&(Ke=-1/3);function Kl(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function ds(e){var t=Kl(e);return t.x*=Ke,t.y*=Ke,t}function Xl(e,t){oe&&xe==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var i=Kl(t),r=i.x,n=i.y,l=Ke;t.deltaMode===0&&(r=t.deltaX,n=t.deltaY,l=1);var o=e.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||n&&u){if(n&&ke&&q){e:for(var f=t.target,h=o.view;f!=a;f=f.parentNode)for(var d=0;d<h.length;d++)if(h[d].node==f){e.display.currentWheelTarget=f;break e}}if(r&&!X&&!ae&&l!=null){n&&u&&dr(e,Math.max(0,a.scrollTop+n*l)),yt(e,Math.max(0,a.scrollLeft+r*l)),(!n||n&&u)&&de(t),o.wheelStartX=null;return}if(n&&l!=null){var c=n*l,p=e.doc.scrollTop,v=p+o.wrapper.clientHeight;c<0?p=Math.max(0,p+c-50):v=Math.min(e.doc.height,v+c+50),cn(e,{top:p,bottom:v})}ni<20&&t.deltaMode!==0&&(o.wheelStartX==null?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=n,setTimeout(function(){if(o.wheelStartX!=null){var m=a.scrollLeft-o.wheelStartX,y=a.scrollTop-o.wheelStartY,S=y&&o.wheelDY&&y/o.wheelDY||m&&o.wheelDX&&m/o.wheelDX;o.wheelStartX=o.wheelStartY=null,S&&(Ke=(Ke*ni+S)/(ni+1),++ni)}},200)):(o.wheelDX+=r,o.wheelDY+=n))}}var Le=function(e,t){this.ranges=e,this.primIndex=t};Le.prototype.primary=function(){return this.ranges[this.primIndex]},Le.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],r=e.ranges[t];if(!Bi(i.anchor,r.anchor)||!Bi(i.head,r.head))return!1}return!0},Le.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new F(Ri(this.ranges[t].anchor),Ri(this.ranges[t].head));return new Le(e,this.primIndex)},Le.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Le.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(A(t,r.from())>=0&&A(e,r.to())<=0)return i}return-1};var F=function(e,t){this.anchor=e,this.head=t};F.prototype.from=function(){return Gr(this.anchor,this.head)},F.prototype.to=function(){return zr(this.anchor,this.head)},F.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ae(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(d,c){return A(d.from(),c.from())}),i=se(t,n);for(var l=1;l<t.length;l++){var o=t[l],a=t[l-1],s=A(a.to(),o.from());if(r&&!o.empty()?s>0:s>=0){var u=Gr(a.from(),o.from()),f=zr(a.to(),o.to()),h=a.empty()?o.from()==o.head:a.from()==a.head;l<=i&&--i,t.splice(--l,2,new F(h?f:u,h?u:f))}}return new Le(t,i)}function $e(e,t){return new Le([new F(e,t||e)],0)}function et(e){return e.text?g(e.from.line+e.text.length-1,E(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function _l(e,t){if(A(e,t.from)<0)return e;if(A(e,t.to)<=0)return et(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=et(t).ch-t.to.ch),g(i,r)}function gn(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new F(_l(n.anchor,t),_l(n.head,t)))}return Ae(e.cm,i,e.sel.primIndex)}function jl(e,t,i){return e.line==t.line?g(i.line,e.ch-t.ch+i.ch):g(i.line+(e.line-t.line),e.ch)}function ps(e,t,i){for(var r=[],n=g(e.first,0),l=n,o=0;o<t.length;o++){var a=t[o],s=jl(a.from,n,l),u=jl(et(a),n,l);if(n=a.to,l=u,i=="around"){var f=e.sel.ranges[o],h=A(f.head,f.anchor)<0;r[o]=new F(h?u:s,h?s:u)}else r[o]=new F(s,s)}return new Le(r,e.sel.primIndex)}function mn(e){e.doc.mode=Pi(e.options,e.doc.modeOption),yr(e)}function yr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,gr(e,100),e.state.modeGen++,e.curOp&&pe(e)}function Yl(e,t){return t.from.ch==0&&t.to.ch==0&&E(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function yn(e,t,i,r){function n(S){return i?i[S]:null}function l(S,x,w){wa(S,x,w,r),ee(S,"change",S,t)}function o(S,x){for(var w=[],M=S;M<x;++M)w.push(new Ot(u[M],n(M),r));return w}var a=t.from,s=t.to,u=t.text,f=k(e,a.line),h=k(e,s.line),d=E(u),c=n(u.length-1),p=s.line-a.line;if(t.full)e.insert(0,o(0,u.length)),e.remove(u.length,e.size-u.length);else if(Yl(e,t)){var v=o(0,u.length-1);l(h,h.text,c),p&&e.remove(a.line,p),v.length&&e.insert(a.line,v)}else if(f==h)if(u.length==1)l(f,f.text.slice(0,a.ch)+d+f.text.slice(s.ch),c);else{var m=o(1,u.length-1);m.push(new Ot(d+f.text.slice(s.ch),c,r)),l(f,f.text.slice(0,a.ch)+u[0],n(0)),e.insert(a.line+1,m)}else if(u.length==1)l(f,f.text.slice(0,a.ch)+u[0]+h.text.slice(s.ch),n(0)),e.remove(a.line+1,p);else{l(f,f.text.slice(0,a.ch)+u[0],n(0)),l(h,d+h.text.slice(s.ch),c);var y=o(1,u.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,y)}ee(e,"change",e,t)}function tt(e,t,i){function r(n,l,o){if(n.linked)for(var a=0;a<n.linked.length;++a){var s=n.linked[a];if(s.doc!=l){var u=o&&s.sharedHist;i&&!u||(t(s.doc,u),r(s.doc,n,u))}}}r(e,null,!0)}function Zl(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,nn(e),mn(e),Ql(e),e.options.direction=t.direction,e.options.lineWrapping||_i(e),e.options.mode=t.modeOption,pe(e)}function Ql(e){(e.doc.direction=="rtl"?st:ot)(e.display.lineDiv,"CodeMirror-rtl")}function vs(e){be(e,function(){Ql(e),pe(e)})}function li(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function xn(e,t){var i={from:Ri(t.from),to:et(t),text:ct(e,t.from,t.to)};return $l(e,i,t.from.line,t.to.line+1),tt(e,function(r){return $l(r,i,t.from.line,t.to.line+1)},!0),i}function Jl(e){for(;e.length;){var t=E(e);if(t.ranges)e.pop();else break}}function gs(e,t){if(t)return Jl(e.done),E(e.done);if(e.done.length&&!E(e.done).ranges)return E(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),E(e.done)}function Vl(e,t,i,r){var n=e.history;n.undone.length=0;var l=+new Date,o,a;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(o=gs(n,n.lastOp==r)))a=E(o.changes),A(t.from,t.to)==0&&A(t.from,a.to)==0?a.to=et(t):o.changes.push(xn(e,t));else{var s=E(n.done);for((!s||!s.ranges)&&oi(e.sel,n.done),o={changes:[xn(e,t)],generation:n.generation},n.done.push(o);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=l,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,a||Y(e,"historyAdded")}function ms(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ys(e,t,i,r){var n=e.history,l=r&&r.origin;i==n.lastSelOp||l&&n.lastSelOrigin==l&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==l||ms(e,l,E(n.done),t))?n.done[n.done.length-1]=t:oi(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=l,n.lastSelOp=i,r&&r.clearRedo!==!1&&Jl(n.undone)}function oi(e,t){var i=E(t);i&&i.ranges&&i.equals(e)||t.push(e)}function $l(e,t,i,r){var n=t["spans_"+e.id],l=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(o){o.markedSpans&&((n||(n=t["spans_"+e.id]={}))[l]=o.markedSpans),++l})}function xs(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function bs(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],n=0;n<t.text.length;++n)r.push(xs(i[n]));return r}function eo(e,t){var i=bs(e,t),r=Ui(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var l=i[n],o=r[n];if(l&&o)e:for(var a=0;a<o.length;++a){for(var s=o[a],u=0;u<l.length;++u)if(l[u].marker==s.marker)continue e;l.push(s)}else o&&(i[n]=o)}return i}function Bt(e,t,i){for(var r=[],n=0;n<e.length;++n){var l=e[n];if(l.ranges){r.push(i?Le.prototype.deepCopy.call(l):l);continue}var o=l.changes,a=[];r.push({changes:a});for(var s=0;s<o.length;++s){var u=o[s],f=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(f=h.match(/^spans_(\d+)$/))&&se(t,Number(f[1]))>-1&&(E(a)[h]=u[h],delete u[h])}}return r}function bn(e,t,i,r){if(r){var n=e.anchor;if(i){var l=A(t,n)<0;l!=A(i,n)<0?(n=t,t=i):l!=A(t,i)<0&&(t=i)}return new F(n,t)}else return new F(i||t,t)}function ai(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),ue(e,new Le([bn(e.sel.primary(),t,i,n)],0),r)}function to(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),l=0;l<e.sel.ranges.length;l++)r[l]=bn(e.sel.ranges[l],t[l],null,n);var o=Ae(e.cm,r,e.sel.primIndex);ue(e,o,i)}function Sn(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,ue(e,Ae(e.cm,n,e.sel.primIndex),r)}function ro(e,t,i,r){ue(e,$e(t,i),r)}function Ss(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var l=0;l<n.length;l++)this.ranges[l]=new F(W(e,n[l].anchor),W(e,n[l].head))},origin:i&&i.origin};return Y(e,"beforeSelectionChange",e,r),e.cm&&Y(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ae(e.cm,r.ranges,r.ranges.length-1):t}function io(e,t,i){var r=e.history.done,n=E(r);n&&n.ranges?(r[r.length-1]=t,si(e,t,i)):ue(e,t,i)}function ue(e,t,i){si(e,t,i),ys(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function si(e,t,i){(De(e,"beforeSelectionChange")||e.cm&&De(e.cm,"beforeSelectionChange"))&&(t=Ss(e,t,i));var r=i&&i.bias||(A(t.primary().head,e.sel.primary().head)<0?-1:1);no(e,oo(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Et(e.cm)}function no(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Gn(e.cm)),ee(e,"cursorActivity",e))}function lo(e){no(e,oo(e,e.sel,null,!1))}function oo(e,t,i,r){for(var n,l=0;l<t.ranges.length;l++){var o=t.ranges[l],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[l],s=ui(e,o.anchor,a&&a.anchor,i,r),u=o.head==o.anchor?s:ui(e,o.head,a&&a.head,i,r);(n||s!=o.anchor||u!=o.head)&&(n||(n=t.ranges.slice(0,l)),n[l]=new F(s,u))}return n?Ae(e.cm,n,t.primIndex):t}function Rt(e,t,i,r,n){var l=k(e,t.line);if(l.markedSpans)for(var o=0;o<l.markedSpans.length;++o){var a=l.markedSpans[o],s=a.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,f="selectRight"in s?!s.selectRight:s.inclusiveRight;if((a.from==null||(u?a.from<=t.ch:a.from<t.ch))&&(a.to==null||(f?a.to>=t.ch:a.to>t.ch))){if(n&&(Y(s,"beforeCursorEnter"),s.explicitlyCleared))if(l.markedSpans){--o;continue}else break;if(!s.atomic)continue;if(i){var h=s.find(r<0?1:-1),d=void 0;if((r<0?f:u)&&(h=ao(e,h,-r,h&&h.line==t.line?l:null)),h&&h.line==t.line&&(d=A(h,i))&&(r<0?d<0:d>0))return Rt(e,h,t,r,n)}var c=s.find(r<0?-1:1);return(r<0?u:f)&&(c=ao(e,c,r,c.line==t.line?l:null)),c?Rt(e,c,t,r,n):null}}return t}function ui(e,t,i,r,n){var l=r||1,o=Rt(e,t,i,l,n)||!n&&Rt(e,t,i,l,!0)||Rt(e,t,i,-l,n)||!n&&Rt(e,t,i,-l,!0);return o||(e.cantEdit=!0,g(e.first,0))}function ao(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?W(e,g(t.line-1)):null:i>0&&t.ch==(r||k(e,t.line)).text.length?t.line<e.first+e.size-1?g(t.line+1,0):null:new g(t.line,t.ch+i)}function so(e){e.setSelection(g(e.firstLine(),0),g(e.lastLine()),Pe)}function uo(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(n,l,o,a){n&&(r.from=W(e,n)),l&&(r.to=W(e,l)),o&&(r.text=o),a!==void 0&&(r.origin=a)}),Y(e,"beforeChange",e,r),e.cm&&Y(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function zt(e,t,i){if(e.cm){if(!e.cm.curOp)return te(e.cm,zt)(e,t,i);if(e.cm.state.suppressEdits)return}if(!((De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"))&&(t=uo(e,t,!0),!t))){var r=el&&!i&&ya(e,t.from,t.to);if(r)for(var n=r.length-1;n>=0;--n)fo(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else fo(e,t)}}function fo(e,t){if(!(t.text.length==1&&t.text[0]==""&&A(t.from,t.to)==0)){var i=gn(e,t);Vl(e,t,i,e.cm?e.cm.curOp.id:NaN),xr(e,t,i,Ui(e,t));var r=[];tt(e,function(n,l){!l&&se(r,n.history)==-1&&(vo(n.history,t),r.push(n.history)),xr(n,t,null,Ui(n,t))})}}function fi(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,l,o=e.sel,a=t=="undo"?n.done:n.undone,s=t=="undo"?n.undone:n.done,u=0;u<a.length&&(l=a[u],!(i?l.ranges&&!l.equals(e.sel):!l.ranges));u++);if(u!=a.length){for(n.lastOrigin=n.lastSelOrigin=null;;)if(l=a.pop(),l.ranges){if(oi(l,s),i&&!l.equals(e.sel)){ue(e,l,{clearRedo:!1});return}o=l}else if(r){a.push(l);return}else break;var f=[];oi(o,s),s.push({changes:f,generation:n.generation}),n.generation=l.generation||++n.maxGeneration;for(var h=De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"),d=function(v){var m=l.changes[v];if(m.origin=t,h&&!uo(e,m,!1))return a.length=0,{};f.push(xn(e,m));var y=v?gn(e,m):E(a);xr(e,m,y,eo(e,m)),!v&&e.cm&&e.cm.scrollIntoView({from:m.from,to:et(m)});var S=[];tt(e,function(x,w){!w&&se(S,x.history)==-1&&(vo(x.history,m),S.push(x.history)),xr(x,m,null,eo(x,m))})},c=l.changes.length-1;c>=0;--c){var p=d(c);if(p)return p.v}}}}function ho(e,t){if(t!=0&&(e.first+=t,e.sel=new Le(Ir(e.sel.ranges,function(n){return new F(g(n.anchor.line+t,n.anchor.ch),g(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){pe(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)Je(e.cm,r,"gutter")}}function xr(e,t,i,r){if(e.cm&&!e.cm.curOp)return te(e.cm,xr)(e,t,i,r);if(t.to.line<e.first){ho(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var n=t.text.length-1-(e.first-t.from.line);ho(e,n),t={from:g(e.first,0),to:g(t.to.line+n,t.to.ch),text:[E(t.text)],origin:t.origin}}var l=e.lastLine();t.to.line>l&&(t={from:t.from,to:g(l,k(e,l).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ct(e,t.from,t.to),i||(i=gn(e,t)),e.cm?ws(e.cm,t,r):yn(e,t,r),si(e,i,Pe),e.cantEdit&&ui(e,g(e.firstLine(),0))&&(e.cantEdit=!1)}}function ws(e,t,i){var r=e.doc,n=e.display,l=t.from,o=t.to,a=!1,s=l.line;e.options.lineWrapping||(s=I(Ne(k(r,l.line))),r.iter(s,o.line+1,function(c){if(c==n.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Gn(e),yn(r,t,i,Ol(e)),e.options.lineWrapping||(r.iter(s,l.line+t.text.length,function(c){var p=jr(c);p>n.maxLineLength&&(n.maxLine=c,n.maxLineLength=p,n.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),ha(r,l.line),gr(e,400);var u=t.text.length-(o.line-l.line)-1;t.full?pe(e):l.line==o.line&&t.text.length==1&&!Yl(e.doc,t)?Je(e,l.line,"text"):pe(e,l.line,o.line+1,u);var f=De(e,"changes"),h=De(e,"change");if(h||f){var d={from:l,to:o,text:t.text,removed:t.removed,origin:t.origin};h&&ee(e,"change",e,d),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function Gt(e,t,i,r,n){var l;r||(r=i),A(r,i)<0&&(l=[r,i],i=l[0],r=l[1]),typeof t=="string"&&(t=e.splitLines(t)),zt(e,{from:i,to:r,text:t,origin:n})}function co(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function po(e,t,i,r){for(var n=0;n<e.length;++n){var l=e[n],o=!0;if(l.ranges){l.copied||(l=e[n]=l.deepCopy(),l.copied=!0);for(var a=0;a<l.ranges.length;a++)co(l.ranges[a].anchor,t,i,r),co(l.ranges[a].head,t,i,r);continue}for(var s=0;s<l.changes.length;++s){var u=l.changes[s];if(i<u.from.line)u.from=g(u.from.line+r,u.from.ch),u.to=g(u.to.line+r,u.to.ch);else if(t<=u.to.line){o=!1;break}}o||(e.splice(0,n+1),n=0)}}function vo(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;po(e.done,i,r,n),po(e.undone,i,r,n)}function br(e,t,i,r){var n=t,l=t;return typeof t=="number"?l=k(e,Xn(e,t)):n=I(t),n==null?null:(r(l,n)&&e.cm&&Je(e.cm,n,i),l)}function Sr(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Sr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var n=this.lines[i];this.height-=n.height,Ca(n),ee(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function wr(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}wr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],n=r.chunkSize();if(e<n){var l=Math.min(t,n-e),o=r.height;if(r.removeInner(e,l),this.height-=o-r.height,n==l&&(this.children.splice(i--,1),r.parent=null),(t-=l)==0)break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Sr))){var a=[];this.collapse(a),this.children=[new Sr(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var n=this.children[r],l=n.chunkSize();if(e<=l){if(n.insertInner(e,t,i),n.lines&&n.lines.length>50){for(var o=n.lines.length%25+25,a=o;a<n.lines.length;){var s=new Sr(n.lines.slice(a,a+=25));n.height-=s.height,this.children.splice(++r,0,s),s.parent=this}n.lines=n.lines.slice(0,o),this.maybeSpill()}break}e-=l}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new wr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var n=se(e.parent.children,e);e.parent.children.splice(n+1,0,i)}else{var r=new wr(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var n=this.children[r],l=n.chunkSize();if(e<l){var o=Math.min(t,l-e);if(n.iterN(e,o,i))return!0;if((t-=o)==0)break;e=0}else e-=l}}};var Cr=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};Cr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=I(i);if(!(r==null||!t)){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var l=ur(this);Fe(i,Math.max(0,i.height-l)),e&&(be(e,function(){go(e,i,-l),Je(e,r,"widget")}),ee(e,"lineWidgetCleared",e,this,r))}},Cr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=ur(this)-t;n&&(Qe(this.doc,r)||Fe(r,r.height+n),i&&be(i,function(){i.curOp.forceUpdate=!0,go(i,r,n),ee(i,"lineWidgetChanged",i,e,I(r))}))},Mt(Cr);function go(e,t,i){Ue(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&fn(e,i)}function Cs(e,t,i,r){var n=new Cr(e,i,r),l=e.cm;return l&&n.noHScroll&&(l.display.alignWidgets=!0),br(e,t,"widget",function(o){var a=o.widgets||(o.widgets=[]);if(n.insertAt==null?a.push(n):a.splice(Math.min(a.length,Math.max(0,n.insertAt)),0,n),n.line=o,l&&!Qe(e,o)){var s=Ue(o)<e.scrollTop;Fe(o,o.height+ur(n)),s&&fn(l,n.height),l.curOp.forceUpdate=!0}return!0}),l&&ee(l,"lineWidgetAdded",l,n,typeof t=="number"?t:I(t)),n}var mo=0,rt=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++mo};rt.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&bt(e),De(this,"clear")){var i=this.find();i&&ee(this,"clear",i.from,i.to)}for(var r=null,n=null,l=0;l<this.lines.length;++l){var o=this.lines[l],a=or(o.markedSpans,this);e&&!this.collapsed?Je(e,I(o),"text"):e&&(a.to!=null&&(n=I(o)),a.from!=null&&(r=I(o))),o.markedSpans=pa(o.markedSpans,a),a.from==null&&this.collapsed&&!Qe(this.doc,o)&&e&&Fe(o,Ht(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=Ne(this.lines[s]),f=jr(u);f>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&pe(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&lo(e.doc)),e&&ee(e,"markerCleared",e,this,r,n),t&&St(e),this.parent&&this.parent.clear()}},rt.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var l=this.lines[n],o=or(l.markedSpans,this);if(o.from!=null&&(i=g(t?l:I(l),o.from),e==-1))return i;if(o.to!=null&&(r=g(t?l:I(l),o.to),e==1))return r}return i&&{from:i,to:r}},rt.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;!t||!r||be(r,function(){var n=t.line,l=I(t.line),o=Qi(r,l);if(o&&(wl(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Qe(i.doc,n)&&i.height!=null){var a=i.height;i.height=null;var s=ur(i)-a;s&&Fe(n,n.height+s)}ee(r,"markerChanged",r,e)})},rt.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||se(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},rt.prototype.detachLine=function(e){if(this.lines.splice(se(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Mt(rt);function Ut(e,t,i,r,n){if(r&&r.shared)return Ls(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return te(e.cm,Ut)(e,t,i,r,n);var l=new rt(e,n),o=A(t,i);if(r&&ft(r,l,!1),o>0||o==0&&l.clearWhenEmpty!==!1)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=kt("span",[l.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ol(e,t.line,t,i,l)||t.line!=i.line&&ol(e,i.line,t,i,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");da()}l.addToHistory&&Vl(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,i.line+1,function(h){s&&l.collapsed&&!s.options.lineWrapping&&Ne(h)==s.display.maxLine&&(u=!0),l.collapsed&&a!=t.line&&Fe(h,0),va(h,new qr(l,a==t.line?t.ch:null,a==i.line?i.ch:null),e.cm&&e.cm.curOp),++a}),l.collapsed&&e.iter(t.line,i.line+1,function(h){Qe(e,h)&&Fe(h,0)}),l.clearOnEnter&&N(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(ca(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++mo,l.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),l.collapsed)pe(s,t.line,i.line+1);else if(l.className||l.startStyle||l.endStyle||l.css||l.attributes||l.title)for(var f=t.line;f<=i.line;f++)Je(s,f,"text");l.atomic&&lo(s.doc),ee(s,"markerAdded",s,l)}return l}var Lr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Lr.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ee(this,"clear")}},Lr.prototype.find=function(e,t){return this.primary.find(e,t)},Mt(Lr);function Ls(e,t,i,r,n){r=ft(r),r.shared=!1;var l=[Ut(e,t,i,r,n)],o=l[0],a=r.widgetNode;return tt(e,function(s){a&&(r.widgetNode=a.cloneNode(!0)),l.push(Ut(s,W(s,t),W(s,i),r,n));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;o=E(l)}),new Lr(l,o)}function yo(e){return e.findMarks(g(e.first,0),e.clipPos(g(e.lastLine())),function(t){return t.parent})}function ks(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.find(),l=e.clipPos(n.from),o=e.clipPos(n.to);if(A(l,o)){var a=Ut(e,l,o,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function Ts(e){for(var t=function(r){var n=e[r],l=[n.primary.doc];tt(n.primary.doc,function(s){return l.push(s)});for(var o=0;o<n.markers.length;o++){var a=n.markers[o];se(l,a.doc)==-1&&(a.parent=null,n.markers.splice(o--,1))}},i=0;i<e.length;i++)t(i)}var Ms=0,ve=function(e,t,i,r,n){if(!(this instanceof ve))return new ve(e,t,i,r,n);i==null&&(i=0),wr.call(this,[new Sr([new Ot("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var l=g(i,0);this.sel=$e(l),this.history=new li(null),this.id=++Ms,this.modeOption=t,this.lineSep=r,this.direction=n=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),yn(this,{from:l,to:l,text:e}),ue(this,$e(l),Pe)};ve.prototype=In(wr.prototype,{constructor:ve,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ei(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:re(function(e){var t=g(this.first,0),i=this.first+this.size-1;zt(this,{from:t,to:g(i,k(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&cr(this.cm,0,0),ue(this,$e(t),Pe)}),replaceRange:function(e,t,i,r){t=W(this,t),i=i?W(this,i):t,Gt(this,e,t,i,r)},getRange:function(e,t,i){var r=ct(this,W(this,e),W(this,t));return i===!1?r:i===""?r.join(""):r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(nr(this,e))return k(this,e)},getLineNumber:function(e){return I(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=k(this,e)),Ne(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return W(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:re(function(e,t,i){ro(this,W(this,typeof e=="number"?g(e,t||0):e),null,i)}),setSelection:re(function(e,t,i){ro(this,W(this,e),W(this,t||e),i)}),extendSelection:re(function(e,t,i){ai(this,W(this,e),t&&W(this,t),i)}),extendSelections:re(function(e,t){to(this,_n(this,e),t)}),extendSelectionsBy:re(function(e,t){var i=Ir(this.sel.ranges,e);to(this,_n(this,i),t)}),setSelections:re(function(e,t,i){if(e.length){for(var r=[],n=0;n<e.length;n++)r[n]=new F(W(this,e[n].anchor),W(this,e[n].head||e[n].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),ue(this,Ae(this.cm,r,t),i)}}),addSelection:re(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new F(W(this,e),W(this,t||e))),ue(this,Ae(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var n=ct(this,t[r].from(),t[r].to());i=i?i.concat(n):n}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var n=ct(this,i[r].from(),i[r].to());e!==!1&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:re(function(e,t,i){for(var r=[],n=this.sel,l=0;l<n.ranges.length;l++){var o=n.ranges[l];r[l]={from:o.from(),to:o.to(),text:this.splitLines(e[l]),origin:i}}for(var a=t&&t!="end"&&ps(this,r,t),s=r.length-1;s>=0;s--)zt(this,r[s]);a?io(this,a):this.cm&&Et(this.cm)}),undo:re(function(){fi(this,"undo")}),redo:re(function(){fi(this,"redo")}),undoSelection:re(function(){fi(this,"undo",!0)}),redoSelection:re(function(){fi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new li(this.history),tt(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Bt(this.history.done),undone:Bt(this.history.undone)}},setHistory:function(e){var t=this.history=new li(this.history);t.done=Bt(e.done.slice(0),null,!0),t.undone=Bt(e.undone.slice(0),null,!0)},setGutterMarker:re(function(e,t,i){return br(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&Bn(n)&&(r.gutterMarkers=null),!0})}),clearGutter:re(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&br(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Bn(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!nr(this,e)||(t=e,e=k(this,e),!e))return null}else if(t=I(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:re(function(e,t,i){return br(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[n])r[n]=i;else{if(Lt(i).test(r[n]))return!1;r[n]+=" "+i}return!0})}),removeLineClass:re(function(e,t,i){return br(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",l=r[n];if(l)if(i==null)r[n]=null;else{var o=l.match(Lt(i));if(!o)return!1;var a=o.index+o[0].length;r[n]=l.slice(0,o.index)+(!o.index||a==l.length?"":" ")+l.slice(a)||null}else return!1;return!0})}),addLineWidget:re(function(e,t,i){return Cs(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ut(this,W(this,e),W(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=W(this,e),Ut(this,e,e,i,"bookmark")},findMarksAt:function(e){e=W(this,e);var t=[],i=k(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(n.from==null||n.from<=e.ch)&&(n.to==null||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=W(this,e),t=W(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(l){var o=l.markedSpans;if(o)for(var a=0;a<o.length;a++){var s=o[a];!(s.to!=null&&n==e.line&&e.ch>=s.to||s.from==null&&n!=e.line||s.from!=null&&n==t.line&&s.from>=t.ch)&&(!i||i(s.marker))&&r.push(s.marker.parent||s.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(n){var l=n.text.length+r;if(l>e)return t=e,!0;e-=l,++i}),W(this,g(i,t))},indexFromPos:function(e){e=W(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new ve(Ei(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new ve(Ei(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],ks(r,yo(this)),r},unlinkDoc:function(e){if(e instanceof U&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ts(yo(this));break}}if(e.history==this.history){var r=[e.id];tt(e,function(n){return r.push(n.id)},!0),e.history=new li(null),e.history.done=Bt(this.history.done,r),e.history.undone=Bt(this.history.undone,r)}},iterLinkedDocs:function(e){tt(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ai(e)},lineSeparator:function(){return this.lineSep||`
|
|
11
|
+
`},setDirection:re(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&vs(this.cm))})}),ve.prototype.eachLine=ve.prototype.iter;var xo=0;function Ds(e){var t=this;if(bo(t),!($(t,e)||qe(t.display,e))){de(e),C&&(xo=+new Date);var i=gt(t,e,!0),r=e.dataTransfer.files;if(!(!i||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var n=r.length,l=Array(n),o=0,a=function(){++o==n&&te(t,function(){i=W(t.doc,i);var c={from:i,to:i,text:t.doc.splitLines(l.filter(function(p){return p!=null}).join(t.doc.lineSeparator())),origin:"paste"};zt(t.doc,c),io(t.doc,$e(W(t.doc,i),W(t.doc,et(c))))})()},s=function(c,p){if(t.options.allowDropFileTypes&&se(t.options.allowDropFileTypes,c.type)==-1){a();return}var v=new FileReader;v.onerror=function(){return a()},v.onload=function(){var m=v.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(m)){a();return}l[p]=m,a()},v.readAsText(c)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),si(t.doc,$e(i,i)),h)for(var d=0;d<h.length;++d)Gt(t.doc,"",h[d].anchor,h[d].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch{}}}}function Ns(e,t){if(C&&(!e.state.draggingText||+new Date-xo<100)){ir(t);return}if(!($(e,t)||qe(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Wr)){var i=D("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ae&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),ae&&i.parentNode.removeChild(i)}}function Os(e,t){var i=gt(e,t);if(i){var r=document.createDocumentFragment();ln(e,i,r),e.display.dragCursor||(e.display.dragCursor=D("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),we(e.display.dragCursor,r)}}function bo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function So(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&i.push(n)}i.length&&i[0].operation(function(){for(var l=0;l<i.length;l++)e(i[l])})}}var wo=!1;function As(){wo||(Ws(),wo=!0)}function Ws(){var e;N(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,So(Hs)},100))}),N(window,"blur",function(){return So(Ft)})}function Hs(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var it={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},kr=0;kr<10;kr++)it[kr+48]=it[kr+96]=String(kr);for(var hi=65;hi<=90;hi++)it[hi]=String.fromCharCode(hi);for(var Tr=1;Tr<=12;Tr++)it[Tr+111]=it[Tr+63235]="F"+Tr;var Xe={};Xe.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Xe.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Xe.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Xe.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Xe.default=ke?Xe.macDefault:Xe.pcDefault;function Ps(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,n,l,o=0;o<t.length-1;o++){var a=t[o];if(/^(cmd|meta|m)$/i.test(a))l=!0;else if(/^a(lt)?$/i.test(a))i=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))n=!0;else throw new Error("Unrecognized modifier name: "+a)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),l&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Fs(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var n=Ir(i.split(" "),Ps),l=0;l<n.length;l++){var o=void 0,a=void 0;l==n.length-1?(a=n.join(" "),o=r):(a=n.slice(0,l+1).join(" "),o="...");var s=t[a];if(!s)t[a]=o;else if(s!=o)throw new Error("Inconsistent bindings for "+a)}delete e[i]}for(var u in t)e[u]=t[u];return e}function qt(e,t,i,r){t=ci(t);var n=t.call?t.call(e,r):t[e];if(n===!1)return"nothing";if(n==="...")return"multi";if(n!=null&&i(n))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return qt(e,t.fallthrough,i,r);for(var l=0;l<t.fallthrough.length;l++){var o=qt(e,t.fallthrough[l],i,r);if(o)return o}}}function Co(e){var t=typeof e=="string"?e:it[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Lo(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(Pn?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(Pn?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function ko(e,t){if(ae&&e.keyCode==34&&e.char)return!1;var i=it[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Lo(i,e,t))}function ci(e){return typeof e=="string"?Xe[e]:e}function Kt(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var l=t(i[n]);r.length&&A(l.from,E(r).to)<=0;){var o=r.pop();if(A(o.from,l.from)<0){l.from=o.from;break}}r.push(l)}be(e,function(){for(var a=r.length-1;a>=0;a--)Gt(e.doc,"",r[a].from,r[a].to,"+delete");Et(e)})}function wn(e,t,i){var r=Rn(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Cn(e,t,i){var r=wn(e,t.ch,i);return r==null?null:new g(t.line,r,i<0?"after":"before")}function Ln(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var l=ze(i,t.doc.direction);if(l){var o=n<0?E(l):l[0],a=n<0==(o.level==1),s=a?"after":"before",u;if(o.level>0||t.doc.direction=="rtl"){var f=Wt(t,i);u=n<0?i.text.length-1:0;var h=Be(t,f,u).top;u=er(function(d){return Be(t,f,d).top==h},n<0==(o.level==1)?o.from:o.to-1,u),s=="before"&&(u=wn(i,u,1))}else u=n<0?o.to:o.from;return new g(r,u,s)}}return new g(r,n<0?i.text.length:0,n<0?"before":"after")}function Es(e,t,i,r){var n=ze(t,e.doc.direction);if(!n)return Cn(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var l=rr(n,i.ch,i.sticky),o=n[l];if(e.doc.direction=="ltr"&&o.level%2==0&&(r>0?o.to>i.ch:o.from<i.ch))return Cn(t,i,r);var a=function(y,S){return wn(t,y instanceof g?y.ch:y,S)},s,u=function(y){return e.options.lineWrapping?(s=s||Wt(e,t),Nl(e,t,s,y)):{begin:0,end:t.text.length}},f=u(i.sticky=="before"?a(i,-1):i.ch);if(e.doc.direction=="rtl"||o.level==1){var h=o.level==1==r<0,d=a(i,h?1:-1);if(d!=null&&(h?d<=o.to&&d<=f.end:d>=o.from&&d>=f.begin)){var c=h?"before":"after";return new g(i.line,d,c)}}var p=function(y,S,x){for(var w=function(z,ie){return ie?new g(i.line,a(z,1),"before"):new g(i.line,z,"after")};y>=0&&y<n.length;y+=S){var M=n[y],T=S>0==(M.level!=1),P=T?x.begin:a(x.end,-1);if(M.from<=P&&P<M.to||(P=T?M.from:a(M.to,-1),x.begin<=P&&P<x.end))return w(P,T)}},v=p(l+r,r,f);if(v)return v;var m=r>0?f.end:a(f.begin,-1);return m!=null&&!(r>0&&m==t.text.length)&&(v=p(r>0?0:n.length-1,r,u(m)),v)?v:null}var Mr={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Pe)},killLine:function(e){return Kt(e,function(t){if(t.empty()){var i=k(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:g(t.head.line+1,0)}:{from:t.head,to:g(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Kt(e,function(t){return{from:g(t.from().line,0),to:W(e.doc,g(t.to().line+1,0))}})},delLineLeft:function(e){return Kt(e,function(t){return{from:g(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Kt(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Kt(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(g(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(g(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return To(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Mo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Is(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},$t)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},$t)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?Mo(e,t.head):r},$t)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),r=e.options.tabSize,n=0;n<i.length;n++){var l=i[n].from(),o=Me(e.getLine(l.line),l.ch,r);t.push(Ci(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return be(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++)if(t[r].empty()){var n=t[r].head,l=k(e.doc,n.line).text;if(l){if(n.ch==l.length&&(n=new g(n.line,n.ch-1)),n.ch>0)n=new g(n.line,n.ch+1),e.replaceRange(l.charAt(n.ch-1)+l.charAt(n.ch-2),g(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var o=k(e.doc,n.line-1).text;o&&(n=new g(n.line,1),e.replaceRange(l.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),g(n.line-1,o.length-1),n,"+transpose"))}}i.push(new F(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return be(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Et(e)})},openLine:function(e){return e.replaceSelection(`
|
|
12
|
+
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function To(e,t){var i=k(e.doc,t),r=Ne(i);return r!=i&&(t=I(r)),Ln(!0,e,r,t,1)}function Is(e,t){var i=k(e.doc,t),r=ba(i);return r!=i&&(t=I(r)),Ln(!0,e,i,t,-1)}function Mo(e,t){var i=To(e,t.line),r=k(e.doc,i.line),n=ze(r,e.doc.direction);if(!n||n[0].level==0){var l=Math.max(i.ch,r.text.search(/\S/)),o=t.line==i.line&&t.ch<=l&&t.ch;return g(i.line,o?0:l,i.sticky)}return i}function di(e,t,i){if(typeof t=="string"&&(t=Mr[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),n=t(e)!=Fr}finally{e.display.shift=r,e.state.suppressEdits=!1}return n}function Bs(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=qt(t,e.state.keyMaps[r],i,e);if(n)return n}return e.options.extraKeys&&qt(t,e.options.extraKeys,i,e)||qt(t,e.options.keyMap,i,e)}var Rs=new Ze;function Dr(e,t,i,r){var n=e.state.keySeq;if(n){if(Co(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Rs.set(50,function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),Do(e,n+" "+t,i,r))return!0}return Do(e,t,i,r)}function Do(e,t,i,r){var n=Bs(e,t,r);return n=="multi"&&(e.state.keySeq=t),n=="handled"&&ee(e,"keyHandled",e,t,i),(n=="handled"||n=="multi")&&(de(i),on(e)),!!n}function No(e,t){var i=ko(t,!0);return i?t.shiftKey&&!e.state.keySeq?Dr(e,"Shift-"+i,t,function(r){return di(e,r,!0)})||Dr(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return di(e,r)}):Dr(e,i,t,function(r){return di(e,r)}):!1}function zs(e,t,i){return Dr(e,"'"+i+"'",t,function(r){return di(e,r,!0)})}var kn=null;function Oo(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=Te(Tt(t)),!$(t,e))){C&&H<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=No(t,e);ae&&(kn=r?i:null,!r&&i==88&&!na&&(ke?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),X&&!ke&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Gs(t)}}function Gs(e){var t=e.display.lineDiv;st(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(ot(t,"CodeMirror-crosshair"),Ce(document,"keyup",i),Ce(document,"mouseover",i))}N(document,"keyup",i),N(document,"mouseover",i)}function Ao(e){e.keyCode==16&&(this.doc.sel.shift=!1),$(this,e)}function Wo(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(qe(t.display,e)||$(t,e)||e.ctrlKey&&!e.altKey||ke&&e.metaKey)){var i=e.keyCode,r=e.charCode;if(ae&&i==kn){kn=null,de(e);return}if(!(ae&&(!e.which||e.which<10)&&No(t,e))){var n=String.fromCharCode(r??i);n!="\b"&&(zs(t,e,n)||t.display.input.onKeyPress(e))}}}var Us=400,Tn=function(e,t,i){this.time=e,this.pos=t,this.button=i};Tn.prototype.compare=function(e,t,i){return this.time+Us>e&&A(t,this.pos)==0&&i==this.button};var Nr,Or;function qs(e,t){var i=+new Date;return Or&&Or.compare(i,e,t)?(Nr=Or=null,"triple"):Nr&&Nr.compare(i,e,t)?(Or=new Tn(i,e,t),Nr=null,"double"):(Nr=new Tn(i,e,t),Or=null,"single")}function Ho(e){var t=this,i=t.display;if(!($(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,qe(i,e)){q||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!Mn(t,e)){var r=gt(t,e),n=qn(e),l=r?qs(r,n):"single";Pr(t).focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Ks(t,n,r,l,e))&&(n==1?r?_s(t,r,l,e):Di(e)==i.scroller&&de(e):n==2?(r&&ai(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(yi?t.display.input.onContextMenu(e):an(t)))}}}function Ks(e,t,i,r,n){var l="Click";return r=="double"?l="Double"+l:r=="triple"&&(l="Triple"+l),l=(t==1?"Left":t==2?"Middle":"Right")+l,Dr(e,Lo(l,n),n,function(o){if(typeof o=="string"&&(o=Mr[o]),!o)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=o(e,i)!=Fr}finally{e.state.suppressEdits=!1}return a})}function Xs(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var l=jo?i.shiftKey&&i.metaKey:i.altKey;n.unit=l?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=ke?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(ke?i.altKey:i.ctrlKey)),n}function _s(e,t,i,r){C?setTimeout(bi(Hl,e),0):e.curOp.focus=Te(Tt(e));var n=Xs(e,i,r),l=e.doc.sel,o;e.options.dragDrop&&ea&&!e.isReadOnly()&&i=="single"&&(o=l.contains(t))>-1&&(A((o=l.ranges[o]).from(),t)<0||t.xRel>0)&&(A(o.to(),t)>0||t.xRel<0)?js(e,r,t,n):Ys(e,r,t,n)}function js(e,t,i,r){var n=e.display,l=!1,o=te(e,function(u){q&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:an(e)),Ce(n.wrapper.ownerDocument,"mouseup",o),Ce(n.wrapper.ownerDocument,"mousemove",a),Ce(n.scroller,"dragstart",s),Ce(n.scroller,"drop",o),l||(de(u),r.addNew||ai(e.doc,i,null,null,r.extend),q&&!Wr||C&&H==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),a=function(u){l=l||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return l=!0};q&&(n.scroller.draggable=!0),e.state.draggingText=o,o.copy=!r.moveOnDrag,N(n.wrapper.ownerDocument,"mouseup",o),N(n.wrapper.ownerDocument,"mousemove",a),N(n.scroller,"dragstart",s),N(n.scroller,"drop",o),e.state.delayingBlurEvent=!0,setTimeout(function(){return n.input.focus()},20),n.scroller.dragDrop&&n.scroller.dragDrop()}function Po(e,t,i){if(i=="char")return new F(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new F(g(t.line,0),W(e.doc,g(t.line+1,0)));var r=i(e,t);return new F(r.from,r.to)}function Ys(e,t,i,r){C&&an(e);var n=e.display,l=e.doc;de(t);var o,a,s=l.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=l.sel.contains(i),a>-1?o=u[a]:o=new F(i,i)):(o=l.sel.primary(),a=l.sel.primIndex),r.unit=="rectangle")r.addNew||(o=new F(i,i)),i=gt(e,t,!0,!0),a=-1;else{var f=Po(e,i,r.unit);r.extend?o=bn(o,f.anchor,f.head,r.extend):o=f}r.addNew?a==-1?(a=u.length,ue(l,Ae(e,u.concat([o]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&r.unit=="char"&&!r.extend?(ue(l,Ae(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=l.sel):Sn(l,a,o,Si):(a=0,ue(l,new Le([o],0),Si),s=l.sel);var h=i;function d(x){if(A(h,x)!=0)if(h=x,r.unit=="rectangle"){for(var w=[],M=e.options.tabSize,T=Me(k(l,i.line).text,i.ch,M),P=Me(k(l,x.line).text,x.ch,M),z=Math.min(T,P),ie=Math.max(T,P),K=Math.min(i.line,x.line),Se=Math.min(e.lastLine(),Math.max(i.line,x.line));K<=Se;K++){var ge=k(l,K).text,Q=wi(ge,z,M);z==ie?w.push(new F(g(K,Q),g(K,Q))):ge.length>Q&&w.push(new F(g(K,Q),g(K,wi(ge,ie,M))))}w.length||w.push(new F(i,i)),ue(l,Ae(e,s.ranges.slice(0,a).concat(w),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(x)}else{var me=o,le=Po(e,x,r.unit),V=me.anchor,J;A(le.anchor,V)>0?(J=le.head,V=Gr(me.from(),le.anchor)):(J=le.anchor,V=zr(me.to(),le.head));var _=s.ranges.slice(0);_[a]=Zs(e,new F(W(l,V),J)),ue(l,Ae(e,_,a),Si)}}var c=n.wrapper.getBoundingClientRect(),p=0;function v(x){var w=++p,M=gt(e,x,!0,r.unit=="rectangle");if(M)if(A(M,h)!=0){e.curOp.focus=Te(Tt(e)),d(M);var T=ti(n,l);(M.line>=T.to||M.line<T.from)&&setTimeout(te(e,function(){p==w&&v(x)}),150)}else{var P=x.clientY<c.top?-20:x.clientY>c.bottom?20:0;P&&setTimeout(te(e,function(){p==w&&(n.scroller.scrollTop+=P,v(x))}),50)}}function m(x){e.state.selectingText=!1,p=1/0,x&&(de(x),n.input.focus()),Ce(n.wrapper.ownerDocument,"mousemove",y),Ce(n.wrapper.ownerDocument,"mouseup",S),l.history.lastSelOrigin=null}var y=te(e,function(x){x.buttons===0||!qn(x)?m(x):v(x)}),S=te(e,m);e.state.selectingText=S,N(n.wrapper.ownerDocument,"mousemove",y),N(n.wrapper.ownerDocument,"mouseup",S)}function Zs(e,t){var i=t.anchor,r=t.head,n=k(e.doc,i.line);if(A(i,r)==0&&i.sticky==r.sticky)return t;var l=ze(n);if(!l)return t;var o=rr(l,i.ch,i.sticky),a=l[o];if(a.from!=i.ch&&a.to!=i.ch)return t;var s=o+(a.from==i.ch==(a.level!=1)?0:1);if(s==0||s==l.length)return t;var u;if(r.line!=i.line)u=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var f=rr(l,r.ch,r.sticky),h=f-o||(r.ch-i.ch)*(a.level==1?-1:1);f==s-1||f==s?u=h<0:u=h>0}var d=l[s+(u?-1:0)],c=u==(d.level==1),p=c?d.from:d.to,v=c?"after":"before";return i.ch==p&&i.sticky==v?t:new F(new g(i.line,p,v),r)}function Fo(e,t,i,r){var n,l;if(t.touches)n=t.touches[0].clientX,l=t.touches[0].clientY;else try{n=t.clientX,l=t.clientY}catch{return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&de(t);var o=e.display,a=o.lineDiv.getBoundingClientRect();if(l>a.bottom||!De(e,i))return Mi(t);l-=a.top-o.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=o.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=n){var f=dt(e.doc,l),h=e.display.gutterSpecs[s];return Y(e,i,e,f,h.className,t),Mi(t)}}}function Mn(e,t){return Fo(e,t,"gutterClick",!0)}function Eo(e,t){qe(e.display,t)||Qs(e,t)||$(e,t,"contextmenu")||yi||e.display.input.onContextMenu(t)}function Qs(e,t){return De(e,"gutterContextMenu")?Fo(e,t,"gutterContextMenu",!1):!1}function Io(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),fr(e)}var Xt={toString:function(){return"CodeMirror.Init"}},Bo={},pi={};function Js(e){var t=e.optionHandlers;function i(r,n,l,o){e.defaults[r]=n,l&&(t[r]=o?function(a,s,u){u!=Xt&&l(a,s,u)}:l)}e.defineOption=i,e.Init=Xt,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,mn(r)},!0),i("indentUnit",2,mn,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){yr(r),fr(r),pe(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!!n){var l=[],o=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var f=s.text.indexOf(n,u);if(f==-1)break;u=f+n.length,l.push(g(o,f))}o++});for(var a=l.length-1;a>=0;a--)Gt(r.doc,n,l[a],g(l[a].line,l[a].ch+n.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,n,l){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),l!=Xt&&r.refresh()}),i("specialCharPlaceholder",Ta,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",Qt?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!Yo),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){Io(r),mr(r)},!0),i("keyMap","default",function(r,n,l){var o=ci(n),a=l!=Xt&&ci(l);a&&a.detach&&a.detach(r,o),o.attach&&o.attach(r,a||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,$s,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=vn(n,r.options.lineNumbers),mr(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?rn(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return It(r)},!0),i("scrollbarStyle","native",function(r){Rl(r),It(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=vn(r.options.gutters,n),mr(r)},!0),i("firstLineNumber",1,mr,!0),i("lineNumberFormatter",function(r){return r},mr,!0),i("showCursorWhenSelecting",!1,hr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Ft(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Vs),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,hr,!0),i("singleCursorHeightPerLine",!0,hr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,yr,!0),i("addModeClass",!1,yr,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,yr,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Vs(e,t,i){var r=i&&i!=Xt;if(!t!=!r){var n=e.display.dragFunctions,l=t?N:Ce;l(e.display.scroller,"dragstart",n.start),l(e.display.scroller,"dragenter",n.enter),l(e.display.scroller,"dragover",n.over),l(e.display.scroller,"dragleave",n.leave),l(e.display.scroller,"drop",n.drop)}}function $s(e){e.options.lineWrapping?(st(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ot(e.display.wrapper,"CodeMirror-wrap"),_i(e)),nn(e),pe(e),fr(e),setTimeout(function(){return It(e)},100)}function U(e,t){var i=this;if(!(this instanceof U))return new U(e,t);this.options=t=t?ft(t):{},ft(Bo,t,!1);var r=t.value;typeof r=="string"?r=new ve(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new U.inputStyles[t.inputStyle](this),l=this.display=new cs(e,r,n,t);l.wrapper.CodeMirror=this,Io(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Rl(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ze,keySeq:null,specialChars:null},t.autofocus&&!Qt&&l.input.focus(),C&&H<11&&setTimeout(function(){return i.display.input.reset(!0)},20),eu(this),As(),bt(this),this.curOp.forceUpdate=!0,Zl(this,r),t.autofocus&&!Qt||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&sn(i)},20):Ft(this);for(var o in pi)pi.hasOwnProperty(o)&&pi[o](this,t[o],Xt);Ul(this),t.finishInit&&t.finishInit(this);for(var a=0;a<Dn.length;++a)Dn[a](this);St(this),q&&t.lineWrapping&&getComputedStyle(l.lineDiv).textRendering=="optimizelegibility"&&(l.lineDiv.style.textRendering="auto")}U.defaults=Bo,U.optionHandlers=pi;function eu(e){var t=e.display;N(t.scroller,"mousedown",te(e,Ho)),C&&H<11?N(t.scroller,"dblclick",te(e,function(s){if(!$(e,s)){var u=gt(e,s);if(!(!u||Mn(e,s)||qe(e.display,s))){de(s);var f=e.findWordAt(u);ai(e.doc,f.anchor,f.head)}}})):N(t.scroller,"dblclick",function(s){return $(e,s)||de(s)}),N(t.scroller,"contextmenu",function(s){return Eo(e,s)}),N(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||Eo(e,s)});var i,r={end:0};function n(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function l(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function o(s,u){if(u.left==null)return!0;var f=u.left-s.left,h=u.top-s.top;return f*f+h*h>400}N(t.scroller,"touchstart",function(s){if(!$(e,s)&&!l(s)&&!Mn(e,s)){t.input.ensurePolled(),clearTimeout(i);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),N(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),N(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!qe(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var f=e.coordsChar(t.activeTouch,"page"),h;!u.prev||o(u,u.prev)?h=new F(f,f):!u.prev.prev||o(u,u.prev.prev)?h=e.findWordAt(f):h=new F(g(f.line,0),W(e.doc,g(f.line+1,0))),e.setSelection(h.anchor,h.head),e.focus(),de(s)}n()}),N(t.scroller,"touchcancel",n),N(t.scroller,"scroll",function(){t.scroller.clientHeight&&(dr(e,t.scroller.scrollTop),yt(e,t.scroller.scrollLeft,!0),Y(e,"scroll",e))}),N(t.scroller,"mousewheel",function(s){return Xl(e,s)}),N(t.scroller,"DOMMouseScroll",function(s){return Xl(e,s)}),N(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){$(e,s)||ir(s)},over:function(s){$(e,s)||(Os(e,s),ir(s))},start:function(s){return Ns(e,s)},drop:te(e,Ds),leave:function(s){$(e,s)||bo(e)}};var a=t.input.getField();N(a,"keyup",function(s){return Ao.call(e,s)}),N(a,"keydown",te(e,Oo)),N(a,"keypress",te(e,Wo)),N(a,"focus",function(s){return sn(e,s)}),N(a,"blur",function(s){return Ft(e,s)})}var Dn=[];U.defineInitHook=function(e){return Dn.push(e)};function Ar(e,t,i,r){var n=e.doc,l;i==null&&(i="add"),i=="smart"&&(n.mode.indent?l=lr(e,t).state:i="prev");var o=e.options.tabSize,a=k(n,t),s=Me(a.text,null,o);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],f;if(!r&&!/\S/.test(a.text))f=0,i="not";else if(i=="smart"&&(f=n.mode.indent(l,a.text.slice(u.length),a.text),f==Fr||f>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?f=Me(k(n,t-1).text,null,o):f=0:i=="add"?f=s+e.options.indentUnit:i=="subtract"?f=s-e.options.indentUnit:typeof i=="number"&&(f=s+i),f=Math.max(0,f);var h="",d=0;if(e.options.indentWithTabs)for(var c=Math.floor(f/o);c;--c)d+=o,h+=" ";if(d<f&&(h+=Ci(f-d)),h!=u)return Gt(n,h,g(t,0),g(t,u.length),"+input"),a.stateAfter=null,!0;for(var p=0;p<n.sel.ranges.length;p++){var v=n.sel.ranges[p];if(v.head.line==t&&v.head.ch<u.length){var m=g(t,u.length);Sn(n,p,new F(m,m));break}}}var We=null;function vi(e){We=e}function Nn(e,t,i,r,n){var l=e.doc;e.display.shift=!1,r||(r=l.sel);var o=+new Date-200,a=n=="paste"||e.state.pasteIncoming>o,s=Ai(t),u=null;if(a&&r.ranges.length>1)if(We&&We.text.join(`
|
|
13
|
+
`)==t){if(r.ranges.length%We.text.length==0){u=[];for(var f=0;f<We.text.length;f++)u.push(l.splitLines(We.text[f]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=Ir(s,function(y){return[y]}));for(var h=e.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var c=r.ranges[d],p=c.from(),v=c.to();c.empty()&&(i&&i>0?p=g(p.line,p.ch-i):e.state.overwrite&&!a?v=g(v.line,Math.min(k(l,v.line).text.length,v.ch+E(s).length)):a&&We&&We.lineWise&&We.text.join(`
|
|
14
|
+
`)==s.join(`
|
|
15
|
+
`)&&(p=v=g(p.line,0)));var m={from:p,to:v,text:u?u[d%u.length]:s,origin:n||(a?"paste":e.state.cutIncoming>o?"cut":"+input")};zt(e.doc,m),ee(e,"inputRead",e,m)}t&&!a&&zo(e,t),Et(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ro(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&be(t,function(){return Nn(t,i,0,null,"paste")}),!0}function zo(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(!(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)){var l=e.getModeAt(n.head),o=!1;if(l.electricChars){for(var a=0;a<l.electricChars.length;a++)if(t.indexOf(l.electricChars.charAt(a))>-1){o=Ar(e,n.head.line,"smart");break}}else l.electricInput&&l.electricInput.test(k(e.doc,n.head.line).text.slice(0,n.head.ch))&&(o=Ar(e,n.head.line,"smart"));o&&ee(e,"electricInput",e,n.head.line)}}}function Go(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var n=e.doc.sel.ranges[r].head.line,l={anchor:g(n,0),head:g(n+1,0)};i.push(l),t.push(e.getRange(l.anchor,l.head))}return{text:t,ranges:i}}function On(e,t,i,r){e.setAttribute("autocorrect",i?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function Uo(){var e=D("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=D("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return q?e.style.width="1000px":e.setAttribute("wrap","off"),Zt&&(e.style.border="1px solid black"),t}function tu(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){Pr(this).focus(),this.display.input.focus()},setOption:function(r,n){var l=this.options,o=l[r];l[r]==n&&r!="mode"||(l[r]=n,t.hasOwnProperty(r)&&te(this,t[r])(this,n,o),Y(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,n){this.state.keyMaps[n?"push":"unshift"](ci(r))},removeKeyMap:function(r){for(var n=this.state.keyMaps,l=0;l<n.length;++l)if(n[l]==r||n[l].name==r)return n.splice(l,1),!0},addOverlay:he(function(r,n){var l=r.token?r:e.getMode(this.options,r);if(l.startState)throw new Error("Overlays may not be stateful.");Zo(this.state.overlays,{mode:l,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},function(o){return o.priority}),this.state.modeGen++,pe(this)}),removeOverlay:he(function(r){for(var n=this.state.overlays,l=0;l<n.length;++l){var o=n[l].modeSpec;if(o==r||typeof r=="string"&&o.name==r){n.splice(l,1),this.state.modeGen++,pe(this);return}}}),indentLine:he(function(r,n,l){typeof n!="string"&&typeof n!="number"&&(n==null?n=this.options.smartIndent?"smart":"prev":n=n?"add":"subtract"),nr(this.doc,r)&&Ar(this,r,n,l)}),indentSelection:he(function(r){for(var n=this.doc.sel.ranges,l=-1,o=0;o<n.length;o++){var a=n[o];if(a.empty())a.head.line>l&&(Ar(this,a.head.line,r,!0),l=a.head.line,o==this.doc.sel.primIndex&&Et(this));else{var s=a.from(),u=a.to(),f=Math.max(l,s.line);l=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var h=f;h<l;++h)Ar(this,h,r);var d=this.doc.sel.ranges;s.ch==0&&n.length==d.length&&d[o].from().ch>0&&Sn(this.doc,o,new F(s,d[o].to()),Pe)}}}),getTokenAt:function(r,n){return Jn(this,r,n)},getLineTokens:function(r,n){return Jn(this,g(r),n,!0)},getTokenTypeAt:function(r){r=W(this.doc,r);var n=Yn(this,k(this.doc,r.line)),l=0,o=(n.length-1)/2,a=r.ch,s;if(a==0)s=n[2];else for(;;){var u=l+o>>1;if((u?n[u*2-1]:0)>=a)o=u;else if(n[u*2+1]<a)l=u+1;else{s=n[u*2+2];break}}var f=s?s.indexOf("overlay "):-1;return f<0?s:f==0?null:s.slice(0,f-1)},getModeAt:function(r){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(r).state).mode:n},getHelper:function(r,n){return this.getHelpers(r,n)[0]},getHelpers:function(r,n){var l=[];if(!i.hasOwnProperty(n))return l;var o=i[n],a=this.getModeAt(r);if(typeof a[n]=="string")o[a[n]]&&l.push(o[a[n]]);else if(a[n])for(var s=0;s<a[n].length;s++){var u=o[a[n][s]];u&&l.push(u)}else a.helperType&&o[a.helperType]?l.push(o[a.helperType]):o[a.name]&&l.push(o[a.name]);for(var f=0;f<o._global.length;f++){var h=o._global[f];h.pred(a,this)&&se(l,h.val)==-1&&l.push(h.val)}return l},getStateAfter:function(r,n){var l=this.doc;return r=Xn(l,r??l.first+l.size-1),lr(this,r+1,n).state},cursorCoords:function(r,n){var l,o=this.doc.sel.primary();return r==null?l=o.head:typeof r=="object"?l=W(this.doc,r):l=r?o.from():o.to(),Oe(this,l,n||"page")},charCoords:function(r,n){return Jr(this,W(this.doc,r),n||"page")},coordsChar:function(r,n){return r=Tl(this,r,n||"page"),$i(this,r.left,r.top)},lineAtHeight:function(r,n){return r=Tl(this,{top:r,left:0},n||"page").top,dt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,n,l){var o=!1,a;if(typeof r=="number"){var s=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>s&&(r=s,o=!0),a=k(this.doc,r)}else a=r;return Qr(this,a,{top:0,left:0},n||"page",l||o).top+(o?this.doc.height-Ue(a):0)},defaultTextHeight:function(){return Ht(this.display)},defaultCharWidth:function(){return Pt(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,l,o,a){var s=this.display;r=Oe(this,W(this.doc,r));var u=r.bottom,f=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),s.sizer.appendChild(n),o=="over")u=r.top;else if(o=="above"||o=="near"){var h=Math.max(s.wrapper.clientHeight,this.doc.height),d=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(o=="above"||r.bottom+n.offsetHeight>h)&&r.top>n.offsetHeight?u=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=h&&(u=r.bottom),f+n.offsetWidth>d&&(f=d-n.offsetWidth)}n.style.top=u+"px",n.style.left=n.style.right="",a=="right"?(f=s.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(a=="left"?f=0:a=="middle"&&(f=(s.sizer.clientWidth-n.offsetWidth)/2),n.style.left=f+"px"),l&&Va(this,{left:f,top:u,right:f+n.offsetWidth,bottom:u+n.offsetHeight})},triggerOnKeyDown:he(Oo),triggerOnKeyPress:he(Wo),triggerOnKeyUp:Ao,triggerOnMouseDown:he(Ho),execCommand:function(r){if(Mr.hasOwnProperty(r))return Mr[r].call(null,this)},triggerElectric:he(function(r){zo(this,r)}),findPosH:function(r,n,l,o){var a=1;n<0&&(a=-1,n=-n);for(var s=W(this.doc,r),u=0;u<n&&(s=An(this.doc,s,a,l,o),!s.hitSide);++u);return s},moveH:he(function(r,n){var l=this;this.extendSelectionsBy(function(o){return l.display.shift||l.doc.extend||o.empty()?An(l.doc,o.head,r,n,l.options.rtlMoveVisually):r<0?o.from():o.to()},$t)}),deleteH:he(function(r,n){var l=this.doc.sel,o=this.doc;l.somethingSelected()?o.replaceSelection("",null,"+delete"):Kt(this,function(a){var s=An(o,a.head,r,n,!1);return r<0?{from:s,to:a.head}:{from:a.head,to:s}})}),findPosV:function(r,n,l,o){var a=1,s=o;n<0&&(a=-1,n=-n);for(var u=W(this.doc,r),f=0;f<n;++f){var h=Oe(this,u,"div");if(s==null?s=h.left:h.left=s,u=qo(this,h,a,l),u.hitSide)break}return u},moveV:he(function(r,n){var l=this,o=this.doc,a=[],s=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(f){if(s)return r<0?f.from():f.to();var h=Oe(l,f.head,"div");f.goalColumn!=null&&(h.left=f.goalColumn),a.push(h.left);var d=qo(l,h,r,n);return n=="page"&&f==o.sel.primary()&&fn(l,Jr(l,d,"div").top-h.top),d},$t),a.length)for(var u=0;u<o.sel.ranges.length;u++)o.sel.ranges[u].goalColumn=a[u]}),findWordAt:function(r){var n=this.doc,l=k(n,r.line).text,o=r.ch,a=r.ch;if(l){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||a==l.length)&&o?--o:++a;for(var u=l.charAt(o),f=Br(u,s)?function(h){return Br(h,s)}:/\s/.test(u)?function(h){return/\s/.test(h)}:function(h){return!/\s/.test(h)&&!Br(h)};o>0&&f(l.charAt(o-1));)--o;for(;a<l.length&&f(l.charAt(a));)++a}return new F(g(r.line,o),g(r.line,a))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?st(this.display.cursorDiv,"CodeMirror-overwrite"):ot(this.display.cursorDiv,"CodeMirror-overwrite"),Y(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Te(Tt(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:he(function(r,n){cr(this,r,n)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Ie(this)-this.display.barHeight,width:r.scrollWidth-Ie(this)-this.display.barWidth,clientHeight:Zi(this),clientWidth:pt(this)}},scrollIntoView:he(function(r,n){r==null?(r={from:this.doc.sel.primary().head,to:null},n==null&&(n=this.options.cursorScrollMargin)):typeof r=="number"?r={from:g(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=n||0,r.from.line!=null?$a(this,r):Fl(this,r.from,r.to,r.margin)}),setSize:he(function(r,n){var l=this,o=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=o(r)),n!=null&&(this.display.wrapper.style.height=o(n)),this.options.lineWrapping&&Cl(this);var a=this.display.viewFrom;this.doc.iter(a,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){Je(l,a,"widget");break}}++a}),this.curOp.forceUpdate=!0,Y(this,"refresh",this)}),operation:function(r){return be(this,r)},startOperation:function(){return bt(this)},endOperation:function(){return St(this)},refresh:he(function(){var r=this.display.cachedTextHeight;pe(this),this.curOp.forceUpdate=!0,fr(this),cr(this,this.doc.scrollLeft,this.doc.scrollTop),dn(this.display),(r==null||Math.abs(r-Ht(this.display))>.5||this.options.lineWrapping)&&nn(this),Y(this,"refresh",this)}),swapDoc:he(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Zl(this,r),fr(this),this.display.input.reset(),cr(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,ee(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Mt(e),e.registerHelper=function(r,n,l){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=l},e.registerGlobalHelper=function(r,n,l,o){e.registerHelper(r,n,o),i[r]._global.push({pred:l,val:o})}}function An(e,t,i,r,n){var l=t,o=i,a=k(e,t.line),s=n&&e.direction=="rtl"?-i:i;function u(){var S=t.line+s;return S<e.first||S>=e.first+e.size?!1:(t=new g(S,t.ch,t.sticky),a=k(e,S))}function f(S){var x;if(r=="codepoint"){var w=a.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(w))x=null;else{var M=i>0?w>=55296&&w<56320:w>=56320&&w<57343;x=new g(t.line,Math.max(0,Math.min(a.text.length,t.ch+i*(M?2:1))),-i)}}else n?x=Es(e.cm,a,t,i):x=Cn(a,t,i);if(x==null)if(!S&&u())t=Ln(n,e.cm,a,t.line,s);else return!1;else t=x;return!0}if(r=="char"||r=="codepoint")f();else if(r=="column")f(!0);else if(r=="word"||r=="group")for(var h=null,d=r=="group",c=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(i<0&&!f(!p));p=!1){var v=a.text.charAt(t.ch)||`
|
|
16
|
+
`,m=Br(v,c)?"w":d&&v==`
|
|
17
|
+
`?"n":!d||/\s/.test(v)?null:"p";if(d&&!p&&!m&&(m="s"),h&&h!=m){i<0&&(i=1,f(),t.sticky="after");break}if(m&&(h=m),i>0&&!f(!p))break}var y=ui(e,t,l,o,!0);return Bi(l,y)&&(y.hitSide=!0),y}function qo(e,t,i,r){var n=e.doc,l=t.left,o;if(r=="page"){var a=Math.min(e.display.wrapper.clientHeight,Pr(e).innerHeight||n(e).documentElement.clientHeight),s=Math.max(a-.5*Ht(e.display),3);o=(i>0?t.bottom:t.top)+i*s}else r=="line"&&(o=i>0?t.bottom+3:t.top-3);for(var u;u=$i(e,l,o),!!u.outside;){if(i<0?o<=0:o>=n.height){u.hitSide=!0;break}o+=i*5}return u}var B=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ze,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};B.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;n.contentEditable=!0,On(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function l(a){for(var s=a.target;s;s=s.parentNode){if(s==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}N(n,"paste",function(a){!l(a)||$(r,a)||Ro(a,r)||H<=11&&setTimeout(te(r,function(){return t.updateFromDOM()}),20)}),N(n,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),N(n,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),N(n,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),N(n,"touchstart",function(){return i.forceCompositionEnd()}),N(n,"input",function(){t.composing||t.readFromDOMSoon()});function o(a){if(!(!l(a)||$(r,a))){if(r.somethingSelected())vi({lineWise:!1,text:r.getSelections()}),a.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=Go(r);vi({lineWise:!0,text:s.text}),a.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Pe),r.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var u=We.text.join(`
|
|
18
|
+
`);if(a.clipboardData.setData("Text",u),a.clipboardData.getData("Text")==u){a.preventDefault();return}}var f=Uo(),h=f.firstChild;On(h),r.display.lineSpace.insertBefore(f,r.display.lineSpace.firstChild),h.value=We.text.join(`
|
|
19
|
+
`);var d=Te(ut(n));Jt(h),setTimeout(function(){r.display.lineSpace.removeChild(f),d.focus(),d==n&&i.showPrimarySelection()},50)}}N(n,"copy",o),N(n,"cut",o)},B.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},B.prototype.prepareSelection=function(){var e=Wl(this.cm,!1);return e.focus=Te(ut(this.div))==this.div,e},B.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},B.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},B.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line<t.display.viewFrom){e.removeAllRanges();return}var l=gi(t,e.anchorNode,e.anchorOffset),o=gi(t,e.focusNode,e.focusOffset);if(!(l&&!l.bad&&o&&!o.bad&&A(Gr(l,o),r)==0&&A(zr(l,o),n)==0)){var a=t.display.view,s=r.line>=t.display.viewFrom&&Ko(t,r)||{node:a[0].measure.map[2],offset:0},u=n.line<t.display.viewTo&&Ko(t,n);if(!u){var f=a[a.length-1].measure,h=f.maps?f.maps[f.maps.length-1]:f.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(!s||!u){e.removeAllRanges();return}var d=e.rangeCount&&e.getRangeAt(0),c;try{c=at(s.node,s.offset,u.offset,u.node)}catch{}c&&(!X&&t.state.focused?(e.collapse(s.node,s.offset),c.collapsed||(e.removeAllRanges(),e.addRange(c))):(e.removeAllRanges(),e.addRange(c)),d&&e.anchorNode==null?e.addRange(d):X&&this.startGracePeriod()),this.rememberSelection()}},B.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},B.prototype.showMultipleSelections=function(e){we(this.cm.display.cursorDiv,e.cursors),we(this.cm.display.selectionDiv,e.selection)},B.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},B.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Ye(this.div,t)},B.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||Te(ut(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},B.prototype.blur=function(){this.div.blur()},B.prototype.getField=function(){return this.div},B.prototype.supportsTouch=function(){return!0},B.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):be(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function i(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,i))}this.polling.set(this.cm.options.pollInterval,i)},B.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},B.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(Hr&&oe&&this.cm.display.gutterSpecs.length&&ru(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var i=gi(t,e.anchorNode,e.anchorOffset),r=gi(t,e.focusNode,e.focusOffset);i&&r&&be(t,function(){ue(t.doc,$e(i,r),Pe),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},B.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),n=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=g(r.line-1,k(e.doc,r.line-1).length)),n.ch==k(e.doc,n.line).text.length&&n.line<e.lastLine()&&(n=g(n.line+1,0)),r.line<t.viewFrom||n.line>t.viewTo-1)return!1;var l,o,a;r.line==t.viewFrom||(l=mt(e,r.line))==0?(o=I(t.view[0].line),a=t.view[0].node):(o=I(t.view[l].line),a=t.view[l-1].node.nextSibling);var s=mt(e,n.line),u,f;if(s==t.view.length-1?(u=t.viewTo-1,f=t.lineDiv.lastChild):(u=I(t.view[s+1].line)-1,f=t.view[s+1].node.previousSibling),!a)return!1;for(var h=e.doc.splitLines(iu(e,a,f,o,u)),d=ct(e.doc,g(o,0),g(u,k(e.doc,u).text.length));h.length>1&&d.length>1;)if(E(h)==E(d))h.pop(),d.pop(),u--;else if(h[0]==d[0])h.shift(),d.shift(),o++;else break;for(var c=0,p=0,v=h[0],m=d[0],y=Math.min(v.length,m.length);c<y&&v.charCodeAt(c)==m.charCodeAt(c);)++c;for(var S=E(h),x=E(d),w=Math.min(S.length-(h.length==1?c:0),x.length-(d.length==1?c:0));p<w&&S.charCodeAt(S.length-p-1)==x.charCodeAt(x.length-p-1);)++p;if(h.length==1&&d.length==1&&o==r.line)for(;c&&c>r.ch&&S.charCodeAt(S.length-p-1)==x.charCodeAt(x.length-p-1);)c--,p++;h[h.length-1]=S.slice(0,S.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(c).replace(/\u200b+$/,"");var M=g(o,c),T=g(u,d.length?E(d).length-p:0);if(h.length>1||h[0]||A(M,T))return Gt(e.doc,h,M,T,"+input"),!0},B.prototype.ensurePolled=function(){this.forceCompositionEnd()},B.prototype.reset=function(){this.forceCompositionEnd()},B.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},B.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},B.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&be(this.cm,function(){return pe(e.cm)})},B.prototype.setUneditable=function(e){e.contentEditable="false"},B.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||te(this.cm,Nn)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},B.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},B.prototype.onContextMenu=function(){},B.prototype.resetPosition=function(){},B.prototype.needsContentAttribute=!0;function Ko(e,t){var i=Qi(e,t.line);if(!i||i.hidden)return null;var r=k(e.doc,t.line),n=yl(i,r,t.line),l=ze(r,e.doc.direction),o="left";if(l){var a=rr(l,t.ch);o=a%2?"right":"left"}var s=Sl(n.map,t.ch,o);return s.offset=s.collapse=="right"?s.end:s.start,s}function ru(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function _t(e,t){return t&&(e.bad=!0),e}function iu(e,t,i,r,n){var l="",o=!1,a=e.doc.lineSeparator(),s=!1;function u(c){return function(p){return p.id==c}}function f(){o&&(l+=a,s&&(l+=a),o=s=!1)}function h(c){c&&(f(),l+=c)}function d(c){if(c.nodeType==1){var p=c.getAttribute("cm-text");if(p){h(p);return}var v=c.getAttribute("cm-marker"),m;if(v){var y=e.findMarks(g(r,0),g(n+1,0),u(+v));y.length&&(m=y[0].find(0))&&h(ct(e.doc,m.from,m.to).join(a));return}if(c.getAttribute("contenteditable")=="false")return;var S=/^(pre|div|p|li|table|br)$/i.test(c.nodeName);if(!/^br$/i.test(c.nodeName)&&c.textContent.length==0)return;S&&f();for(var x=0;x<c.childNodes.length;x++)d(c.childNodes[x]);/^(pre|p)$/i.test(c.nodeName)&&(s=!0),S&&(o=!0)}else c.nodeType==3&&h(c.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;d(t),t!=i;)t=t.nextSibling,s=!1;return l}function gi(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return _t(e.clipPos(g(e.display.viewTo-1)),!0);t=null,i=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var n=0;n<e.display.view.length;n++){var l=e.display.view[n];if(l.node==r)return nu(l,t,i)}}function nu(e,t,i){var r=e.text.firstChild,n=!1;if(!t||!Ye(r,t))return _t(g(I(e.line),0),!0);if(t==r&&(n=!0,t=r.childNodes[i],i=0,!t)){var l=e.rest?E(e.rest):e.line;return _t(g(I(l),l.text.length),n)}var o=t.nodeType==3?t:null,a=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,i&&(i=o.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var s=e.measure,u=s.maps;function f(m,y,S){for(var x=-1;x<(u?u.length:0);x++)for(var w=x<0?s.map:u[x],M=0;M<w.length;M+=3){var T=w[M+2];if(T==m||T==y){var P=I(x<0?e.line:e.rest[x]),z=w[M]+S;return(S<0||T!=m)&&(z=w[M+(S?1:0)]),g(P,z)}}}var h=f(o,a,i);if(h)return _t(h,n);for(var d=a.nextSibling,c=o?o.nodeValue.length-i:0;d;d=d.nextSibling){if(h=f(d,d.firstChild,0),h)return _t(g(h.line,h.ch-c),n);c+=d.textContent.length}for(var p=a.previousSibling,v=i;p;p=p.previousSibling){if(h=f(p,p.firstChild,-1),h)return _t(g(h.line,h.ch+v),n);v+=p.textContent.length}}var j=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ze,this.hasSelection=!1,this.composing=null,this.resetting=!1};j.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var n=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),Zt&&(n.style.width="0px"),N(n,"input",function(){C&&H>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),N(n,"paste",function(o){$(r,o)||Ro(o,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function l(o){if(!$(r,o)){if(r.somethingSelected())vi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var a=Go(r);vi({lineWise:!0,text:a.text}),o.type=="cut"?r.setSelections(a.ranges,null,Pe):(i.prevInput="",n.value=a.text.join(`
|
|
20
|
+
`),Jt(n))}else return;o.type=="cut"&&(r.state.cutIncoming=+new Date)}}N(n,"cut",l),N(n,"copy",l),N(e.scroller,"paste",function(o){if(!(qe(e,o)||$(r,o))){if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var a=new Event("paste");a.clipboardData=o.clipboardData,n.dispatchEvent(a)}}),N(e.lineSpace,"selectstart",function(o){qe(e,o)||de(o)}),N(n,"compositionstart",function(){var o=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:o,range:r.markText(o,r.getCursor("to"),{className:"CodeMirror-composing"})}}),N(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},j.prototype.createField=function(e){this.wrapper=Uo(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;On(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},j.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},j.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=Wl(e);if(e.options.moveInputWithCursor){var n=Oe(e,i.sel.primary().head,"div"),l=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+o.top-l.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+o.left-l.left))}return r},j.prototype.showSelection=function(e){var t=this.cm,i=t.display;we(i.cursorDiv,e.cursors),we(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},j.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&Jt(this.textarea),C&&H>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",C&&H>=9&&(this.hasSelection=null));this.resetting=!1}},j.prototype.getField=function(){return this.textarea},j.prototype.supportsTouch=function(){return!1},j.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Qt||Te(ut(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},j.prototype.blur=function(){this.textarea.blur()},j.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},j.prototype.receivedFocus=function(){this.slowPoll()},j.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},j.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},j.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||ia(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(C&&H>=9&&this.hasSelection===n||ke&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var l=n.charCodeAt(0);if(l==8203&&!r&&(r="\u200B"),l==8666)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(r.length,n.length);o<a&&r.charCodeAt(o)==n.charCodeAt(o);)++o;return be(t,function(){Nn(t,n.slice(o),r.length-o,null,e.composing?"*compose":null),n.length>1e3||n.indexOf(`
|
|
21
|
+
`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},j.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},j.prototype.onKeyPress=function(){C&&H>=9&&(this.hasSelection=null),this.fastPoll()},j.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var l=gt(i,e),o=r.scroller.scrollTop;if(!l||ae)return;var a=i.options.resetSelectionOnContextMenu;a&&i.doc.sel.contains(l)==-1&&te(i,ue)(i.doc,$e(l),Pe);var s=n.style.cssText,u=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
22
|
+
top: `+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+`px;
|
|
23
|
+
z-index: 1000; background: `+(C?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
24
|
+
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var h;q&&(h=n.ownerDocument.defaultView.scrollY),r.input.focus(),q&&n.ownerDocument.defaultView.scrollTo(null,h),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=c,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function d(){if(n.selectionStart!=null){var v=i.somethingSelected(),m="\u200B"+(v?n.value:"");n.value="\u21DA",n.value=m,t.prevInput=v?"":"\u200B",n.selectionStart=1,n.selectionEnd=m.length,r.selForContextMenu=i.doc.sel}}function c(){if(t.contextMenuPending==c&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,n.style.cssText=s,C&&H<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=o),n.selectionStart!=null)){(!C||C&&H<9)&&d();var v=0,m=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?te(i,so)(i):v++<10?r.detectingSelectAll=setTimeout(m,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(m,200)}}if(C&&H>=9&&d(),yi){ir(e);var p=function(){Ce(window,"mouseup",p),setTimeout(c,20)};N(window,"mouseup",p)}else setTimeout(c,50)},j.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},j.prototype.setUneditable=function(){},j.prototype.needsContentAttribute=!1;function lu(e,t){if(t=t?ft(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=Te(ut(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=a.getValue()}var n;if(e.form&&(N(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var l=e.form;n=l.submit;try{var o=l.submit=function(){r(),l.submit=n,l.submit(),l.submit=o}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(Ce(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var a=U(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function ou(e){e.off=Ce,e.on=N,e.wheelEventPixels=ds,e.Doc=ve,e.splitLines=Ai,e.countColumn=Me,e.findColumn=wi,e.isWordChar=Li,e.Pass=Fr,e.signal=Y,e.Line=Ot,e.changeEnd=et,e.scrollbarModel=Bl,e.Pos=g,e.cmpPos=A,e.modes=Hi,e.mimeModes=Dt,e.resolveMode=Rr,e.getMode=Pi,e.modeExtensions=Nt,e.extendMode=sa,e.copyState=ht,e.startState=Kn,e.innerMode=Fi,e.commands=Mr,e.keyMap=Xe,e.keyName=ko,e.isModifierKey=Co,e.lookupKey=qt,e.normalizeKeyMap=Fs,e.StringStream=Z,e.SharedTextMarker=Lr,e.TextMarker=rt,e.LineWidget=Cr,e.e_preventDefault=de,e.e_stopPropagation=Un,e.e_stop=ir,e.addClass=st,e.contains=Ye,e.rmClass=ot,e.keyNames=it}Js(U),tu(U);var au="iter insert remove copy getEditor constructor".split(" ");for(var mi in ve.prototype)ve.prototype.hasOwnProperty(mi)&&se(au,mi)<0&&(U.prototype[mi]=(function(e){return function(){return e.apply(this.doc,arguments)}})(ve.prototype[mi]));return Mt(ve),U.inputStyles={textarea:j,contenteditable:B},U.defineMode=function(e){!U.defaults.mode&&e!="null"&&(U.defaults.mode=e),oa.apply(this,arguments)},U.defineMIME=aa,U.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),U.defineMIME("text/plain","null"),U.defineExtension=function(e,t){U.prototype[e]=t},U.defineDocExtension=function(e,t){ve.prototype[e]=t},U.fromTextArea=lu,ou(U),U.version="5.65.20",U})),(function(L){typeof exports=="object"&&typeof module=="object"?L(require("../lib/codemirror")):typeof define=="function"&&define.amd?define(["../lib/codemirror"],L):L(CodeMirror)})(function(L){"use strict";L.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var G=0;G<L.modeInfo.length;G++){var X=L.modeInfo[G];X.mimes&&(X.mime=X.mimes[0])}L.findModeByMIME=function(R){R=R.toLowerCase();for(var O=0;O<L.modeInfo.length;O++){var b=L.modeInfo[O];if(b.mime==R)return b;if(b.mimes){for(var C=0;C<b.mimes.length;C++)if(b.mimes[C]==R)return b}}if(/\+xml$/.test(R))return L.findModeByMIME("application/xml");if(/\+json$/.test(R))return L.findModeByMIME("application/json")},L.findModeByExtension=function(R){R=R.toLowerCase();for(var O=0;O<L.modeInfo.length;O++){var b=L.modeInfo[O];if(b.ext){for(var C=0;C<b.ext.length;C++)if(b.ext[C]==R)return b}}},L.findModeByFileName=function(R){for(var O=0;O<L.modeInfo.length;O++){var b=L.modeInfo[O];if(b.file&&b.file.test(R))return b}var C=R.lastIndexOf("."),H=C>-1&&R.substring(C+1,R.length);if(H)return L.findModeByExtension(H)},L.findModeByName=function(R){R=R.toLowerCase();for(var O=0;O<L.modeInfo.length;O++){var b=L.modeInfo[O];if(b.name.toLowerCase()==R)return b;if(b.alias){for(var C=0;C<b.alias.length;C++)if(b.alias[C].toLowerCase()==R)return b}}}}),(function(L){typeof exports=="object"&&typeof module=="object"?L(require("../../lib/codemirror"),"cjs"):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],function(G){L(G,"amd")}):L(CodeMirror,"plain")})(function(L,G){L.modeURL||(L.modeURL="../mode/%N/%N.js");var X={};function R(b,C){var H=C;return function(){--H==0&&b()}}function O(b,C,H){var q=L.modes[b],He=q&&q.dependencies;if(!He)return C();for(var oe=[],xe=0;xe<He.length;++xe)L.modes.hasOwnProperty(He[xe])||oe.push(He[xe]);if(!oe.length)return C();for(var ae=R(C,oe.length),xe=0;xe<oe.length;++xe)L.requireMode(oe[xe],ae,H)}L.requireMode=function(b,C,H){if(typeof b!="string"&&(b=b.name),L.modes.hasOwnProperty(b))return O(b,C,H);if(X.hasOwnProperty(b))return X[b].push(C);var q=H&&H.path?H.path(b):L.modeURL.replace(/%N/g,b);if(H&&H.loadMode)H.loadMode(q,function(){O(b,C,H)});else if(G=="plain"){var He=document.createElement("script");He.src=q;var oe=document.getElementsByTagName("script")[0],xe=X[b]=[C];L.on(He,"load",function(){O(b,function(){for(var ae=0;ae<xe.length;++ae)xe[ae]()},H)}),oe.parentNode.insertBefore(He,oe)}else G=="cjs"?(require(q),C()):G=="amd"&&requirejs([q],C)},L.autoLoadMode=function(b,C,H){L.modes.hasOwnProperty(C)||L.requireMode(C,function(){b.setOption("mode",b.getOption("mode"))},H)}}),(function(L){typeof exports=="object"&&typeof module=="object"?L(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],L):L(CodeMirror)})(function(L){"use strict";L.overlayMode=function(G,X,R){return{startState:function(){return{base:L.startState(G),overlay:L.startState(X),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(O){return{base:L.copyState(G,O.base),overlay:L.copyState(X,O.overlay),basePos:O.basePos,baseCur:null,overlayPos:O.overlayPos,overlayCur:null}},token:function(O,b){return(O!=b.streamSeen||Math.min(b.basePos,b.overlayPos)<O.start)&&(b.streamSeen=O,b.basePos=b.overlayPos=O.start),O.start==b.basePos&&(b.baseCur=G.token(O,b.base),b.basePos=O.pos),O.start==b.overlayPos&&(O.pos=O.start,b.overlayCur=X.token(O,b.overlay),b.overlayPos=O.pos),O.pos=Math.min(b.basePos,b.overlayPos),b.overlayCur==null?b.baseCur:b.baseCur!=null&&b.overlay.combineTokens||R&&b.overlay.combineTokens==null?b.baseCur+" "+b.overlayCur:b.overlayCur},indent:G.indent&&function(O,b,C){return G.indent(O.base,b,C)},electricChars:G.electricChars,innerMode:function(O){return{state:O.base,mode:G}},blankLine:function(O){var b,C;return G.blankLine&&(b=G.blankLine(O.base)),X.blankLine&&(C=X.blankLine(O.overlay)),C==null?b:R&&b!=null?b+" "+C:C}}}});
|