From 0b39d54bdc4aa12aa7d41393069d1369cdaae282 Mon Sep 17 00:00:00 2001 From: byteblogs168 <598092184@qq.com> Date: Fri, 1 Mar 2024 17:40:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=202.6.1=201.=20=E4=BF=AE=E5=A4=8Dhttps://g?= =?UTF-8?q?itee.com/aizuda/easy-retry/issues/I953TP=202.=20https://gitee.c?= =?UTF-8?q?om/aizuda/easy-retry/issues/I94WIU?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../easy-retry-client-job-core/pom.xml | 4 +++ .../model/request/DispatchJobRequest.java | 6 ++-- .../common/core/constant/SystemConstants.java | 6 ++++ .../server/common/enums/TriggerTypeEnum.java | 30 ------------------- .../support/dispatch/ScanJobTaskActor.java | 3 +- .../controller/WorkflowBatchController.java | 1 + .../web/controller/WorkflowController.java | 8 ++--- .../web/model/request/JobRequestVO.java | 1 - .../web/service/impl/JobServiceImpl.java | 8 ++--- .../lib/assets/{fjGXFx1T.js => te7nzc9K.js} | 4 +-- frontend/public/lib/index.html | 2 +- frontend/src/utils/jobEnum.js | 8 ++--- frontend/src/views/config/GroupList.vue | 2 +- frontend/src/views/job/WorkflowList.vue | 3 +- frontend/src/views/job/form/JobForm.vue | 10 +++---- pom.xml | 2 +- 16 files changed, 38 insertions(+), 60 deletions(-) delete mode 100644 easy-retry-server/easy-retry-server-common/src/main/java/com/aizuda/easy/retry/server/common/enums/TriggerTypeEnum.java rename frontend/public/lib/assets/{fjGXFx1T.js => te7nzc9K.js} (99%) diff --git a/easy-retry-client/easy-retry-client-job-core/pom.xml b/easy-retry-client/easy-retry-client-job-core/pom.xml index b128c3f2..9ebc7d54 100644 --- a/easy-retry-client/easy-retry-client-job-core/pom.xml +++ b/easy-retry-client/easy-retry-client-job-core/pom.xml @@ -52,6 +52,10 @@ guava ${guava.version} + + org.springframework.boot + spring-boot-starter-validation + diff --git a/easy-retry-common/easy-retry-common-client-api/src/main/java/com/aizuda/easy/retry/client/model/request/DispatchJobRequest.java b/easy-retry-common/easy-retry-common-client-api/src/main/java/com/aizuda/easy/retry/client/model/request/DispatchJobRequest.java index 5ff00d13..7d53a7f2 100644 --- a/easy-retry-common/easy-retry-common-client-api/src/main/java/com/aizuda/easy/retry/client/model/request/DispatchJobRequest.java +++ b/easy-retry-common/easy-retry-common-client-api/src/main/java/com/aizuda/easy/retry/client/model/request/DispatchJobRequest.java @@ -12,7 +12,7 @@ import javax.validation.constraints.NotNull; @Data public class DispatchJobRequest { - @NotNull(message = "namespaceId 不能为空") + @NotBlank(message = "namespaceId 不能为空") private String namespaceId; @NotNull(message = "jobId 不能为空") @@ -30,7 +30,7 @@ public class DispatchJobRequest { @NotBlank(message = "group 不能为空") private String groupName; - @NotBlank(message = "parallelNum 不能为空") + @NotNull(message = "parallelNum 不能为空") private Integer parallelNum; @NotNull(message = "executorType 不能为空") @@ -39,7 +39,7 @@ public class DispatchJobRequest { @NotBlank(message = "executorInfo 不能为空") private String executorInfo; - @NotBlank(message = "executorTimeout 不能为空") + @NotNull(message = "executorTimeout 不能为空") private Integer executorTimeout; private String argsStr; diff --git a/easy-retry-common/easy-retry-common-core/src/main/java/com/aizuda/easy/retry/common/core/constant/SystemConstants.java b/easy-retry-common/easy-retry-common-core/src/main/java/com/aizuda/easy/retry/common/core/constant/SystemConstants.java index 47015854..a2a8d755 100644 --- a/easy-retry-common/easy-retry-common-core/src/main/java/com/aizuda/easy/retry/common/core/constant/SystemConstants.java +++ b/easy-retry-common/easy-retry-common-core/src/main/java/com/aizuda/easy/retry/common/core/constant/SystemConstants.java @@ -122,4 +122,10 @@ public interface SystemConstants { * 客户端返回的非json对象,单值比如 "aa", 123等 */ String SINGLE_PARAM = "SINGLE_PARAM"; + + /** + * 工作流触发类型 + * 仅表示定时任务类型为工作流 + */ + Integer WORKFLOW_TRIGGER_TYPE = 99; } diff --git a/easy-retry-server/easy-retry-server-common/src/main/java/com/aizuda/easy/retry/server/common/enums/TriggerTypeEnum.java b/easy-retry-server/easy-retry-server-common/src/main/java/com/aizuda/easy/retry/server/common/enums/TriggerTypeEnum.java deleted file mode 100644 index 0ff3809b..00000000 --- a/easy-retry-server/easy-retry-server-common/src/main/java/com/aizuda/easy/retry/server/common/enums/TriggerTypeEnum.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.aizuda.easy.retry.server.common.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * 1 CRON表达式 2 固定时间 3 工作流 - * @author xiaowoniu - * @date 2024-01-03 22:10:01 - * @since 2.6.0 - */ -@AllArgsConstructor -@Getter -public enum TriggerTypeEnum { - CRON(1, "CRON表达式"), - FIXED_TIME(2, "固定时间"), - WORKFLOW(3, "工作流"); - - private final Integer type; - private final String desc; - - public static TriggerTypeEnum get(Integer type) { - for (TriggerTypeEnum triggerTypeEnum : TriggerTypeEnum.values()) { - if (triggerTypeEnum.type.equals(type)) { - return triggerTypeEnum; - } - } - return null; - } -} diff --git a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/dispatch/ScanJobTaskActor.java b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/dispatch/ScanJobTaskActor.java index a61ed5c4..bc8fe95b 100644 --- a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/dispatch/ScanJobTaskActor.java +++ b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/dispatch/ScanJobTaskActor.java @@ -12,7 +12,6 @@ import com.aizuda.easy.retry.server.common.config.SystemProperties; import com.aizuda.easy.retry.server.common.dto.PartitionTask; import com.aizuda.easy.retry.server.common.dto.ScanTask; import com.aizuda.easy.retry.server.common.enums.JobTaskExecutorSceneEnum; -import com.aizuda.easy.retry.server.common.enums.TriggerTypeEnum; import com.aizuda.easy.retry.server.common.strategy.WaitStrategies; import com.aizuda.easy.retry.server.common.util.DateUtils; import com.aizuda.easy.retry.server.common.util.PartitionTaskUtils; @@ -168,7 +167,7 @@ public class ScanJobTaskActor extends AbstractActor { Job::getId, Job::getNamespaceId) .eq(Job::getJobStatus, StatusEnum.YES.getStatus()) .eq(Job::getDeleted, StatusEnum.NO.getStatus()) - .ne(Job::getTriggerType, TriggerTypeEnum.WORKFLOW.getType()) + .ne(Job::getTriggerType, SystemConstants.WORKFLOW_TRIGGER_TYPE) .in(Job::getBucketIndex, scanTask.getBuckets()) .le(Job::getNextTriggerAt, DateUtils.toNowMilli() + DateUtils.toEpochMilli(SystemConstants.SCHEDULE_PERIOD)) diff --git a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/controller/WorkflowBatchController.java b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/controller/WorkflowBatchController.java index c09e32d3..167f3b8b 100644 --- a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/controller/WorkflowBatchController.java +++ b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/controller/WorkflowBatchController.java @@ -35,6 +35,7 @@ public class WorkflowBatchController { } @PostMapping("/stop/{id}") + @LoginRequired public Boolean stop(@PathVariable("id") Long id) { return workflowBatchService.stop(id); } diff --git a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/controller/WorkflowController.java b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/controller/WorkflowController.java index a8d6a842..9cad6fda 100644 --- a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/controller/WorkflowController.java +++ b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/controller/WorkflowController.java @@ -31,7 +31,7 @@ public class WorkflowController { private final WorkflowService workflowService; @PostMapping - @LoginRequired(role = RoleEnum.ADMIN) + @LoginRequired(role = RoleEnum.USER) public Boolean saveWorkflow(@RequestBody @Validated WorkflowRequestVO workflowRequestVO) { return workflowService.saveWorkflow(workflowRequestVO); } @@ -43,7 +43,7 @@ public class WorkflowController { } @PutMapping - @LoginRequired(role = RoleEnum.ADMIN) + @LoginRequired(role = RoleEnum.USER) public Boolean updateWorkflow(@RequestBody @Validated WorkflowRequestVO workflowRequestVO) { return workflowService.updateWorkflow(workflowRequestVO); } @@ -55,7 +55,7 @@ public class WorkflowController { } @PutMapping("/update/status/{id}") - @LoginRequired(role = RoleEnum.ADMIN) + @LoginRequired(role = RoleEnum.USER) public Boolean updateStatus(@PathVariable("id") Long id) { return workflowService.updateStatus(id); } @@ -81,7 +81,7 @@ public class WorkflowController { } @PostMapping("/check-node-expression") - @LoginRequired(role = RoleEnum.ADMIN) + @LoginRequired(role = RoleEnum.USER) public Pair checkNodeExpression(@RequestBody DecisionConfig decisionConfig) { return workflowService.checkNodeExpression(decisionConfig); } diff --git a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/request/JobRequestVO.java b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/request/JobRequestVO.java index b5b62570..78932399 100644 --- a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/request/JobRequestVO.java +++ b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/request/JobRequestVO.java @@ -43,7 +43,6 @@ public class JobRequestVO { /** * 参数类型 text/json */ -// @NotNull(message = "argsType 不能为空") private Integer argsType; /** diff --git a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobServiceImpl.java b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobServiceImpl.java index 6cae8d6e..1a639b66 100644 --- a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobServiceImpl.java +++ b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobServiceImpl.java @@ -3,11 +3,11 @@ package com.aizuda.easy.retry.server.web.service.impl; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.HashUtil; import cn.hutool.core.util.StrUtil; +import com.aizuda.easy.retry.common.core.constant.SystemConstants; import com.aizuda.easy.retry.common.core.enums.StatusEnum; import com.aizuda.easy.retry.server.common.WaitStrategy; import com.aizuda.easy.retry.server.common.config.SystemProperties; import com.aizuda.easy.retry.server.common.enums.JobTaskExecutorSceneEnum; -import com.aizuda.easy.retry.server.common.enums.TriggerTypeEnum; import com.aizuda.easy.retry.server.common.exception.EasyRetryServerException; import com.aizuda.easy.retry.server.common.strategy.WaitStrategies; import com.aizuda.easy.retry.server.common.util.CronUtils; @@ -151,7 +151,7 @@ public class JobServiceImpl implements JobService { updateJob.setNamespaceId(job.getNamespaceId()); // 工作流任务 - if (Objects.equals(jobRequestVO.getTriggerType(), TriggerTypeEnum.WORKFLOW.getType())) { + if (Objects.equals(jobRequestVO.getTriggerType(), SystemConstants.WORKFLOW_TRIGGER_TYPE)) { job.setNextTriggerAt(0L); // 非常驻任务 > 非常驻任务 } else if (Objects.equals(job.getResident(), StatusEnum.NO.getStatus()) && Objects.equals( @@ -174,7 +174,7 @@ public class JobServiceImpl implements JobService { } private static Long calculateNextTriggerAt(final JobRequestVO jobRequestVO, Long time) { - if (Objects.equals(jobRequestVO.getTriggerType(), TriggerTypeEnum.WORKFLOW.getType())) { + if (Objects.equals(jobRequestVO.getTriggerType(), SystemConstants.WORKFLOW_TRIGGER_TYPE)) { return 0L; } @@ -189,7 +189,7 @@ public class JobServiceImpl implements JobService { public Job updateJobResident(JobRequestVO jobRequestVO) { Job job = JobConverter.INSTANCE.toJob(jobRequestVO); job.setResident(StatusEnum.NO.getStatus()); - if (Objects.equals(jobRequestVO.getTriggerType(), TriggerTypeEnum.WORKFLOW.getType())) { + if (Objects.equals(jobRequestVO.getTriggerType(), SystemConstants.WORKFLOW_TRIGGER_TYPE)) { return job; } diff --git a/frontend/public/lib/assets/fjGXFx1T.js b/frontend/public/lib/assets/te7nzc9K.js similarity index 99% rename from frontend/public/lib/assets/fjGXFx1T.js rename to frontend/public/lib/assets/te7nzc9K.js index 02112bd3..d08fffe2 100644 --- a/frontend/public/lib/assets/fjGXFx1T.js +++ b/frontend/public/lib/assets/te7nzc9K.js @@ -1,4 +1,4 @@ -var e,t,n=Object.getOwnPropertyNames,o=(e={"assets/fjGXFx1T.js"(e,t){function n(e,t){const n=new Set(e.split(","));return t?e=>n.has(e.toLowerCase()):e=>n.has(e)}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const o={},r=[],i=()=>{},l=()=>!1,a=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),s=e=>e.startsWith("onUpdate:"),c=Object.assign,u=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,p=(e,t)=>d.call(e,t),h=Array.isArray,f=e=>"[object Map]"===x(e),g=e=>"[object Set]"===x(e),m=e=>"function"==typeof e,v=e=>"string"==typeof e,b=e=>"symbol"==typeof e,y=e=>null!==e&&"object"==typeof e,O=e=>(y(e)||m(e))&&m(e.then)&&m(e.catch),w=Object.prototype.toString,x=e=>w.call(e),$=e=>"[object Object]"===x(e),S=e=>v(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,C=n(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),k=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},P=/-(\w)/g,M=k((e=>e.replace(P,((e,t)=>t?t.toUpperCase():"")))),T=/\B([A-Z])/g,I=k((e=>e.replace(T,"-$1").toLowerCase())),E=k((e=>e.charAt(0).toUpperCase()+e.slice(1))),A=k((e=>e?`on${E(e)}`:"")),R=(e,t)=>!Object.is(e,t),D=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},B=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let N;const z=()=>N||(N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function _(e){if(h(e)){const t={};for(let n=0;n{if(e){const n=e.split(Q);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function W(e){let t="";if(v(e))t=e;else if(h(e))for(let n=0;nv(e)?e:null==e?"":h(e)||y(e)&&(e.toString===w||!m(e.toString))?JSON.stringify(e,Y,2):String(e),Y=(e,t)=>t&&t.__v_isRef?Y(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],o)=>(e[K(t,o)+" =>"]=n,e)),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>K(e)))}:b(t)?K(t):!y(t)||h(t)||$(t)?t:String(t),K=(e,t="")=>{var n;return b(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let G,U;class q{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=G,!e&&G&&(this.index=(G.scopes||(G.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=G;try{return G=this,e()}finally{G=t}}}on(){G=this}off(){G=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t=2))break;ue(),this._queryings--}return this._dirtyLevel>=2}set dirty(e){this._dirtyLevel=e?3:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=le,t=U;try{return le=!0,U=this,this._runnings++,oe(this),this.fn()}finally{re(this),this._runnings--,U=t,le=e}}stop(){var e;this.active&&(oe(this),re(this),null==(e=this.onStop)||e.call(this),this.active=!1)}}function oe(e){e._trackId++,e._depsLength=0}function re(e){if(e.deps&&e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},ve=new WeakMap,be=Symbol(""),ye=Symbol("");function Oe(e,t,n){if(le&&U){let t=ve.get(e);t||ve.set(e,t=new Map);let o=t.get(n);o||t.set(n,o=me((()=>t.delete(n)))),he(U,o)}}function we(e,t,n,o,r,i){const l=ve.get(e);if(!l)return;let a=[];if("clear"===t)a=[...l.values()];else if("length"===n&&h(e)){const e=Number(o);l.forEach(((t,n)=>{("length"===n||!b(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(l.get(n)),t){case"add":h(e)?S(n)&&a.push(l.get("length")):(a.push(l.get(be)),f(e)&&a.push(l.get(ye)));break;case"delete":h(e)||(a.push(l.get(be)),f(e)&&a.push(l.get(ye)));break;case"set":f(e)&&a.push(l.get(be))}de();for(const s of a)s&&ge(s,3);pe()}const xe=n("__proto__,__v_isRef,__isVue"),$e=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(b)),Se=Ce();function Ce(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=pt(this);for(let t=0,r=this.length;t{e[t]=function(...e){ce(),de();const n=pt(this)[t].apply(this,e);return pe(),ue(),n}})),e}function ke(e){const t=pt(this);return Oe(t,0,e),t.hasOwnProperty(e)}class Pe{constructor(e=!1,t=!1){this._isReadonly=e,this._shallow=t}get(e,t,n){const o=this._isReadonly,r=this._shallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(o?r?ot:nt:r?tt:et).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const i=h(e);if(!o){if(i&&p(Se,t))return Reflect.get(Se,t,n);if("hasOwnProperty"===t)return ke}const l=Reflect.get(e,t,n);return(b(t)?$e.has(t):xe(t))?l:(o||Oe(e,0,t),r?l:yt(l)?i&&S(t)?l:l.value:y(l)?o?lt(l):it(l):l)}}class Me extends Pe{constructor(e=!1){super(!1,e)}set(e,t,n,o){let r=e[t];if(!this._shallow){const t=ct(r);if(ut(n)||ct(n)||(r=pt(r),n=pt(n)),!h(e)&&yt(r)&&!yt(n))return!t&&(r.value=n,!0)}const i=h(e)&&S(t)?Number(t)e,De=e=>Reflect.getPrototypeOf(e);function je(e,t,n=!1,o=!1){const r=pt(e=e.__v_raw),i=pt(t);n||(R(t,i)&&Oe(r,0,t),Oe(r,0,i));const{has:l}=De(r),a=o?Re:n?gt:ft;return l.call(r,t)?a(e.get(t)):l.call(r,i)?a(e.get(i)):void(e!==r&&e.get(t))}function Be(e,t=!1){const n=this.__v_raw,o=pt(n),r=pt(e);return t||(R(e,r)&&Oe(o,0,e),Oe(o,0,r)),e===r?n.has(e):n.has(e)||n.has(r)}function Ne(e,t=!1){return e=e.__v_raw,!t&&Oe(pt(e),0,be),Reflect.get(e,"size",e)}function ze(e){e=pt(e);const t=pt(this);return De(t).has.call(t,e)||(t.add(e),we(t,"add",e,e)),this}function _e(e,t){t=pt(t);const n=pt(this),{has:o,get:r}=De(n);let i=o.call(n,e);i||(e=pt(e),i=o.call(n,e));const l=r.call(n,e);return n.set(e,t),i?R(t,l)&&we(n,"set",e,t):we(n,"add",e,t),this}function Le(e){const t=pt(this),{has:n,get:o}=De(t);let r=n.call(t,e);r||(e=pt(e),r=n.call(t,e)),o&&o.call(t,e);const i=t.delete(e);return r&&we(t,"delete",e,void 0),i}function Qe(){const e=pt(this),t=0!==e.size,n=e.clear();return t&&we(e,"clear",void 0,void 0),n}function He(e,t){return function(n,o){const r=this,i=r.__v_raw,l=pt(i),a=t?Re:e?gt:ft;return!e&&Oe(l,0,be),i.forEach(((e,t)=>n.call(o,a(e),a(t),r)))}}function Fe(e,t,n){return function(...o){const r=this.__v_raw,i=pt(r),l=f(i),a="entries"===e||e===Symbol.iterator&&l,s="keys"===e&&l,c=r[e](...o),u=n?Re:t?gt:ft;return!t&&Oe(i,0,s?ye:be),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function We(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Ze(){const e={get(e){return je(this,e)},get size(){return Ne(this)},has:Be,add:ze,set:_e,delete:Le,clear:Qe,forEach:He(!1,!1)},t={get(e){return je(this,e,!1,!0)},get size(){return Ne(this)},has:Be,add:ze,set:_e,delete:Le,clear:Qe,forEach:He(!1,!0)},n={get(e){return je(this,e,!0)},get size(){return Ne(this,!0)},has(e){return Be.call(this,e,!0)},add:We("add"),set:We("set"),delete:We("delete"),clear:We("clear"),forEach:He(!0,!1)},o={get(e){return je(this,e,!0,!0)},get size(){return Ne(this,!0)},has(e){return Be.call(this,e,!0)},add:We("add"),set:We("set"),delete:We("delete"),clear:We("clear"),forEach:He(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{e[r]=Fe(r,!1,!1),n[r]=Fe(r,!0,!1),t[r]=Fe(r,!1,!0),o[r]=Fe(r,!0,!0)})),[e,n,t,o]}const[Ve,Xe,Ye,Ke]=Ze();function Ge(e,t){const n=t?e?Ke:Ye:e?Xe:Ve;return(t,o,r)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(p(n,o)&&o in t?n:t,o,r)}const Ue={get:Ge(!1,!1)},qe={get:Ge(!1,!0)},Je={get:Ge(!0,!1)},et=new WeakMap,tt=new WeakMap,nt=new WeakMap,ot=new WeakMap;function rt(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>x(e).slice(8,-1))(e))}function it(e){return ct(e)?e:at(e,!1,Ie,Ue,et)}function lt(e){return at(e,!0,Ee,Je,nt)}function at(e,t,n,o,r){if(!y(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const l=rt(e);if(0===l)return e;const a=new Proxy(e,2===l?o:n);return r.set(e,a),a}function st(e){return ct(e)?st(e.__v_raw):!(!e||!e.__v_isReactive)}function ct(e){return!(!e||!e.__v_isReadonly)}function ut(e){return!(!e||!e.__v_isShallow)}function dt(e){return st(e)||ct(e)}function pt(e){const t=e&&e.__v_raw;return t?pt(t):e}function ht(e){return j(e,"__v_skip",!0),e}const ft=e=>y(e)?it(e):e,gt=e=>y(e)?lt(e):e;class mt{constructor(e,t,n,o){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new ne((()=>e(this._value)),(()=>bt(this,1))),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=pt(this);return vt(e),e._cacheable&&!e.effect.dirty||R(e._value,e._value=e.effect.run())&&bt(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function vt(e){le&&U&&(e=pt(e),he(U,e.dep||(e.dep=me((()=>e.dep=void 0),e instanceof mt?e:void 0))))}function bt(e,t=3,n){const o=(e=pt(e)).dep;o&&ge(o,t)}function yt(e){return!(!e||!0!==e.__v_isRef)}function Ot(e){return xt(e,!1)}function wt(e){return xt(e,!0)}function xt(e,t){return yt(e)?e:new $t(e,t)}class $t{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:pt(e),this._value=t?e:ft(e)}get value(){return vt(this),this._value}set value(e){const t=this.__v_isShallow||ut(e)||ct(e);e=t?e:pt(e),R(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:ft(e),bt(this,3))}}function St(e){bt(e,3)}function Ct(e){return yt(e)?e.value:e}const kt={get:(e,t,n)=>Ct(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return yt(r)&&!yt(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Pt(e){return st(e)?e:new Proxy(e,kt)}function Mt(e){const t=h(e)?new Array(e.length):{};for(const n in e)t[n]=At(e,n);return t}class Tt{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=pt(this._object),t=this._key,null==(n=ve.get(e))?void 0:n.get(t);var e,t,n}}class It{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Et(e,t,n){return yt(e)?e:m(e)?new It(e):y(e)&&arguments.length>1?At(e,t,n):Ot(e)}function At(e,t,n){const o=e[t];return yt(o)?o:new Tt(e,t,n)}function Rt(e,t,n,o){let r;try{r=o?e(...o):e()}catch(i){jt(i,t,n)}return r}function Dt(e,t,n,o){if(m(e)){const r=Rt(e,t,n,o);return r&&O(r)&&r.catch((e=>{jt(e,t,n)})),r}const r=[];for(let i=0;i>>1,r=zt[o],i=Gt(r);iGt(e)-Gt(t))),Ht=0;Htnull==e.id?1/0:e.id,Ut=(e,t)=>{const n=Gt(e)-Gt(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function qt(e){Nt=!1,Bt=!0,zt.sort(Ut);try{for(_t=0;_tv(e)?e.trim():e))),t&&(i=n.map(B))}let s,c=r[s=A(t)]||r[s=A(M(t))];!c&&l&&(c=r[s=A(I(t))]),c&&Dt(c,e,6,i);const u=r[s+"Once"];if(u){if(e.emitted){if(e.emitted[s])return}else e.emitted={};e.emitted[s]=!0,Dt(u,e,6,i)}}function en(e,t,n=!1){const o=t.emitsCache,r=o.get(e);if(void 0!==r)return r;const i=e.emits;let l={},a=!1;if(!m(e)){const o=e=>{const n=en(e,t,!0);n&&(a=!0,c(l,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return i||a?(h(i)?i.forEach((e=>l[e]=null)):c(l,i),y(e)&&o.set(e,l),l):(y(e)&&o.set(e,null),null)}function tn(e,t){return!(!e||!a(t))&&(t=t.slice(2).replace(/Once$/,""),p(e,t[0].toLowerCase()+t.slice(1))||p(e,I(t))||p(e,t))}let nn=null,on=null;function rn(e){const t=nn;return nn=e,on=e&&e.type.__scopeId||null,t}function ln(e){on=e}function an(){on=null}function sn(e,t=nn,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d&&gr(-1);const r=rn(t);let i;try{i=e(...n)}finally{rn(r),o._d&&gr(1)}return i};return o._n=!0,o._c=!0,o._d=!0,o}function cn(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:i,propsOptions:[l],slots:a,attrs:c,emit:u,render:d,renderCache:p,data:h,setupState:f,ctx:g,inheritAttrs:m}=e;let v,b;const y=rn(e);try{if(4&n.shapeFlag){const e=r||o,t=e;v=Tr(d.call(t,e,p,i,f,h,g)),b=c}else{const e=t;v=Tr(e.length>1?e(i,{attrs:c,slots:a,emit:u}):e(i,null)),b=t.props?c:un(c)}}catch(w){dr.length=0,jt(w,e,1),v=Cr(cr)}let O=v;if(b&&!1!==m){const e=Object.keys(b),{shapeFlag:t}=O;e.length&&7&t&&(l&&e.some(s)&&(b=dn(b,l)),O=kr(O,b))}return n.dirs&&(O=kr(O),O.dirs=O.dirs?O.dirs.concat(n.dirs):n.dirs),n.transition&&(O.transition=n.transition),v=O,rn(y),v}const un=e=>{let t;for(const n in e)("class"===n||"style"===n||a(n))&&((t||(t={}))[n]=e[n]);return t},dn=(e,t)=>{const n={};for(const o in e)s(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function pn(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;r{e(...t),k()}}const d=jr,p=e=>!0===r?e:Cn(e,!1===r?1:void 0);let f,g,v=!1,b=!1;if(yt(e)?(f=()=>e.value,v=ut(e)):st(e)?(f=()=>p(e),v=!0):h(e)?(b=!0,v=e.some((e=>st(e)||ut(e))),f=()=>e.map((e=>yt(e)?e.value:st(e)?p(e):m(e)?Rt(e,d,2):void 0))):f=m(e)?t?()=>Rt(e,d,2):()=>(g&&g(),Dt(e,d,3,[O])):i,t&&r){const e=f;f=()=>Cn(e())}let y,O=e=>{g=S.onStop=()=>{Rt(e,d,4),g=S.onStop=void 0}};if(Hr){if(O=i,t?n&&Dt(t,d,3,[f(),b?[]:void 0,O]):f(),"sync"!==l)return i;{const e=Ro(bn);y=e.__watcherHandles||(e.__watcherHandles=[])}}let w=b?new Array(e.length).fill(On):On;const x=()=>{if(S.active&&S.dirty)if(t){const e=S.run();(r||v||(b?e.some(((e,t)=>R(e,w[t]))):R(e,w)))&&(g&&g(),Dt(t,d,3,[e,w===On?void 0:b&&w[0]===On?[]:w,O]),w=e)}else S.run()};let $;x.allowRecurse=!!t,"sync"===l?$=x:"post"===l?$=()=>Yo(x,d&&d.suspense):(x.pre=!0,d&&(x.id=d.uid),$=()=>Vt(x));const S=new ne(f,i,$),C=ee(),k=()=>{S.stop(),C&&u(C.effects,S)};return t?n?x():w=S.run():"post"===l?Yo(S.run.bind(S),d&&d.suspense):S.run(),y&&y.push(k),k}function $n(e,t,n){const o=this.proxy,r=v(e)?e.includes(".")?Sn(o,e):()=>o[e]:e.bind(o,o);let i;m(t)?i=t:(i=t.handler,n=t);const l=jr;_r(this);const a=xn(r,i.bind(o),n);return l?_r(l):Lr(),a}function Sn(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e0){if(n>=t)return e;n++}if((o=o||new Set).has(e))return e;if(o.add(e),yt(e))Cn(e.value,t,n,o);else if(h(e))for(let r=0;r{Cn(e,t,n,o)}));else if($(e))for(const r in e)Cn(e[r],t,n,o);return e}function kn(e,t){const n=nn;if(null===n)return e;const r=Vr(n)||n.proxy,i=e.dirs||(e.dirs=[]);for(let l=0;l{e.isMounted=!0})),Jn((()=>{e.isUnmounting=!0})),e}const En=[Function,Array],An={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:En,onEnter:En,onAfterEnter:En,onEnterCancelled:En,onBeforeLeave:En,onLeave:En,onAfterLeave:En,onLeaveCancelled:En,onBeforeAppear:En,onAppear:En,onAfterAppear:En,onAppearCancelled:En},Rn={name:"BaseTransition",props:An,setup(e,{slots:t}){const n=Br(),o=In();let r;return()=>{const i=t.default&&_n(t.default(),!0);if(!i||!i.length)return;let l=i[0];if(i.length>1)for(const e of i)if(e.type!==cr){l=e;break}const a=pt(e),{mode:s}=a;if(o.isLeaving)return Bn(l);const c=Nn(l);if(!c)return Bn(l);const u=jn(c,a,o,n);zn(c,u);const d=n.subTree,p=d&&Nn(d);let h=!1;const{getTransitionKey:f}=c.type;if(f){const e=f();void 0===r?r=e:e!==r&&(r=e,h=!0)}if(p&&p.type!==cr&&(!Or(c,p)||h)){const e=jn(p,a,o,n);if(zn(p,e),"out-in"===s)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,!1!==n.update.active&&(n.effect.dirty=!0,n.update())},Bn(l);"in-out"===s&&c.type!==cr&&(e.delayLeave=(e,t,n)=>{Dn(o,p)[String(p.key)]=p,e[Mn]=()=>{t(),e[Mn]=void 0,delete u.delayedLeave},u.delayedLeave=n})}return l}}};function Dn(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function jn(e,t,n,o){const{appear:r,mode:i,persisted:l=!1,onBeforeEnter:a,onEnter:s,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:p,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:m,onAppear:v,onAfterAppear:b,onAppearCancelled:y}=t,O=String(e.key),w=Dn(n,e),x=(e,t)=>{e&&Dt(e,o,9,t)},$=(e,t)=>{const n=t[1];x(e,t),h(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},S={mode:i,persisted:l,beforeEnter(t){let o=a;if(!n.isMounted){if(!r)return;o=m||a}t[Mn]&&t[Mn](!0);const i=w[O];i&&Or(e,i)&&i.el[Mn]&&i.el[Mn](),x(o,[t])},enter(e){let t=s,o=c,i=u;if(!n.isMounted){if(!r)return;t=v||s,o=b||c,i=y||u}let l=!1;const a=e[Tn]=t=>{l||(l=!0,x(t?i:o,[e]),S.delayedLeave&&S.delayedLeave(),e[Tn]=void 0)};t?$(t,[e,a]):a()},leave(t,o){const r=String(e.key);if(t[Tn]&&t[Tn](!0),n.isUnmounting)return o();x(d,[t]);let i=!1;const l=t[Mn]=n=>{i||(i=!0,o(),x(n?g:f,[t]),t[Mn]=void 0,w[r]===e&&delete w[r])};w[r]=e,p?$(p,[t,l]):l()},clone:e=>jn(e,t,n,o)};return S}function Bn(e){if(Hn(e))return(e=kr(e)).children=null,e}function Nn(e){return Hn(e)?e.children?e.children[0]:void 0:e}function zn(e,t){6&e.shapeFlag&&e.component?zn(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function _n(e,t=!1,n){let o=[],r=0;for(let i=0;i1)for(let i=0;in.has(e.toLowerCase()):e=>n.has(e)}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const o={},r=[],i=()=>{},l=()=>!1,a=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),s=e=>e.startsWith("onUpdate:"),c=Object.assign,u=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,p=(e,t)=>d.call(e,t),h=Array.isArray,f=e=>"[object Map]"===x(e),g=e=>"[object Set]"===x(e),m=e=>"function"==typeof e,v=e=>"string"==typeof e,b=e=>"symbol"==typeof e,y=e=>null!==e&&"object"==typeof e,O=e=>(y(e)||m(e))&&m(e.then)&&m(e.catch),w=Object.prototype.toString,x=e=>w.call(e),$=e=>"[object Object]"===x(e),S=e=>v(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,C=n(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),k=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},P=/-(\w)/g,M=k((e=>e.replace(P,((e,t)=>t?t.toUpperCase():"")))),T=/\B([A-Z])/g,I=k((e=>e.replace(T,"-$1").toLowerCase())),E=k((e=>e.charAt(0).toUpperCase()+e.slice(1))),A=k((e=>e?`on${E(e)}`:"")),R=(e,t)=>!Object.is(e,t),D=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},B=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let N;const z=()=>N||(N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function _(e){if(h(e)){const t={};for(let n=0;n{if(e){const n=e.split(Q);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function W(e){let t="";if(v(e))t=e;else if(h(e))for(let n=0;nv(e)?e:null==e?"":h(e)||y(e)&&(e.toString===w||!m(e.toString))?JSON.stringify(e,Y,2):String(e),Y=(e,t)=>t&&t.__v_isRef?Y(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],o)=>(e[K(t,o)+" =>"]=n,e)),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>K(e)))}:b(t)?K(t):!y(t)||h(t)||$(t)?t:String(t),K=(e,t="")=>{var n;return b(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let G,U;class q{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=G,!e&&G&&(this.index=(G.scopes||(G.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=G;try{return G=this,e()}finally{G=t}}}on(){G=this}off(){G=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t=2))break;ue(),this._queryings--}return this._dirtyLevel>=2}set dirty(e){this._dirtyLevel=e?3:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=le,t=U;try{return le=!0,U=this,this._runnings++,oe(this),this.fn()}finally{re(this),this._runnings--,U=t,le=e}}stop(){var e;this.active&&(oe(this),re(this),null==(e=this.onStop)||e.call(this),this.active=!1)}}function oe(e){e._trackId++,e._depsLength=0}function re(e){if(e.deps&&e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},ve=new WeakMap,be=Symbol(""),ye=Symbol("");function Oe(e,t,n){if(le&&U){let t=ve.get(e);t||ve.set(e,t=new Map);let o=t.get(n);o||t.set(n,o=me((()=>t.delete(n)))),he(U,o)}}function we(e,t,n,o,r,i){const l=ve.get(e);if(!l)return;let a=[];if("clear"===t)a=[...l.values()];else if("length"===n&&h(e)){const e=Number(o);l.forEach(((t,n)=>{("length"===n||!b(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(l.get(n)),t){case"add":h(e)?S(n)&&a.push(l.get("length")):(a.push(l.get(be)),f(e)&&a.push(l.get(ye)));break;case"delete":h(e)||(a.push(l.get(be)),f(e)&&a.push(l.get(ye)));break;case"set":f(e)&&a.push(l.get(be))}de();for(const s of a)s&&ge(s,3);pe()}const xe=n("__proto__,__v_isRef,__isVue"),$e=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(b)),Se=Ce();function Ce(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=pt(this);for(let t=0,r=this.length;t{e[t]=function(...e){ce(),de();const n=pt(this)[t].apply(this,e);return pe(),ue(),n}})),e}function ke(e){const t=pt(this);return Oe(t,0,e),t.hasOwnProperty(e)}class Pe{constructor(e=!1,t=!1){this._isReadonly=e,this._shallow=t}get(e,t,n){const o=this._isReadonly,r=this._shallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(o?r?ot:nt:r?tt:et).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const i=h(e);if(!o){if(i&&p(Se,t))return Reflect.get(Se,t,n);if("hasOwnProperty"===t)return ke}const l=Reflect.get(e,t,n);return(b(t)?$e.has(t):xe(t))?l:(o||Oe(e,0,t),r?l:yt(l)?i&&S(t)?l:l.value:y(l)?o?lt(l):it(l):l)}}class Me extends Pe{constructor(e=!1){super(!1,e)}set(e,t,n,o){let r=e[t];if(!this._shallow){const t=ct(r);if(ut(n)||ct(n)||(r=pt(r),n=pt(n)),!h(e)&&yt(r)&&!yt(n))return!t&&(r.value=n,!0)}const i=h(e)&&S(t)?Number(t)e,De=e=>Reflect.getPrototypeOf(e);function je(e,t,n=!1,o=!1){const r=pt(e=e.__v_raw),i=pt(t);n||(R(t,i)&&Oe(r,0,t),Oe(r,0,i));const{has:l}=De(r),a=o?Re:n?gt:ft;return l.call(r,t)?a(e.get(t)):l.call(r,i)?a(e.get(i)):void(e!==r&&e.get(t))}function Be(e,t=!1){const n=this.__v_raw,o=pt(n),r=pt(e);return t||(R(e,r)&&Oe(o,0,e),Oe(o,0,r)),e===r?n.has(e):n.has(e)||n.has(r)}function Ne(e,t=!1){return e=e.__v_raw,!t&&Oe(pt(e),0,be),Reflect.get(e,"size",e)}function ze(e){e=pt(e);const t=pt(this);return De(t).has.call(t,e)||(t.add(e),we(t,"add",e,e)),this}function _e(e,t){t=pt(t);const n=pt(this),{has:o,get:r}=De(n);let i=o.call(n,e);i||(e=pt(e),i=o.call(n,e));const l=r.call(n,e);return n.set(e,t),i?R(t,l)&&we(n,"set",e,t):we(n,"add",e,t),this}function Le(e){const t=pt(this),{has:n,get:o}=De(t);let r=n.call(t,e);r||(e=pt(e),r=n.call(t,e)),o&&o.call(t,e);const i=t.delete(e);return r&&we(t,"delete",e,void 0),i}function Qe(){const e=pt(this),t=0!==e.size,n=e.clear();return t&&we(e,"clear",void 0,void 0),n}function He(e,t){return function(n,o){const r=this,i=r.__v_raw,l=pt(i),a=t?Re:e?gt:ft;return!e&&Oe(l,0,be),i.forEach(((e,t)=>n.call(o,a(e),a(t),r)))}}function Fe(e,t,n){return function(...o){const r=this.__v_raw,i=pt(r),l=f(i),a="entries"===e||e===Symbol.iterator&&l,s="keys"===e&&l,c=r[e](...o),u=n?Re:t?gt:ft;return!t&&Oe(i,0,s?ye:be),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function We(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Ze(){const e={get(e){return je(this,e)},get size(){return Ne(this)},has:Be,add:ze,set:_e,delete:Le,clear:Qe,forEach:He(!1,!1)},t={get(e){return je(this,e,!1,!0)},get size(){return Ne(this)},has:Be,add:ze,set:_e,delete:Le,clear:Qe,forEach:He(!1,!0)},n={get(e){return je(this,e,!0)},get size(){return Ne(this,!0)},has(e){return Be.call(this,e,!0)},add:We("add"),set:We("set"),delete:We("delete"),clear:We("clear"),forEach:He(!0,!1)},o={get(e){return je(this,e,!0,!0)},get size(){return Ne(this,!0)},has(e){return Be.call(this,e,!0)},add:We("add"),set:We("set"),delete:We("delete"),clear:We("clear"),forEach:He(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{e[r]=Fe(r,!1,!1),n[r]=Fe(r,!0,!1),t[r]=Fe(r,!1,!0),o[r]=Fe(r,!0,!0)})),[e,n,t,o]}const[Ve,Xe,Ye,Ke]=Ze();function Ge(e,t){const n=t?e?Ke:Ye:e?Xe:Ve;return(t,o,r)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(p(n,o)&&o in t?n:t,o,r)}const Ue={get:Ge(!1,!1)},qe={get:Ge(!1,!0)},Je={get:Ge(!0,!1)},et=new WeakMap,tt=new WeakMap,nt=new WeakMap,ot=new WeakMap;function rt(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>x(e).slice(8,-1))(e))}function it(e){return ct(e)?e:at(e,!1,Ie,Ue,et)}function lt(e){return at(e,!0,Ee,Je,nt)}function at(e,t,n,o,r){if(!y(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const l=rt(e);if(0===l)return e;const a=new Proxy(e,2===l?o:n);return r.set(e,a),a}function st(e){return ct(e)?st(e.__v_raw):!(!e||!e.__v_isReactive)}function ct(e){return!(!e||!e.__v_isReadonly)}function ut(e){return!(!e||!e.__v_isShallow)}function dt(e){return st(e)||ct(e)}function pt(e){const t=e&&e.__v_raw;return t?pt(t):e}function ht(e){return j(e,"__v_skip",!0),e}const ft=e=>y(e)?it(e):e,gt=e=>y(e)?lt(e):e;class mt{constructor(e,t,n,o){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new ne((()=>e(this._value)),(()=>bt(this,1))),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=pt(this);return vt(e),e._cacheable&&!e.effect.dirty||R(e._value,e._value=e.effect.run())&&bt(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function vt(e){le&&U&&(e=pt(e),he(U,e.dep||(e.dep=me((()=>e.dep=void 0),e instanceof mt?e:void 0))))}function bt(e,t=3,n){const o=(e=pt(e)).dep;o&&ge(o,t)}function yt(e){return!(!e||!0!==e.__v_isRef)}function Ot(e){return xt(e,!1)}function wt(e){return xt(e,!0)}function xt(e,t){return yt(e)?e:new $t(e,t)}class $t{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:pt(e),this._value=t?e:ft(e)}get value(){return vt(this),this._value}set value(e){const t=this.__v_isShallow||ut(e)||ct(e);e=t?e:pt(e),R(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:ft(e),bt(this,3))}}function St(e){bt(e,3)}function Ct(e){return yt(e)?e.value:e}const kt={get:(e,t,n)=>Ct(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return yt(r)&&!yt(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Pt(e){return st(e)?e:new Proxy(e,kt)}function Mt(e){const t=h(e)?new Array(e.length):{};for(const n in e)t[n]=At(e,n);return t}class Tt{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=pt(this._object),t=this._key,null==(n=ve.get(e))?void 0:n.get(t);var e,t,n}}class It{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Et(e,t,n){return yt(e)?e:m(e)?new It(e):y(e)&&arguments.length>1?At(e,t,n):Ot(e)}function At(e,t,n){const o=e[t];return yt(o)?o:new Tt(e,t,n)}function Rt(e,t,n,o){let r;try{r=o?e(...o):e()}catch(i){jt(i,t,n)}return r}function Dt(e,t,n,o){if(m(e)){const r=Rt(e,t,n,o);return r&&O(r)&&r.catch((e=>{jt(e,t,n)})),r}const r=[];for(let i=0;i>>1,r=zt[o],i=Gt(r);iGt(e)-Gt(t))),Ht=0;Htnull==e.id?1/0:e.id,Ut=(e,t)=>{const n=Gt(e)-Gt(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function qt(e){Nt=!1,Bt=!0,zt.sort(Ut);try{for(_t=0;_tv(e)?e.trim():e))),t&&(i=n.map(B))}let s,c=r[s=A(t)]||r[s=A(M(t))];!c&&l&&(c=r[s=A(I(t))]),c&&Dt(c,e,6,i);const u=r[s+"Once"];if(u){if(e.emitted){if(e.emitted[s])return}else e.emitted={};e.emitted[s]=!0,Dt(u,e,6,i)}}function en(e,t,n=!1){const o=t.emitsCache,r=o.get(e);if(void 0!==r)return r;const i=e.emits;let l={},a=!1;if(!m(e)){const o=e=>{const n=en(e,t,!0);n&&(a=!0,c(l,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return i||a?(h(i)?i.forEach((e=>l[e]=null)):c(l,i),y(e)&&o.set(e,l),l):(y(e)&&o.set(e,null),null)}function tn(e,t){return!(!e||!a(t))&&(t=t.slice(2).replace(/Once$/,""),p(e,t[0].toLowerCase()+t.slice(1))||p(e,I(t))||p(e,t))}let nn=null,on=null;function rn(e){const t=nn;return nn=e,on=e&&e.type.__scopeId||null,t}function ln(e){on=e}function an(){on=null}function sn(e,t=nn,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d&&gr(-1);const r=rn(t);let i;try{i=e(...n)}finally{rn(r),o._d&&gr(1)}return i};return o._n=!0,o._c=!0,o._d=!0,o}function cn(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:i,propsOptions:[l],slots:a,attrs:c,emit:u,render:d,renderCache:p,data:h,setupState:f,ctx:g,inheritAttrs:m}=e;let v,b;const y=rn(e);try{if(4&n.shapeFlag){const e=r||o,t=e;v=Tr(d.call(t,e,p,i,f,h,g)),b=c}else{const e=t;v=Tr(e.length>1?e(i,{attrs:c,slots:a,emit:u}):e(i,null)),b=t.props?c:un(c)}}catch(w){dr.length=0,jt(w,e,1),v=Cr(cr)}let O=v;if(b&&!1!==m){const e=Object.keys(b),{shapeFlag:t}=O;e.length&&7&t&&(l&&e.some(s)&&(b=dn(b,l)),O=kr(O,b))}return n.dirs&&(O=kr(O),O.dirs=O.dirs?O.dirs.concat(n.dirs):n.dirs),n.transition&&(O.transition=n.transition),v=O,rn(y),v}const un=e=>{let t;for(const n in e)("class"===n||"style"===n||a(n))&&((t||(t={}))[n]=e[n]);return t},dn=(e,t)=>{const n={};for(const o in e)s(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function pn(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;r{e(...t),k()}}const d=jr,p=e=>!0===r?e:Cn(e,!1===r?1:void 0);let f,g,v=!1,b=!1;if(yt(e)?(f=()=>e.value,v=ut(e)):st(e)?(f=()=>p(e),v=!0):h(e)?(b=!0,v=e.some((e=>st(e)||ut(e))),f=()=>e.map((e=>yt(e)?e.value:st(e)?p(e):m(e)?Rt(e,d,2):void 0))):f=m(e)?t?()=>Rt(e,d,2):()=>(g&&g(),Dt(e,d,3,[O])):i,t&&r){const e=f;f=()=>Cn(e())}let y,O=e=>{g=S.onStop=()=>{Rt(e,d,4),g=S.onStop=void 0}};if(Hr){if(O=i,t?n&&Dt(t,d,3,[f(),b?[]:void 0,O]):f(),"sync"!==l)return i;{const e=Ro(bn);y=e.__watcherHandles||(e.__watcherHandles=[])}}let w=b?new Array(e.length).fill(On):On;const x=()=>{if(S.active&&S.dirty)if(t){const e=S.run();(r||v||(b?e.some(((e,t)=>R(e,w[t]))):R(e,w)))&&(g&&g(),Dt(t,d,3,[e,w===On?void 0:b&&w[0]===On?[]:w,O]),w=e)}else S.run()};let $;x.allowRecurse=!!t,"sync"===l?$=x:"post"===l?$=()=>Yo(x,d&&d.suspense):(x.pre=!0,d&&(x.id=d.uid),$=()=>Vt(x));const S=new ne(f,i,$),C=ee(),k=()=>{S.stop(),C&&u(C.effects,S)};return t?n?x():w=S.run():"post"===l?Yo(S.run.bind(S),d&&d.suspense):S.run(),y&&y.push(k),k}function $n(e,t,n){const o=this.proxy,r=v(e)?e.includes(".")?Sn(o,e):()=>o[e]:e.bind(o,o);let i;m(t)?i=t:(i=t.handler,n=t);const l=jr;_r(this);const a=xn(r,i.bind(o),n);return l?_r(l):Lr(),a}function Sn(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e0){if(n>=t)return e;n++}if((o=o||new Set).has(e))return e;if(o.add(e),yt(e))Cn(e.value,t,n,o);else if(h(e))for(let r=0;r{Cn(e,t,n,o)}));else if($(e))for(const r in e)Cn(e[r],t,n,o);return e}function kn(e,t){const n=nn;if(null===n)return e;const r=Vr(n)||n.proxy,i=e.dirs||(e.dirs=[]);for(let l=0;l{e.isMounted=!0})),Jn((()=>{e.isUnmounting=!0})),e}const En=[Function,Array],An={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:En,onEnter:En,onAfterEnter:En,onEnterCancelled:En,onBeforeLeave:En,onLeave:En,onAfterLeave:En,onLeaveCancelled:En,onBeforeAppear:En,onAppear:En,onAfterAppear:En,onAppearCancelled:En},Rn={name:"BaseTransition",props:An,setup(e,{slots:t}){const n=Br(),o=In();let r;return()=>{const i=t.default&&_n(t.default(),!0);if(!i||!i.length)return;let l=i[0];if(i.length>1)for(const e of i)if(e.type!==cr){l=e;break}const a=pt(e),{mode:s}=a;if(o.isLeaving)return Bn(l);const c=Nn(l);if(!c)return Bn(l);const u=jn(c,a,o,n);zn(c,u);const d=n.subTree,p=d&&Nn(d);let h=!1;const{getTransitionKey:f}=c.type;if(f){const e=f();void 0===r?r=e:e!==r&&(r=e,h=!0)}if(p&&p.type!==cr&&(!Or(c,p)||h)){const e=jn(p,a,o,n);if(zn(p,e),"out-in"===s)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,!1!==n.update.active&&(n.effect.dirty=!0,n.update())},Bn(l);"in-out"===s&&c.type!==cr&&(e.delayLeave=(e,t,n)=>{Dn(o,p)[String(p.key)]=p,e[Mn]=()=>{t(),e[Mn]=void 0,delete u.delayedLeave},u.delayedLeave=n})}return l}}};function Dn(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function jn(e,t,n,o){const{appear:r,mode:i,persisted:l=!1,onBeforeEnter:a,onEnter:s,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:p,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:m,onAppear:v,onAfterAppear:b,onAppearCancelled:y}=t,O=String(e.key),w=Dn(n,e),x=(e,t)=>{e&&Dt(e,o,9,t)},$=(e,t)=>{const n=t[1];x(e,t),h(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},S={mode:i,persisted:l,beforeEnter(t){let o=a;if(!n.isMounted){if(!r)return;o=m||a}t[Mn]&&t[Mn](!0);const i=w[O];i&&Or(e,i)&&i.el[Mn]&&i.el[Mn](),x(o,[t])},enter(e){let t=s,o=c,i=u;if(!n.isMounted){if(!r)return;t=v||s,o=b||c,i=y||u}let l=!1;const a=e[Tn]=t=>{l||(l=!0,x(t?i:o,[e]),S.delayedLeave&&S.delayedLeave(),e[Tn]=void 0)};t?$(t,[e,a]):a()},leave(t,o){const r=String(e.key);if(t[Tn]&&t[Tn](!0),n.isUnmounting)return o();x(d,[t]);let i=!1;const l=t[Mn]=n=>{i||(i=!0,o(),x(n?g:f,[t]),t[Mn]=void 0,w[r]===e&&delete w[r])};w[r]=e,p?$(p,[t,l]):l()},clone:e=>jn(e,t,n,o)};return S}function Bn(e){if(Hn(e))return(e=kr(e)).children=null,e}function Nn(e){return Hn(e)?e.children?e.children[0]:void 0:e}function zn(e,t){6&e.shapeFlag&&e.component?zn(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function _n(e,t=!1,n){let o=[],r=0;for(let i=0;i1)for(let i=0;ic({name:e.name},t,{setup:e}))():e}const Qn=e=>!!e.type.__asyncLoader,Hn=e=>e.type.__isKeepAlive;function Fn(e,t){Zn(e,"a",t)}function Wn(e,t){Zn(e,"da",t)}function Zn(e,t,n=jr){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Xn(t,o,n),n){let e=n.parent;for(;e&&e.parent;)Hn(e.parent.vnode)&&Vn(o,t,n,e),e=e.parent}}function Vn(e,t,n,o){const r=Xn(t,e,o,!0);eo((()=>{u(o[t],r)}),n)}function Xn(e,t,n=jr,o=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;ce(),_r(n);const r=Dt(t,n,e,o);return Lr(),ue(),r});return o?r.unshift(i):r.push(i),i}}const Yn=e=>(t,n=jr)=>(!Hr||"sp"===e)&&Xn(e,((...e)=>t(...e)),n),Kn=Yn("bm"),Gn=Yn("m"),Un=Yn("bu"),qn=Yn("u"),Jn=Yn("bum"),eo=Yn("um"),to=Yn("sp"),no=Yn("rtg"),oo=Yn("rtc");function ro(e,t=jr){Xn("ec",e,t)}function io(e,t,n,o){let r;const i=n&&n[o];if(h(e)||v(e)){r=new Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,i&&i[n])));else{const n=Object.keys(e);r=new Array(n.length);for(let o=0,l=n.length;o{const t=o.fn(...e);return t&&(t.key=o.key),t}:o.fn)}return e}function ao(e,t,n={},o,r){if(nn.isCE||nn.parent&&Qn(nn.parent)&&nn.parent.isCE)return"default"!==t&&(n.name=t),Cr("slot",n,o&&o());let i=e[t];i&&i._c&&(i._d=!1),hr();const l=i&&so(i(n)),a=br(ar,{key:n.key||l&&l.key||`_${t}`},l||(o?o():[]),l&&1===e._?64:-2);return!r&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function so(e){return e.some((e=>!yr(e)||e.type!==cr&&!(e.type===ar&&!so(e.children))))?e:null}const co=e=>e?Qr(e)?Vr(e)||e.proxy:co(e.parent):null,uo=c(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>co(e.parent),$root:e=>co(e.root),$emit:e=>e.emit,$options:e=>Oo(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Vt(e.update)}),$nextTick:e=>e.n||(e.n=Zt.bind(e.proxy)),$watch:e=>$n.bind(e)}),po=(e,t)=>e!==o&&!e.__isScriptSetup&&p(e,t),ho={get({_:e},t){const{ctx:n,setupState:r,data:i,props:l,accessCache:a,type:s,appContext:c}=e;let u;if("$"!==t[0]){const s=a[t];if(void 0!==s)switch(s){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return l[t]}else{if(po(r,t))return a[t]=1,r[t];if(i!==o&&p(i,t))return a[t]=2,i[t];if((u=e.propsOptions[0])&&p(u,t))return a[t]=3,l[t];if(n!==o&&p(n,t))return a[t]=4,n[t];mo&&(a[t]=0)}}const d=uo[t];let h,f;return d?("$attrs"===t&&Oe(e,0,t),d(e)):(h=s.__cssModules)&&(h=h[t])?h:n!==o&&p(n,t)?(a[t]=4,n[t]):(f=c.config.globalProperties,p(f,t)?f[t]:void 0)},set({_:e},t,n){const{data:r,setupState:i,ctx:l}=e;return po(i,t)?(i[t]=n,!0):r!==o&&p(r,t)?(r[t]=n,!0):!(p(e.props,t)||"$"===t[0]&&t.slice(1)in e||(l[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:l}},a){let s;return!!n[a]||e!==o&&p(e,a)||po(t,a)||(s=l[0])&&p(s,a)||p(r,a)||p(uo,a)||p(i.config.globalProperties,a)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:p(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function fo(){const e=Br();return e.setupContext||(e.setupContext=Zr(e))}function go(e){return h(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}let mo=!0;function vo(e){const t=Oo(e),n=e.proxy,o=e.ctx;mo=!1,t.beforeCreate&&bo(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:a,watch:s,provide:c,inject:u,created:d,beforeMount:p,mounted:f,beforeUpdate:g,updated:v,activated:b,deactivated:O,beforeDestroy:w,beforeUnmount:x,destroyed:$,unmounted:S,render:C,renderTracked:k,renderTriggered:P,errorCaptured:M,serverPrefetch:T,expose:I,inheritAttrs:E,components:A,directives:R,filters:D}=t;if(u&&function(e,t,n=i){h(e)&&(e=So(e));for(const o in e){const n=e[o];let r;r=y(n)?"default"in n?Ro(n.from||o,n.default,!0):Ro(n.from||o):Ro(n),yt(r)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[o]=r}}(u,o,null),a)for(const i in a){const e=a[i];m(e)&&(o[i]=e.bind(n))}if(r){const t=r.call(n,n);y(t)&&(e.data=it(t))}if(mo=!0,l)for(const h in l){const e=l[h],t=m(e)?e.bind(n,n):m(e.get)?e.get.bind(n,n):i,r=!m(e)&&m(e.set)?e.set.bind(n):i,a=Yr({get:t,set:r});Object.defineProperty(o,h,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(s)for(const i in s)yo(s[i],o,n,i);if(c){const e=m(c)?c.call(n):c;Reflect.ownKeys(e).forEach((t=>{Ao(t,e[t])}))}function j(e,t){h(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(d&&bo(d,e,"c"),j(Kn,p),j(Gn,f),j(Un,g),j(qn,v),j(Fn,b),j(Wn,O),j(ro,M),j(oo,k),j(no,P),j(Jn,x),j(eo,S),j(to,T),h(I))if(I.length){const t=e.exposed||(e.exposed={});I.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});C&&e.render===i&&(e.render=C),null!=E&&(e.inheritAttrs=E),A&&(e.components=A),R&&(e.directives=R)}function bo(e,t,n){Dt(h(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function yo(e,t,n,o){const r=o.includes(".")?Sn(n,o):()=>n[o];if(v(e)){const n=t[e];m(n)&&wn(r,n)}else if(m(e))wn(r,e.bind(n));else if(y(e))if(h(e))e.forEach((e=>yo(e,t,n,o)));else{const o=m(e.handler)?e.handler.bind(n):t[e.handler];m(o)&&wn(r,o,e)}}function Oo(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:l}}=e.appContext,a=i.get(t);let s;return a?s=a:r.length||n||o?(s={},r.length&&r.forEach((e=>wo(s,e,l,!0))),wo(s,t,l)):s=t,y(t)&&i.set(t,s),s}function wo(e,t,n,o=!1){const{mixins:r,extends:i}=t;i&&wo(e,i,n,!0),r&&r.forEach((t=>wo(e,t,n,!0)));for(const l in t)if(o&&"expose"===l);else{const o=xo[l]||n&&n[l];e[l]=o?o(e[l],t[l]):t[l]}return e}const xo={data:$o,props:Po,emits:Po,methods:ko,computed:ko,beforeCreate:Co,created:Co,beforeMount:Co,mounted:Co,beforeUpdate:Co,updated:Co,beforeDestroy:Co,beforeUnmount:Co,destroyed:Co,unmounted:Co,activated:Co,deactivated:Co,errorCaptured:Co,serverPrefetch:Co,components:ko,directives:ko,watch:function(e,t){if(!e)return t;if(!t)return e;const n=c(Object.create(null),e);for(const o in t)n[o]=Co(e[o],t[o]);return n},provide:$o,inject:function(e,t){return ko(So(e),So(t))}};function $o(e,t){return t?e?function(){return c(m(e)?e.call(this,this):e,m(t)?t.call(this,this):t)}:t:e}function So(e){if(h(e)){const t={};for(let n=0;n(i.has(e)||(e&&m(e.install)?(i.add(e),e.install(a,...t)):m(e)&&(i.add(e),e(a,...t))),a),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),a),component:(e,t)=>t?(r.components[e]=t,a):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,a):r.directives[e],mount(i,s,c){if(!l){const u=Cr(n,o);return u.appContext=r,!0===c?c="svg":!1===c&&(c=void 0),s&&t?t(u,i):e(u,i,c),l=!0,a._container=i,i.__vue_app__=a,Vr(u.component)||u.component.proxy}},unmount(){l&&(e(null,a._container),delete a._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,a),runWithContext(e){Eo=a;try{return e()}finally{Eo=null}}};return a}}let Eo=null;function Ao(e,t){if(jr){let n=jr.provides;const o=jr.parent&&jr.parent.provides;o===n&&(n=jr.provides=Object.create(o)),n[e]=t}}function Ro(e,t,n=!1){const o=jr||nn;if(o||Eo){const r=o?null==o.parent?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:Eo._context.provides;if(r&&e in r)return r[e];if(arguments.length>1)return n&&m(t)?t.call(o&&o.proxy):t}}function Do(e,t,n,o=!1){const r={},i={};j(i,wr,1),e.propsDefaults=Object.create(null),jo(e,t,r,i);for(const l in e.propsOptions[0])l in r||(r[l]=void 0);n?e.props=o?r:at(r,!1,Ae,qe,tt):e.type.props?e.props=r:e.props=i,e.attrs=i}function jo(e,t,n,r){const[i,l]=e.propsOptions;let a,s=!1;if(t)for(let o in t){if(C(o))continue;const c=t[o];let u;i&&p(i,u=M(o))?l&&l.includes(u)?(a||(a={}))[u]=c:n[u]=c:tn(e.emitsOptions,o)||o in r&&c===r[o]||(r[o]=c,s=!0)}if(l){const t=pt(n),r=a||o;for(let o=0;o{d=!0;const[n,o]=No(e,t,!0);c(s,n),o&&u.push(...o)};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}if(!a&&!d)return y(e)&&i.set(e,r),r;if(h(a))for(let r=0;r-1,n[1]=o<0||t-1||p(n,"default"))&&u.push(e)}}}const f=[s,u];return y(e)&&i.set(e,f),f}function zo(e){return"$"!==e[0]}function _o(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:null===e?"null":""}function Lo(e,t){return _o(e)===_o(t)}function Qo(e,t){return h(t)?t.findIndex((t=>Lo(t,e))):m(t)&&Lo(t,e)?0:-1}const Ho=e=>"_"===e[0]||"$stable"===e,Fo=e=>h(e)?e.map(Tr):[Tr(e)],Wo=(e,t,n)=>{if(t._n)return t;const o=sn(((...e)=>Fo(t(...e))),n);return o._c=!1,o},Zo=(e,t,n)=>{const o=e._ctx;for(const r in e){if(Ho(r))continue;const n=e[r];if(m(n))t[r]=Wo(0,n,o);else if(null!=n){const e=Fo(n);t[r]=()=>e}}},Vo=(e,t)=>{const n=Fo(t);e.slots.default=()=>n};function Xo(e,t,n,r,i=!1){if(h(e))return void e.forEach(((e,o)=>Xo(e,t&&(h(t)?t[o]:t),n,r,i)));if(Qn(r)&&!i)return;const l=4&r.shapeFlag?Vr(r.component)||r.component.proxy:r.el,a=i?null:l,{i:s,r:c}=e,d=t&&t.r,f=s.refs===o?s.refs={}:s.refs,g=s.setupState;if(null!=d&&d!==c&&(v(d)?(f[d]=null,p(g,d)&&(g[d]=null)):yt(d)&&(d.value=null)),m(c))Rt(c,s,12,[a,f]);else{const t=v(c),o=yt(c);if(t||o){const r=()=>{if(e.f){const n=t?p(g,c)?g[c]:f[c]:c.value;i?h(n)&&u(n,l):h(n)?n.includes(l)||n.push(l):t?(f[c]=[l],p(g,c)&&(g[c]=f[c])):(c.value=[l],e.k&&(f[e.k]=c.value))}else t?(f[c]=a,p(g,c)&&(g[c]=a)):o&&(c.value=a,e.k&&(f[e.k]=a))};a?(r.id=-1,Yo(r,n)):r()}}}const Yo=function(e,t){var n;t&&t.pendingBranch?h(e)?t.effects.push(...e):t.effects.push(e):(h(n=e)?Lt.push(...n):Qt&&Qt.includes(n,n.allowRecurse?Ht+1:Ht)||Lt.push(n),Xt())};function Ko(e){return function(e,t){z().__VUE__=!0;const{insert:n,remove:l,patchProp:a,createElement:s,createText:u,createComment:d,setText:h,setElementText:f,parentNode:g,nextSibling:m,setScopeId:v=i,insertStaticContent:b}=e,y=(e,t,n,o=null,r=null,i=null,l=void 0,a=null,s=!!t.dynamicChildren)=>{if(e===t)return;e&&!Or(e,t)&&(o=te(e),K(e,r,i,!0),e=null),-2===t.patchFlag&&(s=!1,t.dynamicChildren=null);const{type:c,ref:u,shapeFlag:d}=t;switch(c){case sr:w(e,t,n,o);break;case cr:x(e,t,n,o);break;case ur:null==e&&$(t,n,o,l);break;case ar:_(e,t,n,o,r,i,l,a,s);break;default:1&d?P(e,t,n,o,r,i,l,a,s):6&d?L(e,t,n,o,r,i,l,a,s):(64&d||128&d)&&c.process(e,t,n,o,r,i,l,a,s,re)}null!=u&&r&&Xo(u,e&&e.ref,i,t||e,!t)},w=(e,t,o,r)=>{if(null==e)n(t.el=u(t.children),o,r);else{const n=t.el=e.el;t.children!==e.children&&h(n,t.children)}},x=(e,t,o,r)=>{null==e?n(t.el=d(t.children||""),o,r):t.el=e.el},$=(e,t,n,o)=>{[e.el,e.anchor]=b(e.children,t,n,o,e.el,e.anchor)},S=({el:e,anchor:t},o,r)=>{let i;for(;e&&e!==t;)i=m(e),n(e,o,r),e=i;n(t,o,r)},k=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=m(e),l(e),e=n;l(t)},P=(e,t,n,o,r,i,l,a,s)=>{"svg"===t.type?l="svg":"math"===t.type&&(l="mathml"),null==e?T(t,n,o,r,i,l,a,s):R(e,t,r,i,l,a,s)},T=(e,t,o,r,i,l,c,u)=>{let d,p;const{props:h,shapeFlag:g,transition:m,dirs:v}=e;if(d=e.el=s(e.type,l,h&&h.is,h),8&g?f(d,e.children):16&g&&A(e.children,d,null,r,i,Go(e,l),c,u),v&&Pn(e,null,r,"created"),E(d,e,e.scopeId,c,r),h){for(const t in h)"value"===t||C(t)||a(d,t,null,h[t],l,e.children,r,i,ee);"value"in h&&a(d,"value",null,h.value,l),(p=h.onVnodeBeforeMount)&&Ar(p,r,e)}v&&Pn(e,null,r,"beforeMount");const b=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(i,m);b&&m.beforeEnter(d),n(d,t,o),((p=h&&h.onVnodeMounted)||b||v)&&Yo((()=>{p&&Ar(p,r,e),b&&m.enter(d),v&&Pn(e,null,r,"mounted")}),i)},E=(e,t,n,o,r)=>{if(n&&v(e,n),o)for(let i=0;i{for(let c=s;c{const c=t.el=e.el;let{patchFlag:u,dynamicChildren:d,dirs:p}=t;u|=16&e.patchFlag;const h=e.props||o,g=t.props||o;let m;if(n&&Uo(n,!1),(m=g.onVnodeBeforeUpdate)&&Ar(m,n,t,e),p&&Pn(t,e,n,"beforeUpdate"),n&&Uo(n,!0),d?B(e.dynamicChildren,d,c,n,r,Go(t,i),l):s||Z(e,t,c,null,n,r,Go(t,i),l,!1),u>0){if(16&u)N(c,t,h,g,n,r,i);else if(2&u&&h.class!==g.class&&a(c,"class",null,g.class,i),4&u&&a(c,"style",h.style,g.style,i),8&u){const o=t.dynamicProps;for(let t=0;t{m&&Ar(m,n,t,e),p&&Pn(t,e,n,"updated")}),r)},B=(e,t,n,o,r,i,l)=>{for(let a=0;a{if(n!==r){if(n!==o)for(const o in n)C(o)||o in r||a(e,o,n[o],null,s,t.children,i,l,ee);for(const o in r){if(C(o))continue;const c=r[o],u=n[o];c!==u&&"value"!==o&&a(e,o,u,c,s,t.children,i,l,ee)}"value"in r&&a(e,"value",n.value,r.value,s)}},_=(e,t,o,r,i,l,a,s,c)=>{const d=t.el=e?e.el:u(""),p=t.anchor=e?e.anchor:u("");let{patchFlag:h,dynamicChildren:f,slotScopeIds:g}=t;g&&(s=s?s.concat(g):g),null==e?(n(d,o,r),n(p,o,r),A(t.children,o,p,i,l,a,s,c)):h>0&&64&h&&f&&e.dynamicChildren?(B(e.dynamicChildren,f,o,i,l,a,s),(null!=t.key||i&&t===i.subTree)&&qo(e,t,!0)):Z(e,t,o,p,i,l,a,s,c)},L=(e,t,n,o,r,i,l,a,s)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,o,l,s):Q(t,n,o,r,i,l,s):H(e,t,s)},Q=(e,t,n,r,i,l,a)=>{const s=e.component=function(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||Rr,l={uid:Dr++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new q(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:No(r,i),emitsOptions:en(r,i),emit:null,emitted:null,propsDefaults:o,inheritAttrs:r.inheritAttrs,ctx:o,data:o,props:o,attrs:o,slots:o,refs:o,setupState:o,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=Jt.bind(null,l),e.ce&&e.ce(l),l}(e,r,i);if(Hn(e)&&(s.ctx.renderer=re),function(e,t=!1){t&&zr(t);const{props:n,children:o}=e.vnode,r=Qr(e);Do(e,n,r,t),((e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=pt(t),j(t,"_",n)):Zo(t,e.slots={})}else e.slots={},t&&Vo(e,t);j(e.slots,wr,1)})(e,o);r&&function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=ht(new Proxy(e.ctx,ho));const{setup:o}=n;if(o){const n=e.setupContext=o.length>1?Zr(e):null;_r(e),ce();const r=Rt(o,e,0,[e.props,n]);if(ue(),Lr(),O(r)){if(r.then(Lr,Lr),t)return r.then((n=>{Fr(e,n,t)})).catch((t=>{jt(t,e,0)}));e.asyncDep=r}else Fr(e,r,t)}else Wr(e)}(e,t);t&&zr(!1)}(s),s.asyncDep){if(i&&i.registerDep(s,F),!e.el){const e=s.subTree=Cr(cr);x(null,e,t,n)}}else F(s,e,t,n,i,l,a)},H=(e,t,n)=>{const o=t.component=e.component;if(function(e,t,n){const{props:o,children:r,component:i}=e,{props:l,children:a,patchFlag:s}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&s>=0))return!(!r&&!a||a&&a.$stable)||o!==l&&(o?!l||pn(o,l,c):!!l);if(1024&s)return!0;if(16&s)return o?pn(o,l,c):!!l;if(8&s){const e=t.dynamicProps;for(let t=0;t_t&&zt.splice(t,1)}(o.update),o.effect.dirty=!0,o.update()}else t.el=e.el,o.vnode=t},F=(e,t,n,o,r,l,a)=>{const s=()=>{if(e.isMounted){let{next:t,bu:n,u:o,parent:i,vnode:c}=e;{const n=Jo(e);if(n)return t&&(t.el=c.el,W(e,t,a)),void n.asyncDep.then((()=>{e.isUnmounted||s()}))}let u,d=t;Uo(e,!1),t?(t.el=c.el,W(e,t,a)):t=c,n&&D(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Ar(u,i,t,c),Uo(e,!0);const p=cn(e),h=e.subTree;e.subTree=p,y(h,p,g(h.el),te(h),e,r,l),t.el=p.el,null===d&&function({vnode:e,parent:t},n){if(n)for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.el=e.el),o!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,p.el),o&&Yo(o,r),(u=t.props&&t.props.onVnodeUpdated)&&Yo((()=>Ar(u,i,t,c)),r)}else{let i;const{el:a,props:s}=t,{bm:c,m:u,parent:d}=e,p=Qn(t);if(Uo(e,!1),c&&D(c),!p&&(i=s&&s.onVnodeBeforeMount)&&Ar(i,d,t),Uo(e,!0),a&&le){const n=()=>{e.subTree=cn(e),le(a,e.subTree,e,r,null)};p?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const i=e.subTree=cn(e);y(null,i,n,o,e,r,l),t.el=i.el}if(u&&Yo(u,r),!p&&(i=s&&s.onVnodeMounted)){const e=t;Yo((()=>Ar(i,d,e)),r)}(256&t.shapeFlag||d&&Qn(d.vnode)&&256&d.vnode.shapeFlag)&&e.a&&Yo(e.a,r),e.isMounted=!0,t=n=o=null}},c=e.effect=new ne(s,i,(()=>Vt(u)),e.scope),u=e.update=()=>{c.dirty&&c.run()};u.id=e.uid,Uo(e,!0),u()},W=(e,t,n)=>{t.component=e;const r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,o){const{props:r,attrs:i,vnode:{patchFlag:l}}=e,a=pt(r),[s]=e.propsOptions;let c=!1;if(!(o||l>0)||16&l){let o;jo(e,t,r,i)&&(c=!0);for(const i in a)t&&(p(t,i)||(o=I(i))!==i&&p(t,o))||(s?!n||void 0===n[i]&&void 0===n[o]||(r[i]=Bo(s,a,i,void 0,e,!0)):delete r[i]);if(i!==a)for(const e in i)t&&p(t,e)||(delete i[e],c=!0)}else if(8&l){const n=e.vnode.dynamicProps;for(let o=0;o{const{vnode:r,slots:i}=e;let l=!0,a=o;if(32&r.shapeFlag){const e=t._;e?n&&1===e?l=!1:(c(i,t),n||1!==e||delete i._):(l=!t.$stable,Zo(t,i)),a=t}else t&&(Vo(e,t),a={default:1});if(l)for(const o in i)Ho(o)||null!=a[o]||delete i[o]})(e,t.children,n),ce(),Yt(e),ue()},Z=(e,t,n,o,r,i,l,a,s=!1)=>{const c=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:p,shapeFlag:h}=t;if(p>0){if(128&p)return void X(c,d,n,o,r,i,l,a,s);if(256&p)return void V(c,d,n,o,r,i,l,a,s)}8&h?(16&u&&ee(c,r,i),d!==c&&f(n,d)):16&u?16&h?X(c,d,n,o,r,i,l,a,s):ee(c,r,i,!0):(8&u&&f(n,""),16&h&&A(d,n,o,r,i,l,a,s))},V=(e,t,n,o,i,l,a,s,c)=>{t=t||r;const u=(e=e||r).length,d=t.length,p=Math.min(u,d);let h;for(h=0;hd?ee(e,i,l,!0,!1,p):A(t,n,o,i,l,a,s,c,p)},X=(e,t,n,o,i,l,a,s,c)=>{let u=0;const d=t.length;let p=e.length-1,h=d-1;for(;u<=p&&u<=h;){const o=e[u],r=t[u]=c?Ir(t[u]):Tr(t[u]);if(!Or(o,r))break;y(o,r,n,null,i,l,a,s,c),u++}for(;u<=p&&u<=h;){const o=e[p],r=t[h]=c?Ir(t[h]):Tr(t[h]);if(!Or(o,r))break;y(o,r,n,null,i,l,a,s,c),p--,h--}if(u>p){if(u<=h){const e=h+1,r=eh)for(;u<=p;)K(e[u],i,l,!0),u++;else{const f=u,g=u,m=new Map;for(u=g;u<=h;u++){const e=t[u]=c?Ir(t[u]):Tr(t[u]);null!=e.key&&m.set(e.key,u)}let v,b=0;const O=h-g+1;let w=!1,x=0;const $=new Array(O);for(u=0;u=O){K(o,i,l,!0);continue}let r;if(null!=o.key)r=m.get(o.key);else for(v=g;v<=h;v++)if(0===$[v-g]&&Or(o,t[v])){r=v;break}void 0===r?K(o,i,l,!0):($[r-g]=u+1,r>=x?x=r:w=!0,y(o,t[r],n,null,i,l,a,s,c),b++)}const S=w?function(e){const t=e.slice(),n=[0];let o,r,i,l,a;const s=e.length;for(o=0;o>1,e[n[a]]0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,l=n[i-1];i-- >0;)n[i]=l,l=t[l];return n}($):r;for(v=S.length-1,u=O-1;u>=0;u--){const e=g+u,r=t[e],p=e+1{const{el:l,type:a,transition:s,children:c,shapeFlag:u}=e;if(6&u)Y(e.component.subTree,t,o,r);else if(128&u)e.suspense.move(t,o,r);else if(64&u)a.move(e,t,o,re);else if(a!==ar)if(a!==ur)if(2!==r&&1&u&&s)if(0===r)s.beforeEnter(l),n(l,t,o),Yo((()=>s.enter(l)),i);else{const{leave:e,delayLeave:r,afterLeave:i}=s,a=()=>n(l,t,o),c=()=>{e(l,(()=>{a(),i&&i()}))};r?r(l,a,c):c()}else n(l,t,o);else S(e,t,o);else{n(l,t,o);for(let e=0;e{const{type:i,props:l,ref:a,children:s,dynamicChildren:c,shapeFlag:u,patchFlag:d,dirs:p}=e;if(null!=a&&Xo(a,null,n,e,!0),256&u)return void t.ctx.deactivate(e);const h=1&u&&p,f=!Qn(e);let g;if(f&&(g=l&&l.onVnodeBeforeUnmount)&&Ar(g,t,e),6&u)J(e.component,n,o);else{if(128&u)return void e.suspense.unmount(n,o);h&&Pn(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,r,re,o):c&&(i!==ar||d>0&&64&d)?ee(c,t,n,!1,!0):(i===ar&&384&d||!r&&16&u)&&ee(s,t,n),o&&G(e)}(f&&(g=l&&l.onVnodeUnmounted)||h)&&Yo((()=>{g&&Ar(g,t,e),h&&Pn(e,null,t,"unmounted")}),n)},G=e=>{const{type:t,el:n,anchor:o,transition:r}=e;if(t===ar)return void U(n,o);if(t===ur)return void k(e);const i=()=>{l(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){const{leave:t,delayLeave:o}=r,l=()=>t(n,i);o?o(e.el,i,l):l()}else i()},U=(e,t)=>{let n;for(;e!==t;)n=m(e),l(e),e=n;l(t)},J=(e,t,n)=>{const{bum:o,scope:r,update:i,subTree:l,um:a}=e;o&&D(o),r.stop(),i&&(i.active=!1,K(l,e,t,n)),a&&Yo(a,t),Yo((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},ee=(e,t,n,o=!1,r=!1,i=0)=>{for(let l=i;l6&e.shapeFlag?te(e.component.subTree):128&e.shapeFlag?e.suspense.next():m(e.anchor||e.el),oe=(e,t,n)=>{null==e?t._vnode&&K(t._vnode,null,null,!0):y(t._vnode||null,e,t,null,null,null,n),Yt(),Kt(),t._vnode=e},re={p:y,um:K,m:Y,r:G,mt:Q,mc:A,pc:Z,pbc:B,n:te,o:e};let ie,le;return t&&([ie,le]=t(re)),{render:oe,hydrate:ie,createApp:Io(oe,ie)}}(e)}function Go({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Uo({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function qo(e,t,n=!1){const o=e.children,r=t.children;if(h(o)&&h(r))for(let i=0;ie&&(e.disabled||""===e.disabled),tr=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,nr=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,or=(e,t)=>{const n=e&&e.to;return v(n)?t?t(n):null:n};function rr(e,t,n,{o:{insert:o},m:r},i=2){0===i&&o(e.targetAnchor,t,n);const{el:l,anchor:a,shapeFlag:s,children:c,props:u}=e,d=2===i;if(d&&o(l,t,n),(!d||er(u))&&16&s)for(let p=0;p{16&b&&u(y,e,t,r,i,l,a,s)};v?m(n,c):d&&m(d,p)}else{t.el=e.el;const o=t.anchor=e.anchor,u=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=er(e.props),m=g?n:u,b=g?o:h;if("svg"===l||tr(u)?l="svg":("mathml"===l||nr(u))&&(l="mathml"),O?(p(e.dynamicChildren,O,m,r,i,l,a),qo(e,t,!0)):s||d(e,t,m,b,r,i,l,a,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):rr(t,n,o,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=or(t.props,f);e&&rr(t,e,null,c,0)}else g&&rr(t,u,h,c,1)}lr(t)},remove(e,t,n,o,{um:r,o:{remove:i}},l){const{shapeFlag:a,children:s,anchor:c,targetAnchor:u,target:d,props:p}=e;if(d&&i(u),l&&i(c),16&a){const e=l||!er(p);for(let o=0;o0?pr||r:null,dr.pop(),pr=dr[dr.length-1]||null,fr>0&&pr&&pr.push(e),e}function vr(e,t,n,o,r,i){return mr(Sr(e,t,n,o,r,i,!0))}function br(e,t,n,o,r){return mr(Cr(e,t,n,o,r,!0))}function yr(e){return!!e&&!0===e.__v_isVNode}function Or(e,t){return e.type===t.type&&e.key===t.key}const wr="__vInternal",xr=({key:e})=>null!=e?e:null,$r=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?v(e)||yt(e)||m(e)?{i:nn,r:e,k:t,f:!!n}:e:null);function Sr(e,t=null,n=null,o=0,r=null,i=(e===ar?0:1),l=!1,a=!1){const s={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&xr(t),ref:t&&$r(t),scopeId:on,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:nn};return a?(Er(s,n),128&i&&e.normalize(s)):n&&(s.shapeFlag|=v(n)?8:16),fr>0&&!l&&pr&&(s.patchFlag>0||6&i)&&32!==s.patchFlag&&pr.push(s),s}const Cr=function(e,t=null,n=null,o=0,r=null,i=!1){if(e&&e!==gn||(e=cr),yr(e)){const o=kr(e,t,!0);return n&&Er(o,n),fr>0&&!i&&pr&&(6&o.shapeFlag?pr[pr.indexOf(e)]=o:pr.push(o)),o.patchFlag|=-2,o}var l;if(m(l=e)&&"__vccOpts"in l&&(e=e.__vccOpts),t){t=function(e){return e?dt(e)||wr in e?c({},e):e:null}(t);let{class:e,style:n}=t;e&&!v(e)&&(t.class=W(e)),y(n)&&(dt(n)&&!h(n)&&(n=c({},n)),t.style=_(n))}const a=v(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:y(e)?4:m(e)?2:0;return Sr(e,t,n,o,r,a,i,!0)};function kr(e,t,n=!1){const{props:o,ref:r,patchFlag:i,children:l}=e,s=t?function(...e){const t={};for(let n=0;njr||nn;let Nr,zr;{const e=z(),t=(t,n)=>{let o;return(o=e[t])||(o=e[t]=[]),o.push(n),e=>{o.length>1?o.forEach((t=>t(e))):o[0](e)}};Nr=t("__VUE_INSTANCE_SETTERS__",(e=>jr=e)),zr=t("__VUE_SSR_SETTERS__",(e=>Hr=e))}const _r=e=>{Nr(e),e.scope.on()},Lr=()=>{jr&&jr.scope.off(),Nr(null)};function Qr(e){return 4&e.vnode.shapeFlag}let Hr=!1;function Fr(e,t,n){m(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:y(t)&&(e.setupState=Pt(t)),Wr(e)}function Wr(e,t,n){const o=e.type;e.render||(e.render=o.render||i),_r(e),ce();try{vo(e)}finally{ue(),Lr()}}function Zr(e){const t=t=>{e.exposed=t||{}};return{get attrs(){return function(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get:(t,n)=>(Oe(e,0,"$attrs"),t[n])}))}(e)},slots:e.slots,emit:e.emit,expose:t}}function Vr(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Pt(ht(e.exposed)),{get:(t,n)=>n in t?t[n]:n in uo?uo[n](e):void 0,has:(e,t)=>t in e||t in uo}))}function Xr(e,t=!0){return m(e)?e.displayName||e.name:e.name||t&&e.__name}const Yr=(e,t)=>function(e,t,n=!1){let o,r;const l=m(e);return l?(o=e,r=i):(o=e.get,r=e.set),new mt(o,r,l||!r,n)}(e,0,Hr);function Kr(e,t,n){const o=arguments.length;return 2===o?y(t)&&!h(t)?yr(t)?Cr(e,null,[t]):Cr(e,t):Cr(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&yr(n)&&(n=[n]),Cr(e,t,n))}const Gr="3.4.5",Ur="undefined"!=typeof document?document:null,qr=Ur&&Ur.createElement("template"),Jr={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r="svg"===t?Ur.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?Ur.createElementNS("http://www.w3.org/1998/Math/MathML",e):Ur.createElement(e,n?{is:n}:void 0);return"select"===e&&o&&null!=o.multiple&&r.setAttribute("multiple",o.multiple),r},createText:e=>Ur.createTextNode(e),createComment:e=>Ur.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ur.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,i){const l=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{qr.innerHTML="svg"===o?`${e}`:"mathml"===o?`${e}`:e;const r=qr.content;if("svg"===o||"mathml"===o){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ei="transition",ti="animation",ni=Symbol("_vtc"),oi=(e,{slots:t})=>Kr(Rn,si(e),t);oi.displayName="Transition";const ri={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},ii=oi.props=c({},An,ri),li=(e,t=[])=>{h(e)?e.forEach((e=>e(...t))):e&&e(...t)},ai=e=>!!e&&(h(e)?e.some((e=>e.length>1)):e.length>1);function si(e){const t={};for(const c in e)c in ri||(t[c]=e[c]);if(!1===e.css)return t;const{name:n="v",type:o,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:l=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:s=i,appearActiveClass:u=l,appearToClass:d=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:f=`${n}-leave-to`}=e,g=function(e){if(null==e)return null;if(y(e))return[ci(e.enter),ci(e.leave)];{const t=ci(e);return[t,t]}}(r),m=g&&g[0],v=g&&g[1],{onBeforeEnter:b,onEnter:O,onEnterCancelled:w,onLeave:x,onLeaveCancelled:$,onBeforeAppear:S=b,onAppear:C=O,onAppearCancelled:k=w}=t,P=(e,t,n)=>{di(e,t?d:a),di(e,t?u:l),n&&n()},M=(e,t)=>{e._isLeaving=!1,di(e,p),di(e,f),di(e,h),t&&t()},T=e=>(t,n)=>{const r=e?C:O,l=()=>P(t,e,n);li(r,[t,l]),pi((()=>{di(t,e?s:i),ui(t,e?d:a),ai(r)||fi(t,o,m,l)}))};return c(t,{onBeforeEnter(e){li(b,[e]),ui(e,i),ui(e,l)},onBeforeAppear(e){li(S,[e]),ui(e,s),ui(e,u)},onEnter:T(!1),onAppear:T(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>M(e,t);ui(e,p),bi(),ui(e,h),pi((()=>{e._isLeaving&&(di(e,p),ui(e,f),ai(x)||fi(e,o,v,n))})),li(x,[e,n])},onEnterCancelled(e){P(e,!1),li(w,[e])},onAppearCancelled(e){P(e,!0),li(k,[e])},onLeaveCancelled(e){M(e),li($,[e])}})}function ci(e){const t=(e=>{const t=v(e)?Number(e):NaN;return isNaN(t)?e:t})(e);return t}function ui(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e[ni]||(e[ni]=new Set)).add(t)}function di(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const n=e[ni];n&&(n.delete(t),n.size||(e[ni]=void 0))}function pi(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let hi=0;function fi(e,t,n,o){const r=e._endId=++hi,i=()=>{r===e._endId&&o()};if(n)return setTimeout(i,n);const{type:l,timeout:a,propCount:s}=gi(e,t);if(!l)return o();const c=l+"end";let u=0;const d=()=>{e.removeEventListener(c,p),i()},p=t=>{t.target===e&&++u>=s&&d()};setTimeout((()=>{u(n[e]||"").split(", "),r=o(`${ei}Delay`),i=o(`${ei}Duration`),l=mi(r,i),a=o(`${ti}Delay`),s=o(`${ti}Duration`),c=mi(a,s);let u=null,d=0,p=0;return t===ei?l>0&&(u=ei,d=l,p=i.length):t===ti?c>0&&(u=ti,d=c,p=s.length):(d=Math.max(l,c),u=d>0?l>c?ei:ti:null,p=u?u===ei?i.length:s.length:0),{type:u,timeout:d,propCount:p,hasTransform:u===ei&&/\b(transform|all)(,|$)/.test(o(`${ei}Property`).toString())}}function mi(e,t){for(;e.lengthvi(t)+vi(e[n]))))}function vi(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function bi(){return document.body.offsetHeight}const yi=Symbol("_vod"),Oi={beforeMount(e,{value:t},{transition:n}){e[yi]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):wi(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),wi(e,!0),o.enter(e)):o.leave(e,(()=>{wi(e,!1)})):wi(e,t))},beforeUnmount(e,{value:t}){wi(e,t)}};function wi(e,t){e.style.display=t?e[yi]:"none"}const xi=Symbol(""),$i=/\s*!important$/;function Si(e,t,n){if(h(n))n.forEach((n=>Si(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=ki[t];if(n)return n;let o=M(t);if("filter"!==o&&o in e)return ki[t]=o;o=E(o);for(let r=0;r{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();Dt(function(e,t){if(h(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Ei||(Ai.then((()=>Ei=0)),Ei=Date.now()),n}(o,r);!function(e,t,n,o){e.addEventListener(t,n,o)}(e,n,l,a)}else l&&(function(e,t,n,o){e.removeEventListener(t,n,o)}(e,n,l,a),i[t]=void 0)}}const Ii=/(?:Once|Passive|Capture)$/;let Ei=0;const Ai=Promise.resolve(),Ri=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Di=new WeakMap,ji=new WeakMap,Bi=Symbol("_moveCb"),Ni=Symbol("_enterCb"),zi={name:"TransitionGroup",props:c({},ii,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Br(),o=In();let r,i;return qn((()=>{if(!r.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const o=e.cloneNode(),r=e[ni];r&&r.forEach((e=>{e.split(/\s+/).forEach((e=>e&&o.classList.remove(e)))})),n.split(/\s+/).forEach((e=>e&&o.classList.add(e))),o.style.display="none";const i=1===t.nodeType?t:t.parentNode;i.appendChild(o);const{hasTransform:l}=gi(o);return i.removeChild(o),l}(r[0].el,n.vnode.el,t))return;r.forEach(Li),r.forEach(Qi);const o=r.filter(Hi);bi(),o.forEach((e=>{const n=e.el,o=n.style;ui(n,t),o.transform=o.webkitTransform=o.transitionDuration="";const r=n[Bi]=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",r),n[Bi]=null,di(n,t))};n.addEventListener("transitionend",r)}))})),()=>{const l=pt(e),a=si(l);let s=l.tag||ar;r=i,i=t.default?_n(t.default()):[];for(let e=0;ee.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Fi.some((n=>e[`${n}Key`]&&!t.includes(n)))},Zi=(e,t)=>{const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(n,...o)=>{for(let e=0;e{const d="svg"===r;"class"===t?function(e,t,n){const o=e[ni];o&&(t=(t?[t,...o]:[...o]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,o,d):"style"===t?function(e,t,n){const o=e.style,r=v(n);if(n&&!r){if(t&&!v(t))for(const e in t)null==n[e]&&Si(o,e,"");for(const e in n)Si(o,e,n[e])}else{const i=o.display;if(r){if(t!==n){const e=o[xi];e&&(n+=";"+e),o.cssText=n}}else t&&e.removeAttribute("style");yi in e&&(o.display=i)}}(e,n,o):a(t)?s(t)||Ti(e,t,0,o,l):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){if(o)return"innerHTML"===t||"textContent"===t||!!(t in e&&Ri(t)&&m(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return(!Ri(t)||!v(n))&&t in e}(e,t,o,d))?function(e,t,n,o,r,i,l){if("innerHTML"===t||"textContent"===t)return o&&l(o,r,i),void(e[t]=null==n?"":n);const a=e.tagName;if("value"===t&&"PROGRESS"!==a&&!a.includes("-")){e._value=n;const o=null==n?"":n;return("OPTION"===a?e.getAttribute("value"):e.value)!==o&&(e.value=o),void(null==n&&e.removeAttribute(t))}let s=!1;if(""===n||null==n){const o=typeof e[t];"boolean"===o?n=V(n):null==n&&"string"===o?(n="",s=!0):"number"===o&&(n=0,s=!0)}try{e[t]=n}catch(c){}s&&e.removeAttribute(t)}(e,t,o,i,l,c,u):("true-value"===t?e._trueValue=o:"false-value"===t&&(e._falseValue=o),function(e,t,n,o,r){if(o&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(Pi,t.slice(6,t.length)):e.setAttributeNS(Pi,t,n);else{const o=Z(t);null==n||o&&!V(n)?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}(e,t,o,d))}},Jr);let Xi;function Yi(){return Xi||(Xi=Ko(Vi))}const Ki=(...e)=>{Yi().render(...e)},Gi=(...e)=>{const t=Yi().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=function(e){return v(e)?document.querySelector(e):e}(e);if(!o)return;const r=t._component;m(r)||r.render||r.template||(r.template=o.innerHTML),o.innerHTML="";const i=n(o,!1,function(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t}; /*! * pinia v2.1.7 @@ -18,4 +18,4 @@ var a0,s0;!function(e){class t{static encodeText(n,o){const r=e.QrSegment.makeSe * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -function p1(e){return"[object Object]"===Object.prototype.toString.call(e)}function h1(){return h1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(r[n]=e[n]);return r}const g1={silent:!1,logLevel:"warn"},m1=["validator"],v1=Object.prototype,b1=v1.toString,y1=v1.hasOwnProperty,O1=/^\s*function (\w+)/;function w1(e){var t;const n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){const e=n.toString().match(O1);return e?e[1]:""}return""}const x1=function(e){var t,n;return!1!==p1(e)&&(void 0===(t=e.constructor)||!1!==p1(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))};let $1=e=>e;const S1=(e,t)=>y1.call(e,t),C1=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},k1=Array.isArray||function(e){return"[object Array]"===b1.call(e)},P1=e=>"[object Function]"===b1.call(e),M1=(e,t)=>x1(e)&&S1(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),T1=e=>x1(e)&&(S1(e,"type")||["_vueTypes_name","validator","default","required"].some((t=>S1(e,t))));function I1(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function E1(e,t,n=!1){let o,r=!0,i="";o=x1(e)?e:{type:e};const l=M1(o)?o._vueTypes_name+" - ":"";if(T1(o)&&null!==o.type){if(void 0===o.type||!0===o.type)return r;if(!o.required&&null==t)return r;k1(o.type)?(r=o.type.some((e=>!0===E1(e,t,!0))),i=o.type.map((e=>w1(e))).join(" or ")):(i=w1(o),r="Array"===i?k1(t):"Object"===i?x1(t):"String"===i||"Number"===i||"Boolean"===i||"Function"===i?function(e){if(null==e)return"";const t=e.constructor.toString().match(O1);return t?t[1].replace(/^Async/,""):""}(t)===i:t instanceof o.type)}if(!r){const e=`${l}value "${t}" should be of type "${i}"`;return!1===n?($1(e),!1):e}if(S1(o,"validator")&&P1(o.validator)){const e=$1,i=[];if($1=e=>{i.push(e)},r=o.validator(t),$1=e,!r){const e=(i.length>1?"* ":"")+i.join("\n* ");return i.length=0,!1===n?($1(e),r):e}}return r}function A1(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(S1(this,"default")&&delete this.default,this):P1(e)||!0===E1(this,e,!0)?(this.default=k1(e)?()=>[...e]:x1(e)?()=>Object.assign({},e):e,this):($1(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:o}=n;return P1(o)&&(n.validator=I1(o,n)),n}function R1(e,t){const n=A1(e,t);return Object.defineProperty(n,"validate",{value(e){return P1(this.validator)&&$1(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=I1(e,this),this}})}function D1(e,t,n){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach((n=>{t[n]=Object.getOwnPropertyDescriptor(e,n)})),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!x1(n))return o;const{validator:r}=n,i=f1(n,m1);if(P1(r)){let{validator:e}=o;e&&(e=null!==(a=(l=e).__original)&&void 0!==a?a:l),o.validator=I1(e?function(t){return e.call(this,t)&&r.call(this,t)}:r,o)}var l,a;return Object.assign(o,i)}function j1(e){return e.replace(/^(?!\s*$)/gm," ")}const B1=()=>R1("any",{}),N1=()=>R1("boolean",{type:Boolean}),z1=()=>R1("string",{type:String}),_1=()=>R1("number",{type:Number}),L1=()=>R1("array",{type:Array}),Q1=()=>R1("object",{type:Object});function H1(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return A1(e.name||"<>",{type:null,validator(n){const o=e(n);return o||$1(`${this._vueTypes_name} - ${t}`),o}})}function F1(e){if(!k1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.map((e=>"symbol"==typeof e?e.toString():e)).join('", "')}".`,n={validator(n){const o=-1!==e.indexOf(n);return o||$1(t),o}};if(-1===e.indexOf(null)){const t=e.reduce(((e,t)=>{if(null!=t){const n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e}),[]);t.length>0&&(n.type=t)}return A1("oneOf",n)}function W1(e){if(!k1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=!1,o=[];for(let i=0;io.indexOf(e)===t));const r=!1===n&&o.length>0?o:null;return A1("oneOfType",t?{type:r,validator(t){const n=[],o=e.some((e=>{const o=E1(e,t,!0);return"string"==typeof o&&n.push(o),!0===o}));return o||$1(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${j1(n.join("\n"))}`),o}}:{type:r})}function Z1(e){return A1("arrayOf",{type:Array,validator(t){let n="";const o=t.every((t=>(n=E1(e,t,!0),!0===n)));return o||$1(`arrayOf - value validation error:\n${j1(n)}`),o}})}function V1(e){return A1("instanceOf",{type:e})}function X1(e){return A1("objectOf",{type:Object,validator(t){let n="";const o=Object.keys(t).every((o=>(n=E1(e,t[o],!0),!0===n)));return o||$1(`objectOf - value validation error:\n${j1(n)}`),o}})}function Y1(e){const t=Object.keys(e),n=t.filter((t=>{var n;return!(null===(n=e[t])||void 0===n||!n.required)})),o=A1("shape",{type:Object,validator(o){if(!x1(o))return!1;const r=Object.keys(o);if(n.length>0&&n.some((e=>-1===r.indexOf(e)))){const e=n.filter((e=>-1===r.indexOf(e)));return $1(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return r.every((n=>{if(-1===t.indexOf(n))return!0===this._vueTypes_isLoose||($1(`shape - shape definition does not include a "${n}" property. Allowed keys: "${t.join('", "')}".`),!1);const r=E1(e[n],o[n],!0);return"string"==typeof r&&$1(`shape - "${n}" property validation error:\n ${j1(r)}`),!0===r}))}});return Object.defineProperty(o,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(o,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),o}const K1=["name","validate","getter"],G1=(()=>{var e;return(e=class{static get any(){return B1()}static get func(){return R1("function",{type:Function}).def(this.defaults.func)}static get bool(){return void 0===this.defaults.bool?N1():N1().def(this.defaults.bool)}static get string(){return z1().def(this.defaults.string)}static get number(){return _1().def(this.defaults.number)}static get array(){return L1().def(this.defaults.array)}static get object(){return Q1().def(this.defaults.object)}static get integer(){return A1("integer",{type:Number,validator(e){const t=C1(e);return!1===t&&$1(`integer - "${e}" is not an integer`),t}}).def(this.defaults.integer)}static get symbol(){return A1("symbol",{validator(e){const t="symbol"==typeof e;return!1===t&&$1(`symbol - invalid value "${e}"`),t}})}static get nullable(){return Object.defineProperty({type:null,validator(e){const t=null===e;return!1===t&&$1("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"})}static extend(e){if($1("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),k1(e))return e.forEach((e=>this.extend(e))),this;const{name:t,validate:n=!1,getter:o=!1}=e,r=f1(e,K1);if(S1(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:i}=r;if(M1(i))return delete r.type,Object.defineProperty(this,t,o?{get:()=>D1(t,i,r)}:{value(...e){const n=D1(t,i,r);return n.validator&&(n.validator=n.validator.bind(n,...e)),n}});let l;return l=o?{get(){const e=Object.assign({},r);return n?R1(t,e):A1(t,e)},enumerable:!0}:{value(...e){const o=Object.assign({},r);let i;return i=n?R1(t,o):A1(t,o),o.validator&&(i.validator=o.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,l)}}).defaults={},e.sensibleDefaults=void 0,e.config=g1,e.custom=H1,e.oneOf=F1,e.instanceOf=V1,e.oneOfType=W1,e.arrayOf=Z1,e.objectOf=X1,e.shape=Y1,e.utils={validate:(e,t)=>!0===E1(t,e,!0),toType:(e,t,n=!1)=>n?R1(e,t):A1(e,t)},e})();!function(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){(class extends G1{static get sensibleDefaults(){return h1({},this.defaults)}static set sensibleDefaults(t){this.defaults=!1!==t?h1({},!0!==t?t:e):{}}}).defaults=h1({},e)}();const U1=Ln({__name:"AntdIcon",props:{modelValue:B1(),size:z1(),color:z1()},setup(e){const t=Ln({props:{value:B1(),size:z1(),color:z1()},setup:e=>()=>{const{value:t}=e;return t?Kr(t,{style:{fontSize:e.size,color:e.color}},{}):null}});return(n,o)=>(hr(),br(Ct(t),{value:e.modelValue,size:e.size,color:e.color},null,8,["value","size","color"]))}});var q1=(e=>(e[e.SpEl=1]="SpEl",e[e.Aviator=2]="Aviator",e[e.QL=3]="QL",e))(q1||{}),J1=(e=>(e[e["CRON表达式"]=1]="CRON表达式",e[e["固定时间"]=2]="固定时间",e))(J1||{}),e2=(e=>(e[e["丢弃"]=1]="丢弃",e[e["覆盖"]=2]="覆盖",e[e["并行"]=3]="并行",e))(e2||{}),t2=(e=>(e[e["跳过"]=1]="跳过",e[e["阻塞"]=2]="阻塞",e))(t2||{}),n2=(e=>(e[e["关闭"]=0]="关闭",e[e["开启"]=1]="开启",e))(n2||{}),o2=(e=>(e[e.and=1]="and",e[e.or=2]="or",e))(o2||{}),r2=(e=>(e[e["application/json"]=1]="application/json",e[e["application/x-www-form-urlencoded"]=2]="application/x-www-form-urlencoded",e))(r2||{});const i2={1:{title:"待处理",name:"waiting",color:"#64a6ea",icon:i0},2:{title:"运行中",name:"running",color:"#1b7ee5",icon:yN},3:{title:"成功",name:"success",color:"#087da1",icon:l$},4:{title:"失败",name:"fail",color:"#f52d80",icon:w$},5:{title:"停止",name:"stop",color:"#ac2df5",icon:WJ},6:{title:"取消",name:"cancel",color:"#f5732d",icon:yJ},98:{title:"判定未通过",name:"decision-failed",color:"#b63f1a",icon:cJ},99:{title:"跳过",name:"skip",color:"#00000036",icon:fJ}},l2={1:{name:"Java",color:"#d06892"}},a2={0:{name:"无",color:"#f5f5f5"},1:{name:"执行超时",color:"#64a6ea"},2:{name:"无客户端节点",color:"#1b7ee5"},3:{name:"任务已关闭",color:"#087da1"},4:{name:"任务丢弃",color:"#3a2f81"},5:{name:"任务被覆盖",color:"#c2238a"},6:{name:"无可执行任务项",color:"#23c28a"},7:{name:"任务执行期间发生非预期异常",color:"#bdc223"},8:{name:"手动停止",color:"#23c28a"},9:{name:"条件节点执行异常",color:"#23c28a"},10:{name:"任务中断",color:"#bdc223"},11:{name:"回调节点执行异常",color:"#bdc223"},12:{name:"无需处理",color:"#23c28a"},13:{name:"节点关闭跳过执行",color:"#3a2f81"},14:{name:"判定未通过",color:"#b63f1a"}},s2={2:{name:"运行中",color:"#1b7ee5"},3:{name:"成功",color:"#087da1"},4:{name:"失败",color:"#f52d80"},5:{name:"停止",color:"#ac2df5"},6:{name:"取消",color:"#7e7286"}},c2={DEBUG:{name:"DEBUG",color:"#2647cc"},INFO:{name:"INFO",color:"#5c962c"},WARN:{name:"WARN",color:"#da9816"},ERROR:{name:"ERROR",color:"#dc3f41"}},u2={0:{name:"关闭",color:"#dc3f41"},1:{name:"开启",color:"#1b7ee5"}},d2=(e=>{const t={};return Object.keys(e).forEach((n=>{const o=e[parseInt(n,10)];t[parseInt(n,10)]={name:o.title,color:o.color}})),t})(i2),p2={class:"log"},h2={class:"scroller"},f2={class:"index"},g2={class:"content"},m2={class:"line"},v2={class:"flex"},b2={class:"text",style:{color:"#2db7f5"}},y2={class:"text",style:{color:"#00a3a3"}},O2={class:"text",style:{color:"#a771bf","font-weight":"500"}},w2=(e=>(ln("data-v-b01a1bda"),e=e(),an(),e))((()=>Sr("div",{class:"text"},":",-1))),x2={class:"text",style:{"font-size":"16px"}},$2={class:"text",style:{"font-size":"16px"}},S2=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},C2=S2(Ln({__name:"LogModal",props:{open:N1().def(!1),record:Q1().def({}),modalValue:L1().def([])},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot([]);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modalValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=Ot();Gn((()=>{p()})),Jn((()=>{h()}));const a=()=>{h(),n("update:open",!1)},s=new AbortController,c=Ot(!1);let u=0,d=0;const p=()=>{d1(`/job/log/list?taskBatchId=${o.record.taskBatchId}&jobId=${o.record.jobId}&taskId=${o.record.id}&startId=${u}&fromIndex=${d}&size=50`,"get",void 0,s.signal).then((e=>{c.value=e.finished,u=e.nextStartId,d=e.fromIndex,e.message&&(i.value.push(...e.message),i.value.sort(((e,t)=>e.time_stamp-t.time_stamp))),c.value||(clearTimeout(l.value),l.value=setTimeout(p,1e3))})).catch((()=>{c.value=!0}))},h=()=>{c.value=!0,s.abort(),clearTimeout(l.value),l.value=void 0},f=e=>{const t=new Date(Number.parseInt(e.toString()));return`${t.getFullYear()}-${1===(t.getMonth()+1).toString().length?"0"+(t.getMonth()+1):(t.getMonth()+1).toString()}-${t.getDate()} ${t.getHours()}:${1===t.getMinutes().toString().length?"0"+t.getMinutes():t.getMinutes().toString()}:${1===t.getSeconds().toString().length?"0"+t.getSeconds():t.getSeconds().toString()}.${t.getMilliseconds()}`};return(e,t)=>{const n=fn("a-drawer");return hr(),vr("div",null,[Cr(n,{open:r.value,"onUpdate:open":t[0]||(t[0]=e=>r.value=e),height:"100vh",footer:null,title:"日志详情",placement:"bottom",destroyOnClose:"",bodyStyle:{padding:0},onClose:a},{default:sn((()=>[Sr("div",p2,[Sr("table",h2,[Sr("tbody",null,[(hr(!0),vr(ar,null,io(i.value,((e,t)=>(hr(),vr("tr",{key:t},[Sr("td",f2,X(t+1),1),Sr("td",null,[Sr("div",g2,[Sr("div",m2,[Sr("div",v2,[Sr("div",b2,X(f(e.time_stamp)),1),Sr("div",{class:"text",style:_({color:Ct(c2)[e.level].color})},X(4===e.level.length?e.level+" ":e.level),5),Sr("div",y2,"["+X(e.thread)+"]",1),Sr("div",O2,X(e.location),1),w2]),Sr("div",x2,X(e.message),1),Sr("div",$2,X(e.throwable),1)])])])])))),128))])])])])),_:1},8,["open"])])}}}),[["__scopeId","data-v-b01a1bda"]]),k2={key:0},P2={style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},M2=(e=>(ln("data-v-2a4ad4d5"),e=e(),an(),e))((()=>Sr("span",{style:{"padding-left":"18px"}},"任务项列表",-1))),T2={style:{"padding-left":"6px"}},I2=["onClick"],E2={key:0},A2=S2(Ln({__name:"DetailCard",props:{id:z1(),ids:L1().def([]),open:N1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=fo().slots,i=Od.PRESENTED_IMAGE_SIMPLE,l=u1(),a=Ot(!1),s=Ot(!1),c=Ot(!1),u=Ot(!1),d=Ot(1),p=Ot({}),h=Ot([]),f=Ot({current:1,defaultPageSize:10,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:e=>`共 ${e} 条`});wn((()=>o.open),(e=>{a.value=e}),{immediate:!0});const g=Ot([]);Gn((()=>{o.ids.length>1&&(document.querySelector(".ant-pagination-prev").title="上一个",document.querySelector(".ant-pagination-next").title="下一个"),g.value=o.ids,Zt((()=>{o.ids.length>0?(y(o.ids[0]),O(o.ids[0])):o.id&&(g.value=[p.value.taskBatchId],b(o.id),O(p.value.taskBatchId))}))}));const m=()=>{n("update:open",!1)},b=e=>{c.value=!0,d1(`/job/${e}`).then((e=>{p.value=e,c.value=!1}))},y=e=>{c.value=!0,d1(`/job/batch/${e}`).then((e=>{p.value=e,c.value=!1}))},O=(e,t=1)=>{u.value=!0,d1(`/job/task/list?groupName=${l.GROUP_NAME}&taskBatchId=${e??"0"}&page=${t}`).then((e=>{f.value.total=e.total,h.value=e.data,u.value=!1}))},w=Ot({}),x=e=>{const t=o.ids[e-1];y(t),O(t)},$=Ot([{title:"日志",dataIndex:"log",width:"5%"},{title:"ID",dataIndex:"id",width:"10%"},{title:"组名称",dataIndex:"groupName"},{title:"地址",dataIndex:"clientInfo"},{title:"参数",dataIndex:"argsStr",ellipsis:!0},{title:"结果",dataIndex:"resultMessage",ellipsis:!0},{title:"状态",dataIndex:"taskStatus"},{title:"重试次数",dataIndex:"retryCount"},{title:"开始执行时间",dataIndex:"createDt",sorter:!0,width:"12%"}]);return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-tag"),b=fn("a-descriptions"),y=fn("a-spin"),S=fn("a-button"),C=fn("a-table"),k=fn("a-tab-pane"),P=fn("a-tabs"),M=fn("a-empty"),T=fn("a-pagination"),I=fn("a-drawer");return hr(),vr(ar,null,[Cr(I,{title:"任务批次详情",placement:"right",width:800,open:a.value,"onUpdate:open":n[2]||(n[2]=e=>a.value=e),"destroy-on-close":"",onClose:m},lo({default:sn((()=>[g.value&&g.value.length>0?(hr(),vr("div",k2,[Cr(P,{activeKey:d.value,"onUpdate:activeKey":n[0]||(n[0]=e=>d.value=e),animated:""},{renderTabBar:sn((()=>[])),default:sn((()=>[(hr(!0),vr(ar,null,io(g.value,((e,n)=>(hr(),br(k,{key:n+1,tab:e},{default:sn((()=>[Cr(y,{spinning:c.value},{default:sn((()=>[Cr(b,{bordered:"",column:2},{default:sn((()=>[Cr(o,{label:"组名称"},{default:sn((()=>[Pr(X(p.value.groupName),1)])),_:1}),p.value.jobName?(hr(),br(o,{key:0,label:"任务名称"},{default:sn((()=>[Pr(X(p.value.jobName),1)])),_:1})):Mr("",!0),p.value.nodeName?(hr(),br(o,{key:1,label:"节点名称"},{default:sn((()=>[Pr(X(p.value.nodeName),1)])),_:1})):Mr("",!0),Cr(o,{label:"状态"},{default:sn((()=>[null!=p.value.taskBatchStatus?(hr(),br(l,{key:0,color:Ct(d2)[p.value.taskBatchStatus].color},{default:sn((()=>[Pr(X(Ct(d2)[p.value.taskBatchStatus].name),1)])),_:1},8,["color"])):Mr("",!0),null!=p.value.jobStatus?(hr(),br(l,{key:1,color:Ct(u2)[p.value.jobStatus].color},{default:sn((()=>[Pr(X(Ct(u2)[p.value.jobStatus].name),1)])),_:1},8,["color"])):Mr("",!0)])),_:1}),Ct(r).default?Mr("",!0):(hr(),br(o,{key:2,label:"执行器类型"},{default:sn((()=>[p.value.executorType?(hr(),br(l,{key:0,color:Ct(l2)[p.value.executorType].color},{default:sn((()=>[Pr(X(Ct(l2)[p.value.executorType].name),1)])),_:1},8,["color"])):Mr("",!0)])),_:1})),Cr(o,{label:"操作原因"},{default:sn((()=>[void 0!==p.value.operationReason?(hr(),br(l,{key:0,color:Ct(a2)[p.value.operationReason].color,style:_(0===p.value.operationReason?{color:"#1e1e1e"}:{})},{default:sn((()=>[Pr(X(Ct(a2)[p.value.operationReason].name),1)])),_:1},8,["color","style"])):Mr("",!0)])),_:1}),Ct(r).default?Mr("",!0):(hr(),br(o,{key:3,label:"执行器名称",span:2},{default:sn((()=>[Pr(X(p.value.executorInfo),1)])),_:1})),Cr(o,{label:"开始执行时间"},{default:sn((()=>[Pr(X(p.value.executionAt),1)])),_:1}),Cr(o,{label:"创建时间"},{default:sn((()=>[Pr(X(p.value.createDt),1)])),_:1})])),_:1})])),_:1},8,["spinning"]),ao(t.$slots,"default",{},void 0,!0),Sr("div",P2,[M2,Sr("span",T2,[Cr(S,{type:"text",icon:Kr(Ct(KJ)),onClick:t=>O(e)},null,8,["icon","onClick"])])]),Cr(C,{dataSource:h.value,columns:$.value,loading:u.value,scroll:{x:1200},"row-key":"id",onChange:t=>{return n=e,o=t,f.value=o,void O(n,o.current);var n,o},pagination:f.value},{bodyCell:sn((({column:e,record:t,text:n})=>["log"===e.dataIndex?(hr(),vr("a",{key:0,onClick:e=>{return n=t,w.value=n,void(s.value=!0);var n}},"点击查看",8,I2)):Mr("",!0),"taskStatus"===e.dataIndex?(hr(),vr(ar,{key:1},[n?(hr(),br(l,{key:0,color:Ct(s2)[n].color},{default:sn((()=>[Pr(X(Ct(s2)[n].name),1)])),_:2},1032,["color"])):Mr("",!0)],64)):Mr("",!0),"clientInfo"===e.dataIndex?(hr(),vr(ar,{key:2},[Pr(X(""!==n?n.split("@")[1]:""),1)],64)):Mr("",!0)])),_:2},1032,["dataSource","columns","loading","onChange","pagination"])])),_:2},1032,["tab"])))),128))])),_:3},8,["activeKey"])])):(hr(),br(M,{key:1,class:"empty",image:Ct(i),description:"暂无数据"},null,8,["image"]))])),_:2},[e.ids&&e.ids.length>0?{name:"footer",fn:sn((()=>[Cr(T,{style:{"text-align":"center"},current:d.value,"onUpdate:current":n[1]||(n[1]=e=>d.value=e),total:e.ids.length,pageSize:1,hideOnSinglePage:"",onChange:x},{itemRender:sn((({page:e,type:t,originalElement:n})=>{return["page"===t?(hr(),vr("a",E2,X(e),1)):(hr(),br((o=n,v(o)?mn(hn,o,!1)||o:o||gn),{key:1}))];var o})),_:1},8,["current","total"])])),key:"0"}:void 0]),1032,["open"]),s.value&&w.value?(hr(),br(C2,{key:0,open:s.value,"onUpdate:open":n[3]||(n[3]=e=>s.value=e),record:w.value},null,8,["open","record"])):Mr("",!0)],64)}}}),[["__scopeId","data-v-2a4ad4d5"]]),R2=e=>(ln("data-v-74f467a1"),e=e(),an(),e),D2={class:"add-node-btn-box"},j2={class:"add-node-btn"},B2={class:"add-node-popover-body"},N2={class:"icon"},z2=R2((()=>Sr("p",null,"任务节点",-1))),_2=R2((()=>Sr("p",null,"决策节点",-1))),L2=R2((()=>Sr("p",null,"回调通知",-1))),Q2=S2(Ln({__name:"AddNode",props:{modelValue:Q1(),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e=>{let t={};1===e?t={nodeName:"任务节点",nodeType:1,conditionNodes:[{nodeName:"任务1",failStrategy:1,priorityLevel:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}],childNode:o.modelValue}:2===e?t={nodeName:"决策节点",nodeType:2,conditionNodes:[{nodeName:"条件1",priorityLevel:1,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1,defaultDecision:0}},{nodeName:"其他情况",priorityLevel:2,decision:{expressionType:1,nodeExpression:"#true",logicalCondition:1,defaultDecision:1}}],childNode:o.modelValue}:3===e&&(t={nodeName:"回调通知",nodeType:3,conditionNodes:[{nodeName:"回调通知",workflowNodeStatus:1,callback:{webhook:void 0,contentType:void 0,secret:void 0}}],childNode:o.modelValue}),n("update:modelValue",t)};return(t,n)=>{const o=fn("a-button"),i=fn("a-popover");return hr(),vr("div",D2,[Sr("div",j2,[e.disabled?Mr("",!0):(hr(),br(i,{key:0,placement:"rightTop",trigger:"click","overlay-style":{width:"296px"}},{content:sn((()=>[Sr("div",B2,[Sr("ul",N2,[Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[0]||(n[0]=e=>r(1))},{default:sn((()=>[Cr(Ct(e0),{style:{color:"#3296fa"}})])),_:1}),z2]),Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[1]||(n[1]=e=>r(2))},{default:sn((()=>[Cr(Ct(_J),{style:{color:"#15bc83"}})])),_:1}),_2]),Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[2]||(n[2]=e=>r(3))},{default:sn((()=>[Cr(Ct(yL),{style:{color:"#935af6"}})])),_:1}),L2])])])])),default:sn((()=>[Cr(o,{type:"primary",icon:Kr(Ct(MI)),shape:"circle"},null,8,["icon"])])),_:1}))])])}}}),[["__scopeId","data-v-74f467a1"]]),H2=e=>{const t=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];"number"==typeof o&&t.push({name:n,value:o})}return t},F2=Ln({__name:"TaskDrawer",props:{open:N1().def(!1),len:_1().def(0),modelValue:Q1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=u1(),i=Ot(!1),l=Ot({}),a=Ot([]);Gn((()=>{a.value=r.JOB_LIST})),wn((()=>o.open),(e=>{i.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{l.value=e}),{immediate:!0,deep:!0});const s=()=>{n("update:modelValue",l.value)},c=Ot(),u=()=>{var e;null==(e=c.value)||e.validate().then((()=>{d(),n("save",l.value)})).catch((()=>{xB.warning("请检查表单信息")}))},d=()=>{n("update:open",!1),i.value=!1},p={failStrategy:[{required:!0,message:"请选择失败策略",trigger:"change"}],workflowNodeStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]},h=(e,t)=>{l.value.jobTask.jobName=t.title};return(t,n)=>{const o=fn("a-typography-paragraph"),r=fn("a-select-option"),f=fn("a-select"),g=fn("a-form-item"),m=fn("a-radio"),v=fn("a-radio-group"),b=fn("a-form"),y=fn("a-button"),O=fn("a-drawer");return hr(),br(O,{open:i.value,"onUpdate:open":n[5]||(n[5]=e=>i.value=e),"destroy-on-close":"",width:500,onClose:d},{title:sn((()=>[Cr(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:l.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>l.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:s},null,8,["content"])])),extra:sn((()=>[Cr(f,{value:l.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>l.value.priorityLevel=e),style:{width:"110px"}},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.len,(e=>(hr(),br(r,{key:e,value:e},{default:sn((()=>[Pr("优先级 "+X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:sn((()=>[Cr(y,{type:"primary",onClick:u},{default:sn((()=>[Pr("保存")])),_:1}),Cr(y,{style:{"margin-left":"12px"},onClick:d},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(b,{ref_key:"formRef",ref:c,rules:p,layout:"vertical",model:l.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(g,{name:["jobTask","jobId"],label:"所属任务",placeholder:"请选择任务",rules:[{required:!0,message:"请选择任务",trigger:"change"}]},{default:sn((()=>[Cr(f,{value:l.value.jobTask.jobId,"onUpdate:value":n[2]||(n[2]=e=>l.value.jobTask.jobId=e),onChange:h},{default:sn((()=>[(hr(!0),vr(ar,null,io(a.value,(e=>(hr(),br(r,{key:e.id,value:e.id,title:e.jobName},{default:sn((()=>[Pr(X(e.jobName),1)])),_:2},1032,["value","title"])))),128))])),_:1},8,["value"])])),_:1}),Cr(g,{name:"failStrategy",label:"失败策略"},{default:sn((()=>[Cr(v,{value:l.value.failStrategy,"onUpdate:value":n[3]||(n[3]=e=>l.value.failStrategy=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(t2)),(e=>(hr(),br(m,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(g,{name:"workflowNodeStatus",label:"节点状态"},{default:sn((()=>[Cr(v,{value:l.value.workflowNodeStatus,"onUpdate:value":n[4]||(n[4]=e=>l.value.workflowNodeStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(n2)),(e=>(hr(),br(m,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),W2=Ln({__name:"TaskDetail",props:{modelValue:Q1().def({}),open:N1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=u1(),i=Ot(!1);wn((()=>o.open),(e=>{i.value=e}),{immediate:!0});const l=()=>{n("update:open",!1)},a=e=>{var t;return null==(t=r.JOB_LIST.find((t=>t.id===e)))?void 0:t.jobName};return(t,n)=>{const o=fn("a-descriptions-item"),r=fn("a-descriptions"),s=fn("a-drawer");return hr(),br(s,{title:"任务详情",placement:"right",width:500,open:i.value,"onUpdate:open":n[0]||(n[0]=e=>i.value=e),"destroy-on-close":"",onClose:l},{default:sn((()=>[Cr(r,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"节点名称"},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(o,{label:"任务 ID"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.jobTask)?void 0:t.jobId),1)]})),_:1}),Cr(o,{label:"任务名称"},{default:sn((()=>{var t;return[Pr(X(a(null==(t=e.modelValue.jobTask)?void 0:t.jobId)),1)]})),_:1}),Cr(o,{label:"失败策略"},{default:sn((()=>[Pr(X(Ct(t2)[e.modelValue.failStrategy]),1)])),_:1}),Cr(o,{label:"工作流状态"},{default:sn((()=>[Pr(X(Ct(n2)[e.modelValue.workflowNodeStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),Z2=e=>(ln("data-v-7dad514a"),e=e(),an(),e),V2={class:"node-wrap"},X2={class:"branch-box"},Y2={class:"condition-node"},K2={class:"condition-node-box"},G2=["onClick"],U2=["onClick"],q2={class:"title"},J2={class:"text",style:{color:"#3296fa"}},e3={class:"priority-title"},t3={class:"content",style:{"min-height":"81px"}},n3={key:0,class:"placeholder"},o3=Z2((()=>Sr("span",{class:"content_label"},"任务名称: ",-1))),r3=Z2((()=>Sr("span",{class:"content_label"},"失败策略: ",-1))),i3=Z2((()=>Sr("div",null,".........",-1))),l3=["onClick"],a3={key:1,class:"top-left-cover-line"},s3={key:2,class:"bottom-left-cover-line"},c3={key:3,class:"top-right-cover-line"},u3={key:4,class:"bottom-right-cover-line"},d3=S2(Ln({__name:"TaskNode",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=u1(),i=Ot({});Ot({}),wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{var e;const t=i.value.conditionNodes.length+1;null==(e=i.value.conditionNodes)||e.push({nodeName:"任务"+t,priorityLevel:t,failStrategy:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}),n("update:modelValue",i.value)},a=(e,t)=>{e.childNode?a(e.childNode,t):e.childNode=t},s=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},c=Ot(0),u=Ot(!1),d=Ot({}),p=e=>{const t=i.value.conditionNodes[c.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[c.value]=e,t!==o&&s(c.value,o-t),n("update:modelValue",i.value)},h=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus&&i2[e.taskBatchStatus]?i2[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover",f=Ot(),g=Ot(),m=Ot(!1),v=Ot([]),b=(e,t)=>{var n,l,a,s;g.value=[],2===r.TYPE?(null==(n=e.jobBatchList)||n.sort(((e,t)=>e.taskBatchStatus-t.taskBatchStatus)).forEach((e=>{var t;e.id?null==(t=g.value)||t.push(e.id):e.jobId&&(f.value=e.jobId.toString())})),(null==(l=e.jobTask)?void 0:l.jobId)&&(f.value=null==(a=e.jobTask)?void 0:a.jobId.toString()),m.value=!0):1===r.TYPE?v.value[t]=!0:(s=t,o.disabled||(c.value=s,d.value=JSON.parse(JSON.stringify(i.value.conditionNodes[s])),u.value=!0))};return(t,o)=>{const c=fn("a-button"),y=fn("a-badge"),O=fn("a-typography-text"),w=fn("a-tooltip");return hr(),vr("div",V2,[Sr("div",X2,[e.disabled?Mr("",!0):(hr(),br(c,{key:0,class:"add-branch",primary:"",onClick:l},{default:sn((()=>[Pr("添加任务")])),_:1})),(hr(!0),vr(ar,null,io(i.value.conditionNodes,((o,l)=>{var c,u,d,p;return hr(),vr("div",{class:"col-box",key:l},[Sr("div",Y2,[Sr("div",K2,[Sr("div",{class:W(["auto-judge",h(o)]),style:{cursor:"pointer"},onClick:e=>b(o,l)},[0!=l?(hr(),vr("div",{key:0,class:"sort-left",onClick:Zi((e=>s(l,-1)),["stop"])},[Cr(Ct(BR))],8,U2)):Mr("",!0),Sr("div",q2,[Sr("span",J2,[Cr(y,{status:"processing",color:1===o.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Pr(" "+X(o.nodeName),1)]),Sr("span",e3,"优先级"+X(o.priorityLevel),1),e.disabled?Mr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Zi((e=>(e=>{var t;1===i.value.conditionNodes.length?(i.value.childNode&&(i.value.conditionNodes[0].childNode?a(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Zt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))):null==(t=i.value.conditionNodes)||t.splice(e,1)})(l)),["stop"])},null,8,["onClick"]))]),Sr("div",t3,[(null==(c=o.jobTask)?void 0:c.jobId)?Mr("",!0):(hr(),vr("div",n3,"请选择任务")),(null==(u=o.jobTask)?void 0:u.jobId)?(hr(),vr(ar,{key:1},[Sr("div",null,[o3,Cr(O,{style:{width:"126px"},ellipsis:"",content:`${null==(d=o.jobTask)?void 0:d.jobName}(${null==(p=o.jobTask)?void 0:p.jobId})`},null,8,["content"])]),Sr("div",null,[r3,Pr(X(Ct(t2)[o.failStrategy]),1)]),i3],64)):Mr("",!0)]),l!=i.value.conditionNodes.length-1?(hr(),vr("div",{key:1,class:"sort-right",onClick:Zi((e=>s(l)),["stop"])},[Cr(Ct(ok))],8,l3)):Mr("",!0),2===Ct(r).TYPE&&o.taskBatchStatus?(hr(),br(w,{key:2},{title:sn((()=>[Pr(X(Ct(i2)[o.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(U1),{class:"error-tip",color:Ct(i2)[o.taskBatchStatus].color,size:"24px",onClick:Zi((()=>{}),["stop"]),"model-value":Ct(i2)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Mr("",!0)],10,G2),Cr(Q2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?ao(t.$slots,"default",{key:0,node:o},void 0,!0):Mr("",!0),0==l?(hr(),vr("div",a3)):Mr("",!0),0==l?(hr(),vr("div",s3)):Mr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",c3)):Mr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",u3)):Mr("",!0),0!==Ct(r).type&&v.value[l]?(hr(),br(W2,{key:5,open:v.value[l],"onUpdate:open":e=>v.value[l]=e,modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):Mr("",!0)])})),128))]),i.value.conditionNodes.length>1?(hr(),br(Q2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):Mr("",!0),0===Ct(r).TYPE&&u.value?(hr(),br(F2,{key:1,open:u.value,"onUpdate:open":o[1]||(o[1]=e=>u.value=e),modelValue:d.value,"onUpdate:modelValue":o[2]||(o[2]=e=>d.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:p},null,8,["open","modelValue","len"])):Mr("",!0),0!==Ct(r).TYPE&&m.value?(hr(),br(Ct(A2),{key:2,open:m.value,"onUpdate:open":o[4]||(o[4]=e=>m.value=e),id:f.value,ids:g.value},null,8,["open","id","ids"])):Mr("",!0)])}}}),[["__scopeId","data-v-7dad514a"]]);class p3{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=w3(this,e,t);let o=[];return this.decompose(0,e,o,2),n.length&&n.decompose(0,n.length,o,3),this.decompose(t,this.length,o,1),f3.from(o,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=w3(this,e,t);let n=[];return this.decompose(e,t,n,0),f3.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),o=new v3(this),r=new v3(e);for(let i=t,l=t;;){if(o.next(i),r.next(i),i=0,o.lineBreak!=r.lineBreak||o.done!=r.done||o.value!=r.value)return!1;if(l+=o.value.length,o.done||l>=n)return!0}}iter(e=1){return new v3(this,e)}iterRange(e,t=this.length){return new b3(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let o=this.line(e).from;n=this.iterRange(o,Math.max(o,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new y3(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new h3(e):f3.from(h3.split(e,[])):p3.empty}}class h3 extends p3{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.text[r],l=o+i.length;if((t?n:l)>=e)return new O3(o,l,n,i);o=l+1,n++}}decompose(e,t,n,o){let r=e<=0&&t>=this.length?this:new h3(m3(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&o){let e=n.pop(),t=g3(r.text,e.text.slice(),0,r.length);if(t.length<=32)n.push(new h3(t,e.length+r.length));else{let e=t.length>>1;n.push(new h3(t.slice(0,e)),new h3(t.slice(e)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof h3))return super.replace(e,t,n);[e,t]=w3(this,e,t);let o=g3(this.text,g3(n.text,m3(this.text,0,e)),t),r=this.length+n.length-(t-e);return o.length<=32?new h3(o,r):f3.from(h3.split(o,[]),r)}sliceString(e,t=this.length,n="\n"){[e,t]=w3(this,e,t);let o="";for(let r=0,i=0;r<=t&&ie&&i&&(o+=n),er&&(o+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return o}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],o=-1;for(let r of e)n.push(r),o+=r.length+1,32==n.length&&(t.push(new h3(n,o)),n=[],o=-1);return o>-1&&t.push(new h3(n,o)),t}}class f3 extends p3{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.children[r],l=o+i.length,a=n+i.lines-1;if((t?a:l)>=e)return i.lineInner(e,t,n,o);o=l+1,n=a+1}}decompose(e,t,n,o){for(let r=0,i=0;i<=t&&r=i){let r=o&((i<=e?1:0)|(a>=t?2:0));i>=e&&a<=t&&!r?n.push(l):l.decompose(e-i,t-i,n,r)}i=a+1}}replace(e,t,n){if([e,t]=w3(this,e,t),n.lines=r&&t<=l){let a=i.replace(e-r,t-r,n),s=this.lines-i.lines+a.lines;if(a.lines>4&&a.lines>s>>6){let r=this.children.slice();return r[o]=a,new f3(r,this.length-(t-e)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=w3(this,e,t);let o="";for(let r=0,i=0;re&&r&&(o+=n),ei&&(o+=l.sliceString(e-i,t-i,n)),i=a+1}return o}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof f3))return 0;let n=0,[o,r,i,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=t,r+=t){if(o==i||r==l)return n;let a=this.children[o],s=e.children[r];if(a!=s)return n+a.scanIdentical(s,t);n+=a.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let n=0;for(let p of e)n+=p.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new h3(n,t)}let o=Math.max(32,n>>5),r=o<<1,i=o>>1,l=[],a=0,s=-1,c=[];function u(e){let t;if(e.lines>r&&e instanceof f3)for(let n of e.children)u(n);else e.lines>i&&(a>i||!a)?(d(),l.push(e)):e instanceof h3&&a&&(t=c[c.length-1])instanceof h3&&e.lines+t.lines<=32?(a+=e.lines,s+=e.length+1,c[c.length-1]=new h3(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>o&&d(),a+=e.lines,s+=e.length+1,c.push(e))}function d(){0!=a&&(l.push(1==c.length?c[0]:f3.from(c,s)),s=-1,a=c.length=0)}for(let p of e)u(p);return d(),1==l.length?l[0]:new f3(l,t)}}function g3(e,t,n=0,o=1e9){for(let r=0,i=0,l=!0;i=n&&(s>o&&(a=a.slice(0,o-r)),r0?1:(e instanceof h3?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,o=this.nodes[n],r=this.offsets[n],i=r>>1,l=o instanceof h3?o.text.length:o.children.length;if(i==(t>0?l:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(o instanceof h3){let r=o.text[i+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=o.children[i+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof h3?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class b3{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new v3(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*t,this.value=o.length<=n?o:t<0?o.slice(o.length-n):o.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class y3{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:o}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(p3.prototype[Symbol.iterator]=function(){return this.iter()},v3.prototype[Symbol.iterator]=b3.prototype[Symbol.iterator]=y3.prototype[Symbol.iterator]=function(){return this});class O3{constructor(e,t,n,o){this.from=e,this.to=t,this.number=n,this.text=o}get length(){return this.to-this.from}}function w3(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}let x3="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let Hpe=1;Hpee)return x3[t-1]<=e;return!1}function S3(e){return e>=127462&&e<=127487}function C3(e,t,n=!0,o=!0){return(n?k3:P3)(e,t,o)}function k3(e,t,n){if(t==e.length)return t;t&&M3(e.charCodeAt(t))&&T3(e.charCodeAt(t-1))&&t--;let o=I3(e,t);for(t+=A3(o);t=0&&S3(I3(e,o));)n++,o-=2;if(n%2==0)break;t+=2}}}return t}function P3(e,t,n){for(;t>0;){let o=k3(e,t-2,n);if(o=56320&&e<57344}function T3(e){return e>=55296&&e<56320}function I3(e,t){let n=e.charCodeAt(t);if(!T3(n)||t+1==e.length)return n;let o=e.charCodeAt(t+1);return M3(o)?o-56320+(n-55296<<10)+65536:n}function E3(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function A3(e){return e<65536?1:2}const R3=/\r\n?|\n/;var D3=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(D3||(D3={}));class j3{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-o);r+=l}else{if(n!=D3.Simple&&s>=e&&(n==D3.TrackDel&&oe||n==D3.TrackBefore&&oe))return null;if(s>e||s==e&&t<0&&!l)return e==o||t<0?r:r+a;r+=a}o=s}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return r}touchesRange(e,t=e){for(let n=0,o=0;n=0&&o<=t&&r>=e)return!(ot)||"cover";o=r}return!1}toString(){let e="";for(let t=0;t=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new j3(e)}static create(e){return new j3(e)}}class B3 extends j3{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return _3(this,((t,n,o,r,i)=>e=e.replace(o,o+(n-t),i)),!1),e}mapDesc(e,t=!1){return L3(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let o=0,r=0;o=0){t[o]=l,t[o+1]=i;let a=o>>1;for(;n.length0&&z3(n,t,r.text),r.forward(e),l+=e}let s=e[i++];for(;l>1].toJSON()))}return e}static of(e,t,n){let o=[],r=[],i=0,l=null;function a(e=!1){if(!e&&!o.length)return;il||e<0||l>t)throw new RangeError(`Invalid change range ${e} to ${l} (in doc of length ${t})`);let u=c?"string"==typeof c?p3.of(c.split(n||R3)):c:p3.empty,d=u.length;if(e==l&&0==d)return;ei&&N3(o,e-i,-1),N3(o,l-e,d),z3(r,o,u),i=l}}(e),a(!l),l}static empty(e){return new B3(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let o=0;ot&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;n.length=0&&n<=0&&n==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=n:o?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function z3(e,t,n){if(0==n.length)return;let o=t.length-2>>1;if(o>1])),!(n||l==e.sections.length||e.sections[l+1]<0);)a=e.sections[l++],s=e.sections[l++];t(r,c,i,u,d),r=c,i=u}}}function L3(e,t,n,o=!1){let r=[],i=o?[]:null,l=new H3(e),a=new H3(t);for(let s=-1;;)if(-1==l.ins&&-1==a.ins){let e=Math.min(l.len,a.len);N3(r,e,-1),l.forward(e),a.forward(e)}else if(a.ins>=0&&(l.ins<0||s==l.i||0==l.off&&(a.len=0&&s=0)){if(l.done&&a.done)return i?B3.createSet(r,i):j3.create(r);throw new Error("Mismatched change set lengths")}{let e=0,t=l.len;for(;t;)if(-1==a.ins){let n=Math.min(t,a.len);e+=n,t-=n,a.forward(n)}else{if(!(0==a.ins&&a.lene||l.ins>=0&&l.len>e)&&(a||o.length>t),i.forward2(e),l.forward(e)}}else N3(o,0,l.ins,a),r&&z3(r,o,l.text),l.next()}}class H3{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?p3.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?p3.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class F3{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,o;return this.empty?n=o=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),n==this.from&&o==this.to?this:new F3(n,o,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return W3.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return W3.range(this.anchor,n)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return W3.range(e.anchor,e.head)}static create(e,t,n){return new F3(e,t,n)}}class W3{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:W3.create(this.ranges.map((n=>n.map(e,t))),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new W3(e.ranges.map((e=>F3.fromJSON(e))),e.main)}static single(e,t=e){return new W3([W3.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,o=0;oe?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(n);for(let o=1;on.head?W3.range(l,i):W3.range(i,l))}}return new W3(e,t)}}function Z3(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let V3=0;class X3{constructor(e,t,n,o,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=o,this.id=V3++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new X3(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:Y3),!!e.static,e.enables)}of(e){return new K3([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new K3(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new K3(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(n=>t(n.field(e))))}}function Y3(e,t){return e==t||e.length==t.length&&e.every(((e,n)=>e===t[n]))}class K3{constructor(e,t,n,o){this.dependencies=e,this.facet=t,this.type=n,this.value=o,this.id=V3++}dynamicSlot(e){var t;let n=this.value,o=this.facet.compareInput,r=this.id,i=e[r]>>1,l=2==this.type,a=!1,s=!1,c=[];for(let u of this.dependencies)"doc"==u?a=!0:"selection"==u?s=!0:0==(1&(null!==(t=e[u.id])&&void 0!==t?t:1))&&c.push(e[u.id]);return{create:e=>(e.values[i]=n(e),1),update(e,t){if(a&&t.docChanged||s&&(t.docChanged||t.selection)||U3(e,c)){let t=n(e);if(l?!G3(t,e.values[i],o):!o(t,e.values[i]))return e.values[i]=t,1}return 0},reconfigure:(e,t)=>{let a,s=t.config.address[r];if(null!=s){let r=p4(t,s);if(this.dependencies.every((n=>n instanceof X3?t.facet(n)===e.facet(n):!(n instanceof e4)||t.field(n,!1)==e.field(n,!1)))||(l?G3(a=n(e),r,o):o(a=n(e),r)))return e.values[i]=r,0}else a=n(e);return e.values[i]=a,1}}}}function G3(e,t,n){if(e.length!=t.length)return!1;for(let o=0;oe[t.id])),r=n.map((e=>e.type)),i=o.filter((e=>!(1&e))),l=e[t.id]>>1;function a(e){let n=[];for(let t=0;te===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(J3).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let o=e.values[t],r=this.updateF(o,n);return this.compareF(o,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,J3.of({field:this,create:e})]}get extension(){return this}}const t4=4,n4=3,o4=2,r4=1;function i4(e){return t=>new a4(t,e)}const l4={highest:i4(0),high:i4(r4),default:i4(o4),low:i4(n4),lowest:i4(t4)};class a4{constructor(e,t){this.inner=e,this.prec=t}}class s4{of(e){return new c4(this,e)}reconfigure(e){return s4.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class c4{constructor(e,t){this.compartment=e,this.inner=t}}class u4{constructor(e,t,n,o,r,i){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=o,this.staticValues=r,this.facets=i,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let o=[],r=Object.create(null),i=new Map;for(let d of function(e,t,n){let o=[[],[],[],[],[]],r=new Map;function i(e,l){let a=r.get(e);if(null!=a){if(a<=l)return;let t=o[a].indexOf(e);t>-1&&o[a].splice(t,1),e instanceof c4&&n.delete(e.compartment)}if(r.set(e,l),Array.isArray(e))for(let t of e)i(t,l);else if(e instanceof c4){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");let o=t.get(e.compartment)||e.inner;n.set(e.compartment,o),i(o,l)}else if(e instanceof a4)i(e.inner,e.prec);else if(e instanceof e4)o[l].push(e),e.provides&&i(e.provides,l);else if(e instanceof K3)o[l].push(e),e.facet.extensions&&i(e.facet.extensions,o4);else{let t=e.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(t,l)}}return i(e,o4),o.reduce(((e,t)=>e.concat(t)))}(e,t,i))d instanceof e4?o.push(d):(r[d.facet.id]||(r[d.facet.id]=[])).push(d);let l=Object.create(null),a=[],s=[];for(let d of o)l[d.id]=s.length<<1,s.push((e=>d.slot(e)));let c=null==n?void 0:n.config.facets;for(let d in r){let e=r[d],t=e[0].facet,o=c&&c[d]||[];if(e.every((e=>0==e.type)))if(l[t.id]=a.length<<1|1,Y3(o,e))a.push(n.facet(t));else{let o=t.combine(e.map((e=>e.value)));a.push(n&&t.compare(o,n.facet(t))?n.facet(t):o)}else{for(let t of e)0==t.type?(l[t.id]=a.length<<1|1,a.push(t.value)):(l[t.id]=s.length<<1,s.push((e=>t.dynamicSlot(e))));l[t.id]=s.length<<1,s.push((n=>q3(n,t,e)))}}let u=s.map((e=>e(l)));return new u4(e,i,u,l,a,r)}}function d4(e,t){if(1&t)return 2;let n=t>>1,o=e.status[n];if(4==o)throw new Error("Cyclic dependency between fields and/or facets");if(2&o)return o;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function p4(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const h4=X3.define(),f4=X3.define({combine:e=>e.some((e=>e)),static:!0}),g4=X3.define({combine:e=>e.length?e[0]:void 0,static:!0}),m4=X3.define(),v4=X3.define(),b4=X3.define(),y4=X3.define({combine:e=>!!e.length&&e[0]});class O4{constructor(e,t){this.type=e,this.value=t}static define(){return new w4}}class w4{of(e){return new O4(this,e)}}class x4{constructor(e){this.map=e}of(e){return new $4(this,e)}}class $4{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new $4(this.type,t)}is(e){return this.type==e}static define(e={}){return new x4(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let o of e){let e=o.map(t);e&&n.push(e)}return n}}$4.reconfigure=$4.define(),$4.appendConfig=$4.define();class S4{constructor(e,t,n,o,r,i){this.startState=e,this.changes=t,this.selection=n,this.effects=o,this.annotations=r,this.scrollIntoView=i,this._doc=null,this._state=null,n&&Z3(n,t.newLength),r.some((e=>e.type==S4.time))||(this.annotations=r.concat(S4.time.of(Date.now())))}static create(e,t,n,o,r,i){return new S4(e,t,n,o,r,i)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(S4.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function C4(e,t){let n=[];for(let o=0,r=0;;){let i,l;if(o=e[o]))i=e[o++],l=e[o++];else{if(!(r=0;r--){let i=n[r](e);i&&Object.keys(i).length&&(o=k4(o,P4(t,i,e.changes.newLength),!0))}return o==e?e:S4.create(t,e.changes,e.selection,o.effects,o.annotations,o.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let r of t.facet(m4)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:C4(n,t))}if(!0!==n){let o,r;if(!1===n)r=e.changes.invertedDesc,o=B3.empty(t.doc.length);else{let t=e.changes.filter(n);o=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=S4.create(t,o,e.selection&&e.selection.map(r),$4.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let o=t.facet(v4);for(let r=o.length-1;r>=0;r--){let n=o[r](e);e=n instanceof S4?n:Array.isArray(n)&&1==n.length&&n[0]instanceof S4?n[0]:M4(t,I4(n),!1)}return e}(r):r)}S4.time=O4.define(),S4.userEvent=O4.define(),S4.addToHistory=O4.define(),S4.remote=O4.define();const T4=[];function I4(e){return null==e?T4:Array.isArray(e)?e:[e]}var E4=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(E4||(E4={}));const A4=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let R4;try{R4=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(Qpe){}function D4(e){return t=>{if(!/\S/.test(t))return E4.Space;if(function(e){if(R4)return R4.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||A4.test(n)))return!0}return!1}(t))return E4.Word;for(let n=0;n-1)return E4.Word;return E4.Other}}class j4{constructor(e,t,n,o,r,i){this.config=e,this.doc=t,this.selection=n,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=r,i&&(i._state=this);for(let l=0;lr.set(t,e))),n=null),r.set(l.value.compartment,l.value.extension)):l.is($4.reconfigure)?(n=null,o=l.value):l.is($4.appendConfig)&&(n=null,o=I4(o).concat(l.value));n?t=e.startState.values.slice():(n=u4.resolve(o,r,this),t=new j4(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values);let i=e.startState.facet(f4)?e.newSelection:e.newSelection.asSingle();new j4(n,e.newDoc,i,t,((t,n)=>n.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:W3.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),o=this.changes(n.changes),r=[n.range],i=I4(n.effects);for(let l=1;lt.spec.fromJSON(i,e))))}return j4.create({doc:e.doc,selection:W3.fromJSON(e.selection),extensions:t.extensions?o.concat([t.extensions]):o})}static create(e={}){let t=u4.resolve(e.extensions||[],new Map),n=e.doc instanceof p3?e.doc:p3.of((e.doc||"").split(t.staticFacet(j4.lineSeparator)||R3)),o=e.selection?e.selection instanceof W3?e.selection:W3.single(e.selection.anchor,e.selection.head):W3.single(0);return Z3(o,n.length),t.staticFacet(f4)||(o=o.asSingle()),new j4(t,n,o,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(j4.tabSize)}get lineBreak(){return this.facet(j4.lineSeparator)||"\n"}get readOnly(){return this.facet(y4)}phrase(e,...t){for(let n of this.facet(j4.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,n)=>{if("$"==n)return"$";let o=+(n||1);return!o||o>t.length?e:t[o-1]}))),e}languageDataAt(e,t,n=-1){let o=[];for(let r of this.facet(h4))for(let i of r(this,t,n))Object.prototype.hasOwnProperty.call(i,e)&&o.push(i[e]);return o}charCategorizer(e){return D4(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:o}=this.doc.lineAt(e),r=this.charCategorizer(e),i=e-n,l=e-n;for(;i>0;){let e=C3(t,i,!1);if(r(t.slice(e,i))!=E4.Word)break;i=e}for(;le.length?e[0]:4}),j4.lineSeparator=g4,j4.readOnly=y4,j4.phrases=X3.define({compare(e,t){let n=Object.keys(e),o=Object.keys(t);return n.length==o.length&&n.every((n=>e[n]==t[n]))}}),j4.languageData=h4,j4.changeFilter=m4,j4.transactionFilter=v4,j4.transactionExtender=b4,s4.reconfigure=$4.define();class N4{eq(e){return this==e}range(e,t=e){return z4.create(e,t,this)}}N4.prototype.startSide=N4.prototype.endSide=0,N4.prototype.point=!1,N4.prototype.mapMode=D3.TrackDel;let z4=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,o){return new e(t,n,o)}};function _4(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class L4{constructor(e,t,n,o){this.from=e,this.to=t,this.value=n,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,o=0){let r=n?this.to:this.from;for(let i=o,l=r.length;;){if(i==l)return i;let o=i+l>>1,a=r[o]-e||(n?this.value[o].endSide:this.value[o].startSide)-t;if(o==i)return a>=0?i:l;a>=0?l=o:i=o+1}}between(e,t,n,o){for(let r=this.findIndex(t,-1e9,!0),i=this.findIndex(n,1e9,!1,r);rc||s==c&&u.startSide>0&&u.endSide<=0)continue;(c-s||u.endSide-u.startSide)<0||(i<0&&(i=s),u.point&&(l=Math.max(l,c-s)),n.push(u),o.push(s-i),r.push(c-i))}return{mapped:n.length?new L4(o,r,n,l):null,pos:i}}}class Q4{constructor(e,t,n,o){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=o}static create(e,t,n,o){return new Q4(e,t,n,o)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:o=0,filterTo:r=this.length}=e,i=e.filter;if(0==t.length&&!i)return this;if(n&&(t=t.slice().sort(_4)),this.isEmpty)return t.length?Q4.of(t):this;let l=new W4(this,null,-1).goto(0),a=0,s=[],c=new H4;for(;l.value||a=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||s.push(e)}else 1==l.rangeIndex&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+i.length&&!1===i.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return Z4.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Z4.from(e).goto(t)}static compare(e,t,n,o,r=-1){let i=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),l=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),a=F4(i,l,n),s=new X4(i,a,r),c=new X4(l,a,r);n.iterGaps(((e,t,n)=>Y4(s,e,c,t,n,o))),n.empty&&0==n.length&&Y4(s,0,c,0,0,o)}static eq(e,t,n=0,o){null==o&&(o=999999999);let r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),i=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(r.length!=i.length)return!1;if(!r.length)return!0;let l=F4(r,i),a=new X4(r,l,0).goto(n),s=new X4(i,l,0).goto(n);for(;;){if(a.to!=s.to||!K4(a.active,s.active)||a.point&&(!s.point||!a.point.eq(s.point)))return!1;if(a.to>o)return!0;a.next(),s.next()}}static spans(e,t,n,o,r=-1){let i=new X4(e,null,r).goto(t),l=t,a=i.openStart;for(;;){let e=Math.min(i.to,n);if(i.point){let n=i.activeForPoint(i.to),r=i.pointFroml&&(o.span(l,e,i.active,a),a=i.openEnd(e));if(i.to>n)return a+(i.point&&i.to>n?1:0);l=i.to,i.next()}}static of(e,t=!1){let n=new H4;for(let o of e instanceof z4?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(_4);t=o}return e}(e):e)n.add(o.from,o.to,o.value);return n.finish()}static join(e){if(!e.length)return Q4.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let o=e[n];o!=Q4.empty;o=o.nextLayer)t=new Q4(o.chunkPos,o.chunk,t,Math.max(o.maxPoint,t.maxPoint));return t}}Q4.empty=new Q4([],[],null,-1),Q4.empty.nextLayer=Q4.empty;class H4{finishChunk(e){this.chunks.push(new L4(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new H4)).add(e,t,n)}addInner(e,t,n){let o=e-this.lastTo||n.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(o<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Q4.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=Q4.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function F4(e,t,n){let o=new Map;for(let i of e)for(let e=0;e=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&o.push(new W4(i,t,n,r));return 1==o.length?o[0]:new Z4(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)V4(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)V4(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),V4(this.heap,0)}}}function V4(e,t){for(let n=e[t];;){let o=1+(t<<1);if(o>=e.length)break;let r=e[o];if(o+1=0&&(r=e[o+1],o++),n.compare(r)<0)break;e[o]=n,e[t]=r,t=o}}class X4{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Z4.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){G4(this.active,e),G4(this.activeTo,e),G4(this.activeRank,e),this.minActive=q4(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:o,rank:r}=this.cursor;for(;t0;)t++;U4(this.active,t,n),U4(this.activeTo,t,o),U4(this.activeRank,t,r),e&&U4(e,t,this.cursor.from),this.minActive=q4(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let o=this.minActive;if(o>-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),n&&G4(n,o)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[t]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Y4(e,t,n,o,r,i){e.goto(t),n.goto(o);let l=o+r,a=o,s=o-t;for(;;){let t=e.to+s-n.to||e.endSide-n.endSide,o=t<0?e.to+s:n.to,r=Math.min(o,l);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&K4(e.activeForPoint(e.to),n.activeForPoint(n.to))||i.comparePoint(a,r,e.point,n.point):r>a&&!K4(e.active,n.active)&&i.compareRange(a,r,e.active,n.active),o>l)break;a=o,t<=0&&e.next(),t>=0&&n.next()}}function K4(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;o--)e[o+1]=e[o];e[t]=n}function q4(e,t){let n=-1,o=1e9;for(let r=0;r=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=C3(e,r)}return!0===o?-1:e.length}const t8="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),n8="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),o8="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class r8{constructor(e,t){this.rules=[];let{finish:n}=t||{};function o(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function r(e,t,i,l){let a=[],s=/^@(\w+)\b/.exec(e[0]),c=s&&"keyframes"==s[1];if(s&&null==t)return i.push(e[0]+";");for(let n in t){let l=t[n];if(/&/.test(n))r(n.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),l,i);else if(l&&"object"==typeof l){if(!s)throw new RangeError("The value of a property ("+n+") should be a primitive value.");r(o(n),l,a,c)}else null!=l&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+l+";")}(a.length||c)&&i.push((!n||s||l?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let i in e)r(o(i),e[i],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=o8[t8]||1;return o8[t8]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let o=e[n8],r=n&&n.nonce;o?r&&o.setNonce(r):o=new l8(e,r),o.mount(Array.isArray(t)?t:[t])}}let i8=new Map;class l8{constructor(e,t){let n=e.ownerDocument||e,o=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&o.CSSStyleSheet){let t=i8.get(n);if(t)return e.adoptedStyleSheets=[t.sheet,...e.adoptedStyleSheets],e[n8]=t;this.sheet=new o.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],i8.set(n,this)}else{this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let o=e.head||e;o.insertBefore(this.styleTag,o.firstChild)}this.modules=[],e[n8]=this}mount(e){let t=this.sheet,n=0,o=0;for(let r=0;r-1&&(this.modules.splice(l,1),o--,l=-1),-1==l){if(this.modules.splice(o++,0,i),t)for(let e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},c8="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),u8="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),d8=0;d8<10;d8++)a8[48+d8]=a8[96+d8]=String(d8);for(d8=1;d8<=24;d8++)a8[d8+111]="F"+d8;for(d8=65;d8<=90;d8++)a8[d8]=String.fromCharCode(d8+32),s8[d8]=String.fromCharCode(d8);for(var p8 in a8)s8.hasOwnProperty(p8)||(s8[p8]=a8[p8]);function h8(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function f8(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function g8(e,t){if(!t.anchorNode)return!1;try{return f8(e,t.anchorNode)}catch(Qpe){return!1}}function m8(e){return 3==e.nodeType?M8(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function v8(e,t,n,o){return!!n&&(y8(e,t,n,o,-1)||y8(e,t,n,o,1))}function b8(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function y8(e,t,n,o,r){for(;;){if(e==n&&t==o)return!0;if(t==(r<0?0:O8(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=b8(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?O8(e):0}}}function O8(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function w8(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function x8(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function $8(e,t){let n=t.width/e.offsetWidth,o=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(o>.995&&o<1.005||!isFinite(o)||Math.abs(t.height-e.offsetHeight)<1)&&(o=1),{scaleX:n,scaleY:o}}class S8{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?O8(t):0),n,Math.min(e.focusOffset,n?O8(n):0))}set(e,t,n,o){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=o}}let C8,k8=null;function P8(e){if(e.setActive)return e.setActive();if(k8)return e.focus(k8);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==k8?{get preventScroll(){return k8={preventScroll:!0},!0}}:void 0),!k8){k8=!1;for(let e=0;eMath.max(1,e.scrollHeight-e.clientHeight-4)}class A8{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new A8(e.parentNode,b8(e),t)}static after(e,t){return new A8(e.parentNode,b8(e)+1,t)}}const R8=[];class D8{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let n,o=this.dom,r=null;for(let i of this.children){if(7&i.flags){if(!i.dom&&(n=r?r.nextSibling:o.firstChild)){let e=D8.get(n);(!e||!e.parent&&e.canReuseDOM(i))&&i.reuseDOM(n)}i.sync(e,t),i.flags&=-8}if(n=r?r.nextSibling:o.firstChild,t&&!t.written&&t.node==o&&n!=i.dom&&(t.written=!0),i.dom.parentNode==o)for(;n&&n!=i.dom;)n=j8(n);else o.insertBefore(i.dom,n);r=i.dom}for(n=r?r.nextSibling:o.firstChild,n&&t&&t.node==o&&(t.written=!0);n;)n=j8(n)}else if(1&this.flags)for(let n of this.children)7&n.flags&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let o=0==O8(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==o&&t.firstChild!=t.lastChild&&(o=e==t.firstChild?-1:1),e=t}n=o<0?e:e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!D8.get(n);)n=n.nextSibling;if(!n)return this.length;for(let o=0,r=0;;o++){let e=this.children[o];if(e.dom==n)return r;r+=e.length+e.breakAfter}}domBoundsAround(e,t,n=0){let o=-1,r=-1,i=-1,l=-1;for(let a=0,s=n,c=n;at)return n.domBoundsAround(e,t,s);if(u>=e&&-1==o&&(o=a,r=s),s>t&&n.dom.parentNode==this.dom){i=a,l=c;break}c=u,s=u+n.breakAfter}return{from:r,to:l<0?n+this.length:l,startDOM:(o?this.children[o-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:i=0?this.children[i].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=R8){this.markDirty();for(let o=e;othis.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function N8(e,t,n,o,r,i,l,a,s){let{children:c}=e,u=c.length?c[t]:null,d=i.length?i[i.length-1]:null,p=d?d.breakAfter:l;if(!(t==o&&u&&!l&&!p&&i.length<2&&u.merge(n,r,i.length?d:null,0==n,a,s))){if(o0&&(!l&&i.length&&u.merge(n,u.length,i[0],!1,a,0)?u.breakAfter=i.shift().breakAfter:(n2);var G8={mac:K8||/Mac/.test(_8.platform),windows:/Win/.test(_8.platform),linux:/Linux|X11/.test(_8.platform),ie:W8,ie_version:H8?L8.documentMode||6:F8?+F8[1]:Q8?+Q8[1]:0,gecko:Z8,gecko_version:Z8?+(/Firefox\/(\d+)/.exec(_8.userAgent)||[0,0])[1]:0,chrome:!!V8,chrome_version:V8?+V8[1]:0,ios:K8,android:/Android\b/.test(_8.userAgent),webkit:X8,safari:Y8,webkit_version:X8?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=L8.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class U8 extends D8{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return!(8&this.flags||n&&(!(n instanceof U8)||this.length-(t-e)+n.length>256||8&n.flags)||(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),0))}split(e){let t=new U8(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new A8(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,n){let o=e.nodeValue.length;t>o&&(t=o);let r=t,i=t,l=0;0==t&&n<0||t==o&&n>=0?G8.chrome||G8.gecko||(t?(r--,l=1):i=0)?0:a.length-1];return G8.safari&&!l&&0==s.width&&(s=Array.prototype.find.call(a,(e=>e.width))||s),l?w8(s,l<0):s||null}(this.dom,e,t)}}class q8 extends D8{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let o of t)o.setParent(this)}setAttrs(e){if(I8(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof q8&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(o=r),n=i,r++}let i=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new q8(this.mark,t,i)}domAtPos(e){return t5(this,e)}coordsAt(e,t){return o5(this,e,t)}}class J8 extends D8{static create(e,t,n){return new J8(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=J8.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof J8&&this.widget.compare(n.widget))||e>0&&r<=0||t0)?A8.before(this.dom):A8.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let o=this.dom.getClientRects(),r=null;if(!o.length)return null;let i=this.side?this.side<0:e>0;for(let l=i?o.length-1:0;r=o[l],!(e>0?0==l:l==o.length-1||r.top0?A8.before(this.dom):A8.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return p3.empty}get isHidden(){return!0}}function t5(e,t){let n=e.dom,{children:o}=e,r=0;for(let i=0;ri&&t0;i--){let e=o[i-1];if(e.dom.parentNode==n)return e.domAtPos(e.length)}for(let i=r;i0&&t instanceof q8&&r.length&&(o=r[r.length-1])instanceof q8&&o.mark.eq(t.mark)?n5(o,t.children[0],n-1):(r.push(t),t.setParent(e)),e.length+=t.length}function o5(e,t,n){let o=null,r=-1,i=null,l=-1;!function e(t,a){for(let s=0,c=0;s=a&&(u.children.length?e(u,a-c):(!i||i.isHidden&&n>0)&&(d>a||c==d&&u.getSide()>0)?(i=u,l=a-c):(c-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let i of o)if(i!=n&&(-1==r.indexOf(i)||e[i]!==t[i]))return!1;return!0}function a5(e,t,n){let o=!1;if(t)for(let r in t)n&&r in n||(o=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(o=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return o}function s5(e){let t=Object.create(null);for(let n=0;n0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){l5(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){n5(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=r5(t,this.attrs||{})),n&&(this.attrs=r5({class:n},this.attrs||{}))}domAtPos(e){return t5(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?4&this.flags&&(I8(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(a5(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let o=this.dom.lastChild;for(;o&&D8.get(o)instanceof q8;)o=o.lastChild;if(!(o&&this.length&&("BR"==o.nodeName||0!=(null===(n=D8.get(o))||void 0===n?void 0:n.isEditable)||G8.ios&&this.children.some((e=>e instanceof U8))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e,t=0;for(let n of this.children){if(!(n instanceof U8)||/[^ -~]/.test(n.text))return null;let o=m8(n.dom);if(1!=o.length)return null;t+=o[0].width,e=o[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(e,t){let n=o5(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=n.bottom-n.top;if(Math.abs(t-e.lineHeight)<2&&e.textHeight=t){if(r instanceof c5)return r;if(i>t)break}o=i+r.breakAfter}return null}}class u5 extends D8{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof u5&&this.widget.compare(n.widget))||e>0&&r<=0||t0)}}class d5{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var p5=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(p5||(p5={}));class h5 extends N4{constructor(e,t,n,o){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=o}get heightRelevant(){return!1}static mark(e){return new f5(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new m5(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,o=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:r,end:i}=v5(e,o);t=(r?o?-3e8:-1:5e8)-1,n=1+(i?o?2e8:1:-6e8)}return new m5(e,t,n,o,e.widget||null,!0)}static line(e){return new g5(e)}static set(e,t=!1){return Q4.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}h5.none=Q4.empty;class f5 extends h5{constructor(e){let{start:t,end:n}=v5(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof f5&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(n=e.attrs)||void 0===n?void 0:n.class))&&l5(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}f5.prototype.point=!1;class g5 extends h5{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof g5&&this.spec.class==e.spec.class&&l5(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}g5.prototype.mapMode=D3.TrackBefore,g5.prototype.point=!0;class m5 extends h5{constructor(e,t,n,o,r,i){super(t,n,r,e),this.block=o,this.isReplace=i,this.mapMode=o?t<=0?D3.TrackBefore:D3.TrackAfter:D3.TrackDel}get type(){return this.startSide!=this.endSide?p5.WidgetRange:this.startSide<=0?p5.WidgetBefore:p5.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof m5&&(t=this.widget,n=e.widget,t==n||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,n}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function v5(e,t=!1){let{inclusiveStart:n,inclusiveEnd:o}=e;return null==n&&(n=e.inclusive),null==o&&(o=e.inclusive),{start:null!=n?n:t,end:null!=o?o:t}}function b5(e,t,n,o=0){let r=n.length-1;r>=0&&n[r]+o>=e?n[r]=Math.max(n[r],t):n.push(e,t)}m5.prototype.point=!0;class y5{constructor(e,t,n,o){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=o,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof u5&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new c5),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(O5(new e5(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof u5||this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:o}=this.cursor.next(this.skip);if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=t,this.textOff=0}let o=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(O5(new U8(this.text.slice(this.textOff,this.textOff+o)),t),n),this.atCursorPos=!0,this.textOff+=o,e-=o,n=0}}span(e,t,n,o){this.buildText(t-e,n,o),this.pos=t,this.openStart<0&&(this.openStart=o)}point(e,t,n,o,r,i){if(this.disallowBlockEffectsFor[i]&&n instanceof m5){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(n instanceof m5)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new u5(n.widget||new w5("div"),l,n));else{let i=J8.create(n.widget||new w5("span"),l,l?0:n.startSide),a=this.atCursorPos&&!i.isEditable&&r<=o.length&&(e0),s=!i.isEditable&&(eo.length||n.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||i.isEditable||(this.pendingBuffer=0),this.flushBuffer(o),a&&(c.append(O5(new e5(1),o),r),r=o.length+Math.max(0,r-o.length)),c.append(O5(i,o),r),this.atCursorPos=s,this.pendingBuffer=s?eo.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=o.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,o,r){let i=new y5(e,t,n,r);return i.openEnd=Q4.spans(o,t,n,i),i.openStart<0&&(i.openStart=i.openEnd),i.finish(i.openEnd),i}}function O5(e,t){for(let n of t)e=new q8(n,[e],e.length);return e}class w5 extends d5{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}var x5=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(x5||(x5={}));const $5=x5.LTR,S5=x5.RTL;function C5(e){let t=[];for(let n=0;n=t){if(l.level==n)return i;(r<0||(0!=o?o<0?l.fromt:e[r].level>l.level))&&(r=i)}}if(r<0)throw new RangeError("Index out of range");return r}}function R5(e,t){if(e.length!=t.length)return!1;for(let n=0;ns&&l.push(new A5(s,f.from,p)),B5(e,f.direction==$5!=!(p%2)?o+1:o,r,f.inner,f.from,f.to,l),s=f.to),h=f.to}else{if(h==n||(t?D5[h]!=a:D5[h]==a))break;h++}d?j5(e,s,h,o+1,r,d,l):st;){let n=!0,u=!1;if(!c||s>i[c-1].to){let e=D5[s-1];e!=a&&(n=!1,u=16==e)}let d=n||1!=a?null:[],p=n?o:o+1,h=s;e:for(;;)if(c&&h==i[c-1].to){if(u)break e;let f=i[--c];if(!n)for(let e=f.from,n=c;;){if(e==t)break e;if(!n||i[n-1].to!=e){if(D5[e-1]==a)break e;break}e=i[--n].from}d?d.push(f):(f.to=0;e-=3)if(T5[e+1]==-n){let t=T5[e+2],n=2&t?r:4&t?1&t?i:r:0;n&&(D5[l]=D5[T5[e]]=n),a=e;break}}else{if(189==T5.length)break;T5[a++]=l,T5[a++]=t,T5[a++]=s}else if(2==(o=D5[l])||1==o){let e=o==r;s=e?0:1;for(let t=a-3;t>=0;t-=3){let n=T5[t+2];if(2&n)break;if(e)T5[t+2]|=2;else{if(4&n)break;T5[t+2]|=4}}}}}(e,r,i,o,a),function(e,t,n,o){for(let r=0,i=o;r<=n.length;r++){let l=r?n[r-1].to:e,a=rs;)t==i&&(t=n[--o].from,i=o?n[o-1].to:e),D5[--t]=u;s=l}else i=l,s++}}}(r,i,o,a),j5(e,r,i,t,n,o,l)}function N5(e){return[new A5(0,e,0)]}let z5="";function _5(e,t,n,o,r){var i;let l=o.head-e.from,a=A5.find(t,l,null!==(i=o.bidiLevel)&&void 0!==i?i:-1,o.assoc),s=t[a],c=s.side(r,n);if(l==c){let e=a+=r?1:-1;if(e<0||e>=t.length)return null;s=t[a=e],l=s.side(!r,n),c=s.side(r,n)}let u=C3(e.text,l,s.forward(r,n));(us.to)&&(u=c),z5=e.text.slice(Math.min(l,u),Math.max(l,u));let d=a==(r?t.length-1:0)?null:t[a+(r?1:-1)];return d&&u==c&&d.level+(r?0:1)e.some((e=>e))}),K5=X3.define({combine:e=>e.some((e=>e))});class G5{constructor(e,t="nearest",n="nearest",o=5,r=5,i=!1){this.range=e,this.y=t,this.x=n,this.yMargin=o,this.xMargin=r,this.isSnapshot=i}map(e){return e.empty?this:new G5(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new G5(W3.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const U5=$4.define({map:(e,t)=>e.map(t)});function q5(e,t,n){let o=e.facet(W5);o.length?o[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)}const J5=X3.define({combine:e=>!e.length||e[0]});let e6=0;const t6=X3.define();class n6{constructor(e,t,n,o,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=o,this.extension=r(this)}static define(e,t){const{eventHandlers:n,eventObservers:o,provide:r,decorations:i}=t||{};return new n6(e6++,e,n,o,(e=>{let t=[t6.of(e)];return i&&t.push(l6.of((t=>{let n=t.plugin(e);return n?i(n):h5.none}))),r&&t.push(r(e)),t}))}static fromClass(e,t){return n6.define((t=>new e(t)),t)}}class o6{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(Lpe){if(q5(e.state,Lpe,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(Qpe){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(Lpe){q5(e.state,Lpe,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(Lpe){q5(e.state,Lpe,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const r6=X3.define(),i6=X3.define(),l6=X3.define(),a6=X3.define(),s6=X3.define(),c6=X3.define();function u6(e,t){let n=e.state.facet(c6);if(!n.length)return n;let o=n.map((t=>t instanceof Function?t(e):t)),r=[];return Q4.spans(o,t.from,t.to,{point(){},span(e,n,o,i){let l=e-t.from,a=n-t.from,s=r;for(let r=o.length-1;r>=0;r--,i--){let e,n=o[r].spec.bidiIsolate;if(null==n&&(n=L5(t.text,l,a)),i>0&&s.length&&(e=s[s.length-1]).to==l&&e.direction==n)e.to=a,s=e.inner;else{let e={from:l,to:a,direction:n,inner:[]};s.push(e),s=e.inner}}}}),r}const d6=X3.define();function p6(e){let t=0,n=0,o=0,r=0;for(let i of e.state.facet(d6)){let l=i(e);l&&(null!=l.left&&(t=Math.max(t,l.left)),null!=l.right&&(n=Math.max(n,l.right)),null!=l.top&&(o=Math.max(o,l.top)),null!=l.bottom&&(r=Math.max(r,l.bottom)))}return{left:t,right:n,top:o,bottom:r}}const h6=X3.define();class f6{constructor(e,t,n,o){this.fromA=e,this.toA=t,this.fromB=n,this.toB=o}join(e){return new f6(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let o=e[t-1];if(!(o.fromA>n.toA)){if(o.toAc)break;r+=2}if(!a)return n;new f6(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),i=a.toA,l=a.toB}}}class g6{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=B3.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let o=[];this.changes.iterChangedRanges(((e,t,n,r)=>o.push(new f6(e,t,n,r)))),this.changedRanges=o}static create(e,t,n){return new g6(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class m6 extends D8{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new c5],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new f6(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every((({fromA:e,toA:t})=>tthis.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let o=-1;this.view.inputState.composing>=0&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?o=this.domChanged.newSel.head:function(e,t){let n=!1;return t&&e.iterChangedRanges(((e,o)=>{et.from&&(n=!0)})),n}(e.changes,this.hasComposition)||e.selectionSet||(o=e.state.selection.main.head));let r=o>-1?function(e,t,n){let o=b6(e,n);if(!o)return null;let{node:r,from:i,to:l}=o,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(o.from,o.to)!=a)return null;let s=t.invertedDesc,c=new f6(s.mapPos(i),s.mapPos(l),i,l),u=[];for(let d=r.parentNode;;d=d.parentNode){let t=D8.get(d);if(t instanceof q8)u.push({node:d,deco:t.mark});else{if(t instanceof c5||"DIV"==d.nodeName&&d.parentNode==e.contentDOM)return{range:c,text:r,marks:u,line:d};if(d==e.contentDOM)return null;u.push({node:d,deco:new f5({inclusive:!0,attributes:s5(d),tagName:d.tagName.toLowerCase()})})}}}(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:o}=this.hasComposition;n=new f6(t,o,e.changes.mapPos(t,-1),e.changes.mapPos(o,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(G8.ie||G8.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=function(e,t,n){let o=new O6;return Q4.compare(e,t,n,o),o.changes}(this.decorations,this.updateDeco(),e.changes);return n=f6.extendWithRanges(n,i),!!(7&this.flags||0!=n.length)&&(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:o}=this.view;o.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=G8.chrome||G8.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||o.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((e=>e.flags&=-9));let r=[];if(this.view.viewport.from||this.view.viewport.to=0?o[i]:null;if(!e)break;let t,l,a,s,{fromA:c,toA:u,fromB:d,toB:p}=e;if(n&&n.range.fromBd){let e=y5.build(this.view.state.doc,d,n.range.fromB,this.decorations,this.dynamicDecorationMap),o=y5.build(this.view.state.doc,n.range.toB,p,this.decorations,this.dynamicDecorationMap);l=e.breakAtStart,a=e.openStart,s=o.openEnd;let r=this.compositionView(n);o.breakAtStart?r.breakAfter=1:o.content.length&&r.merge(r.length,r.length,o.content[0],!1,o.openStart,0)&&(r.breakAfter=o.content[0].breakAfter,o.content.shift()),e.content.length&&r.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),t=e.content.concat(r).concat(o.content)}else({content:t,breakAtStart:l,openStart:a,openEnd:s}=y5.build(this.view.state.doc,d,p,this.decorations,this.dynamicDecorationMap));let{i:h,off:f}=r.findPos(u,1),{i:g,off:m}=r.findPos(c,-1);N8(this,g,m,h,f,t,l,a,s)}n&&this.fixCompositionDOM(n)}compositionView(e){let t=new U8(e.text.nodeValue);t.flags|=8;for(let{deco:o}of e.marks)t=new q8(o,[t],t.length);let n=new c5;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|(t.children.some((e=>7&e.flags))?1:0),this.markedForComposition.add(t);let n=D8.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),o=this.children[n.i];t(e.line,o);for(let r=e.marks.length-1;r>=-1;r--)n=o.childPos(n.off,1),o=o.children[n.i],t(r>=0?e.marks[r].node:e.text,o)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let n=this.view.root.activeElement,o=n==this.dom,r=!o&&g8(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(o||t||r))return;let i=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),s=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(G8.gecko&&l.empty&&!this.hasComposition&&1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null))),a=s=new A8(e,0),i=!0}var c;let u=this.view.observer.selectionRange;!i&&u.focusNode&&(v8(a.node,a.offset,u.anchorNode,u.anchorOffset)&&v8(s.node,s.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,l))||(this.view.observer.ignore((()=>{G8.android&&G8.chrome&&this.dom.contains(u.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=h8(this.view.root);if(e)if(l.empty){if(G8.gecko){let e=(t=a.node,o=a.offset,1!=t.nodeType?0:(o&&"false"==t.childNodes[o-1].contentEditable?1:0)|(ol.head&&([a,s]=[s,a]),t.setEnd(s.node,s.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}var t,o;r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())})),this.view.observer.setSelectionRange(a,s)),this.impreciseAnchor=a.precise?null:new A8(u.anchorNode,u.anchorOffset),this.impreciseHead=s.precise?null:new A8(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&v8(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=h8(e.root),{anchorNode:o,anchorOffset:r}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let i=c5.find(this,t.head);if(!i)return;let l=i.posAtStart;if(t.head==l||t.head==l+i.length)return;let a=this.coordsAt(t.head,-1),s=this.coordsAt(t.head,1);if(!a||!s||a.bottom>s.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(o,r)}moveToLine(e){let t,n=this.dom;if(e.node!=n)return e;for(let o=e.offset;!t&&o=0;o--){let e=D8.get(n.childNodes[o]);e instanceof c5&&(t=e.domAtPos(e.length))}return t?new A8(t.node,t.offset,!0):e}nearest(e){for(let t=e;t;){let e=D8.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;i--){let l=this.children[i],a=r-l.breakAfter,s=a-l.length;if(ae||l.covers(1))&&(!n||l instanceof c5&&!(n instanceof c5&&t>=0))&&(n=l,o=s),r=s}return n?n.coordsAt(e-o,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),o=this.children[t];if(!(o instanceof c5))return null;for(;o.children.length;){let{i:e,off:t}=o.childPos(n,1);for(;;e++){if(e==o.children.length)return null;if((o=o.children[e]).length)break}n=t}if(!(o instanceof U8))return null;let r=C3(o.text,n);if(r==n)return null;let i=M8(o.dom,n,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==x5.LTR;for(let s=0,c=0;co)break;if(s>=n){let n=e.dom.getBoundingClientRect();if(t.push(n.height),i){let t=e.dom.lastChild,o=t?m8(t):[];if(o.length){let e=o[o.length-1],t=a?e.right-n.left:n.right-e.left;t>l&&(l=t,this.minWidth=r,this.minWidthFrom=s,this.minWidthTo=u)}}}s=u+e.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?x5.RTL:x5.LTR}measureTextSize(){for(let r of this.children)if(r instanceof c5){let e=r.measureTextSize();if(e)return e}let e,t,n,o=document.createElement("div");return o.className="cm-line",o.style.width="99999px",o.style.position="absolute",o.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(o);let r=m8(o.firstChild)[0];e=o.getBoundingClientRect().height,t=r?r.width/27:7,n=r?r.height:e,o.remove()})),{lineHeight:e,charWidth:t,textHeight:n}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new B8(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,o=0;;o++){let r=o==t.viewports.length?null:t.viewports[o],i=r?r.from-1:this.length;if(i>n){let o=(t.lineBlockAt(i).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(h5.replace({widget:new v6(o),block:!0,inclusive:!0,isBlockGap:!0}).range(n,i))}if(!r)break;n=r.to+1}return h5.set(e)}updateDeco(){let e=this.view.state.facet(l6).map(((e,t)=>(this.dynamicDecorationMap[t]="function"==typeof e)?e(this.view):e)),t=!1,n=this.view.state.facet(a6).map(((e,n)=>{let o="function"==typeof e;return o&&(t=!0),o?e(this.view):e}));n.length&&(this.dynamicDecorationMap[e.length]=t,e.push(Q4.join(n)));for(let o=e.length;on.anchor?-1:1);if(!o)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(o={left:Math.min(o.left,t.left),top:Math.min(o.top,t.top),right:Math.max(o.right,t.right),bottom:Math.max(o.bottom,t.bottom)});let r=p6(this.view),i={left:o.left-r.left,top:o.top-r.top,right:o.right+r.right,bottom:o.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;!function(e,t,n,o,r,i,l,a){let s=e.ownerDocument,c=s.defaultView||window;for(let u=e,d=!1;u&&!d;)if(1==u.nodeType){let e,p=u==s.body,h=1,f=1;if(p)e=x8(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:h,scaleY:f}=$8(u,t)),e={left:t.left,right:t.left+u.clientWidth*h,top:t.top,bottom:t.top+u.clientHeight*f}}let g=0,m=0;if("nearest"==r)t.top0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+m+l)):t.bottom>e.bottom&&(m=t.bottom-e.bottom+l,n<0&&t.top-m0&&t.right>e.right+g&&(g=t.right-e.right+g+i)):t.right>e.right&&(g=t.right-e.right+i,n<0&&t.left0))break;o=o.childNodes[r-1],r=O8(o)}if(n>=0)for(let o=e,r=t;;){if(3==o.nodeType)return{node:o,offset:r};if(!(1==o.nodeType&&r=0))break;o=o.childNodes[r],r=0}return null}let O6=class{constructor(){this.changes=[]}compareRange(e,t){b5(e,t,this.changes)}comparePoint(e,t){b5(e,t,this.changes)}};function w6(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function x6(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function $6(e,t){return e.topt.top+1}function S6(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function k6(e,t,n){let o,r,i,l,a,s,c,u,d=!1;for(let h=e.firstChild;h;h=h.nextSibling){let e=m8(h);for(let p=0;pm||l==m&&i>g){o=h,r=f,i=g,l=m;let a=m?n0?p0)}0==g?n>f.bottom&&(!c||c.bottomf.top)&&(s=h,u=f):c&&$6(c,f)?c=C6(c,f.bottom):u&&$6(u,f)&&(u=S6(u,f.top))}}if(c&&c.bottom>=n?(o=a,r=c):u&&u.top<=n&&(o=s,r=u),!o)return{node:e,offset:0};let p=Math.max(r.left,Math.min(r.right,t));return 3==o.nodeType?P6(o,p,n):d&&"false"!=o.contentEditable?k6(o,p,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,o)+(t>=(r.left+r.right)/2?1:0)}}function P6(e,t,n){let o=e.nodeValue.length,r=-1,i=1e9,l=0;for(let a=0;an?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&u=(c.left+c.right)/2,o=n;if((G8.chrome||G8.gecko)&&M8(e,a).getBoundingClientRect().left==c.right&&(o=!n),u<=0)return{node:e,offset:a+(o?1:0)};r=a+(o?1:0),i=u}}}return{node:e,offset:r>-1?r:l>0?e.nodeValue.length:0}}function M6(e,t,n,o=-1){var r,i;let l,a=e.contentDOM.getBoundingClientRect(),s=a.top+e.viewState.paddingTop,{docHeight:c}=e.viewState,{x:u,y:d}=t,p=d-s;if(p<0)return 0;if(p>c)return e.state.doc.length;for(let O=e.viewState.heightOracle.textHeight/2,w=!1;l=e.elementAtHeight(p),l.type!=p5.Text;)for(;p=o>0?l.bottom+O:l.top-O,!(p>=0&&p<=c);){if(w)return n?null:0;w=!0,o=-o}d=s+p;let h=l.from;if(he.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:T6(e,a,l,u,d);let f=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:f,m=g.elementFromPoint(u,d);m&&!e.contentDOM.contains(m)&&(m=null),m||(u=Math.max(a.left+1,Math.min(a.right-1,u)),m=g.elementFromPoint(u,d),m&&!e.contentDOM.contains(m)&&(m=null));let v,b=-1;if(m&&0!=(null===(r=e.docView.nearest(m))||void 0===r?void 0:r.isEditable))if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(u,d);e&&({offsetNode:v,offset:b}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(u,d);t&&(({startContainer:v,startOffset:b}=t),(!e.contentDOM.contains(v)||G8.safari&&function(e,t,n){let o;if(3!=e.nodeType||t!=(o=e.nodeValue.length))return!1;for(let r=e.nextSibling;r;r=r.nextSibling)if(1!=r.nodeType||"BR"!=r.nodeName)return!1;return M8(e,o-1,o).getBoundingClientRect().left>n}(v,b,u)||G8.chrome&&function(e,t,n){if(0!=t)return!1;for(let r=e;;){let e=r.parentNode;if(!e||1!=e.nodeType||e.firstChild!=r)return!1;if(e.classList.contains("cm-line"))break;r=e}let o=1==e.nodeType?e.getBoundingClientRect():M8(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect();return n-o.left>5}(v,b,u))&&(v=void 0))}if(!v||!e.docView.dom.contains(v)){let t=c5.find(e.docView,h);if(!t)return p>l.top+l.height/2?l.to:l.from;({node:v,offset:b}=k6(t.dom,u,d))}let y=e.docView.nearest(v);if(!y)return null;if(y.isWidget&&1==(null===(i=y.dom)||void 0===i?void 0:i.nodeType)){let e=y.dom.getBoundingClientRect();return t.y1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;i+=Math.floor((r-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let l=e.state.sliceDoc(n.from,n.to);return n.from+e8(l,i,e.state.tabSize)}function I6(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type))for(let o of n.type)if(o.to>t||o.to==t&&(o.to==n.to||o.type==p5.Text))return o;return n}function E6(e,t,n,o){let r=e.state.doc.lineAt(t.head),i=e.bidiSpans(r),l=e.textDirectionAt(r.from);for(let a=t,s=null;;){let t=_5(r,i,l,a,n),c=z5;if(!t){if(r.number==(n?e.state.doc.lines:1))return a;c="\n",r=e.state.doc.line(r.number+(n?1:-1)),i=e.bidiSpans(r),t=e.visualLineSide(r,!n)}if(s){if(!s(c))return a}else{if(!o)return t;s=o(c)}a=t}}function A6(e,t,n){for(;;){let o=0;for(let r of e)r.between(t-1,t+1,((e,r,i)=>{if(t>e&&tt(e))),n.from,t.head>n.from?-1:1);return o==n.from?n:W3.cursor(o,onull)),G8.gecko&&(t=e.contentDOM.ownerDocument,l7.has(t)||(l7.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{}))))}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,o=t.target;o!=e.contentDOM;o=o.parentNode)if(!o||11==o.nodeType||(n=D8.get(o))&&n.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let o of e){let e=o.spec;if(e&&e.domEventHandlers)for(let t in e.domEventHandlers){let r=e.domEventHandlers[t];r&&n(t).handlers.push(j6(o.value,r))}if(e&&e.domEventObservers)for(let t in e.domEventObservers){let r=e.domEventObservers[t];r&&n(t).observers.push(j6(o.value,r))}}for(let o in Q6)n(o).handlers.push(Q6[o]);for(let o in H6)n(o).observers.push(H6[o]);return t}(e),n=this.handlers,o=this.view.contentDOM;for(let r in t)if("scroll"!=r){let e=!t[r].handlers.length,i=n[r];i&&e!=!i.handlers.length&&(o.removeEventListener(r,this.handleEvent),i=null),i||o.addEventListener(r,this.handleEvent,{passive:e})}for(let r in n)"scroll"==r||t[r]||o.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&Date.now()t.keyCode==e.keyCode)))&&!e.ctrlKey||N6.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(){let e=this.pendingIOSKey;return!!e&&(this.pendingIOSKey=void 0,T8(this.view.contentDOM,e.key,e.keyCode))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(G8.safari&&!G8.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function j6(e,t){return(n,o)=>{try{return t.call(e,o,n)}catch(Lpe){q5(n.state,Lpe)}}}const B6=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],N6="dthko",z6=[16,17,18,20,91,92,224,225];function _6(e){return.7*Math.max(0,e)+8}class L6{constructor(e,t,n,o){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=function(e){let t=e.ownerDocument;for(let n=e.parentNode;n&&n!=t.body;)if(1==n.nodeType){if(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else{if(11!=n.nodeType)break;n=n.host}return null}(e.contentDOM),this.atoms=e.state.facet(s6).map((t=>t(e)));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(j4.allowMultipleSelections)&&function(e,t){let n=e.state.facet(Q5);return n.length?n[0](t):G8.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let o=h8(e.root);if(!o||0==o.rangeCount)return!0;let r=o.getRangeAt(0).getClientRects();for(let i=0;i=t.clientX&&e.top<=t.clientY&&e.bottom>=t.clientY)return!0}return!1}(e,t)||1!=e7(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t,n,o;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(n=this.startEvent,o=e,Math.max(Math.abs(n.clientX-o.clientX),Math.abs(n.clientY-o.clientY))<10))return;this.select(this.lastEvent=e);let r=0,i=0,l=(null===(t=this.scrollParent)||void 0===t?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},a=p6(this.view);e.clientX-a.left<=l.left+6?r=-_6(l.left-e.clientX):e.clientX+a.right>=l.right-6&&(r=_6(e.clientX-l.right)),e.clientY-a.top<=l.top+6?i=-_6(l.top-e.clientY):e.clientY+a.bottom>=l.bottom-6&&(i=_6(e.clientY-l.bottom)),this.setScrollSpeed(r,i)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nthis.select(this.lastEvent)),20)}}const Q6=Object.create(null),H6=Object.create(null),F6=G8.ie&&G8.ie_version<15||G8.ios&&G8.webkit_version<604;function W6(e,t){let n,{state:o}=e,r=1,i=o.toText(t),l=i.lines==o.selection.ranges.length;if(null!=n7&&o.selection.ranges.every((e=>e.empty))&&n7==i.toString()){let e=-1;n=o.changeByRange((n=>{let a=o.doc.lineAt(n.from);if(a.from==e)return{range:n};e=a.from;let s=o.toText((l?i.line(r++).text:t)+o.lineBreak);return{changes:{from:a.from,insert:s},range:W3.cursor(n.from+s.length)}}))}else n=l?o.changeByRange((e=>{let t=i.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:W3.cursor(e.from+t.length)}})):o.replaceSelection(i);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function Z6(e,t,n,o){if(1==o)return W3.cursor(t,n);if(2==o)return function(e,t,n=1){let o=e.charCategorizer(t),r=e.doc.lineAt(t),i=t-r.from;if(0==r.length)return W3.cursor(t);0==i?n=1:i==r.length&&(n=-1);let l=i,a=i;n<0?l=C3(r.text,i,!1):a=C3(r.text,i);let s=o(r.text.slice(l,a));for(;l>0;){let e=C3(r.text,l,!1);if(o(r.text.slice(e,l))!=s)break;l=e}for(;a{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},Q6.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&(e.inputState.lastEscPress=Date.now()),!1),H6.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},H6.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Q6.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let o of e.state.facet(F5))if(n=o(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=K6(e,t),o=e7(t),r=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),r=r.map(e.changes))},get(t,i,l){let a,s=K6(e,t),c=Z6(e,s.pos,s.bias,o);if(n.pos!=s.pos&&!i){let t=Z6(e,n.pos,n.bias,o),r=Math.min(t.from,c.from),i=Math.max(t.to,c.to);c=r1&&(a=function(e,t){for(let n=0;n=t)return W3.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(r,s.pos))?a:l?r.addRange(c):W3.create([c])}}}(e,t)),n){let o=!e.hasFocus;e.inputState.startMouseSelection(new L6(e,t,n,o)),o&&e.observer.ignore((()=>P8(e.contentDOM)));let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}return!1};let V6=(e,t)=>e>=t.top&&e<=t.bottom,X6=(e,t,n)=>V6(t,n)&&e>=n.left&&e<=n.right;function Y6(e,t,n,o){let r=c5.find(e.docView,t);if(!r)return 1;let i=t-r.posAtStart;if(0==i)return 1;if(i==r.length)return-1;let l=r.coordsAt(i,-1);if(l&&X6(n,o,l))return-1;let a=r.coordsAt(i,1);return a&&X6(n,o,a)?1:l&&V6(o,l)?-1:1}function K6(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:Y6(e,n,t.clientX,t.clientY)}}const G6=G8.ie&&G8.ie_version<=11;let U6=null,q6=0,J6=0;function e7(e){if(!G6)return e.detail;let t=U6,n=J6;return U6=e,J6=Date.now(),q6=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(q6+1)%3:1}function t7(e,t,n,o){if(!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:i}=e.inputState,l=o&&i&&function(e,t){let n=e.state.facet(H5);return n.length?n[0](t):G8.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:i.from,to:i.to}:null,a={from:r,insert:n},s=e.state.changes(l?[l,a]:a);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(r,-1),head:s.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Q6.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let o=e.docView.nearest(t.target);if(o&&o.isWidget){let e=o.posAtStart,t=e+o.length;(e>=n.to||t<=n.from)&&(n=W3.range(e,t))}}let{inputState:o}=e;return o.mouseSelection&&(o.mouseSelection.dragging=!0),o.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove"),!1},Q6.dragend=e=>(e.inputState.draggedContent=null,!1),Q6.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let o=Array(n.length),r=0,i=()=>{++r==n.length&&t7(e,t,o.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(o[e]=t.result),i()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return t7(e,t,n,!0),!0}return!1},Q6.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=F6?null:t.clipboardData;return n?(W6(e,n.getData("text/plain")||n.getData("text/uri-text")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{e.focus(),n.remove(),W6(e,n.value)}),50)}(e),!1)};let n7=null;Q6.copy=Q6.cut=(e,t)=>{let{text:n,ranges:o,linewise:r}=function(e){let t=[],n=[],o=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:o}of e.selection.ranges){let i=e.doc.lineAt(o);i.number>r&&(t.push(i.text),n.push({from:i.from,to:Math.min(e.doc.length,i.to+1)})),r=i.number}o=!0}return{text:t.join(e.lineBreak),ranges:n,linewise:o}}(e.state);if(!n&&!r)return!1;n7=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let i=F6?null:t.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let o=n.appendChild(document.createElement("textarea"));o.style.cssText="position: fixed; left: -10000px; top: 10px",o.value=t,o.focus(),o.selectionEnd=t.length,o.selectionStart=0,setTimeout((()=>{o.remove(),e.focus()}),50)}(e,n),!1)};const o7=O4.define();function r7(e,t){let n=[];for(let o of e.facet(X5)){let r=o(e,t);r&&n.push(r)}return n?e.update({effects:n,annotations:o7.of(!0)}):null}function i7(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=r7(e.state,t);n?e.dispatch(n):e.update([])}}),10)}H6.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),i7(e)},H6.blur=e=>{e.observer.clearSelectionRange(),i7(e)},H6.compositionstart=H6.compositionupdate=e=>{null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0)},H6.compositionend=e=>{e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,G8.chrome&&G8.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then((()=>e.observer.flush())):setTimeout((()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])}),50)},H6.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Q6.beforeinput=(e,t)=>{var n;let o;if(G8.chrome&&G8.android&&(o=B6.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(o.key,o.keyCode),"Backspace"==o.key||"Delete"==o.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}return!1};const l7=new Set,a7=["pre-wrap","normal","pre-line","break-spaces"];class s7{constructor(e){this.lineWrapping=e,this.doc=p3.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return a7.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=o,this.lineLength=r,a){this.heightSamples={};for(let e=0;e0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>p7&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return h7.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,o){let r=this,i=n.doc;for(let l=o.length-1;l>=0;l--){let{fromA:a,toA:s,fromB:c,toB:u}=o[l],d=r.lineAt(a,d7.ByPosNoHeight,n.setDoc(t),0,0),p=d.to>=s?d:r.lineAt(s,d7.ByPosNoHeight,n,0,0);for(u+=p.to-s,s=p.to;l>0&&d.from<=o[l-1].toA;)a=o[l-1].fromA,c=o[l-1].fromB,l--,a2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,o-=r.size}else{if(!(r>2*o))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}}else if(o=r&&i(this.blockAt(0,n,o,r))}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more&&this.setHeight(e,o.heights[o.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class g7 extends f7{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,o){return new u7(o,this.length,n,this.height,this.breaks)}replace(e,t,n){let o=n[0];return 1==n.length&&(o instanceof g7||o instanceof m7&&4&o.flags)&&Math.abs(this.length-o.length)<10?(o instanceof m7?o=new g7(o.length,this.height):o.height=this.height,this.outdated||(o.outdated=!1),o):h7.of(n)}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more?this.setHeight(e,o.heights[o.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class m7 extends h7{constructor(e){super(e,0)}heightMetrics(e,t){let n,o=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-o+1,l=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);n=t/i,this.length>i+1&&(l=(this.height-t)/(this.length-i-1))}else n=this.height/i;return{firstLine:o,lastLine:r,perLine:n,perChar:l}}blockAt(e,t,n,o){let{firstLine:r,lastLine:i,perLine:l,perChar:a}=this.heightMetrics(t,o);if(t.lineWrapping){let r=o+Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length),i=t.doc.lineAt(r),s=l+i.length*a,c=Math.max(n,e-s/2);return new u7(i.from,i.length,c,s,0)}{let o=Math.max(0,Math.min(i-r,Math.floor((e-n)/l))),{from:a,length:s}=t.doc.line(r+o);return new u7(a,s,n+l*o,l,0)}}lineAt(e,t,n,o,r){if(t==d7.ByHeight)return this.blockAt(e,n,o,r);if(t==d7.ByPosNoHeight){let{from:t,to:o}=n.doc.lineAt(e);return new u7(t,o-t,0,0,0)}let{firstLine:i,perLine:l,perChar:a}=this.heightMetrics(n,r),s=n.doc.lineAt(e),c=l+s.length*a,u=s.number-i,d=o+l*u+a*(s.from-r-u);return new u7(s.from,s.length,Math.max(o,Math.min(d,o+this.height-c)),c,0)}forEachLine(e,t,n,o,r,i){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:s}=this.heightMetrics(n,r);for(let c=e,u=o;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-l;u+=a*n+s*(e-r-n)}let o=a+s*t.length;i(new u7(t.from,t.length,u,o,0)),u+=o,c=t.to+1}}replace(e,t,n){let o=this.length-t;if(o>0){let e=n[n.length-1];e instanceof m7?n[n.length-1]=new m7(e.length+o):n.push(null,new m7(o-1))}if(e>0){let t=n[0];t instanceof m7?n[0]=new m7(e+t.length):n.unshift(new m7(e-1),null)}return h7.of(n)}decomposeLeft(e,t){t.push(new m7(e-1),null)}decomposeRight(e,t){t.push(null,new m7(this.length-e-1))}updateHeight(e,t=0,n=!1,o){let r=t+this.length;if(o&&o.from<=t+this.length&&o.more){let n=[],i=Math.max(t,o.from),l=-1;for(o.from>t&&n.push(new m7(o.from-t-1).updateHeight(e,t));i<=r&&o.more;){let t=e.doc.lineAt(i).length;n.length&&n.push(null);let r=o.heights[o.index++];-1==l?l=r:Math.abs(r-l)>=p7&&(l=-2);let a=new g7(t,r);a.outdated=!1,n.push(a),i+=t+1}i<=r&&n.push(null,new m7(r-i).updateHeight(e,i));let a=h7.of(n);return(l<0||Math.abs(a.height-this.height)>=p7||Math.abs(l-this.heightMetrics(e,t).perLine)>=p7)&&(e.heightChanged=!0),a}return(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class v7 extends h7{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,o){let r=n+this.left.height;return el))return s;let c=t==d7.ByPosNoHeight?d7.ByPosNoHeight:d7.ByPos;return a?s.join(this.right.lineAt(l,c,n,i,l)):this.left.lineAt(l,c,n,o,r).join(s)}forEachLine(e,t,n,o,r,i){let l=o+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,l,a,i);else{let s=this.lineAt(a,d7.ByPos,n,o,r);e=e&&s.from<=t&&i(s),t>s.to&&this.right.forEachLine(s.to+1,t,n,l,a,i)}}replace(e,t,n){let o=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-o,t-o,n));let r=[];e>0&&this.decomposeLeft(e,r);let i=r.length;for(let l of n)r.push(l);if(e>0&&b7(r,i-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,o=n+this.break;if(e>=o)return this.right.decomposeRight(e-o,t);e2*t.size||t.size>2*e.size?h7.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,o){let{left:r,right:i}=this,l=t+r.length+this.break,a=null;return o&&o.from<=t+r.length&&o.more?a=r=r.updateHeight(e,t,n,o):r.updateHeight(e,t,n),o&&o.from<=l+i.length&&o.more?a=i=i.updateHeight(e,l,n,o):i.updateHeight(e,l,n),a?this.balanced(r,i):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function b7(e,t){let n,o;null==e[t]&&(n=e[t-1])instanceof m7&&(o=e[t+1])instanceof m7&&e.splice(t-1,3,new m7(n.length+1+o.length))}class y7{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof g7?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new g7(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=5)&&this.addLineDeco(o,r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new g7(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new m7(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof g7)return e;let t=new g7(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let o=this.ensureLine();o.length+=n,o.collapsed+=n,o.widgetHeight=Math.max(o.widgetHeight,e),o.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof g7||this.isCovered?(this.writtenTot.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=n.overflow){let n=t.getBoundingClientRect();i=Math.max(i,n.left),l=Math.min(l,n.right),a=Math.max(a,n.top),s=c==e.parentNode?n.bottom:Math.min(s,n.bottom)}c="absolute"==n.position||"fixed"==n.position?t.offsetParent:t.parentNode}else{if(11!=c.nodeType)break;c=c.host}return{left:i-n.left,right:Math.max(i,l)-n.left,top:a-(n.top+t),bottom:Math.max(a,s)-(n.top+t)}}function x7(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class $7{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n"function"!=typeof e&&"cm-lineWrapping"==e.class));this.heightOracle=new s7(t),this.stateDeco=e.facet(l6).filter((e=>"function"!=typeof e)),this.heightMap=h7.empty().applyChanges(this.stateDeco,p3.empty,this.heightOracle.setDoc(e.doc),[new f6(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=h5.set(this.lineGaps.map((e=>e.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let o=n?t.head:t.anchor;if(!e.some((({from:e,to:t})=>o>=e&&o<=t))){let{from:t,to:n}=this.lineBlockAt(o);e.push(new k7(t,n))}}this.viewports=e.sort(((e,t)=>e.from-t.from)),this.scaler=this.heightMap.height<=7e6?I7:new E7(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(e=>{this.viewportLines.push(1==this.scaler.scale?e:A7(e,this.scaler))}))}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(l6).filter((e=>"function"!=typeof e));let o=e.changedRanges,r=f6.extendWithRanges(o,function(e,t,n){let o=new O7;return Q4.compare(e,t,n,o,0),o.changes}(n,this.stateDeco,e?e.changes:B3.empty(this.state.doc.length))),i=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=i&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let s=!e.changes.empty||2&e.flags||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),s&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(K5)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),o=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?x5.RTL:x5.LTR;let i=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=i||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let s=0,c=0;if(l.width&&l.height){let{scaleX:e,scaleY:n}=$8(t,l);this.scaleX==e&&this.scaleY==n||(this.scaleX=e,this.scaleY=n,s|=8,i=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,s|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(o.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,s|=8);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=E8(e.scrollDOM);let h=(this.printing?x7:w7)(t,this.paddingTop),f=h.top-this.pixelViewport.top,g=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let v=l.width;if(this.contentDOMWidth==v&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,s|=8),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(t)&&(i=!0),i||o.lineWrapping&&Math.abs(v-this.contentDOMWidth)>o.charWidth){let{lineHeight:n,charWidth:l,textHeight:a}=e.docView.measureTextSize();i=n>0&&o.refresh(r,n,l,a,v/l,t),i&&(e.docView.minWidth=0,s|=8)}f>0&&g>0?c=Math.max(f,g):f<0&&g<0&&(c=Math.min(f,g)),o.heightChanged=!1;for(let n of this.viewports){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(i?h7.empty().applyChanges(this.stateDeco,p3.empty,this.heightOracle,[new f6(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(o,0,i,new c7(n.from,r))}o.heightChanged&&(s|=2)}let b=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(2&s||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(i?[]:this.lineGaps,e)),s|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),s}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),o=this.heightMap,r=this.heightOracle,{visibleTop:i,visibleBottom:l}=this,a=new k7(o.lineAt(i-1e3*n,d7.ByHeight,r,0,0).from,o.lineAt(l+1e3*(1-n),d7.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(ea.to){let n,i=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),l=o.lineAt(e,d7.ByPos,r,0,0);n="center"==t.y?(l.top+l.bottom)/2-i/2:"start"==t.y||"nearest"==t.y&&e=l+Math.max(10,Math.min(n,250)))&&o>i-2e3&&r>1,i=o<<1;if(this.defaultTextDirection!=x5.LTR&&!n)return[];let l=[],a=(o,i,s,c)=>{if(i-oo&&ee.from>=s.from&&e.to<=s.to&&Math.abs(e.from-o)e.fromt))));if(!p){if(ie.from<=i&&e.to>=i))){let e=t.moveToLineBoundary(W3.cursor(i),!1,!0).head;e>o&&(i=e)}p=new $7(o,i,this.gapSize(s,o,i,c))}l.push(p)};for(let s of this.viewportLines){if(s.lengths.from&&a(s.from,t,s,e),re.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Q4.spans(e,this.viewport.from,this.viewport.to,{span(e,n){t.push({from:e,to:n})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,n)=>e.from!=t[n].from||e.to!=t[n].to));return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||A7(this.heightMap.lineAt(e,d7.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return A7(this.heightMap.lineAt(this.scaler.fromDOM(e),d7.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return A7(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class k7{constructor(e,t){this.from=e,this.to=t}}function P7(e,t,n){let o=[],r=e,i=0;return Q4.spans(n,e,t,{span(){},point(e,t){e>r&&(o.push({from:r,to:e}),i+=e-r),r=t}},20),r=1)return t[t.length-1].to;let o=Math.floor(e*n);for(let r=0;;r++){let{from:e,to:n}=t[r],i=n-e;if(o<=i)return e+o;o-=i}}function T7(e,t){let n=0;for(let{from:o,to:r}of e.ranges){if(t<=r){n+=t-o;break}n+=r-o}return n/e.total}const I7={toDOM:e=>e,fromDOM:e=>e,scale:1};class E7{constructor(e,t,n){let o=0,r=0,i=0;this.viewports=n.map((({from:n,to:r})=>{let i=t.lineAt(n,d7.ByPos,e,0,0).top,l=t.lineAt(r,d7.ByPos,e,0,0).bottom;return o+=l-i,{from:n,to:r,top:i,bottom:l,domTop:0,domBottom:0}})),this.scale=(7e6-o)/(t.height-o);for(let l of this.viewports)l.domTop=i+(l.top-r)*this.scale,i=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,n=0,o=0;;t++){let r=tA7(e,t))):e._content)}const R7=X3.define({combine:e=>e.join(" ")}),D7=X3.define({combine:e=>e.indexOf(!0)>-1}),j7=r8.newName(),B7=r8.newName(),N7=r8.newName(),z7={"&light":"."+B7,"&dark":"."+N7};function _7(e,t,n){return new r8(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]})):e+" "+t})}const L7=_7("."+j7,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},z7),Q7="￿";class H7{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(j4.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Q7}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let o=e;;){this.findPointBefore(n,o);let e=this.text.length;this.readNode(o);let r=o.nextSibling;if(r==t)break;let i=D8.get(o),l=D8.get(r);(i&&l?i.breakAfter:(i?i.breakAfter:W7(o))||W7(r)&&("BR"!=o.nodeName||o.cmIgnore)&&this.text.length>e)&&this.lineBreak(),o=r}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let r,i=-1,l=1;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),l=this.lineSeparator.length):(r=o.exec(t))&&(i=r.index,l=r[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),l>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=l-1);n=i+l}}readNode(e){if(e.cmIgnore)return;let t=D8.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(F7(e,n.node,n.offset)?t:0))}}function F7(e,t,n){for(;;){if(!t||n-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=r||i?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}=e.observer.selectionRange;return n&&(t.push(new Z7(n,o)),r==n&&i==o||t.push(new Z7(r,i))),t}(e),n=new H7(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,o=2==e.length?e[1].pos:n;return n>-1&&o>-1?W3.single(n+t,o+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!f8(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),o=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!f8(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),l=e.viewport;if(G8.ios&&e.state.selection.main.empty&&n!=o&&(l.from>0||l.toDate.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=r.from,s=null;(8===i||G8.android&&t.text.length0&&a>0&&e.charCodeAt(l-1)==t.charCodeAt(a-1);)l--,a--;return"end"==o&&(n-=l+Math.max(0,i-Math.min(l,a))-i),l=l?i-n:0,a=i+(a-l),l=i):a=a?i-n:0,l=i+(l-a),a=i),{from:i,toA:l,toB:a}}(e.state.doc.sliceString(o,l,Q7),t.text,a-o,s);c&&(G8.chrome&&13==i&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==Q7+Q7&&c.toB--,n={from:o+c.from,to:o+c.toA,insert:p3.of(t.text.slice(c.from,c.toB).split(Q7))})}else o&&(!e.hasFocus&&e.state.facet(J5)||o.main.eq(r))&&(o=null);if(!n&&!o)return!1;if(!n&&t.typeOver&&!r.empty&&o&&o.main.empty?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,r.to)}:n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,r.to))}:(G8.mac||G8.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(o&&2==n.insert.length&&(o=W3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:p3.of([" "])}):G8.chrome&&n&&n.from==n.to&&n.from==r.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(o&&(o=W3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:p3.of([" "])}),n){if(G8.ios&&e.inputState.flushIOSKey())return!0;if(G8.android&&(n.from==r.from&&n.to==r.to&&1==n.insert.length&&2==n.insert.lines&&T8(e.contentDOM,"Enter",13)||(n.from==r.from-1&&n.to==r.to&&0==n.insert.length||8==i&&n.insert.lengthr.head)&&T8(e.contentDOM,"Backspace",8)||n.from==r.from&&n.to==r.to+1&&0==n.insert.length&&T8(e.contentDOM,"Delete",46)))return!0;let t,l=n.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>t||(t=function(e,t,n){let o,r=e.state,i=r.selection.main;if(t.from>=i.from&&t.to<=i.to&&t.to-t.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=i.fromt.to?r.sliceDoc(t.to,i.to):"";o=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+l))}else{let l=r.changes(t),a=n&&n.main.to<=l.newLength?n.main:void 0;if(r.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=i.to&&t.to>=i.to-10){let s,c=e.state.sliceDoc(t.from,t.to),u=n&&b6(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);s={from:u.from,to:u.to-e}}else s=e.state.doc.lineAt(i.head);let d=i.to-t.to,p=i.to-i.from;o=r.changeByRange((n=>{if(n.from==i.from&&n.to==i.to)return{changes:l,range:a||n.map(l)};let o=n.to-d,u=o-c.length;if(n.to-n.from!=p||e.state.sliceDoc(u,o)!=c||n.to>=s.from&&n.from<=s.to)return{range:n};let h=r.changes({from:u,to:o,insert:t.insert}),f=n.to-i.to;return{changes:h,range:a?W3.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(h)}}))}else o={changes:l,selection:a&&r.selection.replaceRange(a)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(o,{userEvent:l,scrollIntoView:!0})}(e,n,o));return e.state.facet(V5).some((t=>t(e,n.from,n.to,l,a)))||e.dispatch(a()),!0}if(o&&!o.main.eq(r)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:o,scrollIntoView:t,userEvent:n}),!0}return!1}const Y7={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},K7=G8.ie&&G8.ie_version<=11;class G7{constructor(e){this.view=e,this.active=!1,this.selectionRange=new S8,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(G8.ie&&G8.ie_version<=11||G8.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),K7&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,n)=>t!=e[n])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,o=this.selectionRange;if(n.state.facet(J5)?n.root.activeElement!=this.dom:!g8(n.dom,o))return;let r=o.anchorNode&&n.docView.nearest(o.anchorNode);r&&r.ignoreEvent(e)?t||(this.selectionChanged=!1):(G8.ie&&G8.ie_version<=11||G8.android&&G8.chrome)&&!n.state.selection.main.empty&&o.focusNode&&v8(o.focusNode,o.focusOffset,o.anchorNode,o.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=G8.safari&&11==e.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e){let t=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;let o=t.startContainer,r=t.startOffset,i=t.endContainer,l=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);return v8(a.node,a.offset,i,l)&&([o,r,i,l]=[i,l,o,r]),{anchorNode:o,anchorOffset:r,focusNode:i,focusOffset:l}}(this.view)||h8(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=g8(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&T8(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,o=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(o=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:o}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),o=this.selectionChanged&&g8(this.dom,this.selectionRange);if(e<0&&!o)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new V7(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,o=X7(this.view,t);return this.view.state==n&&this.view.update([]),o}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let n=U7(t,e.previousSibling||e.target.previousSibling,-1),o=U7(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:o?t.posBefore(o):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let o of this.scrollTargets)o.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function U7(e,t,n){for(;t;){let o=D8.get(t);if(o&&o.parent==e)return o;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}class q7{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach((e=>t(e,this))))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new C7(e.state||j4.create(e)),e.scrollTo&&e.scrollTo.is(U5)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(t6).map((e=>new o6(e)));for(let n of this.plugins)n.update(this);this.observer=new G7(this),this.inputState=new D6(this),this.inputState.ensureHandlers(this.plugins),this.docView=new m6(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=1==e.length&&e[0]instanceof S4?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,o=!1,r=this.state;for(let d of e){if(d.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=d.state}if(this.destroyed)return void(this.viewState.state=r);let i=this.hasFocus,l=0,a=null;e.some((e=>e.annotation(o7)))?(this.inputState.notifiedFocused=i,l=1):i!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=i,a=r7(r,i),a||(l=1));let s=this.observer.delayedAndroidKey,c=null;if(s?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(j4.phrases)!=this.state.facet(j4.phrases))return this.setState(r);t=g6.create(this,r,e),t.flags|=l;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new G5(e.empty?e:W3.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(U5)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=t9.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(h6)!=this.styleModules&&this.mountStyles(),o=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(R7)!=t.state.facet(R7)&&(this.viewState.mustMeasureContent=!0),(n||o||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!t.empty)for(let d of this.state.facet(Z5))try{d(t)}catch(Lpe){q5(this.state,Lpe,"update listener")}(a||c)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!X7(this,c)&&s.force&&T8(this.contentDOM,s.key,s.keyCode)}))}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new C7(e),this.plugins=e.facet(t6).map((e=>new o6(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new m6(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(t6),n=e.state.facet(t6);if(t!=n){let o=[];for(let r of n){let n=t.indexOf(r);if(n<0)o.push(new o6(r));else{let t=this.plugins[n];t.mustUpdate=e,o.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=e;for(let o=0;o-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,o=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:i}=this.viewState;Math.abs(o-this.viewState.scrollTop)>1&&(i=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(i<0)if(E8(n))r=-1,i=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(o);r=e.from,i=e.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5)break;let a=[];4&l||([this.measureRequests,a]=[a,this.measureRequests]);let s=a.map((e=>{try{return e.read(this)}catch(Lpe){return q5(this.state,Lpe),e9}})),c=g6.create(this,this.state,[]),u=!1;c.flags|=l,t?t.flags|=l:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c));for(let e=0;e1||e<-1){o+=e,n.scrollTop=o/this.scaleY,i=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Z5))l(t)}get themeClasses(){return j7+" "+(this.state.facet(D7)?N7:B7)+" "+this.state.facet(R7)}updateAttrs(){let e=n9(this,r6,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(J5)?"true":"false",class:"cm-content",style:`${G8.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),n9(this,i6,t);let n=this.observer.ignore((()=>{let n=a5(this.contentDOM,this.contentAttrs,t),o=a5(this.dom,this.editorAttrs,e);return n||o}));return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(q7.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(h6);let e=this.state.facet(q7.cspNonce);r8.mount(this.root,this.styleModules.concat(L7).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;tt.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return R6(this,e,E6(this,e,t,n))}moveByGroup(e,t){return R6(this,e,E6(this,e,t,(t=>function(e,t,n){let o=e.state.charCategorizer(t),r=o(n);return e=>{let t=o(e);return r==E4.Space&&(r=t),r==t}}(this,e.head,t))))}visualLineSide(e,t){let n=this.bidiSpans(e),o=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return W3.cursor(r.side(t,o)+e.from,r.forward(!t,o)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,o){let r=I6(e,t.head),i=o&&r.type==p5.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(i){let t=e.dom.getBoundingClientRect(),o=e.textDirectionAt(r.from),l=e.posAtCoords({x:n==(o==x5.LTR)?t.right-1:t.left+1,y:(i.top+i.bottom)/2});if(null!=l)return W3.cursor(l,n?-1:1)}return W3.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return R6(this,e,function(e,t,n,o){let r=t.head,i=n?1:-1;if(r==(n?e.state.doc.length:0))return W3.cursor(r,t.assoc);let l,a=t.goalColumn,s=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(r,t.assoc||-1),u=e.documentTop;if(c)null==a&&(a=c.left-s.left),l=i<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(s.right-s.left,e.defaultCharacterWidth*(r-t.from))),l=(i<0?t.top:t.bottom)+u}let d=s.left+a,p=null!=o?o:e.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let t=l+(p+h)*i,n=M6(e,{x:d,y:t},!1,i);if(ts.bottom||(i<0?nr)){let o=e.docView.coordsForChar(n),r=!o||t0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Y5)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>J7)return N5(e.length);let t,n=this.textDirectionAt(e.from);for(let r of this.bidiCache)if(r.from==e.from&&r.dir==n&&(r.fresh||R5(r.isolates,t=u6(this,e))))return r.order;t||(t=u6(this,e));let o=function(e,t,n){if(!e)return[new A5(0,0,t==S5?1:0)];if(t==$5&&!n.length&&!E5.test(e))return N5(e.length);if(n.length)for(;e.length>D5.length;)D5[D5.length]=256;let o=[],r=t==$5?0:1;return B5(e,r,r,n,0,e.length,o),o}(e.text,n,t);return this.bidiCache.push(new t9(e.from,e.to,n,t,!0,o)),o}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||G8.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{P8(this.contentDOM),this.docView.updateSelection()}))}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return U5.of(new G5("number"==typeof e?W3.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return U5.of(new G5(W3.cursor(n.from),"start","start",n.top-e,t,!0))}static domEventHandlers(e){return n6.define((()=>({})),{eventHandlers:e})}static domEventObservers(e){return n6.define((()=>({})),{eventObservers:e})}static theme(e,t){let n=r8.newName(),o=[R7.of(n),h6.of(_7(`.${n}`,e))];return t&&t.dark&&o.push(D7.of(!0)),o}static baseTheme(e){return l4.lowest(h6.of(_7("."+j7,e,z7)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),o=n&&D8.get(n)||D8.get(e);return(null===(t=null==o?void 0:o.rootView)||void 0===t?void 0:t.view)||null}}q7.styleModule=h6,q7.inputHandler=V5,q7.focusChangeEffect=X5,q7.perLineTextDirection=Y5,q7.exceptionSink=W5,q7.updateListener=Z5,q7.editable=J5,q7.mouseSelectionStyle=F5,q7.dragMovesSelection=H5,q7.clickAddsSelectionRange=Q5,q7.decorations=l6,q7.outerDecorations=a6,q7.atomicRanges=s6,q7.bidiIsolatedRanges=c6,q7.scrollMargins=d6,q7.darkTheme=D7,q7.cspNonce=X3.define({combine:e=>e.length?e[0]:""}),q7.contentAttributes=i6,q7.editorAttributes=r6,q7.lineWrapping=q7.contentAttributes.of({class:"cm-lineWrapping"}),q7.announce=$4.define();const J7=4096,e9={};class t9{constructor(e,t,n,o,r,i){this.from=e,this.to=t,this.dir=n,this.isolates=o,this.fresh=r,this.order=i}static update(e,t){if(t.empty&&!e.some((e=>e.fresh)))return e;let n=[],o=e.length?e[e.length-1].dir:x5.LTR;for(let r=Math.max(0,e.length-10);r=0;r--){let t=o[r],i="function"==typeof t?t(e):t;i&&r5(i,n)}return n}const o9=G8.mac?"mac":G8.windows?"win":G8.linux?"linux":"key";function r9(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const i9=l4.default(q7.domEventHandlers({keydown:(e,t)=>u9(s9(t.state),e,t,"editor")})),l9=X3.define({enables:i9}),a9=new WeakMap;function s9(e){let t=e.facet(l9),n=a9.get(t);return n||a9.set(t,n=function(e,t=o9){let n=Object.create(null),o=Object.create(null),r=(e,t)=>{let n=o[e];if(null==n)o[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},i=(e,o,i,l,a)=>{var s,c;let u=n[e]||(n[e]=Object.create(null)),d=o.split(/ (?!$)/).map((e=>function(e,t){const n=e.split(/-(?!$)/);let o,r,i,l,a=n[n.length-1];"Space"==a&&(a=" ");for(let s=0;s{let o=c9={view:t,prefix:n,scope:e};return setTimeout((()=>{c9==o&&(c9=null)}),4e3),!0}]})}let p=d.join(" ");r(p,!1);let h=u[p]||(u[p]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(s=u._any)||void 0===s?void 0:s.run)||void 0===c?void 0:c.slice())||[]});i&&h.run.push(i),l&&(h.preventDefault=!0),a&&(h.stopPropagation=!0)};for(let l of e){let e=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let t in e)e[t].run.push(l.any)}let o=l[t]||l.key;if(o)for(let t of e)i(t,o,l.run,l.preventDefault,l.stopPropagation),l.shift&&i(t,"Shift-"+o,l.shift,l.preventDefault,l.stopPropagation)}return n}(t.reduce(((e,t)=>e.concat(t)),[]))),n}let c9=null;function u9(e,t,n,o){let r=function(e){var t=!(c8&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||u8&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?s8:a8)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),i=A3(I3(r,0))==r.length&&" "!=r,l="",a=!1,s=!1,c=!1;c9&&c9.view==n&&c9.scope==o&&(l=c9.prefix+" ",z6.indexOf(t.keyCode)<0&&(s=!0,c9=null));let u,d,p=new Set,h=e=>{if(e){for(let o of e.run)if(!p.has(o)&&(p.add(o),o(n,t)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),s=!0)}return!1},f=e[o];return f&&(h(f[l+r9(r,t,!i)])?a=!0:i&&(t.altKey||t.metaKey||t.ctrlKey)&&!(G8.windows&&t.ctrlKey&&t.altKey)&&(u=a8[t.keyCode])&&u!=r?(h(f[l+r9(u,t,!0)])||t.shiftKey&&(d=s8[t.keyCode])!=r&&d!=u&&h(f[l+r9(d,t,!1)]))&&(a=!0):i&&t.shiftKey&&h(f[l+r9(r,t,!0)])&&(a=!0),!a&&h(f._any)&&(a=!0)),s&&(a=!0),a&&c&&t.stopPropagation(),a}class d9{constructor(e,t,n,o,r){this.className=e,this.left=t,this.top=n,this.width=o,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let o=e.coordsAtPos(n.head,n.assoc||1);if(!o)return[];let r=p9(e);return[new d9(t,o.left-r.left,o.top-r.top,null,o.bottom-o.top)]}return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let o=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),i=e.textDirection==x5.LTR,l=e.contentDOM,a=l.getBoundingClientRect(),s=p9(e),c=l.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),p=a.right-(u?parseInt(u.paddingRight):0),h=I6(e,o),f=I6(e,r),g=h.type==p5.Text?h:null,m=f.type==p5.Text?f:null;if(g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=h9(e,o,g)),m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=h9(e,r,m)),g&&m&&g.from==m.from)return b(y(n.from,n.to,g));{let t=g?y(n.from,null,g):O(h,!1),o=m?y(null,n.to,m):O(f,!0),r=[];return(g||h).to<(m||f).from-(g&&m?1:0)||h.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2c&&i.from=r)break;a>o&&s(Math.max(e,o),null==t&&e<=c,Math.min(a,r),null==n&&a>=u,l.dir)}if(o=i.to+1,o>=r)break}return 0==a.length&&s(c,null==t,u,null==n,e.textDirection),{top:r,bottom:l,horizontal:a}}function O(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n)}}function p9(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==x5.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function h9(e,t,n){let o=W3.cursor(t);return{from:Math.max(n.from,e.moveToLineBoundary(o,!1,!0).from),to:Math.min(n.to,e.moveToLineBoundary(o,!0,!0).from),type:p5.Text}}class f9{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(g9)!=e.state.facet(g9)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,n=e.facet(g9);for(;t{return n=e,o=this.drawn[t],!(n.constructor==o.constructor&&n.eq(o));var n,o}))){let t=this.dom.firstChild,n=0;for(let o of e)o.update&&t&&o.constructor&&this.drawn[n].constructor&&o.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(o.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const g9=X3.define();function m9(e){return[n6.define((t=>new f9(t,e))),g9.of(e)]}const v9=!G8.ios,b9=X3.define({combine:e=>B4(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function y9(e={}){return[b9.of(e),w9,$9,C9,K5.of(!0)]}function O9(e){return e.startState.facet(b9)!=e.state.facet(b9)}const w9=m9({above:!0,markers(e){let{state:t}=e,n=t.facet(b9),o=[];for(let r of t.selection.ranges){let i=r==t.selection.main;if(r.empty?!i||v9:n.drawRangeCursor){let t=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:W3.cursor(r.head,r.head>r.anchor?-1:1);for(let r of d9.forRange(e,t,n))o.push(r)}}return o},update(e,t){e.transactions.some((e=>e.selection))&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=O9(e);return n&&x9(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){x9(t.state,e)},class:"cm-cursorLayer"});function x9(e,t){t.style.animationDuration=e.facet(b9).cursorBlinkRate+"ms"}const $9=m9({above:!1,markers:e=>e.state.selection.ranges.map((t=>t.empty?[]:d9.forRange(e,"cm-selectionBackground",t))).reduce(((e,t)=>e.concat(t))),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||O9(e),class:"cm-selectionLayer"}),S9={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};v9&&(S9[".cm-line"].caretColor="transparent !important",S9[".cm-content"]={caretColor:"transparent !important"});const C9=l4.highest(q7.theme(S9)),k9=$4.define({map:(e,t)=>null==e?null:t.mapPos(e)}),P9=e4.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce(((e,t)=>t.is(k9)?t.value:e),e))}),M9=n6.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(P9);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(P9)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(P9),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let o=e.scrollDOM.getBoundingClientRect();return{left:n.left-o.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-o.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(P9)!=e&&this.view.dispatch({effects:k9.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function T9(e,t,n,o,r){t.lastIndex=0;for(let i,l=e.iterRange(n,o),a=n;!l.next().done;a+=l.value.length)if(!l.lineBreak)for(;i=t.exec(l.value);)r(a+i.index,i)}class I9{constructor(e){const{regexp:t,decoration:n,decorate:o,boundary:r,maxLength:i=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,o)this.addMatch=(e,t,n,r)=>o(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,o,r)=>{let i=n(e,t,o);i&&r(o,o+e[0].length,i)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,o,r)=>r(o,o+e[0].length,n)}this.boundary=r,this.maxLength=i}createDeco(e){let t=new H4,n=t.add.bind(t);for(let{from:o,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let o=[];for(let{from:r,to:i}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),i=Math.min(e.state.doc.lineAt(i).to,i+t),o.length&&o[o.length-1].to>=r?o[o.length-1].to=i:o.push({from:r,to:i});return o}(e,this.maxLength))T9(e.state.doc,this.regexp,o,r,((t,o)=>this.addMatch(o,e,t,n)));return t.finish()}updateDeco(e,t){let n=1e9,o=-1;return e.docChanged&&e.changes.iterChanges(((t,r,i,l)=>{l>e.view.viewport.from&&i1e3?this.createDeco(e.view):o>-1?this.updateRange(e.view,t.map(e.changes),n,o):t}updateRange(e,t,n,o){for(let r of e.visibleRanges){let i=Math.max(r.from,n),l=Math.min(r.to,o);if(l>i){let n=e.state.doc.lineAt(i),o=n.ton.from;i--)if(this.boundary.test(n.text[i-1-n.from])){a=i;break}for(;lu.push(n.range(e,t));if(n==o)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.indexthis.addMatch(n,e,t,d)));t=t.update({filterFrom:a,filterTo:s,filter:(e,t)=>es,add:u})}}return t}}const E9=null!=/x/.unicode?"gu":"g",A9=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",E9),R9={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let D9=null;const j9=X3.define({combine(e){let t=B4(e,{render:null,specialChars:A9,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==D9&&"undefined"!=typeof document&&document.body){let t=document.body.style;D9=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return D9||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,E9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,E9)),t}});function B9(e={}){return[j9.of(e),N9||(N9=n6.fromClass(class{constructor(e){this.view=e,this.decorations=h5.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(j9)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new I9({regexp:e.specialChars,decoration:(t,n,o)=>{let{doc:r}=n.state,i=I3(t[0],0);if(9==i){let e=r.lineAt(o),t=n.state.tabSize,i=J4(e.text,t,o-e.from);return h5.replace({widget:new _9((t-i%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=h5.replace({widget:new z9(e,i)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(j9);e.startState.facet(j9)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let N9=null;class z9 extends d5{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=(n=this.code)>=32?"•":10==n?"␤":String.fromCharCode(9216+n);var n;let o=e.state.phrase("Control character")+" "+(R9[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,o,t);if(r)return r;let i=document.createElement("span");return i.textContent=t,i.title=o,i.setAttribute("aria-label",o),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class _9 extends d5{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const L9=h5.line({class:"cm-activeLine"}),Q9=n6.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let o of e.state.selection.ranges){let r=e.lineBlockAt(o.head);r.from>t&&(n.push(L9.range(r.from)),t=r.from)}return h5.set(n)}},{decorations:e=>e.decorations});class H9 extends d5{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?m8(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),o=w8(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return o.bottom-o.top>1.5*r?{left:o.left,right:o.right,top:o.top,bottom:o.top+r}:o}ignoreEvent(){return!1}}const F9=2e3;function W9(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(n),r=n-o.from,i=r>F9?-1:r==o.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):J4(o.text,e.state.tabSize,n-o.from);return{line:o.number,col:i,off:r}}function Z9(e,t){let n=W9(e,t),o=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),r=e.state.doc.lineAt(t);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},o=o.map(e.changes)}},get(t,r,i){let l=W9(e,t);if(!l)return o;let a=function(e,t,n){let o=Math.min(t.line,n.line),r=Math.max(t.line,n.line),i=[];if(t.off>F9||n.off>F9||t.col<0||n.col<0){let l=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let t=o;t<=r;t++){let n=e.doc.line(t);n.length<=a&&i.push(W3.range(n.from+l,n.to+a))}}else{let l=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let t=o;t<=r;t++){let n=e.doc.line(t),o=e8(n.text,l,e.tabSize,!0);if(o<0)i.push(W3.cursor(n.to));else{let t=e8(n.text,a,e.tabSize);i.push(W3.range(n.from+o,n.from+t))}}}return i}(e.state,n,l);return a.length?i?W3.create(a.concat(o.ranges)):W3.create(a):o}}:null}function V9(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return q7.mouseSelectionStyle.of(((e,n)=>t(n)?Z9(e,n):null))}const X9={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},Y9={style:"cursor: crosshair"};function K9(e={}){let[t,n]=X9[e.key||"Alt"],o=n6.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[o,q7.contentAttributes.of((e=>{var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.isDown)?Y9:null}))]}const G9="-10000px";class U9{constructor(e,t,n){this.facet=t,this.createTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e)),this.tooltipViews=this.tooltips.map(n)}update(e,t){var n;let o=e.state.facet(this.facet),r=o.filter((e=>e));if(o===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let i=[],l=t?[]:null;for(let a=0;at[n]=e)),t.length=l.length),this.input=o,this.tooltips=r,this.tooltipViews=i,!0}}function q9(e){let{win:t}=e;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const J9=X3.define({combine:e=>{var t,n,o;return{position:G8.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find((e=>e.parent)))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(o=e.find((e=>e.tooltipSpace)))||void 0===o?void 0:o.tooltipSpace)||q9}}}),eee=new WeakMap,tee=n6.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(J9);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new U9(e,ree,(e=>this.createTooltip(e))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,o=e.state.facet(J9);if(o.position!=this.position&&!this.madeAbsolute){this.position=o.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(o.parent!=this.parent){this.parent&&this.container.remove(),this.parent=o.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e){let t=e.create(this.view);if(t.dom.classList.add("cm-tooltip"),e.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",t.dom.appendChild(e)}return t.dom.style.position=this.position,t.dom.style.top=G9,t.dom.style.left="0px",this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}destroy(){var e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),null===(e=n.destroy)||void 0===e||e.call(n);this.parent&&this.container.remove(),null===(t=this.intersectionObserver)||void 0===t||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect(),t=1,n=1,o=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(G8.gecko)o=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==G9&&"0px"==e.style.left){let t=e.getBoundingClientRect();o=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(o||"absolute"==this.position)if(this.parent){let e=this.parent.getBoundingClientRect();e.width&&e.height&&(t=e.width/this.parent.offsetWidth,n=e.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:n}=this.view.viewState);return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(J9).tooltipSpace(this.view),scaleX:t,scaleY:n,makeAbsolute:o}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{editor:n,space:o,scaleX:r,scaleY:i}=e,l=[];for(let a=0;a=Math.min(n.bottom,o.bottom)||d.rightMath.min(n.right,o.right)+.1){u.style.top=G9;continue}let h=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=h?7:0,g=p.right-p.left,m=null!==(t=eee.get(c))&&void 0!==t?t:p.bottom-p.top,v=c.offset||oee,b=this.view.textDirection==x5.LTR,y=p.width>o.right-o.left?b?o.left:o.right-p.width:b?Math.min(d.left-(h?14:0)+v.x,o.right-g):Math.max(o.left,d.left-g+(h?14:0)-v.x),O=this.above[a];!s.strictSide&&(O?d.top-(p.bottom-p.top)-v.yo.bottom)&&O==o.bottom-d.bottom>d.top-o.top&&(O=this.above[a]=!O);let w=(O?d.top-o.top:o.bottom-d.bottom)-f;if(wy&&e.topx&&(x=O?e.top-m-2-f:e.bottom+f+2);if("absolute"==this.position?(u.style.top=(x-e.parent.top)/i+"px",u.style.left=(y-e.parent.left)/r+"px"):(u.style.top=x/i+"px",u.style.left=y/r+"px"),h){let e=d.left+(b?v.x:-v.x)-(y+14-7);h.style.left=e/r+"px"}!0!==c.overlap&&l.push({left:y,top:x,right:$,bottom:x+m}),u.classList.toggle("cm-tooltip-above",O),u.classList.toggle("cm-tooltip-below",!O),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=G9}},{eventObservers:{scroll(){this.maybeMeasure()}}}),nee=q7.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),oee={x:0,y:0},ree=X3.define({enables:[tee,nee]}),iee=X3.define();class lee{static create(e){return new lee(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new U9(e,iee,(e=>this.createHostedView(e)))}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let o=n[e];if(void 0!==o)if(void 0===t)t=o;else if(t!==o)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const aee=ree.compute([iee],(e=>{let t=e.facet(iee).filter((e=>e));return 0===t.length?null:{pos:Math.min(...t.map((e=>e.pos))),end:Math.max(...t.map((e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos}))),create:lee.create,above:t[0].above,arrow:t.some((e=>e.arrow))}}));class see{constructor(e,t,n,o,r){this.view=e,this.source=t,this.field=n,this.setHover=o,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;en.bottom||t.xn.right+e.defaultCharacterWidth)return;let i=e.bidiSpans(e.state.doc.lineAt(o)).find((e=>e.from<=o&&e.to>=o)),l=i&&i.dir==x5.RTL?-1:1;r=t.x{this.pending==t&&(this.pending=null,n&&e.dispatch({effects:this.setHover.of(n)}))}),(t=>q5(e.state,t,"hover tooltip")))}else i&&e.dispatch({effects:this.setHover.of(i)})}get tooltip(){let e=this.view.plugin(tee),t=e?e.manager.tooltips.findIndex((e=>e.create==lee.create)):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:n,tooltip:o}=this;if(n&&o&&!function(e,t){let n=e.getBoundingClientRect();return t.clientX>=n.left-4&&t.clientX<=n.right+4&&t.clientY>=n.top-4&&t.clientY<=n.bottom+4}(o.dom,e)||this.pending){let{pos:o}=n||this.pending,r=null!==(t=null==n?void 0:n.end)&&void 0!==t?t:o;(o==r?this.view.posAtCoords(this.lastMove)==o:function(e,t,n,o,r,i){let l=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(l.left>o||l.rightr||Math.min(l.bottom,a)=t&&s<=n}(this.view,o,r,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of(null)})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function cee(e,t={}){let n=$4.define(),o=e4.define({create:()=>null,update(e,o){if(e&&(t.hideOnChange&&(o.docChanged||o.selection)||t.hideOn&&t.hideOn(o,e)))return null;if(e&&o.docChanged){let t=o.changes.mapPos(e.pos,-1,D3.TrackDel);if(null==t)return null;let n=Object.assign(Object.create(null),e);n.pos=t,null!=e.end&&(n.end=o.changes.mapPos(e.end)),e=n}for(let t of o.effects)t.is(n)&&(e=t.value),t.is(dee)&&(e=null);return e},provide:e=>iee.from(e)});return[o,n6.define((r=>new see(r,e,o,n,t.hoverTime||300))),aee]}function uee(e,t){let n=e.plugin(tee);if(!n)return null;let o=n.manager.tooltips.indexOf(t);return o<0?null:n.manager.tooltipViews[o]}const dee=$4.define(),pee=X3.define({combine(e){let t,n;for(let o of e)t=t||o.topContainer,n=n||o.bottomContainer;return{topContainer:t,bottomContainer:n}}});function hee(e,t){let n=e.plugin(fee),o=n?n.specs.indexOf(t):-1;return o>-1?n.panels[o]:null}const fee=n6.fromClass(class{constructor(e){this.input=e.state.facet(vee),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(pee);this.top=new gee(e,!0,t.topContainer),this.bottom=new gee(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(pee);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new gee(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new gee(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(vee);if(n!=this.input){let t=n.filter((e=>e)),o=[],r=[],i=[],l=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),l.push(t)):(t=this.panels[a],t.update&&t.update(e)),o.push(t),(t.top?r:i).push(t)}this.specs=t,this.panels=o,this.top.sync(r),this.bottom.sync(i);for(let e of l)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let o of this.panels)o.update&&o.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>q7.scrollMargins.of((t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}}))});class gee{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=mee(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=mee(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function mee(e){let t=e.nextSibling;return e.remove(),t}const vee=X3.define({enables:fee});class bee extends N4{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}bee.prototype.elementClass="",bee.prototype.toDOM=void 0,bee.prototype.mapMode=D3.TrackBefore,bee.prototype.startSide=bee.prototype.endSide=-1,bee.prototype.point=!0;const yee=X3.define(),Oee={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Q4.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},wee=X3.define();function xee(e){return[See(),wee.of(Object.assign(Object.assign({},Oee),e))]}const $ee=X3.define({combine:e=>e.some((e=>e))});function See(e){let t=[Cee];return e&&!1===e.fixed&&t.push($ee.of(!0)),t}const Cee=n6.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(wee).map((t=>new Tee(e,t)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!e.state.facet($ee),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,o=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(o<.8*(n.to-n.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet($ee)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let n=Q4.iter(this.view.state.facet(yee),this.view.viewport.from),o=[],r=this.gutters.map((e=>new Mee(e,this.view.viewport,-this.view.documentPadding.top)));for(let i of this.view.viewportLineBlocks)if(o.length&&(o=[]),Array.isArray(i.type)){let e=!0;for(let t of i.type)if(t.type==p5.Text&&e){Pee(n,o,t.from);for(let e of r)e.line(this.view,t,o);e=!1}else if(t.widget)for(let e of r)e.widget(this.view,t)}else if(i.type==p5.Text){Pee(n,o,i.from);for(let e of r)e.line(this.view,i,o)}else if(i.widget)for(let e of r)e.widget(this.view,i);for(let i of r)i.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(wee),n=e.state.facet(wee),o=e.docChanged||e.heightChanged||e.viewportChanged||!Q4.eq(e.startState.facet(yee),e.state.facet(yee),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(o=!0);else{o=!0;let r=[];for(let o of n){let n=t.indexOf(o);n<0?r.push(new Tee(this.view,o)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return o}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>q7.scrollMargins.of((t=>{let n=t.plugin(e);return n&&0!=n.gutters.length&&n.fixed?t.textDirection==x5.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}:null}))});function kee(e){return Array.isArray(e)?e:[e]}function Pee(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class Mee{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Q4.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:o}=this,r=(t.top-this.height)/e.scaleY,i=t.height/e.scaleY;if(this.i==o.elements.length){let t=new Iee(e,i,r,n);o.elements.push(t),o.dom.appendChild(t.dom)}else o.elements[this.i].update(e,i,r,n);this.height=t.bottom,this.i++}line(e,t,n){let o=[];Pee(this.cursor,o,t.from),n.length&&(o=o.concat(n));let r=this.gutter.config.lineMarker(e,t,o);r&&o.unshift(r);let i=this.gutter;(0!=o.length||i.config.renderEmptyElements)&&this.addElement(e,t,o)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Tee{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,(o=>{let r,i=o.target;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();r=(e.top+e.bottom)/2}else r=o.clientY;let l=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[n](e,l,o)&&o.preventDefault()}));this.markers=kee(t.markers(e)),t.initialSpacer&&(this.spacer=new Iee(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=kee(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!Q4.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class Iee{constructor(e,t,n,o){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,o)}update(e,t,n,o){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;nB4(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let o in t){let e=n[o],r=t[o];n[o]=e?(t,n,o)=>e(t,n,o)||r(t,n,o):r}return n}})});class Ree extends bee{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Dee(e,t){return e.state.facet(Aee).formatNumber(t,e.state)}const jee=wee.compute([Aee],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Eee),lineMarker:(e,t,n)=>n.some((e=>e.toDOM))?null:new Ree(Dee(e,e.state.doc.lineAt(t.from).number)),widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(Aee)!=e.state.facet(Aee),initialSpacer:e=>new Ree(Dee(e,Nee(e.state.doc.lines))),updateSpacer(e,t){let n=Dee(t.view,Nee(t.view.state.doc.lines));return n==e.number?e:new Ree(n)},domEventHandlers:e.facet(Aee).domEventHandlers})));function Bee(e={}){return[Aee.of(e),See(),jee]}function Nee(e){let t=9;for(;t{let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.head).from;r>n&&(n=r,t.push(zee.range(r)))}return Q4.of(t)})),Lee=1024;let Qee=0,Hee=class{constructor(e,t){this.from=e,this.to=t}};class Fee{constructor(e={}){this.id=Qee++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=Vee.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Fee.closedBy=new Fee({deserialize:e=>e.split(" ")}),Fee.openedBy=new Fee({deserialize:e=>e.split(" ")}),Fee.group=new Fee({deserialize:e=>e.split(" ")}),Fee.isolate=new Fee({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),Fee.contextHash=new Fee({perNode:!0}),Fee.lookAhead=new Fee({perNode:!0}),Fee.mounted=new Fee({perNode:!0});class Wee{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Fee.mounted.id]}}const Zee=Object.create(null);class Vee{constructor(e,t,n,o=0){this.name=e,this.props=t,this.id=n,this.flags=o}static define(e){let t=e.props&&e.props.length?Object.create(null):Zee,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),o=new Vee(e.name||"",t,e.id,n);if(e.props)for(let r of e.props)if(Array.isArray(r)||(r=r(o)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}return o}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(Fee.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let o of n.split(" "))t[o]=e[n];return e=>{for(let n=e.prop(Fee.group),o=-1;o<(n?n.length:0);o++){let r=t[o<0?e.name:n[o]];if(r)return r}}}}Vee.none=new Vee("",Object.create(null),0,8);class Xee{constructor(e){this.types=e;for(let t=0;t=t){let l=new rte(e.tree,e.overlay[0].from+i.from,-1,i);(r||(r=[o])).push(nte(l,t,n,!1))}}return r?cte(r):o}(this,e,t)}iterate(e){let{enter:t,leave:n,from:o=0,to:r=this.length}=e,i=e.mode||0,l=(i&Gee.IncludeAnonymous)>0;for(let a=this.cursor(i|Gee.IncludeAnonymous);;){let e=!1;if(a.from<=r&&a.to>=o&&(!l&&a.type.isAnonymous||!1!==t(a))){if(a.firstChild())continue;e=!0}for(;e&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;e=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:gte(Vee.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,n)=>new qee(this.type,e,t,n,this.propValues)),e.makeTree||((e,t,n)=>new qee(Vee.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:o,maxBufferLength:r=Lee,reused:i=[],minRepeatType:l=o.types.length}=e,a=Array.isArray(n)?new Jee(n,n.length):n,s=o.types,c=0,u=0;function d(e,t,n,b,y,O){let{id:w,start:x,end:$,size:S}=a,C=u;for(;S<0;){if(a.next(),-1==S){let t=i[w];return n.push(t),void b.push(x-e)}if(-3==S)return void(c=w);if(-4==S)return void(u=w);throw new RangeError(`Unrecognized record size: ${S}`)}let k,P,M=s[w],T=x-e;if($-x<=r&&(P=m(a.pos-t,y))){let t=new Uint16Array(P.size-P.skip),n=a.pos-P.size,r=t.length;for(;a.pos>n;)r=v(P.start,t,r);k=new ete(t,$-P.start,o),T=P.start-e}else{let e=a.pos-S;a.next();let t=[],n=[],o=w>=l?w:-1,i=0,s=$;for(;a.pos>e;)o>=0&&a.id==o&&a.size>=0?(a.end<=s-r&&(f(t,n,x,i,a.end,s,o,C),i=t.length,s=a.end),a.next()):O>2500?p(x,e,t,n):d(x,e,t,n,o,O+1);if(o>=0&&i>0&&i-1&&i>0){let e=h(M);k=gte(M,t,n,0,t.length,0,$-x,e,e)}else k=g(M,t,n,$-x,C-$)}n.push(k),b.push(T)}function p(e,t,n,i){let l=[],s=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:o}=a;if(o>4)a.next();else{if(c>-1&&t=0;e-=3)t[n++]=l[e],t[n++]=l[e+1]-r,t[n++]=l[e+2]-r,t[n++]=n;n.push(new ete(t,l[2]-r,o)),i.push(r-e)}}function h(e){return(t,n,o)=>{let r,i,l=0,a=t.length-1;if(a>=0&&(r=t[a])instanceof qee){if(!a&&r.type==e&&r.length==o)return r;(i=r.prop(Fee.lookAhead))&&(l=n[a]+r.length+i)}return g(e,t,n,o,l)}}function f(e,t,n,r,i,l,a,s){let c=[],u=[];for(;e.length>r;)c.push(e.pop()),u.push(t.pop()+n-i);e.push(g(o.types[a],c,u,l-i,s-l)),t.push(i-n)}function g(e,t,n,o,r=0,i){if(c){let e=[Fee.contextHash,c];i=i?[e].concat(i):[e]}if(r>25){let e=[Fee.lookAhead,r];i=i?[e].concat(i):[e]}return new qee(e,t,n,o,i)}function m(e,t){let n=a.fork(),o=0,i=0,s=0,c=n.end-r,u={size:0,start:0,skip:0};e:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=o,u.start=i,u.skip=s,s+=4,o+=4,n.next();continue}let a=n.pos-e;if(e<0||a=l?4:0,p=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size)break e;d+=4}else n.id>=l&&(d+=4);n.next()}i=p,o+=e,s+=d}return(t<0||o==e)&&(u.size=o,u.start=i,u.skip=s),u.size>4?u:void 0}function v(e,t,n){let{id:o,start:r,end:i,size:s}=a;if(a.next(),s>=0&&o4){let o=a.pos-(s-4);for(;a.pos>o;)n=v(e,t,n)}t[--n]=l,t[--n]=i-e,t[--n]=r-e,t[--n]=o}else-3==s?c=o:-4==s&&(u=o);return n}let b=[],y=[];for(;a.pos>0;)d(e.start||0,e.bufferStart||0,b,y,-1,0);let O=null!==(t=e.length)&&void 0!==t?t:b.length?y[0]+b[0].length:0;return new qee(s[e.topID],b.reverse(),y.reverse(),O)}(e)}}qee.empty=new qee(Vee.none,[],[],0);class Jee{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Jee(this.buffer,this.index)}}class ete{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Vee.none}toString(){let e=[];for(let t=0;t0));a=i[a+3]);return l}slice(e,t,n){let o=this.buffer,r=new Uint16Array(t-e),i=0;for(let l=e,a=0;l=t&&nt;case 1:return n<=t&&o>t;case 2:return o>t;case 4:return!0}}function nte(e,t,n,o){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;e!=s;e+=t){let s=l[e],c=a[e]+i.from;if(tte(o,n,c,c+s.length))if(s instanceof ete){if(r&Gee.ExcludeBuffers)continue;let l=s.findChild(0,s.buffer.length,t,n-c,o);if(l>-1)return new ste(new ate(i,s,e,c),null,l)}else if(r&Gee.IncludeAnonymous||!s.type.isAnonymous||pte(s)){let l;if(!(r&Gee.IgnoreMounts)&&(l=Wee.get(s))&&!l.overlay)return new rte(l.tree,c,e,i);let a=new rte(s,c,e,i);return r&Gee.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?s.children.length-1:0,t,n,o)}}if(r&Gee.IncludeAnonymous||!i.type.isAnonymous)return null;if(e=i.index>=0?i.index+t:t<0?-1:i._parent._tree.children.length,i=i._parent,!i)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let o;if(!(n&Gee.IgnoreOverlays)&&(o=Wee.get(this._tree))&&o.overlay){let n=e-this.from;for(let{from:e,to:r}of o.overlay)if((t>0?e<=n:e=n:r>n))return new rte(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ite(e,t,n,o){let r=e.cursor(),i=[];if(!r.firstChild())return i;if(null!=n)for(;!r.type.is(n);)if(!r.nextSibling())return i;for(;;){if(null!=o&&r.type.is(o))return i;if(r.type.is(t)&&i.push(r.node),!r.nextSibling())return null==o?i:[]}}function lte(e,t,n=t.length-1){for(let o=e.parent;n>=0;o=o.parent){if(!o)return!1;if(!o.type.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}class ate{constructor(e,t,n,o){this.parent=e,this.buffer=t,this.index=n,this.start=o}}class ste extends ote{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new ste(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&Gee.ExcludeBuffers)return null;let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new ste(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ste(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ste(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,o=this.index+4,r=n.buffer[this.index+3];if(r>o){let i=n.buffer[this.index+1];e.push(n.slice(o,r,i)),t.push(0)}return new qee(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function cte(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;in.from||o.to0){if(this.index-1)for(let o=t+e,r=e<0?-1:n._tree.children.length;o!=r;o+=e){let e=n._tree.children[o];if(this.mode&Gee.IncludeAnonymous||e instanceof ete||!e.type.isAnonymous||pte(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let i=e;i;i=i._parent)if(i.index==o){if(o==this.index)return i;t=i,n=r+1;break e}o=this.stack[--r]}for(let o=n;o=0;r--){if(r<0)return lte(this.node,e,o);let i=n[t.buffer[this.stack[r]]];if(!i.isAnonymous){if(e[o]&&e[o]!=i.name)return!1;o--}}return!0}}function pte(e){return e.children.some((e=>e instanceof ete||!e.type.isAnonymous||pte(e)))}const hte=new WeakMap;function fte(e,t){if(!e.isAnonymous||t instanceof ete||t.type!=e)return 1;let n=hte.get(t);if(null==n){n=1;for(let o of t.children){if(o.type!=e||!(o instanceof qee)){n=1;break}n+=fte(e,o)}hte.set(t,n)}return n}function gte(e,t,n,o,r,i,l,a,s){let c=0;for(let h=o;h=u)break;f+=t}if(c==r+1){if(f>u){let e=n[r];t(e.children,e.positions,0,e.children.length,o[r]+a);continue}d.push(n[r])}else{let t=o[c-1]+n[c-1].length-h;d.push(gte(e,n,o,r,c,h,t,null,s))}p.push(h+a-i)}}(t,n,o,r,0),(a||s)(d,p,l)}class mte{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let o=this.map.get(e);o||this.map.set(e,o=new Map),o.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof ste?this.setBuffer(e.context.buffer,e.index,t):e instanceof rte&&this.map.set(e.tree,t)}get(e){return e instanceof ste?this.getBuffer(e.context.buffer,e.index):e instanceof rte?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class vte{constructor(e,t,n,o,r=!1,i=!1){this.from=e,this.to=t,this.tree=n,this.offset=o,this.open=(r?1:0)|(i?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let o=[new vte(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&o.push(r);return o}static applyChanges(e,t,n=128){if(!t.length)return e;let o=[],r=1,i=e.length?e[0]:null;for(let l=0,a=0,s=0;;l++){let c=l=n)for(;i&&i.from=t.from||u<=t.to||s){let e=Math.max(t.from,a)-s,n=Math.min(t.to,u)-s;t=e>=n?null:new vte(e,n,t.tree,t.offset+s,l>0,!!c)}if(t&&o.push(t),i.to>u)break;i=rnew Hee(e.from,e.to))):[new Hee(0,0)]:[new Hee(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let o=this.startParse(e,t,n);for(;;){let e=o.advance();if(e)return e}}}class yte{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Fee({perNode:!0});let Ote=0;class wte{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=Ote++}static define(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let t=new wte([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new $te;return t=>t.modified.indexOf(e)>-1?t:$te.get(t.base||t,t.modified.concat(e).sort(((e,t)=>e.id-t.id)))}}let xte=0;class $te{constructor(){this.instances=[],this.id=xte++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find((n=>{return n.base==e&&(o=t,r=n.modified,o.length==r.length&&o.every(((e,t)=>e==r[t])));var o,r}));if(n)return n;let o=[],r=new wte(o,e,t);for(let l of t)l.instances.push(r);let i=function(e){let t=[[]];for(let n=0;nt.length-e.length))}(t);for(let l of e.set)if(!l.modified.length)for(let e of i)o.push($te.get(l,e));return r}}function Ste(e){let t=Object.create(null);for(let n in e){let o=e[n];Array.isArray(o)||(o=[o]);for(let e of n.split(" "))if(e){let n=[],r=2,i=e;for(let t=0;;){if("..."==i&&t>0&&t+3==e.length){r=1;break}let o=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(i);if(!o)throw new RangeError("Invalid path: "+e);if(n.push("*"==o[0]?"":'"'==o[0][0]?JSON.parse(o[0]):o[0]),t+=o[0].length,t==e.length)break;let l=e[t++];if(t==e.length&&"!"==l){r=0;break}if("/"!=l)throw new RangeError("Invalid path: "+e);i=e.slice(t)}let l=n.length-1,a=n[l];if(!a)throw new RangeError("Invalid path: "+e);let s=new kte(o,r,l>0?n.slice(0,l):null);t[a]=s.sort(t[a])}}return Cte.add(t)}const Cte=new Fee;class kte{constructor(e,t,n,o){this.tags=e,this.mode=t,this.context=n,this.next=o}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth{let t=r;for(let o of e)for(let e of o.set){let o=n[e.id];if(o){t=t?t+" "+o:o;break}}return t},scope:o}}function Mte(e,t,n,o=0,r=e.length){let i=new Tte(o,Array.isArray(t)?t:[t],n);i.highlightRange(e.cursor(),o,r,"",i.highlighters),i.flush(r)}kte.empty=new kte([],2,null);class Tte{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,o,r){let{type:i,from:l,to:a}=e;if(l>=n||a<=t)return;i.isTop&&(r=this.highlighters.filter((e=>!e.scope||e.scope(i))));let s=o,c=function(e){let t=e.type.prop(Cte);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||kte.empty,u=function(e,t){let n=null;for(let o of e){let e=o.style(t);e&&(n=n?n+" "+e:e)}return n}(r,c.tags);if(u&&(s&&(s+=" "),s+=u,1==c.mode&&(o+=(o?" ":"")+u)),this.startSpan(Math.max(t,l),s),c.opaque)return;let d=e.tree&&e.tree.prop(Fee.mounted);if(d&&d.overlay){let i=e.node.enter(d.overlay[0].from+l,1),c=this.highlighters.filter((e=>!e.scope||e.scope(d.tree.type))),u=e.firstChild();for(let p=0,h=l;;p++){let f=p=g)&&e.nextSibling()););if(!f||g>n)break;h=f.to+l,h>t&&(this.highlightRange(i.cursor(),Math.max(t,f.from+l),Math.min(n,h),"",c),this.startSpan(Math.min(n,h),s))}u&&e.parent()}else if(e.firstChild()){d&&(o="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,o,r),this.startSpan(Math.min(n,e.to),s)}}while(e.nextSibling());e.parent()}}}const Ite=wte.define,Ete=Ite(),Ate=Ite(),Rte=Ite(Ate),Dte=Ite(Ate),jte=Ite(),Bte=Ite(jte),Nte=Ite(jte),zte=Ite(),_te=Ite(zte),Lte=Ite(),Qte=Ite(),Hte=Ite(),Fte=Ite(Hte),Wte=Ite(),Zte={comment:Ete,lineComment:Ite(Ete),blockComment:Ite(Ete),docComment:Ite(Ete),name:Ate,variableName:Ite(Ate),typeName:Rte,tagName:Ite(Rte),propertyName:Dte,attributeName:Ite(Dte),className:Ite(Ate),labelName:Ite(Ate),namespace:Ite(Ate),macroName:Ite(Ate),literal:jte,string:Bte,docString:Ite(Bte),character:Ite(Bte),attributeValue:Ite(Bte),number:Nte,integer:Ite(Nte),float:Ite(Nte),bool:Ite(jte),regexp:Ite(jte),escape:Ite(jte),color:Ite(jte),url:Ite(jte),keyword:Lte,self:Ite(Lte),null:Ite(Lte),atom:Ite(Lte),unit:Ite(Lte),modifier:Ite(Lte),operatorKeyword:Ite(Lte),controlKeyword:Ite(Lte),definitionKeyword:Ite(Lte),moduleKeyword:Ite(Lte),operator:Qte,derefOperator:Ite(Qte),arithmeticOperator:Ite(Qte),logicOperator:Ite(Qte),bitwiseOperator:Ite(Qte),compareOperator:Ite(Qte),updateOperator:Ite(Qte),definitionOperator:Ite(Qte),typeOperator:Ite(Qte),controlOperator:Ite(Qte),punctuation:Hte,separator:Ite(Hte),bracket:Fte,angleBracket:Ite(Fte),squareBracket:Ite(Fte),paren:Ite(Fte),brace:Ite(Fte),content:zte,heading:_te,heading1:Ite(_te),heading2:Ite(_te),heading3:Ite(_te),heading4:Ite(_te),heading5:Ite(_te),heading6:Ite(_te),contentSeparator:Ite(zte),list:Ite(zte),quote:Ite(zte),emphasis:Ite(zte),strong:Ite(zte),link:Ite(zte),monospace:Ite(zte),strikethrough:Ite(zte),inserted:Ite(),deleted:Ite(),changed:Ite(),invalid:Ite(),meta:Wte,documentMeta:Ite(Wte),annotation:Ite(Wte),processingInstruction:Ite(Wte),definition:wte.defineModifier(),constant:wte.defineModifier(),function:wte.defineModifier(),standard:wte.defineModifier(),local:wte.defineModifier(),special:wte.defineModifier()};var Vte;Pte([{tag:Zte.link,class:"tok-link"},{tag:Zte.heading,class:"tok-heading"},{tag:Zte.emphasis,class:"tok-emphasis"},{tag:Zte.strong,class:"tok-strong"},{tag:Zte.keyword,class:"tok-keyword"},{tag:Zte.atom,class:"tok-atom"},{tag:Zte.bool,class:"tok-bool"},{tag:Zte.url,class:"tok-url"},{tag:Zte.labelName,class:"tok-labelName"},{tag:Zte.inserted,class:"tok-inserted"},{tag:Zte.deleted,class:"tok-deleted"},{tag:Zte.literal,class:"tok-literal"},{tag:Zte.string,class:"tok-string"},{tag:Zte.number,class:"tok-number"},{tag:[Zte.regexp,Zte.escape,Zte.special(Zte.string)],class:"tok-string2"},{tag:Zte.variableName,class:"tok-variableName"},{tag:Zte.local(Zte.variableName),class:"tok-variableName tok-local"},{tag:Zte.definition(Zte.variableName),class:"tok-variableName tok-definition"},{tag:Zte.special(Zte.variableName),class:"tok-variableName2"},{tag:Zte.definition(Zte.propertyName),class:"tok-propertyName tok-definition"},{tag:Zte.typeName,class:"tok-typeName"},{tag:Zte.namespace,class:"tok-namespace"},{tag:Zte.className,class:"tok-className"},{tag:Zte.macroName,class:"tok-macroName"},{tag:Zte.propertyName,class:"tok-propertyName"},{tag:Zte.operator,class:"tok-operator"},{tag:Zte.comment,class:"tok-comment"},{tag:Zte.meta,class:"tok-meta"},{tag:Zte.invalid,class:"tok-invalid"},{tag:Zte.punctuation,class:"tok-punctuation"}]);const Xte=new Fee;function Yte(e){return X3.define({combine:e?t=>t.concat(e):void 0})}const Kte=new Fee;class Gte{constructor(e,t,n=[],o=""){this.data=e,this.name=o,j4.prototype.hasOwnProperty("tree")||Object.defineProperty(j4.prototype,"tree",{get(){return Jte(this)}}),this.parser=t,this.extension=[sne.of(this),j4.languageData.of(((e,t,n)=>{let o=Ute(e,t,n),r=o.type.prop(Xte);if(!r)return[];let i=e.facet(r),l=o.type.prop(Kte);if(l){let r=o.resolve(t-o.from,n);for(let t of l)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(i)}}return i}))].concat(n)}isActiveAt(e,t,n=-1){return Ute(e,t,n).type.prop(Xte)==this.data}findRegions(e){let t=e.facet(sne);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],o=(e,t)=>{if(e.prop(Xte)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(Fee.mounted);if(r){if(r.tree.prop(Xte)==this.data){if(r.overlay)for(let e of r.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(r.overlay){let e=n.length;if(o(r.tree,r.overlay[0].from+t),n.length>e)return}}for(let n=0;ne.isTop?t:void 0))]}),e.name)}configure(e,t){return new qte(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Jte(e){let t=e.field(Gte.state,!1);return t?t.tree:qee.empty}class ene{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let tne=null;class nne{constructor(e,t,n=[],o,r,i,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=o,this.treeLen=r,this.viewport=i,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new nne(e,t,[],qee.empty,0,n,[],null)}startParse(){return this.parser.startParse(new ene(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=qee.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(vte.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=tne;tne=this;try{return e()}finally{tne=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=one(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:o,treeLen:r,viewport:i,skipped:l}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,n,o,r)=>t.push({fromA:e,toA:n,fromB:o,toB:r}))),n=vte.applyChanges(n,t),o=qee.empty,r=0,i={from:e.mapPos(i.from,-1),to:e.mapPos(i.to,1)},this.skipped.length){l=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),o=e.mapPos(t.to,-1);ne.from&&(this.fragments=one(this.fragments,t,o),this.skipped.splice(n--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends bte{createParse(t,n,o){let r=o[0].from,i=o[o.length-1].to;return{parsedPos:r,advance(){let t=tne;if(t){for(let e of o)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=i,new qee(Vee.none,[],[],i-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return tne}}function one(e,t,n){return vte.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class rne{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new rne(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=nne.create(e.facet(sne).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new rne(n)}}Gte.state=e4.define({create:rne.init,update(e,t){for(let n of t.effects)if(n.is(Gte.setState))return n.value;return t.startState.facet(sne)!=t.state.facet(sne)?rne.init(t.state):e.apply(t)}});let ine=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(ine=e=>{let t=-1,n=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const lne="undefined"!=typeof navigator&&(null===(Vte=navigator.scheduling)||void 0===Vte?void 0:Vte.isInputPending)?()=>navigator.scheduling.isInputPending():null,ane=n6.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Gte.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Gte.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=ine(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndo+1e3,a=r.context.work((()=>lne&&lne()||Date.now()>i),o+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Gte.setState.of(new rne(r.context))})),this.chunkBudget>0&&(!a||l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>q5(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),sne=X3.define({combine:e=>e.length?e[0]:null,enables:e=>[Gte.state,ane,q7.contentAttributes.compute([e],(t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}}))]});class cne{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const une=X3.define(),dne=X3.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some((e=>e!=t[0])))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function pne(e){let t=e.facet(dne);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function hne(e,t){let n="",o=e.tabSize,r=e.facet(dne)[0];if("\t"==r){for(;t>=o;)n+="\t",t-=o;r=" "}for(let i=0;i=t?function(e,t,n){let o=t.resolveStack(n),r=o.node.enterUnfinishedNodesBefore(n);if(r!=o.node){let e=[];for(let t=r;t!=o.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)o={node:e[t],next:o}}return vne(o,e,n)}(e,n,t):null}class gne{constructor(e,t={}){this.state=e,this.options=t,this.unit=pne(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:o,simulateDoubleBreak:r}=this.options;return null!=o&&o>=n.from&&o<=n.to?r&&o==e?{text:"",from:e}:(t<0?o-1&&(r+=i-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return J4(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:o}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(o);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const mne=new Fee;function vne(e,t,n){for(let o=e;o;o=o.next){let e=bne(o.node);if(e)return e(One.create(t,n,o))}return 0}function bne(e){let t=e.type.prop(mne);if(t)return t;let n,o=e.firstChild;if(o&&(n=o.type.prop(Fee.closedBy))){let t=e.lastChild,o=t&&n.indexOf(t.name)>-1;return e=>$ne(e,!0,1,void 0,o&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?yne:null}function yne(){return 0}class One extends gne{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new One(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(wne(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return vne(this.context.next,this.base,this.pos)}}function wne(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function xne({closing:e,align:t=!0,units:n=1}){return o=>$ne(o,t,n,e)}function $ne(e,t,n,o,r){let i=e.textAfter,l=i.match(/^\s*/)[0].length,a=o&&i.slice(l,l+o.length)==o||r==e.pos+l,s=t?function(e){let t=e.node,n=t.childAfter(t.from),o=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,i=e.state.doc.lineAt(n.from),l=null==r||r<=i.from?i.to:Math.min(i.to,r);for(let a=n.to;;){let e=t.childAfter(a);if(!e||e==o)return null;if(!e.type.isSkipped)return e.from{let o=e&&e.test(n.textAfter);return n.baseIndent+(o?0:t*n.unit)}}const Cne=X3.define(),kne=new Fee;function Pne(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Mne(e,t,n){for(let o of e.facet(Cne)){let r=o(e,t,n);if(r)return r}return function(e,t,n){let o=Jte(e);if(o.lengthn)continue;if(r&&l.from=t&&o.to>n&&(r=o)}}return r}(e,t,n)}function Tne(e,t){let n=t.mapPos(e.from,1),o=t.mapPos(e.to,-1);return n>=o?void 0:{from:n,to:o}}const Ine=$4.define({map:Tne}),Ene=$4.define({map:Tne});function Ane(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some((e=>e.from<=n&&e.to>=n))||t.push(e.lineBlockAt(n));return t}const Rne=e4.define({create:()=>h5.none,update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(Ine)&&!jne(e,n.value.from,n.value.to)){let{preparePlaceholder:o}=t.state.facet(Lne),r=o?h5.replace({widget:new Wne(o(t.state,n.value))}):Fne;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(Ene)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:o}=t.selection.main;e.between(o,o,((e,t)=>{eo&&(n=!0)})),n&&(e=e.update({filterFrom:o,filterTo:o,filter:(e,t)=>t<=o||e>=o}))}return e},provide:e=>q7.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,((e,t)=>{n.push(e,t)})),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{(!r||r.from>e)&&(r={from:e,to:t})})),r}function jne(e,t,n){let o=!1;return e.between(t,t,((e,r)=>{e==t&&r==n&&(o=!0)})),o}function Bne(e,t){return e.field(Rne,!1)?t:t.concat($4.appendConfig.of(Qne()))}function Nne(e,t,n=!0){let o=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return q7.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${o} ${e.state.phrase("to")} ${r}.`)}const zne=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of Ane(e)){let n=Mne(e.state,t.from,t.to);if(n)return e.dispatch({effects:Bne(e.state,[Ine.of(n),Nne(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(Rne,!1))return!1;let t=[];for(let n of Ane(e)){let o=Dne(e.state,n.from,n.to);o&&t.push(Ene.of(o),Nne(e,o,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let o=0;o{let t=e.state.field(Rne,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,((e,t)=>{n.push(Ene.of({from:e,to:t}))})),e.dispatch({effects:n}),!0}}],_ne={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Lne=X3.define({combine:e=>B4(e,_ne)});function Qne(e){let t=[Rne,Yne];return e&&t.push(Lne.of(e)),t}function Hne(e,t){let{state:n}=e,o=n.facet(Lne),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),o=Dne(e.state,n.from,n.to);o&&e.dispatch({effects:Ene.of(o)}),t.preventDefault()};if(o.placeholderDOM)return o.placeholderDOM(e,r,t);let i=document.createElement("span");return i.textContent=o.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}const Fne=h5.replace({widget:new class extends d5{toDOM(e){return Hne(e,null)}}});class Wne extends d5{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Hne(e,this.value)}}const Zne={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Vne extends bee{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function Xne(e={}){let t=Object.assign(Object.assign({},Zne),e),n=new Vne(t,!0),o=new Vne(t,!1),r=n6.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(sne)!=e.state.facet(sne)||e.startState.field(Rne,!1)!=e.state.field(Rne,!1)||Jte(e.startState)!=Jte(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new H4;for(let r of e.viewportLineBlocks){let i=Dne(e.state,r.from,r.to)?o:Mne(e.state,r.from,r.to)?n:null;i&&t.add(r.from,r.from,i)}return t.finish()}}),{domEventHandlers:i}=t;return[r,xee({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||Q4.empty},initialSpacer:()=>new Vne(t,!1),domEventHandlers:Object.assign(Object.assign({},i),{click:(e,t,n)=>{if(i.click&&i.click(e,t,n))return!0;let o=Dne(e.state,t.from,t.to);if(o)return e.dispatch({effects:Ene.of(o)}),!0;let r=Mne(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:Ine.of(r)}),!0)}})}),Qne()]}const Yne=q7.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Kne{constructor(e,t){let n;function o(e){let t=r8.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?o(t.all):void 0,i=t.scope;this.scope=i instanceof Gte?e=>e.prop(Xte)==i.data:i?e=>e==i:void 0,this.style=Pte(e.map((e=>({tag:e.tag,class:e.class||o(Object.assign({},e,{tag:null}))}))),{all:r}).style,this.module=n?new r8(n):null,this.themeType=t.themeType}static define(e,t){return new Kne(e,t||{})}}const Gne=X3.define(),Une=X3.define({combine:e=>e.length?[e[0]]:null});function qne(e){let t=e.facet(Gne);return t.length?t:e.facet(Une)}function Jne(e,t){let n,o=[toe];return e instanceof Kne&&(e.module&&o.push(q7.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?o.push(Une.of(e)):n?o.push(Gne.computeN([q7.darkTheme],(t=>t.facet(q7.darkTheme)==("dark"==n)?[e]:[]))):o.push(Gne.of(e)),o}class eoe{constructor(e){this.markCache=Object.create(null),this.tree=Jte(e.state),this.decorations=this.buildDeco(e,qne(e.state))}update(e){let t=Jte(e.state),n=qne(e.state),o=n!=qne(e.startState);t.length{n.add(e,t,this.markCache[o]||(this.markCache[o]=h5.mark({class:o})))}),o,r);return n.finish()}}const toe=l4.high(n6.fromClass(eoe,{decorations:e=>e.decorations})),noe=Kne.define([{tag:Zte.meta,color:"#404740"},{tag:Zte.link,textDecoration:"underline"},{tag:Zte.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Zte.emphasis,fontStyle:"italic"},{tag:Zte.strong,fontWeight:"bold"},{tag:Zte.strikethrough,textDecoration:"line-through"},{tag:Zte.keyword,color:"#708"},{tag:[Zte.atom,Zte.bool,Zte.url,Zte.contentSeparator,Zte.labelName],color:"#219"},{tag:[Zte.literal,Zte.inserted],color:"#164"},{tag:[Zte.string,Zte.deleted],color:"#a11"},{tag:[Zte.regexp,Zte.escape,Zte.special(Zte.string)],color:"#e40"},{tag:Zte.definition(Zte.variableName),color:"#00f"},{tag:Zte.local(Zte.variableName),color:"#30a"},{tag:[Zte.typeName,Zte.namespace],color:"#085"},{tag:Zte.className,color:"#167"},{tag:[Zte.special(Zte.variableName),Zte.macroName],color:"#256"},{tag:Zte.definition(Zte.propertyName),color:"#00c"},{tag:Zte.comment,color:"#940"},{tag:Zte.invalid,color:"#f00"}]),ooe=q7.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),roe="()[]{}",ioe=X3.define({combine:e=>B4(e,{afterCursor:!0,brackets:roe,maxScanDistance:1e4,renderMatch:soe})}),loe=h5.mark({class:"cm-matchingBracket"}),aoe=h5.mark({class:"cm-nonmatchingBracket"});function soe(e){let t=[],n=e.matched?loe:aoe;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const coe=[e4.define({create:()=>h5.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],o=t.state.facet(ioe);for(let r of t.state.selection.ranges){if(!r.empty)continue;let e=foe(t.state,r.head,-1,o)||r.head>0&&foe(t.state,r.head-1,1,o)||o.afterCursor&&(foe(t.state,r.head,1,o)||r.headq7.decorations.from(e)}),ooe];function uoe(e={}){return[ioe.of(e),coe]}const doe=new Fee;function poe(e,t,n){let o=e.prop(t<0?Fee.openedBy:Fee.closedBy);if(o)return o;if(1==e.name.length){let o=n.indexOf(e.name);if(o>-1&&o%2==(t<0?1:0))return[n[o+t]]}return null}function hoe(e){let t=e.type.prop(doe);return t?t(e.node):e}function foe(e,t,n,o={}){let r=o.maxScanDistance||1e4,i=o.brackets||roe,l=Jte(e),a=l.resolveInner(t,n);for(let s=a;s;s=s.parent){let e=poe(s.type,n,i);if(e&&s.from0?t>=o.from&&to.from&&t<=o.to))return goe(0,0,n,s,o,e,i)}}return function(e,t,n,o,r,i,l){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),s=l.indexOf(a);if(s<0||s%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let p=0;!u.next().done&&p<=i;){let e=u.value;n<0&&(p+=e.length);let i=t+p*n;for(let t=n>0?0:e.length-1,a=n>0?e.length:-1;t!=a;t+=n){let a=l.indexOf(e[t]);if(!(a<0||o.resolveInner(i+t,1).type!=r))if(a%2==0==n>0)d++;else{if(1==d)return{start:c,end:{from:i+t,to:i+t+1},matched:a>>1==s>>1};d--}}n>0&&(p+=e.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,l,a.type,r,i)}function goe(e,t,n,o,r,i,l){let a=o.parent,s={from:r.from,to:r.to},c=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(o.from):u.childAfter(o.to)))do{if(n<0?u.to<=o.from:u.from>=o.to){if(0==c&&i.indexOf(u.type.name)>-1&&u.from-1||boe.push(e)}function xoe(e,t){let n=[];for(let a of t.split(" ")){let t=[];for(let n of a.split(".")){let o=e[n]||Zte[n];o?"function"==typeof o?t.length?t=t.map(o):woe(n):t.length?woe(n):t=Array.isArray(o)?o:[o]:woe(n)}for(let e of t)n.push(e)}if(!n.length)return 0;let o=t.replace(/ /g,"_"),r=o+" "+n.map((e=>e.id)),i=yoe[r];if(i)return i.id;let l=yoe[r]=Vee.define({id:voe.length,name:o,props:[Ste({[o]:n})]});return voe.push(l),l.id}function $oe(e,t){return({state:n,dispatch:o})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(o(n.update(r)),!0)}}x5.RTL,x5.LTR;const Soe=$oe(Toe,0),Coe=$oe(Moe,0),koe=$oe(((e,t)=>Moe(e,t,function(e){let t=[];for(let n of e.selection.ranges){let o=e.doc.lineAt(n.from),r=n.to<=o.to?o:e.doc.lineAt(n.to),i=t.length-1;i>=0&&t[i].to>o.from?t[i].to=r.to:t.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:r.to})}return t}(t))),0);function Poe(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function Moe(e,t,n=t.selection.ranges){let o=n.map((e=>Poe(t,e.from).block));if(!o.every((e=>e)))return null;let r=n.map(((e,n)=>function(e,{open:t,close:n},o,r){let i,l,a=e.sliceDoc(o-50,o),s=e.sliceDoc(r,r+50),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(s)[0].length,d=a.length-c;if(a.slice(d-t.length,d)==t&&s.slice(u,u+n.length)==n)return{open:{pos:o-c,margin:c&&1},close:{pos:r+u,margin:u&&1}};r-o<=100?i=l=e.sliceDoc(o,r):(i=e.sliceDoc(o,o+50),l=e.sliceDoc(r-50,r));let p=/^\s*/.exec(i)[0].length,h=/\s*$/.exec(l)[0].length,f=l.length-h-n.length;return i.slice(p,p+t.length)==t&&l.slice(f,f+n.length)==n?{open:{pos:o+p+t.length,margin:/\s/.test(i.charAt(p+t.length))?1:0},close:{pos:r-h-n.length,margin:/\s/.test(l.charAt(f-1))?1:0}}:null}(t,o[n],e.from,e.to)));if(2!=e&&!r.every((e=>e)))return{changes:t.changes(n.map(((e,t)=>r[t]?[]:[{from:e.from,insert:o[t].open+" "},{from:e.to,insert:" "+o[t].close}])))};if(1!=e&&r.some((e=>e))){let e=[];for(let t,n=0;nr&&(i==l||l>s.from)){r=s.from;let e=/^\s*/.exec(s.text)[0].length,t=e==s.length,i=s.text.slice(e,e+a.length)==a?e:-1;ee.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:r,indent:i,empty:l,single:a}of o)!a&&l||e.push({from:t.from+i,insert:r+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&o.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:n,token:r}of o)if(n>=0){let o=t.from+n,i=o+r.length;" "==t.text[i-t.from]&&i++,e.push({from:o,to:i})}return{changes:e}}return null}const Ioe=O4.define(),Eoe=O4.define(),Aoe=X3.define(),Roe=X3.define({combine:e=>B4(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,o)=>e(n,o)||t(n,o)})}),Doe=e4.define({create:()=>Goe.empty,update(e,t){let n=t.state.facet(Roe),o=t.annotation(Ioe);if(o){let r=Qoe.fromTransaction(t,o.selection),i=o.side,l=0==i?e.undone:e.done;return l=r?Hoe(l,l.length,n.minDepth,r):Zoe(l,t.startState.selection),new Goe(0==i?o.rest:l,0==i?l:o.rest)}let r=t.annotation(Eoe);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(S4.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let i=Qoe.fromTransaction(t),l=t.annotation(S4.time),a=t.annotation(S4.userEvent);return i?e=e.addChanges(i,l,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,a,n.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new Goe(e.done.map(Qoe.fromJSON),e.undone.map(Qoe.fromJSON))});function joe(e={}){return[Doe,Roe.of(e),q7.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?Noe:"historyRedo"==e.inputType?zoe:null;return!!n&&(e.preventDefault(),n(t))}})]}function Boe(e,t){return function({state:n,dispatch:o}){if(!t&&n.readOnly)return!1;let r=n.field(Doe,!1);if(!r)return!1;let i=r.pop(e,n,t);return!!i&&(o(i),!0)}}const Noe=Boe(0,!1),zoe=Boe(1,!1),_oe=Boe(0,!0),Loe=Boe(1,!0);class Qoe{constructor(e,t,n,o,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=o,this.selectionsAfter=r}setSelAfter(e){return new Qoe(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new Qoe(e.changes&&B3.fromJSON(e.changes),[],e.mapped&&j3.fromJSON(e.mapped),e.startSelection&&W3.fromJSON(e.startSelection),e.selectionsAfter.map(W3.fromJSON))}static fromTransaction(e,t){let n=Woe;for(let o of e.startState.facet(Aoe)){let t=o(e);t.length&&(n=n.concat(t))}return!n.length&&e.changes.empty?null:new Qoe(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Woe)}static selection(e){return new Qoe(void 0,Woe,void 0,void 0,e)}}function Hoe(e,t,n,o){let r=t+1>n+20?t-n-1:0,i=e.slice(r,t);return i.push(o),i}function Foe(e,t){return e.length?t.length?e.concat(t):e:t}const Woe=[];function Zoe(e,t){if(e.length){let n=e[e.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return o.length&&o[o.length-1].eq(t)?e:(o.push(t),Hoe(e,e.length-1,1e9,n.setSelAfter(o)))}return[Qoe.selection([t])]}function Voe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Xoe(e,t){if(!e.length)return e;let n=e.length,o=Woe;for(;n;){let r=Yoe(e[n-1],t,o);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,o=r.selectionsAfter}return o.length?[Qoe.selection(o)]:Woe}function Yoe(e,t,n){let o=Foe(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):Woe,n);if(!e.changes)return Qoe.selection(o);let r=e.changes.map(t),i=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(i):i;return new Qoe(r,$4.mapEffects(e.effects,t),l,e.startSelection.map(i),o)}const Koe=/^(input\.type|delete)($|\.)/;class Goe{constructor(e,t,n=0,o=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=o}isolate(){return this.prevTime?new Goe(this.done,this.undone):this}addChanges(e,t,n,o,r){let i=this.done,l=i[i.length-1];return i=l&&l.changes&&!l.changes.empty&&e.changes&&(!n||Koe.test(n))&&(!l.selectionsAfter.length&&t-this.prevTimen.push(e,t))),t.iterChangedRanges(((e,t,r,i)=>{for(let l=0;l=e&&r<=t&&(o=!0)}})),o}(l.changes,e.changes))||"input.type.compose"==n)?Hoe(i,i.length-1,o.minDepth,new Qoe(e.changes.compose(l.changes),Foe(e.effects,l.effects),l.mapped,l.startSelection,Woe)):Hoe(i,i.length,o.minDepth,e),new Goe(i,Woe,t,n)}addSelection(e,t,n,o){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Woe;return r.length>0&&t-this.prevTimee.empty!=l.ranges[t].empty)).length)?this:new Goe(Zoe(this.done,e),this.undone,t,n);var i,l}addMapping(e){return new Goe(Xoe(this.done,e),Xoe(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let o=0==e?this.done:this.undone;if(0==o.length)return null;let r=o[o.length-1],i=r.selectionsAfter[0]||t.selection;if(n&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:Ioe.of({side:e,rest:Voe(o),selection:i}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let n=1==o.length?Woe:o.slice(0,o.length-1);return r.mapped&&(n=Xoe(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:Ioe.of({side:e,rest:n,selection:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}Goe.empty=new Goe(Woe,Woe);const Uoe=[{key:"Mod-z",run:Noe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:zoe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:zoe,preventDefault:!0},{key:"Mod-u",run:_oe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Loe,preventDefault:!0}];function qoe(e,t){return W3.create(e.ranges.map(t),e.mainIndex)}function Joe(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function ere({state:e,dispatch:t},n){let o=qoe(e.selection,n);return!o.eq(e.selection,!0)&&(t(Joe(e,o)),!0)}function tre(e,t){return W3.cursor(t?e.to:e.from)}function nre(e,t){return ere(e,(n=>n.empty?e.moveByChar(n,t):tre(n,t)))}function ore(e){return e.textDirectionAt(e.state.selection.main.head)==x5.LTR}const rre=e=>nre(e,!ore(e)),ire=e=>nre(e,ore(e));function lre(e,t){return ere(e,(n=>n.empty?e.moveByGroup(n,t):tre(n,t)))}function are(e,t,n){if(t.type.prop(n))return!0;let o=t.to-t.from;return o&&(o>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function sre(e,t,n){let o,r,i=Jte(e).resolveInner(t.head),l=n?Fee.closedBy:Fee.openedBy;for(let a=t.head;;){let t=n?i.childAfter(a):i.childBefore(a);if(!t)break;are(e,t,l)?i=t:a=n?t.to:t.from}return r=i.type.prop(l)&&(o=n?foe(e,i.from,1):foe(e,i.to,-1))&&o.matched?n?o.end.to:o.end.from:n?i.to:i.from,W3.cursor(r,n?-1:1)}function cre(e,t){return ere(e,(n=>{if(!n.empty)return tre(n,t);let o=e.moveVertically(n,t);return o.head!=n.head?o:e.moveToLineBoundary(n,t)}))}const ure=e=>cre(e,!1),dre=e=>cre(e,!0);function pre(e){let t,n=e.scrollDOM.clientHeightn.empty?e.moveVertically(n,t,o.height):tre(n,t)));if(i.eq(r.selection))return!1;if(o.selfScroll){let t=e.coordsAtPos(r.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),a=l.top+o.marginTop,s=l.bottom-o.marginBottom;t&&t.top>a&&t.bottomhre(e,!1),gre=e=>hre(e,!0);function mre(e,t,n){let o=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?o.to:o.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==o.from&&o.length){let n=/^\s*/.exec(e.state.sliceDoc(o.from,Math.min(o.from+100,o.to)))[0].length;n&&t.head!=o.from+n&&(r=W3.cursor(o.from+n))}return r}function vre(e,t){let n=qoe(e.state.selection,(e=>{let n=t(e);return W3.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)}));return!n.eq(e.state.selection)&&(e.dispatch(Joe(e.state,n)),!0)}function bre(e,t){return vre(e,(n=>e.moveByChar(n,t)))}const yre=e=>bre(e,!ore(e)),Ore=e=>bre(e,ore(e));function wre(e,t){return vre(e,(n=>e.moveByGroup(n,t)))}function xre(e,t){return vre(e,(n=>e.moveVertically(n,t)))}const $re=e=>xre(e,!1),Sre=e=>xre(e,!0);function Cre(e,t){return vre(e,(n=>e.moveVertically(n,t,pre(e).height)))}const kre=e=>Cre(e,!1),Pre=e=>Cre(e,!0),Mre=({state:e,dispatch:t})=>(t(Joe(e,{anchor:0})),!0),Tre=({state:e,dispatch:t})=>(t(Joe(e,{anchor:e.doc.length})),!0),Ire=({state:e,dispatch:t})=>(t(Joe(e,{anchor:e.selection.main.anchor,head:0})),!0),Ere=({state:e,dispatch:t})=>(t(Joe(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function Are(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:o}=e,r=o.changeByRange((o=>{let{from:r,to:i}=o;if(r==i){let l=t(o);lr&&(n="delete.forward",l=Rre(e,l,!0)),r=Math.min(r,l),i=Math.max(i,l)}else r=Rre(e,r,!1),i=Rre(e,i,!0);return r==i?{range:o}:{changes:{from:r,to:i},range:W3.cursor(r,rt(e))))o.between(t,t,((e,o)=>{et&&(t=n?o:e)}));return t}const Dre=(e,t)=>Are(e,(n=>{let o,r,i=n.from,{state:l}=e,a=l.doc.lineAt(i);if(!t&&i>a.from&&iDre(e,!1),Bre=e=>Dre(e,!0),Nre=(e,t)=>Are(e,(n=>{let o=n.head,{state:r}=e,i=r.doc.lineAt(o),l=r.charCategorizer(o);for(let e=null;;){if(o==(t?i.to:i.from)){o==n.head&&i.number!=(t?r.doc.lines:1)&&(o+=t?1:-1);break}let a=C3(i.text,o-i.from,t)+i.from,s=i.text.slice(Math.min(o,a)-i.from,Math.max(o,a)-i.from),c=l(s);if(null!=e&&c!=e)break;" "==s&&o==n.head||(e=c),o=a}return o})),zre=e=>Nre(e,!1);function _re(e){let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.from),i=e.doc.lineAt(o.to);if(o.empty||o.to!=i.from||(i=e.doc.lineAt(o.to-1)),n>=r.number){let e=t[t.length-1];e.to=i.to,e.ranges.push(o)}else t.push({from:r.from,to:i.to,ranges:[o]});n=i.number+1}return t}function Lre(e,t,n){if(e.readOnly)return!1;let o=[],r=[];for(let i of _re(e)){if(n?i.to==e.doc.length:0==i.from)continue;let t=e.doc.lineAt(n?i.to+1:i.from-1),l=t.length+1;if(n){o.push({from:i.to,to:t.to},{from:i.from,insert:t.text+e.lineBreak});for(let t of i.ranges)r.push(W3.range(Math.min(e.doc.length,t.anchor+l),Math.min(e.doc.length,t.head+l)))}else{o.push({from:t.from,to:i.from},{from:i.to,insert:e.lineBreak+t.text});for(let e of i.ranges)r.push(W3.range(e.anchor-l,e.head-l))}}return!!o.length&&(t(e.update({changes:o,scrollIntoView:!0,selection:W3.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function Qre(e,t,n){if(e.readOnly)return!1;let o=[];for(let r of _re(e))n?o.push({from:r.from,insert:e.doc.slice(r.from,r.to)+e.lineBreak}):o.push({from:r.to,insert:e.lineBreak+e.doc.slice(r.from,r.to)});return t(e.update({changes:o,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Hre=Fre(!1);function Fre(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let o=t.changeByRange((n=>{let{from:o,to:r}=n,i=t.doc.lineAt(o),l=!e&&o==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,o=Jte(e).resolveInner(t),r=o.childBefore(t),i=o.childAfter(t);return r&&i&&r.to<=t&&i.from>=t&&(n=r.type.prop(Fee.closedBy))&&n.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,o);e&&(o=r=(r<=i.to?i:t.doc.lineAt(r)).to);let a=new gne(t,{simulateBreak:o,simulateDoubleBreak:!!l}),s=fne(a,o);for(null==s&&(s=J4(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));ri.from&&o{let r=[];for(let l=o.from;l<=o.to;){let i=e.doc.lineAt(l);i.number>n&&(o.empty||o.to>i.from)&&(t(i,r,o),n=i.number),l=i.to+1}let i=e.changes(r);return{changes:r,range:W3.range(i.mapPos(o.anchor,1),i.mapPos(o.head,1))}}))}const Zre=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Wre(e,((t,n)=>{n.push({from:t.from,insert:e.facet(dne)})})),{userEvent:"input.indent"})),!0),Vre=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Wre(e,((t,n)=>{let o=/^\s*/.exec(t.text)[0];if(!o)return;let r=J4(o,e.tabSize),i=0,l=hne(e,Math.max(0,r-pne(e)));for(;iere(e,(t=>sre(e.state,t,!ore(e)))),shift:e=>vre(e,(t=>sre(e.state,t,!ore(e))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>ere(e,(t=>sre(e.state,t,ore(e)))),shift:e=>vre(e,(t=>sre(e.state,t,ore(e))))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Lre(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>Qre(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Lre(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>Qre(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,o=null;return n.ranges.length>1?o=W3.create([n.main]):n.main.empty||(o=W3.create([W3.cursor(n.main.head)])),!!o&&(t(Joe(e,o)),!0)}},{key:"Mod-Enter",run:Fre(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=_re(e).map((({from:t,to:n})=>W3.range(t,Math.min(n+1,e.doc.length))));return t(e.update({selection:W3.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=qoe(e.selection,(t=>{var n;for(let o=Jte(e).resolveStack(t.from,1);o;o=o.next){let{node:e}=o;if((e.from=t.to||e.to>t.to&&e.from<=t.from)&&(null===(n=e.parent)||void 0===n?void 0:n.parent))return W3.range(e.to,e.from)}return t}));return t(Joe(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:Vre},{key:"Mod-]",run:Zre},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),o=new gne(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=Wre(e,((t,r,i)=>{let l=fne(o,t.from);if(null==l)return;/\S/.test(t.text)||(l=0);let a=/^\s*/.exec(t.text)[0],s=hne(e,l);(a!=s||i.from{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(_re(t).map((({from:e,to:n})=>(e>0?e--:ne.moveVertically(t,!0))).map(n);return e.dispatch({changes:n,selection:o,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let o=!1,r=qoe(e.selection,(t=>{let r=foe(e,t.head,-1)||foe(e,t.head,1)||t.head>0&&foe(e,t.head-1,1)||t.head{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),o=Poe(e.state,n.from);return o.line?Soe(e):!!o.block&&koe(e)}},{key:"Alt-A",run:Coe}].concat([{key:"ArrowLeft",run:rre,shift:yre,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>lre(e,!ore(e)),shift:e=>wre(e,!ore(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>ere(e,(t=>mre(e,t,!ore(e)))),shift:e=>vre(e,(t=>mre(e,t,!ore(e)))),preventDefault:!0},{key:"ArrowRight",run:ire,shift:Ore,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>lre(e,ore(e)),shift:e=>wre(e,ore(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>ere(e,(t=>mre(e,t,ore(e)))),shift:e=>vre(e,(t=>mre(e,t,ore(e)))),preventDefault:!0},{key:"ArrowUp",run:ure,shift:$re,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Mre,shift:Ire},{mac:"Ctrl-ArrowUp",run:fre,shift:kre},{key:"ArrowDown",run:dre,shift:Sre,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Tre,shift:Ere},{mac:"Ctrl-ArrowDown",run:gre,shift:Pre},{key:"PageUp",run:fre,shift:kre},{key:"PageDown",run:gre,shift:Pre},{key:"Home",run:e=>ere(e,(t=>mre(e,t,!1))),shift:e=>vre(e,(t=>mre(e,t,!1))),preventDefault:!0},{key:"Mod-Home",run:Mre,shift:Ire},{key:"End",run:e=>ere(e,(t=>mre(e,t,!0))),shift:e=>vre(e,(t=>mre(e,t,!0))),preventDefault:!0},{key:"Mod-End",run:Tre,shift:Ere},{key:"Enter",run:Hre},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:jre,shift:jre},{key:"Delete",run:Bre},{key:"Mod-Backspace",mac:"Alt-Backspace",run:zre},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>Nre(e,!0)},{mac:"Mod-Backspace",run:e=>Are(e,(t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}))},{mac:"Mod-Delete",run:e=>Are(e,(t=>{let n=e.moveToLineBoundary(t,!0).head;return t.headere(e,(t=>W3.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>vre(e,(t=>W3.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>ere(e,(t=>W3.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>vre(e,(t=>W3.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:Bre},{key:"Ctrl-h",run:jre},{key:"Ctrl-k",run:e=>Are(e,(t=>{let n=e.lineBlockAt(t.head).to;return t.head{if(e.readOnly)return!1;let n=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:p3.of(["",""])},range:W3.cursor(e.from)})));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,o=e.doc.lineAt(n),r=n==o.from?n-1:C3(o.text,n-o.from,!1)+o.from,i=n==o.to?n+1:C3(o.text,n-o.from,!0)+o.from;return{changes:{from:r,to:i,insert:e.doc.slice(n,i).append(e.doc.slice(r,n))},range:W3.cursor(i)}}));return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:gre}].map((e=>({mac:e.key,run:e.run,shift:e.shift}))))),Yre={key:"Tab",run:Zre,shift:Vre};function Kre(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)){var r=n[o];"string"==typeof r?e.setAttribute(o,r):null!=r&&(e[o]=r)}t++}for(;te.normalize("NFKD"):e=>e;class qre{constructor(e,t,n=0,o=e.length,r,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,o),this.bufferStart=n,this.normalize=r?e=>r(Ure(e)):Ure,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return I3(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=E3(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=A3(e);let o=this.normalize(t);for(let r=0,i=n;;r++){let e=o.charCodeAt(r),l=this.match(e,i);if(r==o.length-1){if(l)return this.value=l,this;break}i==n&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,o=n+t[0].length;if(this.matchPos=iie(this.text,o+(n==o?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,o,t)))return this.value={from:n,to:o,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=n||o.to<=t){let o=new oie(t,e.sliceString(t,n));return nie.set(e,o),o}if(o.from==t&&o.to==n)return o;let{text:r,from:i}=o;return i>t&&(r=e.sliceString(t,i)+r,i=t),o.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=iie(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=oie.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function iie(e,t){if(t>=e.length)return t;let n,o=e.lineAt(t);for(;t=56320&&n<57344;)t++;return t}function lie(e){let t=Kre("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:o}=e,r=o.doc.lineAt(o.selection.main.head),[,i,l,a,s]=n,c=a?+a.slice(1):0,u=l?+l:r.number;if(l&&s){let e=u/100;i&&(e=e*("-"==i?-1:1)+r.number/o.doc.lines),u=Math.round(o.doc.lines*e)}else l&&i&&(u=u*("-"==i?-1:1)+r.number);let d=o.doc.line(Math.max(1,Math.min(o.doc.lines,u))),p=W3.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[aie.of(!1),q7.scrollIntoView(p.from,{y:"center"})],selection:p}),e.focus()}return{dom:Kre("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:aie.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},Kre("label",e.state.phrase("Go to line"),": ",t)," ",Kre("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(tie.prototype[Symbol.iterator]=rie.prototype[Symbol.iterator]=function(){return this});const aie=$4.define(),sie=e4.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(aie)&&(e=n.value);return e},provide:e=>vee.from(e,(e=>e?lie:null))}),cie=q7.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),uie={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},die=X3.define({combine:e=>B4(e,uie,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})});function pie(e){let t=[vie,mie];return e&&t.push(die.of(e)),t}const hie=h5.mark({class:"cm-selectionMatch"}),fie=h5.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function gie(e,t,n,o){return!(0!=n&&e(t.sliceDoc(n-1,n))==E4.Word||o!=t.doc.length&&e(t.sliceDoc(o,o+1))==E4.Word)}const mie=n6.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(die),{state:n}=e,o=n.selection;if(o.ranges.length>1)return h5.none;let r,i=o.main,l=null;if(i.empty){if(!t.highlightWordAroundCursor)return h5.none;let e=n.wordAt(i.head);if(!e)return h5.none;l=n.charCategorizer(i.head),r=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e200)return h5.none;if(t.wholeWords){if(r=n.sliceDoc(i.from,i.to),l=n.charCategorizer(i.head),!gie(l,n,i.from,i.to)||!function(e,t,n,o){return e(t.sliceDoc(n,n+1))==E4.Word&&e(t.sliceDoc(o-1,o))==E4.Word}(l,n,i.from,i.to))return h5.none}else if(r=n.sliceDoc(i.from,i.to).trim(),!r)return h5.none}let a=[];for(let s of e.visibleRanges){let e=new qre(n.doc,r,s.from,s.to);for(;!e.next().done;){let{from:o,to:r}=e.value;if((!l||gie(l,n,o,r))&&(i.empty&&o<=i.from&&r>=i.to?a.push(fie.range(o,r)):(o>=i.to||r<=i.from)&&a.push(hie.range(o,r)),a.length>t.maxMatches))return h5.none}}return h5.set(a)}},{decorations:e=>e.decorations}),vie=q7.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),bie=X3.define({combine:e=>B4(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Xie(e),scrollToMatch:e=>q7.scrollIntoView(e)})});class yie{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,eie),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new kie(this):new xie(this)}getCursor(e,t=0,n){let o=e.doc?e:j4.create({doc:e});return null==n&&(n=o.doc.length),this.regexp?$ie(this,o,t,n):wie(this,o,t,n)}}class Oie{constructor(e){this.spec=e}}function wie(e,t,n,o){return new qre(t.doc,e.unquoted,n,o,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(r=t.doc,i=t.charCategorizer(t.selection.main.head),(e,t,n,o)=>((o>e||o+n.length=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=wie(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}function $ie(e,t,n,o){return new tie(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(r(Sie(n.input,n.index))!=E4.Word||r(Cie(n.input,n.index))!=E4.Word)&&(r(Cie(n.input,n.index+n[0].length))!=E4.Word||r(Sie(n.input,n.index+n[0].length))!=E4.Word)):void 0},n,o);var r}function Sie(e,t){return e.slice(C3(e,t,!1),t)}function Cie(e,t){return e.slice(t,C3(e,t))}class kie extends Oie{nextMatch(e,t,n){let o=$ie(this.spec,e,n,e.doc.length).next();return o.done&&(o=$ie(this.spec,e,0,t).next()),o.done?null:o.value}prevMatchInRange(e,t,n){for(let o=1;;o++){let r=Math.max(t,n-1e4*o),i=$ie(this.spec,e,r,n),l=null;for(;!i.next().done;)l=i.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=$ie(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}const Pie=$4.define(),Mie=$4.define(),Tie=e4.define({create:e=>new Iie(Qie(e).create(),null),update(e,t){for(let n of t.effects)n.is(Pie)?e=new Iie(n.value.create(),e.panel):n.is(Mie)&&(e=new Iie(e.query,n.value?Lie:null));return e},provide:e=>vee.from(e,(e=>e.panel))});class Iie{constructor(e,t){this.query=e,this.panel=t}}const Eie=h5.mark({class:"cm-searchMatch"}),Aie=h5.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Rie=n6.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Tie))}update(e){let t=e.state.field(Tie);(t!=e.startState.field(Tie)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return h5.none;let{view:n}=this,o=new H4;for(let r=0,i=n.visibleRanges,l=i.length;ri[r+1].from-500;)a=i[++r].to;e.highlight(n.state,t,a,((e,t)=>{let r=n.state.selection.ranges.some((n=>n.from==e&&n.to==t));o.add(e,t,r?Aie:Eie)}))}return o.finish()}},{decorations:e=>e.decorations});function Die(e){return t=>{let n=t.state.field(Tie,!1);return n&&n.query.spec.valid?e(t,n):Wie(t)}}const jie=Die(((e,{query:t})=>{let{to:n}=e.state.selection.main,o=t.nextMatch(e.state,n,n);if(!o)return!1;let r=W3.single(o.from,o.to),i=e.state.facet(bie);return e.dispatch({selection:r,effects:[Gie(e,o),i.scrollToMatch(r.main,e)],userEvent:"select.search"}),Fie(e),!0})),Bie=Die(((e,{query:t})=>{let{state:n}=e,{from:o}=n.selection.main,r=t.prevMatch(n,o,o);if(!r)return!1;let i=W3.single(r.from,r.to),l=e.state.facet(bie);return e.dispatch({selection:i,effects:[Gie(e,r),l.scrollToMatch(i.main,e)],userEvent:"select.search"}),Fie(e),!0})),Nie=Die(((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:W3.create(n.map((e=>W3.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),zie=Die(((e,{query:t})=>{let{state:n}=e,{from:o,to:r}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,o,o);if(!i)return!1;let l,a,s=[],c=[];if(i.from==o&&i.to==r&&(a=n.toText(t.getReplacement(i)),s.push({from:i.from,to:i.to,insert:a}),i=t.nextMatch(n,i.from,i.to),c.push(q7.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(o).number)+"."))),i){let t=0==s.length||s[0].from>=i.to?0:i.to-i.from-a.length;l=W3.single(i.from-t,i.to-t),c.push(Gie(e,i)),c.push(n.facet(bie).scrollToMatch(l.main,e))}return e.dispatch({changes:s,selection:l,effects:c,userEvent:"input.replace"}),!0})),_ie=Die(((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map((e=>{let{from:n,to:o}=e;return{from:n,to:o,insert:t.getReplacement(e)}}));if(!n.length)return!1;let o=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:q7.announce.of(o),userEvent:"input.replace.all"}),!0}));function Lie(e){return e.state.facet(bie).createPanel(e)}function Qie(e,t){var n,o,r,i,l;let a=e.selection.main,s=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!s)return t;let c=e.facet(bie);return new yie({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?s:s.replace(/\n/g,"\\n"),caseSensitive:null!==(o=null==t?void 0:t.caseSensitive)&&void 0!==o?o:c.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(l=null==t?void 0:t.wholeWord)&&void 0!==l?l:c.wholeWord})}function Hie(e){let t=hee(e,Lie);return t&&t.dom.querySelector("[main-field]")}function Fie(e){let t=Hie(e);t&&t==e.root.activeElement&&t.select()}const Wie=e=>{let t=e.state.field(Tie,!1);if(t&&t.panel){let n=Hie(e);if(n&&n!=e.root.activeElement){let o=Qie(e.state,t.query.spec);o.valid&&e.dispatch({effects:Pie.of(o)}),n.focus(),n.select()}}else e.dispatch({effects:[Mie.of(!0),t?Pie.of(Qie(e.state,t.query.spec)):$4.appendConfig.of(qie)]});return!0},Zie=e=>{let t=e.state.field(Tie,!1);if(!t||!t.panel)return!1;let n=hee(e,Lie);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Mie.of(!1)}),!0},Vie=[{key:"Mod-f",run:Wie,scope:"editor search-panel"},{key:"F3",run:jie,shift:Bie,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:jie,shift:Bie,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Zie,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:o,to:r}=n.main,i=[],l=0;for(let a=new qre(e.doc,e.sliceDoc(o,r));!a.next().done;){if(i.length>1e3)return!1;a.value.from==o&&(l=i.length),i.push(W3.range(a.value.from,a.value.to))}return t(e.update({selection:W3.create(i,l),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=hee(e,lie);if(!t){let n=[aie.of(!0)];null==e.state.field(sie,!1)&&n.push($4.appendConfig.of([sie,cie])),e.dispatch({effects:n}),t=hee(e,lie)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:n}=e,o=W3.create(n.ranges.map((t=>e.wordAt(t.head)||W3.cursor(t.head))),n.mainIndex);return!o.eq(n)&&(t(e.update({selection:o})),!0)})({state:e,dispatch:t});let o=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=o)))return!1;let r=function(e,t){let{main:n,ranges:o}=e.selection,r=e.wordAt(n.head),i=r&&r.from==n.from&&r.to==n.to;for(let l=!1,a=new qre(e.doc,t,o[o.length-1].to);;){if(a.next(),!a.done){if(l&&o.some((e=>e.from==a.value.from)))continue;if(i){let t=e.wordAt(a.value.from);if(!t||t.from!=a.value.from||t.to!=a.value.to)continue}return a.value}if(l)return null;a=new qre(e.doc,t,0,Math.max(0,o[o.length-1].from-1)),l=!0}}(e,o);return!!r&&(t(e.update({selection:e.selection.addRange(W3.range(r.from,r.to),!1),effects:q7.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class Xie{constructor(e){this.view=e;let t=this.query=e.state.field(Tie).query.spec;function n(e,t,n){return Kre("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=Kre("input",{value:t.search,placeholder:Yie(e,"Find"),"aria-label":Yie(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Kre("input",{value:t.replace,placeholder:Yie(e,"Replace"),"aria-label":Yie(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Kre("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Kre("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Kre("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=Kre("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",(()=>jie(e)),[Yie(e,"next")]),n("prev",(()=>Bie(e)),[Yie(e,"previous")]),n("select",(()=>Nie(e)),[Yie(e,"all")]),Kre("label",null,[this.caseField,Yie(e,"match case")]),Kre("label",null,[this.reField,Yie(e,"regexp")]),Kre("label",null,[this.wordField,Yie(e,"by word")]),...e.state.readOnly?[]:[Kre("br"),this.replaceField,n("replace",(()=>zie(e)),[Yie(e,"replace")]),n("replaceAll",(()=>_ie(e)),[Yie(e,"replace all")])],Kre("button",{name:"close",onclick:()=>Zie(e),"aria-label":Yie(e,"close"),type:"button"},["×"])])}commit(){let e=new yie({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Pie.of(e)}))}keydown(e){var t,n,o;t=this.view,n=e,o="search-panel",u9(s9(t.state),n,t,o)?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Bie:jie)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),zie(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Pie)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(bie).top}}function Yie(e,t){return e.state.phrase(t)}const Kie=/[\s\.,:;?!]/;function Gie(e,{from:t,to:n}){let o=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,i=Math.max(o.from,t-30),l=Math.min(r,n+30),a=e.state.sliceDoc(i,l);if(i!=o.from)for(let s=0;s<30;s++)if(!Kie.test(a[s+1])&&Kie.test(a[s])){a=a.slice(s);break}if(l!=r)for(let s=a.length-1;s>a.length-30;s--)if(!Kie.test(a[s-1])&&Kie.test(a[s])){a=a.slice(0,s);break}return q7.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${o.number}.`)}const Uie=q7.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),qie=[Tie,l4.low(Rie),Uie];class Jie{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=Jte(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),o=t.text.slice(n-t.from,this.pos-t.from),r=o.search(rle(e,!1));return r<0?null:{from:n+r,to:this.pos,text:o.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function ele(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function tle(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[n,o]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e{let r=e.matchBefore(o);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}class nle{constructor(e,t,n,o){this.completion=e,this.source=t,this.match=n,this.score=o}}function ole(e){return e.selection.main.from}function rle(e,t){var n;let{source:o}=e,r=t&&"^"!=o[0],i="$"!=o[o.length-1];return r||i?new RegExp(`${r?"^":""}(?:${o})${i?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const ile=O4.define(),lle=new WeakMap;function ale(e){if(!Array.isArray(e))return e;let t=lle.get(e);return t||lle.set(e,t=tle(e)),t}const sle=$4.define(),cle=$4.define();class ule{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&o<=57||o>=97&&o<=122?2:o>=65&&o<=90?1:0:(s=E3(o))!=s.toLowerCase()?1:s!=s.toUpperCase()?2:0;(!v||1==b&&g||0==y&&0!=b)&&(t[u]==o||n[u]==o&&(d=!0)?i[u++]=v:i.length&&(m=!1)),y=b,v+=A3(o)}return u==a&&0==i[0]&&m?this.result((d?-200:0)-100,i,e):p==a&&0==h?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):p==a?this.ret(-900-e.length,[h,f]):u==a?this.result((d?-200:0)-100-700+(m?0:-1100),i,e):2!=t.length&&this.result((o[0]?-700:0)-200-1100,o,e)}result(e,t,n){let o=[],r=0;for(let i of t){let e=i+(this.astral?A3(I3(n,i)):1);r&&o[r-1]==i?o[r-1]=e:(o[r++]=i,o[r++]=e)}return this.ret(e-n.length,o)}}const dle=X3.define({combine:e=>B4(e,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:hle,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>ple(e(n),t(n)),optionClass:(e,t)=>n=>ple(e(n),t(n)),addToOptions:(e,t)=>e.concat(t)})});function ple(e,t){return e?t?e+" "+t:e:t}function hle(e,t,n,o,r,i){let l,a,s=e.textDirection==x5.RTL,c=s,u=!1,d="top",p=t.left-r.left,h=r.right-t.right,f=o.right-o.left,g=o.bottom-o.top;if(c&&p=g||e>t.top?l=n.bottom-t.top:(d="bottom",l=t.bottom-n.top)}return{style:`${d}: ${l/((t.bottom-t.top)/i.offsetHeight)}px; max-width: ${a/((t.right-t.left)/i.offsetWidth)}px`,class:"cm-completionInfo-"+(u?s?"left-narrow":"right-narrow":c?"left":"right")}}function fle(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let o=Math.floor((e-t)/n);return{from:e-(o+1)*n,to:e-o*n}}class gle{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let o=e.state.field(t),{options:r,selected:i}=o.open,l=e.state.facet(dle);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,o){let r=document.createElement("span");r.className="cm-completionLabel";let i=e.displayLabel||e.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(i.slice(l,e)));let n=r.appendChild(document.createElement("span"));n.appendChild(document.createTextNode(i.slice(e,t))),n.className="cm-completionMatchedText",l=t}return le.position-t.position)).map((e=>e.render))}(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=fle(r.length,i,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",(n=>{let{options:o}=e.state.field(t).open;for(let t,r=n.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(t=/-(\d+)$/.exec(r.id))&&+t[1]{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(dle).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:cle.of(null)})})),this.showOptions(r,o.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(e){var t;let n=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=o){let{options:r,selected:i,disabled:l}=n.open;o.open&&o.open.options==r||(this.range=fle(r.length,i,e.state.facet(dle).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),l!=(null===(t=o.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=fle(t.options.length,t.selected,this.view.state.facet(dle).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:o}=n;if(!o)return;let r="string"==typeof o?document.createTextNode(o):o(n);if(!r)return;"then"in r?r.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)})).catch((e=>q5(this.view.state,e,"completion info"))):this.addInfoPane(r,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:o}=e;n.appendChild(t),this.infoDestroy=o||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,o=this.range.from;n;n=n.nextSibling,o++)"LI"==n.nodeName&&n.id?o==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected"):o--;return t&&function(e,t){let n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.height/e.offsetHeight;o.topn.bottom&&(e.scrollTop+=(o.bottom-n.bottom)/r)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return o.top>Math.min(r.bottom,t.bottom)-10||o.bottomn.from||0==n.from)&&(r=e,"string"!=typeof s&&s.header?o.appendChild(s.header(s)):o.appendChild(document.createElement("completion-section")).textContent=e)}const c=o.appendChild(document.createElement("li"));c.id=t+"-"+i,c.setAttribute("role","option");let u=this.optionClass(l);u&&(c.className=u);for(let e of this.optionContent){let t=e(l,this.view.state,this.view,a);t&&c.appendChild(t)}}return n.from&&o.classList.add("cm-completionListIncompleteTop"),n.tonew gle(n,e,t)}function vle(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class ble{constructor(e,t,n,o,r,i){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=o,this.selected=r,this.disabled=i}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new ble(this.options,wle(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,o,r){let i=function(e,t){let n=[],o=null,r=e=>{n.push(e);let{section:t}=e.completion;if(t){o||(o=[]);let e="string"==typeof t?t:t.name;o.some((t=>t.name==e))||o.push("string"==typeof t?{name:e}:t)}};for(let s of e)if(s.hasResult()){let e=s.result.getMatch;if(!1===s.result.filter)for(let t of s.result.options)r(new nle(t,s.source,e?e(t):[],1e9-n.length));else{let n=new ule(t.sliceDoc(s.from,s.to));for(let t of s.result.options)if(n.match(t.label)){let o=t.displayLabel?e?e(t,n.matched):[]:n.matched;r(new nle(t,s.source,o,n.score+(t.boost||0)))}}}if(o){let e=Object.create(null),t=0,r=(e,t)=>{var n,o;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(o=t.rank)&&void 0!==o?o:1e9)||(e.namet.score-e.score||a(e.completion,t.completion)))){let e=s.completion;!l||l.label!=e.label||l.detail!=e.detail||null!=l.type&&null!=e.type&&l.type!=e.type||l.apply!=e.apply||l.boost!=e.boost?i.push(s):vle(s.completion)>vle(l)&&(i[i.length-1]=s),l=s.completion}return i}(e,t);if(!i.length)return o&&e.some((e=>1==e.state))?new ble(o.options,o.attrs,o.tooltip,o.timestamp,o.selected,!0):null;let l=t.facet(dle).selectOnOpen?0:-1;if(o&&o.selected!=l&&-1!=o.selected){let e=o.options[o.selected].completion;for(let t=0;tt.hasResult()?Math.min(e,t.from):e),1e8),create:Ile,above:r.aboveCursor},o?o.timestamp:Date.now(),l,!1)}map(e){return new ble(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class yle{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new yle(xle,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(dle),o=(n.override||t.languageDataAt("autocomplete",ole(t)).map(ale)).map((t=>(this.active.find((e=>e.source==t))||new Sle(t,this.active.some((e=>0!=e.state))?1:0)).update(e,n)));o.length==this.active.length&&o.every(((e,t)=>e==this.active[t]))&&(o=this.active);let r=this.open;r&&e.docChanged&&(r=r.map(e.changes)),e.selection||o.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let n=0,o=0;;){for(;n1==e.state))&&(r=null),!r&&o.every((e=>1!=e.state))&&o.some((e=>e.hasResult()))&&(o=o.map((e=>e.hasResult()?new Sle(e.source,0):e)));for(let i of e.effects)i.is(Ple)&&(r=r&&r.setSelected(i.value,this.id));return o==this.active&&r==this.open?this:new yle(o,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Ole}}const Ole={"aria-autocomplete":"list"};function wle(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const xle=[];function $le(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class Sle{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=$le(e),o=this;n?o=o.handleUserEvent(e,n,t):e.docChanged?o=o.handleChange(e):e.selection&&0!=o.state&&(o=new Sle(o.source,0));for(let r of e.effects)if(r.is(sle))o=new Sle(o.source,1,r.value?ole(e.state):-1);else if(r.is(cle))o=new Sle(o.source,0);else if(r.is(kle))for(let e of r.value)e.source==o.source&&(o=e);return o}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new Sle(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(ole(e.startState))?new Sle(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Sle(this.source,this.state,e.mapPos(this.explicitPos))}}class Cle extends Sle{constructor(e,t,n,o,r){super(e,2,t),this.result=n,this.from=o,this.to=r}hasResult(){return!0}handleUserEvent(e,t,n){var o;let r=e.changes.mapPos(this.from),i=e.changes.mapPos(this.to,1),l=ole(e.state);if((this.explicitPos<0?l<=r:li||"delete"==t&&ole(e.startState)==this.from)return new Sle(this.source,"input"==t&&n.activateOnTyping?1:0);let a,s=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,o){if(!e)return!1;let r=t.sliceDoc(n,o);return"function"==typeof e?e(r,n,o,t):rle(e,!0).test(r)}(this.result.validFor,e.state,r,i)?new Cle(this.source,s,this.result,r,i):this.result.update&&(a=this.result.update(this.result,r,i,new Jie(e.state,l,s>=0)))?new Cle(this.source,s,a,a.from,null!==(o=a.to)&&void 0!==o?o:ole(e.state)):new Sle(this.source,1,s)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Sle(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Cle(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}const kle=$4.define({map:(e,t)=>e.map((e=>e.map(t)))}),Ple=$4.define(),Mle=e4.define({create:()=>yle.start(),update:(e,t)=>e.update(t),provide:e=>[ree.from(e,(e=>e.tooltip)),q7.contentAttributes.from(e,(e=>e.attrs))]});function Tle(e,t){const n=t.completion.apply||t.completion.label;let o=e.state.field(Mle).active.find((e=>e.source==t.source));return o instanceof Cle&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,o){let{main:r}=e.selection,i=n-r.from,l=o-r.from;return Object.assign(Object.assign({},e.changeByRange((a=>a!=r&&n!=o&&e.sliceDoc(a.from+i,a.from+l)!=e.sliceDoc(n,o)?{range:a}:{changes:{from:a.from+i,to:o==r.from?a.to:a.from+l,insert:t},range:W3.cursor(a.from+i+t.length)}))),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,o.from,o.to)),{annotations:ile.of(t.completion)})):n(e,t.completion,o.from,o.to),!0)}const Ile=mle(Mle,Tle);function Ele(e,t="option"){return n=>{let o=n.state.field(Mle,!1);if(!o||!o.open||o.open.disabled||Date.now()-o.open.timestamp-1?o.open.selected+i*(e?1:-1):e?0:l-1;return a<0?a="page"==t?0:l-1:a>=l&&(a="page"==t?l-1:0),n.dispatch({effects:Ple.of(a)}),!0}}class Ale{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Rle=n6.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let t of e.state.field(Mle).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(Mle);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Mle)==t)return;let n=e.transactions.some((e=>(e.selection||e.docChanged)&&!$le(e)));for(let o=0;o50&&Date.now()-t.time>1e3){for(let e of t.context.abortListeners)try{e()}catch(Lpe){q5(this.view.state,Lpe)}t.context.abortListeners=null,this.running.splice(o--,1)}else t.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let o of e.transactions)"input"==$le(o)?this.composing=2:2==this.composing&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(Mle);for(let n of t.active)1!=n.state||this.running.some((e=>e.active.source==n.source))||this.startQuery(n)}startQuery(e){let{state:t}=this.view,n=ole(t),o=new Jie(t,n,e.explicitPos==n),r=new Ale(e,o);this.running.push(r),Promise.resolve(e.source(o)).then((e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:cle.of(null)}),q5(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(dle).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(dle);for(let o=0;oe.source==r.active.source));if(i&&1==i.state)if(null==r.done){let e=new Sle(r.active.source,0);for(let t of r.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(i)}t.length&&this.view.dispatch({effects:kle.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Mle,!1);if(t&&t.tooltip&&this.view.state.facet(dle).closeOnBlur){let n=t.open&&uee(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||this.view.dispatch({effects:cle.of(null)})}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:sle.of(!1)})),20),this.composing=0}}}),Dle=q7.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class jle{constructor(e,t,n,o){this.field=e,this.line=t,this.from=n,this.to=o}}class Ble{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,D3.TrackDel),n=e.mapPos(this.to,1,D3.TrackDel);return null==t||null==n?null:new Ble(this.field,t,n)}}class Nle{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],o=[t],r=e.doc.lineAt(t),i=/^\s*/.exec(r.text)[0];for(let l of this.lines){if(n.length){let n=i,r=/^\t*/.exec(l)[0].length;for(let t=0;tnew Ble(e.field,o[e.line]+e.from,o[e.line]+e.to)))}}static parse(e){let t,n=[],o=[],r=[];for(let i of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(i);){let e=t[1]?+t[1]:null,l=t[2]||t[3]||"",a=-1;for(let t=0;t=a&&e.field++}r.push(new jle(a,o.length,t.index,t.index+l.length)),i=i.slice(0,t.index)+l+i.slice(t.index+t[0].length)}for(let e;e=/\\([{}])/.exec(i);){i=i.slice(0,e.index)+e[1]+i.slice(e.index+e[0].length);for(let t of r)t.line==o.length&&t.from>e.index&&(t.from--,t.to--)}o.push(i)}return new Nle(o,r)}}let zle=h5.widget({widget:new class extends d5{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),_le=h5.mark({class:"cm-snippetField"});class Lle{constructor(e,t){this.ranges=e,this.active=t,this.deco=h5.set(e.map((e=>(e.from==e.to?zle:_le).range(e.from,e.to))))}map(e){let t=[];for(let n of this.ranges){let o=n.map(e);if(!o)return null;t.push(o)}return new Lle(t,this.active)}selectionInsideField(e){return e.ranges.every((e=>this.ranges.some((t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))))}}const Qle=$4.define({map:(e,t)=>e&&e.map(t)}),Hle=$4.define(),Fle=e4.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(Qle))return n.value;if(n.is(Hle)&&e)return new Lle(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>q7.decorations.from(e,(e=>e?e.deco:h5.none))});function Wle(e,t){return W3.create(e.filter((e=>e.field==t)).map((e=>W3.range(e.from,e.to))))}function Zle(e){let t=Nle.parse(e);return(e,n,o,r)=>{let{text:i,ranges:l}=t.instantiate(e.state,o),a={changes:{from:o,to:r,insert:p3.of(i)},scrollIntoView:!0,annotations:n?ile.of(n):void 0};if(l.length&&(a.selection=Wle(l,0)),l.length>1){let t=new Lle(l,0),n=a.effects=[Qle.of(t)];void 0===e.state.field(Fle,!1)&&n.push($4.appendConfig.of([Fle,Kle,Ule,Dle]))}e.dispatch(e.state.update(a))}}function Vle(e){return({state:t,dispatch:n})=>{let o=t.field(Fle,!1);if(!o||e<0&&0==o.active)return!1;let r=o.active+e,i=e>0&&!o.ranges.some((t=>t.field==r+e));return n(t.update({selection:Wle(o.ranges,r),effects:Qle.of(i?null:new Lle(o.ranges,r)),scrollIntoView:!0})),!0}}const Xle=[{key:"Tab",run:Vle(1),shift:Vle(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(Fle,!1)&&(t(e.update({effects:Qle.of(null)})),!0)}],Yle=X3.define({combine:e=>e.length?e[0]:Xle}),Kle=l4.highest(l9.compute([Yle],(e=>e.facet(Yle))));function Gle(e,t){return Object.assign(Object.assign({},t),{apply:Zle(e)})}const Ule=q7.domEventHandlers({mousedown(e,t){let n,o=t.state.field(Fle,!1);if(!o||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=o.ranges.find((e=>e.from<=n&&e.to>=n));return!(!r||r.field==o.active||(t.dispatch({selection:Wle(o.ranges,r.field),effects:Qle.of(o.ranges.some((e=>e.field>r.field))?new Lle(o.ranges,r.field):null),scrollIntoView:!0}),0))}}),qle={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Jle=$4.define({map(e,t){let n=t.mapPos(e,-1,D3.TrackAfter);return null==n?void 0:n}}),eae=new class extends N4{};eae.startSide=1,eae.endSide=-1;const tae=e4.define({create:()=>Q4.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Jle)&&(e=e.update({add:[eae.range(n.value,n.value+1)]}));return e}}),nae="()[]{}<>";function oae(e){for(let t=0;t<8;t+=2)if(nae.charCodeAt(t)==e)return nae.charAt(t+1);return E3(e<128?e:e+1)}function rae(e,t){return e.languageDataAt("closeBrackets",t)[0]||qle}const iae="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),lae=q7.inputHandler.of(((e,t,n,o)=>{if((iae?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(o.length>2||2==o.length&&1==A3(I3(o,0))||t!=r.from||n!=r.to)return!1;let i=function(e,t){let n=rae(e,e.selection.main.head),o=n.brackets||qle.brackets;for(let r of o){let i=oae(I3(r,0));if(t==r)return i==r?pae(e,r,o.indexOf(r+r+r)>-1,n):uae(e,r,i,n.before||qle.before);if(t==i&&sae(e,e.selection.main.from))return dae(e,0,i)}return null}(e.state,o);return!!i&&(e.dispatch(i),!0)})),aae=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=rae(e,e.selection.main.head).brackets||qle.brackets,o=null,r=e.changeByRange((t=>{if(t.empty){let o=function(e,t){let n=e.sliceString(t-2,t);return A3(I3(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let r of n)if(r==o&&cae(e.doc,t.head)==oae(I3(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:W3.cursor(t.head-r.length)}}return{range:o=t}}));return o||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!o}}];function sae(e,t){let n=!1;return e.field(tae).between(0,e.doc.length,(e=>{e==t&&(n=!0)})),n}function cae(e,t){let n=e.sliceString(t,t+2);return n.slice(0,A3(I3(n,0)))}function uae(e,t,n,o){let r=null,i=e.changeByRange((i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:n,from:i.to}],effects:Jle.of(i.to+t.length),range:W3.range(i.anchor+t.length,i.head+t.length)};let l=cae(e.doc,i.head);return!l||/\s/.test(l)||o.indexOf(l)>-1?{changes:{insert:t+n,from:i.head},effects:Jle.of(i.head+t.length),range:W3.cursor(i.head+t.length)}:{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function dae(e,t,n){let o=null,r=e.changeByRange((t=>t.empty&&cae(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:W3.cursor(t.head+n.length)}:o={range:t}));return o?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function pae(e,t,n,o){let r=o.stringPrefixes||qle.stringPrefixes,i=null,l=e.changeByRange((o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:t,from:o.to}],effects:Jle.of(o.to+t.length),range:W3.range(o.anchor+t.length,o.head+t.length)};let l,a=o.head,s=cae(e.doc,a);if(s==t){if(hae(e,a))return{changes:{insert:t+t,from:a},effects:Jle.of(a+t.length),range:W3.cursor(a+t.length)};if(sae(e,a)){let o=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+o.length,insert:o},range:W3.cursor(a+o.length)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(l=fae(e,a-2*t.length,r))>-1&&hae(e,l))return{changes:{insert:t+t+t+t,from:a},effects:Jle.of(a+t.length),range:W3.cursor(a+t.length)};if(e.charCategorizer(a)(s)!=E4.Word&&fae(e,a,r)>-1&&!function(e,t,n,o){let r=Jte(e).resolveInner(t,-1),i=o.reduce(((e,t)=>Math.max(e,t.length)),0);for(let l=0;l<5;l++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+i)),a=l.indexOf(n);if(!a||a>-1&&o.indexOf(l.slice(0,a))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let s=r.to==t&&r.parent;if(!s)break;r=s}return!1}(e,a,t,r))return{changes:{insert:t+t,from:a},effects:Jle.of(a+t.length),range:W3.cursor(a+t.length)}}return{range:i=o}}));return i?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function hae(e,t){let n=Jte(e).resolveInner(t+1);return n.parent&&n.from==t}function fae(e,t,n){let o=e.charCategorizer(t);if(o(e.sliceDoc(t-1,t))!=E4.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&o(e.sliceDoc(n-1,n))!=E4.Word)return n}return-1}function gae(e={}){return[Mle,dle.of(e),Rle,vae,Dle]}const mae=[{key:"Ctrl-Space",run:e=>!!e.state.field(Mle,!1)&&(e.dispatch({effects:sle.of(!0)}),!0)},{key:"Escape",run:e=>{let t=e.state.field(Mle,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:cle.of(null)}),0))}},{key:"ArrowDown",run:Ele(!0)},{key:"ArrowUp",run:Ele(!1)},{key:"PageDown",run:Ele(!0,"page")},{key:"PageUp",run:Ele(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(Mle,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.facet(dle).defaultKeymap?[mae]:[])));class bae{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class yae{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let o=e,r=n.facet(Rae).markerFilter;r&&(o=r(o));let i=h5.set(o.map((e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?h5.widget({widget:new zae(e),diagnostic:e}).range(e.from):h5.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e}).range(e.from,e.to))),!0);return new yae(i,t,Oae(i))}}function Oae(e,t=null,n=0){let o=null;return e.between(n,1e9,((e,n,{spec:r})=>{if(!t||r.diagnostic==t)return o=new bae(e,n,r.diagnostic),!1})),o}function wae(e,t){let n=e.startState.doc.lineAt(t.pos);return!(!e.effects.some((e=>e.is($ae)))&&!e.changes.touchesRange(n.from,n.to))}function xae(e,t){return e.field(kae,!1)?t:t.concat($4.appendConfig.of(qae))}const $ae=$4.define(),Sae=$4.define(),Cae=$4.define(),kae=e4.define({create:()=>new yae(h5.none,null,null),update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),o=null;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);o=Oae(n,e.selected.diagnostic,r)||Oae(n,null,r)}e=new yae(n,e.panel,o)}for(let n of t.effects)n.is($ae)?e=yae.init(n.value,e.panel,t.state):n.is(Sae)?e=new yae(e.diagnostics,n.value?Lae.open:null,e.selected):n.is(Cae)&&(e=new yae(e.diagnostics,e.panel,n.value));return e},provide:e=>[vee.from(e,(e=>e.panel)),q7.decorations.from(e,(e=>e.diagnostics))]}),Pae=h5.mark({class:"cm-lintRange cm-lintRange-active"});function Mae(e,t,n){let{diagnostics:o}=e.state.field(kae),r=[],i=2e8,l=0;o.between(t-(n<0?1:0),t+(n>0?1:0),((e,o,{spec:a})=>{t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t({dom:Tae(e,r)})}:null}function Tae(e,t){return Kre("ul",{class:"cm-tooltip-lint"},t.map((t=>Nae(e,t,!1))))}const Iae=e=>{let t=e.state.field(kae,!1);return!(!t||!t.panel||(e.dispatch({effects:Sae.of(!1)}),0))},Eae=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(kae,!1);t&&t.panel||e.dispatch({effects:xae(e.state,[Sae.of(!0)])});let n=hee(e,Lae.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(kae,!1);if(!t)return!1;let n=e.state.selection.main,o=t.diagnostics.iter(n.to+1);return!(!o.value&&(o=t.diagnostics.iter(0),!o.value||o.from==n.from&&o.to==n.to)||(e.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0}),0))}}],Aae=n6.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Rae);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){let e=Date.now();if(ePromise.resolve(e(this.view))))).then((t=>{let n=t.reduce(((e,t)=>e.concat(t)));this.view.state.doc==e.doc&&this.view.dispatch(function(e,t){return{effects:xae(e,[$ae.of(t)])}}(this.view.state,n))}),(e=>{q5(this.view.state,e)}))}}update(e){let t=e.state.facet(Rae);(e.docChanged||t!=e.startState.facet(Rae)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Rae=X3.define({combine:e=>Object.assign({sources:e.map((e=>e.source))},B4(e.map((e=>e.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function Dae(e,t={}){return[Rae.of({source:e,config:t}),Aae,qae]}function jae(e){let t=e.plugin(Aae);t&&t.force()}function Bae(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;ee.toLowerCase()==o.toLowerCase()))){t.push(o);continue e}}t.push("")}return t}function Nae(e,t,n){var o;let r=n?Bae(t.actions):[];return Kre("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Kre("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),null===(o=t.actions)||void 0===o?void 0:o.map(((n,o)=>{let i=!1,l=o=>{if(o.preventDefault(),i)return;i=!0;let r=Oae(e.state.field(kae).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:a}=n,s=r[o]?a.indexOf(r[o]):-1,c=s<0?a:[a.slice(0,s),Kre("u",a.slice(s,s+1)),a.slice(s+1)];return Kre("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${a}${s<0?"":` (access key "${r[o]})"`}.`},c)})),t.source&&Kre("div",{class:"cm-diagnosticSource"},t.source))}class zae extends d5{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Kre("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class _ae{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Nae(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Lae{constructor(e){this.view=e,this.items=[],this.list=Kre("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)Iae(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],o=Bae(n.actions);for(let r=0;r{for(let t=0;tIae(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(kae).selected;if(!e)return-1;for(let t=0;t{let a,s=-1;for(let t=n;tn&&(this.items.splice(n,s-n),o=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}));n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.topt.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Oae(this.view.state.field(kae).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Cae.of(t)})}static open(e){return new Lae(e)}}function Qae(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function Hae(e){return Qae(``,'width="6" height="3"')}const Fae=q7.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Hae("#d11")},".cm-lintRange-warning":{backgroundImage:Hae("orange")},".cm-lintRange-info":{backgroundImage:Hae("#999")},".cm-lintRange-hint":{backgroundImage:Hae("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function Wae(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}class Zae extends bee{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce(((e,t)=>Wae(e)function(e,t,n){function o(){let o=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(o.from)&&e.dispatch({effects:Kae.of({pos:o.from,above:!1,create:()=>({dom:Tae(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let n=o=>{let r=t.getBoundingClientRect();if(!(o.clientX>r.left-10&&o.clientXr.top-10&&o.clientY{clearTimeout(i),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(i),i=setTimeout(o,r)}}(e,t,n)),t}}function Vae(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let o=[];for(let r in n)o.push(new Zae(n[r]).range(+r));return Q4.of(o,!0)}const Xae=xee({class:"cm-gutter-lint",markers:e=>e.state.field(Yae)}),Yae=e4.define({create:()=>Q4.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(Jae).markerFilter;for(let o of t.effects)if(o.is($ae)){let r=o.value;n&&(r=n(r||[])),e=Vae(t.state.doc,r.slice(0))}return e}}),Kae=$4.define(),Gae=e4.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=wae(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce(((e,t)=>t.is(Kae)?t.value:e),e)),provide:e=>ree.from(e)}),Uae=q7.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Qae('')},".cm-lint-marker-warning":{content:Qae('')},".cm-lint-marker-error":{content:Qae('')}}),qae=[kae,q7.decorations.compute([kae],(e=>{let{selected:t,panel:n}=e.field(kae);return t&&n&&t.from!=t.to?h5.set([Pae.range(t.from,t.to)]):h5.none})),cee(Mae,{hideOn:wae}),Fae],Jae=X3.define({combine:e=>B4(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function ese(e={}){return[Jae.of(e),Yae,Xae,Uae,Gae]}const tse=(()=>[Bee(),_ee,B9(),joe(),Xne(),y9(),[P9,M9],j4.allowMultipleSelections.of(!0),j4.transactionFilter.of((e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:o}=e.newSelection.main,r=n.lineAt(o);if(o>r.from+200)return e;let i=n.sliceString(r.from,o);if(!t.some((e=>e.test(i))))return e;let{state:l}=e,a=-1,s=[];for(let{head:c}of l.selection.ranges){let e=l.doc.lineAt(c);if(e.from==a)continue;a=e.from;let t=fne(l,e.from);if(null==t)continue;let n=/^\s*/.exec(e.text)[0],o=hne(l,t);n!=o&&s.push({from:e.from,to:e.from+n.length,insert:o})}return s.length?[e,{changes:s,sequential:!0}]:e})),Jne(noe,{fallback:!0}),uoe(),[lae,tae],gae(),V9(),K9(),Q9,pie(),l9.of([...aae,...Xre,...Vie,...Uoe,...zne,...mae,...Eae])])(),nse=(()=>[B9(),joe(),y9(),Jne(noe,{fallback:!0}),l9.of([...Xre,...Uoe])])();function ose(e,t={},n){const{props:o,domProps:r,on:i,...l}=t,a=i?(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):{})(i):{};return Kr(e,{...l,...o,...r,...a},n)}var rse=Ln({name:"CodeMirror",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:""},theme:{type:Object,default:()=>{}},dark:{type:Boolean,default:!1},basic:{type:Boolean,default:!1},minimal:{type:Boolean,default:!1},placeholder:{type:String,default:void 0},wrap:{type:Boolean,default:!1},tab:{type:Boolean,default:!1},allowMultipleSelections:{type:Boolean,default:!1},tabSize:{type:Number,default:void 0},lineSeparator:{type:String,default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},extensions:{type:Array,default:()=>[]},phrases:{type:Object,default:()=>{}},lang:{type:Object,default:()=>{}},linter:{type:Function,default:void 0},linterConfig:{type:Object,default:()=>({})},forceLinting:{type:Boolean,default:!1},gutter:{type:Boolean,defalt:!1},gutterConfig:{type:Object,default:()=>{}},tag:{type:String,default:"div"}},emits:{"update:modelValue":e=>!0,update:e=>!0,ready:e=>!0,focus:e=>!0,change:e=>!0,destroy:()=>!0},setup(e,t){const n=Ot(),o=Ot(e.modelValue),r=wt(new q7),i=Yr({get:()=>r.value.hasFocus,set:e=>{e&&r.value.focus()}}),l=Yr({get:()=>r.value.state.selection,set:e=>r.value.dispatch({selection:e})}),a=Yr({get:()=>r.value.state.selection.main.head,set:e=>r.value.dispatch({selection:{anchor:e}})}),s=Yr({get:()=>r.value.state.toJSON(),set:e=>r.value.setState(j4.fromJSON(e))}),c=Ot(0),u=Ot(0),d=Yr((()=>{const n=new s4,o=new s4;return[e.basic?tse:void 0,e.minimal&&!e.basic?nse:void 0,q7.updateListener.of((n=>{t.emit("focus",r.value.hasFocus),c.value=r.value.state.doc.length,!n.changes.empty&&n.docChanged&&(e.linter&&(e.forceLinting&&jae(r.value),u.value=e.linter(r.value).length),t.emit("update",n))})),q7.theme(e.theme,{dark:e.dark}),e.wrap?q7.lineWrapping:void 0,e.tab?l9.of([Yre]):void 0,j4.allowMultipleSelections.of(e.allowMultipleSelections),e.tabSize?o.of(j4.tabSize.of(e.tabSize)):void 0,e.phrases?j4.phrases.of(e.phrases):void 0,j4.readOnly.of(e.readonly),q7.editable.of(!e.disabled),e.lineSeparator?j4.lineSeparator.of(e.lineSeparator):void 0,e.lang?n.of(e.lang):void 0,e.linter?Dae(e.linter,e.linterConfig):void 0,e.linter&&e.gutter?ese(e.gutterConfig):void 0,e.placeholder?(i=e.placeholder,n6.fromClass(class{constructor(e){this.view=e,this.placeholder=i?h5.set([h5.widget({widget:new H9(i),side:1}).range(0)]):h5.none}get decorations(){return this.view.state.doc.length?h5.none:this.placeholder}},{decorations:e=>e.decorations})):void 0,...e.extensions].filter((e=>!!e));var i}));wn(d,(e=>{var t;null==(t=r.value)||t.dispatch({effects:$4.reconfigure.of(e)})}),{immediate:!0}),wn((()=>e.modelValue),(async t=>{r.value.composing||r.value.state.doc.toJSON().join(e.lineSeparator??"\n")===t||r.value.dispatch({changes:{from:0,to:r.value.state.doc.length,insert:t},selection:r.value.state.selection,scrollIntoView:!0})}),{immediate:!0}),Gn((async()=>{let e=o.value;n.value&&(n.value.childNodes[0]&&(o.value,e=n.value.childNodes[0].innerText.trim()),r.value=new q7({parent:n.value,state:j4.create({doc:e,extensions:d.value}),dispatch:e=>{r.value.update([e]),!e.changes.empty&&e.docChanged&&(t.emit("update:modelValue",e.state.doc.toString()),t.emit("change",e.state))}}),await Zt(),t.emit("ready",{view:r.value,state:r.value.state,container:n.value}))})),eo((()=>{r.value.destroy(),t.emit("destroy")}));const p={editor:n,view:r,cursor:a,selection:l,focus:i,length:c,json:s,diagnosticCount:u,dom:r.value.contentDOM,lint:()=>{!e.linter||!r.value||(e.forceLinting&&jae(r.value),u.value=function(e){let t=e.field(kae,!1);return t?t.diagnostics.size:0}(r.value.state))},forceReconfigure:()=>{var e,t;null==(e=r.value)||e.dispatch({effects:$4.reconfigure.of([])}),null==(t=r.value)||t.dispatch({effects:$4.appendConfig.of(d.value)})},getRange:(e,t)=>r.value.state.sliceDoc(e,t),getLine:e=>r.value.state.doc.line(e+1).text,lineCount:()=>r.value.state.doc.lines,getCursor:()=>r.value.state.selection.main.head,listSelections:()=>{let e;return null!==(e=r.value.state.selection.ranges)&&void 0!==e?e:[]},getSelection:()=>{let e;return null!==(e=r.value.state.sliceDoc(r.value.state.selection.main.from,r.value.state.selection.main.to))&&void 0!==e?e:""},getSelections:()=>{const e=r.value.state;return e?e.selection.ranges.map((t=>e.sliceDoc(t.from,t.to))):[]},somethingSelected:()=>r.value.state.selection.ranges.some((e=>!e.empty)),replaceRange:(e,t,n)=>r.value.dispatch({changes:{from:t,to:n,insert:e}}),replaceSelection:e=>r.value.dispatch(r.value.state.replaceSelection(e)),setCursor:e=>r.value.dispatch({selection:{anchor:e}}),setSelection:(e,t)=>r.value.dispatch({selection:{anchor:e,head:t}}),setSelections:(e,t)=>r.value.dispatch({selection:W3.create(e,t)}),extendSelectionsBy:e=>r.value.dispatch({selection:W3.create(l.value.ranges.map((t=>t.extend(e(t)))))})};return t.expose(p),p},render(){return ose(this.$props.tag,{ref:"editor",class:"vue-codemirror"},this.$slots.default?ose("aside",{style:"display: none;","aria-hidden":"true"},"function"==typeof(e=this.$slots.default)?e():e):void 0);var e}});const ise="#e06c75",lse="#abb2bf",ase="#7d8799",sse="#d19a66",cse="#2c313a",use="#282c34",dse="#353a42",pse="#528bff",hse=[q7.theme({"&":{color:lse,backgroundColor:use},".cm-content":{caretColor:pse},".cm-cursor, .cm-dropCursor":{borderLeftColor:pse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:lse},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:use,color:ase,border:"none"},".cm-activeLineGutter":{backgroundColor:cse},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:dse},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:dse,borderBottomColor:dse},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:cse,color:lse}}},{dark:!0}),Jne(Kne.define([{tag:Zte.keyword,color:"#c678dd"},{tag:[Zte.name,Zte.deleted,Zte.character,Zte.propertyName,Zte.macroName],color:ise},{tag:[Zte.function(Zte.variableName),Zte.labelName],color:"#61afef"},{tag:[Zte.color,Zte.constant(Zte.name),Zte.standard(Zte.name)],color:sse},{tag:[Zte.definition(Zte.name),Zte.separator],color:lse},{tag:[Zte.typeName,Zte.className,Zte.number,Zte.changed,Zte.annotation,Zte.modifier,Zte.self,Zte.namespace],color:"#e5c07b"},{tag:[Zte.operator,Zte.operatorKeyword,Zte.url,Zte.escape,Zte.regexp,Zte.link,Zte.special(Zte.string)],color:"#56b6c2"},{tag:[Zte.meta,Zte.comment],color:ase},{tag:Zte.strong,fontWeight:"bold"},{tag:Zte.emphasis,fontStyle:"italic"},{tag:Zte.strikethrough,textDecoration:"line-through"},{tag:Zte.link,color:ase,textDecoration:"underline"},{tag:Zte.heading,fontWeight:"bold",color:ise},{tag:[Zte.atom,Zte.bool,Zte.special(Zte.variableName)],color:sse},{tag:[Zte.processingInstruction,Zte.string,Zte.inserted],color:"#98c379"},{tag:Zte.invalid,color:"#ffffff"}]))];var fse={};class gse{constructor(e,t,n,o,r,i,l,a,s,c=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=o,this.pos=r,this.score=i,this.buffer=l,this.bufferBase=a,this.curContext=s,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let o=e.parser.context;return new gse(e,[],t,n,n,0,[],0,o?new mse(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,o=65535&e,{parser:r}=this.p,i=r.dynamicPrecedence(o);if(i&&(this.score+=i),0==n)return this.pushState(r.getGoto(this.state,o,!0),this.reducePos),o=2e3&&!(null===(t=this.p.parser.nodeSet.types[o])||void 0===t?void 0:t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=s):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(o,a)}storeNode(e,t,n,o=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[o-4]&&e.buffer[o-1]>-1){if(t==n)return;if(e.buffer[o-2]>=t)return void(e.buffer[o-2]=n)}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,o>4&&(o-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=o}else this.buffer.push(e,t,n,o)}shift(e,t,n,o){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:i}=this.p;(o>this.pos||t<=i.maxNode)&&(this.pos=o,i.stateFlag(r,1)||(this.reducePos=o)),this.pushState(r,n),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,o,4)}else this.pos=o,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,o,4)}apply(e,t,n,o){65536&e?this.reduce(e):this.shift(e,t,n,o)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(t,o),this.buffer.push(n,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),o=e.bufferBase+t;for(;e&&o==e.bufferBase;)e=e.parent;return new gse(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new vse(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(0==(65536&n))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let o,r=0;r1&t&&e==o))||n.push(t[e],o)}t=n}let n=[];for(let o=0;o>19,o=65535&t,r=this.stack.length-3*n;if(r<0||e.getGoto(this.stack[r],o,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(o,r)=>{if(!t.includes(o))return t.push(o),e.allActions(o,(t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let o=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],o,!1)>=0)return n<<19|65536|o}}else{let e=n(t,r+1);if(null!=e)return e}}))};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class mse{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class vse{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let o=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=o}}class bse{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new bse(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new bse(this.stack,this.pos,this.index)}}function yse(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let o=0,r=0;o=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),i+=r,n)break;i*=46}n?n[r++]=i:n=new t(i)}return n}class Ose{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const wse=new Ose;class xse{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=wse,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,o=this.rangeIndex,r=this.pos+e;for(;rn.to:r>=n.to;){if(o==this.ranges.length-1)return null;let e=this.ranges[++o];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t,n,o=this.chunkOff+e;if(o>=0&&o=this.chunk2Pos&&to.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=wse,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let o of this.ranges){if(o.from>=t)break;o.to>e&&(n+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}return n}}class $se{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;kse(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}$se.prototype.contextual=$se.prototype.fallback=$se.prototype.extend=!1;class Sse{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?yse(e):e}token(e,t){let n=e.pos,o=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(kse(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(n||o++,null==r)break;e.reset(r,e.token)}o&&(e.reset(n,e.token),e.acceptToken(this.elseToken,o))}}Sse.prototype.contextual=$se.prototype.fallback=$se.prototype.extend=!1;class Cse{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function kse(e,t,n,o,r,i){let l=0,a=1<0){let n=e[d];if(s.allows(n)&&(-1==t.token.value||t.token.value==n||Mse(n,t.token.value,r,i))){t.acceptToken(n);break}}let o=t.next,c=0,u=e[l+2];if(!(t.next<0&&u>c&&65535==e[n+3*u-3])){for(;c>1,i=n+r+(r<<1),a=e[i],s=e[i+1]||65536;if(o=s)){l=e[i+2],t.advance();continue e}c=r+1}}break}l=e[n+3*u-1]}}function Pse(e,t,n){for(let o,r=t;65535!=(o=e[r]);r++)if(o==n)return r-t;return-1}function Mse(e,t,n,o){let r=Pse(n,o,t);return r<0||Pse(n,o,e)t)&&!o.type.isError)return n<0?Math.max(0,Math.min(o.to-1,t-25)):Math.min(e.length,Math.max(o.from+1,t+25));if(n<0?o.prevSibling():o.nextSibling())break;if(!o.parent())return n<0?0:e.length}}class Ase{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ese(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ese(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(r instanceof qee){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+r.length}}}class Rse{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new Ose))}getActions(e){let t=0,n=null,{parser:o}=e.p,{tokenizers:r}=o,i=o.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let s=0;sc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let r=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!o.extend&&(n=c,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||(n=new Ose,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Ose,{pos:n,p:o}=e;return t.start=n,t.end=Math.min(n+1,o.stream.end),t.value=n==o.stream.end?o.parser.eofTerm:0,t}updateCachedToken(e,t,n){let o=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(o,e),n),e.value>-1){let{parser:t}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,t,n,o){for(let r=0;r4*e.bufferLength?new Ase(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,o=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;io)r.push(l);else{if(this.advanceStack(l,r,n))continue;{e||(e=[],t=[]),e.push(l);let n=this.tokens.getMainToken(l);t.push(n.value,n.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>o))&&this.recovering--}else if(r.length>1){e:for(let e=0;e500&&o.buffer.length>500){if(!((t.score-o.score||t.buffer.length-o.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(n--,1)}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let i=1;ithis.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let i=this.fragments.nodeAt(o);i;){let o=this.parser.nodeSet.types[i.type.id]==i.type?r.getGoto(e.state,i.type.id):-1;if(o>-1&&i.length&&(!t||(i.prop(Fee.contextHash)||0)==n))return e.useNode(i,o),!0;if(!(i instanceof qee)||0==i.children.length||i.positions[0]>0)break;let l=i.children[0];if(!(l instanceof qee&&0==i.positions[0]))break;i=l}}let i=r.stateSlot(e.state,4);if(i>0)return e.reduce(i),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let a=0;ao?t.push(u):n.push(u)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return jse(e,t),!0}}runRecovery(e,t,n){let o=null,r=!1;for(let i=0;i ":"";if(l.deadEnd){if(r)continue;if(r=!0,l.restart(),this.advanceFully(l,n))continue}let u=l.split(),d=c;for(let e=0;u.forceReduce()&&e<10&&!this.advanceFully(u,n);e++)Tse&&(d=this.stackID(u)+" -> ");for(let e of l.recoverByInsert(a))this.advanceFully(e,n);this.stream.end>l.pos?(s==l.pos&&(s++,a=0),l.recoverByDelete(a,s),jse(l,n)):(!o||o.scoree;class zse extends bte{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[t][1])),o=[];for(let l=0;l=0)r(n,e,l[t++]);else{let o=l[t+-n];for(let i=-n;i>0;i--)r(l[t++],e,o);t++}}}this.nodeSet=new Xee(t.map(((t,r)=>Vee.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:o[r],top:n.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Lee;let i=yse(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l"number"==typeof e?new $se(i,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let o=new Dse(this,e,t,n);for(let r of this.wrappers)o=r(o,e,t,n);return o}getGoto(e,t,n=!1){let o=this.goto;if(t>=o[0])return-1;for(let r=o[t+1];;){let t=o[r++],i=1&t,l=o[r++];if(i&&n)return l;for(let n=r+(t>>1);r0}validAction(e,t){return!!this.allActions(e,(e=>e==t||null))}allActions(e,t){let n=this.stateSlot(e,4),o=n?t(n):void 0;for(let r=this.stateSlot(e,1);null==o;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=_se(this.data,r+2)}o=t(_se(this.data,r+1))}return o}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=_se(this.data,n+2)}if(0==(1&this.data[n+2])){let e=this.data[n+1];t.some(((t,n)=>1&n&&t==e))||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(zse.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map((t=>{let n=e.tokenizers.find((e=>e.from==t));return n?n.to:t}))),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map(((n,o)=>{let r=e.specializers.find((e=>e.from==n.external));if(!r)return n;let i=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[o]=Lse(i),i}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map((()=>!1));if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let o=null;for(let r=0;re.external(n,o)<<1|t}return e.get}const Qse=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Hse=new class{constructor(e){this.start=e.start,this.shift=e.shift||Nse,this.reduce=e.reduce||Nse,this.reuse=e.reuse||Nse,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}({start:!1,shift:(e,t)=>4==t||5==t||312==t?e:313==t,strict:!1}),Fse=new Cse(((e,t)=>{let{next:n}=e;(125==n||-1==n||t.context)&&e.acceptToken(310)}),{contextual:!0,fallback:!0}),Wse=new Cse(((e,t)=>{let n,{next:o}=e;Qse.indexOf(o)>-1||(47!=o||47!=(n=e.peek(1))&&42!=n)&&(125==o||59==o||-1==o||t.context||e.acceptToken(309))}),{contextual:!0}),Zse=new Cse(((e,t)=>{let{next:n}=e;if((43==n||45==n)&&(e.advance(),n==e.next)){e.advance();let n=!t.context&&t.canShift(1);e.acceptToken(n?1:2)}}),{contextual:!0});function Vse(e,t){return e>=65&&e<=90||e>=97&&e<=122||95==e||e>=192||!t&&e>=48&&e<=57}const Xse=new Cse(((e,t)=>{if(60!=e.next||!t.dialectEnabled(0))return;if(e.advance(),47==e.next)return;let n=0;for(;Qse.indexOf(e.next)>-1;)e.advance(),n++;if(Vse(e.next,!0)){for(e.advance(),n++;Vse(e.next,!1);)e.advance(),n++;for(;Qse.indexOf(e.next)>-1;)e.advance(),n++;if(44==e.next)return;for(let t=0;;t++){if(7==t){if(!Vse(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),n++}}e.acceptToken(3,-n)})),Yse=Ste({"get set async static":Zte.modifier,"for while do if else switch try catch finally return throw break continue default case":Zte.controlKeyword,"in of await yield void typeof delete instanceof":Zte.operatorKeyword,"let var const using function class extends":Zte.definitionKeyword,"import export from":Zte.moduleKeyword,"with debugger as new":Zte.keyword,TemplateString:Zte.special(Zte.string),super:Zte.atom,BooleanLiteral:Zte.bool,this:Zte.self,null:Zte.null,Star:Zte.modifier,VariableName:Zte.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Zte.function(Zte.variableName),VariableDefinition:Zte.definition(Zte.variableName),Label:Zte.labelName,PropertyName:Zte.propertyName,PrivatePropertyName:Zte.special(Zte.propertyName),"CallExpression/MemberExpression/PropertyName":Zte.function(Zte.propertyName),"FunctionDeclaration/VariableDefinition":Zte.function(Zte.definition(Zte.variableName)),"ClassDeclaration/VariableDefinition":Zte.definition(Zte.className),PropertyDefinition:Zte.definition(Zte.propertyName),PrivatePropertyDefinition:Zte.definition(Zte.special(Zte.propertyName)),UpdateOp:Zte.updateOperator,"LineComment Hashbang":Zte.lineComment,BlockComment:Zte.blockComment,Number:Zte.number,String:Zte.string,Escape:Zte.escape,ArithOp:Zte.arithmeticOperator,LogicOp:Zte.logicOperator,BitOp:Zte.bitwiseOperator,CompareOp:Zte.compareOperator,RegExp:Zte.regexp,Equals:Zte.definitionOperator,Arrow:Zte.function(Zte.punctuation),": Spread":Zte.punctuation,"( )":Zte.paren,"[ ]":Zte.squareBracket,"{ }":Zte.brace,"InterpolationStart InterpolationEnd":Zte.special(Zte.brace),".":Zte.derefOperator,", ;":Zte.separator,"@":Zte.meta,TypeName:Zte.typeName,TypeDefinition:Zte.definition(Zte.typeName),"type enum interface implements namespace module declare":Zte.definitionKeyword,"abstract global Privacy readonly override":Zte.modifier,"is keyof unique infer":Zte.operatorKeyword,JSXAttributeValue:Zte.attributeValue,JSXText:Zte.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Zte.angleBracket,"JSXIdentifier JSXNameSpacedName":Zte.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Zte.attributeName,"JSXBuiltin/JSXIdentifier":Zte.standard(Zte.tagName)}),Kse={__proto__:null,export:18,as:23,from:31,default:34,async:39,function:40,extends:52,this:56,true:64,false:64,null:76,void:80,typeof:84,super:102,new:136,delete:152,yield:161,await:165,class:170,public:227,private:227,protected:227,readonly:229,instanceof:248,satisfies:251,in:252,const:254,import:286,keyof:339,unique:343,infer:349,is:385,abstract:405,implements:407,type:409,let:412,var:414,using:417,interface:423,enum:427,namespace:433,module:435,declare:439,global:443,for:462,of:471,while:474,with:478,do:482,if:486,else:488,switch:492,case:498,try:504,catch:508,finally:512,return:516,throw:520,break:524,continue:528,debugger:532},Gse={__proto__:null,async:123,get:125,set:127,declare:187,public:189,private:189,protected:189,static:191,abstract:193,override:195,readonly:201,accessor:203,new:389},Use={__proto__:null,"<":143},qse=zse.deserialize({version:14,states:"$RQWO'#CdO>cQWO'#H[O>kQWO'#HbO>kQWO'#HdO`Q^O'#HfO>kQWO'#HhO>kQWO'#HkO>pQWO'#HqO>uQ07iO'#HwO%[Q^O'#HyO?QQ07iO'#H{O?]Q07iO'#H}O9kQ07hO'#IPO?hQ08SO'#ChO@jQ`O'#DiQOQWOOO%[Q^O'#EPOAQQWO'#ESO:RQ7[O'#EjOA]QWO'#EjOAhQpO'#FbOOQU'#Cf'#CfOOQ07`'#Dn'#DnOOQ07`'#Jm'#JmO%[Q^O'#JmOOQO'#Jq'#JqOOQO'#Ib'#IbOBhQ`O'#EcOOQ07`'#Eb'#EbOCdQ07pO'#EcOCnQ`O'#EVOOQO'#Jp'#JpODSQ`O'#JqOEaQ`O'#EVOCnQ`O'#EcPEnO!0LbO'#CaPOOO)CDu)CDuOOOO'#IX'#IXOEyO!bO,59TOOQ07b,59T,59TOOOO'#IY'#IYOFXO#tO,59TO%[Q^O'#D`OOOO'#I['#I[OFgO?MpO,59xOOQ07b,59x,59xOFuQ^O'#I]OGYQWO'#JkOI[QrO'#JkO+}Q^O'#JkOIcQWO,5:OOIyQWO'#ElOJWQWO'#JyOJcQWO'#JxOJcQWO'#JxOJkQWO,5;YOJpQWO'#JwOOQ07f,5:Z,5:ZOJwQ^O,5:ZOLxQ08SO,5:eOMiQWO,5:mONSQ07hO'#JvONZQWO'#JuO9ZQWO'#JuONoQWO'#JuONwQWO,5;XON|QWO'#JuO!#UQrO'#JjOOQ07b'#Ch'#ChO%[Q^O'#ERO!#tQpO,5:rOOQO'#Jr'#JrOOQO-EmOOQU'#J`'#J`OOQU,5>n,5>nOOQU-EpQWO'#HQO9aQWO'#HSO!CgQWO'#HSO:RQ7[O'#HUO!ClQWO'#HUOOQU,5=j,5=jO!CqQWO'#HVO!DSQWO'#CnO!DXQWO,59OO!DcQWO,59OO!FhQ^O,59OOOQU,59O,59OO!FxQ07hO,59OO%[Q^O,59OO!ITQ^O'#H^OOQU'#H_'#H_OOQU'#H`'#H`O`Q^O,5=vO!IkQWO,5=vO`Q^O,5=|O`Q^O,5>OO!IpQWO,5>QO`Q^O,5>SO!IuQWO,5>VO!IzQ^O,5>]OOQU,5>c,5>cO%[Q^O,5>cO9kQ07hO,5>eOOQU,5>g,5>gO!NUQWO,5>gOOQU,5>i,5>iO!NUQWO,5>iOOQU,5>k,5>kO!NZQ`O'#D[O%[Q^O'#JmO!NxQ`O'#JmO# gQ`O'#DjO# xQ`O'#DjO#$ZQ^O'#DjO#$bQWO'#JlO#$jQWO,5:TO#$oQWO'#EpO#$}QWO'#JzO#%VQWO,5;ZO#%[Q`O'#DjO#%iQ`O'#EUOOQ07b,5:n,5:nO%[Q^O,5:nO#%pQWO,5:nO>pQWO,5;UO!@}Q`O,5;UO!AVQ7[O,5;UO:RQ7[O,5;UO#%xQWO,5@XO#%}Q$ISO,5:rOOQO-E<`-E<`O#'TQ07pO,5:}OCnQ`O,5:qO#'_Q`O,5:qOCnQ`O,5:}O!@rQ07hO,5:qOOQ07`'#Ef'#EfOOQO,5:},5:}O%[Q^O,5:}O#'lQ07hO,5:}O#'wQ07hO,5:}O!@}Q`O,5:qOOQO,5;T,5;TO#(VQ07hO,5:}POOO'#IV'#IVP#(kO!0LbO,58{POOO,58{,58{OOOO-EwO+}Q^O,5>wOOQO,5>},5>}O#)VQ^O'#I]OOQO-EpQ08SO1G0{O#>wQ08SO1G0{O#@oQ08SO1G0{O#CoQ(CYO'#ChO#EmQ(CYO1G1^O#EtQ(CYO'#JjO!,lQWO1G1dO#FUQ08SO,5?TOOQ07`-EkQWO1G3lO$2^Q^O1G3nO$6bQ^O'#HmOOQU1G3q1G3qO$6oQWO'#HsO>pQWO'#HuOOQU1G3w1G3wO$6wQ^O1G3wO9kQ07hO1G3}OOQU1G4P1G4POOQ07`'#GY'#GYO9kQ07hO1G4RO9kQ07hO1G4TO$;OQWO,5@XO!*fQ^O,5;[O9ZQWO,5;[O>pQWO,5:UO!*fQ^O,5:UO!@}Q`O,5:UO$;TQ(CYO,5:UOOQO,5;[,5;[O$;_Q`O'#I^O$;uQWO,5@WOOQ07b1G/o1G/oO$;}Q`O'#IdO$pQWO1G0pO!@}Q`O1G0pO!AVQ7[O1G0pOOQ07`1G5s1G5sO!@rQ07hO1G0]OOQO1G0i1G0iO%[Q^O1G0iO$wO$>TQWO1G5qO$>]QWO1G6OO$>eQrO1G6PO9ZQWO,5>}O$>oQ08SO1G5|O%[Q^O1G5|O$?PQ07hO1G5|O$?bQWO1G5{O$?bQWO1G5{O9ZQWO1G5{O$?jQWO,5?QO9ZQWO,5?QOOQO,5?Q,5?QO$@OQWO,5?QO$'TQWO,5?QOOQO-EXOOQU,5>X,5>XO%[Q^O'#HnO%7^QWO'#HpOOQU,5>_,5>_O9ZQWO,5>_OOQU,5>a,5>aOOQU7+)c7+)cOOQU7+)i7+)iOOQU7+)m7+)mOOQU7+)o7+)oO%7cQ`O1G5sO%7wQ(CYO1G0vO%8RQWO1G0vOOQO1G/p1G/pO%8^Q(CYO1G/pO>pQWO1G/pO!*fQ^O'#DjOOQO,5>x,5>xOOQO-E<[-E<[OOQO,5?O,5?OOOQO-EpQWO7+&[O!@}Q`O7+&[OOQO7+%w7+%wO$=gQ08SO7+&TOOQO7+&T7+&TO%[Q^O7+&TO%8hQ07hO7+&TO!@rQ07hO7+%wO!@}Q`O7+%wO%8sQ07hO7+&TO%9RQ08SO7++hO%[Q^O7++hO%9cQWO7++gO%9cQWO7++gOOQO1G4l1G4lO9ZQWO1G4lO%9kQWO1G4lOOQO7+%|7+%|O#%sQWO<tQ08SO1G2ZO%AVQ08SO1G2mO%CbQ08SO1G2oO%EmQ7[O,5>yOOQO-E<]-E<]O%EwQrO,5>zO%[Q^O,5>zOOQO-E<^-E<^O%FRQWO1G5uOOQ07b<YOOQU,5>[,5>[O&5cQWO1G3yO9ZQWO7+&bO!*fQ^O7+&bOOQO7+%[7+%[O&5hQ(CYO1G6PO>pQWO7+%[OOQ07b<pQWO<pQWO7+)eO'&gQWO<}AN>}O%[Q^OAN?ZOOQO<eQ(CYOG26}O!*fQ^O'#DyO1PQWO'#EWO'@ZQrO'#JiO!*fQ^O'#DqO'@bQ^O'#D}O'@iQrO'#ChO'CPQrO'#ChO!*fQ^O'#EPO'CaQ^O,5;VO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O'#IiO'EdQWO,5a#@O#@^#@d#Ax#BW#Cr#DQ#DW#D^#Dd#Dn#Dt#Dz#EU#Eh#EnPPPPPPPPPP#EtPPPPPPP#Fi#Ip#KP#KW#K`PPPP$!d$%Z$+r$+u$+x$,q$,t$,w$-O$-WPP$-^$-b$.Y$/X$/]$/qPP$/u$/{$0PP$0S$0W$0Z$1P$1h$2P$2T$2W$2Z$2a$2d$2h$2lR!{RoqOXst!Z#c%j&m&o&p&r,h,m1w1zY!uQ'Z-Y1[5]Q%pvQ%xyQ&P|Q&e!VS'R!e-QQ'a!iS'g!r!xS*c$|*hQ+f%yQ+s&RQ,X&_Q-W'YQ-b'bQ-j'hQ/|*jQ1f,YR;Y:g%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%j%p%}&f&i&m&o&p&r&v'O']'m'}(P(V(^(r(v(z)y+O+S,e,h,m-^-f-t-z.l.s0[0a0q1_1o1p1r1t1w1z1|2m2s3Z5Y5d5t5u5x6]7w7|8]8gS#p]:d!r)[$[$m'S)n,y,|.{2]3p5W6S9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]Q*u%ZQ+k%{Q,Z&bQ,b&jQ.c;QQ0h+^Q0l+`Q0w+lQ1n,`Q2{.[Q4v0rQ5k1gQ6i3PQ6u;RQ7h4wR8m6j&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%j%p%}&f&i&j&m&o&p&r&v'O'S']'m'}(P(V(^(r(v(z)n)y+O+S+^,e,h,m,y,|-^-f-t-z.[.l.s.{0[0a0q1_1o1p1r1t1w1z1|2]2m2s3P3Z3p5W5Y5d5t5u5x6S6]6j7w7|8]8g9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]t!nQ!r!u!x!y'R'Y'Z'g'h'i-Q-W-Y-j1[5]5_$v$si#u#w$c$d$x${%O%Q%[%]%a)u){)}*P*R*Y*`*p*q+]+`+w+z.Z.i/Z/j/k/m0Q0S0^1R1U1^3O3x4S4[4f4n4p5c6g7T7^7y8j8w9[9n:O:W:y:z:|:};O;P;S;T;U;V;W;X;_;`;a;b;c;d;g;h;i;j;k;l;m;n;q;r < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:371,context:Hse,nodeProps:[["isolate",-8,4,5,13,33,35,48,50,52,""],["group",-26,8,16,18,65,201,205,209,210,212,215,218,228,230,236,238,240,242,245,251,257,259,261,263,265,267,268,"Statement",-32,12,13,28,31,32,38,48,51,52,54,59,67,75,79,81,83,84,106,107,116,117,134,137,139,140,141,142,144,145,164,165,167,"Expression",-23,27,29,33,37,39,41,168,170,172,173,175,176,177,179,180,181,183,184,185,195,197,199,200,"Type",-3,87,99,105,"ClassItem"],["openedBy",22,"<",34,"InterpolationStart",53,"[",57,"{",72,"(",157,"JSXStartCloseTag"],["closedBy",23,">",36,"InterpolationEnd",47,"]",58,"}",73,")",162,"JSXEndTag"]],propSources:[Yse],skippedNodes:[0,4,5,271],repeatNodeCount:37,tokenData:"$Fj(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Ns!`!a$#_!a!b$(l!b!c$,k!c!}Er!}#O$-u#O#P$/P#P#Q$4h#Q#R$5r#R#SEr#S#T$7P#T#o$8Z#o#p$q#r#s$?}#s$f%Z$f$g+g$g#BYEr#BY#BZ$AX#BZ$ISEr$IS$I_$AX$I_$I|Er$I|$I}$Dd$I}$JO$Dd$JO$JTEr$JT$JU$AX$JU$KVEr$KV$KW$AX$KW&FUEr&FU&FV$AX&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AX?HUOEr(n%d_$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$f&j(OpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(OpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$f&j(Op(R!b't(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST(P#S$f&j'u(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$f&j(Op(R!b'u(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$f&j!o$Ip(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/|3l_'}$(n$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$f&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$a`$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$a``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$a`$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(R!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$a`(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k#%|:hh$f&j(Op(R!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXVS$f&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSVSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWVS(R!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]VS$f&j(OpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWVS(OpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYVS(Op(R!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$f&j!USOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$f&j!USO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!USOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!US#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$f&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$f&j(R!b!USOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ(R!b!USOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb(R!b!USOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX(R!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$f&j(R!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Kse[e]||-1},{term:334,get:e=>Gse[e]||-1},{term:70,get:e=>Use[e]||-1}],tokenPrec:14626}),Jse=[Gle("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),Gle("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),Gle("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Gle("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Gle("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),Gle("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),Gle("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),Gle("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),Gle("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),Gle('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Gle('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],ece=Jse.concat([Gle("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Gle("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Gle("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),tce=new mte,nce=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function oce(e){return(t,n)=>{let o=t.node.getChild("VariableDefinition");return o&&n(o,e),!0}}const rce=["FunctionDeclaration"],ice={FunctionDeclaration:oce("function"),ClassDeclaration:oce("class"),ClassExpression:()=>!0,EnumDeclaration:oce("constant"),TypeAliasDeclaration:oce("type"),NamespaceDeclaration:oce("namespace"),VariableDefinition(e,t){e.matchContext(rce)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function lce(e,t){let n=tce.get(t);if(n)return n;let o=[],r=!0;function i(t,n){let r=e.sliceString(t.from,t.to);o.push({label:r,type:n})}return t.cursor(Gee.IncludeAnonymous).iterate((t=>{if(r)r=!1;else if(t.name){let e=ice[t.name];if(e&&e(t,i)||nce.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of lce(e,t.node))o.push(n);return!1}})),tce.set(t,o),o}const ace=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,sce=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function cce(e){let t=Jte(e.state).resolveInner(e.pos,-1);if(sce.indexOf(t.name)>-1)return null;let n="VariableName"==t.name||t.to-t.from<20&&ace.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let o=[];for(let r=t;r;r=r.parent)nce.has(r.name)&&(o=o.concat(lce(e.state.doc,r)));return{options:o,from:n?t.from:e.pos,validFor:ace}}const uce=qte.define({name:"javascript",parser:qse.configure({props:[mne.add({IfStatement:Sne({except:/^\s*({|else\b)/}),TryStatement:Sne({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:e=>e.baseIndent,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),o=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:o?1:2)*e.unit},Block:xne({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Sne({except:/^{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag":e=>e.column(e.node.from)+e.unit}),kne.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to({from:e.from+2,to:e.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),dce={test:e=>/^JSX/.test(e.name),facet:Yte({commentTokens:{block:{open:"{/*",close:"*/}"}}})},pce=uce.configure({dialect:"ts"},"typescript"),hce=uce.configure({dialect:"jsx",props:[Kte.add((e=>e.isTop?[dce]:void 0))]}),fce=uce.configure({dialect:"jsx ts",props:[Kte.add((e=>e.isTop?[dce]:void 0))]},"typescript");let gce=e=>({label:e,type:"keyword"});const mce="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(gce),vce=mce.concat(["declare","implements","private","protected","public"].map(gce));function bce(e={}){let t=e.jsx?e.typescript?fce:hce:e.typescript?pce:uce,n=e.typescript?ece.concat(vce):Jse.concat(mce);return new cne(t,[uce.data.of({autocomplete:(o=sce,r=tle(n),e=>{for(let t=Jte(e.state).resolveInner(e.pos,-1);t;t=t.parent){if(o.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return r(e)})}),uce.data.of({autocomplete:cce}),e.jsx?wce:[]]);var o,r}function yce(e,t,n=e.length){for(let o=null==t?void 0:t.firstChild;o;o=o.nextSibling)if("JSXIdentifier"==o.name||"JSXBuiltin"==o.name||"JSXNamespacedName"==o.name||"JSXMemberExpression"==o.name)return e.sliceString(o.from,Math.min(o.to,n));return""}const Oce="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),wce=q7.inputHandler.of(((e,t,n,o,r)=>{if((Oce?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||">"!=o&&"/"!=o||!uce.isActiveAt(e.state,t,-1))return!1;let i=r(),{state:l}=i,a=l.changeByRange((e=>{var t;let n,{head:r}=e,i=Jte(l).resolveInner(r-1,-1);if("JSXStartTag"==i.name&&(i=i.parent),l.doc.sliceString(r-1,r)!=o||"JSXAttributeValue"==i.name&&i.to>r);else{if(">"==o&&"JSXFragmentTag"==i.name)return{range:e,changes:{from:r,insert:""}};if("/"==o&&"JSXStartCloseTag"==i.name){let e=i.parent,o=e.parent;if(o&&e.from==r-2&&((n=yce(l.doc,o.firstChild,r))||"JSXFragmentTag"==(null===(t=o.firstChild)||void 0===t?void 0:t.name))){let e=`${n}>`;return{range:W3.cursor(r+e.length,-1),changes:{from:r,insert:e}}}}else if(">"==o){let t=function(e){for(;;){if("JSXOpenTag"==e.name||"JSXSelfClosingTag"==e.name||"JSXFragmentTag"==e.name)return e;if("JSXEscape"==e.name||!e.parent)return null;e=e.parent}}(i);if(t&&!/^\/?>|^<\//.test(l.doc.sliceString(r,r+2))&&(n=yce(l.doc,t,r)))return{range:e,changes:{from:r,insert:``}}}}return{range:e}}));return!a.changes.empty&&(e.dispatch([i,l.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),xce=S2(Ln({__name:"BranchDrawer",props:{open:N1().def(!1),len:_1().def(0),modelValue:Q1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot({}),l=Ot({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"500px",overflowY:"auto",overflowX:"hidden"}});wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{n("update:modelValue",i.value)},s=Ot(),c=()=>{var e;null==(e=s.value)||e.validate().then((()=>{d(),n("save",i.value)})).catch((()=>{xB.warning("请检查表单信息")}))},u=async()=>{const{key:e,value:t}=await d1("/workflow/check-node-expression","post",i.value.decision);return 1!==e?Promise.reject(t??"请检查条件表达式"):Promise.resolve()},d=()=>{n("update:open",!1),r.value=!1};return(t,n)=>{const o=fn("a-typography-paragraph"),p=fn("a-select-option"),h=fn("a-select"),f=fn("a-radio"),g=fn("a-radio-group"),m=fn("a-form-item"),v=fn("a-form"),b=fn("a-button"),y=fn("a-drawer");return hr(),br(y,{open:r.value,"onUpdate:open":n[5]||(n[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:d},{title:sn((()=>[Cr(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:a},{editableEnterIcon:sn((()=>[Pr(X(null))])),_:1},8,["content"])])),extra:sn((()=>[Cr(h,{value:i.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>i.value.priorityLevel=e),style:{width:"110px"}},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.len-1,(e=>(hr(),br(p,{key:e,value:e},{default:sn((()=>[Pr("优先级 "+X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:sn((()=>[Cr(b,{type:"primary",onClick:c},{default:sn((()=>[Pr("保存")])),_:1}),Cr(b,{style:{"margin-left":"12px"},onClick:d},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(v,{layout:"vertical",ref_key:"formRef",ref:s,model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(m,{name:["decision","logicalCondition"],label:"判定逻辑",rules:[{required:!0,message:"请选择判定逻辑",trigger:"change"}]},{default:sn((()=>[Cr(g,{value:i.value.decision.logicalCondition,"onUpdate:value":n[2]||(n[2]=e=>i.value.decision.logicalCondition=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(o2)),(e=>(hr(),br(f,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(m,{name:["decision","expressionType"],label:"表达式类型",rules:[{required:!0,message:"请选择表达式类型",trigger:"change"}]},{default:sn((()=>[Cr(g,{value:i.value.decision.expressionType,"onUpdate:value":n[3]||(n[3]=e=>i.value.decision.expressionType=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(q1)),(e=>(hr(),br(f,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(m,{name:["decision","nodeExpression"],label:"条件表达式",rules:[{required:!0,message:"请填写条件表达式",trigger:"change"},{validator:u,trigger:"blur"}]},{default:sn((()=>[Cr(Ct(rse),{modelValue:i.value.decision.nodeExpression,"onUpdate:modelValue":n[4]||(n[4]=e=>i.value.decision.nodeExpression=e),theme:l.value,basic:"",lang:Ct(bce)(),extensions:[Ct(hse)]},null,8,["modelValue","theme","lang","extensions"])])),_:1},8,["rules"])])),_:1},8,["model"])])),_:1},8,["open"])}}}),[["__scopeId","data-v-83531903"]]),$ce=S2(Ln({__name:"BranchDesc",props:{modelValue:Q1().def({})},setup(e){const t=e,n=Ot("");Gn((()=>{var e;Zt((()=>{r()})),(null==(e=t.modelValue.decision)?void 0:e.nodeExpression)&&(n.value=t.modelValue.decision.nodeExpression)}));const o=Ot({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"520px",overflowY:"auto",overflowX:"hidden"}}),r=()=>{const e=document.getElementById("branch-desc"),t=null==e?void 0:e.querySelector(".ant-descriptions-view"),n=null==t?void 0:t.querySelector("tbody"),o=document.createElement("tr");o.className="ant-descriptions-row";const r=document.createElement("th");r.className="ant-descriptions-item-label",r.innerHTML="条件表达式",r.setAttribute("colspan","4"),o.appendChild(r),null==n||n.insertBefore(o,null==n?void 0:n.childNodes[3]);const i=(null==n?void 0:n.getElementsByClassName("ant-descriptions-row"))[3];i.childNodes[2].remove();const l=i.querySelector(".ant-descriptions-item-content");l.setAttribute("style","padding: 0"),null==l||l.setAttribute("colspan","4")};return(t,r)=>{const i=fn("a-descriptions-item"),l=fn("a-descriptions");return hr(),br(l,{id:"branch-desc",column:2,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(i,{label:"节点名称",span:2},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(i,{label:"判定逻辑"},{default:sn((()=>{var t;return[Pr(X(Ct(o2)[null==(t=e.modelValue.decision)?void 0:t.logicalCondition]),1)]})),_:1}),Cr(i,{label:"表达式类型"},{default:sn((()=>{var t;return[Pr(X(Ct(q1)[null==(t=e.modelValue.decision)?void 0:t.expressionType]),1)]})),_:1}),Cr(i,{label:"条件表达式",span:2},{default:sn((()=>[Cr(Ct(rse),{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=e=>n.value=e),readonly:"",disabled:"",theme:o.value,basic:"",lang:Ct(bce)(),extensions:[Ct(hse)]},null,8,["modelValue","theme","lang","extensions"])])),_:1})])),_:1})}}}),[["__scopeId","data-v-dc9046db"]]),Sce=Ln({__name:"BranchDetail",props:{modelValue:Q1().def({}),open:N1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-drawer");return hr(),br(o,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr($ce,{"model-value":e.modelValue},null,8,["model-value"])])),_:1},8,["open"])}}}),Cce={class:"branch-wrap"},kce={class:"branch-box-wrap"},Pce={class:"branch-box"},Mce={class:"condition-node"},Tce={class:"condition-node-box"},Ice=["onClick"],Ece=["onClick"],Ace={class:"title"},Rce={class:"node-title"},Dce={class:"priority-title"},jce={class:"content"},Bce=["innerHTML"],Nce={key:1,class:"placeholder"},zce=["onClick"],_ce={key:1,class:"top-left-cover-line"},Lce={key:2,class:"bottom-left-cover-line"},Qce={key:3,class:"top-right-cover-line"},Hce={key:4,class:"bottom-right-cover-line"},Fce=(e=>(ln("data-v-9cc29834"),e=e(),an(),e))((()=>Sr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[Sr("span",{style:{"padding-left":"18px"}},"决策节点详情")],-1))),Wce=S2(Ln({__name:"BranchNode",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=u1(),i=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{const e=i.value.conditionNodes.length;i.value.conditionNodes.splice(-1,0,{nodeName:"条件"+e,priorityLevel:e,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1,defaultDecision:0}}),i.value.conditionNodes[e].priorityLevel=e+1},a=(e,t)=>{e.childNode?a(e.childNode,t):e.childNode=t},s=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},c=(e,t)=>{const{nodeName:n,decision:o}=e.conditionNodes[t],{logicalCondition:r,expressionType:i,nodeExpression:l}=o;return l?"其他情况"!==n?`${o2[r]}\n${q1[i]}\n${l}`:"如存在未满足其他分支条件的情况,则进入此分支":"其他情况"===n?"如存在未满足其他分支条件的情况,则进入此分支":void 0},u=Ot(0),d=Ot(!1),p=Ot([]),h=Ot({}),f=e=>{const t=i.value.conditionNodes[u.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[u.value]=e,t!==o&&s(u.value,o-t),n("update:modelValue",i.value)},g=Ot([]),m=Ot(""),v=Ot([]),b=(e,t)=>{var n,l;if(v.value=[],"其他情况"!==e.nodeName)if(2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=v.value)||t.push(e.id):e.jobId&&(m.value=e.jobId.toString())})),0===v.value.length)return void(p.value[t]=!0);g.value[t]=!0}else 1===r.TYPE?p.value[t]=!0:(l=t,o.disabled||l===i.value.conditionNodes.length-1?0!==r.TYPE&&(p.value[l]=!0):(u.value=l,h.value=JSON.parse(JSON.stringify(i.value.conditionNodes[l])),d.value=!0))},y=e=>o.disabled?2===r.TYPE?"其他情况"===e.nodeName?`node-disabled node-error node-error-${e.taskBatchStatus?i2[e.taskBatchStatus].name:"default"}`:`node-error node-error-${e.taskBatchStatus?i2[e.taskBatchStatus].name:"default"}`:"其他情况"===e.nodeName?"node-disabled":"node-error":"其他情况"===e.nodeName?"node-disabled":"auto-judge-def auto-judge-hover";return(t,o)=>{const u=fn("a-button"),O=fn("a-badge"),w=fn("a-tooltip");return hr(),vr("div",Cce,[Sr("div",kce,[Sr("div",Pce,[e.disabled?Mr("",!0):(hr(),br(u,{key:0,class:"add-branch",primary:"",onClick:l},{default:sn((()=>[Pr("添加条件")])),_:1})),(hr(!0),vr(ar,null,io(i.value.conditionNodes,((o,l)=>(hr(),vr("div",{class:"col-box",key:l},[Sr("div",Mce,[Sr("div",Tce,[Sr("div",{class:W(["auto-judge",y(o)]),onClick:e=>b(o,l)},[0!==l?(hr(),vr("div",{key:0,class:"sort-left",onClick:Zi((e=>s(l,-1)),["stop"])},[Cr(Ct(BR))],8,Ece)):Mr("",!0),Sr("div",Ace,[Sr("span",Rce,[Cr(O,{status:"processing",color:"#52c41a"}),Pr(" "+X(o.nodeName)+" ",1),"其他情况"===o.nodeName?(hr(),br(w,{key:0},{title:sn((()=>[Pr(" 该分支为系统默认创建,与其他分支互斥。只有当其他分支都无法运行时,才会运行该分支。 ")])),default:sn((()=>[Cr(Ct(m$),{style:{"margin-left":"3px"}})])),_:1})):Mr("",!0)]),Sr("span",Dce,"优先级"+X(o.priorityLevel),1),e.disabled?Mr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Zi((e=>{return t=l,null==(o=i.value.conditionNodes)||o.splice(t,1),void(1===i.value.conditionNodes.length&&(i.value.childNode&&(i.value.conditionNodes[0].childNode?a(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Zt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))));var t,o}),["stop"])},null,8,["onClick"]))]),Sr("div",jce,[c(i.value,l)?(hr(),vr("span",{key:0,innerHTML:c(i.value,l)},null,8,Bce)):(hr(),vr("span",Nce," 请设置条件 "))]),l!==i.value.conditionNodes.length-2?(hr(),vr("div",{key:1,class:"sort-right",onClick:Zi((e=>s(l)),["stop"])},[Cr(Ct(ok))],8,zce)):Mr("",!0),2===Ct(r).TYPE&&o.taskBatchStatus?(hr(),br(w,{key:2},{title:sn((()=>[Pr(X(Ct(i2)[o.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(U1),{class:"error-tip",color:Ct(i2)[o.taskBatchStatus].color,size:"24px",onClick:Zi((()=>{}),["stop"]),"model-value":Ct(i2)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Mr("",!0)],10,Ice),Cr(Q2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?ao(t.$slots,"default",{key:0,node:o},void 0,!0):Mr("",!0),0==l?(hr(),vr("div",_ce)):Mr("",!0),0==l?(hr(),vr("div",Lce)):Mr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",Qce)):Mr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",Hce)):Mr("",!0),0!==Ct(r).type&&p.value[l]?(hr(),br(Sce,{key:5,open:p.value[l],"onUpdate:open":e=>p.value[l]=e,modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):Mr("",!0),0!==Ct(r).TYPE&&g.value[l]?(hr(),br(Ct(A2),{key:6,open:g.value[l],"onUpdate:open":e=>g.value[l]=e,id:m.value,ids:v.value},{default:sn((()=>[Fce,Cr($ce,{modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["open","onUpdate:open","id","ids"])):Mr("",!0)])))),128))]),Cr(Q2,{disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])]),Cr(xce,{open:d.value,"onUpdate:open":o[1]||(o[1]=e=>d.value=e),modelValue:h.value,"onUpdate:modelValue":o[2]||(o[2]=e=>h.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:f},null,8,["open","modelValue","len"])])}}}),[["__scopeId","data-v-9cc29834"]]),Zce=Ln({__name:"CallbackDrawer",props:{open:N1().def(!1),len:_1().def(0),modelValue:Q1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot({});wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{n("update:modelValue",i.value)},a=Ot(),s=()=>{var e;null==(e=a.value)||e.validate().then((()=>{c(),n("save",i.value)})).catch((()=>{xB.warning("请检查表单信息")}))},c=()=>{n("update:open",!1),r.value=!1};return(e,t)=>{const n=fn("a-typography-paragraph"),o=fn("a-input"),u=fn("a-form-item"),d=fn("a-select-option"),p=fn("a-select"),h=fn("a-radio"),f=fn("a-radio-group"),g=fn("a-form"),m=fn("a-button"),v=fn("a-drawer");return hr(),br(v,{open:r.value,"onUpdate:open":t[5]||(t[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:c},{title:sn((()=>[Cr(n,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":t[0]||(t[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:l},null,8,["content"])])),footer:sn((()=>[Cr(m,{type:"primary",onClick:s},{default:sn((()=>[Pr("保存")])),_:1}),Cr(m,{style:{"margin-left":"12px"},onClick:c},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(g,{ref_key:"formRef",ref:a,layout:"vertical",model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(u,{name:["callback","webhook"],label:"webhook",rules:[{required:!0,message:"请输入 webhook",trigger:"change"}]},{default:sn((()=>[Cr(o,{value:i.value.callback.webhook,"onUpdate:value":t[1]||(t[1]=e=>i.value.callback.webhook=e),placeholder:"请输入 webhook"},null,8,["value"])])),_:1}),Cr(u,{name:["callback","contentType"],label:"请求类型",rules:[{required:!0,message:"请选择请求类型",trigger:"change"}]},{default:sn((()=>[Cr(p,{value:i.value.callback.contentType,"onUpdate:value":t[2]||(t[2]=e=>i.value.callback.contentType=e),placeholder:"请选择请求类型"},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(r2)),(e=>(hr(),br(d,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(u,{name:["callback","secret"],label:"秘钥",rules:[{required:!0,message:"请输入秘钥",trigger:"change"}]},{default:sn((()=>[Cr(o,{value:i.value.callback.secret,"onUpdate:value":t[3]||(t[3]=e=>i.value.callback.secret=e),placeholder:"请输入秘钥"},null,8,["value"])])),_:1}),Cr(u,{name:"workflowNodeStatus",label:"工作流状态",rules:[{required:!0,message:"请选择工作流状态",trigger:"change"}]},{default:sn((()=>[Cr(f,{value:i.value.workflowNodeStatus,"onUpdate:value":t[4]||(t[4]=e=>i.value.workflowNodeStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(n2)),(e=>(hr(),br(h,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),Vce=Ln({__name:"CallbackDetail",props:{modelValue:Q1().def({}),open:N1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-descriptions"),a=fn("a-drawer");return hr(),br(a,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"节点名称"},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(o,{label:"webhook"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.callback)?void 0:t.webhook),1)]})),_:1}),Cr(o,{label:"请求类型"},{default:sn((()=>{var t;return[Pr(X(Ct(r2)[null==(t=e.modelValue.callback)?void 0:t.contentType]),1)]})),_:1}),Cr(o,{label:"密钥"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.callback)?void 0:t.secret),1)]})),_:1})])),_:1})])),_:1},8,["open"])}}}),Xce=e=>(ln("data-v-714c9e92"),e=e(),an(),e),Yce={class:"node-wrap"},Kce={class:"branch-box"},Gce={class:"condition-node",style:{"min-height":"230px"}},Uce={class:"condition-node-box",style:{"padding-top":"0"}},qce={class:"popover"},Jce=Xce((()=>Sr("span",null,"重试",-1))),eue=Xce((()=>Sr("span",null,"忽略",-1))),tue=["onClick"],nue={class:"title"},oue={class:"text",style:{color:"#935af6"}},rue={class:"content",style:{"min-height":"81px"}},iue={key:0,class:"placeholder"},lue={style:{display:"flex","justify-content":"space-between"}},aue=Xce((()=>Sr("span",{class:"content_label"},"Webhook:",-1))),sue=Xce((()=>Sr("span",{class:"content_label"},"请求类型: ",-1))),cue=Xce((()=>Sr("div",null,".........",-1))),uue={key:1,class:"top-left-cover-line"},due={key:2,class:"bottom-left-cover-line"},pue={key:3,class:"top-right-cover-line"},hue={key:4,class:"bottom-right-cover-line"},fue=Xce((()=>Sr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[Sr("span",{style:{"padding-left":"18px"}},"回调节点详情")],-1))),gue=S2(Ln({__name:"CallbackNode",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=u1(),i=Ot({}),l=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{i.value.childNode&&(i.value.conditionNodes[0].childNode?s(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Zt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))},s=(e,t)=>{e.childNode?s(e.childNode,t):e.childNode=t},c=Ot(0),u=Ot(!1),d=Ot(!1),p=Ot({}),h=e=>{i.value.conditionNodes[c.value]=e,n("update:modelValue",i.value)},f=Ot(!1),g=Ot(""),m=Ot([]),v=(e,t)=>{var n,o;if(m.value=[],2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=m.value)||t.push(e.id):e.jobId&&(g.value=e.jobId.toString())})),0===m.value.length)return void(d.value=!0);f.value=!0}else 1===r.TYPE?d.value=!0:(o=t,0===r.TYPE?(c.value=o,p.value=JSON.parse(JSON.stringify(i.value.conditionNodes[o])),u.value=!0):d.value=!0)},b=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus?i2[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover";return(t,n)=>{const o=fn("a-divider"),s=fn("a-button"),c=fn("a-badge"),y=fn("a-typography-text"),O=fn("a-tooltip"),w=fn("a-popover"),x=fn("a-descriptions-item"),$=fn("a-descriptions");return hr(),vr("div",Yce,[Sr("div",Kce,[(hr(!0),vr(ar,null,io(i.value.conditionNodes,((n,u)=>(hr(),vr("div",{class:"col-box",key:u},[Sr("div",Gce,[Sr("div",Uce,[Cr(w,{open:l.value[u]&&2===Ct(r).TYPE,getPopupContainer:e=>e.parentNode,onOpenChange:e=>l.value[u]=e},{content:sn((()=>[Sr("div",qce,[Cr(o,{type:"vertical"}),Cr(s,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(TJ)),Jce])),_:1}),Cr(o,{type:"vertical"}),Cr(s,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(rJ)),eue])),_:1})])])),default:sn((()=>{var t,o;return[Sr("div",{class:W(["auto-judge",b(n)]),onClick:e=>v(n,u)},[Sr("div",nue,[Sr("span",oue,[Cr(c,{status:"processing",color:1===n.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Pr(" "+X(n.nodeName),1)]),e.disabled?Mr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Zi(a,["stop"])}))]),Sr("div",rue,[(null==(t=n.callback)?void 0:t.webhook)?Mr("",!0):(hr(),vr("div",iue,"请配置回调通知")),(null==(o=n.callback)?void 0:o.webhook)?(hr(),vr(ar,{key:1},[Sr("div",lue,[aue,Cr(y,{style:{width:"116px"},ellipsis:"",content:n.callback.webhook},null,8,["content"])]),Sr("div",null,[sue,Pr(" "+X(Ct(r2)[n.callback.contentType]),1)]),cue],64)):Mr("",!0)]),2===Ct(r).TYPE&&n.taskBatchStatus?(hr(),br(O,{key:0},{title:sn((()=>[Pr(X(Ct(i2)[n.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(U1),{class:"error-tip",color:Ct(i2)[n.taskBatchStatus].color,size:"24px",onClick:Zi((()=>{}),["stop"]),"model-value":Ct(i2)[n.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Mr("",!0)],10,tue)]})),_:2},1032,["open","getPopupContainer","onOpenChange"]),Cr(Q2,{disabled:e.disabled,modelValue:n.childNode,"onUpdate:modelValue":e=>n.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),n.childNode?ao(t.$slots,"default",{key:0,node:n},void 0,!0):Mr("",!0),0==u?(hr(),vr("div",uue)):Mr("",!0),0==u?(hr(),vr("div",due)):Mr("",!0),u==i.value.conditionNodes.length-1?(hr(),vr("div",pue)):Mr("",!0),u==i.value.conditionNodes.length-1?(hr(),vr("div",hue)):Mr("",!0)])))),128))]),i.value.conditionNodes.length>1?(hr(),br(Q2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):Mr("",!0),0!==Ct(r).type?(hr(),br(Vce,{key:1,open:d.value,"onUpdate:open":n[1]||(n[1]=e=>d.value=e),modelValue:i.value.conditionNodes[0],"onUpdate:modelValue":n[2]||(n[2]=e=>i.value.conditionNodes[0]=e)},null,8,["open","modelValue"])):Mr("",!0),Cr(Zce,{open:u.value,"onUpdate:open":n[3]||(n[3]=e=>u.value=e),modelValue:p.value,"onUpdate:modelValue":n[4]||(n[4]=e=>p.value=e),onSave:h},null,8,["open","modelValue"]),0!==Ct(r).TYPE&&f.value?(hr(),br(Ct(A2),{key:2,open:f.value,"onUpdate:open":n[5]||(n[5]=e=>f.value=e),id:g.value,ids:m.value},{default:sn((()=>[fue,Cr($,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(x,{label:"节点名称"},{default:sn((()=>[Pr(X(i.value.conditionNodes[0].nodeName),1)])),_:1}),Cr(x,{label:"webhook"},{default:sn((()=>{var e;return[Pr(X(null==(e=i.value.conditionNodes[0].callback)?void 0:e.webhook),1)]})),_:1}),Cr(x,{label:"请求类型"},{default:sn((()=>{var e;return[Pr(X(Ct(r2)[null==(e=i.value.conditionNodes[0].callback)?void 0:e.contentType]),1)]})),_:1}),Cr(x,{label:"密钥"},{default:sn((()=>{var e;return[Pr(X(null==(e=i.value.conditionNodes[0].callback)?void 0:e.secret),1)]})),_:1})])),_:1})])),_:1},8,["open","id","ids"])):Mr("",!0)])}}}),[["__scopeId","data-v-714c9e92"]]),mue=Ln({__name:"NodeWrap",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({});return wn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),wn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>{const o=fn("node-wrap",!0);return hr(),vr(ar,null,[1==r.value.nodeType?(hr(),br(d3,{key:0,modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Mr("",!0)])),_:1},8,["modelValue","disabled"])):Mr("",!0),2==r.value.nodeType?(hr(),br(Wce,{key:1,modelValue:r.value,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Mr("",!0)])),_:1},8,["modelValue","disabled"])):Mr("",!0),3==r.value.nodeType?(hr(),br(gue,{key:2,modelValue:r.value,"onUpdate:modelValue":n[2]||(n[2]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Mr("",!0)])),_:1},8,["modelValue","disabled"])):Mr("",!0),r.value.childNode?(hr(),br(o,{key:3,modelValue:r.value.childNode,"onUpdate:modelValue":n[3]||(n[3]=e=>r.value.childNode=e),disabled:e.disabled},null,8,["modelValue","disabled"])):Mr("",!0)],64)}}}),vue="*",bue="/",yue="-",Oue=",",wue="?",xue="L",$ue="W",Sue="#",Cue="",kue="LW",Pue=(new Date).getFullYear();function Mue(e){return"number"==typeof e||/^\d+(\.\d+)?$/.test(e)}const{hasOwnProperty:Tue}=Object.prototype;function Iue(e,t){return Object.keys(t).forEach((n=>{!function(e,t,n){const o=t[n];(function(e){return null!=e})(o)&&(Tue.call(e,n)&&function(e){return null!==e&&"object"==typeof e}(o)?e[n]=Iue(Object(e[n]),t[n]):e[n]=o)}(e,t,n)})),e}const Eue={common:{from:"从",fromThe:"从第",start:"开始",every:"每",between:"在",and:"到",end:"之间的",specified:"固定的",symbolTip:"通配符支持",valTip:"值为",nearest:"最近的",current:"本",nth:"第",index:"个",placeholder:"请选择",placeholderMulti:"请选择(支持多选)",help:"帮助",wordNumError:"格式不正确,必须有6或7位",reverse:"反向解析",reset:"重置",tagError:"表达式不正确",numError:"含有非法数字",use:"使用",inputPlaceholder:"Cron表达式"},custom:{unspecified:"不固定",workDay:"工作日",lastTh:"倒数第",lastOne:"最后一个",latestWorkday:"最后一个工作日",empty:"不配置"},second:{title:"秒",val:"0 1 2...59"},minute:{title:"分",val:"0 1 2...59"},hour:{title:"时",val:"0 1 2...23"},dayOfMonth:{timeUnit:"日",title:"日",val:"1 2...31"},month:{title:"月",val:"1 2...12,或12个月的缩写(JAN ... DEC)"},dayOfWeek:{timeUnit:"日",title:"周",val:"1 2...7或星期的缩写(SUN ... SAT)",SUN:"星期天",MON:"星期一",TUE:"星期二",WED:"星期三",THU:"星期四",FRI:"星期五",SAT:"星期六"},year:{title:"年",val:Pue+" ... 2099"},period:{startError:"开始格式不符",cycleError:"循环格式不符"},range:{lowerError:"下限格式不符",upperError:"上限格式不符",lowerBiggerThanUpperError:"下限不能比上限大"},weekDay:{weekDayNumError:"周数格式不符",nthError:"天数格式不符"},app:{title:"基于Vue&Element-ui实现的Cron表达式生成器",next10FireTimes:"最近10次执行时刻"},daysOfWeekOptions:[{label:"星期天",value:1},{label:"星期一",value:2},{label:"星期二",value:3},{label:"星期三",value:4},{label:"星期四",value:5},{label:"星期五",value:6},{label:"星期六",value:7}]},Aue=Ot("zh-CN"),Rue=it({"zh-CN":Eue}),Due={messages:()=>Rue[Aue.value],use(e,t){Aue.value=e,this.add({[e]:t})},add(e={}){Iue(Rue,e)}},jue=Due.messages(),Bue={class:"cron-body-row"},Nue={class:"symbol"},zue=S2(Ln({components:{Radio:ET},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:vue},tag:{type:String,default:vue},onChange:{type:Function}},setup:e=>({Message:jue,change:function(){e.onChange&&e.onChange({tag:vue,type:vue})},EVERY:vue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",Bue,[Cr(l,{checked:e.type===e.EVERY,onClick:e.change},{default:sn((()=>[Sr("span",Nue,X(e.EVERY),1),Pr(X(e.Message.common.every)+X(e.timeUnit),1)])),_:1},8,["checked","onClick"])])}]]),_ue=Due.messages(),Lue={class:"cron-body-row"},Que={class:"symbol"},Hue=S2(Ln({components:{Radio:ET,InputNumber:pQ},props:{startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:bue},tag:{type:String,default:bue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(0);n.value`${n.value}${bue}${o.value}`));function i(t){if(e.type!==bue)return;const r=t.split(bue);2===r.length?(r[0]===vue&&(r[0]=0),!Mue(r[0])||parseInt(r[0])e.startConfig.max?xB.error(`${_ue.period.startError}:${r[0]}`):!Mue(r[1])||parseInt(r[1])e.cycleConfig.max?xB.error(`${_ue.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1]))):xB.error(`${_ue.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:_ue,type_:t,start:n,cycle:o,tag_:r,PERIOD:bue,change:function(){e.onChange&&e.onChange({type:bue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",Lue,[Cr(a,{checked:e.type===e.PERIOD,onChange:e.change},{default:sn((()=>[Sr("span",Que,X(e.tag_),1),Pr(" "+X(e.Message.common.fromThe)+" ",1),Cr(l,{size:"small",value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),min:e.startConfig.min,step:e.startConfig.step,max:e.startConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.start)+X(e.Message.common.every)+" ",1),Cr(l,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Fue=Due.messages(),Wue={class:"cron-body-row"},Zue={class:"symbol"},Vue=S2(Ln({components:{Radio:ET,InputNumber:pQ},props:{upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:yue},tag:{type:String,default:yue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(0);o.value`${o.value}${yue}${n.value}`));function l(t){if(e.type!==yue)return;const r=t.split(yue);2===r.length&&(r[0]===yue&&(r[0]=0),!Mue(r[0])||parseInt(r[0])e.lowerConfig.max||!Mue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Gn((()=>{l(e.tag)})),wn((()=>e.tag),(e=>{l(e)}),{deep:!0}),wn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:Fue,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:yue,change:function(){e.onChange&&e.onChange({type:yue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",Wue,[Cr(a,{checked:e.type===e.RANGE,onChange:e.change},{default:sn((()=>[Sr("span",Zue,X(e.tag_),1),Pr(" "+X(e.Message.common.between)+" ",1),Cr(l,{size:"small",value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),min:e.lowerConfig.min,step:e.lowerConfig.step,max:e.upper_,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.and)+" ",1),Cr(l,{size:"small",value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),min:e.lower,step:e.upperConfig.step,max:e.upperConfig.max,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.Message.common.end)+X(e.Message.common.every)+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Xue=Due.messages(),Yue=Ln({components:{Radio:ET,ASelect:Zx,Tooltip:$S},props:{nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Oue},tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Yr((()=>{let e="";if(o.value&&o.value.length){o.value.sort();for(let t=0;t{Mue(t)&&parseInt(t)>=parseInt(e.nums[0].value)&&parseInt(t)<=parseInt(e.nums[e.nums.length-1].value)&&o.value.push(parseInt(t))}))}}return Gn((()=>{i()})),wn((()=>e.tag),(()=>i()),{deep:!0}),wn((()=>e.type),(()=>i()),{deep:!0}),{Message:Xue,type_:t,tag_:n,open:r,FIXED:Oue,change:function(){e.onChange&&e.onChange({type:Oue,tag:n.value||Oue})},numArray:o,changeTag:i}}}),Kue={class:"cron-body-row"},Gue=Sr("span",{class:"symbol"},",",-1),Uue=S2(Yue,[["render",function(e,t,n,o,r,i){const l=fn("Tooltip"),a=fn("Radio"),s=fn("ASelect");return hr(),vr("div",Kue,[Cr(a,{checked:e.type===e.FIXED,onChange:e.change},{default:sn((()=>[Cr(l,{title:e.tag_},{default:sn((()=>[Gue])),_:1},8,["title"]),Pr(" "+X(e.Message.common.specified),1)])),_:1},8,["checked","onChange"]),Cr(s,{size:"small",mode:"tags",placeholder:e.Message.common.placeholder,style:{width:"300px"},options:e.nums,disabled:e.type!==e.FIXED,value:e.numArray,"onUpdate:value":t[0]||(t[0]=t=>e.numArray=t),onChange:e.change},null,8,["placeholder","options","disabled","value","onChange"])])}]]),que={watch:{tag(e){this.resolveTag(e)}},mounted(){this.resolveTag(this.tag)},methods:{resolveTag(e){null==e&&(e=Cue);let t=null;(e=this.resolveCustom(e))===Cue?t=Cue:e===wue?t=wue:e===vue?t=vue:e===kue&&(t=kue),null==t&&(t=e.startsWith("L-")||e.endsWith(xue)?xue:e.endsWith($ue)&&e.length>1?$ue:e.indexOf(Sue)>0?Sue:e.indexOf(bue)>0?bue:e.indexOf(yue)>0?yue:Oue),this.type_=t,this.tag_=e},resolveCustom:e=>e}},Jue=Due.messages(),ede=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue},mixins:[que],props:{tag:{type:String,default:vue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(vue),a=Ot(e.tag);return{Message:Jue,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.second.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),tde=Due.messages(),nde=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue},mixins:[que],props:{tag:{type:String,default:vue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(vue),a=Ot(e.tag);return{Message:tde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.minute.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),ode=Due.messages(),rde=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue},mixins:[que],props:{tag:{type:String,default:vue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:23},n={min:1,step:1,max:23},o={min:0,step:1,max:23},r={min:0,step:1,max:23},i=[];for(let s=0;s<24;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(vue),a=Ot(e.tag);return{Message:ode,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.hour.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),ide=Due.messages(),lde={class:"cron-body-row"},ade={class:"symbol"},sde=S2(Ln({components:{Radio:ET},props:{type:{type:String,default:wue},tag:{type:String,default:wue},onChange:{type:Function}},setup:e=>({Message:ide,change:function(){e.onChange&&e.onChange({tag:wue,type:wue})},UNFIXED:wue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",lde,[Cr(l,{checked:e.type===e.UNFIXED,onClick:e.change},{default:sn((()=>[Sr("span",ade,X(e.UNFIXED),1),Pr(X(e.Message.custom.unspecified),1)])),_:1},8,["checked","onClick"])])}]]),cde=Due.messages(),ude={class:"cron-body-row"},dde={class:"symbol"},pde=S2(Ln({components:{Radio:ET,InputNumber:pQ},props:{lastConfig:{type:Object,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:xue},tag:{type:String,default:xue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Yr((()=>1===n.value?xue:"L-"+(n.value-1)));function r(t){if(e.type!==xue)return;if(t===xue)return void(n.value=1);const o=t.substring(2);Mue(o)&&parseInt(o)>=e.lastConfig.min&&parseInt(o)<=e.lastConfig.max?n.value=parseInt(o)+1:xB.error(cde.common.numError+":"+o)}return Gn((()=>{r(e.tag)})),wn((()=>e.tag),(e=>{r(e)}),{deep:!0}),wn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:cde,type_:t,tag_:o,LAST:xue,lastNum:n,change:function(){e.onChange&&e.onChange({type:xue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",ude,[Cr(a,{checked:e.type===e.LAST,onChange:e.change},{default:sn((()=>[Sr("span",dde,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.lastTh)+" ",1),Cr(l,{size:"small",value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),min:e.lastConfig.min,step:e.lastConfig.step,max:e.lastConfig.max,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),hde=Due.messages(),fde={class:"cron-body-row"},gde={class:"symbol"},mde=S2(Ln({components:{Radio:ET,InputNumber:pQ},props:{targetTimeUnit:{type:String,default:null},startDateConfig:{type:Object,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:$ue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${$ue}`));function i(t){if(e.type!==$ue)return;const o=t.substring(0,t.length-1);!Mue(o)||parseInt(o)e.startDateConfig.max?xB.error(`${hde.common.numError}:${o}`):n.value=parseInt(o)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:hde,type_:t,startDate:n,weekDayNum:o,tag_:r,WORK_DAY:$ue,change:function(){e.onChange&&e.onChange({type:$ue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("InputNumber");return hr(),vr("div",fde,[Cr(l,{checked:e.type===e.WORK_DAY,onChange:e.change},{default:sn((()=>[Sr("span",gde,X(e.tag_),1),Pr(" "+X(e.Message.common.every)+X(e.targetTimeUnit),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",value:e.startDate,"onUpdate:value":t[0]||(t[0]=t=>e.startDate=t),min:e.startDateConfig.min,step:e.startDateConfig.step,max:e.startDateConfig.max,disabled:e.type!==e.WORK_DAY,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.nearest)+X(e.Message.custom.workDay),1)])}]]),vde=Due.messages(),bde={class:"cron-body-row"},yde={class:"symbol"},Ode=S2(Ln({components:{Radio:ET},props:{targetTimeUnit:{type:String,default:null},type:{type:String,default:kue},tag:{type:String,default:kue},onChange:{type:Function}},setup:e=>({Message:vde,change:function(){e.onChange&&e.onChange({tag:kue,type:kue})},LAST_WORK_DAY:kue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",bde,[Cr(l,{checked:e.type===e.LAST_WORK_DAY,onClick:e.change},{default:sn((()=>[Sr("span",yde,X(e.LAST_WORK_DAY),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.latestWorkday),1)])),_:1},8,["checked","onClick"])])}]]),wde=Due.messages(),xde=31,$de=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue,UnFixed:sde,Last:pde,WorkDay:mde,LastWorkDay:Ode},mixins:[que],props:{tag:{type:String,default:vue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:xde},n={min:1,step:1,max:xde},o={min:1,step:1,max:xde},r={min:1,step:1,max:xde},i={min:1,step:1,max:xde},l=[];for(let c=1;c<32;c++){const e={label:c.toString(),value:c};l.push(e)}const a=Ot(vue),s=Ot(e.tag);return{Message:wde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,lastConfig:i,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("UnFixed"),d=fn("Last"),p=fn("WorkDay"),h=fn("LastWorkDay");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Cr(d,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"last-config":e.lastConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","last-config","onChange"]),Cr(p,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","start-date-config","onChange"]),Cr(h,{type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["type","tag","target-time-unit","start-date-config","onChange"])],64)}]]),Sde=Due.messages(),Cde=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue},mixins:[que],props:{tag:{type:String,default:vue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:12},n={min:1,step:1,max:12},o={min:1,step:1,max:12},r={min:1,step:1,max:12},i=[];for(let s=1;s<13;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(vue),a=Ot(e.tag);return{Message:Sde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.month.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),kde=Due.messages(),Pde={class:"cron-body-row"},Mde={class:"symbol"},Tde=S2(Ln({components:{Radio:ET},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:Cue},tag:{type:String,default:Cue},onChange:{type:Function}},setup:e=>({Message:kde,change:function(){e.onChange&&e.onChange({tag:Cue,type:Cue})},EMPTY:Cue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",Pde,[Cr(l,{checked:e.type===e.EMPTY,onClick:e.change},{default:sn((()=>[Sr("span",Mde,X(e.Message.custom.empty),1)])),_:1},8,["checked","onClick"])])}]]),Ide=Due.messages(),Ede=Pue,Ade=2099,Rde=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue,Empty:Tde},mixins:[que],props:{tag:{type:String,default:Cue},onChange:{type:Function}},setup(e){const t={min:Ede,step:1,max:Ade},n={min:1,step:1,max:Ade},o={min:Ede,step:1,max:Ade},r={min:Ede,step:1,max:Ade},i=[];for(let s=Ede;s<2100;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(Cue),a=Ot(e.tag);return{Message:Ide,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("Empty");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.year.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,tag:e.tag_,onChange:e.change},null,8,["type","tag","onChange"])],64)}]]),Dde=Due.messages(),jde={class:"cron-body-row"},Bde={class:"symbol"},Nde=S2(Ln({components:{Radio:ET,InputNumber:pQ,ASelect:Zx},props:{nums:{type:Array,default:null},startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:bue},tag:{type:String,default:bue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${bue}${o.value}`));function i(t){if(e.type!==bue)return;const r=t.split(bue);2===r.length?!Mue(r[0])||parseInt(r[0])e.startConfig.max?xB.error(`${Dde.period.startError}:${r[0]}`):!Mue(r[1])||parseInt(r[1])e.cycleConfig.max?xB.error(`${Dde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):xB.error(`${Dde.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Dde,type_:t,start:n,cycle:o,tag_:r,PERIOD:bue,change:function(){e.onChange&&e.onChange({type:bue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("ASelect"),s=fn("InputNumber");return hr(),vr("div",jde,[Cr(l,{checked:e.type===e.PERIOD,onChange:e.change},{default:sn((()=>[Sr("span",Bde,X(e.tag_),1),Pr(" "+X(e.Message.common.from),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",style:{width:"100px"},value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Pr(" "+X(e.Message.common.start)+X(e.Message.common.every)+" ",1),Cr(s,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])}]]),zde=Due.messages(),_de=Zx.Option,Lde={class:"cron-body-row"},Qde={class:"symbol"},Hde=S2(Ln({components:{Radio:ET,ASelect:Zx,AOption:_de},props:{nums:{type:Array,default:null},upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:yue},tag:{type:String,default:yue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(0);o.value`${o.value}${yue}${n.value}`));function l(t){if(e.type!==yue)return;const r=t.split(yue);2===r.length&&(r[0]===yue&&(r[0]=0),!Mue(r[0])||parseInt(r[0])e.lowerConfig.max||!Mue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Gn((()=>{l(e.tag)})),wn((()=>e.tag),(e=>{l(e)}),{deep:!0}),wn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:zde,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:yue,change:function(){e.onChange&&e.onChange({type:yue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("AOption"),s=fn("ASelect");return hr(),vr("div",Lde,[Cr(l,{checked:e.type===e.RANGE,onChange:e.change},{default:sn((()=>[Sr("span",Qde,X(e.tag_),1),Pr(" "+X(e.Message.common.between),1)])),_:1},8,["checked","onChange"]),Cr(s,{size:"small",style:{width:"100px"},value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.nums,(t=>(hr(),br(a,{key:t.value,value:t.value,disabled:Number(t.value)>e.upper_},{default:sn((()=>[Pr(X(t.label),1)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value","placeholder","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.and)+" ",1),Cr(s,{size:"small",style:{width:"100px"},value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Pr(" "+X(e.Message.common.end)+X(e.Message.common.every)+X(e.timeUnit),1)])}]]),Fde=Due.messages(),Wde={class:"cron-body-row"},Zde={class:"symbol"},Vde=S2(Ln({components:{Radio:ET,ASelect:Zx},props:{nums:{type:Array,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:xue},tag:{type:String,default:xue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Yr((()=>(n.value>=1&&n.value<7?n.value:"")+xue));function r(t){if(e.type!==xue)return;if(t===xue)return void(n.value=7);const o=t.substring(0,t.length-1);Mue(o)&&parseInt(o)>=parseInt(e.nums[0].value)&&parseInt(o)<=parseInt(e.nums[e.nums.length-1].value)?n.value=parseInt(o):xB.error(Fde.common.numError+":"+o)}return Gn((()=>{r(e.tag)})),wn((()=>e.tag),(e=>{r(e)}),{deep:!0}),wn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:Fde,type_:t,tag_:o,LAST:xue,lastNum:n,change:function(){e.onChange&&e.onChange({type:xue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("ASelect");return hr(),vr("div",Wde,[Cr(l,{checked:e.type===e.LAST,onChange:e.change},{default:sn((()=>[Sr("span",Zde,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.lastTh),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",style:{width:"100px"},value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),Xde=Due.messages(),Yde={class:"cron-body-row"},Kde={class:"symbol"},Gde=S2(Ln({components:{Radio:ET,InputNumber:pQ,ASelect:Zx},props:{targetTimeUnit:{type:String,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Sue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${Sue}${o.value}`));function i(t){if(e.type!==Sue)return;const r=t.split(Sue);2===r.length?!Mue(r[0])||parseInt(r[0])parseInt(e.nums[e.nums.length-1].value)?xB.error(`${Xde.period.startError}:${r[0]}`):!Mue(r[1])||parseInt(r[1])<1||parseInt(r[1])>5?xB.error(`${Xde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):xB.error(`${Xde.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Xde,type_:t,nth:n,weekDayNum:o,tag_:r,WEEK_DAY:Sue,change:function(){e.onChange&&e.onChange({type:Sue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("InputNumber"),s=fn("ASelect");return hr(),vr("div",Yde,[Cr(l,{checked:e.type===e.WEEK_DAY,onChange:e.change},{default:sn((()=>[Sr("span",Kde,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.common.nth),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",value:e.nth,"onUpdate:value":t[0]||(t[0]=t=>e.nth=t),min:1,step:1,max:5,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","disabled","onChange"]),Pr(" "+X(e.Message.common.index)+" ",1),Cr(s,{size:"small",style:{width:"100px"},value:e.weekDayNum,"onUpdate:value":t[1]||(t[1]=t=>e.weekDayNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),Ude=Due.messages(),qde=S2(Ln({components:{Every:zue,Period:Nde,Range:Hde,Fixed:Uue,UnFixed:sde,Last:Vde,WeekDay:Gde},mixins:[que],props:{tag:{type:String,default:wue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:7},n={min:1,step:1,max:7},o={min:1,step:1,max:7},r={min:1,step:1,max:7},i={min:1,step:1,max:7},l=Ude.daysOfWeekOptions,a=Ot(vue),s=Ot(e.tag);return{Message:Ude,startConfig:t,cycleConfig:o,lowerConfig:r,upperConfig:i,startDateConfig:n,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("UnFixed"),d=fn("Last"),p=fn("WeekDay");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.dayOfWeek.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Cr(d,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,"last-config":e.startDateConfig,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","last-config","onChange"]),Cr(p,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","onChange"])],64)}]]),Jde=Due.messages(),epe=Ln({name:"VueCron",components:{AInput:Uz,Popover:MS,Card:CE,Seconds:ede,Minutes:nde,Hours:rde,Days:$de,Months:Cde,Years:Rde,WeekDays:qde,CalendarOutlined:fN},props:{value:{type:String,default:"* * * * * ? *"}},setup(e,{emit:t}){const n=Ot(""),o=Ot([]),r=[{key:"seconds",tab:Jde.second.title},{key:"minutes",tab:Jde.minute.title},{key:"hours",tab:Jde.hour.title},{key:"days",tab:Jde.dayOfMonth.title},{key:"months",tab:Jde.month.title},{key:"weekdays",tab:Jde.dayOfWeek.title},{key:"years",tab:Jde.year.title}],i=it({second:vue,minute:vue,hour:vue,dayOfMonth:vue,month:vue,dayOfWeek:wue,year:Cue}),l=Ot("seconds");function a(e){const o=e.trim().split(" ");if(!e||e.trim().length<11||6!==o.length&&7!==o.length){const e="* * * * * ?";return n.value=e,s(e),xB.error(Jde.common.tagError),t("update:value",e),void t("change",e)}s(e),i.second=o[0],i.minute=o[1],i.hour=o[2],i.dayOfMonth=o[3],i.month=o[4],i.dayOfWeek=o[5],i.year=7===o.length?o[6]:""}function s(e){d1(`/job/cron?cron=${e}`).then((e=>{if(o.value=e,0===o.value.length){const e="* * * * * ?";n.value=e,s(e),t("update:value",e),t("change",e)}}))}return wn((()=>e.value),(e=>{a(e),n.value=e}),{immediate:!0}),{cronStr:n,list:o,tabList:r,activeTabKey:l,tag:i,changeTime:a,timeChange:function(e,n){const o={...i};o[e]=n,"dayOfWeek"===e&&"*"!==n&&"?"!==n?o.dayOfMonth="?":"dayOfMonth"===e&&"*"!==n&&"?"!==n&&(o.dayOfWeek="?");let r=[];r.push(o.second),r.push(o.minute),r.push(o.hour),r.push(o.dayOfMonth),r.push(o.month),r.push(o.dayOfWeek),r.push(o.year),s(r.join(" ").trim()),t("update:value",r.join(" ").trim()),t("change",r.join(" ").trim())}}}}),tpe={key:0},npe={key:1},ope={key:2},rpe={key:3},ipe={key:4},lpe={key:5},ape={key:6},spe={style:{display:"flex","align-items":"center","justify-content":"space-between"}},cpe=Sr("span",{style:{width:"150px","font-weight":"600"}},"CRON 表达式: ",-1),upe=Sr("div",{style:{margin:"20px 0","border-left":"#1677ff 5px solid","font-size":"medium","font-weight":"bold"}},"    近5次的运行时间: ",-1),dpe=S2(epe,[["render",function(e,t,n,o,r,i){const l=fn("AInput"),a=fn("CalendarOutlined"),s=fn("Seconds"),c=fn("Minutes"),u=fn("Hours"),d=fn("Days"),p=fn("Months"),h=fn("WeekDays"),f=fn("Years"),g=fn("a-tab-pane"),m=fn("a-tabs"),v=fn("a-divider"),b=fn("a-input"),y=fn("a-button"),O=fn("Card"),w=fn("Popover");return hr(),br(w,{placement:"bottom",trigger:"click"},{content:sn((()=>[Cr(O,{size:"small"},{default:sn((()=>[Cr(m,{activeKey:e.activeTabKey,"onUpdate:activeKey":t[7]||(t[7]=t=>e.activeTabKey=t),type:"card"},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.tabList,(n=>(hr(),br(g,{key:n.key},{tab:sn((()=>[Sr("span",null,[Cr(a),Pr(" "+X(n.tab),1)])])),default:sn((()=>["seconds"===e.activeTabKey?(hr(),vr("div",tpe,[Cr(s,{tag:e.tag.second,onChange:t[0]||(t[0]=t=>e.timeChange("second",t.tag))},null,8,["tag"])])):"minutes"===e.activeTabKey?(hr(),vr("div",npe,[Cr(c,{tag:e.tag.minute,onChange:t[1]||(t[1]=t=>e.timeChange("minute",t.tag))},null,8,["tag"])])):"hours"===e.activeTabKey?(hr(),vr("div",ope,[Cr(u,{tag:e.tag.hour,onChange:t[2]||(t[2]=t=>e.timeChange("hour",t.tag))},null,8,["tag"])])):"days"===e.activeTabKey?(hr(),vr("div",rpe,[Cr(d,{tag:e.tag.dayOfMonth,onChange:t[3]||(t[3]=t=>e.timeChange("dayOfMonth",t.tag))},null,8,["tag"])])):"months"===e.activeTabKey?(hr(),vr("div",ipe,[Cr(p,{tag:e.tag.month,onChange:t[4]||(t[4]=t=>e.timeChange("month",t.tag))},null,8,["tag"])])):"weekdays"===e.activeTabKey?(hr(),vr("div",lpe,[Cr(h,{tag:e.tag.dayOfWeek,onChange:t[5]||(t[5]=t=>e.timeChange("dayOfWeek",t.tag))},null,8,["tag"])])):"years"===e.activeTabKey?(hr(),vr("div",ape,[Cr(f,{tag:e.tag.year,onChange:t[6]||(t[6]=t=>e.timeChange("year",t.tag))},null,8,["tag"])])):Mr("",!0)])),_:2},1024)))),128))])),_:1},8,["activeKey"]),Cr(v),Sr("div",spe,[cpe,Cr(b,{value:e.cronStr,"onUpdate:value":t[8]||(t[8]=t=>e.cronStr=t)},null,8,["value"]),Cr(y,{type:"primary",style:{"margin-left":"16px"},onClick:t[9]||(t[9]=t=>e.changeTime(e.cronStr))},{default:sn((()=>[Pr("保存")])),_:1})]),Cr(v),upe,(hr(!0),vr(ar,null,io(e.list,((e,t)=>(hr(),vr("div",{key:e,style:{"margin-top":"10px"}},"第"+X(t+1)+"次: "+X(e),1)))),128))])),_:1})])),default:sn((()=>[Cr(l,{readonly:"",value:e.value},null,8,["value"])])),_:1})}]]),ppe=Ln({__name:"StartDrawer",props:{open:N1().def(!1),modelValue:Q1().def({})},emits:["update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=u1();let i="";const l=Ot(!1),a=Ot({}),s=Ot([]);wn((()=>o.open),(e=>{l.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{a.value=e,i=e.workflowName?e.workflowName:e.groupName?e.groupName:"请选择组"}),{immediate:!0,deep:!0});const c=Ot(),u=()=>{var e;null==(e=c.value)||e.validate().then((()=>{d(),n("save",a.value)})).catch((()=>{xB.warning("请检查表单信息")}))},d=()=>{n("update:open",!1),l.value=!1};Gn((()=>{Zt((()=>{p()}))}));const p=()=>{d1("/group/all/group-name/list").then((e=>{s.value=e}))},h=e=>{1===e?a.value.triggerInterval="* * * * * ?":2===e&&(a.value.triggerInterval="60")},f={groupName:[{required:!0,message:"请选择组",trigger:"change"}],triggerType:[{required:!0,message:"请选择触发类型",trigger:"change"}],triggerInterval:[{required:!0,message:"请输入触发间隔",trigger:"change"}],executorTimeout:[{required:!0,message:"请输入执行超时时间",trigger:"change"}],blockStrategy:[{required:!0,message:"请选择阻塞策略",trigger:"change"}],workflowStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]};return(e,t)=>{const n=fn("a-input"),o=fn("a-form-item"),p=fn("a-select-option"),g=fn("a-select"),m=fn("a-col"),v=fn("a-input-number"),b=fn("a-form-item-rest"),y=fn("a-row"),O=fn("a-radio"),w=fn("a-radio-group"),x=fn("a-textarea"),$=fn("a-form"),S=fn("a-button"),C=fn("a-drawer");return hr(),br(C,{open:l.value,"onUpdate:open":t[9]||(t[9]=e=>l.value=e),title:Ct(i),"destroy-on-close":"",width:610,onClose:d},{footer:sn((()=>[Cr(S,{type:"primary",onClick:u},{default:sn((()=>[Pr("保存")])),_:1}),Cr(S,{style:{"margin-left":"12px"},onClick:d},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr($,{ref_key:"formRef",ref:c,layout:"vertical",model:a.value,rules:f,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(o,{name:"workflowName",label:"工作流名称"},{default:sn((()=>[Cr(n,{value:a.value.workflowName,"onUpdate:value":t[0]||(t[0]=e=>a.value.workflowName=e),placeholder:"请输入工作流名称"},null,8,["value"])])),_:1}),Cr(o,{name:"groupName",label:"组名称"},{default:sn((()=>[Cr(g,{ref:"select",value:a.value.groupName,"onUpdate:value":t[1]||(t[1]=e=>a.value.groupName=e),placeholder:"请选择组",disabled:0===Ct(r).TYPE&&void 0!==Ct(r).ID&&null!==Ct(r).ID&&""!==Ct(r).ID&&"undefined"!==Ct(r).ID},{default:sn((()=>[(hr(!0),vr(ar,null,io(s.value,(e=>(hr(),br(p,{key:e,value:e},{default:sn((()=>[Pr(X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value","disabled"])])),_:1}),Cr(y,{gutter:24},{default:sn((()=>[Cr(m,{span:8},{default:sn((()=>[Cr(o,{name:"triggerType",label:"触发类型"},{default:sn((()=>[Cr(g,{ref:"select",value:a.value.triggerType,"onUpdate:value":t[2]||(t[2]=e=>a.value.triggerType=e),placeholder:"请选择触发类型",onChange:h},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(J1)),(e=>(hr(),br(p,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1}),Cr(m,{span:16},{default:sn((()=>[Cr(o,{name:"triggerInterval",label:"触发间隔"},{default:sn((()=>[Cr(b,null,{default:sn((()=>[1===a.value.triggerType?(hr(),br(Ct(dpe),{key:0,value:a.value.triggerInterval,"onUpdate:value":t[3]||(t[3]=e=>a.value.triggerInterval=e)},null,8,["value"])):(hr(),br(v,{key:1,addonAfter:"秒",style:{width:"-webkit-fill-available"},value:a.value.triggerInterval,"onUpdate:value":t[4]||(t[4]=e=>a.value.triggerInterval=e),placeholder:"请输入触发间隔"},null,8,["value"]))])),_:1})])),_:1})])),_:1})])),_:1}),Cr(y,{gutter:24},{default:sn((()=>[Cr(m,{span:8},{default:sn((()=>[Cr(o,{name:"executorTimeout",label:"执行超时时间"},{default:sn((()=>[Cr(v,{addonAfter:"秒",value:a.value.executorTimeout,"onUpdate:value":t[5]||(t[5]=e=>a.value.executorTimeout=e),placeholder:"请输入超时时间"},null,8,["value"])])),_:1})])),_:1}),Cr(m,{span:16},{default:sn((()=>[Cr(o,{name:"blockStrategy",label:"阻塞策略"},{default:sn((()=>[Cr(w,{value:a.value.blockStrategy,"onUpdate:value":t[6]||(t[6]=e=>a.value.blockStrategy=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(e2)),(e=>(hr(),br(O,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1})])),_:1}),Cr(o,{name:"workflowStatus",label:"节点状态"},{default:sn((()=>[Cr(w,{value:a.value.workflowStatus,"onUpdate:value":t[7]||(t[7]=e=>a.value.workflowStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(n2)),(e=>(hr(),br(O,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(o,{name:"description",label:"描述"},{default:sn((()=>[Cr(x,{value:a.value.description,"onUpdate:value":t[8]||(t[8]=e=>a.value.description=e),"auto-size":{minRows:5},placeholder:"请输入描述"},null,8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open","title"])}}}),hpe=Ln({__name:"StartDetail",props:{modelValue:Q1().def({}),open:N1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-descriptions"),a=fn("a-drawer");return hr(),br(a,{title:"工作流详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"工作流名称"},{default:sn((()=>[Pr(X(e.modelValue.workflowName),1)])),_:1}),Cr(o,{label:"组名称"},{default:sn((()=>[Pr(X(e.modelValue.groupName),1)])),_:1}),Cr(o,{label:"触发类型"},{default:sn((()=>[Pr(X(Ct(J1)[e.modelValue.triggerType]),1)])),_:1}),Cr(o,{label:"触发间隔"},{default:sn((()=>[Pr(X(e.modelValue.triggerInterval)+" "+X(2===e.modelValue.triggerType?"秒":null),1)])),_:1}),Cr(o,{label:"执行超时时间"},{default:sn((()=>[Pr(X(e.modelValue.executorTimeout)+" 秒 ",1)])),_:1}),Cr(o,{label:"阻塞策略"},{default:sn((()=>[Pr(X(Ct(e2)[e.modelValue.blockStrategy]),1)])),_:1}),Cr(o,{label:"工作流状态"},{default:sn((()=>[Pr(X(Ct(n2)[e.modelValue.workflowStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),fpe=e=>(ln("data-v-c07f8c3a"),e=e(),an(),e),gpe={class:"node-wrap"},mpe={class:"title",style:{background:"#ffffff"}},vpe={class:"text",style:{color:"#ff943e"}},bpe={key:0,class:"content"},ype=fpe((()=>Sr("span",{class:"content_label"},"组名称: ",-1))),Ope=fpe((()=>Sr("span",{class:"content_label"},"阻塞策略: ",-1))),wpe=fpe((()=>Sr("div",null,".........",-1))),xpe={key:1,class:"content"},$pe=[fpe((()=>Sr("span",{class:"placeholder"}," 请配置工作流 ",-1)))],Spe=S2(Ln({__name:"StartNode",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({}),i=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0}),wn((()=>i.value),(e=>{n("update:modelValue",e)}));const l=u1();wn((()=>i.value.groupName),(e=>{e&&(l.setGroupName(e),d1(`/job/list?groupName=${e}`).then((e=>{l.setJobList(e)})))}),{immediate:!0});const a=Ot(!1),s=Ot(!1),c=e=>{i.value=e},u=()=>{0===l.TYPE?(r.value=JSON.parse(JSON.stringify(i.value)),a.value=!0):s.value=!0};return(t,n)=>{const o=fn("a-badge"),d=fn("a-typography-text"),p=fn("a-tooltip");return hr(),vr("div",gpe,[Sr("div",{class:W([e.disabled?"start-node-disabled":"node-wrap-box-hover","node-wrap-box start-node node-error-success"]),onClick:u},[Sr("div",mpe,[Sr("span",vpe,[Cr(o,{status:"processing",color:1===i.value.workflowStatus?"#52c41a":"#ff000d"},null,8,["color"]),Pr(" "+X(i.value.workflowName?i.value.workflowName:"请选择组"),1)])]),i.value.groupName?(hr(),vr("div",bpe,[Sr("div",null,[ype,Cr(d,{style:{width:"135px"},ellipsis:"",content:i.value.groupName},null,8,["content"])]),Sr("div",null,[Ope,Pr(X(Ct(e2)[i.value.blockStrategy]),1)]),wpe])):(hr(),vr("div",xpe,$pe)),2===Ct(l).TYPE?(hr(),br(p,{key:2},{title:sn((()=>[Pr(X(Ct(i2)[3].title),1)])),default:sn((()=>[Cr(Ct(U1),{class:"error-tip",color:Ct(i2)[3].color,size:"24px",onClick:Zi((()=>{}),["stop"]),"model-value":Ct(i2)[3].icon},null,8,["color","model-value"])])),_:1})):Mr("",!0)],2),Cr(Q2,{disabled:e.disabled,modelValue:i.value.nodeConfig,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.nodeConfig=e)},null,8,["disabled","modelValue"]),0!==Ct(l).TYPE?(hr(),br(hpe,{key:0,open:s.value,"onUpdate:open":n[1]||(n[1]=e=>s.value=e),modelValue:i.value,"onUpdate:modelValue":n[2]||(n[2]=e=>i.value=e)},null,8,["open","modelValue"])):Mr("",!0),Cr(ppe,{open:a.value,"onUpdate:open":n[3]||(n[3]=e=>a.value=e),modelValue:r.value,"onUpdate:modelValue":n[4]||(n[4]=e=>r.value=e),onSave:c},null,8,["open","modelValue"])])}}}),[["__scopeId","data-v-c07f8c3a"]]),Cpe={class:"workflow-design"},kpe={class:"box-scale"},Ppe=Sr("div",{class:"end-node"},[Sr("div",{class:"end-node-circle"}),Sr("div",{class:"end-node-text"},"流程结束")],-1),Mpe=Ln({__name:"WorkFlow",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({});return wn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),wn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>(hr(),vr("div",Cpe,[Sr("div",kpe,[Cr(Spe,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},null,8,["modelValue","disabled"]),r.value.nodeConfig?(hr(),br(mue,{key:0,modelValue:r.value.nodeConfig,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value.nodeConfig=e),disabled:e.disabled},null,8,["modelValue","disabled"])):Mr("",!0),Ppe])]))}}),Tpe={style:{width:"calc(100vw - 16px)",height:"calc(100vh - 48px)"}},Ipe={class:"header"},Epe={key:0,class:"buttons"},Ape={style:{overflow:"auto",width:"100vw",height:"calc(100vh - 48px)"}},Rpe=S2(Ln({__name:"App",setup(e){const t=e=>{const t={},n=window.location.href.split("?")[1];return n&&n.split("&").forEach((e=>{const n=e.split("=")[1],o=e.split("=")[0];t[o]=n})),t[e]},n=u1(),o=Ot(100);let r=t("id");const i=localStorage.getItem("Access-Token"),l=t("mode"),a=localStorage.getItem("app_namespace"),s="xkjIc2ZHZ0"===t("x1c2Hdd6"),c="kaxC8Iml"===t("x1c2Hdd6")||s,u="wA4wN1nZ"===t("x1c2Hdd6");Gn((()=>{if(n.clear(),!["D7Rzd7Oe","kaxC8Iml","xkjIc2ZHZ0","wA4wN1nZ"].includes(t("x1c2Hdd6")))return d.value=!0,void xB.error({content:"未知错误,请联系管理员",duration:0});n.setToken(i),n.setMode(l),n.setNameSpaceId(a),n.setType(c?s?2:1:0),p.value=c,r&&"undefined"!==r&&(n.setId(u?"":r),s?v():m())}));const d=Ot(!1),p=Ot(!1),h=Ot({workflowStatus:1,blockStrategy:1,description:void 0,executorTimeout:60}),f=()=>{"undefined"===r||u?(h.value.id=void 0,d1("/workflow","post",h.value).then((()=>{window.parent.postMessage({code:"SV5ucvLBhvFkOftb",data:JSON.stringify(h.value)})}))):d1("/workflow","put",h.value).then((()=>{window.parent.postMessage({code:"8Rr3XPtVVAHfduQg",data:JSON.stringify(h.value)})}))},g=()=>{window.parent.postMessage({code:"kb4DO9h6WIiqFhbp"})},m=()=>{d.value=!0,d1(`/workflow/${r}`).then((e=>{h.value=e})).finally((()=>{d.value=!1}))},v=()=>{d.value=!0,d1(`/workflow/batch/${r}`).then((e=>{h.value=e})).finally((()=>{d.value=!1}))},b=e=>{o.value+=10*e,o.value<=10?o.value=10:o.value>=300&&(o.value=300)};return(e,t)=>{const n=fn("a-button"),r=fn("a-tooltip"),i=fn("a-affix"),l=fn("a-spin");return hr(),vr("div",Tpe,[Cr(i,{"offset-top":0},{default:sn((()=>[Sr("div",Ipe,[Sr("div",null,[Cr(r,{title:"缩小"},{default:sn((()=>[Cr(n,{type:"primary",icon:Kr(Ct(SJ)),onClick:t[0]||(t[0]=e=>b(-1))},null,8,["icon"])])),_:1}),Pr(" "+X(o.value)+"% ",1),Cr(r,{title:"放大"},{default:sn((()=>[Cr(n,{type:"primary",icon:Kr(Ct(MI)),onClick:t[1]||(t[1]=e=>b(1))},null,8,["icon"])])),_:1})]),p.value?Mr("",!0):(hr(),vr("div",Epe,[Cr(n,{type:"primary",siz:"large",onClick:f},{default:sn((()=>[Pr("保存")])),_:1}),Cr(n,{siz:"large",style:{"margin-left":"16px"},onClick:g},{default:sn((()=>[Pr("取消")])),_:1})]))])])),_:1}),Sr("div",Ape,[Cr(l,{spinning:d.value},{default:sn((()=>[Cr(Ct(Mpe),{class:"work-flow",modelValue:h.value,"onUpdate:modelValue":t[2]||(t[2]=e=>h.value=e),disabled:p.value,style:_([{"transform-origin":"0 0"},`transform: scale(${o.value/100})`])},null,8,["modelValue","disabled","style"])])),_:1},8,["spinning"])])])}}}),[["__scopeId","data-v-181c4323"]]);function Dpe(e,t){var n;return e="object"==typeof(n=e)&&null!==n?e:Object.create(null),new Proxy(e,{get:(e,n,o)=>"key"===n?Reflect.get(e,n,o):Reflect.get(e,n,o)||Reflect.get(t,n,o)})}function jpe(e,{storage:t,serializer:n,key:o,debug:r}){try{const r=null==t?void 0:t.getItem(o);r&&e.$patch(null==n?void 0:n.deserialize(r))}catch(Lpe){}}function Bpe(e,{storage:t,serializer:n,key:o,paths:r,debug:i}){try{const i=Array.isArray(r)?function(e,t){return t.reduce(((t,n)=>{const o=n.split(".");return function(e,t,n){return t.slice(0,-1).reduce(((e,t)=>/^(__proto__)$/.test(t)?{}:e[t]=e[t]||{}),e)[t[t.length-1]]=n,e}(t,o,function(e,t){return t.reduce(((e,t)=>null==e?void 0:e[t]),e)}(e,o))}),{})}(e,r):e;t.setItem(o,n.serialize(i))}catch(Lpe){}}var Npe=function(e={}){return t=>{const{auto:n=!1}=e,{options:{persist:o=n},store:r,pinia:i}=t;if(!o)return;if(!(r.$id in i.state.value)){const e=i._s.get(r.$id.replace("__hot:",""));return void(e&&Promise.resolve().then((()=>e.$persist())))}const l=(Array.isArray(o)?o.map((t=>Dpe(t,e))):[Dpe(o,e)]).map(function(e,t){return n=>{var o;try{const{storage:r=localStorage,beforeRestore:i,afterRestore:l,serializer:a={serialize:JSON.stringify,deserialize:JSON.parse},key:s=t.$id,paths:c=null,debug:u=!1}=n;return{storage:r,beforeRestore:i,afterRestore:l,serializer:a,key:(null!=(o=e.key)?o:e=>e)("string"==typeof s?s:s(t.$id)),paths:c,debug:u}}catch(Lpe){return n.debug,null}}}(e,r)).filter(Boolean);r.$persist=()=>{l.forEach((e=>{Bpe(r.$state,e)}))},r.$hydrate=({runHooks:e=!0}={})=>{l.forEach((n=>{const{beforeRestore:o,afterRestore:i}=n;e&&(null==o||o(t)),jpe(r,n),e&&(null==i||i(t))}))},l.forEach((e=>{const{beforeRestore:n,afterRestore:o}=e;null==n||n(t),jpe(r,e),null==o||o(t),r.$subscribe(((t,n)=>{Bpe(n,e)}),{detached:!0})}))}}();const zpe=function(){const e=J(!0),t=e.run((()=>Ot({})));let n=[],o=[];const r=ht({install(e){qi(r),r._a=e,e.provide(Ji,r),e.config.globalProperties.$pinia=r,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}();zpe.use(Npe);const _pe=Gi(Rpe);_pe.use(c1),_pe.use(zpe),_pe.mount("#app")}},function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports});export default o(); +function p1(e){return"[object Object]"===Object.prototype.toString.call(e)}function h1(){return h1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(r[n]=e[n]);return r}const g1={silent:!1,logLevel:"warn"},m1=["validator"],v1=Object.prototype,b1=v1.toString,y1=v1.hasOwnProperty,O1=/^\s*function (\w+)/;function w1(e){var t;const n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){const e=n.toString().match(O1);return e?e[1]:""}return""}const x1=function(e){var t,n;return!1!==p1(e)&&(void 0===(t=e.constructor)||!1!==p1(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))};let $1=e=>e;const S1=(e,t)=>y1.call(e,t),C1=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},k1=Array.isArray||function(e){return"[object Array]"===b1.call(e)},P1=e=>"[object Function]"===b1.call(e),M1=(e,t)=>x1(e)&&S1(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),T1=e=>x1(e)&&(S1(e,"type")||["_vueTypes_name","validator","default","required"].some((t=>S1(e,t))));function I1(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function E1(e,t,n=!1){let o,r=!0,i="";o=x1(e)?e:{type:e};const l=M1(o)?o._vueTypes_name+" - ":"";if(T1(o)&&null!==o.type){if(void 0===o.type||!0===o.type)return r;if(!o.required&&null==t)return r;k1(o.type)?(r=o.type.some((e=>!0===E1(e,t,!0))),i=o.type.map((e=>w1(e))).join(" or ")):(i=w1(o),r="Array"===i?k1(t):"Object"===i?x1(t):"String"===i||"Number"===i||"Boolean"===i||"Function"===i?function(e){if(null==e)return"";const t=e.constructor.toString().match(O1);return t?t[1].replace(/^Async/,""):""}(t)===i:t instanceof o.type)}if(!r){const e=`${l}value "${t}" should be of type "${i}"`;return!1===n?($1(e),!1):e}if(S1(o,"validator")&&P1(o.validator)){const e=$1,i=[];if($1=e=>{i.push(e)},r=o.validator(t),$1=e,!r){const e=(i.length>1?"* ":"")+i.join("\n* ");return i.length=0,!1===n?($1(e),r):e}}return r}function A1(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(S1(this,"default")&&delete this.default,this):P1(e)||!0===E1(this,e,!0)?(this.default=k1(e)?()=>[...e]:x1(e)?()=>Object.assign({},e):e,this):($1(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:o}=n;return P1(o)&&(n.validator=I1(o,n)),n}function R1(e,t){const n=A1(e,t);return Object.defineProperty(n,"validate",{value(e){return P1(this.validator)&&$1(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=I1(e,this),this}})}function D1(e,t,n){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach((n=>{t[n]=Object.getOwnPropertyDescriptor(e,n)})),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!x1(n))return o;const{validator:r}=n,i=f1(n,m1);if(P1(r)){let{validator:e}=o;e&&(e=null!==(a=(l=e).__original)&&void 0!==a?a:l),o.validator=I1(e?function(t){return e.call(this,t)&&r.call(this,t)}:r,o)}var l,a;return Object.assign(o,i)}function j1(e){return e.replace(/^(?!\s*$)/gm," ")}const B1=()=>R1("any",{}),N1=()=>R1("boolean",{type:Boolean}),z1=()=>R1("string",{type:String}),_1=()=>R1("number",{type:Number}),L1=()=>R1("array",{type:Array}),Q1=()=>R1("object",{type:Object});function H1(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return A1(e.name||"<>",{type:null,validator(n){const o=e(n);return o||$1(`${this._vueTypes_name} - ${t}`),o}})}function F1(e){if(!k1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.map((e=>"symbol"==typeof e?e.toString():e)).join('", "')}".`,n={validator(n){const o=-1!==e.indexOf(n);return o||$1(t),o}};if(-1===e.indexOf(null)){const t=e.reduce(((e,t)=>{if(null!=t){const n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e}),[]);t.length>0&&(n.type=t)}return A1("oneOf",n)}function W1(e){if(!k1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=!1,o=[];for(let i=0;io.indexOf(e)===t));const r=!1===n&&o.length>0?o:null;return A1("oneOfType",t?{type:r,validator(t){const n=[],o=e.some((e=>{const o=E1(e,t,!0);return"string"==typeof o&&n.push(o),!0===o}));return o||$1(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${j1(n.join("\n"))}`),o}}:{type:r})}function Z1(e){return A1("arrayOf",{type:Array,validator(t){let n="";const o=t.every((t=>(n=E1(e,t,!0),!0===n)));return o||$1(`arrayOf - value validation error:\n${j1(n)}`),o}})}function V1(e){return A1("instanceOf",{type:e})}function X1(e){return A1("objectOf",{type:Object,validator(t){let n="";const o=Object.keys(t).every((o=>(n=E1(e,t[o],!0),!0===n)));return o||$1(`objectOf - value validation error:\n${j1(n)}`),o}})}function Y1(e){const t=Object.keys(e),n=t.filter((t=>{var n;return!(null===(n=e[t])||void 0===n||!n.required)})),o=A1("shape",{type:Object,validator(o){if(!x1(o))return!1;const r=Object.keys(o);if(n.length>0&&n.some((e=>-1===r.indexOf(e)))){const e=n.filter((e=>-1===r.indexOf(e)));return $1(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return r.every((n=>{if(-1===t.indexOf(n))return!0===this._vueTypes_isLoose||($1(`shape - shape definition does not include a "${n}" property. Allowed keys: "${t.join('", "')}".`),!1);const r=E1(e[n],o[n],!0);return"string"==typeof r&&$1(`shape - "${n}" property validation error:\n ${j1(r)}`),!0===r}))}});return Object.defineProperty(o,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(o,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),o}const K1=["name","validate","getter"],G1=(()=>{var e;return(e=class{static get any(){return B1()}static get func(){return R1("function",{type:Function}).def(this.defaults.func)}static get bool(){return void 0===this.defaults.bool?N1():N1().def(this.defaults.bool)}static get string(){return z1().def(this.defaults.string)}static get number(){return _1().def(this.defaults.number)}static get array(){return L1().def(this.defaults.array)}static get object(){return Q1().def(this.defaults.object)}static get integer(){return A1("integer",{type:Number,validator(e){const t=C1(e);return!1===t&&$1(`integer - "${e}" is not an integer`),t}}).def(this.defaults.integer)}static get symbol(){return A1("symbol",{validator(e){const t="symbol"==typeof e;return!1===t&&$1(`symbol - invalid value "${e}"`),t}})}static get nullable(){return Object.defineProperty({type:null,validator(e){const t=null===e;return!1===t&&$1("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"})}static extend(e){if($1("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),k1(e))return e.forEach((e=>this.extend(e))),this;const{name:t,validate:n=!1,getter:o=!1}=e,r=f1(e,K1);if(S1(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:i}=r;if(M1(i))return delete r.type,Object.defineProperty(this,t,o?{get:()=>D1(t,i,r)}:{value(...e){const n=D1(t,i,r);return n.validator&&(n.validator=n.validator.bind(n,...e)),n}});let l;return l=o?{get(){const e=Object.assign({},r);return n?R1(t,e):A1(t,e)},enumerable:!0}:{value(...e){const o=Object.assign({},r);let i;return i=n?R1(t,o):A1(t,o),o.validator&&(i.validator=o.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,l)}}).defaults={},e.sensibleDefaults=void 0,e.config=g1,e.custom=H1,e.oneOf=F1,e.instanceOf=V1,e.oneOfType=W1,e.arrayOf=Z1,e.objectOf=X1,e.shape=Y1,e.utils={validate:(e,t)=>!0===E1(t,e,!0),toType:(e,t,n=!1)=>n?R1(e,t):A1(e,t)},e})();!function(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){(class extends G1{static get sensibleDefaults(){return h1({},this.defaults)}static set sensibleDefaults(t){this.defaults=!1!==t?h1({},!0!==t?t:e):{}}}).defaults=h1({},e)}();const U1=Ln({__name:"AntdIcon",props:{modelValue:B1(),size:z1(),color:z1()},setup(e){const t=Ln({props:{value:B1(),size:z1(),color:z1()},setup:e=>()=>{const{value:t}=e;return t?Kr(t,{style:{fontSize:e.size,color:e.color}},{}):null}});return(n,o)=>(hr(),br(Ct(t),{value:e.modelValue,size:e.size,color:e.color},null,8,["value","size","color"]))}});var q1=(e=>(e[e.SpEl=1]="SpEl",e[e.Aviator=2]="Aviator",e[e.QL=3]="QL",e))(q1||{}),J1=(e=>(e[e["固定时间"]=2]="固定时间",e[e["CRON表达式"]=3]="CRON表达式",e))(J1||{}),e2=(e=>(e[e["丢弃"]=1]="丢弃",e[e["覆盖"]=2]="覆盖",e[e["并行"]=3]="并行",e))(e2||{}),t2=(e=>(e[e["跳过"]=1]="跳过",e[e["阻塞"]=2]="阻塞",e))(t2||{}),n2=(e=>(e[e["关闭"]=0]="关闭",e[e["开启"]=1]="开启",e))(n2||{}),o2=(e=>(e[e.and=1]="and",e[e.or=2]="or",e))(o2||{}),r2=(e=>(e[e["application/json"]=1]="application/json",e[e["application/x-www-form-urlencoded"]=2]="application/x-www-form-urlencoded",e))(r2||{});const i2={1:{title:"待处理",name:"waiting",color:"#64a6ea",icon:i0},2:{title:"运行中",name:"running",color:"#1b7ee5",icon:yN},3:{title:"成功",name:"success",color:"#087da1",icon:l$},4:{title:"失败",name:"fail",color:"#f52d80",icon:w$},5:{title:"停止",name:"stop",color:"#ac2df5",icon:WJ},6:{title:"取消",name:"cancel",color:"#f5732d",icon:yJ},98:{title:"判定未通过",name:"decision-failed",color:"#b63f1a",icon:cJ},99:{title:"跳过",name:"skip",color:"#00000036",icon:fJ}},l2={1:{name:"Java",color:"#d06892"}},a2={0:{name:"无",color:"#f5f5f5"},1:{name:"执行超时",color:"#64a6ea"},2:{name:"无客户端节点",color:"#1b7ee5"},3:{name:"任务已关闭",color:"#087da1"},4:{name:"任务丢弃",color:"#3a2f81"},5:{name:"任务被覆盖",color:"#c2238a"},6:{name:"无可执行任务项",color:"#23c28a"},7:{name:"任务执行期间发生非预期异常",color:"#bdc223"},8:{name:"手动停止",color:"#23c28a"},9:{name:"条件节点执行异常",color:"#23c28a"},10:{name:"任务中断",color:"#bdc223"},11:{name:"回调节点执行异常",color:"#bdc223"},12:{name:"无需处理",color:"#23c28a"},13:{name:"节点关闭跳过执行",color:"#3a2f81"},14:{name:"判定未通过",color:"#b63f1a"}},s2={2:{name:"运行中",color:"#1b7ee5"},3:{name:"成功",color:"#087da1"},4:{name:"失败",color:"#f52d80"},5:{name:"停止",color:"#ac2df5"},6:{name:"取消",color:"#7e7286"}},c2={DEBUG:{name:"DEBUG",color:"#2647cc"},INFO:{name:"INFO",color:"#5c962c"},WARN:{name:"WARN",color:"#da9816"},ERROR:{name:"ERROR",color:"#dc3f41"}},u2={0:{name:"关闭",color:"#dc3f41"},1:{name:"开启",color:"#1b7ee5"}},d2=(e=>{const t={};return Object.keys(e).forEach((n=>{const o=e[parseInt(n,10)];t[parseInt(n,10)]={name:o.title,color:o.color}})),t})(i2),p2={class:"log"},h2={class:"scroller"},f2={class:"index"},g2={class:"content"},m2={class:"line"},v2={class:"flex"},b2={class:"text",style:{color:"#2db7f5"}},y2={class:"text",style:{color:"#00a3a3"}},O2={class:"text",style:{color:"#a771bf","font-weight":"500"}},w2=(e=>(ln("data-v-b01a1bda"),e=e(),an(),e))((()=>Sr("div",{class:"text"},":",-1))),x2={class:"text",style:{"font-size":"16px"}},$2={class:"text",style:{"font-size":"16px"}},S2=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},C2=S2(Ln({__name:"LogModal",props:{open:N1().def(!1),record:Q1().def({}),modalValue:L1().def([])},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot([]);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modalValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=Ot();Gn((()=>{p()})),Jn((()=>{h()}));const a=()=>{h(),n("update:open",!1)},s=new AbortController,c=Ot(!1);let u=0,d=0;const p=()=>{d1(`/job/log/list?taskBatchId=${o.record.taskBatchId}&jobId=${o.record.jobId}&taskId=${o.record.id}&startId=${u}&fromIndex=${d}&size=50`,"get",void 0,s.signal).then((e=>{c.value=e.finished,u=e.nextStartId,d=e.fromIndex,e.message&&(i.value.push(...e.message),i.value.sort(((e,t)=>e.time_stamp-t.time_stamp))),c.value||(clearTimeout(l.value),l.value=setTimeout(p,1e3))})).catch((()=>{c.value=!0}))},h=()=>{c.value=!0,s.abort(),clearTimeout(l.value),l.value=void 0},f=e=>{const t=new Date(Number.parseInt(e.toString()));return`${t.getFullYear()}-${1===(t.getMonth()+1).toString().length?"0"+(t.getMonth()+1):(t.getMonth()+1).toString()}-${t.getDate()} ${t.getHours()}:${1===t.getMinutes().toString().length?"0"+t.getMinutes():t.getMinutes().toString()}:${1===t.getSeconds().toString().length?"0"+t.getSeconds():t.getSeconds().toString()}.${t.getMilliseconds()}`};return(e,t)=>{const n=fn("a-drawer");return hr(),vr("div",null,[Cr(n,{open:r.value,"onUpdate:open":t[0]||(t[0]=e=>r.value=e),height:"100vh",footer:null,title:"日志详情",placement:"bottom",destroyOnClose:"",bodyStyle:{padding:0},onClose:a},{default:sn((()=>[Sr("div",p2,[Sr("table",h2,[Sr("tbody",null,[(hr(!0),vr(ar,null,io(i.value,((e,t)=>(hr(),vr("tr",{key:t},[Sr("td",f2,X(t+1),1),Sr("td",null,[Sr("div",g2,[Sr("div",m2,[Sr("div",v2,[Sr("div",b2,X(f(e.time_stamp)),1),Sr("div",{class:"text",style:_({color:Ct(c2)[e.level].color})},X(4===e.level.length?e.level+" ":e.level),5),Sr("div",y2,"["+X(e.thread)+"]",1),Sr("div",O2,X(e.location),1),w2]),Sr("div",x2,X(e.message),1),Sr("div",$2,X(e.throwable),1)])])])])))),128))])])])])),_:1},8,["open"])])}}}),[["__scopeId","data-v-b01a1bda"]]),k2={key:0},P2={style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},M2=(e=>(ln("data-v-2a4ad4d5"),e=e(),an(),e))((()=>Sr("span",{style:{"padding-left":"18px"}},"任务项列表",-1))),T2={style:{"padding-left":"6px"}},I2=["onClick"],E2={key:0},A2=S2(Ln({__name:"DetailCard",props:{id:z1(),ids:L1().def([]),open:N1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=fo().slots,i=Od.PRESENTED_IMAGE_SIMPLE,l=u1(),a=Ot(!1),s=Ot(!1),c=Ot(!1),u=Ot(!1),d=Ot(1),p=Ot({}),h=Ot([]),f=Ot({current:1,defaultPageSize:10,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:e=>`共 ${e} 条`});wn((()=>o.open),(e=>{a.value=e}),{immediate:!0});const g=Ot([]);Gn((()=>{o.ids.length>1&&(document.querySelector(".ant-pagination-prev").title="上一个",document.querySelector(".ant-pagination-next").title="下一个"),g.value=o.ids,Zt((()=>{o.ids.length>0?(y(o.ids[0]),O(o.ids[0])):o.id&&(g.value=[p.value.taskBatchId],b(o.id),O(p.value.taskBatchId))}))}));const m=()=>{n("update:open",!1)},b=e=>{c.value=!0,d1(`/job/${e}`).then((e=>{p.value=e,c.value=!1}))},y=e=>{c.value=!0,d1(`/job/batch/${e}`).then((e=>{p.value=e,c.value=!1}))},O=(e,t=1)=>{u.value=!0,d1(`/job/task/list?groupName=${l.GROUP_NAME}&taskBatchId=${e??"0"}&page=${t}`).then((e=>{f.value.total=e.total,h.value=e.data,u.value=!1}))},w=Ot({}),x=e=>{const t=o.ids[e-1];y(t),O(t)},$=Ot([{title:"日志",dataIndex:"log",width:"5%"},{title:"ID",dataIndex:"id",width:"10%"},{title:"组名称",dataIndex:"groupName"},{title:"地址",dataIndex:"clientInfo"},{title:"参数",dataIndex:"argsStr",ellipsis:!0},{title:"结果",dataIndex:"resultMessage",ellipsis:!0},{title:"状态",dataIndex:"taskStatus"},{title:"重试次数",dataIndex:"retryCount"},{title:"开始执行时间",dataIndex:"createDt",sorter:!0,width:"12%"}]);return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-tag"),b=fn("a-descriptions"),y=fn("a-spin"),S=fn("a-button"),C=fn("a-table"),k=fn("a-tab-pane"),P=fn("a-tabs"),M=fn("a-empty"),T=fn("a-pagination"),I=fn("a-drawer");return hr(),vr(ar,null,[Cr(I,{title:"任务批次详情",placement:"right",width:800,open:a.value,"onUpdate:open":n[2]||(n[2]=e=>a.value=e),"destroy-on-close":"",onClose:m},lo({default:sn((()=>[g.value&&g.value.length>0?(hr(),vr("div",k2,[Cr(P,{activeKey:d.value,"onUpdate:activeKey":n[0]||(n[0]=e=>d.value=e),animated:""},{renderTabBar:sn((()=>[])),default:sn((()=>[(hr(!0),vr(ar,null,io(g.value,((e,n)=>(hr(),br(k,{key:n+1,tab:e},{default:sn((()=>[Cr(y,{spinning:c.value},{default:sn((()=>[Cr(b,{bordered:"",column:2},{default:sn((()=>[Cr(o,{label:"组名称"},{default:sn((()=>[Pr(X(p.value.groupName),1)])),_:1}),p.value.jobName?(hr(),br(o,{key:0,label:"任务名称"},{default:sn((()=>[Pr(X(p.value.jobName),1)])),_:1})):Mr("",!0),p.value.nodeName?(hr(),br(o,{key:1,label:"节点名称"},{default:sn((()=>[Pr(X(p.value.nodeName),1)])),_:1})):Mr("",!0),Cr(o,{label:"状态"},{default:sn((()=>[null!=p.value.taskBatchStatus?(hr(),br(l,{key:0,color:Ct(d2)[p.value.taskBatchStatus].color},{default:sn((()=>[Pr(X(Ct(d2)[p.value.taskBatchStatus].name),1)])),_:1},8,["color"])):Mr("",!0),null!=p.value.jobStatus?(hr(),br(l,{key:1,color:Ct(u2)[p.value.jobStatus].color},{default:sn((()=>[Pr(X(Ct(u2)[p.value.jobStatus].name),1)])),_:1},8,["color"])):Mr("",!0)])),_:1}),Ct(r).default?Mr("",!0):(hr(),br(o,{key:2,label:"执行器类型"},{default:sn((()=>[p.value.executorType?(hr(),br(l,{key:0,color:Ct(l2)[p.value.executorType].color},{default:sn((()=>[Pr(X(Ct(l2)[p.value.executorType].name),1)])),_:1},8,["color"])):Mr("",!0)])),_:1})),Cr(o,{label:"操作原因"},{default:sn((()=>[void 0!==p.value.operationReason?(hr(),br(l,{key:0,color:Ct(a2)[p.value.operationReason].color,style:_(0===p.value.operationReason?{color:"#1e1e1e"}:{})},{default:sn((()=>[Pr(X(Ct(a2)[p.value.operationReason].name),1)])),_:1},8,["color","style"])):Mr("",!0)])),_:1}),Ct(r).default?Mr("",!0):(hr(),br(o,{key:3,label:"执行器名称",span:2},{default:sn((()=>[Pr(X(p.value.executorInfo),1)])),_:1})),Cr(o,{label:"开始执行时间"},{default:sn((()=>[Pr(X(p.value.executionAt),1)])),_:1}),Cr(o,{label:"创建时间"},{default:sn((()=>[Pr(X(p.value.createDt),1)])),_:1})])),_:1})])),_:1},8,["spinning"]),ao(t.$slots,"default",{},void 0,!0),Sr("div",P2,[M2,Sr("span",T2,[Cr(S,{type:"text",icon:Kr(Ct(KJ)),onClick:t=>O(e)},null,8,["icon","onClick"])])]),Cr(C,{dataSource:h.value,columns:$.value,loading:u.value,scroll:{x:1200},"row-key":"id",onChange:t=>{return n=e,o=t,f.value=o,void O(n,o.current);var n,o},pagination:f.value},{bodyCell:sn((({column:e,record:t,text:n})=>["log"===e.dataIndex?(hr(),vr("a",{key:0,onClick:e=>{return n=t,w.value=n,void(s.value=!0);var n}},"点击查看",8,I2)):Mr("",!0),"taskStatus"===e.dataIndex?(hr(),vr(ar,{key:1},[n?(hr(),br(l,{key:0,color:Ct(s2)[n].color},{default:sn((()=>[Pr(X(Ct(s2)[n].name),1)])),_:2},1032,["color"])):Mr("",!0)],64)):Mr("",!0),"clientInfo"===e.dataIndex?(hr(),vr(ar,{key:2},[Pr(X(""!==n?n.split("@")[1]:""),1)],64)):Mr("",!0)])),_:2},1032,["dataSource","columns","loading","onChange","pagination"])])),_:2},1032,["tab"])))),128))])),_:3},8,["activeKey"])])):(hr(),br(M,{key:1,class:"empty",image:Ct(i),description:"暂无数据"},null,8,["image"]))])),_:2},[e.ids&&e.ids.length>0?{name:"footer",fn:sn((()=>[Cr(T,{style:{"text-align":"center"},current:d.value,"onUpdate:current":n[1]||(n[1]=e=>d.value=e),total:e.ids.length,pageSize:1,hideOnSinglePage:"",onChange:x},{itemRender:sn((({page:e,type:t,originalElement:n})=>{return["page"===t?(hr(),vr("a",E2,X(e),1)):(hr(),br((o=n,v(o)?mn(hn,o,!1)||o:o||gn),{key:1}))];var o})),_:1},8,["current","total"])])),key:"0"}:void 0]),1032,["open"]),s.value&&w.value?(hr(),br(C2,{key:0,open:s.value,"onUpdate:open":n[3]||(n[3]=e=>s.value=e),record:w.value},null,8,["open","record"])):Mr("",!0)],64)}}}),[["__scopeId","data-v-2a4ad4d5"]]),R2=e=>(ln("data-v-74f467a1"),e=e(),an(),e),D2={class:"add-node-btn-box"},j2={class:"add-node-btn"},B2={class:"add-node-popover-body"},N2={class:"icon"},z2=R2((()=>Sr("p",null,"任务节点",-1))),_2=R2((()=>Sr("p",null,"决策节点",-1))),L2=R2((()=>Sr("p",null,"回调通知",-1))),Q2=S2(Ln({__name:"AddNode",props:{modelValue:Q1(),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e=>{let t={};1===e?t={nodeName:"任务节点",nodeType:1,conditionNodes:[{nodeName:"任务1",failStrategy:1,priorityLevel:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}],childNode:o.modelValue}:2===e?t={nodeName:"决策节点",nodeType:2,conditionNodes:[{nodeName:"条件1",priorityLevel:1,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1,defaultDecision:0}},{nodeName:"其他情况",priorityLevel:2,decision:{expressionType:1,nodeExpression:"#true",logicalCondition:1,defaultDecision:1}}],childNode:o.modelValue}:3===e&&(t={nodeName:"回调通知",nodeType:3,conditionNodes:[{nodeName:"回调通知",workflowNodeStatus:1,callback:{webhook:void 0,contentType:void 0,secret:void 0}}],childNode:o.modelValue}),n("update:modelValue",t)};return(t,n)=>{const o=fn("a-button"),i=fn("a-popover");return hr(),vr("div",D2,[Sr("div",j2,[e.disabled?Mr("",!0):(hr(),br(i,{key:0,placement:"rightTop",trigger:"click","overlay-style":{width:"296px"}},{content:sn((()=>[Sr("div",B2,[Sr("ul",N2,[Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[0]||(n[0]=e=>r(1))},{default:sn((()=>[Cr(Ct(e0),{style:{color:"#3296fa"}})])),_:1}),z2]),Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[1]||(n[1]=e=>r(2))},{default:sn((()=>[Cr(Ct(_J),{style:{color:"#15bc83"}})])),_:1}),_2]),Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[2]||(n[2]=e=>r(3))},{default:sn((()=>[Cr(Ct(yL),{style:{color:"#935af6"}})])),_:1}),L2])])])])),default:sn((()=>[Cr(o,{type:"primary",icon:Kr(Ct(MI)),shape:"circle"},null,8,["icon"])])),_:1}))])])}}}),[["__scopeId","data-v-74f467a1"]]),H2=e=>{const t=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];"number"==typeof o&&t.push({name:n,value:o})}return t},F2=Ln({__name:"TaskDrawer",props:{open:N1().def(!1),len:_1().def(0),modelValue:Q1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=u1(),i=Ot(!1),l=Ot({}),a=Ot([]);Gn((()=>{a.value=r.JOB_LIST})),wn((()=>o.open),(e=>{i.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{l.value=e}),{immediate:!0,deep:!0});const s=()=>{n("update:modelValue",l.value)},c=Ot(),u=()=>{var e;null==(e=c.value)||e.validate().then((()=>{d(),n("save",l.value)})).catch((()=>{xB.warning("请检查表单信息")}))},d=()=>{n("update:open",!1),i.value=!1},p={failStrategy:[{required:!0,message:"请选择失败策略",trigger:"change"}],workflowNodeStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]},h=(e,t)=>{l.value.jobTask.jobName=t.title};return(t,n)=>{const o=fn("a-typography-paragraph"),r=fn("a-select-option"),f=fn("a-select"),g=fn("a-form-item"),m=fn("a-radio"),v=fn("a-radio-group"),b=fn("a-form"),y=fn("a-button"),O=fn("a-drawer");return hr(),br(O,{open:i.value,"onUpdate:open":n[5]||(n[5]=e=>i.value=e),"destroy-on-close":"",width:500,onClose:d},{title:sn((()=>[Cr(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:l.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>l.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:s},null,8,["content"])])),extra:sn((()=>[Cr(f,{value:l.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>l.value.priorityLevel=e),style:{width:"110px"}},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.len,(e=>(hr(),br(r,{key:e,value:e},{default:sn((()=>[Pr("优先级 "+X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:sn((()=>[Cr(y,{type:"primary",onClick:u},{default:sn((()=>[Pr("保存")])),_:1}),Cr(y,{style:{"margin-left":"12px"},onClick:d},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(b,{ref_key:"formRef",ref:c,rules:p,layout:"vertical",model:l.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(g,{name:["jobTask","jobId"],label:"所属任务",placeholder:"请选择任务",rules:[{required:!0,message:"请选择任务",trigger:"change"}]},{default:sn((()=>[Cr(f,{value:l.value.jobTask.jobId,"onUpdate:value":n[2]||(n[2]=e=>l.value.jobTask.jobId=e),onChange:h},{default:sn((()=>[(hr(!0),vr(ar,null,io(a.value,(e=>(hr(),br(r,{key:e.id,value:e.id,title:e.jobName},{default:sn((()=>[Pr(X(e.jobName),1)])),_:2},1032,["value","title"])))),128))])),_:1},8,["value"])])),_:1}),Cr(g,{name:"failStrategy",label:"失败策略"},{default:sn((()=>[Cr(v,{value:l.value.failStrategy,"onUpdate:value":n[3]||(n[3]=e=>l.value.failStrategy=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(t2)),(e=>(hr(),br(m,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(g,{name:"workflowNodeStatus",label:"节点状态"},{default:sn((()=>[Cr(v,{value:l.value.workflowNodeStatus,"onUpdate:value":n[4]||(n[4]=e=>l.value.workflowNodeStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(n2)),(e=>(hr(),br(m,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),W2=Ln({__name:"TaskDetail",props:{modelValue:Q1().def({}),open:N1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=u1(),i=Ot(!1);wn((()=>o.open),(e=>{i.value=e}),{immediate:!0});const l=()=>{n("update:open",!1)},a=e=>{var t;return null==(t=r.JOB_LIST.find((t=>t.id===e)))?void 0:t.jobName};return(t,n)=>{const o=fn("a-descriptions-item"),r=fn("a-descriptions"),s=fn("a-drawer");return hr(),br(s,{title:"任务详情",placement:"right",width:500,open:i.value,"onUpdate:open":n[0]||(n[0]=e=>i.value=e),"destroy-on-close":"",onClose:l},{default:sn((()=>[Cr(r,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"节点名称"},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(o,{label:"任务 ID"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.jobTask)?void 0:t.jobId),1)]})),_:1}),Cr(o,{label:"任务名称"},{default:sn((()=>{var t;return[Pr(X(a(null==(t=e.modelValue.jobTask)?void 0:t.jobId)),1)]})),_:1}),Cr(o,{label:"失败策略"},{default:sn((()=>[Pr(X(Ct(t2)[e.modelValue.failStrategy]),1)])),_:1}),Cr(o,{label:"工作流状态"},{default:sn((()=>[Pr(X(Ct(n2)[e.modelValue.workflowNodeStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),Z2=e=>(ln("data-v-7dad514a"),e=e(),an(),e),V2={class:"node-wrap"},X2={class:"branch-box"},Y2={class:"condition-node"},K2={class:"condition-node-box"},G2=["onClick"],U2=["onClick"],q2={class:"title"},J2={class:"text",style:{color:"#3296fa"}},e3={class:"priority-title"},t3={class:"content",style:{"min-height":"81px"}},n3={key:0,class:"placeholder"},o3=Z2((()=>Sr("span",{class:"content_label"},"任务名称: ",-1))),r3=Z2((()=>Sr("span",{class:"content_label"},"失败策略: ",-1))),i3=Z2((()=>Sr("div",null,".........",-1))),l3=["onClick"],a3={key:1,class:"top-left-cover-line"},s3={key:2,class:"bottom-left-cover-line"},c3={key:3,class:"top-right-cover-line"},u3={key:4,class:"bottom-right-cover-line"},d3=S2(Ln({__name:"TaskNode",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=u1(),i=Ot({});Ot({}),wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{var e;const t=i.value.conditionNodes.length+1;null==(e=i.value.conditionNodes)||e.push({nodeName:"任务"+t,priorityLevel:t,failStrategy:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}),n("update:modelValue",i.value)},a=(e,t)=>{e.childNode?a(e.childNode,t):e.childNode=t},s=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},c=Ot(0),u=Ot(!1),d=Ot({}),p=e=>{const t=i.value.conditionNodes[c.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[c.value]=e,t!==o&&s(c.value,o-t),n("update:modelValue",i.value)},h=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus&&i2[e.taskBatchStatus]?i2[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover",f=Ot(),g=Ot(),m=Ot(!1),v=Ot([]),b=(e,t)=>{var n,l,a,s;g.value=[],2===r.TYPE?(null==(n=e.jobBatchList)||n.sort(((e,t)=>e.taskBatchStatus-t.taskBatchStatus)).forEach((e=>{var t;e.id?null==(t=g.value)||t.push(e.id):e.jobId&&(f.value=e.jobId.toString())})),(null==(l=e.jobTask)?void 0:l.jobId)&&(f.value=null==(a=e.jobTask)?void 0:a.jobId.toString()),m.value=!0):1===r.TYPE?v.value[t]=!0:(s=t,o.disabled||(c.value=s,d.value=JSON.parse(JSON.stringify(i.value.conditionNodes[s])),u.value=!0))};return(t,o)=>{const c=fn("a-button"),y=fn("a-badge"),O=fn("a-typography-text"),w=fn("a-tooltip");return hr(),vr("div",V2,[Sr("div",X2,[e.disabled?Mr("",!0):(hr(),br(c,{key:0,class:"add-branch",primary:"",onClick:l},{default:sn((()=>[Pr("添加任务")])),_:1})),(hr(!0),vr(ar,null,io(i.value.conditionNodes,((o,l)=>{var c,u,d,p;return hr(),vr("div",{class:"col-box",key:l},[Sr("div",Y2,[Sr("div",K2,[Sr("div",{class:W(["auto-judge",h(o)]),style:{cursor:"pointer"},onClick:e=>b(o,l)},[0!=l?(hr(),vr("div",{key:0,class:"sort-left",onClick:Zi((e=>s(l,-1)),["stop"])},[Cr(Ct(BR))],8,U2)):Mr("",!0),Sr("div",q2,[Sr("span",J2,[Cr(y,{status:"processing",color:1===o.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Pr(" "+X(o.nodeName),1)]),Sr("span",e3,"优先级"+X(o.priorityLevel),1),e.disabled?Mr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Zi((e=>(e=>{var t;1===i.value.conditionNodes.length?(i.value.childNode&&(i.value.conditionNodes[0].childNode?a(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Zt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))):null==(t=i.value.conditionNodes)||t.splice(e,1)})(l)),["stop"])},null,8,["onClick"]))]),Sr("div",t3,[(null==(c=o.jobTask)?void 0:c.jobId)?Mr("",!0):(hr(),vr("div",n3,"请选择任务")),(null==(u=o.jobTask)?void 0:u.jobId)?(hr(),vr(ar,{key:1},[Sr("div",null,[o3,Cr(O,{style:{width:"126px"},ellipsis:"",content:`${null==(d=o.jobTask)?void 0:d.jobName}(${null==(p=o.jobTask)?void 0:p.jobId})`},null,8,["content"])]),Sr("div",null,[r3,Pr(X(Ct(t2)[o.failStrategy]),1)]),i3],64)):Mr("",!0)]),l!=i.value.conditionNodes.length-1?(hr(),vr("div",{key:1,class:"sort-right",onClick:Zi((e=>s(l)),["stop"])},[Cr(Ct(ok))],8,l3)):Mr("",!0),2===Ct(r).TYPE&&o.taskBatchStatus?(hr(),br(w,{key:2},{title:sn((()=>[Pr(X(Ct(i2)[o.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(U1),{class:"error-tip",color:Ct(i2)[o.taskBatchStatus].color,size:"24px",onClick:Zi((()=>{}),["stop"]),"model-value":Ct(i2)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Mr("",!0)],10,G2),Cr(Q2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?ao(t.$slots,"default",{key:0,node:o},void 0,!0):Mr("",!0),0==l?(hr(),vr("div",a3)):Mr("",!0),0==l?(hr(),vr("div",s3)):Mr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",c3)):Mr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",u3)):Mr("",!0),0!==Ct(r).type&&v.value[l]?(hr(),br(W2,{key:5,open:v.value[l],"onUpdate:open":e=>v.value[l]=e,modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):Mr("",!0)])})),128))]),i.value.conditionNodes.length>1?(hr(),br(Q2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):Mr("",!0),0===Ct(r).TYPE&&u.value?(hr(),br(F2,{key:1,open:u.value,"onUpdate:open":o[1]||(o[1]=e=>u.value=e),modelValue:d.value,"onUpdate:modelValue":o[2]||(o[2]=e=>d.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:p},null,8,["open","modelValue","len"])):Mr("",!0),0!==Ct(r).TYPE&&m.value?(hr(),br(Ct(A2),{key:2,open:m.value,"onUpdate:open":o[4]||(o[4]=e=>m.value=e),id:f.value,ids:g.value},null,8,["open","id","ids"])):Mr("",!0)])}}}),[["__scopeId","data-v-7dad514a"]]);class p3{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=w3(this,e,t);let o=[];return this.decompose(0,e,o,2),n.length&&n.decompose(0,n.length,o,3),this.decompose(t,this.length,o,1),f3.from(o,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=w3(this,e,t);let n=[];return this.decompose(e,t,n,0),f3.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),o=new v3(this),r=new v3(e);for(let i=t,l=t;;){if(o.next(i),r.next(i),i=0,o.lineBreak!=r.lineBreak||o.done!=r.done||o.value!=r.value)return!1;if(l+=o.value.length,o.done||l>=n)return!0}}iter(e=1){return new v3(this,e)}iterRange(e,t=this.length){return new b3(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let o=this.line(e).from;n=this.iterRange(o,Math.max(o,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new y3(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new h3(e):f3.from(h3.split(e,[])):p3.empty}}class h3 extends p3{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.text[r],l=o+i.length;if((t?n:l)>=e)return new O3(o,l,n,i);o=l+1,n++}}decompose(e,t,n,o){let r=e<=0&&t>=this.length?this:new h3(m3(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&o){let e=n.pop(),t=g3(r.text,e.text.slice(),0,r.length);if(t.length<=32)n.push(new h3(t,e.length+r.length));else{let e=t.length>>1;n.push(new h3(t.slice(0,e)),new h3(t.slice(e)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof h3))return super.replace(e,t,n);[e,t]=w3(this,e,t);let o=g3(this.text,g3(n.text,m3(this.text,0,e)),t),r=this.length+n.length-(t-e);return o.length<=32?new h3(o,r):f3.from(h3.split(o,[]),r)}sliceString(e,t=this.length,n="\n"){[e,t]=w3(this,e,t);let o="";for(let r=0,i=0;r<=t&&ie&&i&&(o+=n),er&&(o+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return o}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],o=-1;for(let r of e)n.push(r),o+=r.length+1,32==n.length&&(t.push(new h3(n,o)),n=[],o=-1);return o>-1&&t.push(new h3(n,o)),t}}class f3 extends p3{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.children[r],l=o+i.length,a=n+i.lines-1;if((t?a:l)>=e)return i.lineInner(e,t,n,o);o=l+1,n=a+1}}decompose(e,t,n,o){for(let r=0,i=0;i<=t&&r=i){let r=o&((i<=e?1:0)|(a>=t?2:0));i>=e&&a<=t&&!r?n.push(l):l.decompose(e-i,t-i,n,r)}i=a+1}}replace(e,t,n){if([e,t]=w3(this,e,t),n.lines=r&&t<=l){let a=i.replace(e-r,t-r,n),s=this.lines-i.lines+a.lines;if(a.lines>4&&a.lines>s>>6){let r=this.children.slice();return r[o]=a,new f3(r,this.length-(t-e)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=w3(this,e,t);let o="";for(let r=0,i=0;re&&r&&(o+=n),ei&&(o+=l.sliceString(e-i,t-i,n)),i=a+1}return o}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof f3))return 0;let n=0,[o,r,i,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=t,r+=t){if(o==i||r==l)return n;let a=this.children[o],s=e.children[r];if(a!=s)return n+a.scanIdentical(s,t);n+=a.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let n=0;for(let p of e)n+=p.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new h3(n,t)}let o=Math.max(32,n>>5),r=o<<1,i=o>>1,l=[],a=0,s=-1,c=[];function u(e){let t;if(e.lines>r&&e instanceof f3)for(let n of e.children)u(n);else e.lines>i&&(a>i||!a)?(d(),l.push(e)):e instanceof h3&&a&&(t=c[c.length-1])instanceof h3&&e.lines+t.lines<=32?(a+=e.lines,s+=e.length+1,c[c.length-1]=new h3(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>o&&d(),a+=e.lines,s+=e.length+1,c.push(e))}function d(){0!=a&&(l.push(1==c.length?c[0]:f3.from(c,s)),s=-1,a=c.length=0)}for(let p of e)u(p);return d(),1==l.length?l[0]:new f3(l,t)}}function g3(e,t,n=0,o=1e9){for(let r=0,i=0,l=!0;i=n&&(s>o&&(a=a.slice(0,o-r)),r0?1:(e instanceof h3?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,o=this.nodes[n],r=this.offsets[n],i=r>>1,l=o instanceof h3?o.text.length:o.children.length;if(i==(t>0?l:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(o instanceof h3){let r=o.text[i+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=o.children[i+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof h3?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class b3{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new v3(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*t,this.value=o.length<=n?o:t<0?o.slice(o.length-n):o.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class y3{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:o}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(p3.prototype[Symbol.iterator]=function(){return this.iter()},v3.prototype[Symbol.iterator]=b3.prototype[Symbol.iterator]=y3.prototype[Symbol.iterator]=function(){return this});class O3{constructor(e,t,n,o){this.from=e,this.to=t,this.number=n,this.text=o}get length(){return this.to-this.from}}function w3(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}let x3="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let Hpe=1;Hpee)return x3[t-1]<=e;return!1}function S3(e){return e>=127462&&e<=127487}function C3(e,t,n=!0,o=!0){return(n?k3:P3)(e,t,o)}function k3(e,t,n){if(t==e.length)return t;t&&M3(e.charCodeAt(t))&&T3(e.charCodeAt(t-1))&&t--;let o=I3(e,t);for(t+=A3(o);t=0&&S3(I3(e,o));)n++,o-=2;if(n%2==0)break;t+=2}}}return t}function P3(e,t,n){for(;t>0;){let o=k3(e,t-2,n);if(o=56320&&e<57344}function T3(e){return e>=55296&&e<56320}function I3(e,t){let n=e.charCodeAt(t);if(!T3(n)||t+1==e.length)return n;let o=e.charCodeAt(t+1);return M3(o)?o-56320+(n-55296<<10)+65536:n}function E3(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function A3(e){return e<65536?1:2}const R3=/\r\n?|\n/;var D3=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(D3||(D3={}));class j3{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-o);r+=l}else{if(n!=D3.Simple&&s>=e&&(n==D3.TrackDel&&oe||n==D3.TrackBefore&&oe))return null;if(s>e||s==e&&t<0&&!l)return e==o||t<0?r:r+a;r+=a}o=s}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return r}touchesRange(e,t=e){for(let n=0,o=0;n=0&&o<=t&&r>=e)return!(ot)||"cover";o=r}return!1}toString(){let e="";for(let t=0;t=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new j3(e)}static create(e){return new j3(e)}}class B3 extends j3{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return _3(this,((t,n,o,r,i)=>e=e.replace(o,o+(n-t),i)),!1),e}mapDesc(e,t=!1){return L3(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let o=0,r=0;o=0){t[o]=l,t[o+1]=i;let a=o>>1;for(;n.length0&&z3(n,t,r.text),r.forward(e),l+=e}let s=e[i++];for(;l>1].toJSON()))}return e}static of(e,t,n){let o=[],r=[],i=0,l=null;function a(e=!1){if(!e&&!o.length)return;il||e<0||l>t)throw new RangeError(`Invalid change range ${e} to ${l} (in doc of length ${t})`);let u=c?"string"==typeof c?p3.of(c.split(n||R3)):c:p3.empty,d=u.length;if(e==l&&0==d)return;ei&&N3(o,e-i,-1),N3(o,l-e,d),z3(r,o,u),i=l}}(e),a(!l),l}static empty(e){return new B3(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let o=0;ot&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;n.length=0&&n<=0&&n==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=n:o?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function z3(e,t,n){if(0==n.length)return;let o=t.length-2>>1;if(o>1])),!(n||l==e.sections.length||e.sections[l+1]<0);)a=e.sections[l++],s=e.sections[l++];t(r,c,i,u,d),r=c,i=u}}}function L3(e,t,n,o=!1){let r=[],i=o?[]:null,l=new H3(e),a=new H3(t);for(let s=-1;;)if(-1==l.ins&&-1==a.ins){let e=Math.min(l.len,a.len);N3(r,e,-1),l.forward(e),a.forward(e)}else if(a.ins>=0&&(l.ins<0||s==l.i||0==l.off&&(a.len=0&&s=0)){if(l.done&&a.done)return i?B3.createSet(r,i):j3.create(r);throw new Error("Mismatched change set lengths")}{let e=0,t=l.len;for(;t;)if(-1==a.ins){let n=Math.min(t,a.len);e+=n,t-=n,a.forward(n)}else{if(!(0==a.ins&&a.lene||l.ins>=0&&l.len>e)&&(a||o.length>t),i.forward2(e),l.forward(e)}}else N3(o,0,l.ins,a),r&&z3(r,o,l.text),l.next()}}class H3{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?p3.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?p3.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class F3{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,o;return this.empty?n=o=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),n==this.from&&o==this.to?this:new F3(n,o,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return W3.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return W3.range(this.anchor,n)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return W3.range(e.anchor,e.head)}static create(e,t,n){return new F3(e,t,n)}}class W3{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:W3.create(this.ranges.map((n=>n.map(e,t))),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new W3(e.ranges.map((e=>F3.fromJSON(e))),e.main)}static single(e,t=e){return new W3([W3.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,o=0;oe?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(n);for(let o=1;on.head?W3.range(l,i):W3.range(i,l))}}return new W3(e,t)}}function Z3(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let V3=0;class X3{constructor(e,t,n,o,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=o,this.id=V3++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new X3(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:Y3),!!e.static,e.enables)}of(e){return new K3([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new K3(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new K3(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(n=>t(n.field(e))))}}function Y3(e,t){return e==t||e.length==t.length&&e.every(((e,n)=>e===t[n]))}class K3{constructor(e,t,n,o){this.dependencies=e,this.facet=t,this.type=n,this.value=o,this.id=V3++}dynamicSlot(e){var t;let n=this.value,o=this.facet.compareInput,r=this.id,i=e[r]>>1,l=2==this.type,a=!1,s=!1,c=[];for(let u of this.dependencies)"doc"==u?a=!0:"selection"==u?s=!0:0==(1&(null!==(t=e[u.id])&&void 0!==t?t:1))&&c.push(e[u.id]);return{create:e=>(e.values[i]=n(e),1),update(e,t){if(a&&t.docChanged||s&&(t.docChanged||t.selection)||U3(e,c)){let t=n(e);if(l?!G3(t,e.values[i],o):!o(t,e.values[i]))return e.values[i]=t,1}return 0},reconfigure:(e,t)=>{let a,s=t.config.address[r];if(null!=s){let r=p4(t,s);if(this.dependencies.every((n=>n instanceof X3?t.facet(n)===e.facet(n):!(n instanceof e4)||t.field(n,!1)==e.field(n,!1)))||(l?G3(a=n(e),r,o):o(a=n(e),r)))return e.values[i]=r,0}else a=n(e);return e.values[i]=a,1}}}}function G3(e,t,n){if(e.length!=t.length)return!1;for(let o=0;oe[t.id])),r=n.map((e=>e.type)),i=o.filter((e=>!(1&e))),l=e[t.id]>>1;function a(e){let n=[];for(let t=0;te===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(J3).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let o=e.values[t],r=this.updateF(o,n);return this.compareF(o,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,J3.of({field:this,create:e})]}get extension(){return this}}const t4=4,n4=3,o4=2,r4=1;function i4(e){return t=>new a4(t,e)}const l4={highest:i4(0),high:i4(r4),default:i4(o4),low:i4(n4),lowest:i4(t4)};class a4{constructor(e,t){this.inner=e,this.prec=t}}class s4{of(e){return new c4(this,e)}reconfigure(e){return s4.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class c4{constructor(e,t){this.compartment=e,this.inner=t}}class u4{constructor(e,t,n,o,r,i){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=o,this.staticValues=r,this.facets=i,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let o=[],r=Object.create(null),i=new Map;for(let d of function(e,t,n){let o=[[],[],[],[],[]],r=new Map;function i(e,l){let a=r.get(e);if(null!=a){if(a<=l)return;let t=o[a].indexOf(e);t>-1&&o[a].splice(t,1),e instanceof c4&&n.delete(e.compartment)}if(r.set(e,l),Array.isArray(e))for(let t of e)i(t,l);else if(e instanceof c4){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");let o=t.get(e.compartment)||e.inner;n.set(e.compartment,o),i(o,l)}else if(e instanceof a4)i(e.inner,e.prec);else if(e instanceof e4)o[l].push(e),e.provides&&i(e.provides,l);else if(e instanceof K3)o[l].push(e),e.facet.extensions&&i(e.facet.extensions,o4);else{let t=e.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(t,l)}}return i(e,o4),o.reduce(((e,t)=>e.concat(t)))}(e,t,i))d instanceof e4?o.push(d):(r[d.facet.id]||(r[d.facet.id]=[])).push(d);let l=Object.create(null),a=[],s=[];for(let d of o)l[d.id]=s.length<<1,s.push((e=>d.slot(e)));let c=null==n?void 0:n.config.facets;for(let d in r){let e=r[d],t=e[0].facet,o=c&&c[d]||[];if(e.every((e=>0==e.type)))if(l[t.id]=a.length<<1|1,Y3(o,e))a.push(n.facet(t));else{let o=t.combine(e.map((e=>e.value)));a.push(n&&t.compare(o,n.facet(t))?n.facet(t):o)}else{for(let t of e)0==t.type?(l[t.id]=a.length<<1|1,a.push(t.value)):(l[t.id]=s.length<<1,s.push((e=>t.dynamicSlot(e))));l[t.id]=s.length<<1,s.push((n=>q3(n,t,e)))}}let u=s.map((e=>e(l)));return new u4(e,i,u,l,a,r)}}function d4(e,t){if(1&t)return 2;let n=t>>1,o=e.status[n];if(4==o)throw new Error("Cyclic dependency between fields and/or facets");if(2&o)return o;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function p4(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const h4=X3.define(),f4=X3.define({combine:e=>e.some((e=>e)),static:!0}),g4=X3.define({combine:e=>e.length?e[0]:void 0,static:!0}),m4=X3.define(),v4=X3.define(),b4=X3.define(),y4=X3.define({combine:e=>!!e.length&&e[0]});class O4{constructor(e,t){this.type=e,this.value=t}static define(){return new w4}}class w4{of(e){return new O4(this,e)}}class x4{constructor(e){this.map=e}of(e){return new $4(this,e)}}class $4{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new $4(this.type,t)}is(e){return this.type==e}static define(e={}){return new x4(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let o of e){let e=o.map(t);e&&n.push(e)}return n}}$4.reconfigure=$4.define(),$4.appendConfig=$4.define();class S4{constructor(e,t,n,o,r,i){this.startState=e,this.changes=t,this.selection=n,this.effects=o,this.annotations=r,this.scrollIntoView=i,this._doc=null,this._state=null,n&&Z3(n,t.newLength),r.some((e=>e.type==S4.time))||(this.annotations=r.concat(S4.time.of(Date.now())))}static create(e,t,n,o,r,i){return new S4(e,t,n,o,r,i)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(S4.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function C4(e,t){let n=[];for(let o=0,r=0;;){let i,l;if(o=e[o]))i=e[o++],l=e[o++];else{if(!(r=0;r--){let i=n[r](e);i&&Object.keys(i).length&&(o=k4(o,P4(t,i,e.changes.newLength),!0))}return o==e?e:S4.create(t,e.changes,e.selection,o.effects,o.annotations,o.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let r of t.facet(m4)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:C4(n,t))}if(!0!==n){let o,r;if(!1===n)r=e.changes.invertedDesc,o=B3.empty(t.doc.length);else{let t=e.changes.filter(n);o=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=S4.create(t,o,e.selection&&e.selection.map(r),$4.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let o=t.facet(v4);for(let r=o.length-1;r>=0;r--){let n=o[r](e);e=n instanceof S4?n:Array.isArray(n)&&1==n.length&&n[0]instanceof S4?n[0]:M4(t,I4(n),!1)}return e}(r):r)}S4.time=O4.define(),S4.userEvent=O4.define(),S4.addToHistory=O4.define(),S4.remote=O4.define();const T4=[];function I4(e){return null==e?T4:Array.isArray(e)?e:[e]}var E4=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(E4||(E4={}));const A4=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let R4;try{R4=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(Qpe){}function D4(e){return t=>{if(!/\S/.test(t))return E4.Space;if(function(e){if(R4)return R4.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||A4.test(n)))return!0}return!1}(t))return E4.Word;for(let n=0;n-1)return E4.Word;return E4.Other}}class j4{constructor(e,t,n,o,r,i){this.config=e,this.doc=t,this.selection=n,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=r,i&&(i._state=this);for(let l=0;lr.set(t,e))),n=null),r.set(l.value.compartment,l.value.extension)):l.is($4.reconfigure)?(n=null,o=l.value):l.is($4.appendConfig)&&(n=null,o=I4(o).concat(l.value));n?t=e.startState.values.slice():(n=u4.resolve(o,r,this),t=new j4(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values);let i=e.startState.facet(f4)?e.newSelection:e.newSelection.asSingle();new j4(n,e.newDoc,i,t,((t,n)=>n.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:W3.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),o=this.changes(n.changes),r=[n.range],i=I4(n.effects);for(let l=1;lt.spec.fromJSON(i,e))))}return j4.create({doc:e.doc,selection:W3.fromJSON(e.selection),extensions:t.extensions?o.concat([t.extensions]):o})}static create(e={}){let t=u4.resolve(e.extensions||[],new Map),n=e.doc instanceof p3?e.doc:p3.of((e.doc||"").split(t.staticFacet(j4.lineSeparator)||R3)),o=e.selection?e.selection instanceof W3?e.selection:W3.single(e.selection.anchor,e.selection.head):W3.single(0);return Z3(o,n.length),t.staticFacet(f4)||(o=o.asSingle()),new j4(t,n,o,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(j4.tabSize)}get lineBreak(){return this.facet(j4.lineSeparator)||"\n"}get readOnly(){return this.facet(y4)}phrase(e,...t){for(let n of this.facet(j4.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,n)=>{if("$"==n)return"$";let o=+(n||1);return!o||o>t.length?e:t[o-1]}))),e}languageDataAt(e,t,n=-1){let o=[];for(let r of this.facet(h4))for(let i of r(this,t,n))Object.prototype.hasOwnProperty.call(i,e)&&o.push(i[e]);return o}charCategorizer(e){return D4(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:o}=this.doc.lineAt(e),r=this.charCategorizer(e),i=e-n,l=e-n;for(;i>0;){let e=C3(t,i,!1);if(r(t.slice(e,i))!=E4.Word)break;i=e}for(;le.length?e[0]:4}),j4.lineSeparator=g4,j4.readOnly=y4,j4.phrases=X3.define({compare(e,t){let n=Object.keys(e),o=Object.keys(t);return n.length==o.length&&n.every((n=>e[n]==t[n]))}}),j4.languageData=h4,j4.changeFilter=m4,j4.transactionFilter=v4,j4.transactionExtender=b4,s4.reconfigure=$4.define();class N4{eq(e){return this==e}range(e,t=e){return z4.create(e,t,this)}}N4.prototype.startSide=N4.prototype.endSide=0,N4.prototype.point=!1,N4.prototype.mapMode=D3.TrackDel;let z4=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,o){return new e(t,n,o)}};function _4(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class L4{constructor(e,t,n,o){this.from=e,this.to=t,this.value=n,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,o=0){let r=n?this.to:this.from;for(let i=o,l=r.length;;){if(i==l)return i;let o=i+l>>1,a=r[o]-e||(n?this.value[o].endSide:this.value[o].startSide)-t;if(o==i)return a>=0?i:l;a>=0?l=o:i=o+1}}between(e,t,n,o){for(let r=this.findIndex(t,-1e9,!0),i=this.findIndex(n,1e9,!1,r);rc||s==c&&u.startSide>0&&u.endSide<=0)continue;(c-s||u.endSide-u.startSide)<0||(i<0&&(i=s),u.point&&(l=Math.max(l,c-s)),n.push(u),o.push(s-i),r.push(c-i))}return{mapped:n.length?new L4(o,r,n,l):null,pos:i}}}class Q4{constructor(e,t,n,o){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=o}static create(e,t,n,o){return new Q4(e,t,n,o)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:o=0,filterTo:r=this.length}=e,i=e.filter;if(0==t.length&&!i)return this;if(n&&(t=t.slice().sort(_4)),this.isEmpty)return t.length?Q4.of(t):this;let l=new W4(this,null,-1).goto(0),a=0,s=[],c=new H4;for(;l.value||a=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||s.push(e)}else 1==l.rangeIndex&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+i.length&&!1===i.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return Z4.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Z4.from(e).goto(t)}static compare(e,t,n,o,r=-1){let i=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),l=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),a=F4(i,l,n),s=new X4(i,a,r),c=new X4(l,a,r);n.iterGaps(((e,t,n)=>Y4(s,e,c,t,n,o))),n.empty&&0==n.length&&Y4(s,0,c,0,0,o)}static eq(e,t,n=0,o){null==o&&(o=999999999);let r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),i=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(r.length!=i.length)return!1;if(!r.length)return!0;let l=F4(r,i),a=new X4(r,l,0).goto(n),s=new X4(i,l,0).goto(n);for(;;){if(a.to!=s.to||!K4(a.active,s.active)||a.point&&(!s.point||!a.point.eq(s.point)))return!1;if(a.to>o)return!0;a.next(),s.next()}}static spans(e,t,n,o,r=-1){let i=new X4(e,null,r).goto(t),l=t,a=i.openStart;for(;;){let e=Math.min(i.to,n);if(i.point){let n=i.activeForPoint(i.to),r=i.pointFroml&&(o.span(l,e,i.active,a),a=i.openEnd(e));if(i.to>n)return a+(i.point&&i.to>n?1:0);l=i.to,i.next()}}static of(e,t=!1){let n=new H4;for(let o of e instanceof z4?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(_4);t=o}return e}(e):e)n.add(o.from,o.to,o.value);return n.finish()}static join(e){if(!e.length)return Q4.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let o=e[n];o!=Q4.empty;o=o.nextLayer)t=new Q4(o.chunkPos,o.chunk,t,Math.max(o.maxPoint,t.maxPoint));return t}}Q4.empty=new Q4([],[],null,-1),Q4.empty.nextLayer=Q4.empty;class H4{finishChunk(e){this.chunks.push(new L4(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new H4)).add(e,t,n)}addInner(e,t,n){let o=e-this.lastTo||n.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(o<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Q4.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=Q4.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function F4(e,t,n){let o=new Map;for(let i of e)for(let e=0;e=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&o.push(new W4(i,t,n,r));return 1==o.length?o[0]:new Z4(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)V4(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)V4(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),V4(this.heap,0)}}}function V4(e,t){for(let n=e[t];;){let o=1+(t<<1);if(o>=e.length)break;let r=e[o];if(o+1=0&&(r=e[o+1],o++),n.compare(r)<0)break;e[o]=n,e[t]=r,t=o}}class X4{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Z4.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){G4(this.active,e),G4(this.activeTo,e),G4(this.activeRank,e),this.minActive=q4(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:o,rank:r}=this.cursor;for(;t0;)t++;U4(this.active,t,n),U4(this.activeTo,t,o),U4(this.activeRank,t,r),e&&U4(e,t,this.cursor.from),this.minActive=q4(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let o=this.minActive;if(o>-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),n&&G4(n,o)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[t]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Y4(e,t,n,o,r,i){e.goto(t),n.goto(o);let l=o+r,a=o,s=o-t;for(;;){let t=e.to+s-n.to||e.endSide-n.endSide,o=t<0?e.to+s:n.to,r=Math.min(o,l);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&K4(e.activeForPoint(e.to),n.activeForPoint(n.to))||i.comparePoint(a,r,e.point,n.point):r>a&&!K4(e.active,n.active)&&i.compareRange(a,r,e.active,n.active),o>l)break;a=o,t<=0&&e.next(),t>=0&&n.next()}}function K4(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;o--)e[o+1]=e[o];e[t]=n}function q4(e,t){let n=-1,o=1e9;for(let r=0;r=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=C3(e,r)}return!0===o?-1:e.length}const t8="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),n8="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),o8="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class r8{constructor(e,t){this.rules=[];let{finish:n}=t||{};function o(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function r(e,t,i,l){let a=[],s=/^@(\w+)\b/.exec(e[0]),c=s&&"keyframes"==s[1];if(s&&null==t)return i.push(e[0]+";");for(let n in t){let l=t[n];if(/&/.test(n))r(n.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),l,i);else if(l&&"object"==typeof l){if(!s)throw new RangeError("The value of a property ("+n+") should be a primitive value.");r(o(n),l,a,c)}else null!=l&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+l+";")}(a.length||c)&&i.push((!n||s||l?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let i in e)r(o(i),e[i],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=o8[t8]||1;return o8[t8]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let o=e[n8],r=n&&n.nonce;o?r&&o.setNonce(r):o=new l8(e,r),o.mount(Array.isArray(t)?t:[t])}}let i8=new Map;class l8{constructor(e,t){let n=e.ownerDocument||e,o=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&o.CSSStyleSheet){let t=i8.get(n);if(t)return e.adoptedStyleSheets=[t.sheet,...e.adoptedStyleSheets],e[n8]=t;this.sheet=new o.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],i8.set(n,this)}else{this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let o=e.head||e;o.insertBefore(this.styleTag,o.firstChild)}this.modules=[],e[n8]=this}mount(e){let t=this.sheet,n=0,o=0;for(let r=0;r-1&&(this.modules.splice(l,1),o--,l=-1),-1==l){if(this.modules.splice(o++,0,i),t)for(let e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},c8="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),u8="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),d8=0;d8<10;d8++)a8[48+d8]=a8[96+d8]=String(d8);for(d8=1;d8<=24;d8++)a8[d8+111]="F"+d8;for(d8=65;d8<=90;d8++)a8[d8]=String.fromCharCode(d8+32),s8[d8]=String.fromCharCode(d8);for(var p8 in a8)s8.hasOwnProperty(p8)||(s8[p8]=a8[p8]);function h8(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function f8(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function g8(e,t){if(!t.anchorNode)return!1;try{return f8(e,t.anchorNode)}catch(Qpe){return!1}}function m8(e){return 3==e.nodeType?M8(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function v8(e,t,n,o){return!!n&&(y8(e,t,n,o,-1)||y8(e,t,n,o,1))}function b8(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function y8(e,t,n,o,r){for(;;){if(e==n&&t==o)return!0;if(t==(r<0?0:O8(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=b8(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?O8(e):0}}}function O8(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function w8(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function x8(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function $8(e,t){let n=t.width/e.offsetWidth,o=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(o>.995&&o<1.005||!isFinite(o)||Math.abs(t.height-e.offsetHeight)<1)&&(o=1),{scaleX:n,scaleY:o}}class S8{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?O8(t):0),n,Math.min(e.focusOffset,n?O8(n):0))}set(e,t,n,o){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=o}}let C8,k8=null;function P8(e){if(e.setActive)return e.setActive();if(k8)return e.focus(k8);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==k8?{get preventScroll(){return k8={preventScroll:!0},!0}}:void 0),!k8){k8=!1;for(let e=0;eMath.max(1,e.scrollHeight-e.clientHeight-4)}class A8{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new A8(e.parentNode,b8(e),t)}static after(e,t){return new A8(e.parentNode,b8(e)+1,t)}}const R8=[];class D8{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let n,o=this.dom,r=null;for(let i of this.children){if(7&i.flags){if(!i.dom&&(n=r?r.nextSibling:o.firstChild)){let e=D8.get(n);(!e||!e.parent&&e.canReuseDOM(i))&&i.reuseDOM(n)}i.sync(e,t),i.flags&=-8}if(n=r?r.nextSibling:o.firstChild,t&&!t.written&&t.node==o&&n!=i.dom&&(t.written=!0),i.dom.parentNode==o)for(;n&&n!=i.dom;)n=j8(n);else o.insertBefore(i.dom,n);r=i.dom}for(n=r?r.nextSibling:o.firstChild,n&&t&&t.node==o&&(t.written=!0);n;)n=j8(n)}else if(1&this.flags)for(let n of this.children)7&n.flags&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let o=0==O8(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==o&&t.firstChild!=t.lastChild&&(o=e==t.firstChild?-1:1),e=t}n=o<0?e:e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!D8.get(n);)n=n.nextSibling;if(!n)return this.length;for(let o=0,r=0;;o++){let e=this.children[o];if(e.dom==n)return r;r+=e.length+e.breakAfter}}domBoundsAround(e,t,n=0){let o=-1,r=-1,i=-1,l=-1;for(let a=0,s=n,c=n;at)return n.domBoundsAround(e,t,s);if(u>=e&&-1==o&&(o=a,r=s),s>t&&n.dom.parentNode==this.dom){i=a,l=c;break}c=u,s=u+n.breakAfter}return{from:r,to:l<0?n+this.length:l,startDOM:(o?this.children[o-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:i=0?this.children[i].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=R8){this.markDirty();for(let o=e;othis.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function N8(e,t,n,o,r,i,l,a,s){let{children:c}=e,u=c.length?c[t]:null,d=i.length?i[i.length-1]:null,p=d?d.breakAfter:l;if(!(t==o&&u&&!l&&!p&&i.length<2&&u.merge(n,r,i.length?d:null,0==n,a,s))){if(o0&&(!l&&i.length&&u.merge(n,u.length,i[0],!1,a,0)?u.breakAfter=i.shift().breakAfter:(n2);var G8={mac:K8||/Mac/.test(_8.platform),windows:/Win/.test(_8.platform),linux:/Linux|X11/.test(_8.platform),ie:W8,ie_version:H8?L8.documentMode||6:F8?+F8[1]:Q8?+Q8[1]:0,gecko:Z8,gecko_version:Z8?+(/Firefox\/(\d+)/.exec(_8.userAgent)||[0,0])[1]:0,chrome:!!V8,chrome_version:V8?+V8[1]:0,ios:K8,android:/Android\b/.test(_8.userAgent),webkit:X8,safari:Y8,webkit_version:X8?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=L8.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class U8 extends D8{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return!(8&this.flags||n&&(!(n instanceof U8)||this.length-(t-e)+n.length>256||8&n.flags)||(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),0))}split(e){let t=new U8(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new A8(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,n){let o=e.nodeValue.length;t>o&&(t=o);let r=t,i=t,l=0;0==t&&n<0||t==o&&n>=0?G8.chrome||G8.gecko||(t?(r--,l=1):i=0)?0:a.length-1];return G8.safari&&!l&&0==s.width&&(s=Array.prototype.find.call(a,(e=>e.width))||s),l?w8(s,l<0):s||null}(this.dom,e,t)}}class q8 extends D8{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let o of t)o.setParent(this)}setAttrs(e){if(I8(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof q8&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(o=r),n=i,r++}let i=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new q8(this.mark,t,i)}domAtPos(e){return t5(this,e)}coordsAt(e,t){return o5(this,e,t)}}class J8 extends D8{static create(e,t,n){return new J8(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=J8.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof J8&&this.widget.compare(n.widget))||e>0&&r<=0||t0)?A8.before(this.dom):A8.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let o=this.dom.getClientRects(),r=null;if(!o.length)return null;let i=this.side?this.side<0:e>0;for(let l=i?o.length-1:0;r=o[l],!(e>0?0==l:l==o.length-1||r.top0?A8.before(this.dom):A8.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return p3.empty}get isHidden(){return!0}}function t5(e,t){let n=e.dom,{children:o}=e,r=0;for(let i=0;ri&&t0;i--){let e=o[i-1];if(e.dom.parentNode==n)return e.domAtPos(e.length)}for(let i=r;i0&&t instanceof q8&&r.length&&(o=r[r.length-1])instanceof q8&&o.mark.eq(t.mark)?n5(o,t.children[0],n-1):(r.push(t),t.setParent(e)),e.length+=t.length}function o5(e,t,n){let o=null,r=-1,i=null,l=-1;!function e(t,a){for(let s=0,c=0;s=a&&(u.children.length?e(u,a-c):(!i||i.isHidden&&n>0)&&(d>a||c==d&&u.getSide()>0)?(i=u,l=a-c):(c-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let i of o)if(i!=n&&(-1==r.indexOf(i)||e[i]!==t[i]))return!1;return!0}function a5(e,t,n){let o=!1;if(t)for(let r in t)n&&r in n||(o=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(o=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return o}function s5(e){let t=Object.create(null);for(let n=0;n0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){l5(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){n5(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=r5(t,this.attrs||{})),n&&(this.attrs=r5({class:n},this.attrs||{}))}domAtPos(e){return t5(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?4&this.flags&&(I8(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(a5(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let o=this.dom.lastChild;for(;o&&D8.get(o)instanceof q8;)o=o.lastChild;if(!(o&&this.length&&("BR"==o.nodeName||0!=(null===(n=D8.get(o))||void 0===n?void 0:n.isEditable)||G8.ios&&this.children.some((e=>e instanceof U8))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e,t=0;for(let n of this.children){if(!(n instanceof U8)||/[^ -~]/.test(n.text))return null;let o=m8(n.dom);if(1!=o.length)return null;t+=o[0].width,e=o[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(e,t){let n=o5(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=n.bottom-n.top;if(Math.abs(t-e.lineHeight)<2&&e.textHeight=t){if(r instanceof c5)return r;if(i>t)break}o=i+r.breakAfter}return null}}class u5 extends D8{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof u5&&this.widget.compare(n.widget))||e>0&&r<=0||t0)}}class d5{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var p5=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(p5||(p5={}));class h5 extends N4{constructor(e,t,n,o){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=o}get heightRelevant(){return!1}static mark(e){return new f5(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new m5(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,o=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:r,end:i}=v5(e,o);t=(r?o?-3e8:-1:5e8)-1,n=1+(i?o?2e8:1:-6e8)}return new m5(e,t,n,o,e.widget||null,!0)}static line(e){return new g5(e)}static set(e,t=!1){return Q4.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}h5.none=Q4.empty;class f5 extends h5{constructor(e){let{start:t,end:n}=v5(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof f5&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(n=e.attrs)||void 0===n?void 0:n.class))&&l5(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}f5.prototype.point=!1;class g5 extends h5{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof g5&&this.spec.class==e.spec.class&&l5(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}g5.prototype.mapMode=D3.TrackBefore,g5.prototype.point=!0;class m5 extends h5{constructor(e,t,n,o,r,i){super(t,n,r,e),this.block=o,this.isReplace=i,this.mapMode=o?t<=0?D3.TrackBefore:D3.TrackAfter:D3.TrackDel}get type(){return this.startSide!=this.endSide?p5.WidgetRange:this.startSide<=0?p5.WidgetBefore:p5.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof m5&&(t=this.widget,n=e.widget,t==n||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,n}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function v5(e,t=!1){let{inclusiveStart:n,inclusiveEnd:o}=e;return null==n&&(n=e.inclusive),null==o&&(o=e.inclusive),{start:null!=n?n:t,end:null!=o?o:t}}function b5(e,t,n,o=0){let r=n.length-1;r>=0&&n[r]+o>=e?n[r]=Math.max(n[r],t):n.push(e,t)}m5.prototype.point=!0;class y5{constructor(e,t,n,o){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=o,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof u5&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new c5),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(O5(new e5(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof u5||this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:o}=this.cursor.next(this.skip);if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=t,this.textOff=0}let o=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(O5(new U8(this.text.slice(this.textOff,this.textOff+o)),t),n),this.atCursorPos=!0,this.textOff+=o,e-=o,n=0}}span(e,t,n,o){this.buildText(t-e,n,o),this.pos=t,this.openStart<0&&(this.openStart=o)}point(e,t,n,o,r,i){if(this.disallowBlockEffectsFor[i]&&n instanceof m5){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(n instanceof m5)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new u5(n.widget||new w5("div"),l,n));else{let i=J8.create(n.widget||new w5("span"),l,l?0:n.startSide),a=this.atCursorPos&&!i.isEditable&&r<=o.length&&(e0),s=!i.isEditable&&(eo.length||n.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||i.isEditable||(this.pendingBuffer=0),this.flushBuffer(o),a&&(c.append(O5(new e5(1),o),r),r=o.length+Math.max(0,r-o.length)),c.append(O5(i,o),r),this.atCursorPos=s,this.pendingBuffer=s?eo.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=o.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,o,r){let i=new y5(e,t,n,r);return i.openEnd=Q4.spans(o,t,n,i),i.openStart<0&&(i.openStart=i.openEnd),i.finish(i.openEnd),i}}function O5(e,t){for(let n of t)e=new q8(n,[e],e.length);return e}class w5 extends d5{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}var x5=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(x5||(x5={}));const $5=x5.LTR,S5=x5.RTL;function C5(e){let t=[];for(let n=0;n=t){if(l.level==n)return i;(r<0||(0!=o?o<0?l.fromt:e[r].level>l.level))&&(r=i)}}if(r<0)throw new RangeError("Index out of range");return r}}function R5(e,t){if(e.length!=t.length)return!1;for(let n=0;ns&&l.push(new A5(s,f.from,p)),B5(e,f.direction==$5!=!(p%2)?o+1:o,r,f.inner,f.from,f.to,l),s=f.to),h=f.to}else{if(h==n||(t?D5[h]!=a:D5[h]==a))break;h++}d?j5(e,s,h,o+1,r,d,l):st;){let n=!0,u=!1;if(!c||s>i[c-1].to){let e=D5[s-1];e!=a&&(n=!1,u=16==e)}let d=n||1!=a?null:[],p=n?o:o+1,h=s;e:for(;;)if(c&&h==i[c-1].to){if(u)break e;let f=i[--c];if(!n)for(let e=f.from,n=c;;){if(e==t)break e;if(!n||i[n-1].to!=e){if(D5[e-1]==a)break e;break}e=i[--n].from}d?d.push(f):(f.to=0;e-=3)if(T5[e+1]==-n){let t=T5[e+2],n=2&t?r:4&t?1&t?i:r:0;n&&(D5[l]=D5[T5[e]]=n),a=e;break}}else{if(189==T5.length)break;T5[a++]=l,T5[a++]=t,T5[a++]=s}else if(2==(o=D5[l])||1==o){let e=o==r;s=e?0:1;for(let t=a-3;t>=0;t-=3){let n=T5[t+2];if(2&n)break;if(e)T5[t+2]|=2;else{if(4&n)break;T5[t+2]|=4}}}}}(e,r,i,o,a),function(e,t,n,o){for(let r=0,i=o;r<=n.length;r++){let l=r?n[r-1].to:e,a=rs;)t==i&&(t=n[--o].from,i=o?n[o-1].to:e),D5[--t]=u;s=l}else i=l,s++}}}(r,i,o,a),j5(e,r,i,t,n,o,l)}function N5(e){return[new A5(0,e,0)]}let z5="";function _5(e,t,n,o,r){var i;let l=o.head-e.from,a=A5.find(t,l,null!==(i=o.bidiLevel)&&void 0!==i?i:-1,o.assoc),s=t[a],c=s.side(r,n);if(l==c){let e=a+=r?1:-1;if(e<0||e>=t.length)return null;s=t[a=e],l=s.side(!r,n),c=s.side(r,n)}let u=C3(e.text,l,s.forward(r,n));(us.to)&&(u=c),z5=e.text.slice(Math.min(l,u),Math.max(l,u));let d=a==(r?t.length-1:0)?null:t[a+(r?1:-1)];return d&&u==c&&d.level+(r?0:1)e.some((e=>e))}),K5=X3.define({combine:e=>e.some((e=>e))});class G5{constructor(e,t="nearest",n="nearest",o=5,r=5,i=!1){this.range=e,this.y=t,this.x=n,this.yMargin=o,this.xMargin=r,this.isSnapshot=i}map(e){return e.empty?this:new G5(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new G5(W3.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const U5=$4.define({map:(e,t)=>e.map(t)});function q5(e,t,n){let o=e.facet(W5);o.length?o[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)}const J5=X3.define({combine:e=>!e.length||e[0]});let e6=0;const t6=X3.define();class n6{constructor(e,t,n,o,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=o,this.extension=r(this)}static define(e,t){const{eventHandlers:n,eventObservers:o,provide:r,decorations:i}=t||{};return new n6(e6++,e,n,o,(e=>{let t=[t6.of(e)];return i&&t.push(l6.of((t=>{let n=t.plugin(e);return n?i(n):h5.none}))),r&&t.push(r(e)),t}))}static fromClass(e,t){return n6.define((t=>new e(t)),t)}}class o6{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(Lpe){if(q5(e.state,Lpe,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(Qpe){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(Lpe){q5(e.state,Lpe,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(Lpe){q5(e.state,Lpe,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const r6=X3.define(),i6=X3.define(),l6=X3.define(),a6=X3.define(),s6=X3.define(),c6=X3.define();function u6(e,t){let n=e.state.facet(c6);if(!n.length)return n;let o=n.map((t=>t instanceof Function?t(e):t)),r=[];return Q4.spans(o,t.from,t.to,{point(){},span(e,n,o,i){let l=e-t.from,a=n-t.from,s=r;for(let r=o.length-1;r>=0;r--,i--){let e,n=o[r].spec.bidiIsolate;if(null==n&&(n=L5(t.text,l,a)),i>0&&s.length&&(e=s[s.length-1]).to==l&&e.direction==n)e.to=a,s=e.inner;else{let e={from:l,to:a,direction:n,inner:[]};s.push(e),s=e.inner}}}}),r}const d6=X3.define();function p6(e){let t=0,n=0,o=0,r=0;for(let i of e.state.facet(d6)){let l=i(e);l&&(null!=l.left&&(t=Math.max(t,l.left)),null!=l.right&&(n=Math.max(n,l.right)),null!=l.top&&(o=Math.max(o,l.top)),null!=l.bottom&&(r=Math.max(r,l.bottom)))}return{left:t,right:n,top:o,bottom:r}}const h6=X3.define();class f6{constructor(e,t,n,o){this.fromA=e,this.toA=t,this.fromB=n,this.toB=o}join(e){return new f6(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let o=e[t-1];if(!(o.fromA>n.toA)){if(o.toAc)break;r+=2}if(!a)return n;new f6(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),i=a.toA,l=a.toB}}}class g6{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=B3.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let o=[];this.changes.iterChangedRanges(((e,t,n,r)=>o.push(new f6(e,t,n,r)))),this.changedRanges=o}static create(e,t,n){return new g6(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class m6 extends D8{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new c5],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new f6(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every((({fromA:e,toA:t})=>tthis.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let o=-1;this.view.inputState.composing>=0&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?o=this.domChanged.newSel.head:function(e,t){let n=!1;return t&&e.iterChangedRanges(((e,o)=>{et.from&&(n=!0)})),n}(e.changes,this.hasComposition)||e.selectionSet||(o=e.state.selection.main.head));let r=o>-1?function(e,t,n){let o=b6(e,n);if(!o)return null;let{node:r,from:i,to:l}=o,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(o.from,o.to)!=a)return null;let s=t.invertedDesc,c=new f6(s.mapPos(i),s.mapPos(l),i,l),u=[];for(let d=r.parentNode;;d=d.parentNode){let t=D8.get(d);if(t instanceof q8)u.push({node:d,deco:t.mark});else{if(t instanceof c5||"DIV"==d.nodeName&&d.parentNode==e.contentDOM)return{range:c,text:r,marks:u,line:d};if(d==e.contentDOM)return null;u.push({node:d,deco:new f5({inclusive:!0,attributes:s5(d),tagName:d.tagName.toLowerCase()})})}}}(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:o}=this.hasComposition;n=new f6(t,o,e.changes.mapPos(t,-1),e.changes.mapPos(o,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(G8.ie||G8.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=function(e,t,n){let o=new O6;return Q4.compare(e,t,n,o),o.changes}(this.decorations,this.updateDeco(),e.changes);return n=f6.extendWithRanges(n,i),!!(7&this.flags||0!=n.length)&&(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:o}=this.view;o.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=G8.chrome||G8.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||o.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((e=>e.flags&=-9));let r=[];if(this.view.viewport.from||this.view.viewport.to=0?o[i]:null;if(!e)break;let t,l,a,s,{fromA:c,toA:u,fromB:d,toB:p}=e;if(n&&n.range.fromBd){let e=y5.build(this.view.state.doc,d,n.range.fromB,this.decorations,this.dynamicDecorationMap),o=y5.build(this.view.state.doc,n.range.toB,p,this.decorations,this.dynamicDecorationMap);l=e.breakAtStart,a=e.openStart,s=o.openEnd;let r=this.compositionView(n);o.breakAtStart?r.breakAfter=1:o.content.length&&r.merge(r.length,r.length,o.content[0],!1,o.openStart,0)&&(r.breakAfter=o.content[0].breakAfter,o.content.shift()),e.content.length&&r.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),t=e.content.concat(r).concat(o.content)}else({content:t,breakAtStart:l,openStart:a,openEnd:s}=y5.build(this.view.state.doc,d,p,this.decorations,this.dynamicDecorationMap));let{i:h,off:f}=r.findPos(u,1),{i:g,off:m}=r.findPos(c,-1);N8(this,g,m,h,f,t,l,a,s)}n&&this.fixCompositionDOM(n)}compositionView(e){let t=new U8(e.text.nodeValue);t.flags|=8;for(let{deco:o}of e.marks)t=new q8(o,[t],t.length);let n=new c5;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|(t.children.some((e=>7&e.flags))?1:0),this.markedForComposition.add(t);let n=D8.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),o=this.children[n.i];t(e.line,o);for(let r=e.marks.length-1;r>=-1;r--)n=o.childPos(n.off,1),o=o.children[n.i],t(r>=0?e.marks[r].node:e.text,o)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let n=this.view.root.activeElement,o=n==this.dom,r=!o&&g8(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(o||t||r))return;let i=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),s=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(G8.gecko&&l.empty&&!this.hasComposition&&1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null))),a=s=new A8(e,0),i=!0}var c;let u=this.view.observer.selectionRange;!i&&u.focusNode&&(v8(a.node,a.offset,u.anchorNode,u.anchorOffset)&&v8(s.node,s.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,l))||(this.view.observer.ignore((()=>{G8.android&&G8.chrome&&this.dom.contains(u.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=h8(this.view.root);if(e)if(l.empty){if(G8.gecko){let e=(t=a.node,o=a.offset,1!=t.nodeType?0:(o&&"false"==t.childNodes[o-1].contentEditable?1:0)|(ol.head&&([a,s]=[s,a]),t.setEnd(s.node,s.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}var t,o;r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())})),this.view.observer.setSelectionRange(a,s)),this.impreciseAnchor=a.precise?null:new A8(u.anchorNode,u.anchorOffset),this.impreciseHead=s.precise?null:new A8(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&v8(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=h8(e.root),{anchorNode:o,anchorOffset:r}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let i=c5.find(this,t.head);if(!i)return;let l=i.posAtStart;if(t.head==l||t.head==l+i.length)return;let a=this.coordsAt(t.head,-1),s=this.coordsAt(t.head,1);if(!a||!s||a.bottom>s.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(o,r)}moveToLine(e){let t,n=this.dom;if(e.node!=n)return e;for(let o=e.offset;!t&&o=0;o--){let e=D8.get(n.childNodes[o]);e instanceof c5&&(t=e.domAtPos(e.length))}return t?new A8(t.node,t.offset,!0):e}nearest(e){for(let t=e;t;){let e=D8.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;i--){let l=this.children[i],a=r-l.breakAfter,s=a-l.length;if(ae||l.covers(1))&&(!n||l instanceof c5&&!(n instanceof c5&&t>=0))&&(n=l,o=s),r=s}return n?n.coordsAt(e-o,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),o=this.children[t];if(!(o instanceof c5))return null;for(;o.children.length;){let{i:e,off:t}=o.childPos(n,1);for(;;e++){if(e==o.children.length)return null;if((o=o.children[e]).length)break}n=t}if(!(o instanceof U8))return null;let r=C3(o.text,n);if(r==n)return null;let i=M8(o.dom,n,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==x5.LTR;for(let s=0,c=0;co)break;if(s>=n){let n=e.dom.getBoundingClientRect();if(t.push(n.height),i){let t=e.dom.lastChild,o=t?m8(t):[];if(o.length){let e=o[o.length-1],t=a?e.right-n.left:n.right-e.left;t>l&&(l=t,this.minWidth=r,this.minWidthFrom=s,this.minWidthTo=u)}}}s=u+e.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?x5.RTL:x5.LTR}measureTextSize(){for(let r of this.children)if(r instanceof c5){let e=r.measureTextSize();if(e)return e}let e,t,n,o=document.createElement("div");return o.className="cm-line",o.style.width="99999px",o.style.position="absolute",o.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(o);let r=m8(o.firstChild)[0];e=o.getBoundingClientRect().height,t=r?r.width/27:7,n=r?r.height:e,o.remove()})),{lineHeight:e,charWidth:t,textHeight:n}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new B8(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,o=0;;o++){let r=o==t.viewports.length?null:t.viewports[o],i=r?r.from-1:this.length;if(i>n){let o=(t.lineBlockAt(i).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(h5.replace({widget:new v6(o),block:!0,inclusive:!0,isBlockGap:!0}).range(n,i))}if(!r)break;n=r.to+1}return h5.set(e)}updateDeco(){let e=this.view.state.facet(l6).map(((e,t)=>(this.dynamicDecorationMap[t]="function"==typeof e)?e(this.view):e)),t=!1,n=this.view.state.facet(a6).map(((e,n)=>{let o="function"==typeof e;return o&&(t=!0),o?e(this.view):e}));n.length&&(this.dynamicDecorationMap[e.length]=t,e.push(Q4.join(n)));for(let o=e.length;on.anchor?-1:1);if(!o)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(o={left:Math.min(o.left,t.left),top:Math.min(o.top,t.top),right:Math.max(o.right,t.right),bottom:Math.max(o.bottom,t.bottom)});let r=p6(this.view),i={left:o.left-r.left,top:o.top-r.top,right:o.right+r.right,bottom:o.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;!function(e,t,n,o,r,i,l,a){let s=e.ownerDocument,c=s.defaultView||window;for(let u=e,d=!1;u&&!d;)if(1==u.nodeType){let e,p=u==s.body,h=1,f=1;if(p)e=x8(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:h,scaleY:f}=$8(u,t)),e={left:t.left,right:t.left+u.clientWidth*h,top:t.top,bottom:t.top+u.clientHeight*f}}let g=0,m=0;if("nearest"==r)t.top0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+m+l)):t.bottom>e.bottom&&(m=t.bottom-e.bottom+l,n<0&&t.top-m0&&t.right>e.right+g&&(g=t.right-e.right+g+i)):t.right>e.right&&(g=t.right-e.right+i,n<0&&t.left0))break;o=o.childNodes[r-1],r=O8(o)}if(n>=0)for(let o=e,r=t;;){if(3==o.nodeType)return{node:o,offset:r};if(!(1==o.nodeType&&r=0))break;o=o.childNodes[r],r=0}return null}let O6=class{constructor(){this.changes=[]}compareRange(e,t){b5(e,t,this.changes)}comparePoint(e,t){b5(e,t,this.changes)}};function w6(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function x6(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function $6(e,t){return e.topt.top+1}function S6(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function k6(e,t,n){let o,r,i,l,a,s,c,u,d=!1;for(let h=e.firstChild;h;h=h.nextSibling){let e=m8(h);for(let p=0;pm||l==m&&i>g){o=h,r=f,i=g,l=m;let a=m?n0?p0)}0==g?n>f.bottom&&(!c||c.bottomf.top)&&(s=h,u=f):c&&$6(c,f)?c=C6(c,f.bottom):u&&$6(u,f)&&(u=S6(u,f.top))}}if(c&&c.bottom>=n?(o=a,r=c):u&&u.top<=n&&(o=s,r=u),!o)return{node:e,offset:0};let p=Math.max(r.left,Math.min(r.right,t));return 3==o.nodeType?P6(o,p,n):d&&"false"!=o.contentEditable?k6(o,p,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,o)+(t>=(r.left+r.right)/2?1:0)}}function P6(e,t,n){let o=e.nodeValue.length,r=-1,i=1e9,l=0;for(let a=0;an?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&u=(c.left+c.right)/2,o=n;if((G8.chrome||G8.gecko)&&M8(e,a).getBoundingClientRect().left==c.right&&(o=!n),u<=0)return{node:e,offset:a+(o?1:0)};r=a+(o?1:0),i=u}}}return{node:e,offset:r>-1?r:l>0?e.nodeValue.length:0}}function M6(e,t,n,o=-1){var r,i;let l,a=e.contentDOM.getBoundingClientRect(),s=a.top+e.viewState.paddingTop,{docHeight:c}=e.viewState,{x:u,y:d}=t,p=d-s;if(p<0)return 0;if(p>c)return e.state.doc.length;for(let O=e.viewState.heightOracle.textHeight/2,w=!1;l=e.elementAtHeight(p),l.type!=p5.Text;)for(;p=o>0?l.bottom+O:l.top-O,!(p>=0&&p<=c);){if(w)return n?null:0;w=!0,o=-o}d=s+p;let h=l.from;if(he.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:T6(e,a,l,u,d);let f=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:f,m=g.elementFromPoint(u,d);m&&!e.contentDOM.contains(m)&&(m=null),m||(u=Math.max(a.left+1,Math.min(a.right-1,u)),m=g.elementFromPoint(u,d),m&&!e.contentDOM.contains(m)&&(m=null));let v,b=-1;if(m&&0!=(null===(r=e.docView.nearest(m))||void 0===r?void 0:r.isEditable))if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(u,d);e&&({offsetNode:v,offset:b}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(u,d);t&&(({startContainer:v,startOffset:b}=t),(!e.contentDOM.contains(v)||G8.safari&&function(e,t,n){let o;if(3!=e.nodeType||t!=(o=e.nodeValue.length))return!1;for(let r=e.nextSibling;r;r=r.nextSibling)if(1!=r.nodeType||"BR"!=r.nodeName)return!1;return M8(e,o-1,o).getBoundingClientRect().left>n}(v,b,u)||G8.chrome&&function(e,t,n){if(0!=t)return!1;for(let r=e;;){let e=r.parentNode;if(!e||1!=e.nodeType||e.firstChild!=r)return!1;if(e.classList.contains("cm-line"))break;r=e}let o=1==e.nodeType?e.getBoundingClientRect():M8(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect();return n-o.left>5}(v,b,u))&&(v=void 0))}if(!v||!e.docView.dom.contains(v)){let t=c5.find(e.docView,h);if(!t)return p>l.top+l.height/2?l.to:l.from;({node:v,offset:b}=k6(t.dom,u,d))}let y=e.docView.nearest(v);if(!y)return null;if(y.isWidget&&1==(null===(i=y.dom)||void 0===i?void 0:i.nodeType)){let e=y.dom.getBoundingClientRect();return t.y1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;i+=Math.floor((r-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let l=e.state.sliceDoc(n.from,n.to);return n.from+e8(l,i,e.state.tabSize)}function I6(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type))for(let o of n.type)if(o.to>t||o.to==t&&(o.to==n.to||o.type==p5.Text))return o;return n}function E6(e,t,n,o){let r=e.state.doc.lineAt(t.head),i=e.bidiSpans(r),l=e.textDirectionAt(r.from);for(let a=t,s=null;;){let t=_5(r,i,l,a,n),c=z5;if(!t){if(r.number==(n?e.state.doc.lines:1))return a;c="\n",r=e.state.doc.line(r.number+(n?1:-1)),i=e.bidiSpans(r),t=e.visualLineSide(r,!n)}if(s){if(!s(c))return a}else{if(!o)return t;s=o(c)}a=t}}function A6(e,t,n){for(;;){let o=0;for(let r of e)r.between(t-1,t+1,((e,r,i)=>{if(t>e&&tt(e))),n.from,t.head>n.from?-1:1);return o==n.from?n:W3.cursor(o,onull)),G8.gecko&&(t=e.contentDOM.ownerDocument,l7.has(t)||(l7.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{}))))}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,o=t.target;o!=e.contentDOM;o=o.parentNode)if(!o||11==o.nodeType||(n=D8.get(o))&&n.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let o of e){let e=o.spec;if(e&&e.domEventHandlers)for(let t in e.domEventHandlers){let r=e.domEventHandlers[t];r&&n(t).handlers.push(j6(o.value,r))}if(e&&e.domEventObservers)for(let t in e.domEventObservers){let r=e.domEventObservers[t];r&&n(t).observers.push(j6(o.value,r))}}for(let o in Q6)n(o).handlers.push(Q6[o]);for(let o in H6)n(o).observers.push(H6[o]);return t}(e),n=this.handlers,o=this.view.contentDOM;for(let r in t)if("scroll"!=r){let e=!t[r].handlers.length,i=n[r];i&&e!=!i.handlers.length&&(o.removeEventListener(r,this.handleEvent),i=null),i||o.addEventListener(r,this.handleEvent,{passive:e})}for(let r in n)"scroll"==r||t[r]||o.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&Date.now()t.keyCode==e.keyCode)))&&!e.ctrlKey||N6.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(){let e=this.pendingIOSKey;return!!e&&(this.pendingIOSKey=void 0,T8(this.view.contentDOM,e.key,e.keyCode))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(G8.safari&&!G8.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function j6(e,t){return(n,o)=>{try{return t.call(e,o,n)}catch(Lpe){q5(n.state,Lpe)}}}const B6=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],N6="dthko",z6=[16,17,18,20,91,92,224,225];function _6(e){return.7*Math.max(0,e)+8}class L6{constructor(e,t,n,o){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=function(e){let t=e.ownerDocument;for(let n=e.parentNode;n&&n!=t.body;)if(1==n.nodeType){if(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else{if(11!=n.nodeType)break;n=n.host}return null}(e.contentDOM),this.atoms=e.state.facet(s6).map((t=>t(e)));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(j4.allowMultipleSelections)&&function(e,t){let n=e.state.facet(Q5);return n.length?n[0](t):G8.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let o=h8(e.root);if(!o||0==o.rangeCount)return!0;let r=o.getRangeAt(0).getClientRects();for(let i=0;i=t.clientX&&e.top<=t.clientY&&e.bottom>=t.clientY)return!0}return!1}(e,t)||1!=e7(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t,n,o;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(n=this.startEvent,o=e,Math.max(Math.abs(n.clientX-o.clientX),Math.abs(n.clientY-o.clientY))<10))return;this.select(this.lastEvent=e);let r=0,i=0,l=(null===(t=this.scrollParent)||void 0===t?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},a=p6(this.view);e.clientX-a.left<=l.left+6?r=-_6(l.left-e.clientX):e.clientX+a.right>=l.right-6&&(r=_6(e.clientX-l.right)),e.clientY-a.top<=l.top+6?i=-_6(l.top-e.clientY):e.clientY+a.bottom>=l.bottom-6&&(i=_6(e.clientY-l.bottom)),this.setScrollSpeed(r,i)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nthis.select(this.lastEvent)),20)}}const Q6=Object.create(null),H6=Object.create(null),F6=G8.ie&&G8.ie_version<15||G8.ios&&G8.webkit_version<604;function W6(e,t){let n,{state:o}=e,r=1,i=o.toText(t),l=i.lines==o.selection.ranges.length;if(null!=n7&&o.selection.ranges.every((e=>e.empty))&&n7==i.toString()){let e=-1;n=o.changeByRange((n=>{let a=o.doc.lineAt(n.from);if(a.from==e)return{range:n};e=a.from;let s=o.toText((l?i.line(r++).text:t)+o.lineBreak);return{changes:{from:a.from,insert:s},range:W3.cursor(n.from+s.length)}}))}else n=l?o.changeByRange((e=>{let t=i.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:W3.cursor(e.from+t.length)}})):o.replaceSelection(i);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function Z6(e,t,n,o){if(1==o)return W3.cursor(t,n);if(2==o)return function(e,t,n=1){let o=e.charCategorizer(t),r=e.doc.lineAt(t),i=t-r.from;if(0==r.length)return W3.cursor(t);0==i?n=1:i==r.length&&(n=-1);let l=i,a=i;n<0?l=C3(r.text,i,!1):a=C3(r.text,i);let s=o(r.text.slice(l,a));for(;l>0;){let e=C3(r.text,l,!1);if(o(r.text.slice(e,l))!=s)break;l=e}for(;a{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},Q6.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&(e.inputState.lastEscPress=Date.now()),!1),H6.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},H6.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Q6.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let o of e.state.facet(F5))if(n=o(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=K6(e,t),o=e7(t),r=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),r=r.map(e.changes))},get(t,i,l){let a,s=K6(e,t),c=Z6(e,s.pos,s.bias,o);if(n.pos!=s.pos&&!i){let t=Z6(e,n.pos,n.bias,o),r=Math.min(t.from,c.from),i=Math.max(t.to,c.to);c=r1&&(a=function(e,t){for(let n=0;n=t)return W3.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(r,s.pos))?a:l?r.addRange(c):W3.create([c])}}}(e,t)),n){let o=!e.hasFocus;e.inputState.startMouseSelection(new L6(e,t,n,o)),o&&e.observer.ignore((()=>P8(e.contentDOM)));let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}return!1};let V6=(e,t)=>e>=t.top&&e<=t.bottom,X6=(e,t,n)=>V6(t,n)&&e>=n.left&&e<=n.right;function Y6(e,t,n,o){let r=c5.find(e.docView,t);if(!r)return 1;let i=t-r.posAtStart;if(0==i)return 1;if(i==r.length)return-1;let l=r.coordsAt(i,-1);if(l&&X6(n,o,l))return-1;let a=r.coordsAt(i,1);return a&&X6(n,o,a)?1:l&&V6(o,l)?-1:1}function K6(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:Y6(e,n,t.clientX,t.clientY)}}const G6=G8.ie&&G8.ie_version<=11;let U6=null,q6=0,J6=0;function e7(e){if(!G6)return e.detail;let t=U6,n=J6;return U6=e,J6=Date.now(),q6=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(q6+1)%3:1}function t7(e,t,n,o){if(!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:i}=e.inputState,l=o&&i&&function(e,t){let n=e.state.facet(H5);return n.length?n[0](t):G8.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:i.from,to:i.to}:null,a={from:r,insert:n},s=e.state.changes(l?[l,a]:a);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(r,-1),head:s.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Q6.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let o=e.docView.nearest(t.target);if(o&&o.isWidget){let e=o.posAtStart,t=e+o.length;(e>=n.to||t<=n.from)&&(n=W3.range(e,t))}}let{inputState:o}=e;return o.mouseSelection&&(o.mouseSelection.dragging=!0),o.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove"),!1},Q6.dragend=e=>(e.inputState.draggedContent=null,!1),Q6.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let o=Array(n.length),r=0,i=()=>{++r==n.length&&t7(e,t,o.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(o[e]=t.result),i()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return t7(e,t,n,!0),!0}return!1},Q6.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=F6?null:t.clipboardData;return n?(W6(e,n.getData("text/plain")||n.getData("text/uri-text")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{e.focus(),n.remove(),W6(e,n.value)}),50)}(e),!1)};let n7=null;Q6.copy=Q6.cut=(e,t)=>{let{text:n,ranges:o,linewise:r}=function(e){let t=[],n=[],o=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:o}of e.selection.ranges){let i=e.doc.lineAt(o);i.number>r&&(t.push(i.text),n.push({from:i.from,to:Math.min(e.doc.length,i.to+1)})),r=i.number}o=!0}return{text:t.join(e.lineBreak),ranges:n,linewise:o}}(e.state);if(!n&&!r)return!1;n7=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let i=F6?null:t.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let o=n.appendChild(document.createElement("textarea"));o.style.cssText="position: fixed; left: -10000px; top: 10px",o.value=t,o.focus(),o.selectionEnd=t.length,o.selectionStart=0,setTimeout((()=>{o.remove(),e.focus()}),50)}(e,n),!1)};const o7=O4.define();function r7(e,t){let n=[];for(let o of e.facet(X5)){let r=o(e,t);r&&n.push(r)}return n?e.update({effects:n,annotations:o7.of(!0)}):null}function i7(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=r7(e.state,t);n?e.dispatch(n):e.update([])}}),10)}H6.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),i7(e)},H6.blur=e=>{e.observer.clearSelectionRange(),i7(e)},H6.compositionstart=H6.compositionupdate=e=>{null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0)},H6.compositionend=e=>{e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,G8.chrome&&G8.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then((()=>e.observer.flush())):setTimeout((()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])}),50)},H6.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Q6.beforeinput=(e,t)=>{var n;let o;if(G8.chrome&&G8.android&&(o=B6.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(o.key,o.keyCode),"Backspace"==o.key||"Delete"==o.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}return!1};const l7=new Set,a7=["pre-wrap","normal","pre-line","break-spaces"];class s7{constructor(e){this.lineWrapping=e,this.doc=p3.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return a7.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=o,this.lineLength=r,a){this.heightSamples={};for(let e=0;e0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>p7&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return h7.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,o){let r=this,i=n.doc;for(let l=o.length-1;l>=0;l--){let{fromA:a,toA:s,fromB:c,toB:u}=o[l],d=r.lineAt(a,d7.ByPosNoHeight,n.setDoc(t),0,0),p=d.to>=s?d:r.lineAt(s,d7.ByPosNoHeight,n,0,0);for(u+=p.to-s,s=p.to;l>0&&d.from<=o[l-1].toA;)a=o[l-1].fromA,c=o[l-1].fromB,l--,a2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,o-=r.size}else{if(!(r>2*o))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}}else if(o=r&&i(this.blockAt(0,n,o,r))}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more&&this.setHeight(e,o.heights[o.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class g7 extends f7{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,o){return new u7(o,this.length,n,this.height,this.breaks)}replace(e,t,n){let o=n[0];return 1==n.length&&(o instanceof g7||o instanceof m7&&4&o.flags)&&Math.abs(this.length-o.length)<10?(o instanceof m7?o=new g7(o.length,this.height):o.height=this.height,this.outdated||(o.outdated=!1),o):h7.of(n)}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more?this.setHeight(e,o.heights[o.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class m7 extends h7{constructor(e){super(e,0)}heightMetrics(e,t){let n,o=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-o+1,l=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);n=t/i,this.length>i+1&&(l=(this.height-t)/(this.length-i-1))}else n=this.height/i;return{firstLine:o,lastLine:r,perLine:n,perChar:l}}blockAt(e,t,n,o){let{firstLine:r,lastLine:i,perLine:l,perChar:a}=this.heightMetrics(t,o);if(t.lineWrapping){let r=o+Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length),i=t.doc.lineAt(r),s=l+i.length*a,c=Math.max(n,e-s/2);return new u7(i.from,i.length,c,s,0)}{let o=Math.max(0,Math.min(i-r,Math.floor((e-n)/l))),{from:a,length:s}=t.doc.line(r+o);return new u7(a,s,n+l*o,l,0)}}lineAt(e,t,n,o,r){if(t==d7.ByHeight)return this.blockAt(e,n,o,r);if(t==d7.ByPosNoHeight){let{from:t,to:o}=n.doc.lineAt(e);return new u7(t,o-t,0,0,0)}let{firstLine:i,perLine:l,perChar:a}=this.heightMetrics(n,r),s=n.doc.lineAt(e),c=l+s.length*a,u=s.number-i,d=o+l*u+a*(s.from-r-u);return new u7(s.from,s.length,Math.max(o,Math.min(d,o+this.height-c)),c,0)}forEachLine(e,t,n,o,r,i){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:s}=this.heightMetrics(n,r);for(let c=e,u=o;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-l;u+=a*n+s*(e-r-n)}let o=a+s*t.length;i(new u7(t.from,t.length,u,o,0)),u+=o,c=t.to+1}}replace(e,t,n){let o=this.length-t;if(o>0){let e=n[n.length-1];e instanceof m7?n[n.length-1]=new m7(e.length+o):n.push(null,new m7(o-1))}if(e>0){let t=n[0];t instanceof m7?n[0]=new m7(e+t.length):n.unshift(new m7(e-1),null)}return h7.of(n)}decomposeLeft(e,t){t.push(new m7(e-1),null)}decomposeRight(e,t){t.push(null,new m7(this.length-e-1))}updateHeight(e,t=0,n=!1,o){let r=t+this.length;if(o&&o.from<=t+this.length&&o.more){let n=[],i=Math.max(t,o.from),l=-1;for(o.from>t&&n.push(new m7(o.from-t-1).updateHeight(e,t));i<=r&&o.more;){let t=e.doc.lineAt(i).length;n.length&&n.push(null);let r=o.heights[o.index++];-1==l?l=r:Math.abs(r-l)>=p7&&(l=-2);let a=new g7(t,r);a.outdated=!1,n.push(a),i+=t+1}i<=r&&n.push(null,new m7(r-i).updateHeight(e,i));let a=h7.of(n);return(l<0||Math.abs(a.height-this.height)>=p7||Math.abs(l-this.heightMetrics(e,t).perLine)>=p7)&&(e.heightChanged=!0),a}return(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class v7 extends h7{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,o){let r=n+this.left.height;return el))return s;let c=t==d7.ByPosNoHeight?d7.ByPosNoHeight:d7.ByPos;return a?s.join(this.right.lineAt(l,c,n,i,l)):this.left.lineAt(l,c,n,o,r).join(s)}forEachLine(e,t,n,o,r,i){let l=o+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,l,a,i);else{let s=this.lineAt(a,d7.ByPos,n,o,r);e=e&&s.from<=t&&i(s),t>s.to&&this.right.forEachLine(s.to+1,t,n,l,a,i)}}replace(e,t,n){let o=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-o,t-o,n));let r=[];e>0&&this.decomposeLeft(e,r);let i=r.length;for(let l of n)r.push(l);if(e>0&&b7(r,i-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,o=n+this.break;if(e>=o)return this.right.decomposeRight(e-o,t);e2*t.size||t.size>2*e.size?h7.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,o){let{left:r,right:i}=this,l=t+r.length+this.break,a=null;return o&&o.from<=t+r.length&&o.more?a=r=r.updateHeight(e,t,n,o):r.updateHeight(e,t,n),o&&o.from<=l+i.length&&o.more?a=i=i.updateHeight(e,l,n,o):i.updateHeight(e,l,n),a?this.balanced(r,i):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function b7(e,t){let n,o;null==e[t]&&(n=e[t-1])instanceof m7&&(o=e[t+1])instanceof m7&&e.splice(t-1,3,new m7(n.length+1+o.length))}class y7{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof g7?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new g7(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=5)&&this.addLineDeco(o,r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new g7(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new m7(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof g7)return e;let t=new g7(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let o=this.ensureLine();o.length+=n,o.collapsed+=n,o.widgetHeight=Math.max(o.widgetHeight,e),o.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof g7||this.isCovered?(this.writtenTot.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=n.overflow){let n=t.getBoundingClientRect();i=Math.max(i,n.left),l=Math.min(l,n.right),a=Math.max(a,n.top),s=c==e.parentNode?n.bottom:Math.min(s,n.bottom)}c="absolute"==n.position||"fixed"==n.position?t.offsetParent:t.parentNode}else{if(11!=c.nodeType)break;c=c.host}return{left:i-n.left,right:Math.max(i,l)-n.left,top:a-(n.top+t),bottom:Math.max(a,s)-(n.top+t)}}function x7(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class $7{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n"function"!=typeof e&&"cm-lineWrapping"==e.class));this.heightOracle=new s7(t),this.stateDeco=e.facet(l6).filter((e=>"function"!=typeof e)),this.heightMap=h7.empty().applyChanges(this.stateDeco,p3.empty,this.heightOracle.setDoc(e.doc),[new f6(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=h5.set(this.lineGaps.map((e=>e.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let o=n?t.head:t.anchor;if(!e.some((({from:e,to:t})=>o>=e&&o<=t))){let{from:t,to:n}=this.lineBlockAt(o);e.push(new k7(t,n))}}this.viewports=e.sort(((e,t)=>e.from-t.from)),this.scaler=this.heightMap.height<=7e6?I7:new E7(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(e=>{this.viewportLines.push(1==this.scaler.scale?e:A7(e,this.scaler))}))}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(l6).filter((e=>"function"!=typeof e));let o=e.changedRanges,r=f6.extendWithRanges(o,function(e,t,n){let o=new O7;return Q4.compare(e,t,n,o,0),o.changes}(n,this.stateDeco,e?e.changes:B3.empty(this.state.doc.length))),i=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=i&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let s=!e.changes.empty||2&e.flags||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),s&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(K5)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),o=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?x5.RTL:x5.LTR;let i=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=i||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let s=0,c=0;if(l.width&&l.height){let{scaleX:e,scaleY:n}=$8(t,l);this.scaleX==e&&this.scaleY==n||(this.scaleX=e,this.scaleY=n,s|=8,i=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,s|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(o.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,s|=8);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=E8(e.scrollDOM);let h=(this.printing?x7:w7)(t,this.paddingTop),f=h.top-this.pixelViewport.top,g=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let v=l.width;if(this.contentDOMWidth==v&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,s|=8),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(t)&&(i=!0),i||o.lineWrapping&&Math.abs(v-this.contentDOMWidth)>o.charWidth){let{lineHeight:n,charWidth:l,textHeight:a}=e.docView.measureTextSize();i=n>0&&o.refresh(r,n,l,a,v/l,t),i&&(e.docView.minWidth=0,s|=8)}f>0&&g>0?c=Math.max(f,g):f<0&&g<0&&(c=Math.min(f,g)),o.heightChanged=!1;for(let n of this.viewports){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(i?h7.empty().applyChanges(this.stateDeco,p3.empty,this.heightOracle,[new f6(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(o,0,i,new c7(n.from,r))}o.heightChanged&&(s|=2)}let b=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(2&s||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(i?[]:this.lineGaps,e)),s|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),s}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),o=this.heightMap,r=this.heightOracle,{visibleTop:i,visibleBottom:l}=this,a=new k7(o.lineAt(i-1e3*n,d7.ByHeight,r,0,0).from,o.lineAt(l+1e3*(1-n),d7.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(ea.to){let n,i=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),l=o.lineAt(e,d7.ByPos,r,0,0);n="center"==t.y?(l.top+l.bottom)/2-i/2:"start"==t.y||"nearest"==t.y&&e=l+Math.max(10,Math.min(n,250)))&&o>i-2e3&&r>1,i=o<<1;if(this.defaultTextDirection!=x5.LTR&&!n)return[];let l=[],a=(o,i,s,c)=>{if(i-oo&&ee.from>=s.from&&e.to<=s.to&&Math.abs(e.from-o)e.fromt))));if(!p){if(ie.from<=i&&e.to>=i))){let e=t.moveToLineBoundary(W3.cursor(i),!1,!0).head;e>o&&(i=e)}p=new $7(o,i,this.gapSize(s,o,i,c))}l.push(p)};for(let s of this.viewportLines){if(s.lengths.from&&a(s.from,t,s,e),re.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Q4.spans(e,this.viewport.from,this.viewport.to,{span(e,n){t.push({from:e,to:n})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,n)=>e.from!=t[n].from||e.to!=t[n].to));return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||A7(this.heightMap.lineAt(e,d7.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return A7(this.heightMap.lineAt(this.scaler.fromDOM(e),d7.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return A7(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class k7{constructor(e,t){this.from=e,this.to=t}}function P7(e,t,n){let o=[],r=e,i=0;return Q4.spans(n,e,t,{span(){},point(e,t){e>r&&(o.push({from:r,to:e}),i+=e-r),r=t}},20),r=1)return t[t.length-1].to;let o=Math.floor(e*n);for(let r=0;;r++){let{from:e,to:n}=t[r],i=n-e;if(o<=i)return e+o;o-=i}}function T7(e,t){let n=0;for(let{from:o,to:r}of e.ranges){if(t<=r){n+=t-o;break}n+=r-o}return n/e.total}const I7={toDOM:e=>e,fromDOM:e=>e,scale:1};class E7{constructor(e,t,n){let o=0,r=0,i=0;this.viewports=n.map((({from:n,to:r})=>{let i=t.lineAt(n,d7.ByPos,e,0,0).top,l=t.lineAt(r,d7.ByPos,e,0,0).bottom;return o+=l-i,{from:n,to:r,top:i,bottom:l,domTop:0,domBottom:0}})),this.scale=(7e6-o)/(t.height-o);for(let l of this.viewports)l.domTop=i+(l.top-r)*this.scale,i=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,n=0,o=0;;t++){let r=tA7(e,t))):e._content)}const R7=X3.define({combine:e=>e.join(" ")}),D7=X3.define({combine:e=>e.indexOf(!0)>-1}),j7=r8.newName(),B7=r8.newName(),N7=r8.newName(),z7={"&light":"."+B7,"&dark":"."+N7};function _7(e,t,n){return new r8(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]})):e+" "+t})}const L7=_7("."+j7,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},z7),Q7="￿";class H7{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(j4.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Q7}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let o=e;;){this.findPointBefore(n,o);let e=this.text.length;this.readNode(o);let r=o.nextSibling;if(r==t)break;let i=D8.get(o),l=D8.get(r);(i&&l?i.breakAfter:(i?i.breakAfter:W7(o))||W7(r)&&("BR"!=o.nodeName||o.cmIgnore)&&this.text.length>e)&&this.lineBreak(),o=r}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let r,i=-1,l=1;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),l=this.lineSeparator.length):(r=o.exec(t))&&(i=r.index,l=r[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),l>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=l-1);n=i+l}}readNode(e){if(e.cmIgnore)return;let t=D8.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(F7(e,n.node,n.offset)?t:0))}}function F7(e,t,n){for(;;){if(!t||n-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=r||i?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}=e.observer.selectionRange;return n&&(t.push(new Z7(n,o)),r==n&&i==o||t.push(new Z7(r,i))),t}(e),n=new H7(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,o=2==e.length?e[1].pos:n;return n>-1&&o>-1?W3.single(n+t,o+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!f8(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),o=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!f8(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),l=e.viewport;if(G8.ios&&e.state.selection.main.empty&&n!=o&&(l.from>0||l.toDate.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=r.from,s=null;(8===i||G8.android&&t.text.length0&&a>0&&e.charCodeAt(l-1)==t.charCodeAt(a-1);)l--,a--;return"end"==o&&(n-=l+Math.max(0,i-Math.min(l,a))-i),l=l?i-n:0,a=i+(a-l),l=i):a=a?i-n:0,l=i+(l-a),a=i),{from:i,toA:l,toB:a}}(e.state.doc.sliceString(o,l,Q7),t.text,a-o,s);c&&(G8.chrome&&13==i&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==Q7+Q7&&c.toB--,n={from:o+c.from,to:o+c.toA,insert:p3.of(t.text.slice(c.from,c.toB).split(Q7))})}else o&&(!e.hasFocus&&e.state.facet(J5)||o.main.eq(r))&&(o=null);if(!n&&!o)return!1;if(!n&&t.typeOver&&!r.empty&&o&&o.main.empty?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,r.to)}:n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,r.to))}:(G8.mac||G8.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(o&&2==n.insert.length&&(o=W3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:p3.of([" "])}):G8.chrome&&n&&n.from==n.to&&n.from==r.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(o&&(o=W3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:p3.of([" "])}),n){if(G8.ios&&e.inputState.flushIOSKey())return!0;if(G8.android&&(n.from==r.from&&n.to==r.to&&1==n.insert.length&&2==n.insert.lines&&T8(e.contentDOM,"Enter",13)||(n.from==r.from-1&&n.to==r.to&&0==n.insert.length||8==i&&n.insert.lengthr.head)&&T8(e.contentDOM,"Backspace",8)||n.from==r.from&&n.to==r.to+1&&0==n.insert.length&&T8(e.contentDOM,"Delete",46)))return!0;let t,l=n.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>t||(t=function(e,t,n){let o,r=e.state,i=r.selection.main;if(t.from>=i.from&&t.to<=i.to&&t.to-t.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=i.fromt.to?r.sliceDoc(t.to,i.to):"";o=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+l))}else{let l=r.changes(t),a=n&&n.main.to<=l.newLength?n.main:void 0;if(r.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=i.to&&t.to>=i.to-10){let s,c=e.state.sliceDoc(t.from,t.to),u=n&&b6(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);s={from:u.from,to:u.to-e}}else s=e.state.doc.lineAt(i.head);let d=i.to-t.to,p=i.to-i.from;o=r.changeByRange((n=>{if(n.from==i.from&&n.to==i.to)return{changes:l,range:a||n.map(l)};let o=n.to-d,u=o-c.length;if(n.to-n.from!=p||e.state.sliceDoc(u,o)!=c||n.to>=s.from&&n.from<=s.to)return{range:n};let h=r.changes({from:u,to:o,insert:t.insert}),f=n.to-i.to;return{changes:h,range:a?W3.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(h)}}))}else o={changes:l,selection:a&&r.selection.replaceRange(a)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(o,{userEvent:l,scrollIntoView:!0})}(e,n,o));return e.state.facet(V5).some((t=>t(e,n.from,n.to,l,a)))||e.dispatch(a()),!0}if(o&&!o.main.eq(r)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:o,scrollIntoView:t,userEvent:n}),!0}return!1}const Y7={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},K7=G8.ie&&G8.ie_version<=11;class G7{constructor(e){this.view=e,this.active=!1,this.selectionRange=new S8,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(G8.ie&&G8.ie_version<=11||G8.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),K7&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,n)=>t!=e[n])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,o=this.selectionRange;if(n.state.facet(J5)?n.root.activeElement!=this.dom:!g8(n.dom,o))return;let r=o.anchorNode&&n.docView.nearest(o.anchorNode);r&&r.ignoreEvent(e)?t||(this.selectionChanged=!1):(G8.ie&&G8.ie_version<=11||G8.android&&G8.chrome)&&!n.state.selection.main.empty&&o.focusNode&&v8(o.focusNode,o.focusOffset,o.anchorNode,o.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=G8.safari&&11==e.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e){let t=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;let o=t.startContainer,r=t.startOffset,i=t.endContainer,l=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);return v8(a.node,a.offset,i,l)&&([o,r,i,l]=[i,l,o,r]),{anchorNode:o,anchorOffset:r,focusNode:i,focusOffset:l}}(this.view)||h8(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=g8(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&T8(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,o=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(o=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:o}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),o=this.selectionChanged&&g8(this.dom,this.selectionRange);if(e<0&&!o)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new V7(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,o=X7(this.view,t);return this.view.state==n&&this.view.update([]),o}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let n=U7(t,e.previousSibling||e.target.previousSibling,-1),o=U7(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:o?t.posBefore(o):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let o of this.scrollTargets)o.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function U7(e,t,n){for(;t;){let o=D8.get(t);if(o&&o.parent==e)return o;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}class q7{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach((e=>t(e,this))))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new C7(e.state||j4.create(e)),e.scrollTo&&e.scrollTo.is(U5)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(t6).map((e=>new o6(e)));for(let n of this.plugins)n.update(this);this.observer=new G7(this),this.inputState=new D6(this),this.inputState.ensureHandlers(this.plugins),this.docView=new m6(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=1==e.length&&e[0]instanceof S4?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,o=!1,r=this.state;for(let d of e){if(d.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=d.state}if(this.destroyed)return void(this.viewState.state=r);let i=this.hasFocus,l=0,a=null;e.some((e=>e.annotation(o7)))?(this.inputState.notifiedFocused=i,l=1):i!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=i,a=r7(r,i),a||(l=1));let s=this.observer.delayedAndroidKey,c=null;if(s?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(j4.phrases)!=this.state.facet(j4.phrases))return this.setState(r);t=g6.create(this,r,e),t.flags|=l;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new G5(e.empty?e:W3.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(U5)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=t9.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(h6)!=this.styleModules&&this.mountStyles(),o=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(R7)!=t.state.facet(R7)&&(this.viewState.mustMeasureContent=!0),(n||o||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!t.empty)for(let d of this.state.facet(Z5))try{d(t)}catch(Lpe){q5(this.state,Lpe,"update listener")}(a||c)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!X7(this,c)&&s.force&&T8(this.contentDOM,s.key,s.keyCode)}))}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new C7(e),this.plugins=e.facet(t6).map((e=>new o6(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new m6(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(t6),n=e.state.facet(t6);if(t!=n){let o=[];for(let r of n){let n=t.indexOf(r);if(n<0)o.push(new o6(r));else{let t=this.plugins[n];t.mustUpdate=e,o.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=e;for(let o=0;o-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,o=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:i}=this.viewState;Math.abs(o-this.viewState.scrollTop)>1&&(i=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(i<0)if(E8(n))r=-1,i=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(o);r=e.from,i=e.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5)break;let a=[];4&l||([this.measureRequests,a]=[a,this.measureRequests]);let s=a.map((e=>{try{return e.read(this)}catch(Lpe){return q5(this.state,Lpe),e9}})),c=g6.create(this,this.state,[]),u=!1;c.flags|=l,t?t.flags|=l:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c));for(let e=0;e1||e<-1){o+=e,n.scrollTop=o/this.scaleY,i=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Z5))l(t)}get themeClasses(){return j7+" "+(this.state.facet(D7)?N7:B7)+" "+this.state.facet(R7)}updateAttrs(){let e=n9(this,r6,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(J5)?"true":"false",class:"cm-content",style:`${G8.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),n9(this,i6,t);let n=this.observer.ignore((()=>{let n=a5(this.contentDOM,this.contentAttrs,t),o=a5(this.dom,this.editorAttrs,e);return n||o}));return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(q7.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(h6);let e=this.state.facet(q7.cspNonce);r8.mount(this.root,this.styleModules.concat(L7).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;tt.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return R6(this,e,E6(this,e,t,n))}moveByGroup(e,t){return R6(this,e,E6(this,e,t,(t=>function(e,t,n){let o=e.state.charCategorizer(t),r=o(n);return e=>{let t=o(e);return r==E4.Space&&(r=t),r==t}}(this,e.head,t))))}visualLineSide(e,t){let n=this.bidiSpans(e),o=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return W3.cursor(r.side(t,o)+e.from,r.forward(!t,o)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,o){let r=I6(e,t.head),i=o&&r.type==p5.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(i){let t=e.dom.getBoundingClientRect(),o=e.textDirectionAt(r.from),l=e.posAtCoords({x:n==(o==x5.LTR)?t.right-1:t.left+1,y:(i.top+i.bottom)/2});if(null!=l)return W3.cursor(l,n?-1:1)}return W3.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return R6(this,e,function(e,t,n,o){let r=t.head,i=n?1:-1;if(r==(n?e.state.doc.length:0))return W3.cursor(r,t.assoc);let l,a=t.goalColumn,s=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(r,t.assoc||-1),u=e.documentTop;if(c)null==a&&(a=c.left-s.left),l=i<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(s.right-s.left,e.defaultCharacterWidth*(r-t.from))),l=(i<0?t.top:t.bottom)+u}let d=s.left+a,p=null!=o?o:e.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let t=l+(p+h)*i,n=M6(e,{x:d,y:t},!1,i);if(ts.bottom||(i<0?nr)){let o=e.docView.coordsForChar(n),r=!o||t0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Y5)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>J7)return N5(e.length);let t,n=this.textDirectionAt(e.from);for(let r of this.bidiCache)if(r.from==e.from&&r.dir==n&&(r.fresh||R5(r.isolates,t=u6(this,e))))return r.order;t||(t=u6(this,e));let o=function(e,t,n){if(!e)return[new A5(0,0,t==S5?1:0)];if(t==$5&&!n.length&&!E5.test(e))return N5(e.length);if(n.length)for(;e.length>D5.length;)D5[D5.length]=256;let o=[],r=t==$5?0:1;return B5(e,r,r,n,0,e.length,o),o}(e.text,n,t);return this.bidiCache.push(new t9(e.from,e.to,n,t,!0,o)),o}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||G8.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{P8(this.contentDOM),this.docView.updateSelection()}))}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return U5.of(new G5("number"==typeof e?W3.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return U5.of(new G5(W3.cursor(n.from),"start","start",n.top-e,t,!0))}static domEventHandlers(e){return n6.define((()=>({})),{eventHandlers:e})}static domEventObservers(e){return n6.define((()=>({})),{eventObservers:e})}static theme(e,t){let n=r8.newName(),o=[R7.of(n),h6.of(_7(`.${n}`,e))];return t&&t.dark&&o.push(D7.of(!0)),o}static baseTheme(e){return l4.lowest(h6.of(_7("."+j7,e,z7)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),o=n&&D8.get(n)||D8.get(e);return(null===(t=null==o?void 0:o.rootView)||void 0===t?void 0:t.view)||null}}q7.styleModule=h6,q7.inputHandler=V5,q7.focusChangeEffect=X5,q7.perLineTextDirection=Y5,q7.exceptionSink=W5,q7.updateListener=Z5,q7.editable=J5,q7.mouseSelectionStyle=F5,q7.dragMovesSelection=H5,q7.clickAddsSelectionRange=Q5,q7.decorations=l6,q7.outerDecorations=a6,q7.atomicRanges=s6,q7.bidiIsolatedRanges=c6,q7.scrollMargins=d6,q7.darkTheme=D7,q7.cspNonce=X3.define({combine:e=>e.length?e[0]:""}),q7.contentAttributes=i6,q7.editorAttributes=r6,q7.lineWrapping=q7.contentAttributes.of({class:"cm-lineWrapping"}),q7.announce=$4.define();const J7=4096,e9={};class t9{constructor(e,t,n,o,r,i){this.from=e,this.to=t,this.dir=n,this.isolates=o,this.fresh=r,this.order=i}static update(e,t){if(t.empty&&!e.some((e=>e.fresh)))return e;let n=[],o=e.length?e[e.length-1].dir:x5.LTR;for(let r=Math.max(0,e.length-10);r=0;r--){let t=o[r],i="function"==typeof t?t(e):t;i&&r5(i,n)}return n}const o9=G8.mac?"mac":G8.windows?"win":G8.linux?"linux":"key";function r9(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const i9=l4.default(q7.domEventHandlers({keydown:(e,t)=>u9(s9(t.state),e,t,"editor")})),l9=X3.define({enables:i9}),a9=new WeakMap;function s9(e){let t=e.facet(l9),n=a9.get(t);return n||a9.set(t,n=function(e,t=o9){let n=Object.create(null),o=Object.create(null),r=(e,t)=>{let n=o[e];if(null==n)o[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},i=(e,o,i,l,a)=>{var s,c;let u=n[e]||(n[e]=Object.create(null)),d=o.split(/ (?!$)/).map((e=>function(e,t){const n=e.split(/-(?!$)/);let o,r,i,l,a=n[n.length-1];"Space"==a&&(a=" ");for(let s=0;s{let o=c9={view:t,prefix:n,scope:e};return setTimeout((()=>{c9==o&&(c9=null)}),4e3),!0}]})}let p=d.join(" ");r(p,!1);let h=u[p]||(u[p]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(s=u._any)||void 0===s?void 0:s.run)||void 0===c?void 0:c.slice())||[]});i&&h.run.push(i),l&&(h.preventDefault=!0),a&&(h.stopPropagation=!0)};for(let l of e){let e=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let t in e)e[t].run.push(l.any)}let o=l[t]||l.key;if(o)for(let t of e)i(t,o,l.run,l.preventDefault,l.stopPropagation),l.shift&&i(t,"Shift-"+o,l.shift,l.preventDefault,l.stopPropagation)}return n}(t.reduce(((e,t)=>e.concat(t)),[]))),n}let c9=null;function u9(e,t,n,o){let r=function(e){var t=!(c8&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||u8&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?s8:a8)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),i=A3(I3(r,0))==r.length&&" "!=r,l="",a=!1,s=!1,c=!1;c9&&c9.view==n&&c9.scope==o&&(l=c9.prefix+" ",z6.indexOf(t.keyCode)<0&&(s=!0,c9=null));let u,d,p=new Set,h=e=>{if(e){for(let o of e.run)if(!p.has(o)&&(p.add(o),o(n,t)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),s=!0)}return!1},f=e[o];return f&&(h(f[l+r9(r,t,!i)])?a=!0:i&&(t.altKey||t.metaKey||t.ctrlKey)&&!(G8.windows&&t.ctrlKey&&t.altKey)&&(u=a8[t.keyCode])&&u!=r?(h(f[l+r9(u,t,!0)])||t.shiftKey&&(d=s8[t.keyCode])!=r&&d!=u&&h(f[l+r9(d,t,!1)]))&&(a=!0):i&&t.shiftKey&&h(f[l+r9(r,t,!0)])&&(a=!0),!a&&h(f._any)&&(a=!0)),s&&(a=!0),a&&c&&t.stopPropagation(),a}class d9{constructor(e,t,n,o,r){this.className=e,this.left=t,this.top=n,this.width=o,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let o=e.coordsAtPos(n.head,n.assoc||1);if(!o)return[];let r=p9(e);return[new d9(t,o.left-r.left,o.top-r.top,null,o.bottom-o.top)]}return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let o=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),i=e.textDirection==x5.LTR,l=e.contentDOM,a=l.getBoundingClientRect(),s=p9(e),c=l.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),p=a.right-(u?parseInt(u.paddingRight):0),h=I6(e,o),f=I6(e,r),g=h.type==p5.Text?h:null,m=f.type==p5.Text?f:null;if(g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=h9(e,o,g)),m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=h9(e,r,m)),g&&m&&g.from==m.from)return b(y(n.from,n.to,g));{let t=g?y(n.from,null,g):O(h,!1),o=m?y(null,n.to,m):O(f,!0),r=[];return(g||h).to<(m||f).from-(g&&m?1:0)||h.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2c&&i.from=r)break;a>o&&s(Math.max(e,o),null==t&&e<=c,Math.min(a,r),null==n&&a>=u,l.dir)}if(o=i.to+1,o>=r)break}return 0==a.length&&s(c,null==t,u,null==n,e.textDirection),{top:r,bottom:l,horizontal:a}}function O(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n)}}function p9(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==x5.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function h9(e,t,n){let o=W3.cursor(t);return{from:Math.max(n.from,e.moveToLineBoundary(o,!1,!0).from),to:Math.min(n.to,e.moveToLineBoundary(o,!0,!0).from),type:p5.Text}}class f9{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(g9)!=e.state.facet(g9)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,n=e.facet(g9);for(;t{return n=e,o=this.drawn[t],!(n.constructor==o.constructor&&n.eq(o));var n,o}))){let t=this.dom.firstChild,n=0;for(let o of e)o.update&&t&&o.constructor&&this.drawn[n].constructor&&o.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(o.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const g9=X3.define();function m9(e){return[n6.define((t=>new f9(t,e))),g9.of(e)]}const v9=!G8.ios,b9=X3.define({combine:e=>B4(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function y9(e={}){return[b9.of(e),w9,$9,C9,K5.of(!0)]}function O9(e){return e.startState.facet(b9)!=e.state.facet(b9)}const w9=m9({above:!0,markers(e){let{state:t}=e,n=t.facet(b9),o=[];for(let r of t.selection.ranges){let i=r==t.selection.main;if(r.empty?!i||v9:n.drawRangeCursor){let t=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:W3.cursor(r.head,r.head>r.anchor?-1:1);for(let r of d9.forRange(e,t,n))o.push(r)}}return o},update(e,t){e.transactions.some((e=>e.selection))&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=O9(e);return n&&x9(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){x9(t.state,e)},class:"cm-cursorLayer"});function x9(e,t){t.style.animationDuration=e.facet(b9).cursorBlinkRate+"ms"}const $9=m9({above:!1,markers:e=>e.state.selection.ranges.map((t=>t.empty?[]:d9.forRange(e,"cm-selectionBackground",t))).reduce(((e,t)=>e.concat(t))),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||O9(e),class:"cm-selectionLayer"}),S9={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};v9&&(S9[".cm-line"].caretColor="transparent !important",S9[".cm-content"]={caretColor:"transparent !important"});const C9=l4.highest(q7.theme(S9)),k9=$4.define({map:(e,t)=>null==e?null:t.mapPos(e)}),P9=e4.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce(((e,t)=>t.is(k9)?t.value:e),e))}),M9=n6.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(P9);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(P9)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(P9),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let o=e.scrollDOM.getBoundingClientRect();return{left:n.left-o.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-o.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(P9)!=e&&this.view.dispatch({effects:k9.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function T9(e,t,n,o,r){t.lastIndex=0;for(let i,l=e.iterRange(n,o),a=n;!l.next().done;a+=l.value.length)if(!l.lineBreak)for(;i=t.exec(l.value);)r(a+i.index,i)}class I9{constructor(e){const{regexp:t,decoration:n,decorate:o,boundary:r,maxLength:i=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,o)this.addMatch=(e,t,n,r)=>o(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,o,r)=>{let i=n(e,t,o);i&&r(o,o+e[0].length,i)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,o,r)=>r(o,o+e[0].length,n)}this.boundary=r,this.maxLength=i}createDeco(e){let t=new H4,n=t.add.bind(t);for(let{from:o,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let o=[];for(let{from:r,to:i}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),i=Math.min(e.state.doc.lineAt(i).to,i+t),o.length&&o[o.length-1].to>=r?o[o.length-1].to=i:o.push({from:r,to:i});return o}(e,this.maxLength))T9(e.state.doc,this.regexp,o,r,((t,o)=>this.addMatch(o,e,t,n)));return t.finish()}updateDeco(e,t){let n=1e9,o=-1;return e.docChanged&&e.changes.iterChanges(((t,r,i,l)=>{l>e.view.viewport.from&&i1e3?this.createDeco(e.view):o>-1?this.updateRange(e.view,t.map(e.changes),n,o):t}updateRange(e,t,n,o){for(let r of e.visibleRanges){let i=Math.max(r.from,n),l=Math.min(r.to,o);if(l>i){let n=e.state.doc.lineAt(i),o=n.ton.from;i--)if(this.boundary.test(n.text[i-1-n.from])){a=i;break}for(;lu.push(n.range(e,t));if(n==o)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.indexthis.addMatch(n,e,t,d)));t=t.update({filterFrom:a,filterTo:s,filter:(e,t)=>es,add:u})}}return t}}const E9=null!=/x/.unicode?"gu":"g",A9=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",E9),R9={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let D9=null;const j9=X3.define({combine(e){let t=B4(e,{render:null,specialChars:A9,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==D9&&"undefined"!=typeof document&&document.body){let t=document.body.style;D9=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return D9||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,E9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,E9)),t}});function B9(e={}){return[j9.of(e),N9||(N9=n6.fromClass(class{constructor(e){this.view=e,this.decorations=h5.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(j9)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new I9({regexp:e.specialChars,decoration:(t,n,o)=>{let{doc:r}=n.state,i=I3(t[0],0);if(9==i){let e=r.lineAt(o),t=n.state.tabSize,i=J4(e.text,t,o-e.from);return h5.replace({widget:new _9((t-i%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=h5.replace({widget:new z9(e,i)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(j9);e.startState.facet(j9)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let N9=null;class z9 extends d5{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=(n=this.code)>=32?"•":10==n?"␤":String.fromCharCode(9216+n);var n;let o=e.state.phrase("Control character")+" "+(R9[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,o,t);if(r)return r;let i=document.createElement("span");return i.textContent=t,i.title=o,i.setAttribute("aria-label",o),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class _9 extends d5{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const L9=h5.line({class:"cm-activeLine"}),Q9=n6.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let o of e.state.selection.ranges){let r=e.lineBlockAt(o.head);r.from>t&&(n.push(L9.range(r.from)),t=r.from)}return h5.set(n)}},{decorations:e=>e.decorations});class H9 extends d5{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?m8(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),o=w8(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return o.bottom-o.top>1.5*r?{left:o.left,right:o.right,top:o.top,bottom:o.top+r}:o}ignoreEvent(){return!1}}const F9=2e3;function W9(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(n),r=n-o.from,i=r>F9?-1:r==o.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):J4(o.text,e.state.tabSize,n-o.from);return{line:o.number,col:i,off:r}}function Z9(e,t){let n=W9(e,t),o=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),r=e.state.doc.lineAt(t);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},o=o.map(e.changes)}},get(t,r,i){let l=W9(e,t);if(!l)return o;let a=function(e,t,n){let o=Math.min(t.line,n.line),r=Math.max(t.line,n.line),i=[];if(t.off>F9||n.off>F9||t.col<0||n.col<0){let l=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let t=o;t<=r;t++){let n=e.doc.line(t);n.length<=a&&i.push(W3.range(n.from+l,n.to+a))}}else{let l=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let t=o;t<=r;t++){let n=e.doc.line(t),o=e8(n.text,l,e.tabSize,!0);if(o<0)i.push(W3.cursor(n.to));else{let t=e8(n.text,a,e.tabSize);i.push(W3.range(n.from+o,n.from+t))}}}return i}(e.state,n,l);return a.length?i?W3.create(a.concat(o.ranges)):W3.create(a):o}}:null}function V9(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return q7.mouseSelectionStyle.of(((e,n)=>t(n)?Z9(e,n):null))}const X9={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},Y9={style:"cursor: crosshair"};function K9(e={}){let[t,n]=X9[e.key||"Alt"],o=n6.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[o,q7.contentAttributes.of((e=>{var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.isDown)?Y9:null}))]}const G9="-10000px";class U9{constructor(e,t,n){this.facet=t,this.createTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e)),this.tooltipViews=this.tooltips.map(n)}update(e,t){var n;let o=e.state.facet(this.facet),r=o.filter((e=>e));if(o===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let i=[],l=t?[]:null;for(let a=0;at[n]=e)),t.length=l.length),this.input=o,this.tooltips=r,this.tooltipViews=i,!0}}function q9(e){let{win:t}=e;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const J9=X3.define({combine:e=>{var t,n,o;return{position:G8.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find((e=>e.parent)))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(o=e.find((e=>e.tooltipSpace)))||void 0===o?void 0:o.tooltipSpace)||q9}}}),eee=new WeakMap,tee=n6.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(J9);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new U9(e,ree,(e=>this.createTooltip(e))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,o=e.state.facet(J9);if(o.position!=this.position&&!this.madeAbsolute){this.position=o.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(o.parent!=this.parent){this.parent&&this.container.remove(),this.parent=o.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e){let t=e.create(this.view);if(t.dom.classList.add("cm-tooltip"),e.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",t.dom.appendChild(e)}return t.dom.style.position=this.position,t.dom.style.top=G9,t.dom.style.left="0px",this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}destroy(){var e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),null===(e=n.destroy)||void 0===e||e.call(n);this.parent&&this.container.remove(),null===(t=this.intersectionObserver)||void 0===t||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect(),t=1,n=1,o=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(G8.gecko)o=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==G9&&"0px"==e.style.left){let t=e.getBoundingClientRect();o=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(o||"absolute"==this.position)if(this.parent){let e=this.parent.getBoundingClientRect();e.width&&e.height&&(t=e.width/this.parent.offsetWidth,n=e.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:n}=this.view.viewState);return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(J9).tooltipSpace(this.view),scaleX:t,scaleY:n,makeAbsolute:o}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{editor:n,space:o,scaleX:r,scaleY:i}=e,l=[];for(let a=0;a=Math.min(n.bottom,o.bottom)||d.rightMath.min(n.right,o.right)+.1){u.style.top=G9;continue}let h=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=h?7:0,g=p.right-p.left,m=null!==(t=eee.get(c))&&void 0!==t?t:p.bottom-p.top,v=c.offset||oee,b=this.view.textDirection==x5.LTR,y=p.width>o.right-o.left?b?o.left:o.right-p.width:b?Math.min(d.left-(h?14:0)+v.x,o.right-g):Math.max(o.left,d.left-g+(h?14:0)-v.x),O=this.above[a];!s.strictSide&&(O?d.top-(p.bottom-p.top)-v.yo.bottom)&&O==o.bottom-d.bottom>d.top-o.top&&(O=this.above[a]=!O);let w=(O?d.top-o.top:o.bottom-d.bottom)-f;if(wy&&e.topx&&(x=O?e.top-m-2-f:e.bottom+f+2);if("absolute"==this.position?(u.style.top=(x-e.parent.top)/i+"px",u.style.left=(y-e.parent.left)/r+"px"):(u.style.top=x/i+"px",u.style.left=y/r+"px"),h){let e=d.left+(b?v.x:-v.x)-(y+14-7);h.style.left=e/r+"px"}!0!==c.overlap&&l.push({left:y,top:x,right:$,bottom:x+m}),u.classList.toggle("cm-tooltip-above",O),u.classList.toggle("cm-tooltip-below",!O),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=G9}},{eventObservers:{scroll(){this.maybeMeasure()}}}),nee=q7.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),oee={x:0,y:0},ree=X3.define({enables:[tee,nee]}),iee=X3.define();class lee{static create(e){return new lee(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new U9(e,iee,(e=>this.createHostedView(e)))}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let o=n[e];if(void 0!==o)if(void 0===t)t=o;else if(t!==o)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const aee=ree.compute([iee],(e=>{let t=e.facet(iee).filter((e=>e));return 0===t.length?null:{pos:Math.min(...t.map((e=>e.pos))),end:Math.max(...t.map((e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos}))),create:lee.create,above:t[0].above,arrow:t.some((e=>e.arrow))}}));class see{constructor(e,t,n,o,r){this.view=e,this.source=t,this.field=n,this.setHover=o,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;en.bottom||t.xn.right+e.defaultCharacterWidth)return;let i=e.bidiSpans(e.state.doc.lineAt(o)).find((e=>e.from<=o&&e.to>=o)),l=i&&i.dir==x5.RTL?-1:1;r=t.x{this.pending==t&&(this.pending=null,n&&e.dispatch({effects:this.setHover.of(n)}))}),(t=>q5(e.state,t,"hover tooltip")))}else i&&e.dispatch({effects:this.setHover.of(i)})}get tooltip(){let e=this.view.plugin(tee),t=e?e.manager.tooltips.findIndex((e=>e.create==lee.create)):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:n,tooltip:o}=this;if(n&&o&&!function(e,t){let n=e.getBoundingClientRect();return t.clientX>=n.left-4&&t.clientX<=n.right+4&&t.clientY>=n.top-4&&t.clientY<=n.bottom+4}(o.dom,e)||this.pending){let{pos:o}=n||this.pending,r=null!==(t=null==n?void 0:n.end)&&void 0!==t?t:o;(o==r?this.view.posAtCoords(this.lastMove)==o:function(e,t,n,o,r,i){let l=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(l.left>o||l.rightr||Math.min(l.bottom,a)=t&&s<=n}(this.view,o,r,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of(null)})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function cee(e,t={}){let n=$4.define(),o=e4.define({create:()=>null,update(e,o){if(e&&(t.hideOnChange&&(o.docChanged||o.selection)||t.hideOn&&t.hideOn(o,e)))return null;if(e&&o.docChanged){let t=o.changes.mapPos(e.pos,-1,D3.TrackDel);if(null==t)return null;let n=Object.assign(Object.create(null),e);n.pos=t,null!=e.end&&(n.end=o.changes.mapPos(e.end)),e=n}for(let t of o.effects)t.is(n)&&(e=t.value),t.is(dee)&&(e=null);return e},provide:e=>iee.from(e)});return[o,n6.define((r=>new see(r,e,o,n,t.hoverTime||300))),aee]}function uee(e,t){let n=e.plugin(tee);if(!n)return null;let o=n.manager.tooltips.indexOf(t);return o<0?null:n.manager.tooltipViews[o]}const dee=$4.define(),pee=X3.define({combine(e){let t,n;for(let o of e)t=t||o.topContainer,n=n||o.bottomContainer;return{topContainer:t,bottomContainer:n}}});function hee(e,t){let n=e.plugin(fee),o=n?n.specs.indexOf(t):-1;return o>-1?n.panels[o]:null}const fee=n6.fromClass(class{constructor(e){this.input=e.state.facet(vee),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(pee);this.top=new gee(e,!0,t.topContainer),this.bottom=new gee(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(pee);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new gee(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new gee(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(vee);if(n!=this.input){let t=n.filter((e=>e)),o=[],r=[],i=[],l=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),l.push(t)):(t=this.panels[a],t.update&&t.update(e)),o.push(t),(t.top?r:i).push(t)}this.specs=t,this.panels=o,this.top.sync(r),this.bottom.sync(i);for(let e of l)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let o of this.panels)o.update&&o.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>q7.scrollMargins.of((t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}}))});class gee{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=mee(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=mee(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function mee(e){let t=e.nextSibling;return e.remove(),t}const vee=X3.define({enables:fee});class bee extends N4{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}bee.prototype.elementClass="",bee.prototype.toDOM=void 0,bee.prototype.mapMode=D3.TrackBefore,bee.prototype.startSide=bee.prototype.endSide=-1,bee.prototype.point=!0;const yee=X3.define(),Oee={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Q4.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},wee=X3.define();function xee(e){return[See(),wee.of(Object.assign(Object.assign({},Oee),e))]}const $ee=X3.define({combine:e=>e.some((e=>e))});function See(e){let t=[Cee];return e&&!1===e.fixed&&t.push($ee.of(!0)),t}const Cee=n6.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(wee).map((t=>new Tee(e,t)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!e.state.facet($ee),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,o=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(o<.8*(n.to-n.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet($ee)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let n=Q4.iter(this.view.state.facet(yee),this.view.viewport.from),o=[],r=this.gutters.map((e=>new Mee(e,this.view.viewport,-this.view.documentPadding.top)));for(let i of this.view.viewportLineBlocks)if(o.length&&(o=[]),Array.isArray(i.type)){let e=!0;for(let t of i.type)if(t.type==p5.Text&&e){Pee(n,o,t.from);for(let e of r)e.line(this.view,t,o);e=!1}else if(t.widget)for(let e of r)e.widget(this.view,t)}else if(i.type==p5.Text){Pee(n,o,i.from);for(let e of r)e.line(this.view,i,o)}else if(i.widget)for(let e of r)e.widget(this.view,i);for(let i of r)i.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(wee),n=e.state.facet(wee),o=e.docChanged||e.heightChanged||e.viewportChanged||!Q4.eq(e.startState.facet(yee),e.state.facet(yee),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(o=!0);else{o=!0;let r=[];for(let o of n){let n=t.indexOf(o);n<0?r.push(new Tee(this.view,o)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return o}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>q7.scrollMargins.of((t=>{let n=t.plugin(e);return n&&0!=n.gutters.length&&n.fixed?t.textDirection==x5.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}:null}))});function kee(e){return Array.isArray(e)?e:[e]}function Pee(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class Mee{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Q4.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:o}=this,r=(t.top-this.height)/e.scaleY,i=t.height/e.scaleY;if(this.i==o.elements.length){let t=new Iee(e,i,r,n);o.elements.push(t),o.dom.appendChild(t.dom)}else o.elements[this.i].update(e,i,r,n);this.height=t.bottom,this.i++}line(e,t,n){let o=[];Pee(this.cursor,o,t.from),n.length&&(o=o.concat(n));let r=this.gutter.config.lineMarker(e,t,o);r&&o.unshift(r);let i=this.gutter;(0!=o.length||i.config.renderEmptyElements)&&this.addElement(e,t,o)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Tee{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,(o=>{let r,i=o.target;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();r=(e.top+e.bottom)/2}else r=o.clientY;let l=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[n](e,l,o)&&o.preventDefault()}));this.markers=kee(t.markers(e)),t.initialSpacer&&(this.spacer=new Iee(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=kee(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!Q4.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class Iee{constructor(e,t,n,o){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,o)}update(e,t,n,o){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;nB4(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let o in t){let e=n[o],r=t[o];n[o]=e?(t,n,o)=>e(t,n,o)||r(t,n,o):r}return n}})});class Ree extends bee{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Dee(e,t){return e.state.facet(Aee).formatNumber(t,e.state)}const jee=wee.compute([Aee],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Eee),lineMarker:(e,t,n)=>n.some((e=>e.toDOM))?null:new Ree(Dee(e,e.state.doc.lineAt(t.from).number)),widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(Aee)!=e.state.facet(Aee),initialSpacer:e=>new Ree(Dee(e,Nee(e.state.doc.lines))),updateSpacer(e,t){let n=Dee(t.view,Nee(t.view.state.doc.lines));return n==e.number?e:new Ree(n)},domEventHandlers:e.facet(Aee).domEventHandlers})));function Bee(e={}){return[Aee.of(e),See(),jee]}function Nee(e){let t=9;for(;t{let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.head).from;r>n&&(n=r,t.push(zee.range(r)))}return Q4.of(t)})),Lee=1024;let Qee=0,Hee=class{constructor(e,t){this.from=e,this.to=t}};class Fee{constructor(e={}){this.id=Qee++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=Vee.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Fee.closedBy=new Fee({deserialize:e=>e.split(" ")}),Fee.openedBy=new Fee({deserialize:e=>e.split(" ")}),Fee.group=new Fee({deserialize:e=>e.split(" ")}),Fee.isolate=new Fee({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),Fee.contextHash=new Fee({perNode:!0}),Fee.lookAhead=new Fee({perNode:!0}),Fee.mounted=new Fee({perNode:!0});class Wee{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Fee.mounted.id]}}const Zee=Object.create(null);class Vee{constructor(e,t,n,o=0){this.name=e,this.props=t,this.id=n,this.flags=o}static define(e){let t=e.props&&e.props.length?Object.create(null):Zee,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),o=new Vee(e.name||"",t,e.id,n);if(e.props)for(let r of e.props)if(Array.isArray(r)||(r=r(o)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}return o}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(Fee.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let o of n.split(" "))t[o]=e[n];return e=>{for(let n=e.prop(Fee.group),o=-1;o<(n?n.length:0);o++){let r=t[o<0?e.name:n[o]];if(r)return r}}}}Vee.none=new Vee("",Object.create(null),0,8);class Xee{constructor(e){this.types=e;for(let t=0;t=t){let l=new rte(e.tree,e.overlay[0].from+i.from,-1,i);(r||(r=[o])).push(nte(l,t,n,!1))}}return r?cte(r):o}(this,e,t)}iterate(e){let{enter:t,leave:n,from:o=0,to:r=this.length}=e,i=e.mode||0,l=(i&Gee.IncludeAnonymous)>0;for(let a=this.cursor(i|Gee.IncludeAnonymous);;){let e=!1;if(a.from<=r&&a.to>=o&&(!l&&a.type.isAnonymous||!1!==t(a))){if(a.firstChild())continue;e=!0}for(;e&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;e=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:gte(Vee.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,n)=>new qee(this.type,e,t,n,this.propValues)),e.makeTree||((e,t,n)=>new qee(Vee.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:o,maxBufferLength:r=Lee,reused:i=[],minRepeatType:l=o.types.length}=e,a=Array.isArray(n)?new Jee(n,n.length):n,s=o.types,c=0,u=0;function d(e,t,n,b,y,O){let{id:w,start:x,end:$,size:S}=a,C=u;for(;S<0;){if(a.next(),-1==S){let t=i[w];return n.push(t),void b.push(x-e)}if(-3==S)return void(c=w);if(-4==S)return void(u=w);throw new RangeError(`Unrecognized record size: ${S}`)}let k,P,M=s[w],T=x-e;if($-x<=r&&(P=m(a.pos-t,y))){let t=new Uint16Array(P.size-P.skip),n=a.pos-P.size,r=t.length;for(;a.pos>n;)r=v(P.start,t,r);k=new ete(t,$-P.start,o),T=P.start-e}else{let e=a.pos-S;a.next();let t=[],n=[],o=w>=l?w:-1,i=0,s=$;for(;a.pos>e;)o>=0&&a.id==o&&a.size>=0?(a.end<=s-r&&(f(t,n,x,i,a.end,s,o,C),i=t.length,s=a.end),a.next()):O>2500?p(x,e,t,n):d(x,e,t,n,o,O+1);if(o>=0&&i>0&&i-1&&i>0){let e=h(M);k=gte(M,t,n,0,t.length,0,$-x,e,e)}else k=g(M,t,n,$-x,C-$)}n.push(k),b.push(T)}function p(e,t,n,i){let l=[],s=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:o}=a;if(o>4)a.next();else{if(c>-1&&t=0;e-=3)t[n++]=l[e],t[n++]=l[e+1]-r,t[n++]=l[e+2]-r,t[n++]=n;n.push(new ete(t,l[2]-r,o)),i.push(r-e)}}function h(e){return(t,n,o)=>{let r,i,l=0,a=t.length-1;if(a>=0&&(r=t[a])instanceof qee){if(!a&&r.type==e&&r.length==o)return r;(i=r.prop(Fee.lookAhead))&&(l=n[a]+r.length+i)}return g(e,t,n,o,l)}}function f(e,t,n,r,i,l,a,s){let c=[],u=[];for(;e.length>r;)c.push(e.pop()),u.push(t.pop()+n-i);e.push(g(o.types[a],c,u,l-i,s-l)),t.push(i-n)}function g(e,t,n,o,r=0,i){if(c){let e=[Fee.contextHash,c];i=i?[e].concat(i):[e]}if(r>25){let e=[Fee.lookAhead,r];i=i?[e].concat(i):[e]}return new qee(e,t,n,o,i)}function m(e,t){let n=a.fork(),o=0,i=0,s=0,c=n.end-r,u={size:0,start:0,skip:0};e:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=o,u.start=i,u.skip=s,s+=4,o+=4,n.next();continue}let a=n.pos-e;if(e<0||a=l?4:0,p=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size)break e;d+=4}else n.id>=l&&(d+=4);n.next()}i=p,o+=e,s+=d}return(t<0||o==e)&&(u.size=o,u.start=i,u.skip=s),u.size>4?u:void 0}function v(e,t,n){let{id:o,start:r,end:i,size:s}=a;if(a.next(),s>=0&&o4){let o=a.pos-(s-4);for(;a.pos>o;)n=v(e,t,n)}t[--n]=l,t[--n]=i-e,t[--n]=r-e,t[--n]=o}else-3==s?c=o:-4==s&&(u=o);return n}let b=[],y=[];for(;a.pos>0;)d(e.start||0,e.bufferStart||0,b,y,-1,0);let O=null!==(t=e.length)&&void 0!==t?t:b.length?y[0]+b[0].length:0;return new qee(s[e.topID],b.reverse(),y.reverse(),O)}(e)}}qee.empty=new qee(Vee.none,[],[],0);class Jee{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Jee(this.buffer,this.index)}}class ete{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Vee.none}toString(){let e=[];for(let t=0;t0));a=i[a+3]);return l}slice(e,t,n){let o=this.buffer,r=new Uint16Array(t-e),i=0;for(let l=e,a=0;l=t&&nt;case 1:return n<=t&&o>t;case 2:return o>t;case 4:return!0}}function nte(e,t,n,o){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;e!=s;e+=t){let s=l[e],c=a[e]+i.from;if(tte(o,n,c,c+s.length))if(s instanceof ete){if(r&Gee.ExcludeBuffers)continue;let l=s.findChild(0,s.buffer.length,t,n-c,o);if(l>-1)return new ste(new ate(i,s,e,c),null,l)}else if(r&Gee.IncludeAnonymous||!s.type.isAnonymous||pte(s)){let l;if(!(r&Gee.IgnoreMounts)&&(l=Wee.get(s))&&!l.overlay)return new rte(l.tree,c,e,i);let a=new rte(s,c,e,i);return r&Gee.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?s.children.length-1:0,t,n,o)}}if(r&Gee.IncludeAnonymous||!i.type.isAnonymous)return null;if(e=i.index>=0?i.index+t:t<0?-1:i._parent._tree.children.length,i=i._parent,!i)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let o;if(!(n&Gee.IgnoreOverlays)&&(o=Wee.get(this._tree))&&o.overlay){let n=e-this.from;for(let{from:e,to:r}of o.overlay)if((t>0?e<=n:e=n:r>n))return new rte(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ite(e,t,n,o){let r=e.cursor(),i=[];if(!r.firstChild())return i;if(null!=n)for(;!r.type.is(n);)if(!r.nextSibling())return i;for(;;){if(null!=o&&r.type.is(o))return i;if(r.type.is(t)&&i.push(r.node),!r.nextSibling())return null==o?i:[]}}function lte(e,t,n=t.length-1){for(let o=e.parent;n>=0;o=o.parent){if(!o)return!1;if(!o.type.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}class ate{constructor(e,t,n,o){this.parent=e,this.buffer=t,this.index=n,this.start=o}}class ste extends ote{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new ste(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&Gee.ExcludeBuffers)return null;let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new ste(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ste(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ste(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,o=this.index+4,r=n.buffer[this.index+3];if(r>o){let i=n.buffer[this.index+1];e.push(n.slice(o,r,i)),t.push(0)}return new qee(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function cte(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;in.from||o.to0){if(this.index-1)for(let o=t+e,r=e<0?-1:n._tree.children.length;o!=r;o+=e){let e=n._tree.children[o];if(this.mode&Gee.IncludeAnonymous||e instanceof ete||!e.type.isAnonymous||pte(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let i=e;i;i=i._parent)if(i.index==o){if(o==this.index)return i;t=i,n=r+1;break e}o=this.stack[--r]}for(let o=n;o=0;r--){if(r<0)return lte(this.node,e,o);let i=n[t.buffer[this.stack[r]]];if(!i.isAnonymous){if(e[o]&&e[o]!=i.name)return!1;o--}}return!0}}function pte(e){return e.children.some((e=>e instanceof ete||!e.type.isAnonymous||pte(e)))}const hte=new WeakMap;function fte(e,t){if(!e.isAnonymous||t instanceof ete||t.type!=e)return 1;let n=hte.get(t);if(null==n){n=1;for(let o of t.children){if(o.type!=e||!(o instanceof qee)){n=1;break}n+=fte(e,o)}hte.set(t,n)}return n}function gte(e,t,n,o,r,i,l,a,s){let c=0;for(let h=o;h=u)break;f+=t}if(c==r+1){if(f>u){let e=n[r];t(e.children,e.positions,0,e.children.length,o[r]+a);continue}d.push(n[r])}else{let t=o[c-1]+n[c-1].length-h;d.push(gte(e,n,o,r,c,h,t,null,s))}p.push(h+a-i)}}(t,n,o,r,0),(a||s)(d,p,l)}class mte{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let o=this.map.get(e);o||this.map.set(e,o=new Map),o.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof ste?this.setBuffer(e.context.buffer,e.index,t):e instanceof rte&&this.map.set(e.tree,t)}get(e){return e instanceof ste?this.getBuffer(e.context.buffer,e.index):e instanceof rte?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class vte{constructor(e,t,n,o,r=!1,i=!1){this.from=e,this.to=t,this.tree=n,this.offset=o,this.open=(r?1:0)|(i?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let o=[new vte(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&o.push(r);return o}static applyChanges(e,t,n=128){if(!t.length)return e;let o=[],r=1,i=e.length?e[0]:null;for(let l=0,a=0,s=0;;l++){let c=l=n)for(;i&&i.from=t.from||u<=t.to||s){let e=Math.max(t.from,a)-s,n=Math.min(t.to,u)-s;t=e>=n?null:new vte(e,n,t.tree,t.offset+s,l>0,!!c)}if(t&&o.push(t),i.to>u)break;i=rnew Hee(e.from,e.to))):[new Hee(0,0)]:[new Hee(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let o=this.startParse(e,t,n);for(;;){let e=o.advance();if(e)return e}}}class yte{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Fee({perNode:!0});let Ote=0;class wte{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=Ote++}static define(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let t=new wte([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new $te;return t=>t.modified.indexOf(e)>-1?t:$te.get(t.base||t,t.modified.concat(e).sort(((e,t)=>e.id-t.id)))}}let xte=0;class $te{constructor(){this.instances=[],this.id=xte++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find((n=>{return n.base==e&&(o=t,r=n.modified,o.length==r.length&&o.every(((e,t)=>e==r[t])));var o,r}));if(n)return n;let o=[],r=new wte(o,e,t);for(let l of t)l.instances.push(r);let i=function(e){let t=[[]];for(let n=0;nt.length-e.length))}(t);for(let l of e.set)if(!l.modified.length)for(let e of i)o.push($te.get(l,e));return r}}function Ste(e){let t=Object.create(null);for(let n in e){let o=e[n];Array.isArray(o)||(o=[o]);for(let e of n.split(" "))if(e){let n=[],r=2,i=e;for(let t=0;;){if("..."==i&&t>0&&t+3==e.length){r=1;break}let o=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(i);if(!o)throw new RangeError("Invalid path: "+e);if(n.push("*"==o[0]?"":'"'==o[0][0]?JSON.parse(o[0]):o[0]),t+=o[0].length,t==e.length)break;let l=e[t++];if(t==e.length&&"!"==l){r=0;break}if("/"!=l)throw new RangeError("Invalid path: "+e);i=e.slice(t)}let l=n.length-1,a=n[l];if(!a)throw new RangeError("Invalid path: "+e);let s=new kte(o,r,l>0?n.slice(0,l):null);t[a]=s.sort(t[a])}}return Cte.add(t)}const Cte=new Fee;class kte{constructor(e,t,n,o){this.tags=e,this.mode=t,this.context=n,this.next=o}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth{let t=r;for(let o of e)for(let e of o.set){let o=n[e.id];if(o){t=t?t+" "+o:o;break}}return t},scope:o}}function Mte(e,t,n,o=0,r=e.length){let i=new Tte(o,Array.isArray(t)?t:[t],n);i.highlightRange(e.cursor(),o,r,"",i.highlighters),i.flush(r)}kte.empty=new kte([],2,null);class Tte{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,o,r){let{type:i,from:l,to:a}=e;if(l>=n||a<=t)return;i.isTop&&(r=this.highlighters.filter((e=>!e.scope||e.scope(i))));let s=o,c=function(e){let t=e.type.prop(Cte);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||kte.empty,u=function(e,t){let n=null;for(let o of e){let e=o.style(t);e&&(n=n?n+" "+e:e)}return n}(r,c.tags);if(u&&(s&&(s+=" "),s+=u,1==c.mode&&(o+=(o?" ":"")+u)),this.startSpan(Math.max(t,l),s),c.opaque)return;let d=e.tree&&e.tree.prop(Fee.mounted);if(d&&d.overlay){let i=e.node.enter(d.overlay[0].from+l,1),c=this.highlighters.filter((e=>!e.scope||e.scope(d.tree.type))),u=e.firstChild();for(let p=0,h=l;;p++){let f=p=g)&&e.nextSibling()););if(!f||g>n)break;h=f.to+l,h>t&&(this.highlightRange(i.cursor(),Math.max(t,f.from+l),Math.min(n,h),"",c),this.startSpan(Math.min(n,h),s))}u&&e.parent()}else if(e.firstChild()){d&&(o="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,o,r),this.startSpan(Math.min(n,e.to),s)}}while(e.nextSibling());e.parent()}}}const Ite=wte.define,Ete=Ite(),Ate=Ite(),Rte=Ite(Ate),Dte=Ite(Ate),jte=Ite(),Bte=Ite(jte),Nte=Ite(jte),zte=Ite(),_te=Ite(zte),Lte=Ite(),Qte=Ite(),Hte=Ite(),Fte=Ite(Hte),Wte=Ite(),Zte={comment:Ete,lineComment:Ite(Ete),blockComment:Ite(Ete),docComment:Ite(Ete),name:Ate,variableName:Ite(Ate),typeName:Rte,tagName:Ite(Rte),propertyName:Dte,attributeName:Ite(Dte),className:Ite(Ate),labelName:Ite(Ate),namespace:Ite(Ate),macroName:Ite(Ate),literal:jte,string:Bte,docString:Ite(Bte),character:Ite(Bte),attributeValue:Ite(Bte),number:Nte,integer:Ite(Nte),float:Ite(Nte),bool:Ite(jte),regexp:Ite(jte),escape:Ite(jte),color:Ite(jte),url:Ite(jte),keyword:Lte,self:Ite(Lte),null:Ite(Lte),atom:Ite(Lte),unit:Ite(Lte),modifier:Ite(Lte),operatorKeyword:Ite(Lte),controlKeyword:Ite(Lte),definitionKeyword:Ite(Lte),moduleKeyword:Ite(Lte),operator:Qte,derefOperator:Ite(Qte),arithmeticOperator:Ite(Qte),logicOperator:Ite(Qte),bitwiseOperator:Ite(Qte),compareOperator:Ite(Qte),updateOperator:Ite(Qte),definitionOperator:Ite(Qte),typeOperator:Ite(Qte),controlOperator:Ite(Qte),punctuation:Hte,separator:Ite(Hte),bracket:Fte,angleBracket:Ite(Fte),squareBracket:Ite(Fte),paren:Ite(Fte),brace:Ite(Fte),content:zte,heading:_te,heading1:Ite(_te),heading2:Ite(_te),heading3:Ite(_te),heading4:Ite(_te),heading5:Ite(_te),heading6:Ite(_te),contentSeparator:Ite(zte),list:Ite(zte),quote:Ite(zte),emphasis:Ite(zte),strong:Ite(zte),link:Ite(zte),monospace:Ite(zte),strikethrough:Ite(zte),inserted:Ite(),deleted:Ite(),changed:Ite(),invalid:Ite(),meta:Wte,documentMeta:Ite(Wte),annotation:Ite(Wte),processingInstruction:Ite(Wte),definition:wte.defineModifier(),constant:wte.defineModifier(),function:wte.defineModifier(),standard:wte.defineModifier(),local:wte.defineModifier(),special:wte.defineModifier()};var Vte;Pte([{tag:Zte.link,class:"tok-link"},{tag:Zte.heading,class:"tok-heading"},{tag:Zte.emphasis,class:"tok-emphasis"},{tag:Zte.strong,class:"tok-strong"},{tag:Zte.keyword,class:"tok-keyword"},{tag:Zte.atom,class:"tok-atom"},{tag:Zte.bool,class:"tok-bool"},{tag:Zte.url,class:"tok-url"},{tag:Zte.labelName,class:"tok-labelName"},{tag:Zte.inserted,class:"tok-inserted"},{tag:Zte.deleted,class:"tok-deleted"},{tag:Zte.literal,class:"tok-literal"},{tag:Zte.string,class:"tok-string"},{tag:Zte.number,class:"tok-number"},{tag:[Zte.regexp,Zte.escape,Zte.special(Zte.string)],class:"tok-string2"},{tag:Zte.variableName,class:"tok-variableName"},{tag:Zte.local(Zte.variableName),class:"tok-variableName tok-local"},{tag:Zte.definition(Zte.variableName),class:"tok-variableName tok-definition"},{tag:Zte.special(Zte.variableName),class:"tok-variableName2"},{tag:Zte.definition(Zte.propertyName),class:"tok-propertyName tok-definition"},{tag:Zte.typeName,class:"tok-typeName"},{tag:Zte.namespace,class:"tok-namespace"},{tag:Zte.className,class:"tok-className"},{tag:Zte.macroName,class:"tok-macroName"},{tag:Zte.propertyName,class:"tok-propertyName"},{tag:Zte.operator,class:"tok-operator"},{tag:Zte.comment,class:"tok-comment"},{tag:Zte.meta,class:"tok-meta"},{tag:Zte.invalid,class:"tok-invalid"},{tag:Zte.punctuation,class:"tok-punctuation"}]);const Xte=new Fee;function Yte(e){return X3.define({combine:e?t=>t.concat(e):void 0})}const Kte=new Fee;class Gte{constructor(e,t,n=[],o=""){this.data=e,this.name=o,j4.prototype.hasOwnProperty("tree")||Object.defineProperty(j4.prototype,"tree",{get(){return Jte(this)}}),this.parser=t,this.extension=[sne.of(this),j4.languageData.of(((e,t,n)=>{let o=Ute(e,t,n),r=o.type.prop(Xte);if(!r)return[];let i=e.facet(r),l=o.type.prop(Kte);if(l){let r=o.resolve(t-o.from,n);for(let t of l)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(i)}}return i}))].concat(n)}isActiveAt(e,t,n=-1){return Ute(e,t,n).type.prop(Xte)==this.data}findRegions(e){let t=e.facet(sne);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],o=(e,t)=>{if(e.prop(Xte)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(Fee.mounted);if(r){if(r.tree.prop(Xte)==this.data){if(r.overlay)for(let e of r.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(r.overlay){let e=n.length;if(o(r.tree,r.overlay[0].from+t),n.length>e)return}}for(let n=0;ne.isTop?t:void 0))]}),e.name)}configure(e,t){return new qte(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Jte(e){let t=e.field(Gte.state,!1);return t?t.tree:qee.empty}class ene{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let tne=null;class nne{constructor(e,t,n=[],o,r,i,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=o,this.treeLen=r,this.viewport=i,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new nne(e,t,[],qee.empty,0,n,[],null)}startParse(){return this.parser.startParse(new ene(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=qee.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(vte.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=tne;tne=this;try{return e()}finally{tne=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=one(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:o,treeLen:r,viewport:i,skipped:l}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,n,o,r)=>t.push({fromA:e,toA:n,fromB:o,toB:r}))),n=vte.applyChanges(n,t),o=qee.empty,r=0,i={from:e.mapPos(i.from,-1),to:e.mapPos(i.to,1)},this.skipped.length){l=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),o=e.mapPos(t.to,-1);ne.from&&(this.fragments=one(this.fragments,t,o),this.skipped.splice(n--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends bte{createParse(t,n,o){let r=o[0].from,i=o[o.length-1].to;return{parsedPos:r,advance(){let t=tne;if(t){for(let e of o)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=i,new qee(Vee.none,[],[],i-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return tne}}function one(e,t,n){return vte.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class rne{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new rne(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=nne.create(e.facet(sne).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new rne(n)}}Gte.state=e4.define({create:rne.init,update(e,t){for(let n of t.effects)if(n.is(Gte.setState))return n.value;return t.startState.facet(sne)!=t.state.facet(sne)?rne.init(t.state):e.apply(t)}});let ine=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(ine=e=>{let t=-1,n=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const lne="undefined"!=typeof navigator&&(null===(Vte=navigator.scheduling)||void 0===Vte?void 0:Vte.isInputPending)?()=>navigator.scheduling.isInputPending():null,ane=n6.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Gte.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Gte.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=ine(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndo+1e3,a=r.context.work((()=>lne&&lne()||Date.now()>i),o+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Gte.setState.of(new rne(r.context))})),this.chunkBudget>0&&(!a||l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>q5(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),sne=X3.define({combine:e=>e.length?e[0]:null,enables:e=>[Gte.state,ane,q7.contentAttributes.compute([e],(t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}}))]});class cne{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const une=X3.define(),dne=X3.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some((e=>e!=t[0])))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function pne(e){let t=e.facet(dne);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function hne(e,t){let n="",o=e.tabSize,r=e.facet(dne)[0];if("\t"==r){for(;t>=o;)n+="\t",t-=o;r=" "}for(let i=0;i=t?function(e,t,n){let o=t.resolveStack(n),r=o.node.enterUnfinishedNodesBefore(n);if(r!=o.node){let e=[];for(let t=r;t!=o.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)o={node:e[t],next:o}}return vne(o,e,n)}(e,n,t):null}class gne{constructor(e,t={}){this.state=e,this.options=t,this.unit=pne(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:o,simulateDoubleBreak:r}=this.options;return null!=o&&o>=n.from&&o<=n.to?r&&o==e?{text:"",from:e}:(t<0?o-1&&(r+=i-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return J4(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:o}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(o);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const mne=new Fee;function vne(e,t,n){for(let o=e;o;o=o.next){let e=bne(o.node);if(e)return e(One.create(t,n,o))}return 0}function bne(e){let t=e.type.prop(mne);if(t)return t;let n,o=e.firstChild;if(o&&(n=o.type.prop(Fee.closedBy))){let t=e.lastChild,o=t&&n.indexOf(t.name)>-1;return e=>$ne(e,!0,1,void 0,o&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?yne:null}function yne(){return 0}class One extends gne{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new One(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(wne(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return vne(this.context.next,this.base,this.pos)}}function wne(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function xne({closing:e,align:t=!0,units:n=1}){return o=>$ne(o,t,n,e)}function $ne(e,t,n,o,r){let i=e.textAfter,l=i.match(/^\s*/)[0].length,a=o&&i.slice(l,l+o.length)==o||r==e.pos+l,s=t?function(e){let t=e.node,n=t.childAfter(t.from),o=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,i=e.state.doc.lineAt(n.from),l=null==r||r<=i.from?i.to:Math.min(i.to,r);for(let a=n.to;;){let e=t.childAfter(a);if(!e||e==o)return null;if(!e.type.isSkipped)return e.from{let o=e&&e.test(n.textAfter);return n.baseIndent+(o?0:t*n.unit)}}const Cne=X3.define(),kne=new Fee;function Pne(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Mne(e,t,n){for(let o of e.facet(Cne)){let r=o(e,t,n);if(r)return r}return function(e,t,n){let o=Jte(e);if(o.lengthn)continue;if(r&&l.from=t&&o.to>n&&(r=o)}}return r}(e,t,n)}function Tne(e,t){let n=t.mapPos(e.from,1),o=t.mapPos(e.to,-1);return n>=o?void 0:{from:n,to:o}}const Ine=$4.define({map:Tne}),Ene=$4.define({map:Tne});function Ane(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some((e=>e.from<=n&&e.to>=n))||t.push(e.lineBlockAt(n));return t}const Rne=e4.define({create:()=>h5.none,update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(Ine)&&!jne(e,n.value.from,n.value.to)){let{preparePlaceholder:o}=t.state.facet(Lne),r=o?h5.replace({widget:new Wne(o(t.state,n.value))}):Fne;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(Ene)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:o}=t.selection.main;e.between(o,o,((e,t)=>{eo&&(n=!0)})),n&&(e=e.update({filterFrom:o,filterTo:o,filter:(e,t)=>t<=o||e>=o}))}return e},provide:e=>q7.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,((e,t)=>{n.push(e,t)})),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{(!r||r.from>e)&&(r={from:e,to:t})})),r}function jne(e,t,n){let o=!1;return e.between(t,t,((e,r)=>{e==t&&r==n&&(o=!0)})),o}function Bne(e,t){return e.field(Rne,!1)?t:t.concat($4.appendConfig.of(Qne()))}function Nne(e,t,n=!0){let o=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return q7.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${o} ${e.state.phrase("to")} ${r}.`)}const zne=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of Ane(e)){let n=Mne(e.state,t.from,t.to);if(n)return e.dispatch({effects:Bne(e.state,[Ine.of(n),Nne(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(Rne,!1))return!1;let t=[];for(let n of Ane(e)){let o=Dne(e.state,n.from,n.to);o&&t.push(Ene.of(o),Nne(e,o,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let o=0;o{let t=e.state.field(Rne,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,((e,t)=>{n.push(Ene.of({from:e,to:t}))})),e.dispatch({effects:n}),!0}}],_ne={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Lne=X3.define({combine:e=>B4(e,_ne)});function Qne(e){let t=[Rne,Yne];return e&&t.push(Lne.of(e)),t}function Hne(e,t){let{state:n}=e,o=n.facet(Lne),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),o=Dne(e.state,n.from,n.to);o&&e.dispatch({effects:Ene.of(o)}),t.preventDefault()};if(o.placeholderDOM)return o.placeholderDOM(e,r,t);let i=document.createElement("span");return i.textContent=o.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}const Fne=h5.replace({widget:new class extends d5{toDOM(e){return Hne(e,null)}}});class Wne extends d5{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Hne(e,this.value)}}const Zne={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Vne extends bee{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function Xne(e={}){let t=Object.assign(Object.assign({},Zne),e),n=new Vne(t,!0),o=new Vne(t,!1),r=n6.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(sne)!=e.state.facet(sne)||e.startState.field(Rne,!1)!=e.state.field(Rne,!1)||Jte(e.startState)!=Jte(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new H4;for(let r of e.viewportLineBlocks){let i=Dne(e.state,r.from,r.to)?o:Mne(e.state,r.from,r.to)?n:null;i&&t.add(r.from,r.from,i)}return t.finish()}}),{domEventHandlers:i}=t;return[r,xee({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||Q4.empty},initialSpacer:()=>new Vne(t,!1),domEventHandlers:Object.assign(Object.assign({},i),{click:(e,t,n)=>{if(i.click&&i.click(e,t,n))return!0;let o=Dne(e.state,t.from,t.to);if(o)return e.dispatch({effects:Ene.of(o)}),!0;let r=Mne(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:Ine.of(r)}),!0)}})}),Qne()]}const Yne=q7.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Kne{constructor(e,t){let n;function o(e){let t=r8.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?o(t.all):void 0,i=t.scope;this.scope=i instanceof Gte?e=>e.prop(Xte)==i.data:i?e=>e==i:void 0,this.style=Pte(e.map((e=>({tag:e.tag,class:e.class||o(Object.assign({},e,{tag:null}))}))),{all:r}).style,this.module=n?new r8(n):null,this.themeType=t.themeType}static define(e,t){return new Kne(e,t||{})}}const Gne=X3.define(),Une=X3.define({combine:e=>e.length?[e[0]]:null});function qne(e){let t=e.facet(Gne);return t.length?t:e.facet(Une)}function Jne(e,t){let n,o=[toe];return e instanceof Kne&&(e.module&&o.push(q7.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?o.push(Une.of(e)):n?o.push(Gne.computeN([q7.darkTheme],(t=>t.facet(q7.darkTheme)==("dark"==n)?[e]:[]))):o.push(Gne.of(e)),o}class eoe{constructor(e){this.markCache=Object.create(null),this.tree=Jte(e.state),this.decorations=this.buildDeco(e,qne(e.state))}update(e){let t=Jte(e.state),n=qne(e.state),o=n!=qne(e.startState);t.length{n.add(e,t,this.markCache[o]||(this.markCache[o]=h5.mark({class:o})))}),o,r);return n.finish()}}const toe=l4.high(n6.fromClass(eoe,{decorations:e=>e.decorations})),noe=Kne.define([{tag:Zte.meta,color:"#404740"},{tag:Zte.link,textDecoration:"underline"},{tag:Zte.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Zte.emphasis,fontStyle:"italic"},{tag:Zte.strong,fontWeight:"bold"},{tag:Zte.strikethrough,textDecoration:"line-through"},{tag:Zte.keyword,color:"#708"},{tag:[Zte.atom,Zte.bool,Zte.url,Zte.contentSeparator,Zte.labelName],color:"#219"},{tag:[Zte.literal,Zte.inserted],color:"#164"},{tag:[Zte.string,Zte.deleted],color:"#a11"},{tag:[Zte.regexp,Zte.escape,Zte.special(Zte.string)],color:"#e40"},{tag:Zte.definition(Zte.variableName),color:"#00f"},{tag:Zte.local(Zte.variableName),color:"#30a"},{tag:[Zte.typeName,Zte.namespace],color:"#085"},{tag:Zte.className,color:"#167"},{tag:[Zte.special(Zte.variableName),Zte.macroName],color:"#256"},{tag:Zte.definition(Zte.propertyName),color:"#00c"},{tag:Zte.comment,color:"#940"},{tag:Zte.invalid,color:"#f00"}]),ooe=q7.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),roe="()[]{}",ioe=X3.define({combine:e=>B4(e,{afterCursor:!0,brackets:roe,maxScanDistance:1e4,renderMatch:soe})}),loe=h5.mark({class:"cm-matchingBracket"}),aoe=h5.mark({class:"cm-nonmatchingBracket"});function soe(e){let t=[],n=e.matched?loe:aoe;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const coe=[e4.define({create:()=>h5.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],o=t.state.facet(ioe);for(let r of t.state.selection.ranges){if(!r.empty)continue;let e=foe(t.state,r.head,-1,o)||r.head>0&&foe(t.state,r.head-1,1,o)||o.afterCursor&&(foe(t.state,r.head,1,o)||r.headq7.decorations.from(e)}),ooe];function uoe(e={}){return[ioe.of(e),coe]}const doe=new Fee;function poe(e,t,n){let o=e.prop(t<0?Fee.openedBy:Fee.closedBy);if(o)return o;if(1==e.name.length){let o=n.indexOf(e.name);if(o>-1&&o%2==(t<0?1:0))return[n[o+t]]}return null}function hoe(e){let t=e.type.prop(doe);return t?t(e.node):e}function foe(e,t,n,o={}){let r=o.maxScanDistance||1e4,i=o.brackets||roe,l=Jte(e),a=l.resolveInner(t,n);for(let s=a;s;s=s.parent){let e=poe(s.type,n,i);if(e&&s.from0?t>=o.from&&to.from&&t<=o.to))return goe(0,0,n,s,o,e,i)}}return function(e,t,n,o,r,i,l){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),s=l.indexOf(a);if(s<0||s%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let p=0;!u.next().done&&p<=i;){let e=u.value;n<0&&(p+=e.length);let i=t+p*n;for(let t=n>0?0:e.length-1,a=n>0?e.length:-1;t!=a;t+=n){let a=l.indexOf(e[t]);if(!(a<0||o.resolveInner(i+t,1).type!=r))if(a%2==0==n>0)d++;else{if(1==d)return{start:c,end:{from:i+t,to:i+t+1},matched:a>>1==s>>1};d--}}n>0&&(p+=e.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,l,a.type,r,i)}function goe(e,t,n,o,r,i,l){let a=o.parent,s={from:r.from,to:r.to},c=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(o.from):u.childAfter(o.to)))do{if(n<0?u.to<=o.from:u.from>=o.to){if(0==c&&i.indexOf(u.type.name)>-1&&u.from-1||boe.push(e)}function xoe(e,t){let n=[];for(let a of t.split(" ")){let t=[];for(let n of a.split(".")){let o=e[n]||Zte[n];o?"function"==typeof o?t.length?t=t.map(o):woe(n):t.length?woe(n):t=Array.isArray(o)?o:[o]:woe(n)}for(let e of t)n.push(e)}if(!n.length)return 0;let o=t.replace(/ /g,"_"),r=o+" "+n.map((e=>e.id)),i=yoe[r];if(i)return i.id;let l=yoe[r]=Vee.define({id:voe.length,name:o,props:[Ste({[o]:n})]});return voe.push(l),l.id}function $oe(e,t){return({state:n,dispatch:o})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(o(n.update(r)),!0)}}x5.RTL,x5.LTR;const Soe=$oe(Toe,0),Coe=$oe(Moe,0),koe=$oe(((e,t)=>Moe(e,t,function(e){let t=[];for(let n of e.selection.ranges){let o=e.doc.lineAt(n.from),r=n.to<=o.to?o:e.doc.lineAt(n.to),i=t.length-1;i>=0&&t[i].to>o.from?t[i].to=r.to:t.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:r.to})}return t}(t))),0);function Poe(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function Moe(e,t,n=t.selection.ranges){let o=n.map((e=>Poe(t,e.from).block));if(!o.every((e=>e)))return null;let r=n.map(((e,n)=>function(e,{open:t,close:n},o,r){let i,l,a=e.sliceDoc(o-50,o),s=e.sliceDoc(r,r+50),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(s)[0].length,d=a.length-c;if(a.slice(d-t.length,d)==t&&s.slice(u,u+n.length)==n)return{open:{pos:o-c,margin:c&&1},close:{pos:r+u,margin:u&&1}};r-o<=100?i=l=e.sliceDoc(o,r):(i=e.sliceDoc(o,o+50),l=e.sliceDoc(r-50,r));let p=/^\s*/.exec(i)[0].length,h=/\s*$/.exec(l)[0].length,f=l.length-h-n.length;return i.slice(p,p+t.length)==t&&l.slice(f,f+n.length)==n?{open:{pos:o+p+t.length,margin:/\s/.test(i.charAt(p+t.length))?1:0},close:{pos:r-h-n.length,margin:/\s/.test(l.charAt(f-1))?1:0}}:null}(t,o[n],e.from,e.to)));if(2!=e&&!r.every((e=>e)))return{changes:t.changes(n.map(((e,t)=>r[t]?[]:[{from:e.from,insert:o[t].open+" "},{from:e.to,insert:" "+o[t].close}])))};if(1!=e&&r.some((e=>e))){let e=[];for(let t,n=0;nr&&(i==l||l>s.from)){r=s.from;let e=/^\s*/.exec(s.text)[0].length,t=e==s.length,i=s.text.slice(e,e+a.length)==a?e:-1;ee.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:r,indent:i,empty:l,single:a}of o)!a&&l||e.push({from:t.from+i,insert:r+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&o.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:n,token:r}of o)if(n>=0){let o=t.from+n,i=o+r.length;" "==t.text[i-t.from]&&i++,e.push({from:o,to:i})}return{changes:e}}return null}const Ioe=O4.define(),Eoe=O4.define(),Aoe=X3.define(),Roe=X3.define({combine:e=>B4(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,o)=>e(n,o)||t(n,o)})}),Doe=e4.define({create:()=>Goe.empty,update(e,t){let n=t.state.facet(Roe),o=t.annotation(Ioe);if(o){let r=Qoe.fromTransaction(t,o.selection),i=o.side,l=0==i?e.undone:e.done;return l=r?Hoe(l,l.length,n.minDepth,r):Zoe(l,t.startState.selection),new Goe(0==i?o.rest:l,0==i?l:o.rest)}let r=t.annotation(Eoe);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(S4.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let i=Qoe.fromTransaction(t),l=t.annotation(S4.time),a=t.annotation(S4.userEvent);return i?e=e.addChanges(i,l,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,a,n.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new Goe(e.done.map(Qoe.fromJSON),e.undone.map(Qoe.fromJSON))});function joe(e={}){return[Doe,Roe.of(e),q7.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?Noe:"historyRedo"==e.inputType?zoe:null;return!!n&&(e.preventDefault(),n(t))}})]}function Boe(e,t){return function({state:n,dispatch:o}){if(!t&&n.readOnly)return!1;let r=n.field(Doe,!1);if(!r)return!1;let i=r.pop(e,n,t);return!!i&&(o(i),!0)}}const Noe=Boe(0,!1),zoe=Boe(1,!1),_oe=Boe(0,!0),Loe=Boe(1,!0);class Qoe{constructor(e,t,n,o,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=o,this.selectionsAfter=r}setSelAfter(e){return new Qoe(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new Qoe(e.changes&&B3.fromJSON(e.changes),[],e.mapped&&j3.fromJSON(e.mapped),e.startSelection&&W3.fromJSON(e.startSelection),e.selectionsAfter.map(W3.fromJSON))}static fromTransaction(e,t){let n=Woe;for(let o of e.startState.facet(Aoe)){let t=o(e);t.length&&(n=n.concat(t))}return!n.length&&e.changes.empty?null:new Qoe(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Woe)}static selection(e){return new Qoe(void 0,Woe,void 0,void 0,e)}}function Hoe(e,t,n,o){let r=t+1>n+20?t-n-1:0,i=e.slice(r,t);return i.push(o),i}function Foe(e,t){return e.length?t.length?e.concat(t):e:t}const Woe=[];function Zoe(e,t){if(e.length){let n=e[e.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return o.length&&o[o.length-1].eq(t)?e:(o.push(t),Hoe(e,e.length-1,1e9,n.setSelAfter(o)))}return[Qoe.selection([t])]}function Voe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Xoe(e,t){if(!e.length)return e;let n=e.length,o=Woe;for(;n;){let r=Yoe(e[n-1],t,o);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,o=r.selectionsAfter}return o.length?[Qoe.selection(o)]:Woe}function Yoe(e,t,n){let o=Foe(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):Woe,n);if(!e.changes)return Qoe.selection(o);let r=e.changes.map(t),i=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(i):i;return new Qoe(r,$4.mapEffects(e.effects,t),l,e.startSelection.map(i),o)}const Koe=/^(input\.type|delete)($|\.)/;class Goe{constructor(e,t,n=0,o=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=o}isolate(){return this.prevTime?new Goe(this.done,this.undone):this}addChanges(e,t,n,o,r){let i=this.done,l=i[i.length-1];return i=l&&l.changes&&!l.changes.empty&&e.changes&&(!n||Koe.test(n))&&(!l.selectionsAfter.length&&t-this.prevTimen.push(e,t))),t.iterChangedRanges(((e,t,r,i)=>{for(let l=0;l=e&&r<=t&&(o=!0)}})),o}(l.changes,e.changes))||"input.type.compose"==n)?Hoe(i,i.length-1,o.minDepth,new Qoe(e.changes.compose(l.changes),Foe(e.effects,l.effects),l.mapped,l.startSelection,Woe)):Hoe(i,i.length,o.minDepth,e),new Goe(i,Woe,t,n)}addSelection(e,t,n,o){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Woe;return r.length>0&&t-this.prevTimee.empty!=l.ranges[t].empty)).length)?this:new Goe(Zoe(this.done,e),this.undone,t,n);var i,l}addMapping(e){return new Goe(Xoe(this.done,e),Xoe(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let o=0==e?this.done:this.undone;if(0==o.length)return null;let r=o[o.length-1],i=r.selectionsAfter[0]||t.selection;if(n&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:Ioe.of({side:e,rest:Voe(o),selection:i}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let n=1==o.length?Woe:o.slice(0,o.length-1);return r.mapped&&(n=Xoe(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:Ioe.of({side:e,rest:n,selection:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}Goe.empty=new Goe(Woe,Woe);const Uoe=[{key:"Mod-z",run:Noe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:zoe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:zoe,preventDefault:!0},{key:"Mod-u",run:_oe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Loe,preventDefault:!0}];function qoe(e,t){return W3.create(e.ranges.map(t),e.mainIndex)}function Joe(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function ere({state:e,dispatch:t},n){let o=qoe(e.selection,n);return!o.eq(e.selection,!0)&&(t(Joe(e,o)),!0)}function tre(e,t){return W3.cursor(t?e.to:e.from)}function nre(e,t){return ere(e,(n=>n.empty?e.moveByChar(n,t):tre(n,t)))}function ore(e){return e.textDirectionAt(e.state.selection.main.head)==x5.LTR}const rre=e=>nre(e,!ore(e)),ire=e=>nre(e,ore(e));function lre(e,t){return ere(e,(n=>n.empty?e.moveByGroup(n,t):tre(n,t)))}function are(e,t,n){if(t.type.prop(n))return!0;let o=t.to-t.from;return o&&(o>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function sre(e,t,n){let o,r,i=Jte(e).resolveInner(t.head),l=n?Fee.closedBy:Fee.openedBy;for(let a=t.head;;){let t=n?i.childAfter(a):i.childBefore(a);if(!t)break;are(e,t,l)?i=t:a=n?t.to:t.from}return r=i.type.prop(l)&&(o=n?foe(e,i.from,1):foe(e,i.to,-1))&&o.matched?n?o.end.to:o.end.from:n?i.to:i.from,W3.cursor(r,n?-1:1)}function cre(e,t){return ere(e,(n=>{if(!n.empty)return tre(n,t);let o=e.moveVertically(n,t);return o.head!=n.head?o:e.moveToLineBoundary(n,t)}))}const ure=e=>cre(e,!1),dre=e=>cre(e,!0);function pre(e){let t,n=e.scrollDOM.clientHeightn.empty?e.moveVertically(n,t,o.height):tre(n,t)));if(i.eq(r.selection))return!1;if(o.selfScroll){let t=e.coordsAtPos(r.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),a=l.top+o.marginTop,s=l.bottom-o.marginBottom;t&&t.top>a&&t.bottomhre(e,!1),gre=e=>hre(e,!0);function mre(e,t,n){let o=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?o.to:o.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==o.from&&o.length){let n=/^\s*/.exec(e.state.sliceDoc(o.from,Math.min(o.from+100,o.to)))[0].length;n&&t.head!=o.from+n&&(r=W3.cursor(o.from+n))}return r}function vre(e,t){let n=qoe(e.state.selection,(e=>{let n=t(e);return W3.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)}));return!n.eq(e.state.selection)&&(e.dispatch(Joe(e.state,n)),!0)}function bre(e,t){return vre(e,(n=>e.moveByChar(n,t)))}const yre=e=>bre(e,!ore(e)),Ore=e=>bre(e,ore(e));function wre(e,t){return vre(e,(n=>e.moveByGroup(n,t)))}function xre(e,t){return vre(e,(n=>e.moveVertically(n,t)))}const $re=e=>xre(e,!1),Sre=e=>xre(e,!0);function Cre(e,t){return vre(e,(n=>e.moveVertically(n,t,pre(e).height)))}const kre=e=>Cre(e,!1),Pre=e=>Cre(e,!0),Mre=({state:e,dispatch:t})=>(t(Joe(e,{anchor:0})),!0),Tre=({state:e,dispatch:t})=>(t(Joe(e,{anchor:e.doc.length})),!0),Ire=({state:e,dispatch:t})=>(t(Joe(e,{anchor:e.selection.main.anchor,head:0})),!0),Ere=({state:e,dispatch:t})=>(t(Joe(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function Are(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:o}=e,r=o.changeByRange((o=>{let{from:r,to:i}=o;if(r==i){let l=t(o);lr&&(n="delete.forward",l=Rre(e,l,!0)),r=Math.min(r,l),i=Math.max(i,l)}else r=Rre(e,r,!1),i=Rre(e,i,!0);return r==i?{range:o}:{changes:{from:r,to:i},range:W3.cursor(r,rt(e))))o.between(t,t,((e,o)=>{et&&(t=n?o:e)}));return t}const Dre=(e,t)=>Are(e,(n=>{let o,r,i=n.from,{state:l}=e,a=l.doc.lineAt(i);if(!t&&i>a.from&&iDre(e,!1),Bre=e=>Dre(e,!0),Nre=(e,t)=>Are(e,(n=>{let o=n.head,{state:r}=e,i=r.doc.lineAt(o),l=r.charCategorizer(o);for(let e=null;;){if(o==(t?i.to:i.from)){o==n.head&&i.number!=(t?r.doc.lines:1)&&(o+=t?1:-1);break}let a=C3(i.text,o-i.from,t)+i.from,s=i.text.slice(Math.min(o,a)-i.from,Math.max(o,a)-i.from),c=l(s);if(null!=e&&c!=e)break;" "==s&&o==n.head||(e=c),o=a}return o})),zre=e=>Nre(e,!1);function _re(e){let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.from),i=e.doc.lineAt(o.to);if(o.empty||o.to!=i.from||(i=e.doc.lineAt(o.to-1)),n>=r.number){let e=t[t.length-1];e.to=i.to,e.ranges.push(o)}else t.push({from:r.from,to:i.to,ranges:[o]});n=i.number+1}return t}function Lre(e,t,n){if(e.readOnly)return!1;let o=[],r=[];for(let i of _re(e)){if(n?i.to==e.doc.length:0==i.from)continue;let t=e.doc.lineAt(n?i.to+1:i.from-1),l=t.length+1;if(n){o.push({from:i.to,to:t.to},{from:i.from,insert:t.text+e.lineBreak});for(let t of i.ranges)r.push(W3.range(Math.min(e.doc.length,t.anchor+l),Math.min(e.doc.length,t.head+l)))}else{o.push({from:t.from,to:i.from},{from:i.to,insert:e.lineBreak+t.text});for(let e of i.ranges)r.push(W3.range(e.anchor-l,e.head-l))}}return!!o.length&&(t(e.update({changes:o,scrollIntoView:!0,selection:W3.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function Qre(e,t,n){if(e.readOnly)return!1;let o=[];for(let r of _re(e))n?o.push({from:r.from,insert:e.doc.slice(r.from,r.to)+e.lineBreak}):o.push({from:r.to,insert:e.lineBreak+e.doc.slice(r.from,r.to)});return t(e.update({changes:o,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Hre=Fre(!1);function Fre(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let o=t.changeByRange((n=>{let{from:o,to:r}=n,i=t.doc.lineAt(o),l=!e&&o==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,o=Jte(e).resolveInner(t),r=o.childBefore(t),i=o.childAfter(t);return r&&i&&r.to<=t&&i.from>=t&&(n=r.type.prop(Fee.closedBy))&&n.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,o);e&&(o=r=(r<=i.to?i:t.doc.lineAt(r)).to);let a=new gne(t,{simulateBreak:o,simulateDoubleBreak:!!l}),s=fne(a,o);for(null==s&&(s=J4(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));ri.from&&o{let r=[];for(let l=o.from;l<=o.to;){let i=e.doc.lineAt(l);i.number>n&&(o.empty||o.to>i.from)&&(t(i,r,o),n=i.number),l=i.to+1}let i=e.changes(r);return{changes:r,range:W3.range(i.mapPos(o.anchor,1),i.mapPos(o.head,1))}}))}const Zre=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Wre(e,((t,n)=>{n.push({from:t.from,insert:e.facet(dne)})})),{userEvent:"input.indent"})),!0),Vre=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Wre(e,((t,n)=>{let o=/^\s*/.exec(t.text)[0];if(!o)return;let r=J4(o,e.tabSize),i=0,l=hne(e,Math.max(0,r-pne(e)));for(;iere(e,(t=>sre(e.state,t,!ore(e)))),shift:e=>vre(e,(t=>sre(e.state,t,!ore(e))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>ere(e,(t=>sre(e.state,t,ore(e)))),shift:e=>vre(e,(t=>sre(e.state,t,ore(e))))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Lre(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>Qre(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Lre(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>Qre(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,o=null;return n.ranges.length>1?o=W3.create([n.main]):n.main.empty||(o=W3.create([W3.cursor(n.main.head)])),!!o&&(t(Joe(e,o)),!0)}},{key:"Mod-Enter",run:Fre(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=_re(e).map((({from:t,to:n})=>W3.range(t,Math.min(n+1,e.doc.length))));return t(e.update({selection:W3.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=qoe(e.selection,(t=>{var n;for(let o=Jte(e).resolveStack(t.from,1);o;o=o.next){let{node:e}=o;if((e.from=t.to||e.to>t.to&&e.from<=t.from)&&(null===(n=e.parent)||void 0===n?void 0:n.parent))return W3.range(e.to,e.from)}return t}));return t(Joe(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:Vre},{key:"Mod-]",run:Zre},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),o=new gne(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=Wre(e,((t,r,i)=>{let l=fne(o,t.from);if(null==l)return;/\S/.test(t.text)||(l=0);let a=/^\s*/.exec(t.text)[0],s=hne(e,l);(a!=s||i.from{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(_re(t).map((({from:e,to:n})=>(e>0?e--:ne.moveVertically(t,!0))).map(n);return e.dispatch({changes:n,selection:o,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let o=!1,r=qoe(e.selection,(t=>{let r=foe(e,t.head,-1)||foe(e,t.head,1)||t.head>0&&foe(e,t.head-1,1)||t.head{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),o=Poe(e.state,n.from);return o.line?Soe(e):!!o.block&&koe(e)}},{key:"Alt-A",run:Coe}].concat([{key:"ArrowLeft",run:rre,shift:yre,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>lre(e,!ore(e)),shift:e=>wre(e,!ore(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>ere(e,(t=>mre(e,t,!ore(e)))),shift:e=>vre(e,(t=>mre(e,t,!ore(e)))),preventDefault:!0},{key:"ArrowRight",run:ire,shift:Ore,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>lre(e,ore(e)),shift:e=>wre(e,ore(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>ere(e,(t=>mre(e,t,ore(e)))),shift:e=>vre(e,(t=>mre(e,t,ore(e)))),preventDefault:!0},{key:"ArrowUp",run:ure,shift:$re,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Mre,shift:Ire},{mac:"Ctrl-ArrowUp",run:fre,shift:kre},{key:"ArrowDown",run:dre,shift:Sre,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Tre,shift:Ere},{mac:"Ctrl-ArrowDown",run:gre,shift:Pre},{key:"PageUp",run:fre,shift:kre},{key:"PageDown",run:gre,shift:Pre},{key:"Home",run:e=>ere(e,(t=>mre(e,t,!1))),shift:e=>vre(e,(t=>mre(e,t,!1))),preventDefault:!0},{key:"Mod-Home",run:Mre,shift:Ire},{key:"End",run:e=>ere(e,(t=>mre(e,t,!0))),shift:e=>vre(e,(t=>mre(e,t,!0))),preventDefault:!0},{key:"Mod-End",run:Tre,shift:Ere},{key:"Enter",run:Hre},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:jre,shift:jre},{key:"Delete",run:Bre},{key:"Mod-Backspace",mac:"Alt-Backspace",run:zre},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>Nre(e,!0)},{mac:"Mod-Backspace",run:e=>Are(e,(t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}))},{mac:"Mod-Delete",run:e=>Are(e,(t=>{let n=e.moveToLineBoundary(t,!0).head;return t.headere(e,(t=>W3.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>vre(e,(t=>W3.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>ere(e,(t=>W3.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>vre(e,(t=>W3.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:Bre},{key:"Ctrl-h",run:jre},{key:"Ctrl-k",run:e=>Are(e,(t=>{let n=e.lineBlockAt(t.head).to;return t.head{if(e.readOnly)return!1;let n=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:p3.of(["",""])},range:W3.cursor(e.from)})));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,o=e.doc.lineAt(n),r=n==o.from?n-1:C3(o.text,n-o.from,!1)+o.from,i=n==o.to?n+1:C3(o.text,n-o.from,!0)+o.from;return{changes:{from:r,to:i,insert:e.doc.slice(n,i).append(e.doc.slice(r,n))},range:W3.cursor(i)}}));return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:gre}].map((e=>({mac:e.key,run:e.run,shift:e.shift}))))),Yre={key:"Tab",run:Zre,shift:Vre};function Kre(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)){var r=n[o];"string"==typeof r?e.setAttribute(o,r):null!=r&&(e[o]=r)}t++}for(;te.normalize("NFKD"):e=>e;class qre{constructor(e,t,n=0,o=e.length,r,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,o),this.bufferStart=n,this.normalize=r?e=>r(Ure(e)):Ure,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return I3(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=E3(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=A3(e);let o=this.normalize(t);for(let r=0,i=n;;r++){let e=o.charCodeAt(r),l=this.match(e,i);if(r==o.length-1){if(l)return this.value=l,this;break}i==n&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,o=n+t[0].length;if(this.matchPos=iie(this.text,o+(n==o?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,o,t)))return this.value={from:n,to:o,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=n||o.to<=t){let o=new oie(t,e.sliceString(t,n));return nie.set(e,o),o}if(o.from==t&&o.to==n)return o;let{text:r,from:i}=o;return i>t&&(r=e.sliceString(t,i)+r,i=t),o.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=iie(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=oie.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function iie(e,t){if(t>=e.length)return t;let n,o=e.lineAt(t);for(;t=56320&&n<57344;)t++;return t}function lie(e){let t=Kre("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:o}=e,r=o.doc.lineAt(o.selection.main.head),[,i,l,a,s]=n,c=a?+a.slice(1):0,u=l?+l:r.number;if(l&&s){let e=u/100;i&&(e=e*("-"==i?-1:1)+r.number/o.doc.lines),u=Math.round(o.doc.lines*e)}else l&&i&&(u=u*("-"==i?-1:1)+r.number);let d=o.doc.line(Math.max(1,Math.min(o.doc.lines,u))),p=W3.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[aie.of(!1),q7.scrollIntoView(p.from,{y:"center"})],selection:p}),e.focus()}return{dom:Kre("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:aie.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},Kre("label",e.state.phrase("Go to line"),": ",t)," ",Kre("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(tie.prototype[Symbol.iterator]=rie.prototype[Symbol.iterator]=function(){return this});const aie=$4.define(),sie=e4.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(aie)&&(e=n.value);return e},provide:e=>vee.from(e,(e=>e?lie:null))}),cie=q7.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),uie={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},die=X3.define({combine:e=>B4(e,uie,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})});function pie(e){let t=[vie,mie];return e&&t.push(die.of(e)),t}const hie=h5.mark({class:"cm-selectionMatch"}),fie=h5.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function gie(e,t,n,o){return!(0!=n&&e(t.sliceDoc(n-1,n))==E4.Word||o!=t.doc.length&&e(t.sliceDoc(o,o+1))==E4.Word)}const mie=n6.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(die),{state:n}=e,o=n.selection;if(o.ranges.length>1)return h5.none;let r,i=o.main,l=null;if(i.empty){if(!t.highlightWordAroundCursor)return h5.none;let e=n.wordAt(i.head);if(!e)return h5.none;l=n.charCategorizer(i.head),r=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e200)return h5.none;if(t.wholeWords){if(r=n.sliceDoc(i.from,i.to),l=n.charCategorizer(i.head),!gie(l,n,i.from,i.to)||!function(e,t,n,o){return e(t.sliceDoc(n,n+1))==E4.Word&&e(t.sliceDoc(o-1,o))==E4.Word}(l,n,i.from,i.to))return h5.none}else if(r=n.sliceDoc(i.from,i.to).trim(),!r)return h5.none}let a=[];for(let s of e.visibleRanges){let e=new qre(n.doc,r,s.from,s.to);for(;!e.next().done;){let{from:o,to:r}=e.value;if((!l||gie(l,n,o,r))&&(i.empty&&o<=i.from&&r>=i.to?a.push(fie.range(o,r)):(o>=i.to||r<=i.from)&&a.push(hie.range(o,r)),a.length>t.maxMatches))return h5.none}}return h5.set(a)}},{decorations:e=>e.decorations}),vie=q7.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),bie=X3.define({combine:e=>B4(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Xie(e),scrollToMatch:e=>q7.scrollIntoView(e)})});class yie{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,eie),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new kie(this):new xie(this)}getCursor(e,t=0,n){let o=e.doc?e:j4.create({doc:e});return null==n&&(n=o.doc.length),this.regexp?$ie(this,o,t,n):wie(this,o,t,n)}}class Oie{constructor(e){this.spec=e}}function wie(e,t,n,o){return new qre(t.doc,e.unquoted,n,o,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(r=t.doc,i=t.charCategorizer(t.selection.main.head),(e,t,n,o)=>((o>e||o+n.length=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=wie(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}function $ie(e,t,n,o){return new tie(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(r(Sie(n.input,n.index))!=E4.Word||r(Cie(n.input,n.index))!=E4.Word)&&(r(Cie(n.input,n.index+n[0].length))!=E4.Word||r(Sie(n.input,n.index+n[0].length))!=E4.Word)):void 0},n,o);var r}function Sie(e,t){return e.slice(C3(e,t,!1),t)}function Cie(e,t){return e.slice(t,C3(e,t))}class kie extends Oie{nextMatch(e,t,n){let o=$ie(this.spec,e,n,e.doc.length).next();return o.done&&(o=$ie(this.spec,e,0,t).next()),o.done?null:o.value}prevMatchInRange(e,t,n){for(let o=1;;o++){let r=Math.max(t,n-1e4*o),i=$ie(this.spec,e,r,n),l=null;for(;!i.next().done;)l=i.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=$ie(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}const Pie=$4.define(),Mie=$4.define(),Tie=e4.define({create:e=>new Iie(Qie(e).create(),null),update(e,t){for(let n of t.effects)n.is(Pie)?e=new Iie(n.value.create(),e.panel):n.is(Mie)&&(e=new Iie(e.query,n.value?Lie:null));return e},provide:e=>vee.from(e,(e=>e.panel))});class Iie{constructor(e,t){this.query=e,this.panel=t}}const Eie=h5.mark({class:"cm-searchMatch"}),Aie=h5.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Rie=n6.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Tie))}update(e){let t=e.state.field(Tie);(t!=e.startState.field(Tie)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return h5.none;let{view:n}=this,o=new H4;for(let r=0,i=n.visibleRanges,l=i.length;ri[r+1].from-500;)a=i[++r].to;e.highlight(n.state,t,a,((e,t)=>{let r=n.state.selection.ranges.some((n=>n.from==e&&n.to==t));o.add(e,t,r?Aie:Eie)}))}return o.finish()}},{decorations:e=>e.decorations});function Die(e){return t=>{let n=t.state.field(Tie,!1);return n&&n.query.spec.valid?e(t,n):Wie(t)}}const jie=Die(((e,{query:t})=>{let{to:n}=e.state.selection.main,o=t.nextMatch(e.state,n,n);if(!o)return!1;let r=W3.single(o.from,o.to),i=e.state.facet(bie);return e.dispatch({selection:r,effects:[Gie(e,o),i.scrollToMatch(r.main,e)],userEvent:"select.search"}),Fie(e),!0})),Bie=Die(((e,{query:t})=>{let{state:n}=e,{from:o}=n.selection.main,r=t.prevMatch(n,o,o);if(!r)return!1;let i=W3.single(r.from,r.to),l=e.state.facet(bie);return e.dispatch({selection:i,effects:[Gie(e,r),l.scrollToMatch(i.main,e)],userEvent:"select.search"}),Fie(e),!0})),Nie=Die(((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:W3.create(n.map((e=>W3.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),zie=Die(((e,{query:t})=>{let{state:n}=e,{from:o,to:r}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,o,o);if(!i)return!1;let l,a,s=[],c=[];if(i.from==o&&i.to==r&&(a=n.toText(t.getReplacement(i)),s.push({from:i.from,to:i.to,insert:a}),i=t.nextMatch(n,i.from,i.to),c.push(q7.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(o).number)+"."))),i){let t=0==s.length||s[0].from>=i.to?0:i.to-i.from-a.length;l=W3.single(i.from-t,i.to-t),c.push(Gie(e,i)),c.push(n.facet(bie).scrollToMatch(l.main,e))}return e.dispatch({changes:s,selection:l,effects:c,userEvent:"input.replace"}),!0})),_ie=Die(((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map((e=>{let{from:n,to:o}=e;return{from:n,to:o,insert:t.getReplacement(e)}}));if(!n.length)return!1;let o=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:q7.announce.of(o),userEvent:"input.replace.all"}),!0}));function Lie(e){return e.state.facet(bie).createPanel(e)}function Qie(e,t){var n,o,r,i,l;let a=e.selection.main,s=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!s)return t;let c=e.facet(bie);return new yie({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?s:s.replace(/\n/g,"\\n"),caseSensitive:null!==(o=null==t?void 0:t.caseSensitive)&&void 0!==o?o:c.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(l=null==t?void 0:t.wholeWord)&&void 0!==l?l:c.wholeWord})}function Hie(e){let t=hee(e,Lie);return t&&t.dom.querySelector("[main-field]")}function Fie(e){let t=Hie(e);t&&t==e.root.activeElement&&t.select()}const Wie=e=>{let t=e.state.field(Tie,!1);if(t&&t.panel){let n=Hie(e);if(n&&n!=e.root.activeElement){let o=Qie(e.state,t.query.spec);o.valid&&e.dispatch({effects:Pie.of(o)}),n.focus(),n.select()}}else e.dispatch({effects:[Mie.of(!0),t?Pie.of(Qie(e.state,t.query.spec)):$4.appendConfig.of(qie)]});return!0},Zie=e=>{let t=e.state.field(Tie,!1);if(!t||!t.panel)return!1;let n=hee(e,Lie);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Mie.of(!1)}),!0},Vie=[{key:"Mod-f",run:Wie,scope:"editor search-panel"},{key:"F3",run:jie,shift:Bie,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:jie,shift:Bie,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Zie,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:o,to:r}=n.main,i=[],l=0;for(let a=new qre(e.doc,e.sliceDoc(o,r));!a.next().done;){if(i.length>1e3)return!1;a.value.from==o&&(l=i.length),i.push(W3.range(a.value.from,a.value.to))}return t(e.update({selection:W3.create(i,l),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=hee(e,lie);if(!t){let n=[aie.of(!0)];null==e.state.field(sie,!1)&&n.push($4.appendConfig.of([sie,cie])),e.dispatch({effects:n}),t=hee(e,lie)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:n}=e,o=W3.create(n.ranges.map((t=>e.wordAt(t.head)||W3.cursor(t.head))),n.mainIndex);return!o.eq(n)&&(t(e.update({selection:o})),!0)})({state:e,dispatch:t});let o=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=o)))return!1;let r=function(e,t){let{main:n,ranges:o}=e.selection,r=e.wordAt(n.head),i=r&&r.from==n.from&&r.to==n.to;for(let l=!1,a=new qre(e.doc,t,o[o.length-1].to);;){if(a.next(),!a.done){if(l&&o.some((e=>e.from==a.value.from)))continue;if(i){let t=e.wordAt(a.value.from);if(!t||t.from!=a.value.from||t.to!=a.value.to)continue}return a.value}if(l)return null;a=new qre(e.doc,t,0,Math.max(0,o[o.length-1].from-1)),l=!0}}(e,o);return!!r&&(t(e.update({selection:e.selection.addRange(W3.range(r.from,r.to),!1),effects:q7.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class Xie{constructor(e){this.view=e;let t=this.query=e.state.field(Tie).query.spec;function n(e,t,n){return Kre("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=Kre("input",{value:t.search,placeholder:Yie(e,"Find"),"aria-label":Yie(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Kre("input",{value:t.replace,placeholder:Yie(e,"Replace"),"aria-label":Yie(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Kre("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Kre("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Kre("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=Kre("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",(()=>jie(e)),[Yie(e,"next")]),n("prev",(()=>Bie(e)),[Yie(e,"previous")]),n("select",(()=>Nie(e)),[Yie(e,"all")]),Kre("label",null,[this.caseField,Yie(e,"match case")]),Kre("label",null,[this.reField,Yie(e,"regexp")]),Kre("label",null,[this.wordField,Yie(e,"by word")]),...e.state.readOnly?[]:[Kre("br"),this.replaceField,n("replace",(()=>zie(e)),[Yie(e,"replace")]),n("replaceAll",(()=>_ie(e)),[Yie(e,"replace all")])],Kre("button",{name:"close",onclick:()=>Zie(e),"aria-label":Yie(e,"close"),type:"button"},["×"])])}commit(){let e=new yie({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Pie.of(e)}))}keydown(e){var t,n,o;t=this.view,n=e,o="search-panel",u9(s9(t.state),n,t,o)?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Bie:jie)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),zie(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Pie)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(bie).top}}function Yie(e,t){return e.state.phrase(t)}const Kie=/[\s\.,:;?!]/;function Gie(e,{from:t,to:n}){let o=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,i=Math.max(o.from,t-30),l=Math.min(r,n+30),a=e.state.sliceDoc(i,l);if(i!=o.from)for(let s=0;s<30;s++)if(!Kie.test(a[s+1])&&Kie.test(a[s])){a=a.slice(s);break}if(l!=r)for(let s=a.length-1;s>a.length-30;s--)if(!Kie.test(a[s-1])&&Kie.test(a[s])){a=a.slice(0,s);break}return q7.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${o.number}.`)}const Uie=q7.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),qie=[Tie,l4.low(Rie),Uie];class Jie{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=Jte(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),o=t.text.slice(n-t.from,this.pos-t.from),r=o.search(rle(e,!1));return r<0?null:{from:n+r,to:this.pos,text:o.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function ele(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function tle(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[n,o]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e{let r=e.matchBefore(o);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}class nle{constructor(e,t,n,o){this.completion=e,this.source=t,this.match=n,this.score=o}}function ole(e){return e.selection.main.from}function rle(e,t){var n;let{source:o}=e,r=t&&"^"!=o[0],i="$"!=o[o.length-1];return r||i?new RegExp(`${r?"^":""}(?:${o})${i?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const ile=O4.define(),lle=new WeakMap;function ale(e){if(!Array.isArray(e))return e;let t=lle.get(e);return t||lle.set(e,t=tle(e)),t}const sle=$4.define(),cle=$4.define();class ule{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&o<=57||o>=97&&o<=122?2:o>=65&&o<=90?1:0:(s=E3(o))!=s.toLowerCase()?1:s!=s.toUpperCase()?2:0;(!v||1==b&&g||0==y&&0!=b)&&(t[u]==o||n[u]==o&&(d=!0)?i[u++]=v:i.length&&(m=!1)),y=b,v+=A3(o)}return u==a&&0==i[0]&&m?this.result((d?-200:0)-100,i,e):p==a&&0==h?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):p==a?this.ret(-900-e.length,[h,f]):u==a?this.result((d?-200:0)-100-700+(m?0:-1100),i,e):2!=t.length&&this.result((o[0]?-700:0)-200-1100,o,e)}result(e,t,n){let o=[],r=0;for(let i of t){let e=i+(this.astral?A3(I3(n,i)):1);r&&o[r-1]==i?o[r-1]=e:(o[r++]=i,o[r++]=e)}return this.ret(e-n.length,o)}}const dle=X3.define({combine:e=>B4(e,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:hle,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>ple(e(n),t(n)),optionClass:(e,t)=>n=>ple(e(n),t(n)),addToOptions:(e,t)=>e.concat(t)})});function ple(e,t){return e?t?e+" "+t:e:t}function hle(e,t,n,o,r,i){let l,a,s=e.textDirection==x5.RTL,c=s,u=!1,d="top",p=t.left-r.left,h=r.right-t.right,f=o.right-o.left,g=o.bottom-o.top;if(c&&p=g||e>t.top?l=n.bottom-t.top:(d="bottom",l=t.bottom-n.top)}return{style:`${d}: ${l/((t.bottom-t.top)/i.offsetHeight)}px; max-width: ${a/((t.right-t.left)/i.offsetWidth)}px`,class:"cm-completionInfo-"+(u?s?"left-narrow":"right-narrow":c?"left":"right")}}function fle(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let o=Math.floor((e-t)/n);return{from:e-(o+1)*n,to:e-o*n}}class gle{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let o=e.state.field(t),{options:r,selected:i}=o.open,l=e.state.facet(dle);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,o){let r=document.createElement("span");r.className="cm-completionLabel";let i=e.displayLabel||e.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(i.slice(l,e)));let n=r.appendChild(document.createElement("span"));n.appendChild(document.createTextNode(i.slice(e,t))),n.className="cm-completionMatchedText",l=t}return le.position-t.position)).map((e=>e.render))}(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=fle(r.length,i,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",(n=>{let{options:o}=e.state.field(t).open;for(let t,r=n.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(t=/-(\d+)$/.exec(r.id))&&+t[1]{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(dle).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:cle.of(null)})})),this.showOptions(r,o.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(e){var t;let n=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=o){let{options:r,selected:i,disabled:l}=n.open;o.open&&o.open.options==r||(this.range=fle(r.length,i,e.state.facet(dle).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),l!=(null===(t=o.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=fle(t.options.length,t.selected,this.view.state.facet(dle).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:o}=n;if(!o)return;let r="string"==typeof o?document.createTextNode(o):o(n);if(!r)return;"then"in r?r.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)})).catch((e=>q5(this.view.state,e,"completion info"))):this.addInfoPane(r,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:o}=e;n.appendChild(t),this.infoDestroy=o||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,o=this.range.from;n;n=n.nextSibling,o++)"LI"==n.nodeName&&n.id?o==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected"):o--;return t&&function(e,t){let n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.height/e.offsetHeight;o.topn.bottom&&(e.scrollTop+=(o.bottom-n.bottom)/r)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return o.top>Math.min(r.bottom,t.bottom)-10||o.bottomn.from||0==n.from)&&(r=e,"string"!=typeof s&&s.header?o.appendChild(s.header(s)):o.appendChild(document.createElement("completion-section")).textContent=e)}const c=o.appendChild(document.createElement("li"));c.id=t+"-"+i,c.setAttribute("role","option");let u=this.optionClass(l);u&&(c.className=u);for(let e of this.optionContent){let t=e(l,this.view.state,this.view,a);t&&c.appendChild(t)}}return n.from&&o.classList.add("cm-completionListIncompleteTop"),n.tonew gle(n,e,t)}function vle(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class ble{constructor(e,t,n,o,r,i){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=o,this.selected=r,this.disabled=i}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new ble(this.options,wle(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,o,r){let i=function(e,t){let n=[],o=null,r=e=>{n.push(e);let{section:t}=e.completion;if(t){o||(o=[]);let e="string"==typeof t?t:t.name;o.some((t=>t.name==e))||o.push("string"==typeof t?{name:e}:t)}};for(let s of e)if(s.hasResult()){let e=s.result.getMatch;if(!1===s.result.filter)for(let t of s.result.options)r(new nle(t,s.source,e?e(t):[],1e9-n.length));else{let n=new ule(t.sliceDoc(s.from,s.to));for(let t of s.result.options)if(n.match(t.label)){let o=t.displayLabel?e?e(t,n.matched):[]:n.matched;r(new nle(t,s.source,o,n.score+(t.boost||0)))}}}if(o){let e=Object.create(null),t=0,r=(e,t)=>{var n,o;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(o=t.rank)&&void 0!==o?o:1e9)||(e.namet.score-e.score||a(e.completion,t.completion)))){let e=s.completion;!l||l.label!=e.label||l.detail!=e.detail||null!=l.type&&null!=e.type&&l.type!=e.type||l.apply!=e.apply||l.boost!=e.boost?i.push(s):vle(s.completion)>vle(l)&&(i[i.length-1]=s),l=s.completion}return i}(e,t);if(!i.length)return o&&e.some((e=>1==e.state))?new ble(o.options,o.attrs,o.tooltip,o.timestamp,o.selected,!0):null;let l=t.facet(dle).selectOnOpen?0:-1;if(o&&o.selected!=l&&-1!=o.selected){let e=o.options[o.selected].completion;for(let t=0;tt.hasResult()?Math.min(e,t.from):e),1e8),create:Ile,above:r.aboveCursor},o?o.timestamp:Date.now(),l,!1)}map(e){return new ble(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class yle{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new yle(xle,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(dle),o=(n.override||t.languageDataAt("autocomplete",ole(t)).map(ale)).map((t=>(this.active.find((e=>e.source==t))||new Sle(t,this.active.some((e=>0!=e.state))?1:0)).update(e,n)));o.length==this.active.length&&o.every(((e,t)=>e==this.active[t]))&&(o=this.active);let r=this.open;r&&e.docChanged&&(r=r.map(e.changes)),e.selection||o.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let n=0,o=0;;){for(;n1==e.state))&&(r=null),!r&&o.every((e=>1!=e.state))&&o.some((e=>e.hasResult()))&&(o=o.map((e=>e.hasResult()?new Sle(e.source,0):e)));for(let i of e.effects)i.is(Ple)&&(r=r&&r.setSelected(i.value,this.id));return o==this.active&&r==this.open?this:new yle(o,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Ole}}const Ole={"aria-autocomplete":"list"};function wle(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const xle=[];function $le(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class Sle{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=$le(e),o=this;n?o=o.handleUserEvent(e,n,t):e.docChanged?o=o.handleChange(e):e.selection&&0!=o.state&&(o=new Sle(o.source,0));for(let r of e.effects)if(r.is(sle))o=new Sle(o.source,1,r.value?ole(e.state):-1);else if(r.is(cle))o=new Sle(o.source,0);else if(r.is(kle))for(let e of r.value)e.source==o.source&&(o=e);return o}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new Sle(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(ole(e.startState))?new Sle(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Sle(this.source,this.state,e.mapPos(this.explicitPos))}}class Cle extends Sle{constructor(e,t,n,o,r){super(e,2,t),this.result=n,this.from=o,this.to=r}hasResult(){return!0}handleUserEvent(e,t,n){var o;let r=e.changes.mapPos(this.from),i=e.changes.mapPos(this.to,1),l=ole(e.state);if((this.explicitPos<0?l<=r:li||"delete"==t&&ole(e.startState)==this.from)return new Sle(this.source,"input"==t&&n.activateOnTyping?1:0);let a,s=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,o){if(!e)return!1;let r=t.sliceDoc(n,o);return"function"==typeof e?e(r,n,o,t):rle(e,!0).test(r)}(this.result.validFor,e.state,r,i)?new Cle(this.source,s,this.result,r,i):this.result.update&&(a=this.result.update(this.result,r,i,new Jie(e.state,l,s>=0)))?new Cle(this.source,s,a,a.from,null!==(o=a.to)&&void 0!==o?o:ole(e.state)):new Sle(this.source,1,s)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Sle(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Cle(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}const kle=$4.define({map:(e,t)=>e.map((e=>e.map(t)))}),Ple=$4.define(),Mle=e4.define({create:()=>yle.start(),update:(e,t)=>e.update(t),provide:e=>[ree.from(e,(e=>e.tooltip)),q7.contentAttributes.from(e,(e=>e.attrs))]});function Tle(e,t){const n=t.completion.apply||t.completion.label;let o=e.state.field(Mle).active.find((e=>e.source==t.source));return o instanceof Cle&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,o){let{main:r}=e.selection,i=n-r.from,l=o-r.from;return Object.assign(Object.assign({},e.changeByRange((a=>a!=r&&n!=o&&e.sliceDoc(a.from+i,a.from+l)!=e.sliceDoc(n,o)?{range:a}:{changes:{from:a.from+i,to:o==r.from?a.to:a.from+l,insert:t},range:W3.cursor(a.from+i+t.length)}))),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,o.from,o.to)),{annotations:ile.of(t.completion)})):n(e,t.completion,o.from,o.to),!0)}const Ile=mle(Mle,Tle);function Ele(e,t="option"){return n=>{let o=n.state.field(Mle,!1);if(!o||!o.open||o.open.disabled||Date.now()-o.open.timestamp-1?o.open.selected+i*(e?1:-1):e?0:l-1;return a<0?a="page"==t?0:l-1:a>=l&&(a="page"==t?l-1:0),n.dispatch({effects:Ple.of(a)}),!0}}class Ale{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Rle=n6.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let t of e.state.field(Mle).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(Mle);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Mle)==t)return;let n=e.transactions.some((e=>(e.selection||e.docChanged)&&!$le(e)));for(let o=0;o50&&Date.now()-t.time>1e3){for(let e of t.context.abortListeners)try{e()}catch(Lpe){q5(this.view.state,Lpe)}t.context.abortListeners=null,this.running.splice(o--,1)}else t.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let o of e.transactions)"input"==$le(o)?this.composing=2:2==this.composing&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(Mle);for(let n of t.active)1!=n.state||this.running.some((e=>e.active.source==n.source))||this.startQuery(n)}startQuery(e){let{state:t}=this.view,n=ole(t),o=new Jie(t,n,e.explicitPos==n),r=new Ale(e,o);this.running.push(r),Promise.resolve(e.source(o)).then((e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:cle.of(null)}),q5(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(dle).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(dle);for(let o=0;oe.source==r.active.source));if(i&&1==i.state)if(null==r.done){let e=new Sle(r.active.source,0);for(let t of r.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(i)}t.length&&this.view.dispatch({effects:kle.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Mle,!1);if(t&&t.tooltip&&this.view.state.facet(dle).closeOnBlur){let n=t.open&&uee(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||this.view.dispatch({effects:cle.of(null)})}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:sle.of(!1)})),20),this.composing=0}}}),Dle=q7.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class jle{constructor(e,t,n,o){this.field=e,this.line=t,this.from=n,this.to=o}}class Ble{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,D3.TrackDel),n=e.mapPos(this.to,1,D3.TrackDel);return null==t||null==n?null:new Ble(this.field,t,n)}}class Nle{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],o=[t],r=e.doc.lineAt(t),i=/^\s*/.exec(r.text)[0];for(let l of this.lines){if(n.length){let n=i,r=/^\t*/.exec(l)[0].length;for(let t=0;tnew Ble(e.field,o[e.line]+e.from,o[e.line]+e.to)))}}static parse(e){let t,n=[],o=[],r=[];for(let i of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(i);){let e=t[1]?+t[1]:null,l=t[2]||t[3]||"",a=-1;for(let t=0;t=a&&e.field++}r.push(new jle(a,o.length,t.index,t.index+l.length)),i=i.slice(0,t.index)+l+i.slice(t.index+t[0].length)}for(let e;e=/\\([{}])/.exec(i);){i=i.slice(0,e.index)+e[1]+i.slice(e.index+e[0].length);for(let t of r)t.line==o.length&&t.from>e.index&&(t.from--,t.to--)}o.push(i)}return new Nle(o,r)}}let zle=h5.widget({widget:new class extends d5{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),_le=h5.mark({class:"cm-snippetField"});class Lle{constructor(e,t){this.ranges=e,this.active=t,this.deco=h5.set(e.map((e=>(e.from==e.to?zle:_le).range(e.from,e.to))))}map(e){let t=[];for(let n of this.ranges){let o=n.map(e);if(!o)return null;t.push(o)}return new Lle(t,this.active)}selectionInsideField(e){return e.ranges.every((e=>this.ranges.some((t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))))}}const Qle=$4.define({map:(e,t)=>e&&e.map(t)}),Hle=$4.define(),Fle=e4.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(Qle))return n.value;if(n.is(Hle)&&e)return new Lle(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>q7.decorations.from(e,(e=>e?e.deco:h5.none))});function Wle(e,t){return W3.create(e.filter((e=>e.field==t)).map((e=>W3.range(e.from,e.to))))}function Zle(e){let t=Nle.parse(e);return(e,n,o,r)=>{let{text:i,ranges:l}=t.instantiate(e.state,o),a={changes:{from:o,to:r,insert:p3.of(i)},scrollIntoView:!0,annotations:n?ile.of(n):void 0};if(l.length&&(a.selection=Wle(l,0)),l.length>1){let t=new Lle(l,0),n=a.effects=[Qle.of(t)];void 0===e.state.field(Fle,!1)&&n.push($4.appendConfig.of([Fle,Kle,Ule,Dle]))}e.dispatch(e.state.update(a))}}function Vle(e){return({state:t,dispatch:n})=>{let o=t.field(Fle,!1);if(!o||e<0&&0==o.active)return!1;let r=o.active+e,i=e>0&&!o.ranges.some((t=>t.field==r+e));return n(t.update({selection:Wle(o.ranges,r),effects:Qle.of(i?null:new Lle(o.ranges,r)),scrollIntoView:!0})),!0}}const Xle=[{key:"Tab",run:Vle(1),shift:Vle(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(Fle,!1)&&(t(e.update({effects:Qle.of(null)})),!0)}],Yle=X3.define({combine:e=>e.length?e[0]:Xle}),Kle=l4.highest(l9.compute([Yle],(e=>e.facet(Yle))));function Gle(e,t){return Object.assign(Object.assign({},t),{apply:Zle(e)})}const Ule=q7.domEventHandlers({mousedown(e,t){let n,o=t.state.field(Fle,!1);if(!o||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=o.ranges.find((e=>e.from<=n&&e.to>=n));return!(!r||r.field==o.active||(t.dispatch({selection:Wle(o.ranges,r.field),effects:Qle.of(o.ranges.some((e=>e.field>r.field))?new Lle(o.ranges,r.field):null),scrollIntoView:!0}),0))}}),qle={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Jle=$4.define({map(e,t){let n=t.mapPos(e,-1,D3.TrackAfter);return null==n?void 0:n}}),eae=new class extends N4{};eae.startSide=1,eae.endSide=-1;const tae=e4.define({create:()=>Q4.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Jle)&&(e=e.update({add:[eae.range(n.value,n.value+1)]}));return e}}),nae="()[]{}<>";function oae(e){for(let t=0;t<8;t+=2)if(nae.charCodeAt(t)==e)return nae.charAt(t+1);return E3(e<128?e:e+1)}function rae(e,t){return e.languageDataAt("closeBrackets",t)[0]||qle}const iae="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),lae=q7.inputHandler.of(((e,t,n,o)=>{if((iae?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(o.length>2||2==o.length&&1==A3(I3(o,0))||t!=r.from||n!=r.to)return!1;let i=function(e,t){let n=rae(e,e.selection.main.head),o=n.brackets||qle.brackets;for(let r of o){let i=oae(I3(r,0));if(t==r)return i==r?pae(e,r,o.indexOf(r+r+r)>-1,n):uae(e,r,i,n.before||qle.before);if(t==i&&sae(e,e.selection.main.from))return dae(e,0,i)}return null}(e.state,o);return!!i&&(e.dispatch(i),!0)})),aae=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=rae(e,e.selection.main.head).brackets||qle.brackets,o=null,r=e.changeByRange((t=>{if(t.empty){let o=function(e,t){let n=e.sliceString(t-2,t);return A3(I3(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let r of n)if(r==o&&cae(e.doc,t.head)==oae(I3(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:W3.cursor(t.head-r.length)}}return{range:o=t}}));return o||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!o}}];function sae(e,t){let n=!1;return e.field(tae).between(0,e.doc.length,(e=>{e==t&&(n=!0)})),n}function cae(e,t){let n=e.sliceString(t,t+2);return n.slice(0,A3(I3(n,0)))}function uae(e,t,n,o){let r=null,i=e.changeByRange((i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:n,from:i.to}],effects:Jle.of(i.to+t.length),range:W3.range(i.anchor+t.length,i.head+t.length)};let l=cae(e.doc,i.head);return!l||/\s/.test(l)||o.indexOf(l)>-1?{changes:{insert:t+n,from:i.head},effects:Jle.of(i.head+t.length),range:W3.cursor(i.head+t.length)}:{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function dae(e,t,n){let o=null,r=e.changeByRange((t=>t.empty&&cae(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:W3.cursor(t.head+n.length)}:o={range:t}));return o?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function pae(e,t,n,o){let r=o.stringPrefixes||qle.stringPrefixes,i=null,l=e.changeByRange((o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:t,from:o.to}],effects:Jle.of(o.to+t.length),range:W3.range(o.anchor+t.length,o.head+t.length)};let l,a=o.head,s=cae(e.doc,a);if(s==t){if(hae(e,a))return{changes:{insert:t+t,from:a},effects:Jle.of(a+t.length),range:W3.cursor(a+t.length)};if(sae(e,a)){let o=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+o.length,insert:o},range:W3.cursor(a+o.length)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(l=fae(e,a-2*t.length,r))>-1&&hae(e,l))return{changes:{insert:t+t+t+t,from:a},effects:Jle.of(a+t.length),range:W3.cursor(a+t.length)};if(e.charCategorizer(a)(s)!=E4.Word&&fae(e,a,r)>-1&&!function(e,t,n,o){let r=Jte(e).resolveInner(t,-1),i=o.reduce(((e,t)=>Math.max(e,t.length)),0);for(let l=0;l<5;l++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+i)),a=l.indexOf(n);if(!a||a>-1&&o.indexOf(l.slice(0,a))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let s=r.to==t&&r.parent;if(!s)break;r=s}return!1}(e,a,t,r))return{changes:{insert:t+t,from:a},effects:Jle.of(a+t.length),range:W3.cursor(a+t.length)}}return{range:i=o}}));return i?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function hae(e,t){let n=Jte(e).resolveInner(t+1);return n.parent&&n.from==t}function fae(e,t,n){let o=e.charCategorizer(t);if(o(e.sliceDoc(t-1,t))!=E4.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&o(e.sliceDoc(n-1,n))!=E4.Word)return n}return-1}function gae(e={}){return[Mle,dle.of(e),Rle,vae,Dle]}const mae=[{key:"Ctrl-Space",run:e=>!!e.state.field(Mle,!1)&&(e.dispatch({effects:sle.of(!0)}),!0)},{key:"Escape",run:e=>{let t=e.state.field(Mle,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:cle.of(null)}),0))}},{key:"ArrowDown",run:Ele(!0)},{key:"ArrowUp",run:Ele(!1)},{key:"PageDown",run:Ele(!0,"page")},{key:"PageUp",run:Ele(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(Mle,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.facet(dle).defaultKeymap?[mae]:[])));class bae{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class yae{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let o=e,r=n.facet(Rae).markerFilter;r&&(o=r(o));let i=h5.set(o.map((e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?h5.widget({widget:new zae(e),diagnostic:e}).range(e.from):h5.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e}).range(e.from,e.to))),!0);return new yae(i,t,Oae(i))}}function Oae(e,t=null,n=0){let o=null;return e.between(n,1e9,((e,n,{spec:r})=>{if(!t||r.diagnostic==t)return o=new bae(e,n,r.diagnostic),!1})),o}function wae(e,t){let n=e.startState.doc.lineAt(t.pos);return!(!e.effects.some((e=>e.is($ae)))&&!e.changes.touchesRange(n.from,n.to))}function xae(e,t){return e.field(kae,!1)?t:t.concat($4.appendConfig.of(qae))}const $ae=$4.define(),Sae=$4.define(),Cae=$4.define(),kae=e4.define({create:()=>new yae(h5.none,null,null),update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),o=null;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);o=Oae(n,e.selected.diagnostic,r)||Oae(n,null,r)}e=new yae(n,e.panel,o)}for(let n of t.effects)n.is($ae)?e=yae.init(n.value,e.panel,t.state):n.is(Sae)?e=new yae(e.diagnostics,n.value?Lae.open:null,e.selected):n.is(Cae)&&(e=new yae(e.diagnostics,e.panel,n.value));return e},provide:e=>[vee.from(e,(e=>e.panel)),q7.decorations.from(e,(e=>e.diagnostics))]}),Pae=h5.mark({class:"cm-lintRange cm-lintRange-active"});function Mae(e,t,n){let{diagnostics:o}=e.state.field(kae),r=[],i=2e8,l=0;o.between(t-(n<0?1:0),t+(n>0?1:0),((e,o,{spec:a})=>{t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t({dom:Tae(e,r)})}:null}function Tae(e,t){return Kre("ul",{class:"cm-tooltip-lint"},t.map((t=>Nae(e,t,!1))))}const Iae=e=>{let t=e.state.field(kae,!1);return!(!t||!t.panel||(e.dispatch({effects:Sae.of(!1)}),0))},Eae=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(kae,!1);t&&t.panel||e.dispatch({effects:xae(e.state,[Sae.of(!0)])});let n=hee(e,Lae.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(kae,!1);if(!t)return!1;let n=e.state.selection.main,o=t.diagnostics.iter(n.to+1);return!(!o.value&&(o=t.diagnostics.iter(0),!o.value||o.from==n.from&&o.to==n.to)||(e.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0}),0))}}],Aae=n6.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Rae);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){let e=Date.now();if(ePromise.resolve(e(this.view))))).then((t=>{let n=t.reduce(((e,t)=>e.concat(t)));this.view.state.doc==e.doc&&this.view.dispatch(function(e,t){return{effects:xae(e,[$ae.of(t)])}}(this.view.state,n))}),(e=>{q5(this.view.state,e)}))}}update(e){let t=e.state.facet(Rae);(e.docChanged||t!=e.startState.facet(Rae)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Rae=X3.define({combine:e=>Object.assign({sources:e.map((e=>e.source))},B4(e.map((e=>e.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function Dae(e,t={}){return[Rae.of({source:e,config:t}),Aae,qae]}function jae(e){let t=e.plugin(Aae);t&&t.force()}function Bae(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;ee.toLowerCase()==o.toLowerCase()))){t.push(o);continue e}}t.push("")}return t}function Nae(e,t,n){var o;let r=n?Bae(t.actions):[];return Kre("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Kre("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),null===(o=t.actions)||void 0===o?void 0:o.map(((n,o)=>{let i=!1,l=o=>{if(o.preventDefault(),i)return;i=!0;let r=Oae(e.state.field(kae).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:a}=n,s=r[o]?a.indexOf(r[o]):-1,c=s<0?a:[a.slice(0,s),Kre("u",a.slice(s,s+1)),a.slice(s+1)];return Kre("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${a}${s<0?"":` (access key "${r[o]})"`}.`},c)})),t.source&&Kre("div",{class:"cm-diagnosticSource"},t.source))}class zae extends d5{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Kre("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class _ae{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Nae(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Lae{constructor(e){this.view=e,this.items=[],this.list=Kre("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)Iae(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],o=Bae(n.actions);for(let r=0;r{for(let t=0;tIae(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(kae).selected;if(!e)return-1;for(let t=0;t{let a,s=-1;for(let t=n;tn&&(this.items.splice(n,s-n),o=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}));n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.topt.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Oae(this.view.state.field(kae).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Cae.of(t)})}static open(e){return new Lae(e)}}function Qae(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function Hae(e){return Qae(``,'width="6" height="3"')}const Fae=q7.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Hae("#d11")},".cm-lintRange-warning":{backgroundImage:Hae("orange")},".cm-lintRange-info":{backgroundImage:Hae("#999")},".cm-lintRange-hint":{backgroundImage:Hae("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function Wae(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}class Zae extends bee{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce(((e,t)=>Wae(e)function(e,t,n){function o(){let o=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(o.from)&&e.dispatch({effects:Kae.of({pos:o.from,above:!1,create:()=>({dom:Tae(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let n=o=>{let r=t.getBoundingClientRect();if(!(o.clientX>r.left-10&&o.clientXr.top-10&&o.clientY{clearTimeout(i),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(i),i=setTimeout(o,r)}}(e,t,n)),t}}function Vae(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let o=[];for(let r in n)o.push(new Zae(n[r]).range(+r));return Q4.of(o,!0)}const Xae=xee({class:"cm-gutter-lint",markers:e=>e.state.field(Yae)}),Yae=e4.define({create:()=>Q4.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(Jae).markerFilter;for(let o of t.effects)if(o.is($ae)){let r=o.value;n&&(r=n(r||[])),e=Vae(t.state.doc,r.slice(0))}return e}}),Kae=$4.define(),Gae=e4.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=wae(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce(((e,t)=>t.is(Kae)?t.value:e),e)),provide:e=>ree.from(e)}),Uae=q7.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Qae('')},".cm-lint-marker-warning":{content:Qae('')},".cm-lint-marker-error":{content:Qae('')}}),qae=[kae,q7.decorations.compute([kae],(e=>{let{selected:t,panel:n}=e.field(kae);return t&&n&&t.from!=t.to?h5.set([Pae.range(t.from,t.to)]):h5.none})),cee(Mae,{hideOn:wae}),Fae],Jae=X3.define({combine:e=>B4(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function ese(e={}){return[Jae.of(e),Yae,Xae,Uae,Gae]}const tse=(()=>[Bee(),_ee,B9(),joe(),Xne(),y9(),[P9,M9],j4.allowMultipleSelections.of(!0),j4.transactionFilter.of((e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:o}=e.newSelection.main,r=n.lineAt(o);if(o>r.from+200)return e;let i=n.sliceString(r.from,o);if(!t.some((e=>e.test(i))))return e;let{state:l}=e,a=-1,s=[];for(let{head:c}of l.selection.ranges){let e=l.doc.lineAt(c);if(e.from==a)continue;a=e.from;let t=fne(l,e.from);if(null==t)continue;let n=/^\s*/.exec(e.text)[0],o=hne(l,t);n!=o&&s.push({from:e.from,to:e.from+n.length,insert:o})}return s.length?[e,{changes:s,sequential:!0}]:e})),Jne(noe,{fallback:!0}),uoe(),[lae,tae],gae(),V9(),K9(),Q9,pie(),l9.of([...aae,...Xre,...Vie,...Uoe,...zne,...mae,...Eae])])(),nse=(()=>[B9(),joe(),y9(),Jne(noe,{fallback:!0}),l9.of([...Xre,...Uoe])])();function ose(e,t={},n){const{props:o,domProps:r,on:i,...l}=t,a=i?(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):{})(i):{};return Kr(e,{...l,...o,...r,...a},n)}var rse=Ln({name:"CodeMirror",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:""},theme:{type:Object,default:()=>{}},dark:{type:Boolean,default:!1},basic:{type:Boolean,default:!1},minimal:{type:Boolean,default:!1},placeholder:{type:String,default:void 0},wrap:{type:Boolean,default:!1},tab:{type:Boolean,default:!1},allowMultipleSelections:{type:Boolean,default:!1},tabSize:{type:Number,default:void 0},lineSeparator:{type:String,default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},extensions:{type:Array,default:()=>[]},phrases:{type:Object,default:()=>{}},lang:{type:Object,default:()=>{}},linter:{type:Function,default:void 0},linterConfig:{type:Object,default:()=>({})},forceLinting:{type:Boolean,default:!1},gutter:{type:Boolean,defalt:!1},gutterConfig:{type:Object,default:()=>{}},tag:{type:String,default:"div"}},emits:{"update:modelValue":e=>!0,update:e=>!0,ready:e=>!0,focus:e=>!0,change:e=>!0,destroy:()=>!0},setup(e,t){const n=Ot(),o=Ot(e.modelValue),r=wt(new q7),i=Yr({get:()=>r.value.hasFocus,set:e=>{e&&r.value.focus()}}),l=Yr({get:()=>r.value.state.selection,set:e=>r.value.dispatch({selection:e})}),a=Yr({get:()=>r.value.state.selection.main.head,set:e=>r.value.dispatch({selection:{anchor:e}})}),s=Yr({get:()=>r.value.state.toJSON(),set:e=>r.value.setState(j4.fromJSON(e))}),c=Ot(0),u=Ot(0),d=Yr((()=>{const n=new s4,o=new s4;return[e.basic?tse:void 0,e.minimal&&!e.basic?nse:void 0,q7.updateListener.of((n=>{t.emit("focus",r.value.hasFocus),c.value=r.value.state.doc.length,!n.changes.empty&&n.docChanged&&(e.linter&&(e.forceLinting&&jae(r.value),u.value=e.linter(r.value).length),t.emit("update",n))})),q7.theme(e.theme,{dark:e.dark}),e.wrap?q7.lineWrapping:void 0,e.tab?l9.of([Yre]):void 0,j4.allowMultipleSelections.of(e.allowMultipleSelections),e.tabSize?o.of(j4.tabSize.of(e.tabSize)):void 0,e.phrases?j4.phrases.of(e.phrases):void 0,j4.readOnly.of(e.readonly),q7.editable.of(!e.disabled),e.lineSeparator?j4.lineSeparator.of(e.lineSeparator):void 0,e.lang?n.of(e.lang):void 0,e.linter?Dae(e.linter,e.linterConfig):void 0,e.linter&&e.gutter?ese(e.gutterConfig):void 0,e.placeholder?(i=e.placeholder,n6.fromClass(class{constructor(e){this.view=e,this.placeholder=i?h5.set([h5.widget({widget:new H9(i),side:1}).range(0)]):h5.none}get decorations(){return this.view.state.doc.length?h5.none:this.placeholder}},{decorations:e=>e.decorations})):void 0,...e.extensions].filter((e=>!!e));var i}));wn(d,(e=>{var t;null==(t=r.value)||t.dispatch({effects:$4.reconfigure.of(e)})}),{immediate:!0}),wn((()=>e.modelValue),(async t=>{r.value.composing||r.value.state.doc.toJSON().join(e.lineSeparator??"\n")===t||r.value.dispatch({changes:{from:0,to:r.value.state.doc.length,insert:t},selection:r.value.state.selection,scrollIntoView:!0})}),{immediate:!0}),Gn((async()=>{let e=o.value;n.value&&(n.value.childNodes[0]&&(o.value,e=n.value.childNodes[0].innerText.trim()),r.value=new q7({parent:n.value,state:j4.create({doc:e,extensions:d.value}),dispatch:e=>{r.value.update([e]),!e.changes.empty&&e.docChanged&&(t.emit("update:modelValue",e.state.doc.toString()),t.emit("change",e.state))}}),await Zt(),t.emit("ready",{view:r.value,state:r.value.state,container:n.value}))})),eo((()=>{r.value.destroy(),t.emit("destroy")}));const p={editor:n,view:r,cursor:a,selection:l,focus:i,length:c,json:s,diagnosticCount:u,dom:r.value.contentDOM,lint:()=>{!e.linter||!r.value||(e.forceLinting&&jae(r.value),u.value=function(e){let t=e.field(kae,!1);return t?t.diagnostics.size:0}(r.value.state))},forceReconfigure:()=>{var e,t;null==(e=r.value)||e.dispatch({effects:$4.reconfigure.of([])}),null==(t=r.value)||t.dispatch({effects:$4.appendConfig.of(d.value)})},getRange:(e,t)=>r.value.state.sliceDoc(e,t),getLine:e=>r.value.state.doc.line(e+1).text,lineCount:()=>r.value.state.doc.lines,getCursor:()=>r.value.state.selection.main.head,listSelections:()=>{let e;return null!==(e=r.value.state.selection.ranges)&&void 0!==e?e:[]},getSelection:()=>{let e;return null!==(e=r.value.state.sliceDoc(r.value.state.selection.main.from,r.value.state.selection.main.to))&&void 0!==e?e:""},getSelections:()=>{const e=r.value.state;return e?e.selection.ranges.map((t=>e.sliceDoc(t.from,t.to))):[]},somethingSelected:()=>r.value.state.selection.ranges.some((e=>!e.empty)),replaceRange:(e,t,n)=>r.value.dispatch({changes:{from:t,to:n,insert:e}}),replaceSelection:e=>r.value.dispatch(r.value.state.replaceSelection(e)),setCursor:e=>r.value.dispatch({selection:{anchor:e}}),setSelection:(e,t)=>r.value.dispatch({selection:{anchor:e,head:t}}),setSelections:(e,t)=>r.value.dispatch({selection:W3.create(e,t)}),extendSelectionsBy:e=>r.value.dispatch({selection:W3.create(l.value.ranges.map((t=>t.extend(e(t)))))})};return t.expose(p),p},render(){return ose(this.$props.tag,{ref:"editor",class:"vue-codemirror"},this.$slots.default?ose("aside",{style:"display: none;","aria-hidden":"true"},"function"==typeof(e=this.$slots.default)?e():e):void 0);var e}});const ise="#e06c75",lse="#abb2bf",ase="#7d8799",sse="#d19a66",cse="#2c313a",use="#282c34",dse="#353a42",pse="#528bff",hse=[q7.theme({"&":{color:lse,backgroundColor:use},".cm-content":{caretColor:pse},".cm-cursor, .cm-dropCursor":{borderLeftColor:pse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:lse},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:use,color:ase,border:"none"},".cm-activeLineGutter":{backgroundColor:cse},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:dse},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:dse,borderBottomColor:dse},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:cse,color:lse}}},{dark:!0}),Jne(Kne.define([{tag:Zte.keyword,color:"#c678dd"},{tag:[Zte.name,Zte.deleted,Zte.character,Zte.propertyName,Zte.macroName],color:ise},{tag:[Zte.function(Zte.variableName),Zte.labelName],color:"#61afef"},{tag:[Zte.color,Zte.constant(Zte.name),Zte.standard(Zte.name)],color:sse},{tag:[Zte.definition(Zte.name),Zte.separator],color:lse},{tag:[Zte.typeName,Zte.className,Zte.number,Zte.changed,Zte.annotation,Zte.modifier,Zte.self,Zte.namespace],color:"#e5c07b"},{tag:[Zte.operator,Zte.operatorKeyword,Zte.url,Zte.escape,Zte.regexp,Zte.link,Zte.special(Zte.string)],color:"#56b6c2"},{tag:[Zte.meta,Zte.comment],color:ase},{tag:Zte.strong,fontWeight:"bold"},{tag:Zte.emphasis,fontStyle:"italic"},{tag:Zte.strikethrough,textDecoration:"line-through"},{tag:Zte.link,color:ase,textDecoration:"underline"},{tag:Zte.heading,fontWeight:"bold",color:ise},{tag:[Zte.atom,Zte.bool,Zte.special(Zte.variableName)],color:sse},{tag:[Zte.processingInstruction,Zte.string,Zte.inserted],color:"#98c379"},{tag:Zte.invalid,color:"#ffffff"}]))];var fse={};class gse{constructor(e,t,n,o,r,i,l,a,s,c=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=o,this.pos=r,this.score=i,this.buffer=l,this.bufferBase=a,this.curContext=s,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let o=e.parser.context;return new gse(e,[],t,n,n,0,[],0,o?new mse(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,o=65535&e,{parser:r}=this.p,i=r.dynamicPrecedence(o);if(i&&(this.score+=i),0==n)return this.pushState(r.getGoto(this.state,o,!0),this.reducePos),o=2e3&&!(null===(t=this.p.parser.nodeSet.types[o])||void 0===t?void 0:t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=s):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(o,a)}storeNode(e,t,n,o=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[o-4]&&e.buffer[o-1]>-1){if(t==n)return;if(e.buffer[o-2]>=t)return void(e.buffer[o-2]=n)}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,o>4&&(o-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=o}else this.buffer.push(e,t,n,o)}shift(e,t,n,o){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:i}=this.p;(o>this.pos||t<=i.maxNode)&&(this.pos=o,i.stateFlag(r,1)||(this.reducePos=o)),this.pushState(r,n),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,o,4)}else this.pos=o,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,o,4)}apply(e,t,n,o){65536&e?this.reduce(e):this.shift(e,t,n,o)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(t,o),this.buffer.push(n,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),o=e.bufferBase+t;for(;e&&o==e.bufferBase;)e=e.parent;return new gse(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new vse(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(0==(65536&n))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let o,r=0;r1&t&&e==o))||n.push(t[e],o)}t=n}let n=[];for(let o=0;o>19,o=65535&t,r=this.stack.length-3*n;if(r<0||e.getGoto(this.stack[r],o,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(o,r)=>{if(!t.includes(o))return t.push(o),e.allActions(o,(t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let o=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],o,!1)>=0)return n<<19|65536|o}}else{let e=n(t,r+1);if(null!=e)return e}}))};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class mse{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class vse{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let o=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=o}}class bse{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new bse(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new bse(this.stack,this.pos,this.index)}}function yse(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let o=0,r=0;o=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),i+=r,n)break;i*=46}n?n[r++]=i:n=new t(i)}return n}class Ose{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const wse=new Ose;class xse{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=wse,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,o=this.rangeIndex,r=this.pos+e;for(;rn.to:r>=n.to;){if(o==this.ranges.length-1)return null;let e=this.ranges[++o];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t,n,o=this.chunkOff+e;if(o>=0&&o=this.chunk2Pos&&to.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=wse,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let o of this.ranges){if(o.from>=t)break;o.to>e&&(n+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}return n}}class $se{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;kse(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}$se.prototype.contextual=$se.prototype.fallback=$se.prototype.extend=!1;class Sse{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?yse(e):e}token(e,t){let n=e.pos,o=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(kse(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(n||o++,null==r)break;e.reset(r,e.token)}o&&(e.reset(n,e.token),e.acceptToken(this.elseToken,o))}}Sse.prototype.contextual=$se.prototype.fallback=$se.prototype.extend=!1;class Cse{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function kse(e,t,n,o,r,i){let l=0,a=1<0){let n=e[d];if(s.allows(n)&&(-1==t.token.value||t.token.value==n||Mse(n,t.token.value,r,i))){t.acceptToken(n);break}}let o=t.next,c=0,u=e[l+2];if(!(t.next<0&&u>c&&65535==e[n+3*u-3])){for(;c>1,i=n+r+(r<<1),a=e[i],s=e[i+1]||65536;if(o=s)){l=e[i+2],t.advance();continue e}c=r+1}}break}l=e[n+3*u-1]}}function Pse(e,t,n){for(let o,r=t;65535!=(o=e[r]);r++)if(o==n)return r-t;return-1}function Mse(e,t,n,o){let r=Pse(n,o,t);return r<0||Pse(n,o,e)t)&&!o.type.isError)return n<0?Math.max(0,Math.min(o.to-1,t-25)):Math.min(e.length,Math.max(o.from+1,t+25));if(n<0?o.prevSibling():o.nextSibling())break;if(!o.parent())return n<0?0:e.length}}class Ase{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ese(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ese(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(r instanceof qee){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+r.length}}}class Rse{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new Ose))}getActions(e){let t=0,n=null,{parser:o}=e.p,{tokenizers:r}=o,i=o.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let s=0;sc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let r=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!o.extend&&(n=c,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||(n=new Ose,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Ose,{pos:n,p:o}=e;return t.start=n,t.end=Math.min(n+1,o.stream.end),t.value=n==o.stream.end?o.parser.eofTerm:0,t}updateCachedToken(e,t,n){let o=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(o,e),n),e.value>-1){let{parser:t}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,t,n,o){for(let r=0;r4*e.bufferLength?new Ase(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,o=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;io)r.push(l);else{if(this.advanceStack(l,r,n))continue;{e||(e=[],t=[]),e.push(l);let n=this.tokens.getMainToken(l);t.push(n.value,n.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>o))&&this.recovering--}else if(r.length>1){e:for(let e=0;e500&&o.buffer.length>500){if(!((t.score-o.score||t.buffer.length-o.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(n--,1)}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let i=1;ithis.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let i=this.fragments.nodeAt(o);i;){let o=this.parser.nodeSet.types[i.type.id]==i.type?r.getGoto(e.state,i.type.id):-1;if(o>-1&&i.length&&(!t||(i.prop(Fee.contextHash)||0)==n))return e.useNode(i,o),!0;if(!(i instanceof qee)||0==i.children.length||i.positions[0]>0)break;let l=i.children[0];if(!(l instanceof qee&&0==i.positions[0]))break;i=l}}let i=r.stateSlot(e.state,4);if(i>0)return e.reduce(i),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let a=0;ao?t.push(u):n.push(u)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return jse(e,t),!0}}runRecovery(e,t,n){let o=null,r=!1;for(let i=0;i ":"";if(l.deadEnd){if(r)continue;if(r=!0,l.restart(),this.advanceFully(l,n))continue}let u=l.split(),d=c;for(let e=0;u.forceReduce()&&e<10&&!this.advanceFully(u,n);e++)Tse&&(d=this.stackID(u)+" -> ");for(let e of l.recoverByInsert(a))this.advanceFully(e,n);this.stream.end>l.pos?(s==l.pos&&(s++,a=0),l.recoverByDelete(a,s),jse(l,n)):(!o||o.scoree;class zse extends bte{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[t][1])),o=[];for(let l=0;l=0)r(n,e,l[t++]);else{let o=l[t+-n];for(let i=-n;i>0;i--)r(l[t++],e,o);t++}}}this.nodeSet=new Xee(t.map(((t,r)=>Vee.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:o[r],top:n.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Lee;let i=yse(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l"number"==typeof e?new $se(i,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let o=new Dse(this,e,t,n);for(let r of this.wrappers)o=r(o,e,t,n);return o}getGoto(e,t,n=!1){let o=this.goto;if(t>=o[0])return-1;for(let r=o[t+1];;){let t=o[r++],i=1&t,l=o[r++];if(i&&n)return l;for(let n=r+(t>>1);r0}validAction(e,t){return!!this.allActions(e,(e=>e==t||null))}allActions(e,t){let n=this.stateSlot(e,4),o=n?t(n):void 0;for(let r=this.stateSlot(e,1);null==o;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=_se(this.data,r+2)}o=t(_se(this.data,r+1))}return o}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=_se(this.data,n+2)}if(0==(1&this.data[n+2])){let e=this.data[n+1];t.some(((t,n)=>1&n&&t==e))||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(zse.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map((t=>{let n=e.tokenizers.find((e=>e.from==t));return n?n.to:t}))),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map(((n,o)=>{let r=e.specializers.find((e=>e.from==n.external));if(!r)return n;let i=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[o]=Lse(i),i}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map((()=>!1));if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let o=null;for(let r=0;re.external(n,o)<<1|t}return e.get}const Qse=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Hse=new class{constructor(e){this.start=e.start,this.shift=e.shift||Nse,this.reduce=e.reduce||Nse,this.reuse=e.reuse||Nse,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}({start:!1,shift:(e,t)=>4==t||5==t||312==t?e:313==t,strict:!1}),Fse=new Cse(((e,t)=>{let{next:n}=e;(125==n||-1==n||t.context)&&e.acceptToken(310)}),{contextual:!0,fallback:!0}),Wse=new Cse(((e,t)=>{let n,{next:o}=e;Qse.indexOf(o)>-1||(47!=o||47!=(n=e.peek(1))&&42!=n)&&(125==o||59==o||-1==o||t.context||e.acceptToken(309))}),{contextual:!0}),Zse=new Cse(((e,t)=>{let{next:n}=e;if((43==n||45==n)&&(e.advance(),n==e.next)){e.advance();let n=!t.context&&t.canShift(1);e.acceptToken(n?1:2)}}),{contextual:!0});function Vse(e,t){return e>=65&&e<=90||e>=97&&e<=122||95==e||e>=192||!t&&e>=48&&e<=57}const Xse=new Cse(((e,t)=>{if(60!=e.next||!t.dialectEnabled(0))return;if(e.advance(),47==e.next)return;let n=0;for(;Qse.indexOf(e.next)>-1;)e.advance(),n++;if(Vse(e.next,!0)){for(e.advance(),n++;Vse(e.next,!1);)e.advance(),n++;for(;Qse.indexOf(e.next)>-1;)e.advance(),n++;if(44==e.next)return;for(let t=0;;t++){if(7==t){if(!Vse(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),n++}}e.acceptToken(3,-n)})),Yse=Ste({"get set async static":Zte.modifier,"for while do if else switch try catch finally return throw break continue default case":Zte.controlKeyword,"in of await yield void typeof delete instanceof":Zte.operatorKeyword,"let var const using function class extends":Zte.definitionKeyword,"import export from":Zte.moduleKeyword,"with debugger as new":Zte.keyword,TemplateString:Zte.special(Zte.string),super:Zte.atom,BooleanLiteral:Zte.bool,this:Zte.self,null:Zte.null,Star:Zte.modifier,VariableName:Zte.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Zte.function(Zte.variableName),VariableDefinition:Zte.definition(Zte.variableName),Label:Zte.labelName,PropertyName:Zte.propertyName,PrivatePropertyName:Zte.special(Zte.propertyName),"CallExpression/MemberExpression/PropertyName":Zte.function(Zte.propertyName),"FunctionDeclaration/VariableDefinition":Zte.function(Zte.definition(Zte.variableName)),"ClassDeclaration/VariableDefinition":Zte.definition(Zte.className),PropertyDefinition:Zte.definition(Zte.propertyName),PrivatePropertyDefinition:Zte.definition(Zte.special(Zte.propertyName)),UpdateOp:Zte.updateOperator,"LineComment Hashbang":Zte.lineComment,BlockComment:Zte.blockComment,Number:Zte.number,String:Zte.string,Escape:Zte.escape,ArithOp:Zte.arithmeticOperator,LogicOp:Zte.logicOperator,BitOp:Zte.bitwiseOperator,CompareOp:Zte.compareOperator,RegExp:Zte.regexp,Equals:Zte.definitionOperator,Arrow:Zte.function(Zte.punctuation),": Spread":Zte.punctuation,"( )":Zte.paren,"[ ]":Zte.squareBracket,"{ }":Zte.brace,"InterpolationStart InterpolationEnd":Zte.special(Zte.brace),".":Zte.derefOperator,", ;":Zte.separator,"@":Zte.meta,TypeName:Zte.typeName,TypeDefinition:Zte.definition(Zte.typeName),"type enum interface implements namespace module declare":Zte.definitionKeyword,"abstract global Privacy readonly override":Zte.modifier,"is keyof unique infer":Zte.operatorKeyword,JSXAttributeValue:Zte.attributeValue,JSXText:Zte.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Zte.angleBracket,"JSXIdentifier JSXNameSpacedName":Zte.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Zte.attributeName,"JSXBuiltin/JSXIdentifier":Zte.standard(Zte.tagName)}),Kse={__proto__:null,export:18,as:23,from:31,default:34,async:39,function:40,extends:52,this:56,true:64,false:64,null:76,void:80,typeof:84,super:102,new:136,delete:152,yield:161,await:165,class:170,public:227,private:227,protected:227,readonly:229,instanceof:248,satisfies:251,in:252,const:254,import:286,keyof:339,unique:343,infer:349,is:385,abstract:405,implements:407,type:409,let:412,var:414,using:417,interface:423,enum:427,namespace:433,module:435,declare:439,global:443,for:462,of:471,while:474,with:478,do:482,if:486,else:488,switch:492,case:498,try:504,catch:508,finally:512,return:516,throw:520,break:524,continue:528,debugger:532},Gse={__proto__:null,async:123,get:125,set:127,declare:187,public:189,private:189,protected:189,static:191,abstract:193,override:195,readonly:201,accessor:203,new:389},Use={__proto__:null,"<":143},qse=zse.deserialize({version:14,states:"$RQWO'#CdO>cQWO'#H[O>kQWO'#HbO>kQWO'#HdO`Q^O'#HfO>kQWO'#HhO>kQWO'#HkO>pQWO'#HqO>uQ07iO'#HwO%[Q^O'#HyO?QQ07iO'#H{O?]Q07iO'#H}O9kQ07hO'#IPO?hQ08SO'#ChO@jQ`O'#DiQOQWOOO%[Q^O'#EPOAQQWO'#ESO:RQ7[O'#EjOA]QWO'#EjOAhQpO'#FbOOQU'#Cf'#CfOOQ07`'#Dn'#DnOOQ07`'#Jm'#JmO%[Q^O'#JmOOQO'#Jq'#JqOOQO'#Ib'#IbOBhQ`O'#EcOOQ07`'#Eb'#EbOCdQ07pO'#EcOCnQ`O'#EVOOQO'#Jp'#JpODSQ`O'#JqOEaQ`O'#EVOCnQ`O'#EcPEnO!0LbO'#CaPOOO)CDu)CDuOOOO'#IX'#IXOEyO!bO,59TOOQ07b,59T,59TOOOO'#IY'#IYOFXO#tO,59TO%[Q^O'#D`OOOO'#I['#I[OFgO?MpO,59xOOQ07b,59x,59xOFuQ^O'#I]OGYQWO'#JkOI[QrO'#JkO+}Q^O'#JkOIcQWO,5:OOIyQWO'#ElOJWQWO'#JyOJcQWO'#JxOJcQWO'#JxOJkQWO,5;YOJpQWO'#JwOOQ07f,5:Z,5:ZOJwQ^O,5:ZOLxQ08SO,5:eOMiQWO,5:mONSQ07hO'#JvONZQWO'#JuO9ZQWO'#JuONoQWO'#JuONwQWO,5;XON|QWO'#JuO!#UQrO'#JjOOQ07b'#Ch'#ChO%[Q^O'#ERO!#tQpO,5:rOOQO'#Jr'#JrOOQO-EmOOQU'#J`'#J`OOQU,5>n,5>nOOQU-EpQWO'#HQO9aQWO'#HSO!CgQWO'#HSO:RQ7[O'#HUO!ClQWO'#HUOOQU,5=j,5=jO!CqQWO'#HVO!DSQWO'#CnO!DXQWO,59OO!DcQWO,59OO!FhQ^O,59OOOQU,59O,59OO!FxQ07hO,59OO%[Q^O,59OO!ITQ^O'#H^OOQU'#H_'#H_OOQU'#H`'#H`O`Q^O,5=vO!IkQWO,5=vO`Q^O,5=|O`Q^O,5>OO!IpQWO,5>QO`Q^O,5>SO!IuQWO,5>VO!IzQ^O,5>]OOQU,5>c,5>cO%[Q^O,5>cO9kQ07hO,5>eOOQU,5>g,5>gO!NUQWO,5>gOOQU,5>i,5>iO!NUQWO,5>iOOQU,5>k,5>kO!NZQ`O'#D[O%[Q^O'#JmO!NxQ`O'#JmO# gQ`O'#DjO# xQ`O'#DjO#$ZQ^O'#DjO#$bQWO'#JlO#$jQWO,5:TO#$oQWO'#EpO#$}QWO'#JzO#%VQWO,5;ZO#%[Q`O'#DjO#%iQ`O'#EUOOQ07b,5:n,5:nO%[Q^O,5:nO#%pQWO,5:nO>pQWO,5;UO!@}Q`O,5;UO!AVQ7[O,5;UO:RQ7[O,5;UO#%xQWO,5@XO#%}Q$ISO,5:rOOQO-E<`-E<`O#'TQ07pO,5:}OCnQ`O,5:qO#'_Q`O,5:qOCnQ`O,5:}O!@rQ07hO,5:qOOQ07`'#Ef'#EfOOQO,5:},5:}O%[Q^O,5:}O#'lQ07hO,5:}O#'wQ07hO,5:}O!@}Q`O,5:qOOQO,5;T,5;TO#(VQ07hO,5:}POOO'#IV'#IVP#(kO!0LbO,58{POOO,58{,58{OOOO-EwO+}Q^O,5>wOOQO,5>},5>}O#)VQ^O'#I]OOQO-EpQ08SO1G0{O#>wQ08SO1G0{O#@oQ08SO1G0{O#CoQ(CYO'#ChO#EmQ(CYO1G1^O#EtQ(CYO'#JjO!,lQWO1G1dO#FUQ08SO,5?TOOQ07`-EkQWO1G3lO$2^Q^O1G3nO$6bQ^O'#HmOOQU1G3q1G3qO$6oQWO'#HsO>pQWO'#HuOOQU1G3w1G3wO$6wQ^O1G3wO9kQ07hO1G3}OOQU1G4P1G4POOQ07`'#GY'#GYO9kQ07hO1G4RO9kQ07hO1G4TO$;OQWO,5@XO!*fQ^O,5;[O9ZQWO,5;[O>pQWO,5:UO!*fQ^O,5:UO!@}Q`O,5:UO$;TQ(CYO,5:UOOQO,5;[,5;[O$;_Q`O'#I^O$;uQWO,5@WOOQ07b1G/o1G/oO$;}Q`O'#IdO$pQWO1G0pO!@}Q`O1G0pO!AVQ7[O1G0pOOQ07`1G5s1G5sO!@rQ07hO1G0]OOQO1G0i1G0iO%[Q^O1G0iO$wO$>TQWO1G5qO$>]QWO1G6OO$>eQrO1G6PO9ZQWO,5>}O$>oQ08SO1G5|O%[Q^O1G5|O$?PQ07hO1G5|O$?bQWO1G5{O$?bQWO1G5{O9ZQWO1G5{O$?jQWO,5?QO9ZQWO,5?QOOQO,5?Q,5?QO$@OQWO,5?QO$'TQWO,5?QOOQO-EXOOQU,5>X,5>XO%[Q^O'#HnO%7^QWO'#HpOOQU,5>_,5>_O9ZQWO,5>_OOQU,5>a,5>aOOQU7+)c7+)cOOQU7+)i7+)iOOQU7+)m7+)mOOQU7+)o7+)oO%7cQ`O1G5sO%7wQ(CYO1G0vO%8RQWO1G0vOOQO1G/p1G/pO%8^Q(CYO1G/pO>pQWO1G/pO!*fQ^O'#DjOOQO,5>x,5>xOOQO-E<[-E<[OOQO,5?O,5?OOOQO-EpQWO7+&[O!@}Q`O7+&[OOQO7+%w7+%wO$=gQ08SO7+&TOOQO7+&T7+&TO%[Q^O7+&TO%8hQ07hO7+&TO!@rQ07hO7+%wO!@}Q`O7+%wO%8sQ07hO7+&TO%9RQ08SO7++hO%[Q^O7++hO%9cQWO7++gO%9cQWO7++gOOQO1G4l1G4lO9ZQWO1G4lO%9kQWO1G4lOOQO7+%|7+%|O#%sQWO<tQ08SO1G2ZO%AVQ08SO1G2mO%CbQ08SO1G2oO%EmQ7[O,5>yOOQO-E<]-E<]O%EwQrO,5>zO%[Q^O,5>zOOQO-E<^-E<^O%FRQWO1G5uOOQ07b<YOOQU,5>[,5>[O&5cQWO1G3yO9ZQWO7+&bO!*fQ^O7+&bOOQO7+%[7+%[O&5hQ(CYO1G6PO>pQWO7+%[OOQ07b<pQWO<pQWO7+)eO'&gQWO<}AN>}O%[Q^OAN?ZOOQO<eQ(CYOG26}O!*fQ^O'#DyO1PQWO'#EWO'@ZQrO'#JiO!*fQ^O'#DqO'@bQ^O'#D}O'@iQrO'#ChO'CPQrO'#ChO!*fQ^O'#EPO'CaQ^O,5;VO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O'#IiO'EdQWO,5a#@O#@^#@d#Ax#BW#Cr#DQ#DW#D^#Dd#Dn#Dt#Dz#EU#Eh#EnPPPPPPPPPP#EtPPPPPPP#Fi#Ip#KP#KW#K`PPPP$!d$%Z$+r$+u$+x$,q$,t$,w$-O$-WPP$-^$-b$.Y$/X$/]$/qPP$/u$/{$0PP$0S$0W$0Z$1P$1h$2P$2T$2W$2Z$2a$2d$2h$2lR!{RoqOXst!Z#c%j&m&o&p&r,h,m1w1zY!uQ'Z-Y1[5]Q%pvQ%xyQ&P|Q&e!VS'R!e-QQ'a!iS'g!r!xS*c$|*hQ+f%yQ+s&RQ,X&_Q-W'YQ-b'bQ-j'hQ/|*jQ1f,YR;Y:g%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%j%p%}&f&i&m&o&p&r&v'O']'m'}(P(V(^(r(v(z)y+O+S,e,h,m-^-f-t-z.l.s0[0a0q1_1o1p1r1t1w1z1|2m2s3Z5Y5d5t5u5x6]7w7|8]8gS#p]:d!r)[$[$m'S)n,y,|.{2]3p5W6S9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]Q*u%ZQ+k%{Q,Z&bQ,b&jQ.c;QQ0h+^Q0l+`Q0w+lQ1n,`Q2{.[Q4v0rQ5k1gQ6i3PQ6u;RQ7h4wR8m6j&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%j%p%}&f&i&j&m&o&p&r&v'O'S']'m'}(P(V(^(r(v(z)n)y+O+S+^,e,h,m,y,|-^-f-t-z.[.l.s.{0[0a0q1_1o1p1r1t1w1z1|2]2m2s3P3Z3p5W5Y5d5t5u5x6S6]6j7w7|8]8g9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]t!nQ!r!u!x!y'R'Y'Z'g'h'i-Q-W-Y-j1[5]5_$v$si#u#w$c$d$x${%O%Q%[%]%a)u){)}*P*R*Y*`*p*q+]+`+w+z.Z.i/Z/j/k/m0Q0S0^1R1U1^3O3x4S4[4f4n4p5c6g7T7^7y8j8w9[9n:O:W:y:z:|:};O;P;S;T;U;V;W;X;_;`;a;b;c;d;g;h;i;j;k;l;m;n;q;r < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:371,context:Hse,nodeProps:[["isolate",-8,4,5,13,33,35,48,50,52,""],["group",-26,8,16,18,65,201,205,209,210,212,215,218,228,230,236,238,240,242,245,251,257,259,261,263,265,267,268,"Statement",-32,12,13,28,31,32,38,48,51,52,54,59,67,75,79,81,83,84,106,107,116,117,134,137,139,140,141,142,144,145,164,165,167,"Expression",-23,27,29,33,37,39,41,168,170,172,173,175,176,177,179,180,181,183,184,185,195,197,199,200,"Type",-3,87,99,105,"ClassItem"],["openedBy",22,"<",34,"InterpolationStart",53,"[",57,"{",72,"(",157,"JSXStartCloseTag"],["closedBy",23,">",36,"InterpolationEnd",47,"]",58,"}",73,")",162,"JSXEndTag"]],propSources:[Yse],skippedNodes:[0,4,5,271],repeatNodeCount:37,tokenData:"$Fj(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Ns!`!a$#_!a!b$(l!b!c$,k!c!}Er!}#O$-u#O#P$/P#P#Q$4h#Q#R$5r#R#SEr#S#T$7P#T#o$8Z#o#p$q#r#s$?}#s$f%Z$f$g+g$g#BYEr#BY#BZ$AX#BZ$ISEr$IS$I_$AX$I_$I|Er$I|$I}$Dd$I}$JO$Dd$JO$JTEr$JT$JU$AX$JU$KVEr$KV$KW$AX$KW&FUEr&FU&FV$AX&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AX?HUOEr(n%d_$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$f&j(OpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(OpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$f&j(Op(R!b't(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST(P#S$f&j'u(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$f&j(Op(R!b'u(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$f&j!o$Ip(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/|3l_'}$(n$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$f&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$a`$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$a``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$a`$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(R!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$a`(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k#%|:hh$f&j(Op(R!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXVS$f&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSVSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWVS(R!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]VS$f&j(OpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWVS(OpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYVS(Op(R!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$f&j!USOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$f&j!USO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!USOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!US#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$f&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$f&j(R!b!USOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ(R!b!USOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb(R!b!USOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX(R!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$f&j(R!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Kse[e]||-1},{term:334,get:e=>Gse[e]||-1},{term:70,get:e=>Use[e]||-1}],tokenPrec:14626}),Jse=[Gle("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),Gle("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),Gle("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Gle("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Gle("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),Gle("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),Gle("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),Gle("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),Gle("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),Gle('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Gle('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],ece=Jse.concat([Gle("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Gle("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Gle("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),tce=new mte,nce=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function oce(e){return(t,n)=>{let o=t.node.getChild("VariableDefinition");return o&&n(o,e),!0}}const rce=["FunctionDeclaration"],ice={FunctionDeclaration:oce("function"),ClassDeclaration:oce("class"),ClassExpression:()=>!0,EnumDeclaration:oce("constant"),TypeAliasDeclaration:oce("type"),NamespaceDeclaration:oce("namespace"),VariableDefinition(e,t){e.matchContext(rce)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function lce(e,t){let n=tce.get(t);if(n)return n;let o=[],r=!0;function i(t,n){let r=e.sliceString(t.from,t.to);o.push({label:r,type:n})}return t.cursor(Gee.IncludeAnonymous).iterate((t=>{if(r)r=!1;else if(t.name){let e=ice[t.name];if(e&&e(t,i)||nce.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of lce(e,t.node))o.push(n);return!1}})),tce.set(t,o),o}const ace=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,sce=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function cce(e){let t=Jte(e.state).resolveInner(e.pos,-1);if(sce.indexOf(t.name)>-1)return null;let n="VariableName"==t.name||t.to-t.from<20&&ace.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let o=[];for(let r=t;r;r=r.parent)nce.has(r.name)&&(o=o.concat(lce(e.state.doc,r)));return{options:o,from:n?t.from:e.pos,validFor:ace}}const uce=qte.define({name:"javascript",parser:qse.configure({props:[mne.add({IfStatement:Sne({except:/^\s*({|else\b)/}),TryStatement:Sne({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:e=>e.baseIndent,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),o=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:o?1:2)*e.unit},Block:xne({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Sne({except:/^{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag":e=>e.column(e.node.from)+e.unit}),kne.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to({from:e.from+2,to:e.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),dce={test:e=>/^JSX/.test(e.name),facet:Yte({commentTokens:{block:{open:"{/*",close:"*/}"}}})},pce=uce.configure({dialect:"ts"},"typescript"),hce=uce.configure({dialect:"jsx",props:[Kte.add((e=>e.isTop?[dce]:void 0))]}),fce=uce.configure({dialect:"jsx ts",props:[Kte.add((e=>e.isTop?[dce]:void 0))]},"typescript");let gce=e=>({label:e,type:"keyword"});const mce="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(gce),vce=mce.concat(["declare","implements","private","protected","public"].map(gce));function bce(e={}){let t=e.jsx?e.typescript?fce:hce:e.typescript?pce:uce,n=e.typescript?ece.concat(vce):Jse.concat(mce);return new cne(t,[uce.data.of({autocomplete:(o=sce,r=tle(n),e=>{for(let t=Jte(e.state).resolveInner(e.pos,-1);t;t=t.parent){if(o.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return r(e)})}),uce.data.of({autocomplete:cce}),e.jsx?wce:[]]);var o,r}function yce(e,t,n=e.length){for(let o=null==t?void 0:t.firstChild;o;o=o.nextSibling)if("JSXIdentifier"==o.name||"JSXBuiltin"==o.name||"JSXNamespacedName"==o.name||"JSXMemberExpression"==o.name)return e.sliceString(o.from,Math.min(o.to,n));return""}const Oce="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),wce=q7.inputHandler.of(((e,t,n,o,r)=>{if((Oce?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||">"!=o&&"/"!=o||!uce.isActiveAt(e.state,t,-1))return!1;let i=r(),{state:l}=i,a=l.changeByRange((e=>{var t;let n,{head:r}=e,i=Jte(l).resolveInner(r-1,-1);if("JSXStartTag"==i.name&&(i=i.parent),l.doc.sliceString(r-1,r)!=o||"JSXAttributeValue"==i.name&&i.to>r);else{if(">"==o&&"JSXFragmentTag"==i.name)return{range:e,changes:{from:r,insert:""}};if("/"==o&&"JSXStartCloseTag"==i.name){let e=i.parent,o=e.parent;if(o&&e.from==r-2&&((n=yce(l.doc,o.firstChild,r))||"JSXFragmentTag"==(null===(t=o.firstChild)||void 0===t?void 0:t.name))){let e=`${n}>`;return{range:W3.cursor(r+e.length,-1),changes:{from:r,insert:e}}}}else if(">"==o){let t=function(e){for(;;){if("JSXOpenTag"==e.name||"JSXSelfClosingTag"==e.name||"JSXFragmentTag"==e.name)return e;if("JSXEscape"==e.name||!e.parent)return null;e=e.parent}}(i);if(t&&!/^\/?>|^<\//.test(l.doc.sliceString(r,r+2))&&(n=yce(l.doc,t,r)))return{range:e,changes:{from:r,insert:``}}}}return{range:e}}));return!a.changes.empty&&(e.dispatch([i,l.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),xce=S2(Ln({__name:"BranchDrawer",props:{open:N1().def(!1),len:_1().def(0),modelValue:Q1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot({}),l=Ot({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"500px",overflowY:"auto",overflowX:"hidden"}});wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{n("update:modelValue",i.value)},s=Ot(),c=()=>{var e;null==(e=s.value)||e.validate().then((()=>{d(),n("save",i.value)})).catch((()=>{xB.warning("请检查表单信息")}))},u=async()=>{const{key:e,value:t}=await d1("/workflow/check-node-expression","post",i.value.decision);return 1!==e?Promise.reject(t??"请检查条件表达式"):Promise.resolve()},d=()=>{n("update:open",!1),r.value=!1};return(t,n)=>{const o=fn("a-typography-paragraph"),p=fn("a-select-option"),h=fn("a-select"),f=fn("a-radio"),g=fn("a-radio-group"),m=fn("a-form-item"),v=fn("a-form"),b=fn("a-button"),y=fn("a-drawer");return hr(),br(y,{open:r.value,"onUpdate:open":n[5]||(n[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:d},{title:sn((()=>[Cr(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:a},{editableEnterIcon:sn((()=>[Pr(X(null))])),_:1},8,["content"])])),extra:sn((()=>[Cr(h,{value:i.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>i.value.priorityLevel=e),style:{width:"110px"}},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.len-1,(e=>(hr(),br(p,{key:e,value:e},{default:sn((()=>[Pr("优先级 "+X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:sn((()=>[Cr(b,{type:"primary",onClick:c},{default:sn((()=>[Pr("保存")])),_:1}),Cr(b,{style:{"margin-left":"12px"},onClick:d},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(v,{layout:"vertical",ref_key:"formRef",ref:s,model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(m,{name:["decision","logicalCondition"],label:"判定逻辑",rules:[{required:!0,message:"请选择判定逻辑",trigger:"change"}]},{default:sn((()=>[Cr(g,{value:i.value.decision.logicalCondition,"onUpdate:value":n[2]||(n[2]=e=>i.value.decision.logicalCondition=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(o2)),(e=>(hr(),br(f,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(m,{name:["decision","expressionType"],label:"表达式类型",rules:[{required:!0,message:"请选择表达式类型",trigger:"change"}]},{default:sn((()=>[Cr(g,{value:i.value.decision.expressionType,"onUpdate:value":n[3]||(n[3]=e=>i.value.decision.expressionType=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(q1)),(e=>(hr(),br(f,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(m,{name:["decision","nodeExpression"],label:"条件表达式",rules:[{required:!0,message:"请填写条件表达式",trigger:"change"},{validator:u,trigger:"blur"}]},{default:sn((()=>[Cr(Ct(rse),{modelValue:i.value.decision.nodeExpression,"onUpdate:modelValue":n[4]||(n[4]=e=>i.value.decision.nodeExpression=e),theme:l.value,basic:"",lang:Ct(bce)(),extensions:[Ct(hse)]},null,8,["modelValue","theme","lang","extensions"])])),_:1},8,["rules"])])),_:1},8,["model"])])),_:1},8,["open"])}}}),[["__scopeId","data-v-83531903"]]),$ce=S2(Ln({__name:"BranchDesc",props:{modelValue:Q1().def({})},setup(e){const t=e,n=Ot("");Gn((()=>{var e;Zt((()=>{r()})),(null==(e=t.modelValue.decision)?void 0:e.nodeExpression)&&(n.value=t.modelValue.decision.nodeExpression)}));const o=Ot({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"520px",overflowY:"auto",overflowX:"hidden"}}),r=()=>{const e=document.getElementById("branch-desc"),t=null==e?void 0:e.querySelector(".ant-descriptions-view"),n=null==t?void 0:t.querySelector("tbody"),o=document.createElement("tr");o.className="ant-descriptions-row";const r=document.createElement("th");r.className="ant-descriptions-item-label",r.innerHTML="条件表达式",r.setAttribute("colspan","4"),o.appendChild(r),null==n||n.insertBefore(o,null==n?void 0:n.childNodes[3]);const i=(null==n?void 0:n.getElementsByClassName("ant-descriptions-row"))[3];i.childNodes[2].remove();const l=i.querySelector(".ant-descriptions-item-content");l.setAttribute("style","padding: 0"),null==l||l.setAttribute("colspan","4")};return(t,r)=>{const i=fn("a-descriptions-item"),l=fn("a-descriptions");return hr(),br(l,{id:"branch-desc",column:2,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(i,{label:"节点名称",span:2},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(i,{label:"判定逻辑"},{default:sn((()=>{var t;return[Pr(X(Ct(o2)[null==(t=e.modelValue.decision)?void 0:t.logicalCondition]),1)]})),_:1}),Cr(i,{label:"表达式类型"},{default:sn((()=>{var t;return[Pr(X(Ct(q1)[null==(t=e.modelValue.decision)?void 0:t.expressionType]),1)]})),_:1}),Cr(i,{label:"条件表达式",span:2},{default:sn((()=>[Cr(Ct(rse),{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=e=>n.value=e),readonly:"",disabled:"",theme:o.value,basic:"",lang:Ct(bce)(),extensions:[Ct(hse)]},null,8,["modelValue","theme","lang","extensions"])])),_:1})])),_:1})}}}),[["__scopeId","data-v-dc9046db"]]),Sce=Ln({__name:"BranchDetail",props:{modelValue:Q1().def({}),open:N1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-drawer");return hr(),br(o,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr($ce,{"model-value":e.modelValue},null,8,["model-value"])])),_:1},8,["open"])}}}),Cce={class:"branch-wrap"},kce={class:"branch-box-wrap"},Pce={class:"branch-box"},Mce={class:"condition-node"},Tce={class:"condition-node-box"},Ice=["onClick"],Ece=["onClick"],Ace={class:"title"},Rce={class:"node-title"},Dce={class:"priority-title"},jce={class:"content"},Bce=["innerHTML"],Nce={key:1,class:"placeholder"},zce=["onClick"],_ce={key:1,class:"top-left-cover-line"},Lce={key:2,class:"bottom-left-cover-line"},Qce={key:3,class:"top-right-cover-line"},Hce={key:4,class:"bottom-right-cover-line"},Fce=(e=>(ln("data-v-9cc29834"),e=e(),an(),e))((()=>Sr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[Sr("span",{style:{"padding-left":"18px"}},"决策节点详情")],-1))),Wce=S2(Ln({__name:"BranchNode",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=u1(),i=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{const e=i.value.conditionNodes.length;i.value.conditionNodes.splice(-1,0,{nodeName:"条件"+e,priorityLevel:e,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1,defaultDecision:0}}),i.value.conditionNodes[e].priorityLevel=e+1},a=(e,t)=>{e.childNode?a(e.childNode,t):e.childNode=t},s=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},c=(e,t)=>{const{nodeName:n,decision:o}=e.conditionNodes[t],{logicalCondition:r,expressionType:i,nodeExpression:l}=o;return l?"其他情况"!==n?`${o2[r]}\n${q1[i]}\n${l}`:"如存在未满足其他分支条件的情况,则进入此分支":"其他情况"===n?"如存在未满足其他分支条件的情况,则进入此分支":void 0},u=Ot(0),d=Ot(!1),p=Ot([]),h=Ot({}),f=e=>{const t=i.value.conditionNodes[u.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[u.value]=e,t!==o&&s(u.value,o-t),n("update:modelValue",i.value)},g=Ot([]),m=Ot(""),v=Ot([]),b=(e,t)=>{var n,l;if(v.value=[],"其他情况"!==e.nodeName)if(2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=v.value)||t.push(e.id):e.jobId&&(m.value=e.jobId.toString())})),0===v.value.length)return void(p.value[t]=!0);g.value[t]=!0}else 1===r.TYPE?p.value[t]=!0:(l=t,o.disabled||l===i.value.conditionNodes.length-1?0!==r.TYPE&&(p.value[l]=!0):(u.value=l,h.value=JSON.parse(JSON.stringify(i.value.conditionNodes[l])),d.value=!0))},y=e=>o.disabled?2===r.TYPE?"其他情况"===e.nodeName?`node-disabled node-error node-error-${e.taskBatchStatus?i2[e.taskBatchStatus].name:"default"}`:`node-error node-error-${e.taskBatchStatus?i2[e.taskBatchStatus].name:"default"}`:"其他情况"===e.nodeName?"node-disabled":"node-error":"其他情况"===e.nodeName?"node-disabled":"auto-judge-def auto-judge-hover";return(t,o)=>{const u=fn("a-button"),O=fn("a-badge"),w=fn("a-tooltip");return hr(),vr("div",Cce,[Sr("div",kce,[Sr("div",Pce,[e.disabled?Mr("",!0):(hr(),br(u,{key:0,class:"add-branch",primary:"",onClick:l},{default:sn((()=>[Pr("添加条件")])),_:1})),(hr(!0),vr(ar,null,io(i.value.conditionNodes,((o,l)=>(hr(),vr("div",{class:"col-box",key:l},[Sr("div",Mce,[Sr("div",Tce,[Sr("div",{class:W(["auto-judge",y(o)]),onClick:e=>b(o,l)},[0!==l?(hr(),vr("div",{key:0,class:"sort-left",onClick:Zi((e=>s(l,-1)),["stop"])},[Cr(Ct(BR))],8,Ece)):Mr("",!0),Sr("div",Ace,[Sr("span",Rce,[Cr(O,{status:"processing",color:"#52c41a"}),Pr(" "+X(o.nodeName)+" ",1),"其他情况"===o.nodeName?(hr(),br(w,{key:0},{title:sn((()=>[Pr(" 该分支为系统默认创建,与其他分支互斥。只有当其他分支都无法运行时,才会运行该分支。 ")])),default:sn((()=>[Cr(Ct(m$),{style:{"margin-left":"3px"}})])),_:1})):Mr("",!0)]),Sr("span",Dce,"优先级"+X(o.priorityLevel),1),e.disabled?Mr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Zi((e=>{return t=l,null==(o=i.value.conditionNodes)||o.splice(t,1),void(1===i.value.conditionNodes.length&&(i.value.childNode&&(i.value.conditionNodes[0].childNode?a(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Zt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))));var t,o}),["stop"])},null,8,["onClick"]))]),Sr("div",jce,[c(i.value,l)?(hr(),vr("span",{key:0,innerHTML:c(i.value,l)},null,8,Bce)):(hr(),vr("span",Nce," 请设置条件 "))]),l!==i.value.conditionNodes.length-2?(hr(),vr("div",{key:1,class:"sort-right",onClick:Zi((e=>s(l)),["stop"])},[Cr(Ct(ok))],8,zce)):Mr("",!0),2===Ct(r).TYPE&&o.taskBatchStatus?(hr(),br(w,{key:2},{title:sn((()=>[Pr(X(Ct(i2)[o.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(U1),{class:"error-tip",color:Ct(i2)[o.taskBatchStatus].color,size:"24px",onClick:Zi((()=>{}),["stop"]),"model-value":Ct(i2)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Mr("",!0)],10,Ice),Cr(Q2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?ao(t.$slots,"default",{key:0,node:o},void 0,!0):Mr("",!0),0==l?(hr(),vr("div",_ce)):Mr("",!0),0==l?(hr(),vr("div",Lce)):Mr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",Qce)):Mr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",Hce)):Mr("",!0),0!==Ct(r).type&&p.value[l]?(hr(),br(Sce,{key:5,open:p.value[l],"onUpdate:open":e=>p.value[l]=e,modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):Mr("",!0),0!==Ct(r).TYPE&&g.value[l]?(hr(),br(Ct(A2),{key:6,open:g.value[l],"onUpdate:open":e=>g.value[l]=e,id:m.value,ids:v.value},{default:sn((()=>[Fce,Cr($ce,{modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["open","onUpdate:open","id","ids"])):Mr("",!0)])))),128))]),Cr(Q2,{disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])]),Cr(xce,{open:d.value,"onUpdate:open":o[1]||(o[1]=e=>d.value=e),modelValue:h.value,"onUpdate:modelValue":o[2]||(o[2]=e=>h.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:f},null,8,["open","modelValue","len"])])}}}),[["__scopeId","data-v-9cc29834"]]),Zce=Ln({__name:"CallbackDrawer",props:{open:N1().def(!1),len:_1().def(0),modelValue:Q1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot({});wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{n("update:modelValue",i.value)},a=Ot(),s=()=>{var e;null==(e=a.value)||e.validate().then((()=>{c(),n("save",i.value)})).catch((()=>{xB.warning("请检查表单信息")}))},c=()=>{n("update:open",!1),r.value=!1};return(e,t)=>{const n=fn("a-typography-paragraph"),o=fn("a-input"),u=fn("a-form-item"),d=fn("a-select-option"),p=fn("a-select"),h=fn("a-radio"),f=fn("a-radio-group"),g=fn("a-form"),m=fn("a-button"),v=fn("a-drawer");return hr(),br(v,{open:r.value,"onUpdate:open":t[5]||(t[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:c},{title:sn((()=>[Cr(n,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":t[0]||(t[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:l},null,8,["content"])])),footer:sn((()=>[Cr(m,{type:"primary",onClick:s},{default:sn((()=>[Pr("保存")])),_:1}),Cr(m,{style:{"margin-left":"12px"},onClick:c},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(g,{ref_key:"formRef",ref:a,layout:"vertical",model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(u,{name:["callback","webhook"],label:"webhook",rules:[{required:!0,message:"请输入 webhook",trigger:"change"}]},{default:sn((()=>[Cr(o,{value:i.value.callback.webhook,"onUpdate:value":t[1]||(t[1]=e=>i.value.callback.webhook=e),placeholder:"请输入 webhook"},null,8,["value"])])),_:1}),Cr(u,{name:["callback","contentType"],label:"请求类型",rules:[{required:!0,message:"请选择请求类型",trigger:"change"}]},{default:sn((()=>[Cr(p,{value:i.value.callback.contentType,"onUpdate:value":t[2]||(t[2]=e=>i.value.callback.contentType=e),placeholder:"请选择请求类型"},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(r2)),(e=>(hr(),br(d,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(u,{name:["callback","secret"],label:"秘钥",rules:[{required:!0,message:"请输入秘钥",trigger:"change"}]},{default:sn((()=>[Cr(o,{value:i.value.callback.secret,"onUpdate:value":t[3]||(t[3]=e=>i.value.callback.secret=e),placeholder:"请输入秘钥"},null,8,["value"])])),_:1}),Cr(u,{name:"workflowNodeStatus",label:"工作流状态",rules:[{required:!0,message:"请选择工作流状态",trigger:"change"}]},{default:sn((()=>[Cr(f,{value:i.value.workflowNodeStatus,"onUpdate:value":t[4]||(t[4]=e=>i.value.workflowNodeStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(n2)),(e=>(hr(),br(h,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),Vce=Ln({__name:"CallbackDetail",props:{modelValue:Q1().def({}),open:N1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-descriptions"),a=fn("a-drawer");return hr(),br(a,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"节点名称"},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(o,{label:"webhook"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.callback)?void 0:t.webhook),1)]})),_:1}),Cr(o,{label:"请求类型"},{default:sn((()=>{var t;return[Pr(X(Ct(r2)[null==(t=e.modelValue.callback)?void 0:t.contentType]),1)]})),_:1}),Cr(o,{label:"密钥"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.callback)?void 0:t.secret),1)]})),_:1})])),_:1})])),_:1},8,["open"])}}}),Xce=e=>(ln("data-v-714c9e92"),e=e(),an(),e),Yce={class:"node-wrap"},Kce={class:"branch-box"},Gce={class:"condition-node",style:{"min-height":"230px"}},Uce={class:"condition-node-box",style:{"padding-top":"0"}},qce={class:"popover"},Jce=Xce((()=>Sr("span",null,"重试",-1))),eue=Xce((()=>Sr("span",null,"忽略",-1))),tue=["onClick"],nue={class:"title"},oue={class:"text",style:{color:"#935af6"}},rue={class:"content",style:{"min-height":"81px"}},iue={key:0,class:"placeholder"},lue={style:{display:"flex","justify-content":"space-between"}},aue=Xce((()=>Sr("span",{class:"content_label"},"Webhook:",-1))),sue=Xce((()=>Sr("span",{class:"content_label"},"请求类型: ",-1))),cue=Xce((()=>Sr("div",null,".........",-1))),uue={key:1,class:"top-left-cover-line"},due={key:2,class:"bottom-left-cover-line"},pue={key:3,class:"top-right-cover-line"},hue={key:4,class:"bottom-right-cover-line"},fue=Xce((()=>Sr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[Sr("span",{style:{"padding-left":"18px"}},"回调节点详情")],-1))),gue=S2(Ln({__name:"CallbackNode",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=u1(),i=Ot({}),l=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{i.value.childNode&&(i.value.conditionNodes[0].childNode?s(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Zt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))},s=(e,t)=>{e.childNode?s(e.childNode,t):e.childNode=t},c=Ot(0),u=Ot(!1),d=Ot(!1),p=Ot({}),h=e=>{i.value.conditionNodes[c.value]=e,n("update:modelValue",i.value)},f=Ot(!1),g=Ot(""),m=Ot([]),v=(e,t)=>{var n,o;if(m.value=[],2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=m.value)||t.push(e.id):e.jobId&&(g.value=e.jobId.toString())})),0===m.value.length)return void(d.value=!0);f.value=!0}else 1===r.TYPE?d.value=!0:(o=t,0===r.TYPE?(c.value=o,p.value=JSON.parse(JSON.stringify(i.value.conditionNodes[o])),u.value=!0):d.value=!0)},b=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus?i2[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover";return(t,n)=>{const o=fn("a-divider"),s=fn("a-button"),c=fn("a-badge"),y=fn("a-typography-text"),O=fn("a-tooltip"),w=fn("a-popover"),x=fn("a-descriptions-item"),$=fn("a-descriptions");return hr(),vr("div",Yce,[Sr("div",Kce,[(hr(!0),vr(ar,null,io(i.value.conditionNodes,((n,u)=>(hr(),vr("div",{class:"col-box",key:u},[Sr("div",Gce,[Sr("div",Uce,[Cr(w,{open:l.value[u]&&2===Ct(r).TYPE,getPopupContainer:e=>e.parentNode,onOpenChange:e=>l.value[u]=e},{content:sn((()=>[Sr("div",qce,[Cr(o,{type:"vertical"}),Cr(s,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(TJ)),Jce])),_:1}),Cr(o,{type:"vertical"}),Cr(s,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(rJ)),eue])),_:1})])])),default:sn((()=>{var t,o;return[Sr("div",{class:W(["auto-judge",b(n)]),onClick:e=>v(n,u)},[Sr("div",nue,[Sr("span",oue,[Cr(c,{status:"processing",color:1===n.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Pr(" "+X(n.nodeName),1)]),e.disabled?Mr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Zi(a,["stop"])}))]),Sr("div",rue,[(null==(t=n.callback)?void 0:t.webhook)?Mr("",!0):(hr(),vr("div",iue,"请配置回调通知")),(null==(o=n.callback)?void 0:o.webhook)?(hr(),vr(ar,{key:1},[Sr("div",lue,[aue,Cr(y,{style:{width:"116px"},ellipsis:"",content:n.callback.webhook},null,8,["content"])]),Sr("div",null,[sue,Pr(" "+X(Ct(r2)[n.callback.contentType]),1)]),cue],64)):Mr("",!0)]),2===Ct(r).TYPE&&n.taskBatchStatus?(hr(),br(O,{key:0},{title:sn((()=>[Pr(X(Ct(i2)[n.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(U1),{class:"error-tip",color:Ct(i2)[n.taskBatchStatus].color,size:"24px",onClick:Zi((()=>{}),["stop"]),"model-value":Ct(i2)[n.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Mr("",!0)],10,tue)]})),_:2},1032,["open","getPopupContainer","onOpenChange"]),Cr(Q2,{disabled:e.disabled,modelValue:n.childNode,"onUpdate:modelValue":e=>n.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),n.childNode?ao(t.$slots,"default",{key:0,node:n},void 0,!0):Mr("",!0),0==u?(hr(),vr("div",uue)):Mr("",!0),0==u?(hr(),vr("div",due)):Mr("",!0),u==i.value.conditionNodes.length-1?(hr(),vr("div",pue)):Mr("",!0),u==i.value.conditionNodes.length-1?(hr(),vr("div",hue)):Mr("",!0)])))),128))]),i.value.conditionNodes.length>1?(hr(),br(Q2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):Mr("",!0),0!==Ct(r).type?(hr(),br(Vce,{key:1,open:d.value,"onUpdate:open":n[1]||(n[1]=e=>d.value=e),modelValue:i.value.conditionNodes[0],"onUpdate:modelValue":n[2]||(n[2]=e=>i.value.conditionNodes[0]=e)},null,8,["open","modelValue"])):Mr("",!0),Cr(Zce,{open:u.value,"onUpdate:open":n[3]||(n[3]=e=>u.value=e),modelValue:p.value,"onUpdate:modelValue":n[4]||(n[4]=e=>p.value=e),onSave:h},null,8,["open","modelValue"]),0!==Ct(r).TYPE&&f.value?(hr(),br(Ct(A2),{key:2,open:f.value,"onUpdate:open":n[5]||(n[5]=e=>f.value=e),id:g.value,ids:m.value},{default:sn((()=>[fue,Cr($,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(x,{label:"节点名称"},{default:sn((()=>[Pr(X(i.value.conditionNodes[0].nodeName),1)])),_:1}),Cr(x,{label:"webhook"},{default:sn((()=>{var e;return[Pr(X(null==(e=i.value.conditionNodes[0].callback)?void 0:e.webhook),1)]})),_:1}),Cr(x,{label:"请求类型"},{default:sn((()=>{var e;return[Pr(X(Ct(r2)[null==(e=i.value.conditionNodes[0].callback)?void 0:e.contentType]),1)]})),_:1}),Cr(x,{label:"密钥"},{default:sn((()=>{var e;return[Pr(X(null==(e=i.value.conditionNodes[0].callback)?void 0:e.secret),1)]})),_:1})])),_:1})])),_:1},8,["open","id","ids"])):Mr("",!0)])}}}),[["__scopeId","data-v-714c9e92"]]),mue=Ln({__name:"NodeWrap",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({});return wn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),wn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>{const o=fn("node-wrap",!0);return hr(),vr(ar,null,[1==r.value.nodeType?(hr(),br(d3,{key:0,modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Mr("",!0)])),_:1},8,["modelValue","disabled"])):Mr("",!0),2==r.value.nodeType?(hr(),br(Wce,{key:1,modelValue:r.value,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Mr("",!0)])),_:1},8,["modelValue","disabled"])):Mr("",!0),3==r.value.nodeType?(hr(),br(gue,{key:2,modelValue:r.value,"onUpdate:modelValue":n[2]||(n[2]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Mr("",!0)])),_:1},8,["modelValue","disabled"])):Mr("",!0),r.value.childNode?(hr(),br(o,{key:3,modelValue:r.value.childNode,"onUpdate:modelValue":n[3]||(n[3]=e=>r.value.childNode=e),disabled:e.disabled},null,8,["modelValue","disabled"])):Mr("",!0)],64)}}}),vue="*",bue="/",yue="-",Oue=",",wue="?",xue="L",$ue="W",Sue="#",Cue="",kue="LW",Pue=(new Date).getFullYear();function Mue(e){return"number"==typeof e||/^\d+(\.\d+)?$/.test(e)}const{hasOwnProperty:Tue}=Object.prototype;function Iue(e,t){return Object.keys(t).forEach((n=>{!function(e,t,n){const o=t[n];(function(e){return null!=e})(o)&&(Tue.call(e,n)&&function(e){return null!==e&&"object"==typeof e}(o)?e[n]=Iue(Object(e[n]),t[n]):e[n]=o)}(e,t,n)})),e}const Eue={common:{from:"从",fromThe:"从第",start:"开始",every:"每",between:"在",and:"到",end:"之间的",specified:"固定的",symbolTip:"通配符支持",valTip:"值为",nearest:"最近的",current:"本",nth:"第",index:"个",placeholder:"请选择",placeholderMulti:"请选择(支持多选)",help:"帮助",wordNumError:"格式不正确,必须有6或7位",reverse:"反向解析",reset:"重置",tagError:"表达式不正确",numError:"含有非法数字",use:"使用",inputPlaceholder:"Cron表达式"},custom:{unspecified:"不固定",workDay:"工作日",lastTh:"倒数第",lastOne:"最后一个",latestWorkday:"最后一个工作日",empty:"不配置"},second:{title:"秒",val:"0 1 2...59"},minute:{title:"分",val:"0 1 2...59"},hour:{title:"时",val:"0 1 2...23"},dayOfMonth:{timeUnit:"日",title:"日",val:"1 2...31"},month:{title:"月",val:"1 2...12,或12个月的缩写(JAN ... DEC)"},dayOfWeek:{timeUnit:"日",title:"周",val:"1 2...7或星期的缩写(SUN ... SAT)",SUN:"星期天",MON:"星期一",TUE:"星期二",WED:"星期三",THU:"星期四",FRI:"星期五",SAT:"星期六"},year:{title:"年",val:Pue+" ... 2099"},period:{startError:"开始格式不符",cycleError:"循环格式不符"},range:{lowerError:"下限格式不符",upperError:"上限格式不符",lowerBiggerThanUpperError:"下限不能比上限大"},weekDay:{weekDayNumError:"周数格式不符",nthError:"天数格式不符"},app:{title:"基于Vue&Element-ui实现的Cron表达式生成器",next10FireTimes:"最近10次执行时刻"},daysOfWeekOptions:[{label:"星期天",value:1},{label:"星期一",value:2},{label:"星期二",value:3},{label:"星期三",value:4},{label:"星期四",value:5},{label:"星期五",value:6},{label:"星期六",value:7}]},Aue=Ot("zh-CN"),Rue=it({"zh-CN":Eue}),Due={messages:()=>Rue[Aue.value],use(e,t){Aue.value=e,this.add({[e]:t})},add(e={}){Iue(Rue,e)}},jue=Due.messages(),Bue={class:"cron-body-row"},Nue={class:"symbol"},zue=S2(Ln({components:{Radio:ET},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:vue},tag:{type:String,default:vue},onChange:{type:Function}},setup:e=>({Message:jue,change:function(){e.onChange&&e.onChange({tag:vue,type:vue})},EVERY:vue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",Bue,[Cr(l,{checked:e.type===e.EVERY,onClick:e.change},{default:sn((()=>[Sr("span",Nue,X(e.EVERY),1),Pr(X(e.Message.common.every)+X(e.timeUnit),1)])),_:1},8,["checked","onClick"])])}]]),_ue=Due.messages(),Lue={class:"cron-body-row"},Que={class:"symbol"},Hue=S2(Ln({components:{Radio:ET,InputNumber:pQ},props:{startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:bue},tag:{type:String,default:bue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(0);n.value`${n.value}${bue}${o.value}`));function i(t){if(e.type!==bue)return;const r=t.split(bue);2===r.length?(r[0]===vue&&(r[0]=0),!Mue(r[0])||parseInt(r[0])e.startConfig.max?xB.error(`${_ue.period.startError}:${r[0]}`):!Mue(r[1])||parseInt(r[1])e.cycleConfig.max?xB.error(`${_ue.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1]))):xB.error(`${_ue.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:_ue,type_:t,start:n,cycle:o,tag_:r,PERIOD:bue,change:function(){e.onChange&&e.onChange({type:bue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",Lue,[Cr(a,{checked:e.type===e.PERIOD,onChange:e.change},{default:sn((()=>[Sr("span",Que,X(e.tag_),1),Pr(" "+X(e.Message.common.fromThe)+" ",1),Cr(l,{size:"small",value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),min:e.startConfig.min,step:e.startConfig.step,max:e.startConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.start)+X(e.Message.common.every)+" ",1),Cr(l,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Fue=Due.messages(),Wue={class:"cron-body-row"},Zue={class:"symbol"},Vue=S2(Ln({components:{Radio:ET,InputNumber:pQ},props:{upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:yue},tag:{type:String,default:yue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(0);o.value`${o.value}${yue}${n.value}`));function l(t){if(e.type!==yue)return;const r=t.split(yue);2===r.length&&(r[0]===yue&&(r[0]=0),!Mue(r[0])||parseInt(r[0])e.lowerConfig.max||!Mue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Gn((()=>{l(e.tag)})),wn((()=>e.tag),(e=>{l(e)}),{deep:!0}),wn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:Fue,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:yue,change:function(){e.onChange&&e.onChange({type:yue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",Wue,[Cr(a,{checked:e.type===e.RANGE,onChange:e.change},{default:sn((()=>[Sr("span",Zue,X(e.tag_),1),Pr(" "+X(e.Message.common.between)+" ",1),Cr(l,{size:"small",value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),min:e.lowerConfig.min,step:e.lowerConfig.step,max:e.upper_,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.and)+" ",1),Cr(l,{size:"small",value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),min:e.lower,step:e.upperConfig.step,max:e.upperConfig.max,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.Message.common.end)+X(e.Message.common.every)+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Xue=Due.messages(),Yue=Ln({components:{Radio:ET,ASelect:Zx,Tooltip:$S},props:{nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Oue},tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Yr((()=>{let e="";if(o.value&&o.value.length){o.value.sort();for(let t=0;t{Mue(t)&&parseInt(t)>=parseInt(e.nums[0].value)&&parseInt(t)<=parseInt(e.nums[e.nums.length-1].value)&&o.value.push(parseInt(t))}))}}return Gn((()=>{i()})),wn((()=>e.tag),(()=>i()),{deep:!0}),wn((()=>e.type),(()=>i()),{deep:!0}),{Message:Xue,type_:t,tag_:n,open:r,FIXED:Oue,change:function(){e.onChange&&e.onChange({type:Oue,tag:n.value||Oue})},numArray:o,changeTag:i}}}),Kue={class:"cron-body-row"},Gue=Sr("span",{class:"symbol"},",",-1),Uue=S2(Yue,[["render",function(e,t,n,o,r,i){const l=fn("Tooltip"),a=fn("Radio"),s=fn("ASelect");return hr(),vr("div",Kue,[Cr(a,{checked:e.type===e.FIXED,onChange:e.change},{default:sn((()=>[Cr(l,{title:e.tag_},{default:sn((()=>[Gue])),_:1},8,["title"]),Pr(" "+X(e.Message.common.specified),1)])),_:1},8,["checked","onChange"]),Cr(s,{size:"small",mode:"tags",placeholder:e.Message.common.placeholder,style:{width:"300px"},options:e.nums,disabled:e.type!==e.FIXED,value:e.numArray,"onUpdate:value":t[0]||(t[0]=t=>e.numArray=t),onChange:e.change},null,8,["placeholder","options","disabled","value","onChange"])])}]]),que={watch:{tag(e){this.resolveTag(e)}},mounted(){this.resolveTag(this.tag)},methods:{resolveTag(e){null==e&&(e=Cue);let t=null;(e=this.resolveCustom(e))===Cue?t=Cue:e===wue?t=wue:e===vue?t=vue:e===kue&&(t=kue),null==t&&(t=e.startsWith("L-")||e.endsWith(xue)?xue:e.endsWith($ue)&&e.length>1?$ue:e.indexOf(Sue)>0?Sue:e.indexOf(bue)>0?bue:e.indexOf(yue)>0?yue:Oue),this.type_=t,this.tag_=e},resolveCustom:e=>e}},Jue=Due.messages(),ede=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue},mixins:[que],props:{tag:{type:String,default:vue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(vue),a=Ot(e.tag);return{Message:Jue,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.second.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),tde=Due.messages(),nde=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue},mixins:[que],props:{tag:{type:String,default:vue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(vue),a=Ot(e.tag);return{Message:tde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.minute.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),ode=Due.messages(),rde=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue},mixins:[que],props:{tag:{type:String,default:vue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:23},n={min:1,step:1,max:23},o={min:0,step:1,max:23},r={min:0,step:1,max:23},i=[];for(let s=0;s<24;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(vue),a=Ot(e.tag);return{Message:ode,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.hour.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),ide=Due.messages(),lde={class:"cron-body-row"},ade={class:"symbol"},sde=S2(Ln({components:{Radio:ET},props:{type:{type:String,default:wue},tag:{type:String,default:wue},onChange:{type:Function}},setup:e=>({Message:ide,change:function(){e.onChange&&e.onChange({tag:wue,type:wue})},UNFIXED:wue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",lde,[Cr(l,{checked:e.type===e.UNFIXED,onClick:e.change},{default:sn((()=>[Sr("span",ade,X(e.UNFIXED),1),Pr(X(e.Message.custom.unspecified),1)])),_:1},8,["checked","onClick"])])}]]),cde=Due.messages(),ude={class:"cron-body-row"},dde={class:"symbol"},pde=S2(Ln({components:{Radio:ET,InputNumber:pQ},props:{lastConfig:{type:Object,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:xue},tag:{type:String,default:xue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Yr((()=>1===n.value?xue:"L-"+(n.value-1)));function r(t){if(e.type!==xue)return;if(t===xue)return void(n.value=1);const o=t.substring(2);Mue(o)&&parseInt(o)>=e.lastConfig.min&&parseInt(o)<=e.lastConfig.max?n.value=parseInt(o)+1:xB.error(cde.common.numError+":"+o)}return Gn((()=>{r(e.tag)})),wn((()=>e.tag),(e=>{r(e)}),{deep:!0}),wn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:cde,type_:t,tag_:o,LAST:xue,lastNum:n,change:function(){e.onChange&&e.onChange({type:xue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",ude,[Cr(a,{checked:e.type===e.LAST,onChange:e.change},{default:sn((()=>[Sr("span",dde,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.lastTh)+" ",1),Cr(l,{size:"small",value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),min:e.lastConfig.min,step:e.lastConfig.step,max:e.lastConfig.max,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),hde=Due.messages(),fde={class:"cron-body-row"},gde={class:"symbol"},mde=S2(Ln({components:{Radio:ET,InputNumber:pQ},props:{targetTimeUnit:{type:String,default:null},startDateConfig:{type:Object,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:$ue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${$ue}`));function i(t){if(e.type!==$ue)return;const o=t.substring(0,t.length-1);!Mue(o)||parseInt(o)e.startDateConfig.max?xB.error(`${hde.common.numError}:${o}`):n.value=parseInt(o)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:hde,type_:t,startDate:n,weekDayNum:o,tag_:r,WORK_DAY:$ue,change:function(){e.onChange&&e.onChange({type:$ue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("InputNumber");return hr(),vr("div",fde,[Cr(l,{checked:e.type===e.WORK_DAY,onChange:e.change},{default:sn((()=>[Sr("span",gde,X(e.tag_),1),Pr(" "+X(e.Message.common.every)+X(e.targetTimeUnit),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",value:e.startDate,"onUpdate:value":t[0]||(t[0]=t=>e.startDate=t),min:e.startDateConfig.min,step:e.startDateConfig.step,max:e.startDateConfig.max,disabled:e.type!==e.WORK_DAY,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.nearest)+X(e.Message.custom.workDay),1)])}]]),vde=Due.messages(),bde={class:"cron-body-row"},yde={class:"symbol"},Ode=S2(Ln({components:{Radio:ET},props:{targetTimeUnit:{type:String,default:null},type:{type:String,default:kue},tag:{type:String,default:kue},onChange:{type:Function}},setup:e=>({Message:vde,change:function(){e.onChange&&e.onChange({tag:kue,type:kue})},LAST_WORK_DAY:kue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",bde,[Cr(l,{checked:e.type===e.LAST_WORK_DAY,onClick:e.change},{default:sn((()=>[Sr("span",yde,X(e.LAST_WORK_DAY),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.latestWorkday),1)])),_:1},8,["checked","onClick"])])}]]),wde=Due.messages(),xde=31,$de=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue,UnFixed:sde,Last:pde,WorkDay:mde,LastWorkDay:Ode},mixins:[que],props:{tag:{type:String,default:vue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:xde},n={min:1,step:1,max:xde},o={min:1,step:1,max:xde},r={min:1,step:1,max:xde},i={min:1,step:1,max:xde},l=[];for(let c=1;c<32;c++){const e={label:c.toString(),value:c};l.push(e)}const a=Ot(vue),s=Ot(e.tag);return{Message:wde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,lastConfig:i,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("UnFixed"),d=fn("Last"),p=fn("WorkDay"),h=fn("LastWorkDay");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Cr(d,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"last-config":e.lastConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","last-config","onChange"]),Cr(p,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","start-date-config","onChange"]),Cr(h,{type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["type","tag","target-time-unit","start-date-config","onChange"])],64)}]]),Sde=Due.messages(),Cde=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue},mixins:[que],props:{tag:{type:String,default:vue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:12},n={min:1,step:1,max:12},o={min:1,step:1,max:12},r={min:1,step:1,max:12},i=[];for(let s=1;s<13;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(vue),a=Ot(e.tag);return{Message:Sde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.month.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),kde=Due.messages(),Pde={class:"cron-body-row"},Mde={class:"symbol"},Tde=S2(Ln({components:{Radio:ET},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:Cue},tag:{type:String,default:Cue},onChange:{type:Function}},setup:e=>({Message:kde,change:function(){e.onChange&&e.onChange({tag:Cue,type:Cue})},EMPTY:Cue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",Pde,[Cr(l,{checked:e.type===e.EMPTY,onClick:e.change},{default:sn((()=>[Sr("span",Mde,X(e.Message.custom.empty),1)])),_:1},8,["checked","onClick"])])}]]),Ide=Due.messages(),Ede=Pue,Ade=2099,Rde=S2(Ln({components:{Every:zue,Period:Hue,Range:Vue,Fixed:Uue,Empty:Tde},mixins:[que],props:{tag:{type:String,default:Cue},onChange:{type:Function}},setup(e){const t={min:Ede,step:1,max:Ade},n={min:1,step:1,max:Ade},o={min:Ede,step:1,max:Ade},r={min:Ede,step:1,max:Ade},i=[];for(let s=Ede;s<2100;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(Cue),a=Ot(e.tag);return{Message:Ide,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("Empty");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.year.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,tag:e.tag_,onChange:e.change},null,8,["type","tag","onChange"])],64)}]]),Dde=Due.messages(),jde={class:"cron-body-row"},Bde={class:"symbol"},Nde=S2(Ln({components:{Radio:ET,InputNumber:pQ,ASelect:Zx},props:{nums:{type:Array,default:null},startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:bue},tag:{type:String,default:bue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${bue}${o.value}`));function i(t){if(e.type!==bue)return;const r=t.split(bue);2===r.length?!Mue(r[0])||parseInt(r[0])e.startConfig.max?xB.error(`${Dde.period.startError}:${r[0]}`):!Mue(r[1])||parseInt(r[1])e.cycleConfig.max?xB.error(`${Dde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):xB.error(`${Dde.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Dde,type_:t,start:n,cycle:o,tag_:r,PERIOD:bue,change:function(){e.onChange&&e.onChange({type:bue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("ASelect"),s=fn("InputNumber");return hr(),vr("div",jde,[Cr(l,{checked:e.type===e.PERIOD,onChange:e.change},{default:sn((()=>[Sr("span",Bde,X(e.tag_),1),Pr(" "+X(e.Message.common.from),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",style:{width:"100px"},value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Pr(" "+X(e.Message.common.start)+X(e.Message.common.every)+" ",1),Cr(s,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])}]]),zde=Due.messages(),_de=Zx.Option,Lde={class:"cron-body-row"},Qde={class:"symbol"},Hde=S2(Ln({components:{Radio:ET,ASelect:Zx,AOption:_de},props:{nums:{type:Array,default:null},upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:yue},tag:{type:String,default:yue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(0);o.value`${o.value}${yue}${n.value}`));function l(t){if(e.type!==yue)return;const r=t.split(yue);2===r.length&&(r[0]===yue&&(r[0]=0),!Mue(r[0])||parseInt(r[0])e.lowerConfig.max||!Mue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Gn((()=>{l(e.tag)})),wn((()=>e.tag),(e=>{l(e)}),{deep:!0}),wn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:zde,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:yue,change:function(){e.onChange&&e.onChange({type:yue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("AOption"),s=fn("ASelect");return hr(),vr("div",Lde,[Cr(l,{checked:e.type===e.RANGE,onChange:e.change},{default:sn((()=>[Sr("span",Qde,X(e.tag_),1),Pr(" "+X(e.Message.common.between),1)])),_:1},8,["checked","onChange"]),Cr(s,{size:"small",style:{width:"100px"},value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.nums,(t=>(hr(),br(a,{key:t.value,value:t.value,disabled:Number(t.value)>e.upper_},{default:sn((()=>[Pr(X(t.label),1)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value","placeholder","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.and)+" ",1),Cr(s,{size:"small",style:{width:"100px"},value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Pr(" "+X(e.Message.common.end)+X(e.Message.common.every)+X(e.timeUnit),1)])}]]),Fde=Due.messages(),Wde={class:"cron-body-row"},Zde={class:"symbol"},Vde=S2(Ln({components:{Radio:ET,ASelect:Zx},props:{nums:{type:Array,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:xue},tag:{type:String,default:xue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Yr((()=>(n.value>=1&&n.value<7?n.value:"")+xue));function r(t){if(e.type!==xue)return;if(t===xue)return void(n.value=7);const o=t.substring(0,t.length-1);Mue(o)&&parseInt(o)>=parseInt(e.nums[0].value)&&parseInt(o)<=parseInt(e.nums[e.nums.length-1].value)?n.value=parseInt(o):xB.error(Fde.common.numError+":"+o)}return Gn((()=>{r(e.tag)})),wn((()=>e.tag),(e=>{r(e)}),{deep:!0}),wn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:Fde,type_:t,tag_:o,LAST:xue,lastNum:n,change:function(){e.onChange&&e.onChange({type:xue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("ASelect");return hr(),vr("div",Wde,[Cr(l,{checked:e.type===e.LAST,onChange:e.change},{default:sn((()=>[Sr("span",Zde,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.lastTh),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",style:{width:"100px"},value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),Xde=Due.messages(),Yde={class:"cron-body-row"},Kde={class:"symbol"},Gde=S2(Ln({components:{Radio:ET,InputNumber:pQ,ASelect:Zx},props:{targetTimeUnit:{type:String,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Sue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${Sue}${o.value}`));function i(t){if(e.type!==Sue)return;const r=t.split(Sue);2===r.length?!Mue(r[0])||parseInt(r[0])parseInt(e.nums[e.nums.length-1].value)?xB.error(`${Xde.period.startError}:${r[0]}`):!Mue(r[1])||parseInt(r[1])<1||parseInt(r[1])>5?xB.error(`${Xde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):xB.error(`${Xde.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Xde,type_:t,nth:n,weekDayNum:o,tag_:r,WEEK_DAY:Sue,change:function(){e.onChange&&e.onChange({type:Sue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("InputNumber"),s=fn("ASelect");return hr(),vr("div",Yde,[Cr(l,{checked:e.type===e.WEEK_DAY,onChange:e.change},{default:sn((()=>[Sr("span",Kde,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.common.nth),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",value:e.nth,"onUpdate:value":t[0]||(t[0]=t=>e.nth=t),min:1,step:1,max:5,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","disabled","onChange"]),Pr(" "+X(e.Message.common.index)+" ",1),Cr(s,{size:"small",style:{width:"100px"},value:e.weekDayNum,"onUpdate:value":t[1]||(t[1]=t=>e.weekDayNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),Ude=Due.messages(),qde=S2(Ln({components:{Every:zue,Period:Nde,Range:Hde,Fixed:Uue,UnFixed:sde,Last:Vde,WeekDay:Gde},mixins:[que],props:{tag:{type:String,default:wue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:7},n={min:1,step:1,max:7},o={min:1,step:1,max:7},r={min:1,step:1,max:7},i={min:1,step:1,max:7},l=Ude.daysOfWeekOptions,a=Ot(vue),s=Ot(e.tag);return{Message:Ude,startConfig:t,cycleConfig:o,lowerConfig:r,upperConfig:i,startDateConfig:n,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("UnFixed"),d=fn("Last"),p=fn("WeekDay");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.dayOfWeek.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Cr(d,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,"last-config":e.startDateConfig,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","last-config","onChange"]),Cr(p,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","onChange"])],64)}]]),Jde=Due.messages(),epe=Ln({name:"VueCron",components:{AInput:Uz,Popover:MS,Card:CE,Seconds:ede,Minutes:nde,Hours:rde,Days:$de,Months:Cde,Years:Rde,WeekDays:qde,CalendarOutlined:fN},props:{value:{type:String,default:"* * * * * ? *"}},setup(e,{emit:t}){const n=Ot(""),o=Ot([]),r=[{key:"seconds",tab:Jde.second.title},{key:"minutes",tab:Jde.minute.title},{key:"hours",tab:Jde.hour.title},{key:"days",tab:Jde.dayOfMonth.title},{key:"months",tab:Jde.month.title},{key:"weekdays",tab:Jde.dayOfWeek.title},{key:"years",tab:Jde.year.title}],i=it({second:vue,minute:vue,hour:vue,dayOfMonth:vue,month:vue,dayOfWeek:wue,year:Cue}),l=Ot("seconds");function a(e){const o=e.trim().split(" ");if(!e||e.trim().length<11||6!==o.length&&7!==o.length){const e="* * * * * ?";return n.value=e,s(e),xB.error(Jde.common.tagError),t("update:value",e),void t("change",e)}s(e),i.second=o[0],i.minute=o[1],i.hour=o[2],i.dayOfMonth=o[3],i.month=o[4],i.dayOfWeek=o[5],i.year=7===o.length?o[6]:""}function s(e){d1(`/job/cron?cron=${e}`).then((e=>{if(o.value=e,0===o.value.length){const e="* * * * * ?";n.value=e,s(e),t("update:value",e),t("change",e)}}))}return wn((()=>e.value),(e=>{a(e),n.value=e}),{immediate:!0}),{cronStr:n,list:o,tabList:r,activeTabKey:l,tag:i,changeTime:a,timeChange:function(e,n){const o={...i};o[e]=n,"dayOfWeek"===e&&"*"!==n&&"?"!==n?o.dayOfMonth="?":"dayOfMonth"===e&&"*"!==n&&"?"!==n&&(o.dayOfWeek="?");let r=[];r.push(o.second),r.push(o.minute),r.push(o.hour),r.push(o.dayOfMonth),r.push(o.month),r.push(o.dayOfWeek),r.push(o.year),s(r.join(" ").trim()),t("update:value",r.join(" ").trim()),t("change",r.join(" ").trim())}}}}),tpe={key:0},npe={key:1},ope={key:2},rpe={key:3},ipe={key:4},lpe={key:5},ape={key:6},spe={style:{display:"flex","align-items":"center","justify-content":"space-between"}},cpe=Sr("span",{style:{width:"150px","font-weight":"600"}},"CRON 表达式: ",-1),upe=Sr("div",{style:{margin:"20px 0","border-left":"#1677ff 5px solid","font-size":"medium","font-weight":"bold"}},"    近5次的运行时间: ",-1),dpe=S2(epe,[["render",function(e,t,n,o,r,i){const l=fn("AInput"),a=fn("CalendarOutlined"),s=fn("Seconds"),c=fn("Minutes"),u=fn("Hours"),d=fn("Days"),p=fn("Months"),h=fn("WeekDays"),f=fn("Years"),g=fn("a-tab-pane"),m=fn("a-tabs"),v=fn("a-divider"),b=fn("a-input"),y=fn("a-button"),O=fn("Card"),w=fn("Popover");return hr(),br(w,{placement:"bottom",trigger:"click"},{content:sn((()=>[Cr(O,{size:"small"},{default:sn((()=>[Cr(m,{activeKey:e.activeTabKey,"onUpdate:activeKey":t[7]||(t[7]=t=>e.activeTabKey=t),type:"card"},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.tabList,(n=>(hr(),br(g,{key:n.key},{tab:sn((()=>[Sr("span",null,[Cr(a),Pr(" "+X(n.tab),1)])])),default:sn((()=>["seconds"===e.activeTabKey?(hr(),vr("div",tpe,[Cr(s,{tag:e.tag.second,onChange:t[0]||(t[0]=t=>e.timeChange("second",t.tag))},null,8,["tag"])])):"minutes"===e.activeTabKey?(hr(),vr("div",npe,[Cr(c,{tag:e.tag.minute,onChange:t[1]||(t[1]=t=>e.timeChange("minute",t.tag))},null,8,["tag"])])):"hours"===e.activeTabKey?(hr(),vr("div",ope,[Cr(u,{tag:e.tag.hour,onChange:t[2]||(t[2]=t=>e.timeChange("hour",t.tag))},null,8,["tag"])])):"days"===e.activeTabKey?(hr(),vr("div",rpe,[Cr(d,{tag:e.tag.dayOfMonth,onChange:t[3]||(t[3]=t=>e.timeChange("dayOfMonth",t.tag))},null,8,["tag"])])):"months"===e.activeTabKey?(hr(),vr("div",ipe,[Cr(p,{tag:e.tag.month,onChange:t[4]||(t[4]=t=>e.timeChange("month",t.tag))},null,8,["tag"])])):"weekdays"===e.activeTabKey?(hr(),vr("div",lpe,[Cr(h,{tag:e.tag.dayOfWeek,onChange:t[5]||(t[5]=t=>e.timeChange("dayOfWeek",t.tag))},null,8,["tag"])])):"years"===e.activeTabKey?(hr(),vr("div",ape,[Cr(f,{tag:e.tag.year,onChange:t[6]||(t[6]=t=>e.timeChange("year",t.tag))},null,8,["tag"])])):Mr("",!0)])),_:2},1024)))),128))])),_:1},8,["activeKey"]),Cr(v),Sr("div",spe,[cpe,Cr(b,{value:e.cronStr,"onUpdate:value":t[8]||(t[8]=t=>e.cronStr=t)},null,8,["value"]),Cr(y,{type:"primary",style:{"margin-left":"16px"},onClick:t[9]||(t[9]=t=>e.changeTime(e.cronStr))},{default:sn((()=>[Pr("保存")])),_:1})]),Cr(v),upe,(hr(!0),vr(ar,null,io(e.list,((e,t)=>(hr(),vr("div",{key:e,style:{"margin-top":"10px"}},"第"+X(t+1)+"次: "+X(e),1)))),128))])),_:1})])),default:sn((()=>[Cr(l,{readonly:"",value:e.value},null,8,["value"])])),_:1})}]]),ppe=Ln({__name:"StartDrawer",props:{open:N1().def(!1),modelValue:Q1().def({})},emits:["update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=u1();let i="";const l=Ot(!1),a=Ot({}),s=Ot([]);wn((()=>o.open),(e=>{l.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{a.value=e,i=e.workflowName?e.workflowName:e.groupName?e.groupName:"请选择组"}),{immediate:!0,deep:!0});const c=Ot(),u=()=>{var e;null==(e=c.value)||e.validate().then((()=>{d(),n("save",a.value)})).catch((()=>{xB.warning("请检查表单信息")}))},d=()=>{n("update:open",!1),l.value=!1};Gn((()=>{Zt((()=>{p()}))}));const p=()=>{d1("/group/all/group-name/list").then((e=>{s.value=e}))},h=e=>{1===e?a.value.triggerInterval="* * * * * ?":2===e&&(a.value.triggerInterval="60")},f={groupName:[{required:!0,message:"请选择组",trigger:"change"}],triggerType:[{required:!0,message:"请选择触发类型",trigger:"change"}],triggerInterval:[{required:!0,message:"请输入触发间隔",trigger:"change"}],executorTimeout:[{required:!0,message:"请输入执行超时时间",trigger:"change"}],blockStrategy:[{required:!0,message:"请选择阻塞策略",trigger:"change"}],workflowStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]};return(e,t)=>{const n=fn("a-input"),o=fn("a-form-item"),p=fn("a-select-option"),g=fn("a-select"),m=fn("a-col"),v=fn("a-input-number"),b=fn("a-form-item-rest"),y=fn("a-row"),O=fn("a-radio"),w=fn("a-radio-group"),x=fn("a-textarea"),$=fn("a-form"),S=fn("a-button"),C=fn("a-drawer");return hr(),br(C,{open:l.value,"onUpdate:open":t[9]||(t[9]=e=>l.value=e),title:Ct(i),"destroy-on-close":"",width:610,onClose:d},{footer:sn((()=>[Cr(S,{type:"primary",onClick:u},{default:sn((()=>[Pr("保存")])),_:1}),Cr(S,{style:{"margin-left":"12px"},onClick:d},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr($,{ref_key:"formRef",ref:c,layout:"vertical",model:a.value,rules:f,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(o,{name:"workflowName",label:"工作流名称"},{default:sn((()=>[Cr(n,{value:a.value.workflowName,"onUpdate:value":t[0]||(t[0]=e=>a.value.workflowName=e),placeholder:"请输入工作流名称"},null,8,["value"])])),_:1}),Cr(o,{name:"groupName",label:"组名称"},{default:sn((()=>[Cr(g,{ref:"select",value:a.value.groupName,"onUpdate:value":t[1]||(t[1]=e=>a.value.groupName=e),placeholder:"请选择组",disabled:0===Ct(r).TYPE&&void 0!==Ct(r).ID&&null!==Ct(r).ID&&""!==Ct(r).ID&&"undefined"!==Ct(r).ID},{default:sn((()=>[(hr(!0),vr(ar,null,io(s.value,(e=>(hr(),br(p,{key:e,value:e},{default:sn((()=>[Pr(X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value","disabled"])])),_:1}),Cr(y,{gutter:24},{default:sn((()=>[Cr(m,{span:8},{default:sn((()=>[Cr(o,{name:"triggerType",label:"触发类型"},{default:sn((()=>[Cr(g,{ref:"select",value:a.value.triggerType,"onUpdate:value":t[2]||(t[2]=e=>a.value.triggerType=e),placeholder:"请选择触发类型",onChange:h},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(J1)),(e=>(hr(),br(p,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1}),Cr(m,{span:16},{default:sn((()=>[Cr(o,{name:"triggerInterval",label:"触发间隔"},{default:sn((()=>[Cr(b,null,{default:sn((()=>[3===a.value.triggerType?(hr(),br(Ct(dpe),{key:0,value:a.value.triggerInterval,"onUpdate:value":t[3]||(t[3]=e=>a.value.triggerInterval=e)},null,8,["value"])):(hr(),br(v,{key:1,addonAfter:"秒",style:{width:"-webkit-fill-available"},value:a.value.triggerInterval,"onUpdate:value":t[4]||(t[4]=e=>a.value.triggerInterval=e),placeholder:"请输入触发间隔"},null,8,["value"]))])),_:1})])),_:1})])),_:1})])),_:1}),Cr(y,{gutter:24},{default:sn((()=>[Cr(m,{span:8},{default:sn((()=>[Cr(o,{name:"executorTimeout",label:"执行超时时间"},{default:sn((()=>[Cr(v,{addonAfter:"秒",value:a.value.executorTimeout,"onUpdate:value":t[5]||(t[5]=e=>a.value.executorTimeout=e),placeholder:"请输入超时时间"},null,8,["value"])])),_:1})])),_:1}),Cr(m,{span:16},{default:sn((()=>[Cr(o,{name:"blockStrategy",label:"阻塞策略"},{default:sn((()=>[Cr(w,{value:a.value.blockStrategy,"onUpdate:value":t[6]||(t[6]=e=>a.value.blockStrategy=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(e2)),(e=>(hr(),br(O,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1})])),_:1}),Cr(o,{name:"workflowStatus",label:"节点状态"},{default:sn((()=>[Cr(w,{value:a.value.workflowStatus,"onUpdate:value":t[7]||(t[7]=e=>a.value.workflowStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(H2)(Ct(n2)),(e=>(hr(),br(O,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(o,{name:"description",label:"描述"},{default:sn((()=>[Cr(x,{value:a.value.description,"onUpdate:value":t[8]||(t[8]=e=>a.value.description=e),"auto-size":{minRows:5},placeholder:"请输入描述"},null,8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open","title"])}}}),hpe=Ln({__name:"StartDetail",props:{modelValue:Q1().def({}),open:N1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-descriptions"),a=fn("a-drawer");return hr(),br(a,{title:"工作流详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"工作流名称"},{default:sn((()=>[Pr(X(e.modelValue.workflowName),1)])),_:1}),Cr(o,{label:"组名称"},{default:sn((()=>[Pr(X(e.modelValue.groupName),1)])),_:1}),Cr(o,{label:"触发类型"},{default:sn((()=>[Pr(X(Ct(J1)[e.modelValue.triggerType]),1)])),_:1}),Cr(o,{label:"触发间隔"},{default:sn((()=>[Pr(X(e.modelValue.triggerInterval)+" "+X(2===e.modelValue.triggerType?"秒":null),1)])),_:1}),Cr(o,{label:"执行超时时间"},{default:sn((()=>[Pr(X(e.modelValue.executorTimeout)+" 秒 ",1)])),_:1}),Cr(o,{label:"阻塞策略"},{default:sn((()=>[Pr(X(Ct(e2)[e.modelValue.blockStrategy]),1)])),_:1}),Cr(o,{label:"工作流状态"},{default:sn((()=>[Pr(X(Ct(n2)[e.modelValue.workflowStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),fpe=e=>(ln("data-v-c07f8c3a"),e=e(),an(),e),gpe={class:"node-wrap"},mpe={class:"title",style:{background:"#ffffff"}},vpe={class:"text",style:{color:"#ff943e"}},bpe={key:0,class:"content"},ype=fpe((()=>Sr("span",{class:"content_label"},"组名称: ",-1))),Ope=fpe((()=>Sr("span",{class:"content_label"},"阻塞策略: ",-1))),wpe=fpe((()=>Sr("div",null,".........",-1))),xpe={key:1,class:"content"},$pe=[fpe((()=>Sr("span",{class:"placeholder"}," 请配置工作流 ",-1)))],Spe=S2(Ln({__name:"StartNode",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({}),i=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0}),wn((()=>i.value),(e=>{n("update:modelValue",e)}));const l=u1();wn((()=>i.value.groupName),(e=>{e&&(l.setGroupName(e),d1(`/job/list?groupName=${e}`).then((e=>{l.setJobList(e)})))}),{immediate:!0});const a=Ot(!1),s=Ot(!1),c=e=>{i.value=e},u=()=>{0===l.TYPE?(r.value=JSON.parse(JSON.stringify(i.value)),a.value=!0):s.value=!0};return(t,n)=>{const o=fn("a-badge"),d=fn("a-typography-text"),p=fn("a-tooltip");return hr(),vr("div",gpe,[Sr("div",{class:W([e.disabled?"start-node-disabled":"node-wrap-box-hover","node-wrap-box start-node node-error-success"]),onClick:u},[Sr("div",mpe,[Sr("span",vpe,[Cr(o,{status:"processing",color:1===i.value.workflowStatus?"#52c41a":"#ff000d"},null,8,["color"]),Pr(" "+X(i.value.workflowName?i.value.workflowName:"请选择组"),1)])]),i.value.groupName?(hr(),vr("div",bpe,[Sr("div",null,[ype,Cr(d,{style:{width:"135px"},ellipsis:"",content:i.value.groupName},null,8,["content"])]),Sr("div",null,[Ope,Pr(X(Ct(e2)[i.value.blockStrategy]),1)]),wpe])):(hr(),vr("div",xpe,$pe)),2===Ct(l).TYPE?(hr(),br(p,{key:2},{title:sn((()=>[Pr(X(Ct(i2)[3].title),1)])),default:sn((()=>[Cr(Ct(U1),{class:"error-tip",color:Ct(i2)[3].color,size:"24px",onClick:Zi((()=>{}),["stop"]),"model-value":Ct(i2)[3].icon},null,8,["color","model-value"])])),_:1})):Mr("",!0)],2),Cr(Q2,{disabled:e.disabled,modelValue:i.value.nodeConfig,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.nodeConfig=e)},null,8,["disabled","modelValue"]),0!==Ct(l).TYPE?(hr(),br(hpe,{key:0,open:s.value,"onUpdate:open":n[1]||(n[1]=e=>s.value=e),modelValue:i.value,"onUpdate:modelValue":n[2]||(n[2]=e=>i.value=e)},null,8,["open","modelValue"])):Mr("",!0),Cr(ppe,{open:a.value,"onUpdate:open":n[3]||(n[3]=e=>a.value=e),modelValue:r.value,"onUpdate:modelValue":n[4]||(n[4]=e=>r.value=e),onSave:c},null,8,["open","modelValue"])])}}}),[["__scopeId","data-v-c07f8c3a"]]),Cpe={class:"workflow-design"},kpe={class:"box-scale"},Ppe=Sr("div",{class:"end-node"},[Sr("div",{class:"end-node-circle"}),Sr("div",{class:"end-node-text"},"流程结束")],-1),Mpe=Ln({__name:"WorkFlow",props:{modelValue:Q1().def({}),disabled:N1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({});return wn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),wn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>(hr(),vr("div",Cpe,[Sr("div",kpe,[Cr(Spe,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},null,8,["modelValue","disabled"]),r.value.nodeConfig?(hr(),br(mue,{key:0,modelValue:r.value.nodeConfig,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value.nodeConfig=e),disabled:e.disabled},null,8,["modelValue","disabled"])):Mr("",!0),Ppe])]))}}),Tpe={style:{width:"calc(100vw - 16px)",height:"calc(100vh - 48px)"}},Ipe={class:"header"},Epe={key:0,class:"buttons"},Ape={style:{overflow:"auto",width:"100vw",height:"calc(100vh - 48px)"}},Rpe=S2(Ln({__name:"App",setup(e){const t=e=>{const t={},n=window.location.href.split("?")[1];return n&&n.split("&").forEach((e=>{const n=e.split("=")[1],o=e.split("=")[0];t[o]=n})),t[e]},n=u1(),o=Ot(100);let r=t("id");const i=localStorage.getItem("Access-Token"),l=t("mode"),a=localStorage.getItem("app_namespace"),s="xkjIc2ZHZ0"===t("x1c2Hdd6"),c="kaxC8Iml"===t("x1c2Hdd6")||s,u="wA4wN1nZ"===t("x1c2Hdd6");Gn((()=>{if(n.clear(),!["D7Rzd7Oe","kaxC8Iml","xkjIc2ZHZ0","wA4wN1nZ"].includes(t("x1c2Hdd6")))return d.value=!0,void xB.error({content:"未知错误,请联系管理员",duration:0});n.setToken(i),n.setMode(l),n.setNameSpaceId(a),n.setType(c?s?2:1:0),p.value=c,r&&"undefined"!==r&&(n.setId(u?"":r),s?v():m())}));const d=Ot(!1),p=Ot(!1),h=Ot({workflowStatus:1,blockStrategy:1,description:void 0,executorTimeout:60}),f=()=>{"undefined"===r||u?(h.value.id=void 0,d1("/workflow","post",h.value).then((()=>{window.parent.postMessage({code:"SV5ucvLBhvFkOftb",data:JSON.stringify(h.value)})}))):d1("/workflow","put",h.value).then((()=>{window.parent.postMessage({code:"8Rr3XPtVVAHfduQg",data:JSON.stringify(h.value)})}))},g=()=>{window.parent.postMessage({code:"kb4DO9h6WIiqFhbp"})},m=()=>{d.value=!0,d1(`/workflow/${r}`).then((e=>{h.value=e})).finally((()=>{d.value=!1}))},v=()=>{d.value=!0,d1(`/workflow/batch/${r}`).then((e=>{h.value=e})).finally((()=>{d.value=!1}))},b=e=>{o.value+=10*e,o.value<=10?o.value=10:o.value>=300&&(o.value=300)};return(e,t)=>{const n=fn("a-button"),r=fn("a-tooltip"),i=fn("a-affix"),l=fn("a-spin");return hr(),vr("div",Tpe,[Cr(i,{"offset-top":0},{default:sn((()=>[Sr("div",Ipe,[Sr("div",null,[Cr(r,{title:"缩小"},{default:sn((()=>[Cr(n,{type:"primary",icon:Kr(Ct(SJ)),onClick:t[0]||(t[0]=e=>b(-1))},null,8,["icon"])])),_:1}),Pr(" "+X(o.value)+"% ",1),Cr(r,{title:"放大"},{default:sn((()=>[Cr(n,{type:"primary",icon:Kr(Ct(MI)),onClick:t[1]||(t[1]=e=>b(1))},null,8,["icon"])])),_:1})]),p.value?Mr("",!0):(hr(),vr("div",Epe,[Cr(n,{type:"primary",siz:"large",onClick:f},{default:sn((()=>[Pr("保存")])),_:1}),Cr(n,{siz:"large",style:{"margin-left":"16px"},onClick:g},{default:sn((()=>[Pr("取消")])),_:1})]))])])),_:1}),Sr("div",Ape,[Cr(l,{spinning:d.value},{default:sn((()=>[Cr(Ct(Mpe),{class:"work-flow",modelValue:h.value,"onUpdate:modelValue":t[2]||(t[2]=e=>h.value=e),disabled:p.value,style:_([{"transform-origin":"0 0"},`transform: scale(${o.value/100})`])},null,8,["modelValue","disabled","style"])])),_:1},8,["spinning"])])])}}}),[["__scopeId","data-v-181c4323"]]);function Dpe(e,t){var n;return e="object"==typeof(n=e)&&null!==n?e:Object.create(null),new Proxy(e,{get:(e,n,o)=>"key"===n?Reflect.get(e,n,o):Reflect.get(e,n,o)||Reflect.get(t,n,o)})}function jpe(e,{storage:t,serializer:n,key:o,debug:r}){try{const r=null==t?void 0:t.getItem(o);r&&e.$patch(null==n?void 0:n.deserialize(r))}catch(Lpe){}}function Bpe(e,{storage:t,serializer:n,key:o,paths:r,debug:i}){try{const i=Array.isArray(r)?function(e,t){return t.reduce(((t,n)=>{const o=n.split(".");return function(e,t,n){return t.slice(0,-1).reduce(((e,t)=>/^(__proto__)$/.test(t)?{}:e[t]=e[t]||{}),e)[t[t.length-1]]=n,e}(t,o,function(e,t){return t.reduce(((e,t)=>null==e?void 0:e[t]),e)}(e,o))}),{})}(e,r):e;t.setItem(o,n.serialize(i))}catch(Lpe){}}var Npe=function(e={}){return t=>{const{auto:n=!1}=e,{options:{persist:o=n},store:r,pinia:i}=t;if(!o)return;if(!(r.$id in i.state.value)){const e=i._s.get(r.$id.replace("__hot:",""));return void(e&&Promise.resolve().then((()=>e.$persist())))}const l=(Array.isArray(o)?o.map((t=>Dpe(t,e))):[Dpe(o,e)]).map(function(e,t){return n=>{var o;try{const{storage:r=localStorage,beforeRestore:i,afterRestore:l,serializer:a={serialize:JSON.stringify,deserialize:JSON.parse},key:s=t.$id,paths:c=null,debug:u=!1}=n;return{storage:r,beforeRestore:i,afterRestore:l,serializer:a,key:(null!=(o=e.key)?o:e=>e)("string"==typeof s?s:s(t.$id)),paths:c,debug:u}}catch(Lpe){return n.debug,null}}}(e,r)).filter(Boolean);r.$persist=()=>{l.forEach((e=>{Bpe(r.$state,e)}))},r.$hydrate=({runHooks:e=!0}={})=>{l.forEach((n=>{const{beforeRestore:o,afterRestore:i}=n;e&&(null==o||o(t)),jpe(r,n),e&&(null==i||i(t))}))},l.forEach((e=>{const{beforeRestore:n,afterRestore:o}=e;null==n||n(t),jpe(r,e),null==o||o(t),r.$subscribe(((t,n)=>{Bpe(n,e)}),{detached:!0})}))}}();const zpe=function(){const e=J(!0),t=e.run((()=>Ot({})));let n=[],o=[];const r=ht({install(e){qi(r),r._a=e,e.provide(Ji,r),e.config.globalProperties.$pinia=r,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}();zpe.use(Npe);const _pe=Gi(Rpe);_pe.use(c1),_pe.use(zpe),_pe.mount("#app")}},function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports});export default o(); diff --git a/frontend/public/lib/index.html b/frontend/public/lib/index.html index bc5126c5..40876cbc 100644 --- a/frontend/public/lib/index.html +++ b/frontend/public/lib/index.html @@ -5,7 +5,7 @@ Easy Retry - + diff --git a/frontend/src/utils/jobEnum.js b/frontend/src/utils/jobEnum.js index 0850409e..04f86dcc 100644 --- a/frontend/src/utils/jobEnum.js +++ b/frontend/src/utils/jobEnum.js @@ -24,15 +24,15 @@ const enums = { } }, triggerType: { - '1': { - 'name': 'CRON表达式', - 'color': '#d06892' - }, '2': { 'name': '固定时间', 'color': '#f5a22d' }, '3': { + 'name': 'CRON表达式', + 'color': '#d06892' + }, + '99': { 'name': '工作流', 'color': '#76f52d' } diff --git a/frontend/src/views/config/GroupList.vue b/frontend/src/views/config/GroupList.vue index 7e964bf0..3c596207 100644 --- a/frontend/src/views/config/GroupList.vue +++ b/frontend/src/views/config/GroupList.vue @@ -37,7 +37,7 @@ :data="loadData" :alert="options.alert" :rowSelection="options.rowSelection" - :scroll="{ x: 1800 }" + :scroll="{ x: 2000 }" > {{ text }} diff --git a/frontend/src/views/job/WorkflowList.vue b/frontend/src/views/job/WorkflowList.vue index 48eca5ac..af49df8c 100644 --- a/frontend/src/views/job/WorkflowList.vue +++ b/frontend/src/views/job/WorkflowList.vue @@ -129,13 +129,12 @@ > 删除 - + 复制 diff --git a/frontend/src/views/job/form/JobForm.vue b/frontend/src/views/job/form/JobForm.vue index a65fbb7c..1e4204ee 100644 --- a/frontend/src/views/job/form/JobForm.vue +++ b/frontend/src/views/job/form/JobForm.vue @@ -113,7 +113,7 @@ ]" />