@kern0x1b/penstock-cli 26.10.0 → 26.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +1647 -0
- package/dist/grammars/tree-sitter-c-sharp.wasm +0 -0
- package/dist/grammars/tree-sitter-go.wasm +0 -0
- package/dist/grammars/tree-sitter-groovy.wasm +0 -0
- package/dist/grammars/tree-sitter-java.wasm +0 -0
- package/dist/grammars/tree-sitter-javascript.wasm +0 -0
- package/dist/grammars/tree-sitter-kotlin.wasm +0 -0
- package/dist/grammars/tree-sitter-python.wasm +0 -0
- package/dist/grammars/tree-sitter-scala.wasm +0 -0
- package/dist/grammars/tree-sitter-typescript.wasm +0 -0
- package/dist/grammars/web-tree-sitter.wasm +0 -0
- package/dist/penstock.js +1077 -419
- package/dist/syntax-worker.js +5 -0
- package/dist/web/assets/AgentSettings-Iy9ZaTGR.js +1 -0
- package/dist/web/assets/AgentsDialog-Dt09_TEw.js +1 -0
- package/dist/web/assets/BpmnCanvas-CCRBnGIV.js +1905 -0
- package/dist/web/assets/BpmnDocument-D2lXXcnN.js +24 -0
- package/dist/web/assets/ConflictDialog-CaBNoJST.js +1 -0
- package/dist/web/assets/DiffDocument-BjLzoDLL.js +1 -0
- package/dist/web/assets/DmnDocument-BSGTyR3r.js +41 -0
- package/dist/web/assets/DmnDocument-DdjhA8he.css +1 -0
- package/dist/web/assets/FormDocument-BdCKvI-7.js +32 -0
- package/dist/web/assets/FormDocument-URLcKn84.css +1 -0
- package/dist/web/assets/FormStepView-BEDXMPef.js +1 -0
- package/dist/web/assets/GraphAwareLayoutService-CZCVRb9X.js +21 -0
- package/dist/web/assets/NewFileDialog-D9nTKDOT.js +34 -0
- package/dist/web/assets/QuickOpen-D3AkwBdF.js +1 -0
- package/dist/web/assets/ScriptPane-4TG-1RyI.js +2 -0
- package/dist/web/assets/ScriptRunDialog-C2n9cLcf.js +1 -0
- package/dist/web/assets/SettingsDialog-BUft2ulJ.js +1 -0
- package/dist/web/assets/ShortcutsDialog-Naoea994.js +1 -0
- package/dist/web/assets/SourceDocument-PMA1dm6T.js +1 -0
- package/dist/web/assets/TextDocument-D4fl42FV.js +1 -0
- package/dist/web/assets/UnreadableFileLayer-DuWtY1bx.js +1 -0
- package/dist/web/assets/UploadDialog-CEnwtJ3T.js +1 -0
- package/dist/web/assets/Viewer-CZiVl0t6.js +4 -0
- package/dist/web/assets/apply-DwO6xN9h.js +1 -0
- package/dist/web/assets/array-move-Bc4mVEdq.js +1 -0
- package/dist/web/assets/bpmn-0HrGCizt.svg +228 -0
- package/dist/web/assets/bpmn-Cyvp-fAH.eot +0 -0
- package/dist/web/assets/bpmnTheme-iB2hl29R.js +1687 -0
- package/dist/web/assets/bridgeInstance-CJkr34d9.js +600 -0
- package/dist/web/assets/clike-DaHM3zHz.js +1 -0
- package/dist/web/assets/colors-dark-C7vOziWz.css +1 -0
- package/dist/web/assets/colors-dracula-CXhMcc1Z.css +1 -0
- package/dist/web/assets/colors-light-CyT40N4M.css +1 -0
- package/dist/web/assets/commands-BMjdyegc.js +1 -0
- package/dist/web/assets/de-BDwOyJ4E.js +1 -0
- package/dist/web/assets/dialog-wo7dFa5A.js +1 -0
- package/dist/web/assets/diff-BmEImmS0.js +1 -0
- package/dist/web/assets/dist--PmHUHDp.js +1 -0
- package/dist/web/assets/dist-B163CX7G.js +57 -0
- package/dist/web/assets/dist-BBuLDp9u.js +2 -0
- package/dist/web/assets/dist-B_V0lTcO.js +1 -0
- package/dist/web/assets/dist-BaEGn3tp.js +6 -0
- package/dist/web/assets/dist-BqwyxNP3.js +1 -0
- package/dist/web/assets/dist-CAxViutc.js +5 -0
- package/dist/web/assets/dist-CBRIhX1e.js +1 -0
- package/dist/web/assets/dist-CHluRwHI.js +2 -0
- package/dist/web/assets/dist-COW2iVt-.js +1 -0
- package/dist/web/assets/dist-CRJyslwo.js +1 -0
- package/dist/web/assets/dist-CnDXCEJ_.js +23 -0
- package/dist/web/assets/dist-CsBP6QjA.js +13 -0
- package/dist/web/assets/dist-CxyFqsL2.js +6 -0
- package/dist/web/assets/dist-D6gjpLLN.js +1 -0
- package/dist/web/assets/dist-DUkRqvKl.js +1 -0
- package/dist/web/assets/dist-DgvQWhKm.js +6 -0
- package/dist/web/assets/dist-DvFyMwGd.js +1 -0
- package/dist/web/assets/dist-Gx7P7Pk_.js +1 -0
- package/dist/web/assets/dist-Km3QNqlU.js +2 -0
- package/dist/web/assets/dist-TNwbKIWT.js +1 -0
- package/dist/web/assets/dist-sl8LIbwu.js +1 -0
- package/dist/web/assets/dmn-2EwrEScy.eot +0 -0
- package/dist/web/assets/dmn-eH1_eUsy.svg +90 -0
- package/dist/web/assets/dockLayout-CxOMo-Nl.js +1 -0
- package/dist/web/assets/documentBridge-uW6vNrY3.js +240 -0
- package/dist/web/assets/documents-BwU2MdUd.js +1 -0
- package/dist/web/assets/duplicate-rWDlHiZr.js +342 -0
- package/dist/web/assets/ed25519-DTYhEcYX.js +1 -0
- package/dist/web/assets/engine-BPUfS3r2.js +1 -0
- package/dist/web/assets/engines-C3gTrVWJ.js +5 -0
- package/dist/web/assets/es-B4wrlqk9.js +1 -0
- package/dist/web/assets/files-Chpd_QD0.js +1 -0
- package/dist/web/assets/formChecks-DXIRZuhX.js +1 -0
- package/dist/web/assets/fr-BqtYruiB.js +1 -0
- package/dist/web/assets/frontend-By89859W.js +1 -0
- package/dist/web/assets/go-C1TRUqzB.js +1 -0
- package/dist/web/assets/groovy-DASguM_i.js +1 -0
- package/dist/web/assets/html2canvas-BNKOpkjM.js +5 -0
- package/dist/web/assets/httpHost-_QDw41Ka.js +1 -0
- package/dist/web/assets/index.es-CVOua_f9.js +4 -0
- package/dist/web/assets/index.es-DHW5-gbr.js +78 -0
- package/dist/web/assets/index.esm-CTLpq4ik.js +3 -0
- package/dist/web/assets/intelligence-BnJILPl7.js +3 -0
- package/dist/web/assets/ja-B6eG6Wld.js +1 -0
- package/dist/web/assets/jspdf.es.min-Yw43YJzU.js +79 -0
- package/dist/web/assets/ko-Le3hTKqP.js +1 -0
- package/dist/web/assets/lib-D6xZQFAF.js +1 -0
- package/dist/web/assets/libavoid-BRQRZjmQ.wasm +0 -0
- package/dist/web/assets/libavoid.wasm +0 -0
- package/dist/web/assets/platform-PXoldsjF.js +2 -0
- package/dist/web/assets/preferences-C7SSy7Wf.js +1 -0
- package/dist/web/assets/preload-helper-VRuDKI9K.js +1 -0
- package/dist/web/assets/properties-C3HzGRE2.js +1 -0
- package/dist/web/assets/pt-BR-aDlgSu84.js +1 -0
- package/dist/web/assets/purify.es-DBLk-NVl.js +3 -0
- package/dist/web/assets/python-CvnBFxgv.js +1 -0
- package/dist/web/assets/resource/ArchitectsDaughter-OFL.txt +93 -0
- package/dist/web/assets/resource/ArchitectsDaughter-Regular.ttf +0 -0
- package/dist/web/assets/resource/JetBrainsMono-Italic.woff2 +0 -0
- package/dist/web/assets/resource/JetBrainsMono-Medium.woff2 +0 -0
- package/dist/web/assets/resource/JetBrainsMono-OFL.txt +52 -0
- package/dist/web/assets/resource/JetBrainsMono-Regular.woff2 +0 -0
- package/dist/web/assets/resource/JetBrainsMono-SemiBold.woff2 +0 -0
- package/dist/web/assets/rolldown-runtime-B8BYMn-z.js +1 -0
- package/dist/web/assets/ru-DJl9EFpu.js +1 -0
- package/dist/web/assets/run-Dd_PjDF8.js +1 -0
- package/dist/web/assets/samples-DfOV2cQu.js +1 -0
- package/dist/web/assets/shortcut-DONH578b.js +1 -0
- package/dist/web/assets/source-frame-q4WXS_Md.js +2 -0
- package/dist/web/assets/stackblur-es-Djj-lnDR.js +2 -0
- package/dist/web/assets/syntax-DBcQvmbn.js +6 -0
- package/dist/web/assets/testCaseRuns-6x2pl8U_.js +1 -0
- package/dist/web/assets/translator-CTBxdhz9.js +1 -0
- package/dist/web/assets/typing-CXvbBSPr.js +1 -0
- package/dist/web/assets/ui-B2q39Bca.js +1 -0
- package/dist/web/assets/useTrace-BbcYW5PF.js +1 -0
- package/dist/web/assets/vendor-NJP34MHU.js +1 -0
- package/dist/web/assets/web-BTVzb1W6.css +1 -0
- package/dist/web/assets/web-D7xTiPek.js +148 -0
- package/dist/web/assets/zh-CaEk-YOk.js +1 -0
- package/dist/web/icon.svg +9 -0
- package/dist/web/index.html +64 -0
- package/dist/web/manifest.webmanifest +14 -0
- package/package.json +13 -8
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{i as e,r as t}from"./rolldown-runtime-B8BYMn-z.js";import{A as n,O as r,b as i,c as a,m as o,n as s,o as c,p as l,s as u,t as d,u as f,x as p}from"./dist-CRJyslwo.js";o();function Base(){}Base.prototype.get=function(e){return this.$model.properties.get(this,e)},Base.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};function Factory(e,t){this.model=e,this.properties=t}Factory.prototype.createType=function(e){var t=this.model,n=this.properties,r=Object.create(Base.prototype);f(e.properties,function(e){!e.isMany&&e.default!==void 0&&(r[e.name]=e.default)}),n.defineModel(r,t),n.defineDescriptor(r,e);var i=e.ns.name;function ModdleElement(e){n.define(this,`$type`,{value:i,enumerable:!0}),n.define(this,`$attrs`,{value:{}}),n.define(this,`$parent`,{writable:!0}),f(e,s(function(e,t){this.set(t,e)},this))}return ModdleElement.prototype=r,ModdleElement.hasType=r.$instanceOf=this.model.hasType,n.defineModel(ModdleElement,t),n.defineDescriptor(ModdleElement,e),ModdleElement};var m=d(Object.create(null),{String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0}),h=d(Object.create(null),{String:function(e){return e},Boolean:function(e){return e===`true`},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}});function coerceType(e,t){var n=h[e];return n?n(t):t}function isBuiltIn(e){return!!m[e]}function isSimple(e){return!!h[e]}function parseName(e,t){var n=e.split(/:/),r,i;if(n.length===1)r=e,i=t;else if(n.length===2)r=n[1],i=n[0];else throw Error(`expected <prefix:localName> or <localName>, got `+e);return e=(i?i+`:`:``)+r,{name:e,prefix:i,localName:r}}function DescriptorBuilder(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName=Object.create(null),this.properties=[],this.propertiesByName=Object.create(null)}DescriptorBuilder.prototype.build=function(){return r(this,[`ns`,`name`,`allTypes`,`allTypesByName`,`properties`,`propertiesByName`,`bodyProperty`,`idProperty`])},DescriptorBuilder.prototype.addProperty=function(e,t,n){typeof t==`boolean`&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var r=this.properties;t===void 0?r.push(e):r.splice(t,0,e)},DescriptorBuilder.prototype.replaceProperty=function(e,t,n){var r=e.ns,i=this.properties,a=this.propertiesByName,o=e.name!==t.name;if(e.isId){if(!t.isId)throw Error(`property <`+t.ns.name+`> must be id property to refine <`+e.ns.name+`>`);this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw Error(`property <`+t.ns.name+`> must be body property to refine <`+e.ns.name+`>`);this.setBodyProperty(t,!1)}var s=i.indexOf(e);if(s===-1)throw Error(`property <`+r.name+`> not found in property list`);i.splice(s,1),this.addProperty(t,n?void 0:s,o),a[r.name]=a[r.localName]=t},DescriptorBuilder.prototype.redefineProperty=function(e,t,n){var r=e.ns.prefix,i=t.split(`#`),a=parseName(i[0],r),o=parseName(i[1],a.prefix).name,s=this.propertiesByName[o];if(s)this.replaceProperty(s,e,n);else throw Error(`refined property <`+o+`> not found`);delete e.redefines},DescriptorBuilder.prototype.addNamedProperty=function(e,t){var n=e.ns,r=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),r[n.name]=r[n.localName]=e},DescriptorBuilder.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},DescriptorBuilder.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw Error(`body property defined multiple times (<`+this.bodyProperty.ns.name+`>, <`+e.ns.name+`>)`);this.bodyProperty=e},DescriptorBuilder.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw Error(`id property defined multiple times (<`+this.idProperty.ns.name+`>, <`+e.ns.name+`>)`);this.idProperty=e},DescriptorBuilder.prototype.assertNotTrait=function(e){if((e.extends||[]).length)throw Error(`cannot create <${e.name}> extending <${e.extends}>`)},DescriptorBuilder.prototype.assertNotDefined=function(e,t){var n=e.name,r=this.propertiesByName[n];if(r)throw Error(`property <`+n+`> already defined; override of <`+r.definedBy.ns.name+`#`+r.ns.name+`> by <`+e.definedBy.ns.name+`#`+e.ns.name+`> not allowed without redefines`)},DescriptorBuilder.prototype.hasProperty=function(e){return this.propertiesByName[e]},DescriptorBuilder.prototype.addTrait=function(e,t){t&&this.assertNotTrait(e);var n=this.allTypesByName,r=this.allTypes,i=e.name;i in n||(f(e.properties,s(function(n){n=d({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var r=n.replaces,i=n.redefines;r||i?this.redefineProperty(n,r||i,r):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))},this)),r.push(e),n[i]=e)};function Registry(e,t){this.packageMap=Object.create(null),this.typeMap=Object.create(null),this.packages=[],this.properties=t,f(e,s(this.registerPackage,this))}Registry.prototype.getPackage=function(e){return this.packageMap[e]},Registry.prototype.getPackages=function(){return this.packages},Registry.prototype.registerPackage=function(e){e=d({},e);var t=this.packageMap;ensureAvailable(t,e,`prefix`),ensureAvailable(t,e,`uri`),f(e.types,s(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Registry.prototype.registerType=function(e,t){e=d({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:d({},e.meta||{})});var n=parseName(e.name,t.prefix),r=n.name,i=Object.create(null);f(e.properties,s(function(e){var t=parseName(e.name,n.prefix),r=t.name;isBuiltIn(e.type)||(e.type=parseName(e.type,t.prefix).name),d(e,{ns:t,name:r}),i[r]=e},this)),d(e,{ns:n,name:r,propertiesByName:i}),f(e.extends,s(function(e){var t=parseName(e,n.prefix),i=this.typeMap[t.name];i.traits=i.traits||[],i.traits.push(r)},this)),this.definePackage(e,t),this.typeMap[r]=e},Registry.prototype.mapTypes=function(e,t,n){var r=isBuiltIn(e.name)?{name:e.name}:this.typeMap[e.name],i=this;function traverse(n,r){var a=parseName(n,isBuiltIn(n)?``:e.prefix);i.mapTypes(a,t,r)}function traverseTrait(e){return traverse(e,!0)}function traverseSuper(e){return traverse(e,!1)}if(!r)throw Error(`unknown type <`+e.name+`>`);f(r.superClass,n?traverseTrait:traverseSuper),t(r,!n),f(r.traits,traverseTrait)},Registry.prototype.getEffectiveDescriptor=function(e){var t=parseName(e),n=new DescriptorBuilder(t);this.mapTypes(t,function(e,t){n.addTrait(e,t)});var r=n.build();return this.definePackage(r,r.allTypes[r.allTypes.length-1].$pkg),r},Registry.prototype.definePackage=function(e,t){this.properties.define(e,`$pkg`,{value:t})};function ensureAvailable(e,t,n){var r=t[n];if(r in e)throw Error(`package with `+n+` <`+r+`> already defined`)}function Properties(e){this.model=e}Properties.prototype.set=function(e,t,n){if(!p(t)||!t.length)throw TypeError(`property name must be a non-empty string`);var r=this.getProperty(e,t),i=r&&r.name;isUndefined(n)?r?delete e[i]:delete e.$attrs[stripGlobal(t)]:r?i in e?e[i]=n:defineProperty(e,r,n):e.$attrs[stripGlobal(t)]=n},Properties.prototype.get=function(e,t){var n=this.getProperty(e,t);if(!n)return e.$attrs[stripGlobal(t)];var r=n.name;return!e[r]&&n.isMany&&defineProperty(e,n,[]),e[r]},Properties.prototype.define=function(e,t,n){if(!n.writable){var r=n.value;n=d({},n,{get:function(){return r}}),delete n.value}Object.defineProperty(e,t,n)},Properties.prototype.defineDescriptor=function(e,t){this.define(e,`$descriptor`,{value:t})},Properties.prototype.defineModel=function(e,t){this.define(e,`$model`,{value:t})},Properties.prototype.getProperty=function(e,t){var n=this.model,r=n.getPropertyDescriptor(e,t);if(r)return r;if(t.includes(`:`))return null;let i=n.config.strict;if(i!==void 0){let n=TypeError(`unknown property <${t}> on <${e.$type}>`);if(i)throw n;typeof console<`u`&&console.warn(n)}return null};function isUndefined(e){return e===void 0}function defineProperty(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function stripGlobal(e){return e.replace(/^:/,``)}function Moddle(e,t={}){this.properties=new Properties(this),this.factory=new Factory(this,this.properties),this.registry=new Registry(e,this.properties),this.typeCache=Object.create(null),this.config=t}Moddle.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw Error(`unknown type <`+e+`>`);return new n(t)},Moddle.prototype.getType=function(e){var t=this.typeCache,n=p(e)?e:e.ns.name,r=t[n];return r||=(e=this.registry.getEffectiveDescriptor(n),t[n]=this.factory.createType(e)),r},Moddle.prototype.createAny=function(e,t,r){var a=parseName(e),o={$type:e,$instanceOf:function(e){return e===this.$type},get:function(e){return this[e]},set:function(e,t){n(this,[e],t)}},s={name:e,isGeneric:!0,ns:{prefix:a.prefix,localName:a.localName,uri:t}};return this.properties.defineDescriptor(o,s),this.properties.defineModel(o,this),this.properties.define(o,`get`,{enumerable:!1,writable:!0}),this.properties.define(o,`set`,{enumerable:!1,writable:!0}),this.properties.define(o,`$parent`,{enumerable:!1,writable:!0}),this.properties.define(o,`$instanceOf`,{enumerable:!1,writable:!0}),f(r,function(e,t){i(e)&&e.value!==void 0?o[e.name]=e.value:o[t]=e}),o},Moddle.prototype.getPackage=function(e){return this.registry.getPackage(e)},Moddle.prototype.getPackages=function(){return this.registry.getPackages()},Moddle.prototype.getElementDescriptor=function(e){return e.$descriptor},Moddle.prototype.hasType=function(e,t){t===void 0&&(t=e,e=this);var n=e.$model.getElementDescriptor(e);return t in n.allTypesByName},Moddle.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Moddle.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var g=String.fromCharCode,_=Object.prototype.hasOwnProperty,v=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,y={amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`};Object.keys(y).forEach(function(e){y[e.toUpperCase()]=y[e]});function replaceEntities(e,t,n,r){return r?_.call(y,r)?y[r]:`&`+r+`;`:g(t||parseInt(n,16))}function decodeEntities(e){return e.length>3&&e.indexOf(`&`)!==-1?e.replace(v,replaceEntities):e}var b=`non-whitespace outside of root node`;function error$1(e){return Error(e)}e(error$1,`error`);function missingNamespaceForPrefix(e){return`missing namespace for prefix <`+e+`>`}function getter(e){return{get:e,enumerable:!0}}function setNsEntry(e,t,n,r){n in t||(t[n]=n in e?e[n]:null),e[n]=r}function restoreNsMatrix(e,t){var n,r;for(n in t)r=t[n],r===null?delete e[n]:e[n]=r}function uriPrefix(e){return e+`$uri`}function buildNsMatrix(e){var t=Object.create(null),n,r;for(n in e)r=e[n],t[r]=r,t[uriPrefix(r)]=n;return t}function noopGetContext(){return{line:0,column:0}}function throwFunc(e){throw e}function Parser(e){if(!this)return new Parser(e);var t=e&&e.proxy,n,r,i,a,o=throwFunc,s,c,l,u,d=noopGetContext,f=!1,p=!1,m=``,h=!1,g=!1,_=null,v=!1,y,x,S,C;function handleError(e){e instanceof Error||(e=error$1(e)),_=e,o(e,d)}function handleWarning(e){s&&(e instanceof Error||(e=error$1(e)),s(e,d))}this.on=function(e,t){if(typeof t!=`function`)throw error$1(`required args <name, cb>`);switch(e){case`openTag`:r=t;break;case`text`:n=t;break;case`closeTag`:i=t;break;case`error`:o=t;break;case`warn`:s=t;break;case`cdata`:a=t;break;case`attention`:u=t;break;case`question`:l=t;break;case`comment`:c=t;break;default:throw error$1(`unsupported event: `+e)}return this},this.ns=function(e){if(e===void 0&&(e={}),typeof e!=`object`)throw error$1(`required args <nsMap={}>`);var t=Object.create(null),n;for(n in e)t[n]=e[n];return g=!0,C=t,this};function resetState(){y=g?[]:null,x=g?buildNsMatrix(C):null,S=[],d=noopGetContext,v=!1,_=null,p=!1,m=``}this.parse=function(e){if(typeof e!=`string`)throw error$1(`required args <xml=string>`);if(f)throw error$1(`parse during stream; call end() first`);return resetState(),parse(e),d=noopGetContext,v=!1,_},this.write=function(e){if(typeof e!=`string`)throw error$1(`required args <xml=string>`);return f||=(resetState(),!0),_||(m=parse(m+e,!0)||``),this},this.end=function(){return f||resetState(),f=!1,_||parse(m),m=``,d=noopGetContext,v=!1,_},this.stop=function(){v=!0};function parse(e,o=!1){var s=null,f,m,_=0,w=!1,T=!1,E=0,D=0,O,k,A,j,M,N,P,F,I,L=``,R=0,z;function normalizeAttrName(e,t){var n=e.indexOf(`:`);if(n===-1)return e;var r=x[e.substring(0,n)];return r?t===r?e.substr(n+1):r+e.substr(n):(handleWarning(missingNamespaceForPrefix(e.substring(0,n))),null)}function getAttrs(){if(z!==null)return z;var e,t,n=g&&x.xmlns,r=g&&h?[]:null,i=R,a=L,o=a.length,c,l,u,d,p={},v=new Set,y,b,S;parseAttr:for(;i<o;i++)if(y=!1,b=a.charCodeAt(i),!(b===32||b<14&&b>8)){for((b<65||b>122||b>90&&b<97)&&b!==95&&b!==58&&(handleWarning(`illegal first char attribute name`),y=!0),S=i+1;S<o;S++)if(b=a.charCodeAt(S),!(b>96&&b<123||b>64&&b<91||b>47&&b<59||b===46||b===45||b===95)){if(b===32||b<14&&b>8){handleWarning(`missing attribute value`),i=S;continue parseAttr}if(b===61)break;handleWarning(`illegal attribute name char`),y=!0}if(d=a.substring(i,S),d===`xmlns:xmlns`&&(handleWarning(`illegal declaration of xmlns`),y=!0),b=a.charCodeAt(S+1),b===34)S=a.indexOf(`"`,i=S+2),S===-1&&(S=a.indexOf(`'`,i),S!==-1&&(handleWarning(`attribute value quote missmatch`),y=!0));else if(b===39)S=a.indexOf(`'`,i=S+2),S===-1&&(S=a.indexOf(`"`,i),S!==-1&&(handleWarning(`attribute value quote missmatch`),y=!0));else for(handleWarning(`missing attribute value quotes`),y=!0,S+=1;S<o&&(b=a.charCodeAt(S+1),!(b===32||b<14&&b>8));S++);for(S===-1&&(handleWarning(`missing closing quotes`),S=o,y=!0),y||(l=a.substring(i,S)),d===`xmlns:xml`&&l!==`http://www.w3.org/XML/1998/namespace`&&handleError(`illegal value of xmlns:xml`),i=S;S+1<o&&(b=a.charCodeAt(S+1),!(b===32||b<14&&b>8));S++)i===S&&(handleWarning(`illegal character after attribute end`),y=!0);if(i=S+1,y)continue parseAttr;if(v.has(d))handleWarning(`attribute <`+d+`> already defined`);else if(v.add(d),!g)p[d]=l;else if(h){if(c=d===`xmlns`?`xmlns`:d.charCodeAt(0)===120&&d.substr(0,6)===`xmlns:`?d.substr(6):null,c!==null){if(e=decodeEntities(l),t=uriPrefix(c),u=C[e],!u){if(c===`xmlns`||t in x&&x[t]!==e)do u=`ns`+_++;while(x[u]!==void 0);else u=c;C[e]=u}x[c]!==u&&(f||=Object.create(null),s=null,m=null,setNsEntry(x,f,c,u),c===`xmlns`&&(setNsEntry(x,f,uriPrefix(u),e),n=u),setNsEntry(x,f,t,e)),p[d]=l;continue}r.push(d,l)}else d=normalizeAttrName(d,n),d!==null&&(p[d]=l)}if(h)for(i=0,o=r.length;i<o;i++)d=normalizeAttrName(r[i++],n),l=r[i],d!==null&&(p[d]=l);return z=p}function getParseContext(){for(var t=/(\r\n|\r|\n)/g,n=0,r=0,i=0,a=D,o,s;E>=i&&(o=t.exec(e),!(!o||(a=o[0].length+o.index,a>E)));)n+=1,i=a;return E==-1?(r=a,s=e.substring(D)):D===0?s=e.substring(D,E):(r=E-i,s=D==-1?e.substring(E):e.substring(E,D+1)),{data:s,line:n,column:r}}for(d=getParseContext,t&&(I=Object.create({},{name:getter(function(){return P}),originalName:getter(function(){return F}),attrs:getter(getAttrs),ns:getter(function(){return m||=Object.assign(Object.create(null),x),m})}));D!==-1;){if(E=e.charCodeAt(D)===60?D:e.indexOf(`<`,D),E===-1){if(o)return e.substring(D);if(S.length)return handleError(`unexpected end of file`);if(!p)return handleError(`missing start tag`);D<e.length&&e.substring(D).trim()&&handleWarning(b);return}if(p||=!0,D!==E){if(S.length){if(n&&(n(e.substring(D,E),decodeEntities,d),v))return}else if(e.substring(D,E).trim()&&(handleWarning(b),v))return}if(j=e.charCodeAt(E+1),j===33){if(A=e.charCodeAt(E+2),A===91&&e.substr(E+3,6)===`CDATA[`){if(D=e.indexOf(`]]>`,E),D===-1)return o?e.substring(E):handleError(`unclosed cdata`);if(a&&(a(e.substring(E+9,D),d),v))return;D+=3;continue}if(A===45&&e.charCodeAt(E+3)===45){if(D=e.indexOf(`-->`,E),D===-1)return o?e.substring(E):handleError(`unclosed comment`);if(c&&(c(e.substring(E+4,D),decodeEntities,d),v))return;D+=3;continue}}if(j===63){if(D=e.indexOf(`?>`,E),D===-1)return o?e.substring(E):handleError(`unclosed question`);if(l&&(l(e.substring(E,D+2),d),v))return;D+=2}else{for(O=E+1;;O++){if(M=e.charCodeAt(O),isNaN(M))return o?e.substring(E):(D=-1,handleError(`unclosed tag`));if(M===34)A=e.indexOf(`"`,O+1),O=A===-1?O:A;else if(M===39)A=e.indexOf(`'`,O+1),O=A===-1?O:A;else if(M===62){D=O;break}}if(j===33){if(u&&(u(e.substring(E,D+1),decodeEntities,d),v))return;D+=1}else{if(z={},j===47){if(w=!1,T=!0,!S.length)return handleError(`missing open tag`);if(O=P=S.pop(),A=E+2+O.length,e.substring(E+2,A)!==O)return handleError(`closing tag mismatch`);for(;A<D;A++)if(j=e.charCodeAt(A),!(j===32||j>8&&j<14))return handleError(`close tag`)}else{if(e.charCodeAt(D-1)===47?(O=P=e.substring(E+1,D-1),w=!0,T=!0):(O=P=e.substring(E+1,D),w=!0,T=!1),!(j>96&&j<123||j>64&&j<91||j===95||j===58))return handleError(`illegal first char nodeName`);for(A=1,k=O.length;A<k;A++)if(j=O.charCodeAt(A),!(j>96&&j<123||j>64&&j<91||j>47&&j<59||j===45||j===95||j==46)){if(j===32||j<14&&j>8){P=O.substring(0,A),z=null;break}return handleError(`invalid nodeName`)}T||S.push(P)}if(g){w&&(f=null,z===null&&(h=O.indexOf(`xmlns`,A)!==-1)&&(R=A,L=O,getAttrs(),h=!1),T||y.push(f)),F=P,s===null&&(s=Object.create(null));var B=s[P];if(B!==void 0)P=B;else{if(j=P.indexOf(`:`),j!==-1){if(N=x[P.substring(0,j)],!N)return handleError(`missing namespace on <`+F+`>`);P=P.substr(j+1)}else N=x.xmlns;N&&(P=N+`:`+P),s[F]=P}}if(w&&(R=A,L=O,r&&(t?r(I,decodeEntities,T,d):r(P,getAttrs,decodeEntities,T,d),v)))return;if(T){if(i&&(i(t?I:P,decodeEntities,w,d),v))return;g&&(w||(f=y.pop()),f&&(restoreNsMatrix(x,f),f=null,s=null,m=null))}D+=1}}}}}o();function hasLowerCaseAlias(e){return e.xml&&e.xml.tagAlias===`lowerCase`}var x={xsi:`http://www.w3.org/2001/XMLSchema-instance`,xml:`http://www.w3.org/XML/1998/namespace`},S=`property`;function getSerialization(e){return e.xml&&e.xml.serialize}function getSerializationType(e){let t=getSerialization(e);return t!==S&&(t||null)}function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function aliasToName(e,t){return hasLowerCaseAlias(t)?e.prefix+`:`+capitalize(e.localName):e.name}function prefixedToName(e,t){var n=e.name,r=e.localName,i=t&&t.xml&&t.xml.typePrefix;return i&&r.indexOf(i)===0?e.prefix+`:`+r.slice(i.length):n}function normalizeTypeName(e,t,n){let r=parseName(e,t.xmlns),i=parseName(`${t[r.prefix]||r.prefix}:${r.localName}`);return prefixedToName(i,n.getPackage(i.prefix))}function error(e){return Error(e)}function getModdleDescriptor(e){return e.$descriptor}function Context(e){d(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw error(`expected element`);var t=this.elementsById,n=getModdleDescriptor(e).idProperty,r;if(n&&(r=e.get(n.name),r)){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(r))throw Error(`illegal ID <`+r+`>`);if(t[r])throw error(`duplicate ID <`+r+`>`);t[r]=e}},this.addWarning=function(e){this.warnings.push(e)}}function BaseHandler(){}BaseHandler.prototype.handleEnd=function(){},BaseHandler.prototype.handleText=function(){},BaseHandler.prototype.handleNode=function(){};function NoopHandler(){}NoopHandler.prototype=Object.create(BaseHandler.prototype),NoopHandler.prototype.handleNode=function(){return this};function BodyHandler(){}BodyHandler.prototype=Object.create(BaseHandler.prototype),BodyHandler.prototype.handleText=function(e){this.body=(this.body||``)+e};function ReferenceHandler(e,t){this.property=e,this.context=t}ReferenceHandler.prototype=Object.create(BodyHandler.prototype),ReferenceHandler.prototype.handleNode=function(e){if(this.element)throw error(`expected no sub nodes`);return this.element=this.createReference(e),this},ReferenceHandler.prototype.handleEnd=function(){this.element.id=this.body},ReferenceHandler.prototype.createReference=function(e){return{property:this.property.ns.name,id:``}};function ValueHandler(e,t){this.element=t,this.propertyDesc=e}ValueHandler.prototype=Object.create(BodyHandler.prototype),ValueHandler.prototype.handleEnd=function(){var e=this.body||``,t=this.element,n=this.propertyDesc;e=coerceType(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)};function BaseElementHandler(){}BaseElementHandler.prototype=Object.create(BodyHandler.prototype),BaseElementHandler.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t};function ElementHandler(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}ElementHandler.prototype=Object.create(BaseElementHandler.prototype),ElementHandler.prototype.addReference=function(e){this.context.addReference(e)},ElementHandler.prototype.handleText=function(e){var t=this.element;if(!getModdleDescriptor(t).bodyProperty)throw error(`unexpected body text <`+e+`>`);BodyHandler.prototype.handleText.call(this,e)},ElementHandler.prototype.handleEnd=function(){var e=this.body,t=this.element,n=getModdleDescriptor(t).bodyProperty;n&&e!==void 0&&(e=coerceType(n.type,e),t.set(n.name,e))},ElementHandler.prototype.createElement=function(e){var t=e.attributes,n=this.type,r=getModdleDescriptor(n),i=this.context,a=new n({}),o=this.model,s;return f(t,function(e,t){var n=r.propertiesByName[t],c;n&&n.isReference?n.isMany?(c=e.split(` `),f(c,function(e){i.addReference({element:a,property:n.ns.name,id:e})})):i.addReference({element:a,property:n.ns.name,id:e}):(n?e=coerceType(n.type,e):t===`xmlns`?t=`:`+t:(s=parseName(t,r.ns.prefix),o.getPackage(s.prefix)&&i.addWarning({message:`unknown attribute <`+t+`>`,element:a,property:t,value:e})),a.set(t,e))}),a},ElementHandler.prototype.getPropertyForNode=function(e){var t=e.name,n=parseName(t),r=this.type,i=this.model,a=getModdleDescriptor(r),o=n.name,s=a.propertiesByName[o];if(s&&!s.isAttr){let t=getSerializationType(s);if(t){let n=e.attributes[t];if(n){let t=normalizeTypeName(n,e.ns,i),r=i.getType(t);return d({},s,{effectiveType:getModdleDescriptor(r).name})}}return s}var c=i.getPackage(n.prefix);if(c){let e=aliasToName(n,c),t=i.getType(e);if(s=u(a.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&t.hasType(e.type)}),s)return d({},s,{effectiveType:getModdleDescriptor(t).name})}else if(s=u(a.properties,function(e){return!e.isReference&&!e.isAttribute&&e.type===`Element`}),s)return s;throw error(`unrecognized element <`+n.name+`>`)},ElementHandler.prototype.toString=function(){return`ElementDescriptor[`+getModdleDescriptor(this.type).name+`]`},ElementHandler.prototype.valueHandler=function(e,t){return new ValueHandler(e,t)},ElementHandler.prototype.referenceHandler=function(e){return new ReferenceHandler(e,this.context)},ElementHandler.prototype.handler=function(e){return e===`Element`?new GenericElementHandler(this.model,e,this.context):new ElementHandler(this.model,e,this.context)},ElementHandler.prototype.handleChild=function(e){var t=this.getPropertyForNode(e),n,r=this.element,i;if(n=t.effectiveType||t.type,isSimple(n))return this.valueHandler(t,r);i=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e);var a=i.element;return a!==void 0&&(t.isMany?r.get(t.name).push(a):r.set(t.name,a),t.isReference?(d(a,{element:r}),this.context.addReference(a)):a.$parent=r),i};function RootElementHandler(e,t,n){ElementHandler.call(this,e,t,n)}RootElementHandler.prototype=Object.create(ElementHandler.prototype),RootElementHandler.prototype.createElement=function(e){var t=e.name,n=parseName(t),r=this.model,i=this.type,a=r.getPackage(n.prefix),o=a&&aliasToName(n,a)||t;if(!i.hasType(o))throw error(`unexpected element <`+e.originalName+`>`);return ElementHandler.prototype.createElement.call(this,e)};function GenericElementHandler(e,t,n){this.model=e,this.context=n}GenericElementHandler.prototype=Object.create(BaseElementHandler.prototype),GenericElementHandler.prototype.createElement=function(e){var t=e.name,n=parseName(t).prefix,r=e.ns[n+`$uri`],i=e.attributes;return this.model.createAny(t,r,i)},GenericElementHandler.prototype.handleChild=function(e){var t=new GenericElementHandler(this.model,`Element`,this.context).handleNode(e),n=this.element,r=t.element,i;return r!==void 0&&(i=n.$children=n.$children||[],i.push(r),r.$parent=n),t},GenericElementHandler.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)};function Reader(e){e instanceof Moddle&&(e={model:e}),d(this,{lax:!1},e)}Reader.prototype.fromXML=function(e,t,n){var r=t.rootHandler;t instanceof ElementHandler?(r=t,t={}):typeof t==`string`?(r=this.handler(t),t={}):typeof r==`string`&&(r=this.handler(r));var i=this.model,a=this.lax,o=new Context(d({},t,{rootHandler:r})),s=new Parser({proxy:!0}),c=createStack();r.context=o,c.push(r);function handleError(e,t,n){var r=t(),i=r.line,a=r.column,s=r.data;s.charAt(0)===`<`&&s.indexOf(` `)!==-1&&(s=s.slice(0,s.indexOf(` `))+`>`);var c=`unparsable content `+(s?s+` `:``)+`detected
|
|
2
|
+
line: `+i+`
|
|
3
|
+
column: `+a+`
|
|
4
|
+
nested error: `+e.message;if(n)return o.addWarning({message:c,error:e}),!0;throw error(c)}function handleWarning(e,t){return handleError(e,t,!0)}function resolveReferences(){for(var e=o.elementsById,t=o.references,n=0,r;r=t[n];n++){var i=r.element,a=e[r.id],s=getModdleDescriptor(i).propertiesByName[r.property];if(a||o.addWarning({message:`unresolved reference <`+r.id+`>`,element:r.element,property:r.property,value:r.id}),s.isMany){var c=i.get(s.name),l=c.indexOf(r);l===-1&&(l=c.length),a?c[l]=a:c.splice(l,1)}else i.set(s.name,a)}}function handleClose(){c.pop().handleEnd()}var l=/^<\?xml /i,u=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function handleQuestion(e){if(l.test(e)){var t=u.exec(e),n=t&&t[1];n&&!f.test(n)&&o.addWarning({message:`unsupported document encoding <`+n+`>, falling back to UTF-8`})}}function handleOpen(e,t){var n=c.peek();try{c.push(n.handleNode(e))}catch(e){handleError(e,t,a)&&c.push(new NoopHandler)}}function handleCData(e,t){try{c.peek().handleText(e)}catch(e){handleWarning(e,t)}}function handleText(e,t){e.trim()&&handleCData(e,t)}var p=i.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},Object.entries(x).reduce(function(e,[t,n]){return e[n]=t,e},i.config&&i.config.nsMap||{}));return s.ns(p).on(`openTag`,function(e,t,n,r){var i=e.attrs||{},a=Object.keys(i).reduce(function(e,n){return e[n]=t(i[n]),e},{});handleOpen({name:e.name,originalName:e.originalName,attributes:a,ns:e.ns},r)}).on(`question`,handleQuestion).on(`closeTag`,handleClose).on(`cdata`,handleCData).on(`text`,function(e,t,n){handleText(t(e),n)}).on(`error`,handleError).on(`warn`,handleWarning),new Promise(function(t,n){var i;try{s.parse(e),resolveReferences()}catch(e){i=e}var a=r.element;!i&&!a&&(i=error(`failed to parse document as <`+r.type.$descriptor.name+`>`));var c=o.warnings,l=o.references,u=o.elementsById;return i?(i.warnings=c,n(i)):t({rootElement:a,elementsById:u,references:l,warnings:c})})},Reader.prototype.handler=function(e){return new RootElementHandler(this.model,e)};function createStack(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}var C=`<?xml version="1.0" encoding="UTF-8"?>
|
|
5
|
+
`,w=/<|>|'|"|&|\n\r|\n/g,T=/<|>|&/g;function Namespaces(e){this.prefixMap={},this.uriMap={},this.used={},this.wellknown=[],this.custom=[],this.parent=e,this.defaultPrefixMap=e&&e.defaultPrefixMap||{}}Namespaces.prototype.mapDefaultPrefixes=function(e){this.defaultPrefixMap=e},Namespaces.prototype.defaultUriByPrefix=function(e){return this.defaultPrefixMap[e]},Namespaces.prototype.resolve=function(e){for(var t=this;t;){var n=e(t);if(n)return n;t=t.parent}},Namespaces.prototype.eachScope=function(e){for(var t=this;t;)e(t),t=t.parent},Namespaces.prototype.byUri=function(e){return this.resolve(function(t){return t.uriMap[e]})},Namespaces.prototype.add=function(e,t){this.uriMap[e.uri]=e,t?this.wellknown.push(e):this.custom.push(e),this.mapPrefix(e.prefix,e.uri)},Namespaces.prototype.uriByPrefix=function(e){var t=e||`xmlns`;return this.resolve(function(e){return e.prefixMap[t]})},Namespaces.prototype.mapPrefix=function(e,t){this.prefixMap[e||`xmlns`]=t},Namespaces.prototype.getNSKey=function(e){return e.prefix===void 0?e.uri:e.uri+`|`+e.prefix},Namespaces.prototype.logUsed=function(e){var t=e.uri,n=this.getNSKey(e),r=this.byUri(t);this.eachScope(function(e){e.used[n]=r})},Namespaces.prototype.getUsed=function(e){return[].concat(this.wellknown,this.custom).filter(e=>{var t=this.getNSKey(e);return this.used[t]})};function lower(e){return e.charAt(0).toLowerCase()+e.slice(1)}function nameToAlias(e,t){return hasLowerCaseAlias(t)?lower(e):e}function inherits(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function nsName(e){return p(e)?e:(e.prefix?e.prefix+`:`:``)+e.localName}function getNsAttrs(e){return e.getUsed().filter(function(e){return e.prefix!==`xml`}).map(function(e){return{name:`xmlns`+(e.prefix?`:`+e.prefix:``),value:e.uri}})}function getElementNs(e,t){return t.isGeneric?d({localName:t.ns.localName},e):d({localName:nameToAlias(t.ns.localName,t.$pkg)},e)}function getPropertyNs(e,t){return d({localName:t.ns.localName},e)}function getSerializableProperties(e){var t=e.$descriptor;return c(t.properties,function(t){var n=t.name;if(t.isVirtual||!l(e,n))return!1;var r=e[n];return r===t.default||r===null?!1:!t.isMany||r.length})}var E={"\n":`#10`,"\n\r":`#10`,'"':`#34`,"'":`#39`,"<":`#60`,">":`#62`,"&":`#38`},D={"<":`lt`,">":`gt`,"&":`amp`};function escape(e,t,n){return e=p(e)?e:``+e,e.replace(t,function(e){return`&`+n[e]+`;`})}function escapeAttr(e){return escape(e,w,E)}function escapeBody(e){return escape(e,T,D)}function filterAttributes(e){return c(e,function(e){return e.isAttr})}function filterContained(e){return c(e,function(e){return!e.isAttr})}function ReferenceSerializer(e){this.tagName=e}ReferenceSerializer.prototype.build=function(e){return this.element=e,this},ReferenceSerializer.prototype.serializeTo=function(e){e.appendIndent().append(`<`+this.tagName+`>`+this.element.id+`</`+this.tagName+`>`).appendNewLine()};function BodySerializer(){}BodySerializer.prototype.serializeValue=BodySerializer.prototype.serializeTo=function(e){e.append(this.escape?escapeBody(this.value):this.value)},BodySerializer.prototype.build=function(e,t){return this.value=t,e.type===`String`&&t.search(T)!==-1&&(this.escape=!0),this};function ValueSerializer(e){this.tagName=e}inherits(ValueSerializer,BodySerializer),ValueSerializer.prototype.serializeTo=function(e){e.appendIndent().append(`<`+this.tagName+`>`),this.serializeValue(e),e.append(`</`+this.tagName+`>`).appendNewLine()};function ElementSerializer(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}ElementSerializer.prototype.build=function(e){return buildTree(this,e),this},ElementSerializer.prototype.enter=function(e){this.element=e;var t=e.$descriptor,n=this.propertyDescriptor,r=t.isGeneric;if(this.otherAttrs=r?this.parseGenericNsAttributes(e):this.parseNsAttributes(e),this.ns=n?this.nsPropertyTagName(n):this.nsTagName(t),this.tagName=this.addTagName(this.ns),r)return this.collectGenericContainments(e);var i=getSerializableProperties(e);return this.parseAttributes(filterAttributes(i)),this.collectContainments(filterContained(i))},ElementSerializer.prototype.exit=function(){this.parseGenericAttributes(this.element,this.otherAttrs)},ElementSerializer.prototype.nsTagName=function(e){return getElementNs(this.logNamespaceUsed(e.ns),e)},ElementSerializer.prototype.nsPropertyTagName=function(e){return getPropertyNs(this.logNamespaceUsed(e.ns),e)},ElementSerializer.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},ElementSerializer.prototype.nsAttributeName=function(e){var t=p(e)?parseName(e):e.ns;if(e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:d({localName:t.localName},n)},ElementSerializer.prototype.parseGenericNsAttributes=function(e){return Object.entries(e).filter(([t,n])=>!t.startsWith(`$`)&&this.parseNsAttribute(e,t,n)).map(([e,t])=>({name:e,value:t}))},ElementSerializer.prototype.collectGenericContainments=function(e){var t=this,n=[],r=e.$body;r&&n.push({create:function(){return new BodySerializer().build({type:`String`},r)}});var i=e.$children;return i&&f(i,function(e){n.push({create:function(){return new ElementSerializer(t)},element:e})}),n},ElementSerializer.prototype.parseNsAttribute=function(e,t,n){var r=e.$model,i=parseName(t),a;if(i.prefix===`xmlns`&&(a={prefix:i.localName,uri:n}),!i.prefix&&i.localName===`xmlns`&&(a={uri:n}),!a)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(a,!0,!0);else{var o=this.logNamespaceUsed(a,!0);this.getNamespaces().logUsed(o)}},ElementSerializer.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,r=[];return f(n,function(n,i){var a=t.parseNsAttribute(e,i,n);a&&r.push(a)}),r},ElementSerializer.prototype.parseGenericAttributes=function(e,t){var n=this;f(t,function(t){try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){typeof console<`u`&&console.warn(`missing namespace information for <${t.name}=${t.value}> on`,e,n)}})},ElementSerializer.prototype.collectContainments=function(e){var t=this,n=this.element,r=[];return f(e,function(e){var i=n.get(e.name),a=e.isReference;if(e.isMany||(i=[i]),e.isBody)r.push({create:function(){return new BodySerializer().build(e,i[0])}});else if(isSimple(e.type))f(i,function(n){r.push({create:function(){return new ValueSerializer(t.addTagName(t.nsPropertyTagName(e))).build(e,n)}})});else if(a)f(i,function(n){r.push({create:function(){return new ReferenceSerializer(t.addTagName(t.nsPropertyTagName(e))).build(n)}})});else{var o=getSerialization(e);f(i,function(n){r.push({create:function(){return o?o===S?new ElementSerializer(t,e):new TypeSerializer(t,e,o):new ElementSerializer(t)},element:n})})}}),r},ElementSerializer.prototype.getNamespaces=function(e){var t=this.namespaces;if(!t){var n=this.getParentNamespaces();e||!n?this.namespaces=t=new Namespaces(n):t=n}return t},ElementSerializer.prototype.getParentNamespaces=function(){if(this.parentNamespaces!==void 0)return this.parentNamespaces;for(var e=null,t=this.parent;t;){if(t.namespaces){e=t.namespaces;break}if(t.parentNamespaces!==void 0){e=t.parentNamespaces;break}t=t.parent}return this.parentNamespaces=e},ElementSerializer.prototype.logNamespace=function(e,t,n){var r=this.getNamespaces(n),i=e.uri,a=e.prefix;return(!r.byUri(i)||n)&&r.add(e,t),r.mapPrefix(a,i),e},ElementSerializer.prototype.logNamespaceUsed=function(e,t){var n=this.getNamespaces(t),r=e.prefix,i=e.uri,a,o,s;if(!r&&!i)return{localName:e.localName};if(s=n.defaultUriByPrefix(r),i=i||s||n.uriByPrefix(r),!i)throw Error(`no namespace uri given for prefix <`+r+`>`);if(e=n.byUri(i),!e&&!r&&(e=this.logNamespace({uri:i},s===i,!0)),!e){for(a=r,o=1;n.uriByPrefix(a);)a=r+`_`+o++;e=this.logNamespace({prefix:a,uri:i},s===i)}return r&&n.mapPrefix(r,i),e},ElementSerializer.prototype.parseAttributes=function(e){var t=this,n=this.element;f(e,function(e){var r=n.get(e.name);if(e.isReference){if(!e.isMany)r=r.id;else{var i=[];f(r,function(e){i.push(e.id)}),r=i.join(` `)}}t.addAttribute(t.nsAttributeName(e),r)})},ElementSerializer.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),nsName(e)},ElementSerializer.prototype.addAttribute=function(e,t){var n=this.attrs;p(t)&&(t=escapeAttr(t));var r=a(n,function(t){return t.name.localName===e.localName&&t.name.uri===e.uri&&t.name.prefix===e.prefix}),i={name:e,value:t};r===-1?n.push(i):n.splice(r,1,i)},ElementSerializer.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=getNsAttrs(n).concat(t)),f(t,function(t){e.append(` `).append(nsName(t.name)).append(`="`).append(t.value).append(`"`)})},ElementSerializer.prototype.serializeTo=function(e){serializeTree(this,e)};function serializeTree(e,t){for(var n=[{serializer:e,index:0,opened:!1,indent:!1}];n.length;){var r=n[n.length-1],i=r.serializer;if(!r.opened){var a=i.body[0];if(r.indent=a&&a.constructor!==BodySerializer,t.appendIndent().append(`<`+i.tagName),i.serializeAttributes(t),t.append(a?`>`:` />`),r.opened=!0,!a){t.appendNewLine(),n.pop();continue}r.indent&&t.appendNewLine().indent()}if(r.index<i.body.length){var o=i.body[r.index++];o instanceof ElementSerializer?n.push({serializer:o,index:0,opened:!1,indent:!1}):o.serializeTo(t)}else r.indent&&t.unindent().appendIndent(),t.append(`</`+i.tagName+`>`).appendNewLine(),n.pop()}}function TypeSerializer(e,t,n){ElementSerializer.call(this,e,t),this.serialization=n}inherits(TypeSerializer,ElementSerializer),TypeSerializer.prototype.parseNsAttributes=function(e){var t=ElementSerializer.prototype.parseNsAttributes.call(this,e).filter(e=>e.name!==this.serialization),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var r=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var i=e.$model.getPackage(r.uri),a=i.xml&&i.xml.typePrefix||``;return this.addAttribute(this.nsAttributeName(this.serialization),(r.prefix?r.prefix+`:`:``)+a+n.ns.localName),t},TypeSerializer.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri};function SavingWriter(){this.value=``,this.write=function(e){this.value+=e}}function FormatingWriter(e,t){var n=[``];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write(`
|
|
6
|
+
`),this},this.appendIndent=function(){return t&&e.write(n.join(` `)),this},this.indent=function(){return n.push(``),this},this.unindent=function(){return n.pop(),this}}function Writer(e){e=d({format:!1,preamble:!0},e||{});function toXML(t,n){var r=n||new SavingWriter,i=new FormatingWriter(r,e.format);e.preamble&&i.append(C);var a=new ElementSerializer,o=t.$model;if(a.getNamespaces().mapDefaultPrefixes(getDefaultPrefixMappings(o)),a.build(t).serializeTo(i),!n)return r.value}return{toXML}}function buildTree(e,t){for(var n=[{serializer:e,children:e.enter(t),index:0}];n.length;){var r=n[n.length-1];if(r.index>=r.children.length)r.serializer.exit(),n.pop();else{var i=r.children[r.index++],a=i.create();r.serializer.body.push(a),i.element&&n.push({serializer:a,children:a.enter(i.element),index:0})}}}function getDefaultPrefixMappings(e){let t=e.config&&e.config.nsMap||{},n={};for(let e in x)n[e]=x[e];for(let e in t){let r=t[e];n[r]=e}for(let t of e.getPackages())n[t.prefix]=t.uri;return n}var O=t({BpmnModdle:()=>SimpleBpmnModdle});o();function BpmnModdle(e,t){Moddle.call(this,e,t)}BpmnModdle.prototype=Object.create(Moddle.prototype),BpmnModdle.prototype.fromXML=function(e,t,n){p(t)||(n=t,t=`bpmn:Definitions`);var r=new Reader(d({model:this,lax:!0},n)),i=r.handler(t);return r.fromXML(e,i)},BpmnModdle.prototype.toXML=function(e,t){var n=new Writer(t);return new Promise(function(t,r){try{return t({xml:n.toXML(e)})}catch(e){return r(e)}})};var k={bpmn:{name:`BPMN20`,uri:`http://www.omg.org/spec/BPMN/20100524/MODEL`,prefix:`bpmn`,associations:[],types:[{name:`Interface`,superClass:[`RootElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`operations`,type:`Operation`,isMany:!0},{name:`implementationRef`,isAttr:!0,type:`String`}]},{name:`Operation`,superClass:[`BaseElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`inMessageRef`,type:`Message`,isReference:!0},{name:`outMessageRef`,type:`Message`,isReference:!0},{name:`errorRef`,type:`Error`,isMany:!0,isReference:!0},{name:`implementationRef`,isAttr:!0,type:`String`}]},{name:`EndPoint`,superClass:[`RootElement`]},{name:`Auditing`,superClass:[`BaseElement`]},{name:`GlobalTask`,superClass:[`CallableElement`],properties:[{name:`resources`,type:`ResourceRole`,isMany:!0}]},{name:`Monitoring`,superClass:[`BaseElement`]},{name:`Performer`,superClass:[`ResourceRole`]},{name:`Process`,superClass:[`FlowElementsContainer`,`CallableElement`],properties:[{name:`processType`,type:`ProcessType`,isAttr:!0},{name:`isClosed`,isAttr:!0,type:`Boolean`},{name:`auditing`,type:`Auditing`},{name:`monitoring`,type:`Monitoring`},{name:`properties`,type:`Property`,isMany:!0},{name:`laneSets`,isMany:!0,replaces:`FlowElementsContainer#laneSets`,type:`LaneSet`},{name:`flowElements`,isMany:!0,replaces:`FlowElementsContainer#flowElements`,type:`FlowElement`},{name:`artifacts`,type:`Artifact`,isMany:!0},{name:`resources`,type:`ResourceRole`,isMany:!0},{name:`correlationSubscriptions`,type:`CorrelationSubscription`,isMany:!0},{name:`supports`,type:`Process`,isMany:!0,isReference:!0},{name:`definitionalCollaborationRef`,type:`Collaboration`,isAttr:!0,isReference:!0},{name:`isExecutable`,isAttr:!0,type:`Boolean`}]},{name:`LaneSet`,superClass:[`BaseElement`],properties:[{name:`lanes`,type:`Lane`,isMany:!0},{name:`name`,isAttr:!0,type:`String`}]},{name:`Lane`,superClass:[`BaseElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`partitionElementRef`,type:`BaseElement`,isAttr:!0,isReference:!0},{name:`partitionElement`,type:`BaseElement`},{name:`flowNodeRef`,type:`FlowNode`,isMany:!0,isReference:!0},{name:`childLaneSet`,type:`LaneSet`,xml:{serialize:`xsi:type`}}]},{name:`GlobalManualTask`,superClass:[`GlobalTask`]},{name:`ManualTask`,superClass:[`Task`]},{name:`UserTask`,superClass:[`Task`],properties:[{name:`renderings`,type:`Rendering`,isMany:!0},{name:`implementation`,isAttr:!0,type:`String`}]},{name:`Rendering`,superClass:[`BaseElement`]},{name:`HumanPerformer`,superClass:[`Performer`]},{name:`PotentialOwner`,superClass:[`HumanPerformer`]},{name:`GlobalUserTask`,superClass:[`GlobalTask`],properties:[{name:`implementation`,isAttr:!0,type:`String`},{name:`renderings`,type:`Rendering`,isMany:!0}]},{name:`Gateway`,isAbstract:!0,superClass:[`FlowNode`],properties:[{name:`gatewayDirection`,type:`GatewayDirection`,default:`Unspecified`,isAttr:!0}]},{name:`EventBasedGateway`,superClass:[`Gateway`],properties:[{name:`instantiate`,default:!1,isAttr:!0,type:`Boolean`},{name:`eventGatewayType`,type:`EventBasedGatewayType`,isAttr:!0,default:`Exclusive`}]},{name:`ComplexGateway`,superClass:[`Gateway`],properties:[{name:`activationCondition`,type:`Expression`,xml:{serialize:`xsi:type`}},{name:`default`,type:`SequenceFlow`,isAttr:!0,isReference:!0}]},{name:`ExclusiveGateway`,superClass:[`Gateway`],properties:[{name:`default`,type:`SequenceFlow`,isAttr:!0,isReference:!0}]},{name:`InclusiveGateway`,superClass:[`Gateway`],properties:[{name:`default`,type:`SequenceFlow`,isAttr:!0,isReference:!0}]},{name:`ParallelGateway`,superClass:[`Gateway`]},{name:`RootElement`,isAbstract:!0,superClass:[`BaseElement`]},{name:`Relationship`,superClass:[`BaseElement`],properties:[{name:`type`,isAttr:!0,type:`String`},{name:`direction`,type:`RelationshipDirection`,isAttr:!0},{name:`source`,isMany:!0,isReference:!0,type:`Element`},{name:`target`,isMany:!0,isReference:!0,type:`Element`}]},{name:`BaseElement`,isAbstract:!0,properties:[{name:`id`,isAttr:!0,type:`String`,isId:!0},{name:`documentation`,type:`Documentation`,isMany:!0},{name:`extensionDefinitions`,type:`ExtensionDefinition`,isMany:!0,isReference:!0},{name:`extensionElements`,type:`ExtensionElements`}]},{name:`Extension`,properties:[{name:`mustUnderstand`,default:!1,isAttr:!0,type:`Boolean`},{name:`definition`,type:`ExtensionDefinition`,isAttr:!0,isReference:!0}]},{name:`ExtensionDefinition`,properties:[{name:`name`,isAttr:!0,type:`String`},{name:`extensionAttributeDefinitions`,type:`ExtensionAttributeDefinition`,isMany:!0}]},{name:`ExtensionAttributeDefinition`,properties:[{name:`name`,isAttr:!0,type:`String`},{name:`type`,isAttr:!0,type:`String`},{name:`isReference`,default:!1,isAttr:!0,type:`Boolean`},{name:`extensionDefinition`,type:`ExtensionDefinition`,isAttr:!0,isReference:!0}]},{name:`ExtensionElements`,properties:[{name:`valueRef`,isAttr:!0,isReference:!0,type:`Element`},{name:`values`,type:`Element`,isMany:!0},{name:`extensionAttributeDefinition`,type:`ExtensionAttributeDefinition`,isAttr:!0,isReference:!0}]},{name:`Documentation`,superClass:[`BaseElement`],properties:[{name:`text`,type:`String`,isBody:!0},{name:`textFormat`,default:`text/plain`,isAttr:!0,type:`String`}]},{name:`Event`,isAbstract:!0,superClass:[`FlowNode`,`InteractionNode`],properties:[{name:`properties`,type:`Property`,isMany:!0}]},{name:`IntermediateCatchEvent`,superClass:[`CatchEvent`]},{name:`IntermediateThrowEvent`,superClass:[`ThrowEvent`]},{name:`EndEvent`,superClass:[`ThrowEvent`]},{name:`StartEvent`,superClass:[`CatchEvent`],properties:[{name:`isInterrupting`,default:!0,isAttr:!0,type:`Boolean`}]},{name:`ThrowEvent`,isAbstract:!0,superClass:[`Event`],properties:[{name:`dataInputs`,type:`DataInput`,isMany:!0},{name:`dataInputAssociations`,type:`DataInputAssociation`,isMany:!0},{name:`inputSet`,type:`InputSet`},{name:`eventDefinitions`,type:`EventDefinition`,isMany:!0},{name:`eventDefinitionRef`,type:`EventDefinition`,isMany:!0,isReference:!0}]},{name:`CatchEvent`,isAbstract:!0,superClass:[`Event`],properties:[{name:`parallelMultiple`,isAttr:!0,type:`Boolean`,default:!1},{name:`dataOutputs`,type:`DataOutput`,isMany:!0},{name:`dataOutputAssociations`,type:`DataOutputAssociation`,isMany:!0},{name:`outputSet`,type:`OutputSet`},{name:`eventDefinitions`,type:`EventDefinition`,isMany:!0},{name:`eventDefinitionRef`,type:`EventDefinition`,isMany:!0,isReference:!0}]},{name:`BoundaryEvent`,superClass:[`CatchEvent`],properties:[{name:`cancelActivity`,default:!0,isAttr:!0,type:`Boolean`},{name:`attachedToRef`,type:`Activity`,isAttr:!0,isReference:!0}]},{name:`EventDefinition`,isAbstract:!0,superClass:[`RootElement`]},{name:`CancelEventDefinition`,superClass:[`EventDefinition`]},{name:`ErrorEventDefinition`,superClass:[`EventDefinition`],properties:[{name:`errorRef`,type:`Error`,isAttr:!0,isReference:!0}]},{name:`TerminateEventDefinition`,superClass:[`EventDefinition`]},{name:`EscalationEventDefinition`,superClass:[`EventDefinition`],properties:[{name:`escalationRef`,type:`Escalation`,isAttr:!0,isReference:!0}]},{name:`Escalation`,properties:[{name:`structureRef`,type:`ItemDefinition`,isAttr:!0,isReference:!0},{name:`name`,isAttr:!0,type:`String`},{name:`escalationCode`,isAttr:!0,type:`String`}],superClass:[`RootElement`]},{name:`CompensateEventDefinition`,superClass:[`EventDefinition`],properties:[{name:`waitForCompletion`,isAttr:!0,type:`Boolean`,default:!0},{name:`activityRef`,type:`Activity`,isAttr:!0,isReference:!0}]},{name:`TimerEventDefinition`,superClass:[`EventDefinition`],properties:[{name:`timeDate`,type:`Expression`,xml:{serialize:`xsi:type`}},{name:`timeCycle`,type:`Expression`,xml:{serialize:`xsi:type`}},{name:`timeDuration`,type:`Expression`,xml:{serialize:`xsi:type`}}]},{name:`LinkEventDefinition`,superClass:[`EventDefinition`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`target`,type:`LinkEventDefinition`,isReference:!0},{name:`source`,type:`LinkEventDefinition`,isMany:!0,isReference:!0}]},{name:`MessageEventDefinition`,superClass:[`EventDefinition`],properties:[{name:`messageRef`,type:`Message`,isAttr:!0,isReference:!0},{name:`operationRef`,type:`Operation`,isReference:!0}]},{name:`ConditionalEventDefinition`,superClass:[`EventDefinition`],properties:[{name:`condition`,type:`Expression`,xml:{serialize:`xsi:type`}}]},{name:`SignalEventDefinition`,superClass:[`EventDefinition`],properties:[{name:`signalRef`,type:`Signal`,isAttr:!0,isReference:!0}]},{name:`Signal`,superClass:[`RootElement`],properties:[{name:`structureRef`,type:`ItemDefinition`,isAttr:!0,isReference:!0},{name:`name`,isAttr:!0,type:`String`}]},{name:`ImplicitThrowEvent`,superClass:[`ThrowEvent`]},{name:`DataState`,superClass:[`BaseElement`],properties:[{name:`name`,isAttr:!0,type:`String`}]},{name:`ItemAwareElement`,superClass:[`BaseElement`],properties:[{name:`itemSubjectRef`,type:`ItemDefinition`,isAttr:!0,isReference:!0},{name:`dataState`,type:`DataState`}]},{name:`DataAssociation`,superClass:[`BaseElement`],properties:[{name:`sourceRef`,type:`ItemAwareElement`,isMany:!0,isReference:!0},{name:`targetRef`,type:`ItemAwareElement`,isReference:!0},{name:`transformation`,type:`FormalExpression`,xml:{serialize:`property`}},{name:`assignment`,type:`Assignment`,isMany:!0}]},{name:`DataInput`,superClass:[`ItemAwareElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`isCollection`,default:!1,isAttr:!0,type:`Boolean`},{name:`inputSetRef`,type:`InputSet`,isMany:!0,isVirtual:!0,isReference:!0},{name:`inputSetWithOptional`,type:`InputSet`,isMany:!0,isVirtual:!0,isReference:!0},{name:`inputSetWithWhileExecuting`,type:`InputSet`,isMany:!0,isVirtual:!0,isReference:!0}]},{name:`DataOutput`,superClass:[`ItemAwareElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`isCollection`,default:!1,isAttr:!0,type:`Boolean`},{name:`outputSetRef`,type:`OutputSet`,isMany:!0,isVirtual:!0,isReference:!0},{name:`outputSetWithOptional`,type:`OutputSet`,isMany:!0,isVirtual:!0,isReference:!0},{name:`outputSetWithWhileExecuting`,type:`OutputSet`,isMany:!0,isVirtual:!0,isReference:!0}]},{name:`InputSet`,superClass:[`BaseElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`dataInputRefs`,type:`DataInput`,isMany:!0,isReference:!0},{name:`optionalInputRefs`,type:`DataInput`,isMany:!0,isReference:!0},{name:`whileExecutingInputRefs`,type:`DataInput`,isMany:!0,isReference:!0},{name:`outputSetRefs`,type:`OutputSet`,isMany:!0,isReference:!0}]},{name:`OutputSet`,superClass:[`BaseElement`],properties:[{name:`dataOutputRefs`,type:`DataOutput`,isMany:!0,isReference:!0},{name:`name`,isAttr:!0,type:`String`},{name:`inputSetRefs`,type:`InputSet`,isMany:!0,isReference:!0},{name:`optionalOutputRefs`,type:`DataOutput`,isMany:!0,isReference:!0},{name:`whileExecutingOutputRefs`,type:`DataOutput`,isMany:!0,isReference:!0}]},{name:`Property`,superClass:[`ItemAwareElement`],properties:[{name:`name`,isAttr:!0,type:`String`}]},{name:`DataInputAssociation`,superClass:[`DataAssociation`]},{name:`DataOutputAssociation`,superClass:[`DataAssociation`]},{name:`InputOutputSpecification`,superClass:[`BaseElement`],properties:[{name:`dataInputs`,type:`DataInput`,isMany:!0},{name:`dataOutputs`,type:`DataOutput`,isMany:!0},{name:`inputSets`,type:`InputSet`,isMany:!0},{name:`outputSets`,type:`OutputSet`,isMany:!0}]},{name:`DataObject`,superClass:[`FlowElement`,`ItemAwareElement`],properties:[{name:`isCollection`,default:!1,isAttr:!0,type:`Boolean`}]},{name:`InputOutputBinding`,properties:[{name:`inputDataRef`,type:`InputSet`,isAttr:!0,isReference:!0},{name:`outputDataRef`,type:`OutputSet`,isAttr:!0,isReference:!0},{name:`operationRef`,type:`Operation`,isAttr:!0,isReference:!0}]},{name:`Assignment`,superClass:[`BaseElement`],properties:[{name:`from`,type:`Expression`,xml:{serialize:`xsi:type`}},{name:`to`,type:`Expression`,xml:{serialize:`xsi:type`}}]},{name:`DataStore`,superClass:[`RootElement`,`ItemAwareElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`capacity`,isAttr:!0,type:`Integer`},{name:`isUnlimited`,default:!0,isAttr:!0,type:`Boolean`}]},{name:`DataStoreReference`,superClass:[`ItemAwareElement`,`FlowElement`],properties:[{name:`dataStoreRef`,type:`DataStore`,isAttr:!0,isReference:!0}]},{name:`DataObjectReference`,superClass:[`ItemAwareElement`,`FlowElement`],properties:[{name:`dataObjectRef`,type:`DataObject`,isAttr:!0,isReference:!0}]},{name:`ConversationLink`,superClass:[`BaseElement`],properties:[{name:`sourceRef`,type:`InteractionNode`,isAttr:!0,isReference:!0},{name:`targetRef`,type:`InteractionNode`,isAttr:!0,isReference:!0},{name:`name`,isAttr:!0,type:`String`}]},{name:`ConversationAssociation`,superClass:[`BaseElement`],properties:[{name:`innerConversationNodeRef`,type:`ConversationNode`,isAttr:!0,isReference:!0},{name:`outerConversationNodeRef`,type:`ConversationNode`,isAttr:!0,isReference:!0}]},{name:`CallConversation`,superClass:[`ConversationNode`],properties:[{name:`calledCollaborationRef`,type:`Collaboration`,isAttr:!0,isReference:!0},{name:`participantAssociations`,type:`ParticipantAssociation`,isMany:!0}]},{name:`Conversation`,superClass:[`ConversationNode`]},{name:`SubConversation`,superClass:[`ConversationNode`],properties:[{name:`conversationNodes`,type:`ConversationNode`,isMany:!0}]},{name:`ConversationNode`,isAbstract:!0,superClass:[`InteractionNode`,`BaseElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`participantRef`,type:`Participant`,isMany:!0,isReference:!0},{name:`messageFlowRefs`,type:`MessageFlow`,isMany:!0,isReference:!0},{name:`correlationKeys`,type:`CorrelationKey`,isMany:!0}]},{name:`GlobalConversation`,superClass:[`Collaboration`]},{name:`PartnerEntity`,superClass:[`RootElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`participantRef`,type:`Participant`,isMany:!0,isReference:!0}]},{name:`PartnerRole`,superClass:[`RootElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`participantRef`,type:`Participant`,isMany:!0,isReference:!0}]},{name:`CorrelationProperty`,superClass:[`RootElement`],properties:[{name:`correlationPropertyRetrievalExpression`,type:`CorrelationPropertyRetrievalExpression`,isMany:!0},{name:`name`,isAttr:!0,type:`String`},{name:`type`,type:`ItemDefinition`,isAttr:!0,isReference:!0}]},{name:`Error`,superClass:[`RootElement`],properties:[{name:`structureRef`,type:`ItemDefinition`,isAttr:!0,isReference:!0},{name:`name`,isAttr:!0,type:`String`},{name:`errorCode`,isAttr:!0,type:`String`}]},{name:`CorrelationKey`,superClass:[`BaseElement`],properties:[{name:`correlationPropertyRef`,type:`CorrelationProperty`,isMany:!0,isReference:!0},{name:`name`,isAttr:!0,type:`String`}]},{name:`Expression`,superClass:[`BaseElement`],isAbstract:!1,properties:[{name:`body`,isBody:!0,type:`String`}]},{name:`FormalExpression`,superClass:[`Expression`],properties:[{name:`language`,isAttr:!0,type:`String`},{name:`evaluatesToTypeRef`,type:`ItemDefinition`,isAttr:!0,isReference:!0}]},{name:`Message`,superClass:[`RootElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`itemRef`,type:`ItemDefinition`,isAttr:!0,isReference:!0}]},{name:`ItemDefinition`,superClass:[`RootElement`],properties:[{name:`itemKind`,type:`ItemKind`,isAttr:!0},{name:`structureRef`,isAttr:!0,type:`String`},{name:`isCollection`,default:!1,isAttr:!0,type:`Boolean`},{name:`import`,type:`Import`,isAttr:!0,isReference:!0}]},{name:`FlowElement`,isAbstract:!0,superClass:[`BaseElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`auditing`,type:`Auditing`},{name:`monitoring`,type:`Monitoring`},{name:`categoryValueRef`,type:`CategoryValue`,isMany:!0,isReference:!0}]},{name:`SequenceFlow`,superClass:[`FlowElement`],properties:[{name:`isImmediate`,isAttr:!0,type:`Boolean`},{name:`conditionExpression`,type:`Expression`,xml:{serialize:`xsi:type`}},{name:`sourceRef`,type:`FlowNode`,isAttr:!0,isReference:!0},{name:`targetRef`,type:`FlowNode`,isAttr:!0,isReference:!0}]},{name:`FlowElementsContainer`,isAbstract:!0,superClass:[`BaseElement`],properties:[{name:`laneSets`,type:`LaneSet`,isMany:!0},{name:`flowElements`,type:`FlowElement`,isMany:!0}]},{name:`CallableElement`,isAbstract:!0,superClass:[`RootElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`ioSpecification`,type:`InputOutputSpecification`,xml:{serialize:`property`}},{name:`supportedInterfaceRef`,type:`Interface`,isMany:!0,isReference:!0},{name:`ioBinding`,type:`InputOutputBinding`,isMany:!0,xml:{serialize:`property`}}]},{name:`FlowNode`,isAbstract:!0,superClass:[`FlowElement`],properties:[{name:`incoming`,type:`SequenceFlow`,isMany:!0,isReference:!0},{name:`outgoing`,type:`SequenceFlow`,isMany:!0,isReference:!0},{name:`lanes`,type:`Lane`,isMany:!0,isVirtual:!0,isReference:!0}]},{name:`CorrelationPropertyRetrievalExpression`,superClass:[`BaseElement`],properties:[{name:`messagePath`,type:`FormalExpression`},{name:`messageRef`,type:`Message`,isAttr:!0,isReference:!0}]},{name:`CorrelationPropertyBinding`,superClass:[`BaseElement`],properties:[{name:`dataPath`,type:`FormalExpression`},{name:`correlationPropertyRef`,type:`CorrelationProperty`,isAttr:!0,isReference:!0}]},{name:`Resource`,superClass:[`RootElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`resourceParameters`,type:`ResourceParameter`,isMany:!0}]},{name:`ResourceParameter`,superClass:[`BaseElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`isRequired`,isAttr:!0,type:`Boolean`},{name:`type`,type:`ItemDefinition`,isAttr:!0,isReference:!0}]},{name:`CorrelationSubscription`,superClass:[`BaseElement`],properties:[{name:`correlationKeyRef`,type:`CorrelationKey`,isAttr:!0,isReference:!0},{name:`correlationPropertyBinding`,type:`CorrelationPropertyBinding`,isMany:!0}]},{name:`MessageFlow`,superClass:[`BaseElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`sourceRef`,type:`InteractionNode`,isAttr:!0,isReference:!0},{name:`targetRef`,type:`InteractionNode`,isAttr:!0,isReference:!0},{name:`messageRef`,type:`Message`,isAttr:!0,isReference:!0}]},{name:`MessageFlowAssociation`,superClass:[`BaseElement`],properties:[{name:`innerMessageFlowRef`,type:`MessageFlow`,isAttr:!0,isReference:!0},{name:`outerMessageFlowRef`,type:`MessageFlow`,isAttr:!0,isReference:!0}]},{name:`InteractionNode`,isAbstract:!0,properties:[{name:`incomingConversationLinks`,type:`ConversationLink`,isMany:!0,isVirtual:!0,isReference:!0},{name:`outgoingConversationLinks`,type:`ConversationLink`,isMany:!0,isVirtual:!0,isReference:!0}]},{name:`Participant`,superClass:[`InteractionNode`,`BaseElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`interfaceRef`,type:`Interface`,isMany:!0,isReference:!0},{name:`participantMultiplicity`,type:`ParticipantMultiplicity`},{name:`endPointRefs`,type:`EndPoint`,isMany:!0,isReference:!0},{name:`processRef`,type:`Process`,isAttr:!0,isReference:!0}]},{name:`ParticipantAssociation`,superClass:[`BaseElement`],properties:[{name:`innerParticipantRef`,type:`Participant`,isAttr:!0,isReference:!0},{name:`outerParticipantRef`,type:`Participant`,isAttr:!0,isReference:!0}]},{name:`ParticipantMultiplicity`,properties:[{name:`minimum`,default:0,isAttr:!0,type:`Integer`},{name:`maximum`,default:1,isAttr:!0,type:`Integer`}],superClass:[`BaseElement`]},{name:`Collaboration`,superClass:[`RootElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`isClosed`,isAttr:!0,type:`Boolean`},{name:`participants`,type:`Participant`,isMany:!0},{name:`messageFlows`,type:`MessageFlow`,isMany:!0},{name:`artifacts`,type:`Artifact`,isMany:!0},{name:`conversations`,type:`ConversationNode`,isMany:!0},{name:`conversationAssociations`,type:`ConversationAssociation`},{name:`participantAssociations`,type:`ParticipantAssociation`,isMany:!0},{name:`messageFlowAssociations`,type:`MessageFlowAssociation`,isMany:!0},{name:`correlationKeys`,type:`CorrelationKey`,isMany:!0},{name:`choreographyRef`,type:`Choreography`,isMany:!0,isReference:!0},{name:`conversationLinks`,type:`ConversationLink`,isMany:!0}]},{name:`ChoreographyActivity`,isAbstract:!0,superClass:[`FlowNode`],properties:[{name:`participantRef`,type:`Participant`,isMany:!0,isReference:!0},{name:`initiatingParticipantRef`,type:`Participant`,isAttr:!0,isReference:!0},{name:`correlationKeys`,type:`CorrelationKey`,isMany:!0},{name:`loopType`,type:`ChoreographyLoopType`,default:`None`,isAttr:!0}]},{name:`CallChoreography`,superClass:[`ChoreographyActivity`],properties:[{name:`calledChoreographyRef`,type:`Choreography`,isAttr:!0,isReference:!0},{name:`participantAssociations`,type:`ParticipantAssociation`,isMany:!0}]},{name:`SubChoreography`,superClass:[`ChoreographyActivity`,`FlowElementsContainer`],properties:[{name:`artifacts`,type:`Artifact`,isMany:!0}]},{name:`ChoreographyTask`,superClass:[`ChoreographyActivity`],properties:[{name:`messageFlowRef`,type:`MessageFlow`,isMany:!0,isReference:!0}]},{name:`Choreography`,superClass:[`Collaboration`,`FlowElementsContainer`]},{name:`GlobalChoreographyTask`,superClass:[`Choreography`],properties:[{name:`initiatingParticipantRef`,type:`Participant`,isAttr:!0,isReference:!0}]},{name:`TextAnnotation`,superClass:[`Artifact`],properties:[{name:`text`,type:`String`},{name:`textFormat`,default:`text/plain`,isAttr:!0,type:`String`}]},{name:`Group`,superClass:[`Artifact`],properties:[{name:`categoryValueRef`,type:`CategoryValue`,isAttr:!0,isReference:!0}]},{name:`Association`,superClass:[`Artifact`],properties:[{name:`associationDirection`,type:`AssociationDirection`,isAttr:!0},{name:`sourceRef`,type:`BaseElement`,isAttr:!0,isReference:!0},{name:`targetRef`,type:`BaseElement`,isAttr:!0,isReference:!0}]},{name:`Category`,superClass:[`RootElement`],properties:[{name:`categoryValue`,type:`CategoryValue`,isMany:!0},{name:`name`,isAttr:!0,type:`String`}]},{name:`Artifact`,isAbstract:!0,superClass:[`BaseElement`]},{name:`CategoryValue`,superClass:[`BaseElement`],properties:[{name:`categorizedFlowElements`,type:`FlowElement`,isMany:!0,isVirtual:!0,isReference:!0},{name:`value`,isAttr:!0,type:`String`}]},{name:`Activity`,isAbstract:!0,superClass:[`FlowNode`],properties:[{name:`isForCompensation`,default:!1,isAttr:!0,type:`Boolean`},{name:`default`,type:`SequenceFlow`,isAttr:!0,isReference:!0},{name:`ioSpecification`,type:`InputOutputSpecification`,xml:{serialize:`property`}},{name:`boundaryEventRefs`,type:`BoundaryEvent`,isMany:!0,isReference:!0},{name:`properties`,type:`Property`,isMany:!0},{name:`dataInputAssociations`,type:`DataInputAssociation`,isMany:!0},{name:`dataOutputAssociations`,type:`DataOutputAssociation`,isMany:!0},{name:`startQuantity`,default:1,isAttr:!0,type:`Integer`},{name:`resources`,type:`ResourceRole`,isMany:!0},{name:`completionQuantity`,default:1,isAttr:!0,type:`Integer`},{name:`loopCharacteristics`,type:`LoopCharacteristics`}]},{name:`ServiceTask`,superClass:[`Task`],properties:[{name:`implementation`,isAttr:!0,type:`String`},{name:`operationRef`,type:`Operation`,isAttr:!0,isReference:!0}]},{name:`SubProcess`,superClass:[`Activity`,`FlowElementsContainer`,`InteractionNode`],properties:[{name:`triggeredByEvent`,default:!1,isAttr:!0,type:`Boolean`},{name:`artifacts`,type:`Artifact`,isMany:!0}]},{name:`LoopCharacteristics`,isAbstract:!0,superClass:[`BaseElement`]},{name:`MultiInstanceLoopCharacteristics`,superClass:[`LoopCharacteristics`],properties:[{name:`isSequential`,default:!1,isAttr:!0,type:`Boolean`},{name:`behavior`,type:`MultiInstanceBehavior`,default:`All`,isAttr:!0},{name:`loopCardinality`,type:`Expression`,xml:{serialize:`xsi:type`}},{name:`loopDataInputRef`,type:`ItemAwareElement`,isReference:!0},{name:`loopDataOutputRef`,type:`ItemAwareElement`,isReference:!0},{name:`inputDataItem`,type:`DataInput`,xml:{serialize:`property`}},{name:`outputDataItem`,type:`DataOutput`,xml:{serialize:`property`}},{name:`complexBehaviorDefinition`,type:`ComplexBehaviorDefinition`,isMany:!0},{name:`completionCondition`,type:`Expression`,xml:{serialize:`xsi:type`}},{name:`oneBehaviorEventRef`,type:`EventDefinition`,isAttr:!0,isReference:!0},{name:`noneBehaviorEventRef`,type:`EventDefinition`,isAttr:!0,isReference:!0}]},{name:`StandardLoopCharacteristics`,superClass:[`LoopCharacteristics`],properties:[{name:`testBefore`,default:!1,isAttr:!0,type:`Boolean`},{name:`loopCondition`,type:`Expression`,xml:{serialize:`xsi:type`}},{name:`loopMaximum`,type:`Integer`,isAttr:!0}]},{name:`CallActivity`,superClass:[`Activity`,`InteractionNode`],properties:[{name:`calledElement`,type:`String`,isAttr:!0}]},{name:`Task`,superClass:[`Activity`,`InteractionNode`]},{name:`SendTask`,superClass:[`Task`],properties:[{name:`implementation`,isAttr:!0,type:`String`},{name:`operationRef`,type:`Operation`,isAttr:!0,isReference:!0},{name:`messageRef`,type:`Message`,isAttr:!0,isReference:!0}]},{name:`ReceiveTask`,superClass:[`Task`],properties:[{name:`implementation`,isAttr:!0,type:`String`},{name:`instantiate`,default:!1,isAttr:!0,type:`Boolean`},{name:`operationRef`,type:`Operation`,isAttr:!0,isReference:!0},{name:`messageRef`,type:`Message`,isAttr:!0,isReference:!0}]},{name:`ScriptTask`,superClass:[`Task`],properties:[{name:`scriptFormat`,isAttr:!0,type:`String`},{name:`script`,type:`String`}]},{name:`BusinessRuleTask`,superClass:[`Task`],properties:[{name:`implementation`,isAttr:!0,type:`String`}]},{name:`AdHocSubProcess`,superClass:[`SubProcess`],properties:[{name:`completionCondition`,type:`Expression`,xml:{serialize:`xsi:type`}},{name:`ordering`,type:`AdHocOrdering`,isAttr:!0},{name:`cancelRemainingInstances`,default:!0,isAttr:!0,type:`Boolean`}]},{name:`Transaction`,superClass:[`SubProcess`],properties:[{name:`protocol`,isAttr:!0,type:`String`},{name:`method`,isAttr:!0,type:`String`}]},{name:`GlobalScriptTask`,superClass:[`GlobalTask`],properties:[{name:`scriptLanguage`,isAttr:!0,type:`String`},{name:`script`,isAttr:!0,type:`String`}]},{name:`GlobalBusinessRuleTask`,superClass:[`GlobalTask`],properties:[{name:`implementation`,isAttr:!0,type:`String`}]},{name:`ComplexBehaviorDefinition`,superClass:[`BaseElement`],properties:[{name:`condition`,type:`FormalExpression`},{name:`event`,type:`ImplicitThrowEvent`}]},{name:`ResourceRole`,superClass:[`BaseElement`],properties:[{name:`resourceRef`,type:`Resource`,isReference:!0},{name:`resourceParameterBindings`,type:`ResourceParameterBinding`,isMany:!0},{name:`resourceAssignmentExpression`,type:`ResourceAssignmentExpression`},{name:`name`,isAttr:!0,type:`String`}]},{name:`ResourceParameterBinding`,properties:[{name:`expression`,type:`Expression`,xml:{serialize:`xsi:type`}},{name:`parameterRef`,type:`ResourceParameter`,isAttr:!0,isReference:!0}],superClass:[`BaseElement`]},{name:`ResourceAssignmentExpression`,properties:[{name:`expression`,type:`Expression`,xml:{serialize:`xsi:type`}}],superClass:[`BaseElement`]},{name:`Import`,properties:[{name:`importType`,isAttr:!0,type:`String`},{name:`location`,isAttr:!0,type:`String`},{name:`namespace`,isAttr:!0,type:`String`}]},{name:`Definitions`,superClass:[`BaseElement`],properties:[{name:`name`,isAttr:!0,type:`String`},{name:`targetNamespace`,isAttr:!0,type:`String`},{name:`expressionLanguage`,default:`http://www.w3.org/1999/XPath`,isAttr:!0,type:`String`},{name:`typeLanguage`,default:`http://www.w3.org/2001/XMLSchema`,isAttr:!0,type:`String`},{name:`imports`,type:`Import`,isMany:!0},{name:`extensions`,type:`Extension`,isMany:!0},{name:`rootElements`,type:`RootElement`,isMany:!0},{name:`diagrams`,isMany:!0,type:`bpmndi:BPMNDiagram`},{name:`exporter`,isAttr:!0,type:`String`},{name:`relationships`,type:`Relationship`,isMany:!0},{name:`exporterVersion`,isAttr:!0,type:`String`}]}],enumerations:[{name:`ProcessType`,literalValues:[{name:`None`},{name:`Public`},{name:`Private`}]},{name:`GatewayDirection`,literalValues:[{name:`Unspecified`},{name:`Converging`},{name:`Diverging`},{name:`Mixed`}]},{name:`EventBasedGatewayType`,literalValues:[{name:`Parallel`},{name:`Exclusive`}]},{name:`RelationshipDirection`,literalValues:[{name:`None`},{name:`Forward`},{name:`Backward`},{name:`Both`}]},{name:`ItemKind`,literalValues:[{name:`Physical`},{name:`Information`}]},{name:`ChoreographyLoopType`,literalValues:[{name:`None`},{name:`Standard`},{name:`MultiInstanceSequential`},{name:`MultiInstanceParallel`}]},{name:`AssociationDirection`,literalValues:[{name:`None`},{name:`One`},{name:`Both`}]},{name:`MultiInstanceBehavior`,literalValues:[{name:`None`},{name:`One`},{name:`All`},{name:`Complex`}]},{name:`AdHocOrdering`,literalValues:[{name:`Parallel`},{name:`Sequential`}]}],xml:{tagAlias:`lowerCase`,typePrefix:`t`}},bpmndi:{name:`BPMNDI`,uri:`http://www.omg.org/spec/BPMN/20100524/DI`,prefix:`bpmndi`,types:[{name:`BPMNDiagram`,properties:[{name:`plane`,type:`BPMNPlane`,redefines:`di:Diagram#rootElement`},{name:`labelStyle`,type:`BPMNLabelStyle`,isMany:!0}],superClass:[`di:Diagram`]},{name:`BPMNPlane`,properties:[{name:`bpmnElement`,isAttr:!0,isReference:!0,type:`bpmn:BaseElement`,redefines:`di:DiagramElement#modelElement`}],superClass:[`di:Plane`]},{name:`BPMNShape`,properties:[{name:`bpmnElement`,isAttr:!0,isReference:!0,type:`bpmn:BaseElement`,redefines:`di:DiagramElement#modelElement`},{name:`isHorizontal`,isAttr:!0,type:`Boolean`},{name:`isExpanded`,isAttr:!0,type:`Boolean`},{name:`isMarkerVisible`,isAttr:!0,type:`Boolean`},{name:`label`,type:`BPMNLabel`},{name:`isMessageVisible`,isAttr:!0,type:`Boolean`},{name:`participantBandKind`,type:`ParticipantBandKind`,isAttr:!0},{name:`choreographyActivityShape`,type:`BPMNShape`,isAttr:!0,isReference:!0}],superClass:[`di:LabeledShape`]},{name:`BPMNEdge`,properties:[{name:`label`,type:`BPMNLabel`},{name:`bpmnElement`,isAttr:!0,isReference:!0,type:`bpmn:BaseElement`,redefines:`di:DiagramElement#modelElement`},{name:`sourceElement`,isAttr:!0,isReference:!0,type:`di:DiagramElement`,redefines:`di:Edge#source`},{name:`targetElement`,isAttr:!0,isReference:!0,type:`di:DiagramElement`,redefines:`di:Edge#target`},{name:`messageVisibleKind`,type:`MessageVisibleKind`,isAttr:!0,default:`initiating`}],superClass:[`di:LabeledEdge`]},{name:`BPMNLabel`,properties:[{name:`labelStyle`,type:`BPMNLabelStyle`,isAttr:!0,isReference:!0,redefines:`di:DiagramElement#style`}],superClass:[`di:Label`]},{name:`BPMNLabelStyle`,properties:[{name:`font`,type:`dc:Font`}],superClass:[`di:Style`]}],enumerations:[{name:`ParticipantBandKind`,literalValues:[{name:`top_initiating`},{name:`middle_initiating`},{name:`bottom_initiating`},{name:`top_non_initiating`},{name:`middle_non_initiating`},{name:`bottom_non_initiating`}]},{name:`MessageVisibleKind`,literalValues:[{name:`initiating`},{name:`non_initiating`}]}],associations:[]},dc:{name:`DC`,uri:`http://www.omg.org/spec/DD/20100524/DC`,prefix:`dc`,types:[{name:`Boolean`},{name:`Integer`},{name:`Real`},{name:`String`},{name:`Font`,properties:[{name:`name`,type:`String`,isAttr:!0},{name:`size`,type:`Real`,isAttr:!0},{name:`isBold`,type:`Boolean`,isAttr:!0},{name:`isItalic`,type:`Boolean`,isAttr:!0},{name:`isUnderline`,type:`Boolean`,isAttr:!0},{name:`isStrikeThrough`,type:`Boolean`,isAttr:!0}]},{name:`Point`,properties:[{name:`x`,type:`Real`,default:`0`,isAttr:!0},{name:`y`,type:`Real`,default:`0`,isAttr:!0}]},{name:`Bounds`,properties:[{name:`x`,type:`Real`,default:`0`,isAttr:!0},{name:`y`,type:`Real`,default:`0`,isAttr:!0},{name:`width`,type:`Real`,isAttr:!0},{name:`height`,type:`Real`,isAttr:!0}]}],associations:[]},di:{name:`DI`,uri:`http://www.omg.org/spec/DD/20100524/DI`,prefix:`di`,types:[{name:`DiagramElement`,isAbstract:!0,properties:[{name:`id`,isAttr:!0,isId:!0,type:`String`},{name:`extension`,type:`Extension`},{name:`owningDiagram`,type:`Diagram`,isReadOnly:!0,isVirtual:!0,isReference:!0},{name:`owningElement`,type:`DiagramElement`,isReadOnly:!0,isVirtual:!0,isReference:!0},{name:`modelElement`,isReadOnly:!0,isVirtual:!0,isReference:!0,type:`Element`},{name:`style`,type:`Style`,isReadOnly:!0,isVirtual:!0,isReference:!0},{name:`ownedElement`,type:`DiagramElement`,isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:`Node`,isAbstract:!0,superClass:[`DiagramElement`]},{name:`Edge`,isAbstract:!0,superClass:[`DiagramElement`],properties:[{name:`source`,type:`DiagramElement`,isReadOnly:!0,isVirtual:!0,isReference:!0},{name:`target`,type:`DiagramElement`,isReadOnly:!0,isVirtual:!0,isReference:!0},{name:`waypoint`,isUnique:!1,isMany:!0,type:`dc:Point`,xml:{serialize:`xsi:type`}}]},{name:`Diagram`,isAbstract:!0,properties:[{name:`id`,isAttr:!0,isId:!0,type:`String`},{name:`rootElement`,type:`DiagramElement`,isReadOnly:!0,isVirtual:!0},{name:`name`,isAttr:!0,type:`String`},{name:`documentation`,isAttr:!0,type:`String`},{name:`resolution`,isAttr:!0,type:`Real`},{name:`ownedStyle`,type:`Style`,isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:`Shape`,isAbstract:!0,superClass:[`Node`],properties:[{name:`bounds`,type:`dc:Bounds`}]},{name:`Plane`,isAbstract:!0,superClass:[`Node`],properties:[{name:`planeElement`,type:`DiagramElement`,subsettedProperty:`DiagramElement-ownedElement`,isMany:!0}]},{name:`LabeledEdge`,isAbstract:!0,superClass:[`Edge`],properties:[{name:`ownedLabel`,type:`Label`,isReadOnly:!0,subsettedProperty:`DiagramElement-ownedElement`,isMany:!0,isVirtual:!0}]},{name:`LabeledShape`,isAbstract:!0,superClass:[`Shape`],properties:[{name:`ownedLabel`,type:`Label`,isReadOnly:!0,subsettedProperty:`DiagramElement-ownedElement`,isMany:!0,isVirtual:!0}]},{name:`Label`,isAbstract:!0,superClass:[`Node`],properties:[{name:`bounds`,type:`dc:Bounds`}]},{name:`Style`,isAbstract:!0,properties:[{name:`id`,isAttr:!0,isId:!0,type:`String`}]},{name:`Extension`,properties:[{name:`values`,isMany:!0,type:`Element`}]}],associations:[],xml:{tagAlias:`lowerCase`}},bioc:{name:`bpmn.io colors for BPMN`,uri:`http://bpmn.io/schema/bpmn/biocolor/1.0`,prefix:`bioc`,types:[{name:`ColoredShape`,extends:[`bpmndi:BPMNShape`],properties:[{name:`stroke`,isAttr:!0,type:`String`},{name:`fill`,isAttr:!0,type:`String`}]},{name:`ColoredEdge`,extends:[`bpmndi:BPMNEdge`],properties:[{name:`stroke`,isAttr:!0,type:`String`},{name:`fill`,isAttr:!0,type:`String`}]}],enumerations:[],associations:[]},color:{name:`BPMN in Color`,uri:`http://www.omg.org/spec/BPMN/non-normative/color/1.0`,prefix:`color`,types:[{name:`ColoredLabel`,extends:[`bpmndi:BPMNLabel`],properties:[{name:`color`,isAttr:!0,type:`String`}]},{name:`ColoredShape`,extends:[`bpmndi:BPMNShape`],properties:[{name:`background-color`,isAttr:!0,type:`String`},{name:`border-color`,isAttr:!0,type:`String`}]},{name:`ColoredEdge`,extends:[`bpmndi:BPMNEdge`],properties:[{name:`border-color`,isAttr:!0,type:`String`}]}],enumerations:[],associations:[]}};function SimpleBpmnModdle(e,t){return new BpmnModdle(d({},k,e),t)}export{Parser as a,Writer as i,O as n,Moddle as o,Reader as r,SimpleBpmnModdle as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{Ct as e,D as t,Dt as n,Et as r,F as i,I as a,K as o,N as s,Ot as c,P as l,Q as u,R as d,St as f,Tt as p,_t as m,et as h,ft as g,gt as _,jt as v,lt as y,mt as b,ot as x,vt as S,wt as ee,xt as te,yt as C,z as ne}from"./dist-CsBP6QjA.js";var CompletionContext=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=s(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),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(ensureAnchor(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function toSet(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 prefixMatch(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<r.length;e++)n[r[e]]=!0}let r=toSet(t)+toSet(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function completeFromList(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:prefixMatch(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function ifNotIn(e,t){return n=>{for(let t=s(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var Option=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function cur(e){return e.selection.main.from}function ensureAnchor(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var w=y.define();function insertCompletionText(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:b.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var T=new WeakMap;function asSource(e){if(!Array.isArray(e))return e;let t=T.get(e);return t||T.set(e,t=completeFromList(e)),t}var E=f.define(),D=f.define(),FuzzyMatcher=class{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<e.length;){let i=r(e,t),a=n(i);this.chars.push(i);let o=e.slice(t,t+a),s=o.toUpperCase();this.folded.push(r(s==o?o.toLowerCase():s,0)),t+=a}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:a,precise:o,byWord:s}=this;if(t.length==1){let a=r(e,0),o=n(a),s=o==e.length?0:-100;if(a!=t[0]){if(a==i[0])s+=-200;else return null}return this.ret(s,[0,o])}let c=e.indexOf(this.pattern);if(c==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,u=0;if(c<0){for(let o=0,s=Math.min(e.length,200);o<s&&u<l;){let s=r(e,o);(s==t[u]||s==i[u])&&(a[u++]=o),o+=n(s)}if(u<l)return null}let d=0,f=0,p=!1,m=0,h=-1,g=-1,_=/[a-z]/.test(e),y=!0;for(let a=0,u=Math.min(e.length,200),b=0;a<u&&f<l;){let u=r(e,a);c<0&&(d<l&&u==t[d]&&(o[d++]=a),m<l&&(u==t[m]||u==i[m]?(m==0&&(h=a),g=a+1,m++):m=0));let x,S=u<255?u>=48&&u<=57||u>=97&&u<=122?2:+(u>=65&&u<=90):(x=v(u))==x.toLowerCase()?x==x.toUpperCase()?0:2:1;(!a||S==1&&_||b==0&&S!=0)&&(t[f]==u||i[f]==u&&(p=!0)?s[f++]=a:s.length&&(y=!1)),b=S,a+=n(u)}return f==l&&s[0]==0&&y?this.result(-100+(p?-200:0),s,e):m==l&&h==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):c>-1?this.ret(-700-e.length,[c,c+this.pattern.length]):m==l?this.ret(-900-e.length,[h,g]):f==l?this.result(-100+(p?-200:0)+-700+(y?0:-1100),s,e):t.length==2?null:this.result((a[0]?-700:0)+-200+-1100,a,e)}result(e,t,i){let a=[],o=0;for(let e of t){let t=e+(this.astral?n(r(i,e)):1);o&&a[o-1]==e?a[o-1]=t:(a[o++]=e,a[o++]=t)}return this.ret(e-i.length,a)}},StrictMatcher=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},O=_.define({combine(e){return c(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:defaultPositionInfo,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||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=>joinClass(e(n),t(n)),optionClass:(e,t)=>n=>joinClass(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function joinClass(e,t){return e?t?e+` `+t:e:t}function defaultPositionInfo(e,t,n,r,a,o){let s=e.textDirection==i.RTL,c=s,l=!1,u=`top`,d,f,p=t.left-a.left,m=a.right-t.right,h=r.right-r.left,g=r.bottom-r.top;if(c&&p<Math.min(h,m)?c=!1:!c&&m<Math.min(h,p)&&(c=!0),h<=(c?p:m))d=Math.max(a.top,Math.min(n.top,a.bottom-g))-t.top,f=Math.min(400,c?p:m);else{l=!0,f=Math.min(400,(s?t.right:a.right-t.left)-30);let e=a.bottom-t.bottom;e>=g||e>t.top?d=n.bottom-t.top:(u=`bottom`,d=t.bottom-n.top)}let _=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${d/_}px; max-width: ${f/v}px`,class:`cm-completionInfo-`+(l?s?`left-narrow`:`right-narrow`:c?`left`:`right`)}}var k=f.define();function optionContent(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,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function rangeAroundSelected(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 r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}var CompletionTooltip=class{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 r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(O);this.optionContent=optionContent(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=rangeAroundSelected(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:k.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(O).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:D.of(null)})}),this.showOptions(i,r.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){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;n.open&&n.open.options==r||(this.range=rangeAroundSelected(r.length,i,e.state.facet(O).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}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;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=rangeAroundSelected(t.options.length,t.selected,this.view.state.facet(O).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>h(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&scrollIntoView(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(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(O).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0)){if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function completionTooltip(e,t){return n=>new CompletionTooltip(n,e,t)}function scrollIntoView(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function score(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function sortOptions(e,t){let n=[],r=null,i=null,addOption=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},a=t.facet(O);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)addOption(new Option(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),o,s=a.filterStrict?new StrictMatcher(n):new FuzzyMatcher(n);for(let t of r.result.options)if(o=s.match(t.label)){let n=t.displayLabel?e?e(t,o.matched):[]:o.matched,a=o.score+(t.boost||0);if(addOption(new Option(t,r.source,n,a)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(a,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,cmp=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(cmp))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let o=[],s=null,c=a.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||c(e.completion,t.completion))){let t=e.completion;!s||s.label!=t.label||s.detail!=t.detail||s.type!=null&&t.type!=null&&s.type!=t.type||s.apply!=t.apply||s.boost!=t.boost?o.push(e):score(e.completion)>score(s)&&(o[o.length-1]=e),s=e.completion}return o}var A=class CompletionDialog{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,i,a){if(r&&!a&&e.some(e=>e.isPending))return r.setDisabled();let o=sortOptions(e,t);if(!o.length)return r&&e.some(e=>e.isPending)?r.setDisabled():null;let s=t.facet(O).selectOnOpen?0:-1;if(r&&r.selected!=s&&r.selected!=-1){let e=r.options[r.selected].completion;for(let t=0;t<o.length;t++)if(o[t].completion==e){s=t;break}}return new CompletionDialog(o,makeAttrs(n,s),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:ae,above:i.aboveCursor},r?r.timestamp:Date.now(),s,!1)}map(e){return new CompletionDialog(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new CompletionDialog(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},j=class CompletionState{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new CompletionState(M,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(O),r=(n.override||t.languageDataAt(`autocomplete`,cur(t)).map(asSource)).map(t=>(this.active.find(e=>e.source==t)||new N(t,+!!this.active.some(e=>e.state!=0))).update(e,n));r.length==this.active.length&&r.every((e,t)=>e==this.active[t])&&(r=this.active);let i=this.open,a=e.effects.some(e=>e.is(F));i&&e.docChanged&&(i=i.map(e.changes)),e.selection||r.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!sameResults(r,this.active)||a?i=A.build(r,t,this.id,i,n,a):i&&i.disabled&&!r.some(e=>e.isPending)&&(i=null),!i&&r.every(e=>!e.isPending)&&r.some(e=>e.hasResult())&&(r=r.map(e=>e.hasResult()?new N(e.source,0):e));for(let t of e.effects)t.is(k)&&(i&&=i.setSelected(t.value,this.id));return r==this.active&&i==this.open?this:new CompletionState(r,this.id,i)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?re:ie}};function sameResults(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var re={"aria-autocomplete":`list`},ie={};function makeAttrs(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var M=[];function getUpdateType(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(w);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var N=class ActiveSource{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let n=getUpdateType(e,t),r=this;(n&8||n&16&&this.touches(e))&&(r=new ActiveSource(r.source,0)),n&4&&r.state==0&&(r=new ActiveSource(this.source,1)),r=r.updateFor(e,n);for(let t of e.effects)if(t.is(E))r=new ActiveSource(r.source,1,t.value);else if(t.is(D))r=new ActiveSource(r.source,0);else if(t.is(F))for(let e of t.value)e.source==r.source&&(r=e);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(cur(e.state))}},P=class ActiveResult extends N{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(e,t){if(!(t&3))return this.map(e.changes);let n=this.result;n.map&&!e.changes.empty&&(n=n.map(n,e.changes));let r=e.changes.mapPos(this.from),i=e.changes.mapPos(this.to,1),a=cur(e.state);if(a>i||!n||t&2&&(cur(e.startState)==this.from||a<this.limit))return new N(this.source,t&4?1:0);let o=e.changes.mapPos(this.limit);return checkValid(n.validFor,e.state,r,i)?new ActiveResult(this.source,this.explicit,o,n,r,i):n.update&&(n=n.update(n,r,i,new CompletionContext(e.state,a,!1)))?new ActiveResult(this.source,this.explicit,o,n,n.from,n.to??cur(e.state)):new N(this.source,1,this.explicit)}map(e){if(e.empty)return this;let t=this.result.map?this.result.map(this.result,e):this.result;return t?new ActiveResult(this.source,this.explicit,e.mapPos(this.limit),t,e.mapPos(this.from),e.mapPos(this.to,1)):new N(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function checkValid(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):ensureAnchor(e,!0).test(i)}var F=f.define({map(e,t){return e.map(e=>e.map(t))}}),I=e.define({create(){return j.start()},update(e,t){return e.update(t)},provide:e=>[x.from(e,e=>e.tooltip),a.contentAttributes.from(e,e=>e.attrs)]});function applyCompletion(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(I).active.find(e=>e.source==t.source);return r instanceof P&&(typeof n==`string`?e.dispatch({...insertCompletionText(e.state,n,r.from,r.to),annotations:w.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}var ae=completionTooltip(I,applyCompletion);function moveCompletionSelection(e,t=`option`){return n=>{let r=n.state.field(I,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(O).interactionDelay)return!1;let i=1,a;t==`page`&&(a=o(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:s}=r.open.options,c=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:s-1;return c<0?c=t==`page`?0:s-1:c>=s&&(c=t==`page`?s-1:0),n.dispatch({effects:k.of(c)}),!0}}var acceptCompletion=e=>{let t=e.state.field(I,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(O).interactionDelay?!1:applyCompletion(e,t.open.options[t.open.selected])},startCompletion=e=>e.state.field(I,!1)?(e.dispatch({effects:E.of(!0)}),!0):!1,closeCompletion=e=>{let t=e.state.field(I,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:D.of(null)}),!0)},RunningQuery=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},oe=50,se=1e3,ce=d.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(I).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(I),n=e.state.facet(O);if(!e.selectionSet&&!e.docChanged&&e.startState.field(I)==t)return;let r=e.transactions.some(e=>{let t=getUpdateType(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>oe&&Date.now()-n.time>se){for(let e of n.context.abortListeners)try{e()}catch(e){h(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(E)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(I);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(O).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new CompletionContext(t,cur(t),e.explicit,this.view),r=new RunningQuery(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:D.of(null)}),h(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(O).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(O),n=this.view.state.field(I);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=cur(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new P(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending){if(i.done==null){let n=new N(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:F.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(I,!1);if(t&&t.tooltip&&this.view.state.facet(O).closeOnBlur){let n=t.open&&o(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:D.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:E.of(!1)}),20),this.composing=0}}}),L=typeof navigator==`object`&&/Win/.test(navigator.platform),R=S.highest(a.domEventHandlers({keydown(e,t){let n=t.state.field(I,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||!e.key||e.key.length>1||e.ctrlKey&&!(L&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&applyCompletion(t,r),!1}})),z=a.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`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".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`}}}),FieldPos=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},B=class FieldRange{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,m.TrackDel),n=e.mapPos(this.to,1,m.TrackDel);return t==null||n==null?null:new FieldRange(this.field,t,n)}},V=class Snippet{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,n){let r=[],i=[n],a=e.doc.lineAt(n),o=/^\s*/.exec(a.text)[0];for(let a of this.lines){if(r.length){let r=o,s=/^\t*/.exec(a)[0].length;for(let n=0;n<s;n++)r+=e.facet(t);i.push(n+r.length-s),a=r+a.slice(s)}r.push(a),n+=a.length+1}return{text:r,ranges:this.fieldPositions.map(e=>new B(e.field,i[e.line]+e.from,i[e.line]+e.to))}}static parse(e){let t=[],n=[],r=[],i;for(let a of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let e=i[1]?+i[1]:null,o=i[2]||i[3]||``,s=-1;e===0&&(e=1e9);let c=o.replace(/\\[{}]/g,e=>e[1]);for(let n=0;n<t.length;n++)(e==null?c&&t[n].name==c:t[n].seq==e)&&(s=n);if(s<0){let n=0;for(;n<t.length&&(e==null||t[n].seq!=null&&t[n].seq<e);)n++;t.splice(n,0,{seq:e,name:c}),s=n;for(let e of r)e.field>=s&&e.field++}for(let e of r)if(e.line==n.length&&e.from>i.index){let t=i[2]?3+(i[1]||``).length:2;e.from-=t,e.to-=t}r.push(new FieldPos(s,n.length,i.index,i.index+c.length)),a=a.slice(0,i.index)+o+a.slice(i.index+i[0].length)}a=a.replace(/\\([{}])/g,(e,t,i)=>{for(let e of r)e.line==n.length&&e.from>i&&(e.from--,e.to--);return t}),n.push(a)}return new Snippet(n,r)}},H=l.widget({widget:new class extends ne{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),U=l.mark({class:`cm-snippetField`}),W=class ActiveSnippet{constructor(e,t){this.ranges=e,this.active=t,this.deco=l.set(e.map(e=>(e.from==e.to?H:U).range(e.from,e.to)),!0)}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new ActiveSnippet(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))}},G=f.define({map(e,t){return e&&e.map(t)}}),le=f.define(),K=e.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(G))return n.value;if(n.is(le)&&e)return new W(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=>a.decorations.from(e,e=>e?e.deco:l.none)});function fieldSelection(e,t){return b.create(e.filter(e=>e.field==t).map(e=>b.range(e.from,e.to)))}function snippet(e){let t=V.parse(e);return(e,n,r,i)=>{let{text:a,ranges:o}=t.instantiate(e.state,r),{main:s}=e.state.selection,c={changes:{from:r,to:i==s.from?s.to:i,insert:ee.of(a)},scrollIntoView:!0,annotations:n?[w.of(n),p.userEvent.of(`input.complete`)]:void 0};if(o.length&&(c.selection=fieldSelection(o,0)),o.some(e=>e.field>0)){let t=new W(o,0),n=c.effects=[G.of(t)];e.state.field(K,!1)===void 0&&n.push(f.appendConfig.of([K,de,fe,z]))}e.dispatch(e.state.update(c))}}function moveField(e){return({state:t,dispatch:n})=>{let r=t.field(K,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:fieldSelection(r.ranges,i),effects:G.of(a?null:new W(r.ranges,i)),scrollIntoView:!0})),!0}}var clearSnippet=({state:e,dispatch:t})=>e.field(K,!1)?(t(e.update({effects:G.of(null)})),!0):!1,ue=[{key:`Tab`,run:moveField(1),shift:moveField(-1)},{key:`Escape`,run:clearSnippet}],q=_.define({combine(e){return e.length?e[0]:ue}}),de=S.highest(u.compute([q],e=>e.facet(q)));function snippetCompletion(e,t){return{...t,apply:snippet(e)}}var fe=a.domEventHandlers({mousedown(e,t){let n=t.state.field(K,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:fieldSelection(n.ranges,i.field),effects:G.of(n.ranges.some(e=>e.field>i.field)?new W(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),J={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},Y=f.define({map(e,t){return t.mapPos(e,-1,m.TrackAfter)??void 0}}),X=new class extends te{};X.startSide=1,X.endSide=-1;var Z=e.define({create(){return C.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(Y)&&(e=e.update({add:[X.range(n.value,n.value+1)]}));return e}});function closeBrackets(){return[me,Z]}var Q=`()[]{}<>«»»«[]{}`;function closing(e){for(let t=0;t<16;t+=2)if(Q.charCodeAt(t)==e)return Q.charAt(t+1);return v(e<128?e:e+1)}function config(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||J}var pe=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),me=a.inputHandler.of((e,t,i,a)=>{if((pe?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(a.length>2||a.length==2&&n(r(a,0))==1||t!=o.from||i!=o.to)return!1;let s=insertBracket(e.state,a);return s?(e.dispatch(s),!0):!1}),deleteBracketPair=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=config(e,e.selection.main.head).brackets||J.brackets,i=null,a=e.changeByRange(t=>{if(t.empty){let i=prevChar(e.doc,t.head);for(let a of n)if(a==i&&nextChar(e.doc,t.head)==closing(r(a,0)))return{changes:{from:t.head-a.length,to:t.head+a.length},range:b.cursor(t.head-a.length)}}return{range:i=t}});return i||t(e.update(a,{scrollIntoView:!0,userEvent:`delete.backward`})),!i},he=[{key:`Backspace`,run:deleteBracketPair}];function insertBracket(e,t){let n=config(e,e.selection.main.head),i=n.brackets||J.brackets;for(let a of i){let o=closing(r(a,0));if(t==a)return o==a?handleSame(e,a,i.indexOf(a+a+a)>-1,n):handleOpen(e,a,o,n.before||J.before);if(t==o&&closedBracketAt(e,e.selection.main.from))return handleClose(e,a,o)}return null}function closedBracketAt(e,t){let n=!1;return e.field(Z).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function nextChar(e,t){let i=e.sliceString(t,t+2);return i.slice(0,n(r(i,0)))}function prevChar(e,t){let i=e.sliceString(t-2,t);return n(r(i,0))==i.length?i:i.slice(1)}function handleOpen(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:Y.of(a.to+t.length),range:b.range(a.anchor+t.length,a.head+t.length)};let o=nextChar(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:Y.of(a.head+t.length),range:b.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function handleClose(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&nextChar(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:b.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function handleSame(e,t,n,r){let i=r.stringPrefixes||J.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:Y.of(r.to+t.length),range:b.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=nextChar(e.doc,o),c;if(s==t){if(nodeStart(e,o))return{changes:{insert:t+t,from:o},effects:Y.of(o+t.length),range:b.cursor(o+t.length)};if(closedBracketAt(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:b.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=canStartStringAt(e,o-2*t.length,i))>-1&&nodeStart(e,c))return{changes:{insert:t+t+t+t,from:o},effects:Y.of(o+t.length),range:b.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=g.Word&&canStartStringAt(e,o,i)>-1&&!probablyInString(e,o,t,i))return{changes:{insert:t+t,from:o},effects:Y.of(o+t.length),range:b.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function nodeStart(e,t){let n=s(e).resolveInner(t+1);return n.parent&&n.from==t}function probablyInString(e,t,n,r){let i=s(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function canStartStringAt(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=g.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=g.Word)return n}return-1}function autocompletion(e={}){return[R,I,O.of(e),ce,ge,z]}var $=[{key:`Ctrl-Space`,run:startCompletion},{mac:"Alt-`",run:startCompletion},{mac:`Alt-i`,run:startCompletion},{key:`Escape`,run:closeCompletion},{key:`ArrowDown`,run:moveCompletionSelection(!0)},{key:`ArrowUp`,run:moveCompletionSelection(!1)},{key:`PageDown`,run:moveCompletionSelection(!0,`page`)},{key:`PageUp`,run:moveCompletionSelection(!1,`page`)},{key:`Enter`,run:acceptCompletion}],ge=S.highest(u.computeN([O],e=>e.facet(O).defaultKeymap?[$]:[]));function completionStatus(e){let t=e.field(I,!1);return t&&t.active.some(e=>e.isPending)?`pending`:t&&t.active.some(e=>e.state!=0)?`active`:null}export{he as a,$ as c,insertCompletionText as d,snippet as f,closeBrackets as i,completionStatus as l,acceptCompletion as n,closeCompletion as o,snippetCompletion as p,autocompletion as r,completeFromList as s,CompletionContext as t,ifNotIn as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{_ as e,u as t}from"./dist-CHluRwHI.js";import{A as n,At as r,Ct as i,D as a,E as o,F as s,I as c,N as l,Ot as u,S as d,St as f,Tt as p,dt as m,gt as h,kt as g,lt as _,mt as v,n as y,ut as b,wt as x,x as S}from"./dist-CsBP6QjA.js";e();var toggleComment=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=getConfig(e.state,n.from);return r.line?C(e):r.block?T(e):!1};function command(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var C=command(changeLineComment,0),w=command(changeBlockComment,0),T=command((e,t)=>changeBlockComment(e,t,selectedLineRanges(t)),0);function getConfig(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var E=50;function findBlockComment(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-E,r),o=e.sliceDoc(i,i+E),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+E),d=e.sliceDoc(i-E,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function selectedLineRanges(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function changeBlockComment(e,t,n=t.selection.ranges){let r=n.map(e=>getConfig(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>findBlockComment(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function changeLineComment(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=getConfig(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var D=_.define(),O=_.define(),k=h.define(),A=h.define({combine(e){return u(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),j=i.define({create(){return V.empty},update(e,t){let n=t.state.facet(A),r=t.annotation(D);if(r){let i=L.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?updateBranch(o,o.length,n.minDepth,i):addSelection(o,t.startState.selection),new V(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(O);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(p.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=L.fromTransaction(t),o=t.annotation(p.time),s=t.annotation(p.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new V(e.done.map(L.fromJSON),e.undone.map(L.fromJSON))}});function history(e={}){return[j,A.of(e),c.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?N:e.inputType==`historyRedo`?P:null;return n?(e.preventDefault(),n(t)):!1}})]}var M=j;function cmd(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(j,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var N=cmd(0,!1),P=cmd(1,!1),F=cmd(0,!0),I=cmd(1,!0),L=class HistEvent{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new HistEvent(e.changes&&m.fromJSON(e.changes),[],e.mapped&&b.fromJSON(e.mapped),e.startSelection&&v.fromJSON(e.startSelection),e.selectionsAfter.map(v.fromJSON))}static fromTransaction(e,t){let n=R;for(let t of e.startState.facet(k)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new HistEvent(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,R)}static selection(e){return new HistEvent(void 0,R,void 0,void 0,e)}};function updateBranch(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function isAdjacent(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function eqSelectionShape(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function conc(e,t){return e.length?t.length?e.concat(t):e:t}var R=[],z=200;function addSelection(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-z));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),updateBranch(e,e.length-1,1e9,n.setSelAfter(r)))}return[L.selection([t])]}function popSelection(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 addMappingToBranch(e,t){if(!e.length)return e;let n=e.length,r=R;for(;n;){let i=mapEvent(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[L.selection(r)]:R}function mapEvent(e,t,n){let r=conc(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):R,n);if(!e.changes)return L.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new L(i,f.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var B=/^(input\.type|delete)($|\.)/,V=class HistoryState{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this}addChanges(e,t,n,r,i){let a=this.done,o=a[a.length-1];return a=o&&o.changes&&!o.changes.empty&&e.changes&&(!n||B.test(n))&&(!o.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,isAdjacent(o.changes,e.changes))||n==`input.type.compose`)?updateBranch(a,a.length-1,r.minDepth,new L(e.changes.compose(o.changes),conc(f.mapEffects(e.effects,o.changes),o.effects),o.mapped,o.startSelection,R)):updateBranch(a,a.length,r.minDepth,e),new HistoryState(a,R,t,n)}addSelection(e,t,n,r){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:R;return i.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&eqSelectionShape(i[i.length-1],e)?this:new HistoryState(addSelection(this.done,e),this.undone,t,n)}addMapping(e){return new HistoryState(addMappingToBranch(this.done,e),addMappingToBranch(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:D.of({side:e,rest:popSelection(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?R:r.slice(0,r.length-1);return i.mapped&&(n=addMappingToBranch(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:D.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};V.empty=new V(R,R);var H=[{key:`Mod-z`,run:N,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:P,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:P,preventDefault:!0},{key:`Mod-u`,run:F,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:I,preventDefault:!0}];function updateSel(e,t){return v.create(e.ranges.map(t),e.mainIndex)}function setSel(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function moveSel({state:e,dispatch:t},n){let r=updateSel(e.selection,n);return!r.eq(e.selection,!0)&&(t(setSel(e,r)),!0)}function rangeEnd(e,t){return v.cursor(t?e.to:e.from)}function cursorByChar(e,t){return moveSel(e,n=>n.empty?e.moveByChar(n,t):rangeEnd(n,t))}function ltrAtCursor(e){return e.textDirectionAt(e.state.selection.main.head)==s.LTR}var cursorCharLeft=e=>cursorByChar(e,!ltrAtCursor(e)),cursorCharRight=e=>cursorByChar(e,ltrAtCursor(e));function cursorByGroup(e,t){return moveSel(e,n=>n.empty?e.moveByGroup(n,t):rangeEnd(n,t))}var cursorGroupLeft=e=>cursorByGroup(e,!ltrAtCursor(e)),cursorGroupRight=e=>cursorByGroup(e,ltrAtCursor(e));typeof Intl<`u`&&Intl.Segmenter;function interestingNode(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function moveBySyntax(e,r,i){let a=l(e).resolveInner(r.head),o=i?t.closedBy:t.openedBy;for(let t=r.head;;){let n=i?a.childAfter(t):a.childBefore(t);if(!n)break;interestingNode(e,n,o)?a=n:t=i?n.to:n.from}let s=a.type.prop(o),c,u;return u=s&&(c=i?n(e,a.from,1):n(e,a.to,-1))&&c.matched?i?c.end.to:c.end.from:i?a.to:a.from,v.cursor(u,i?-1:1)}var cursorSyntaxLeft=e=>moveSel(e,t=>moveBySyntax(e.state,t,!ltrAtCursor(e))),cursorSyntaxRight=e=>moveSel(e,t=>moveBySyntax(e.state,t,ltrAtCursor(e)));function cursorByLine(e,t){return moveSel(e,n=>{if(!n.empty)return rangeEnd(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var cursorLineUp=e=>cursorByLine(e,!1),cursorLineDown=e=>cursorByLine(e,!0);function pageInfo(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(c.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function cursorByPage(e,t){let n=pageInfo(e),{state:r}=e,i=updateSel(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):rangeEnd(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,l=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<l&&(a=c.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(setSel(r,i),{effects:a}),!0}var cursorPageUp=e=>cursorByPage(e,!1),cursorPageDown=e=>cursorByPage(e,!0);function moveByLineBoundary(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=v.cursor(r.from+n))}return i}var cursorLineBoundaryForward=e=>moveSel(e,t=>moveByLineBoundary(e,t,!0)),cursorLineBoundaryBackward=e=>moveSel(e,t=>moveByLineBoundary(e,t,!1)),cursorLineBoundaryLeft=e=>moveSel(e,t=>moveByLineBoundary(e,t,!ltrAtCursor(e))),cursorLineBoundaryRight=e=>moveSel(e,t=>moveByLineBoundary(e,t,ltrAtCursor(e))),cursorLineStart=e=>moveSel(e,t=>e.moveToLineBoundary(t,!1,!1)),cursorLineEnd=e=>moveSel(e,t=>e.moveToLineBoundary(t,!0,!1));function toMatchingBracket(e,t,r){let i=!1,a=updateSel(e.selection,t=>{let a=n(e,t.head,-1)||n(e,t.head,1)||t.head>0&&n(e,t.head-1,1)||t.head<e.doc.length&&n(e,t.head+1,-1);if(!a||!a.end)return t;i=!0;let o=a.start.from==t.head?a.end.to:a.end.from;return r?v.range(t.anchor,o):v.cursor(o)});return i?(t(setSel(e,a)),!0):!1}var cursorMatchingBracket=({state:e,dispatch:t})=>toMatchingBracket(e,t,!1);function extendSel(e,t,n){let r=updateSel(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=v.range(e.head,e.anchor));let r=n(e);return v.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(setSel(e.state,r)),!0)}function selectByChar(e,t){return extendSel(e,t,n=>e.moveByChar(n,t))}var selectCharLeft=e=>selectByChar(e,!ltrAtCursor(e)),selectCharRight=e=>selectByChar(e,ltrAtCursor(e));function selectByGroup(e,t){return extendSel(e,t,n=>e.moveByGroup(n,t))}var selectGroupLeft=e=>selectByGroup(e,!ltrAtCursor(e)),selectGroupRight=e=>selectByGroup(e,ltrAtCursor(e)),selectSyntaxLeft=e=>{let t=!ltrAtCursor(e);return extendSel(e,t,n=>moveBySyntax(e.state,n,t))},selectSyntaxRight=e=>{let t=ltrAtCursor(e);return extendSel(e,t,n=>moveBySyntax(e.state,n,t))};function selectByLine(e,t){return extendSel(e,t,n=>e.moveVertically(n,t))}var selectLineUp=e=>selectByLine(e,!1),selectLineDown=e=>selectByLine(e,!0);function selectByPage(e,t){return extendSel(e,t,n=>e.moveVertically(n,t,pageInfo(e).height))}var selectPageUp=e=>selectByPage(e,!1),selectPageDown=e=>selectByPage(e,!0),selectLineBoundaryForward=e=>extendSel(e,!0,t=>moveByLineBoundary(e,t,!0)),selectLineBoundaryBackward=e=>extendSel(e,!1,t=>moveByLineBoundary(e,t,!1)),selectLineBoundaryLeft=e=>{let t=!ltrAtCursor(e);return extendSel(e,t,n=>moveByLineBoundary(e,n,t))},selectLineBoundaryRight=e=>{let t=ltrAtCursor(e);return extendSel(e,t,n=>moveByLineBoundary(e,n,t))},selectLineStart=e=>extendSel(e,!1,t=>v.cursor(e.lineBlockAt(t.head).from)),selectLineEnd=e=>extendSel(e,!0,t=>v.cursor(e.lineBlockAt(t.head).to)),cursorDocStart=({state:e,dispatch:t})=>(t(setSel(e,{anchor:0})),!0),cursorDocEnd=({state:e,dispatch:t})=>(t(setSel(e,{anchor:e.doc.length})),!0),selectDocStart=({state:e,dispatch:t})=>(t(setSel(e,{anchor:e.selection.main.anchor,head:0})),!0),selectDocEnd=({state:e,dispatch:t})=>(t(setSel(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),selectAll=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),selectLine=({state:e,dispatch:t})=>{let n=selectedLineBlocks(e).map(({from:t,to:n})=>v.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:v.create(n),userEvent:`select`})),!0},selectParentSyntax=({state:e,dispatch:t})=>{let n=updateSel(e.selection,t=>{let n=l(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return v.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(setSel(e,n)),!0)};function addCursorVertically(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(setSel(n,v.create(i,i.length-1))),!0)}var addCursorAbove=e=>addCursorVertically(e,!1),addCursorBelow=e=>addCursorVertically(e,!0),simplifySelection=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=v.create([n.main]):n.main.empty||(r=v.create([v.cursor(n.main.head)])),r?(t(setSel(e,r)),!0):!1};function deleteBy(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=skipAtomic(e,o,!1)):o>i&&(n=`delete.forward`,o=skipAtomic(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=skipAtomic(e,i,!1),a=skipAtomic(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:v.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?c.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function skipAtomic(e,t,n){if(e instanceof c)for(let r of e.state.facet(c.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var deleteByChar=(e,t,n)=>deleteBy(e,i=>{let a=i.from,{state:o}=e,s=o.doc.lineAt(a),c,l;if(n&&!t&&a>s.from&&a<s.from+200&&!/[^ \t]/.test(c=s.text.slice(0,a-s.from))){if(c[c.length-1]==` `)return a-1;let e=g(c,o.tabSize)%S(o)||S(o);for(let t=0;t<e&&c[c.length-1-t]==` `;t++)a--;l=a}else l=r(s.text,a-s.from,t,t)+s.from,l==a&&s.number!=(t?o.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,a-s.from))&&(l=r(s.text,l-s.from,!1,!1)+s.from);return l}),deleteCharBackward=e=>deleteByChar(e,!1,!0),deleteCharForward=e=>deleteByChar(e,!0,!1),deleteByGroup=(e,t)=>deleteBy(e,n=>{let i=n.head,{state:a}=e,o=a.doc.lineAt(i),s=a.charCategorizer(i);for(let e=null;;){if(i==(t?o.to:o.from)){i==n.head&&o.number!=(t?a.doc.lines:1)&&(i+=t?1:-1);break}let c=r(o.text,i-o.from,t)+o.from,l=o.text.slice(Math.min(i,c)-o.from,Math.max(i,c)-o.from),u=s(l);if(e!=null&&u!=e)break;(l!=` `||i!=n.head)&&(e=u),i=c}return i}),deleteGroupBackward=e=>deleteByGroup(e,!1),deleteGroupForward=e=>deleteByGroup(e,!0),deleteToLineEnd=e=>deleteBy(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),deleteLineBoundaryBackward=e=>deleteBy(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),deleteLineBoundaryForward=e=>deleteBy(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),splitLine=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:x.of([``,``])},range:v.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},transposeChars=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),a=n==i.from?n-1:r(i.text,n-i.from,!1)+i.from,o=n==i.to?n+1:r(i.text,n-i.from,!0)+i.from;return{changes:{from:a,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(a,n))},range:v.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function selectedLineBlocks(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function moveLine(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of selectedLineBlocks(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(v.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(v.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:v.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var moveLineUp=({state:e,dispatch:t})=>moveLine(e,t,!1),moveLineDown=({state:e,dispatch:t})=>moveLine(e,t,!0);function copyLine(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of selectedLineBlocks(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var copyLineUp=({state:e,dispatch:t})=>copyLine(e,t,!1),copyLineDown=({state:e,dispatch:t})=>copyLine(e,t,!0),deleteLine=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(selectedLineBlocks(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=updateSel(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function isBetweenBrackets(e,n){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(n-1,n+1)))return{from:n,to:n};let r=l(e).resolveInner(n),i=r.childBefore(n),a=r.childAfter(n),o;return i&&a&&i.to<=n&&a.from>=n&&(o=i.type.prop(t.closedBy))&&o.indexOf(a.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(a.from).from&&!/\S/.test(e.sliceDoc(i.to,a.from))?{from:i.to,to:a.from}:null}var U=newlineAndIndent(!1),W=newlineAndIndent(!0);function newlineAndIndent(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),s=!e&&r==i&&isBetweenBrackets(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let c=new y(t,{simulateBreak:r,simulateDoubleBreak:!!s}),l=d(c,r);for(l??=g(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;s?{from:r,to:i}=s:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let u=[``,o(t,l)];return s&&u.push(o(t,c.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:x.of(u)},range:v.cursor(r+1+u[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function changeBySelectedLine(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:v.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var indentSelection=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new y(e,{overrideIndentation:e=>n[e]??-1}),i=changeBySelectedLine(e,(t,i,a)=>{let s=d(r,t.from);if(s==null)return;/\S/.test(t.text)||(s=0);let c=/^\s*/.exec(t.text)[0],l=o(e,s);(c!=l||a.from<t.from+c.length)&&(n[t.from]=s,i.push({from:t.from,to:t.from+c.length,insert:l}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},indentMore=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(changeBySelectedLine(e,(t,n)=>{n.push({from:t.from,insert:e.facet(a)})}),{userEvent:`input.indent`})),!0),indentLess=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(changeBySelectedLine(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=g(r,e.tabSize),a=0,s=o(e,Math.max(0,i-S(e)));for(;a<r.length&&a<s.length&&r.charCodeAt(a)==s.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:s.slice(a)})}),{userEvent:`delete.dedent`})),!0),toggleTabFocusMode=e=>(e.setTabFocusMode(),!0),G=[{key:`Ctrl-b`,run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:`Ctrl-f`,run:cursorCharRight,shift:selectCharRight},{key:`Ctrl-p`,run:cursorLineUp,shift:selectLineUp},{key:`Ctrl-n`,run:cursorLineDown,shift:selectLineDown},{key:`Ctrl-a`,run:cursorLineStart,shift:selectLineStart},{key:`Ctrl-e`,run:cursorLineEnd,shift:selectLineEnd},{key:`Ctrl-d`,run:deleteCharForward},{key:`Ctrl-h`,run:deleteCharBackward},{key:`Ctrl-k`,run:deleteToLineEnd},{key:`Ctrl-Alt-h`,run:deleteGroupBackward},{key:`Ctrl-o`,run:splitLine},{key:`Ctrl-t`,run:transposeChars},{key:`Ctrl-v`,run:cursorPageDown}],K=[{key:`ArrowLeft`,run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:cursorGroupLeft,shift:selectGroupLeft,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:cursorLineBoundaryLeft,shift:selectLineBoundaryLeft,preventDefault:!0},{key:`ArrowRight`,run:cursorCharRight,shift:selectCharRight,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:cursorGroupRight,shift:selectGroupRight,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:cursorLineBoundaryRight,shift:selectLineBoundaryRight,preventDefault:!0},{key:`ArrowUp`,run:cursorLineUp,shift:selectLineUp,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:cursorDocStart,shift:selectDocStart},{mac:`Ctrl-ArrowUp`,run:cursorPageUp,shift:selectPageUp},{key:`ArrowDown`,run:cursorLineDown,shift:selectLineDown,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:cursorDocEnd,shift:selectDocEnd},{mac:`Ctrl-ArrowDown`,run:cursorPageDown,shift:selectPageDown},{key:`PageUp`,run:cursorPageUp,shift:selectPageUp},{key:`PageDown`,run:cursorPageDown,shift:selectPageDown},{key:`Home`,run:cursorLineBoundaryBackward,shift:selectLineBoundaryBackward,preventDefault:!0},{key:`Mod-Home`,run:cursorDocStart,shift:selectDocStart},{key:`End`,run:cursorLineBoundaryForward,shift:selectLineBoundaryForward,preventDefault:!0},{key:`Mod-End`,run:cursorDocEnd,shift:selectDocEnd},{key:`Enter`,run:U,shift:U},{key:`Mod-a`,run:selectAll},{key:`Backspace`,run:deleteCharBackward,shift:deleteCharBackward,preventDefault:!0},{key:`Delete`,run:deleteCharForward,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:deleteGroupBackward,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:deleteGroupForward,preventDefault:!0},{mac:`Mod-Backspace`,run:deleteLineBoundaryBackward,preventDefault:!0},{mac:`Mod-Delete`,run:deleteLineBoundaryForward,preventDefault:!0}].concat(G.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),q=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:cursorSyntaxLeft,shift:selectSyntaxLeft},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:cursorSyntaxRight,shift:selectSyntaxRight},{key:`Alt-ArrowUp`,run:moveLineUp},{key:`Shift-Alt-ArrowUp`,run:copyLineUp},{key:`Alt-ArrowDown`,run:moveLineDown},{key:`Shift-Alt-ArrowDown`,run:copyLineDown},{key:`Mod-Alt-ArrowUp`,run:addCursorAbove},{key:`Mod-Alt-ArrowDown`,run:addCursorBelow},{key:`Escape`,run:simplifySelection},{key:`Mod-Enter`,run:W},{key:`Alt-l`,mac:`Ctrl-l`,run:selectLine},{key:`Mod-i`,run:selectParentSyntax,preventDefault:!0},{key:`Mod-[`,run:indentLess},{key:`Mod-]`,run:indentMore},{key:`Mod-Alt-\\`,run:indentSelection},{key:`Shift-Mod-k`,run:deleteLine},{key:`Shift-Mod-\\`,run:cursorMatchingBracket},{key:`Mod-/`,run:toggleComment},{key:`Alt-A`,mac:`Ctrl-A`,run:w},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:toggleTabFocusMode}].concat(K);export{P as a,H as i,history as n,N as o,M as r,q as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./rolldown-runtime-B8BYMn-z.js";import{$ as e,At as t,Ct as n,Dt as r,Et as i,G as a,H as o,I as s,J as c,M as l,Ot as u,P as d,Q as f,R as p,St as m,T as ee,U as h,V as te,W as ne,X as g,Y as _,at as re,bt as ie,ct as v,f as y,ft as b,g as x,gt as S,ht as C,it as w,jt as T,l as E,mt as D,nt as O,rt as k,v as A,vt as ae}from"./dist-CsBP6QjA.js";import{a as oe,c as se,i as ce,r as le}from"./dist-DvFyMwGd.js";import{i as j,n as M,t as N}from"./dist-Gx7P7Pk_.js";import{n as P}from"./dist-DUkRqvKl.js";var F=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,SearchCursor=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(F(e)):F,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 i(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=T(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=r(e);let i=this.normalize(t);if(i.length)for(let e=0,r=n,a=!0;;e++){let n=i.charCodeAt(e),o=this.match(n,r,a,this.bufferPos+this.bufferStart,e==i.length-1);if(o)return this.value=o,this;if(e==i.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?r++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(SearchCursor.prototype[Symbol.iterator]=function(){return this});var I={from:-1,to:-1,match:/.*/.exec(``),precise:!0},L=`gm`+(/x/.unicode==null?``:`u`),RegExpCursor=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=I,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new MultilineRegExpCursor(e,t,n,r,i);this.re=new RegExp(t,L+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=toCharEnd(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.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,r=n+t[0].length;if(this.matchPos=toCharEnd(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},R=new WeakMap,z=class FlattenedDoc{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=R.get(e);if(!r||r.from>=n||r.to<=t){let r=new FlattenedDoc(t,e.sliceString(t,n));return R.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:i,from:a}=r;return a>t&&(i=e.sliceString(t,a)+i,a=t),r.to<n&&(i+=e.sliceString(r.to,n)),R.set(e,new FlattenedDoc(a,i)),new FlattenedDoc(t,i.slice(t-a,n-a))}},MultilineRegExpCursor=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=I,this.matchPos=toCharEnd(e,r),this.re=new RegExp(t,L+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=z.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=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,precise:!0,match:t},this.matchPos=toCharEnd(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=z.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(RegExpCursor.prototype[Symbol.iterator]=MultilineRegExpCursor.prototype[Symbol.iterator]=function(){return this});function validRegExp(e){try{return new RegExp(e,L),!0}catch{return!1}}function toCharEnd(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var gotoLine=e=>{let t=ne(e,`cm-goto-line`);if(t){let e=t.dom.querySelector(`input[type=text]`);return e&&e.select(),!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:i,result:a}=w(e,{class:`cm-goto-line`,label:n.phrase(`Go to line`),input:{type:`text`,name:`line`,value:r},focus:!0,submitLabel:n.phrase(`go`)});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r){e.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,o,c,l,u]=r,d=l?+l.slice(1):0,f=c?+c:a.number;if(c&&u){let e=f/100;o&&(e=e*(o==`-`?-1:1)+a.number/n.doc.lines),f=Math.round(n.doc.lines*e)}else c&&o&&(f=f*(o==`-`?-1:1)+a.number);let p=n.doc.line(Math.max(1,Math.min(n.doc.lines,f))),m=D.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[i,s.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},B={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},V=S.define({combine(e){return u(e,B,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function highlightSelectionMatches(e){let t=[ue,W];return e&&t.push(V.of(e)),t}var H=d.mark({class:`cm-selectionMatch`}),U=d.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function insideWordBoundaries(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=b.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=b.Word)}function insideWord(e,t,n,r){return e(t.sliceDoc(n,n+1))==b.Word&&e(t.sliceDoc(r-1,r))==b.Word}var W=p.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(V),{state:n}=e,r=n.selection;if(r.ranges.length>1)return d.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return d.none;let e=n.wordAt(i.head);if(!e)return d.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return d.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(insideWordBoundaries(o,n,i.from,i.to)&&insideWord(o,n,i.from,i.to)))return d.none}else if(a=n.sliceDoc(i.from,i.to),!a)return d.none}let s=[];for(let r of e.visibleRanges){let e=new SearchCursor(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||insideWordBoundaries(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(U.range(r,a)):(r>=i.to||a<=i.from)&&s.push(H.range(r,a)),s.length>t.maxMatches))return d.none}}return d.set(s)}},{decorations:e=>e.decorations}),ue=s.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),selectWord=({state:e,dispatch:t})=>{let{selection:n}=e,r=D.create(n.ranges.map(t=>e.wordAt(t.head)||D.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)};function findNextOccurrence(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new SearchCursor(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new SearchCursor(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var selectNextOccurrence=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return selectWord({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=findNextOccurrence(e,r);return i?(t(e.update({selection:e.selection.addRange(D.range(i.from,i.to),!1),effects:s.scrollIntoView(i.to)})),!0):!1},G=S.define({combine(e){return u(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new SearchPanel(e),scrollToMatch:e=>s.scrollIntoView(e)})}}),SearchQuery=class{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||validRegExp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
2
|
+
`:t==`r`?`\r`: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&&this.test==e.test}create(){return this.regexp?new RegExpQuery(this):new StringQuery(this)}getCursor(e,t=0,n){let r=e.doc?e:C.create({doc:e});return n??=r.doc.length,this.regexp?regexpCursor(this,r,t,n):stringCursor(this,r,t,n)}},QueryType=class{constructor(e){this.spec=e}};function wrapStringTest(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function stringCursor(e,t,n,r){let i;return e.wholeWord&&(i=stringWordTest(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=wrapStringTest(e.test,t,i)),new SearchCursor(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function stringWordTest(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(charBefore(i,n-a))!=b.Word||t(charAfter(i,n-a))!=b.Word)&&(t(charAfter(i,r-a))!=b.Word||t(charBefore(i,r-a))!=b.Word))}var StringQuery=class extends QueryType{constructor(e){super(e)}nextMatch(e,t,n){let r=stringCursor(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=stringCursor(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=stringCursor(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=stringCursor(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=stringCursor(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function wrapRegexpTest(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function regexpCursor(e,t,n,r){let i;return e.wholeWord&&(i=regexpWordTest(t.charCategorizer(t.selection.main.head))),e.test&&(i=wrapRegexpTest(e.test,t,i)),new RegExpCursor(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function charBefore(e,n){return e.slice(t(e,n,!1),n)}function charAfter(e,n){return e.slice(n,t(e,n))}function regexpWordTest(e){return(t,n,r)=>!r[0].length||(e(charBefore(r.input,r.index))!=b.Word||e(charAfter(r.input,r.index))!=b.Word)&&(e(charAfter(r.input,r.index+r[0].length))!=b.Word||e(charBefore(r.input,r.index+r[0].length))!=b.Word)}var RegExpQuery=class extends QueryType{nextMatch(e,t,n){let r=regexpCursor(this.spec,e,n,e.doc.length).next();return r.done&&(r=regexpCursor(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=regexpCursor(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==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)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=regexpCursor(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=regexpCursor(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},K=m.define(),q=m.define(),J=n.define({create(e){return new SearchState(defaultQuery(e).create(),null)},update(e,t){for(let n of t.effects)n.is(K)?e=new SearchState(n.value.create(),e.panel):n.is(q)&&(e=new SearchState(e.query,n.value?createSearchPanel:null));return e},provide:e=>re.from(e,e=>e.panel)}),SearchState=class{constructor(e,t){this.query=e,this.panel=t}},de=d.mark({class:`cm-searchMatch`}),fe=d.mark({class:`cm-searchMatch cm-searchMatch-selected`}),pe=p.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(J))}update(e){let t=e.state.field(J);(t!=e.startState.field(J)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return d.none;let{view:n}=this,r=new ie;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?fe:de)})}return r.finish()}},{decorations:e=>e.decorations});function searchCommand(e){return t=>{let n=t.state.field(J,!1);return n&&n.query.spec.valid?e(t,n):openSearchPanel(t)}}var Y=searchCommand((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=D.single(r.from,r.to),a=e.state.facet(G);return e.dispatch({selection:i,effects:[announceMatch(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),selectSearchInput(e),!0}),X=searchCommand((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=D.single(i.from,i.to),o=e.state.facet(G);return e.dispatch({selection:a,effects:[announceMatch(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),selectSearchInput(e),!0}),me=searchCommand((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:D.create(n.map(e=>D.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),selectSelectionMatches=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new SearchCursor(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(D.range(t.value.from,t.value.to))}return t(e.update({selection:D.create(a,o),userEvent:`select.search.matches`})),!0},Z=searchCommand((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,c=[],l,u,d=[];o.precise?o.from==r&&o.to==i&&(u=n.toText(t.getReplacement(o)),c.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(s.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(c);return o&&(l=D.single(o.from,o.to).map(f),d.push(announceMatch(e,o)),d.push(n.facet(G).scrollToMatch(l.main,e))),e.dispatch({changes:f,selection:l,effects:d,userEvent:`input.replace`}),!0}),he=searchCommand((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:s.announce.of(r),userEvent:`input.replace.all`}),!0});function createSearchPanel(e){return e.state.facet(G).createPanel(e)}function defaultQuery(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(G);return new SearchQuery({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function getSearchInput(e){let t=a(e,createSearchPanel);return t&&t.dom.querySelector(`[main-field]`)}function selectSearchInput(e){let t=getSearchInput(e);t&&t==e.root.activeElement&&t.select()}var openSearchPanel=e=>{let t=e.state.field(J,!1);if(t&&t.panel){let n=getSearchInput(e);if(n&&n!=e.root.activeElement){let r=defaultQuery(e.state,t.query.spec);r.valid&&e.dispatch({effects:K.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[q.of(!0),t?K.of(defaultQuery(e.state,t.query.spec)):m.appendConfig.of(ve)]});return!0},closeSearchPanel=e=>{let t=e.state.field(J,!1);if(!t||!t.panel)return!1;let n=a(e,createSearchPanel);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:q.of(!1)}),!0},ge=[{key:`Mod-f`,run:openSearchPanel,scope:`editor search-panel`},{key:`F3`,run:Y,shift:X,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:Y,shift:X,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:closeSearchPanel,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:selectSelectionMatches},{key:`Mod-Alt-g`,run:gotoLine},{key:`Mod-d`,run:selectNextOccurrence,preventDefault:!0}],SearchPanel=class{constructor(e){this.view=e;let t=this.query=e.state.field(J).query.spec;this.commit=this.commit.bind(this),this.searchField=v(`input`,{value:t.search,placeholder:phrase(e,`Find`),"aria-label":phrase(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=v(`input`,{value:t.replace,placeholder:phrase(e,`Replace`),"aria-label":phrase(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=v(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=v(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=v(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function button(e,t,n){return v(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=v(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,button(`next`,()=>Y(e),[phrase(e,`next`)]),button(`prev`,()=>X(e),[phrase(e,`previous`)]),button(`select`,()=>me(e),[phrase(e,`all`)]),v(`label`,null,[this.caseField,phrase(e,`match case`)]),v(`label`,null,[this.reField,phrase(e,`regexp`)]),v(`label`,null,[this.wordField,phrase(e,`by word`)]),...e.state.readOnly?[]:[v(`br`),this.replaceField,button(`replace`,()=>Z(e),[phrase(e,`replace`)]),button(`replaceAll`,()=>he(e),[phrase(e,`replace all`)])],v(`button`,{name:`close`,onclick:()=>closeSearchPanel(e),"aria-label":phrase(e,`close`),type:`button`},[`×`])])}commit(){let e=new SearchQuery({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:K.of(e)}))}keydown(e){k(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?X:Y)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Z(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(K)&&!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(G).top}};function phrase(e,t){return e.state.phrase(t)}var Q=30,$=/[\s\.,:;?!]/;function announceMatch(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-Q),o=Math.min(i,n+Q),c=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<Q;e++)if(!$.test(c[e+1])&&$.test(c[e])){c=c.slice(e);break}}if(o!=i){for(let e=c.length-1;e>c.length-Q;e--)if(!$.test(c[e-1])&&$.test(c[e])){c=c.slice(0,e);break}}return s.announce.of(`${e.state.phrase(`current match`)}. ${c} ${e.state.phrase(`on line`)} ${r.number}.`)}var _e=s.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`}}),ve=[J,ae.low(pe),_e],ye=[e(),_(),g(),M(),x(),o(),h(),C.allowMultipleSelections.of(!0),ee(),l(y,{fallback:!0}),E(),ce(),le(),O(),te(),c(),highlightSelectionMatches(),f.of([...oe,...N,...ge,...j,...A,...se,...P])],be=[g(),M(),o(),l(y,{fallback:!0}),f.of([...N,...j])];export{be as n,ye as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-B8BYMn-z.js";import{_ as t,c as n,d as r,f as i,h as a,l as o,m as s,u as c}from"./dist-CHluRwHI.js";function decodeArray(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}function readToken(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||overrides(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function findOffset(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function overrides(e,t,n,r){let i=findOffset(n,r,t);return i<0||findOffset(n,r,e)<i}function cutAt(e,t,n){let r=e.cursor(o.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}function pushStackDedup(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}function pair(e,t){return e[t]|e[t+1]<<16}function findFinished(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function getSpecializer(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var l,StackContext,SimulatedStack,u,CachedToken,d,InputStream,TokenGroup,LocalTokenGroup,ExternalTokenizer,f,p,FragmentCursor,TokenCache,Parse,Dialect,id,ContextTracker,m,h=e((()=>{t(),l=class Stack{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,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 r=e.parser.context;return new Stack(e,[],t,n,n,0,[],0,r?new StackContext(r,r.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){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,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&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new Stack(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,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 SimulatedStack(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))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 r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)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=[],explore=(n,r)=>{if(!t.includes(n))return t.push(n),e.allActions(n,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-r;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=explore(t,r+1);if(e!=null)return e}}})};return explore(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(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!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;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new StackContext(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},StackContext=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},SimulatedStack=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},u=class StackBufferCursor{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new StackBufferCursor(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(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,this.index==0&&this.maybeNext()}fork(){return new StackBufferCursor(this.stack,this.pos,this.index)}},CachedToken=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},d=new CachedToken,InputStream=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=d,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,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1: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=d,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(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 r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},TokenGroup=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;readToken(this.data,e,t,this.id,n.data,n.tokenPrecTable)}},TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1,LocalTokenGroup=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?decodeArray(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(readToken(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}},LocalTokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1,ExternalTokenizer=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}},f=typeof process<`u`&&/\bparse\b/.test({}.LOG),p=null,FragmentCursor=class{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?cutAt(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?cutAt(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(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(i instanceof a){if(o==e){if(o<this.safeFrom)return null;let e=o+i.length;if(e<=this.safeTo){let t=i.prop(c.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,o+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+i.length}}},TokenCache=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new CachedToken)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if((!n||c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new CachedToken,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 CachedToken,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=pair(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(pair(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(pair(o,s+1),t,n,r))}return r}},Parse=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new InputStream(t,r),this.tokens=new TokenCache(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[l.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new FragmentCursor(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&findFinished(r);if(e)return f&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw f&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return f&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,o=f?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.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 s=this.fragments.nodeAt(r);s;){let r=this.parser.nodeSet.types[s.type.id]==s.type?i.getGoto(e.state,s.type.id):-1;if(r>-1&&s.length&&(!t||(s.prop(c.contextHash)||0)==n))return e.useNode(s,r),f&&console.log(o+this.stackID(e)+` (via reuse of ${i.getName(s.type.id)})`),!0;if(!(s instanceof a)||s.children.length==0||s.positions[0]>0)break;let l=s.children[0];if(l instanceof a&&s.positions[0]==0)s=l;else break}}let s=i.stateSlot(e.state,4);if(s>0)return e.reduce(s),f&&console.log(o+this.stackID(e)+` (via always-reduce ${i.getName(s&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let a=0;a<l.length;){let s=l[a++],c=l[a++],u=l[a++],d=a==l.length||!n,p=d?e:e.split(),m=this.tokens.mainToken;if(p.apply(s,c,m?m.start:p.pos,u),f&&console.log(o+this.stackID(p)+` (via ${s&65536?`reduce of ${i.getName(s&65535)}`:`shift`} for ${i.getName(c)} @ ${r}${p==e?``:`, split`})`),d)return!0;p.pos>r?t.push(p):n.push(p)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return pushStackDedup(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=f?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),f&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(f&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)f&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))f&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),f&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),pushStackDedup(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),a.build({buffer:u.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(p||=new WeakMap).get(e);return t||p.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}},Dialect=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},id=e=>e,ContextTracker=class{constructor(e){this.start=e.start,this.shift=e.shift||id,this.reduce=e.reduce||id,this.reuse=e.reuse||id,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},m=class LRParser extends s{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let a=Object.keys(e.topRules).map(t=>e.topRules[t][1]),o=[];for(let e=0;e<t.length;e++)o.push([]);function setProp(e,t,n){o[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=c[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)setProp(r,e,t[n++]);else{let i=t[n+-r];for(let a=-r;a>0;a--)setProp(t[n++],e,i);n++}}}this.nodeSet=new r(t.map((t,n)=>i.define({name:n>=this.minRepeatTerm?void 0:t,id:n,props:o[n],top:a.indexOf(n)>-1,error:n==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(n)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=n;let s=decodeArray(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(getSpecializer),this.states=decodeArray(e.states,Uint32Array),this.data=decodeArray(e.stateData),this.goto=decodeArray(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new TokenGroup(s,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 r=new Parse(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=pair(n,i+2)];else if(n[i+1]==2)return pair(n,i+2);else break}if(a==t||a==0)return pair(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=pair(this.data,n+2);else break}r=t(pair(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=pair(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(LRParser.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw 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,r)=>{let i=e.specializers.find(e=>e.from==n.external);if(!i)return n;let a=Object.assign(Object.assign({},n),{external:i.to});return t.specializers[r]=getSpecializer(a),a})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(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 t==null?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 r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new Dialect(e,n,r)}static deserialize(e){return new LRParser(e)}}}));export{h as a,LocalTokenGroup as i,ExternalTokenizer as n,m as r,ContextTracker as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-B8BYMn-z.js";import{a as t,i as n,s as r}from"./dist-CHluRwHI.js";import{a as i,r as a}from"./dist-TNwbKIWT.js";import{_ as o,d as s,o as c,r as l,w as u,y as d}from"./dist-CsBP6QjA.js";i(),n();var f=t({String:r.string,Number:r.number,"True False":r.bool,PropertyName:r.propertyName,Null:r.null,", :":r.separator,"[ ]":r.squareBracket,"{ }":r.brace}),p=a.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[f],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),m=e({json:()=>json,jsonLanguage:()=>h,jsonParseLinter:()=>jsonParseLinter}),jsonParseLinter=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;let n=getErrorPosition(t,e.state.doc);return[{from:n,message:t.message,severity:`error`,to:n}]}return[]};function getErrorPosition(e,t){let n;return(n=e.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=e.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0}var h=l.define({name:`json`,parser:p.configure({props:[u.add({Object:s({except:/^\s*\}/}),Array:s({except:/^\s*\]/})}),d.add({"Object Array":o})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function json(){return new c(h)}export{json as n,jsonParseLinter as r,m as t};
|
|
Binary file
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<metadata>Copyright (C) 2021 by original authors @ fontello.com</metadata>
|
|
5
|
+
<defs>
|
|
6
|
+
<font id="dmn" horiz-adv-x="1000" >
|
|
7
|
+
<font-face font-family="dmn" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
|
8
|
+
<missing-glyph horiz-adv-x="1000" />
|
|
9
|
+
<glyph glyph-name="up" unicode="" d="M564 280q16-16 16-41t-16-41q-38-38-78 0l-196 188-196-188q-40-38-78 0-16 16-16 41t16 41l234 224q16 16 40 16t40-16z" horiz-adv-x="580" />
|
|
10
|
+
|
|
11
|
+
<glyph glyph-name="down" unicode="" d="M564 422l-234-224q-18-18-40-18t-40 18l-234 224q-16 16-16 41t16 41q38 38 78 0l196-188 196 188q40 38 78 0 16-16 16-41t-16-41z" horiz-adv-x="580" />
|
|
12
|
+
|
|
13
|
+
<glyph glyph-name="clear" unicode="" d="M452 194q18-18 18-43t-18-43q-18-16-43-16t-43 16l-132 152-132-152q-18-16-43-16t-43 16q-16 18-16 43t16 43l138 156-138 158q-16 18-16 43t16 43q18 16 43 16t43-16l132-152 132 152q18 16 43 16t43-16q18-18 18-43t-18-43l-138-158z" horiz-adv-x="470" />
|
|
14
|
+
|
|
15
|
+
<glyph glyph-name="plus" unicode="" d="M550 400q30 0 30-50t-30-50l-210 0 0-210q0-30-50-30t-50 30l0 210-210 0q-30 0-30 50t30 50l210 0 0 210q0 30 50 30t50-30l0-210 210 0z" horiz-adv-x="580" />
|
|
16
|
+
|
|
17
|
+
<glyph glyph-name="minus" unicode="" d="M550 400q30 0 30-50t-30-50l-520 0q-30 0-30 50t30 50l520 0z" horiz-adv-x="580" />
|
|
18
|
+
|
|
19
|
+
<glyph glyph-name="info" unicode="" d="M352 850q48 0 74-27t26-69q0-50-39-88t-95-38q-48 0-74 26t-24 72q0 46 35 85t97 39z m-206-1000q-100 0-54 178l60 254q14 56 0 56-12 0-54-18t-72-38l-26 44q90 78 189 126t151 48q78 0 36-162l-70-266q-16-64 6-64 44 0 118 60l30-40q-84-86-175-132t-139-46z" horiz-adv-x="460" />
|
|
20
|
+
|
|
21
|
+
<glyph glyph-name="left" unicode="" d="M242 626q14 16 39 16t41-16q38-36 0-80l-186-196 186-194q38-44 0-80-16-16-40-16t-40 16l-226 236q-16 16-16 38 0 24 16 40 206 214 226 236z" horiz-adv-x="341" />
|
|
22
|
+
|
|
23
|
+
<glyph glyph-name="decision" unicode="" d="M16 663l0-25 0-601 968 0 0 626-968 0z m51-51l866 0 0-524-866 0 0 524z" horiz-adv-x="1000" />
|
|
24
|
+
|
|
25
|
+
<glyph glyph-name="right" unicode="" d="M98 626l226-236q16-16 16-40 0-22-16-38l-226-236q-16-16-40-16t-40 16q-36 36 0 80l186 194-186 196q-36 44 0 80 16 16 41 16t39-16z" horiz-adv-x="340" />
|
|
26
|
+
|
|
27
|
+
<glyph glyph-name="input" unicode="" d="M661 350q0-14-11-25l-303-304q-11-10-26-10t-25 10-10 25v161h-250q-15 0-25 11t-11 25v214q0 15 11 25t25 11h250v161q0 14 10 25t25 10 26-10l303-304q11-10 11-25z m196 196v-392q0-67-47-114t-114-47h-178q-7 0-13 5t-5 13q0 2-1 11t0 15 2 13 5 11 12 3h178q37 0 64 27t26 63v392q0 37-26 64t-64 26h-174t-6 0-6 2-5 3-4 5-1 8q0 2-1 11t0 15 2 13 5 11 12 3h178q67 0 114-47t47-114z" horiz-adv-x="857.1" />
|
|
28
|
+
|
|
29
|
+
<glyph glyph-name="output" unicode="" d="M357 46q0-2 1-11t0-14-2-14-5-11-12-3h-178q-67 0-114 47t-47 114v392q0 67 47 114t114 47h178q8 0 13-5t5-13q0-2 1-11t0-15-2-13-5-11-12-3h-178q-37 0-63-26t-27-64v-392q0-37 27-63t63-27h174t6 0 7-2 4-3 4-5 1-8z m518 304q0-14-11-25l-303-304q-11-10-25-10t-25 10-11 25v161h-250q-14 0-25 11t-11 25v214q0 15 11 25t25 11h250v161q0 14 11 25t25 10 25-10l303-304q11-10 11-25z" horiz-adv-x="928.6" />
|
|
30
|
+
|
|
31
|
+
<glyph glyph-name="copy" unicode="" d="M970 480q38-10 30-46l-150-556q-4-16-18-23t-30-3l-406 110q-16 4-24 18t-4 28l24 92-180-48q-40-10-50 26l-160 602q-10 36 28 48l454 122q16 4 30-3t18-23l66-244z m-888 190l144-542 392 106-144 540z m702-742l132 492-298 82 76-282q10-34-28-46l-196-52-26-102z" horiz-adv-x="1001" />
|
|
32
|
+
|
|
33
|
+
<glyph glyph-name="keyboard" unicode="" d="M930 650q28 0 49-21t21-49l0-460q0-30-21-50t-49-20l-860 0q-28 0-49 20t-21 50l0 460q0 28 21 49t49 21l860 0z m-380-100l0-100 100 0 0 100-100 0z m150-150l-100 0 0-100 100 0 0 100z m-300 150l0-100 100 0 0 100-100 0z m150-150l-100 0 0-100 100 0 0 100z m-300 150l0-100 100 0 0 100-100 0z m150-150l-100 0 0-100 100 0 0 100z m-300 150l0-100 100 0 0 100-100 0z m150-150l-100 0 0-100 100 0 0 100z m-50-250l0 100-100 0 0-100 100 0z m550 0l0 100-500 0 0-100 500 0z m150 0l0 100-100 0 0-100 100 0z m-150 150l100 0 0 100-100 0 0-100z m150 150l0 100-200 0 0-100 200 0z" horiz-adv-x="1000" />
|
|
34
|
+
|
|
35
|
+
<glyph glyph-name="undo" unicode="" d="M532 736q170 0 289-120t119-290-119-290-289-120q-142 0-252 88l70 74q84-60 182-60 126 0 216 90t90 218-90 218-216 90q-124 0-214-87t-92-211l142 0-184-204-184 204 124 0q2 166 122 283t286 117z" horiz-adv-x="940" />
|
|
36
|
+
|
|
37
|
+
<glyph glyph-name="redo" unicode="" d="M408 760q168 0 287-116t123-282l122 0-184-206-184 206 144 0q-4 124-94 210t-214 86q-126 0-216-90t-90-218q0-126 90-216t216-90q104 0 182 60l70-76q-110-88-252-88-168 0-288 120t-120 290 120 290 288 120z" horiz-adv-x="940" />
|
|
38
|
+
|
|
39
|
+
<glyph glyph-name="menu" unicode="" d="M110 460q46 0 78-32t32-78q0-44-32-77t-78-33-78 33-32 77q0 46 32 78t78 32z m350 0q46 0 78-32t32-78q0-44-33-77t-77-33-77 33-33 77q0 46 32 78t78 32z m350 0q46 0 78-32t32-78q0-44-32-77t-78-33-78 33-32 77q0 46 32 78t78 32z" horiz-adv-x="920" />
|
|
40
|
+
|
|
41
|
+
<glyph glyph-name="setting" unicode="" d="M760 350q0-72 80-122-12-40-34-82-70 18-136-44-54-58-34-136-40-20-84-36-46 82-132 82t-132-82q-44 16-84 36 20 80-34 136-54 54-136 34-14 26-34 82 82 52 82 132 0 72-82 124 20 56 34 82 74-18 136 44 54 56 34 136 42 22 84 34 46-80 132-80t132 80q42-12 84-34-20-78 34-136 66-62 136-44 22-42 34-82-80-50-80-124z m-340-182q76 0 129 53t53 129-53 130-129 54-129-54-53-130 53-129 129-53z" horiz-adv-x="840" />
|
|
42
|
+
|
|
43
|
+
<glyph glyph-name="wrench" unicode="" d="M214 29q0 14-10 25t-25 10-25-10-11-25 11-25 25-11 25 11 10 25z m360 234l-381-381q-21-20-50-20-29 0-51 20l-59 61q-21 20-21 50 0 29 21 51l380 380q22-55 64-97t97-64z m354 243q0-22-13-59-27-75-92-122t-144-46q-104 0-177 73t-73 177 73 176 177 74q32 0 67-10t60-26q9-6 9-15t-9-16l-163-94v-125l108-60q2 2 44 27t75 45 40 20q8 0 13-5t5-14z" horiz-adv-x="928.6" />
|
|
44
|
+
|
|
45
|
+
<glyph glyph-name="eraser" unicode="" d="M500 64l188 215h-429l-188-215h429z m565 601q9-19 6-40t-17-36l-500-572q-22-24-54-24h-429q-21 0-38 11t-27 31q-8 19-5 40t17 36l500 572q21 24 53 24h429q21 0 39-11t26-31z" horiz-adv-x="1071.4" />
|
|
46
|
+
|
|
47
|
+
<glyph glyph-name="attention" unicode="" d="M957-24q10-16 0-34-10-16-30-16l-892 0q-18 0-28 16-13 18-2 34l446 782q8 18 30 18t30-18z m-420 50l0 100-110 0 0-100 110 0z m0 174l0 300-110 0 0-300 110 0z" horiz-adv-x="962" />
|
|
48
|
+
|
|
49
|
+
<glyph glyph-name="resize-big" unicode="" d="M839 55l72 72 0-224-223 0 72 72-184 185 79 79z m-749 591l-72-72 0 223 223 0-72-72 184-184-79-79z m670 79l-72 72 223 0 0-223-72 72-184-184-79 79z m-407-565l-184-185 72-72-223 0 0 224 72-72 184 184z" horiz-adv-x="928" />
|
|
50
|
+
|
|
51
|
+
<glyph glyph-name="resize-small" unicode="" d="M648 88l-72-72 0 223 223 0-72-72 184-185-79-79z m-448 447l-182 183 79 79 183-182 73 70-1-222-222-1z m-182-553l184 185-72 72 223 0 0-223-72 72-184-185z m782 480l-224 0 0 225 73-72 183 182 79-79-183-183z" horiz-adv-x="928" />
|
|
52
|
+
|
|
53
|
+
<glyph glyph-name="file-code" unicode="" d="M819 638q16-16 27-42t11-50v-642q0-23-15-38t-38-16h-750q-23 0-38 16t-16 38v892q0 23 16 38t38 16h500q22 0 49-11t42-27z m-248 136v-210h210q-5 17-12 23l-175 175q-6 7-23 12z m215-853v572h-232q-23 0-38 16t-16 37v233h-429v-858h715z m-518 500q4 7 12 7t13-3l28-21q7-5 7-12t-3-13l-102-136 102-136q4-6 3-13t-7-12l-28-21q-6-4-13-4t-12 7l-126 168q-8 11 0 22z m447-167q8-11 0-22l-126-168q-4-6-11-7t-14 4l-28 21q-6 5-7 12t3 13l102 136-102 136q-4 6-3 13t7 12l28 21q6 4 14 3t11-7z m-346-258q-7 1-11 8t-3 13l77 464q1 7 7 11t14 3l35-5q7-2 11-8t3-13l-77-464q-1-7-7-11t-13-3z" horiz-adv-x="857.1" />
|
|
54
|
+
|
|
55
|
+
<glyph glyph-name="business-knowledge" unicode="" d="M202 594l-191-225 0-10 1-252 794 0 183 226 0 261-787 0z m25-54l708 0 0-188-155-192-714 0-1 189 162 191z" horiz-adv-x="1000" />
|
|
56
|
+
|
|
57
|
+
<glyph glyph-name="knowledge-source" unicode="" d="M13 672l0-24 0-536 10-7c147-97 273-87 378-50 106 38 194 99 274 110l1 0 1 0c109 20 173-14 278-57l32-14 0 384 0 192-974 2z m47-48l880-2 0-144 0-313c-88 37-163 67-272 46-97-13-185-77-283-111-95-34-195-45-325 38l0 486z" horiz-adv-x="1000" />
|
|
58
|
+
|
|
59
|
+
<glyph glyph-name="input-data" unicode="" d="M203 594c-57 0-107-29-142-74-35-44-56-104-56-170 0-66 21-126 56-170 35-44 85-74 142-74l594 0c57 0 107 30 142 74 35 44 56 104 56 170 0 66-21 126-56 170-35 45-85 74-142 74l-594 0z m0-55l594 0c38 0 73-19 99-53 27-33 44-82 44-136 0-54-17-102-44-136-26-34-61-53-99-53l-594 0c-38 0-73 19-99 53-27 34-44 82-44 136 0 54 17 103 44 136 26 34 61 53 99 53z" horiz-adv-x="1000" />
|
|
60
|
+
|
|
61
|
+
<glyph glyph-name="text-annotation" unicode="" d="M677 795l0-25 0-411 0-412 0-24 24 0 224 0 25 0 0 49-25 0-199 0 0 387 0 386 199 0 25 0 0 50-25 0-224 0-24 0z m-81-386l-75-60 60-75 75 60-60 75z m-151-119l-75-60 60-75 75 59-60 76z m-150-120l-76-59 60-76 75 60-59 75z m-151-119l-76-60 60-75 76 59-60 76z" horiz-adv-x="1000" />
|
|
62
|
+
|
|
63
|
+
<glyph glyph-name="connection" unicode="" d="M911 749c0 0-285-146-431-214 31-28 60-59 90-89-147-149-295-299-443-448 11-11 22-21 33-31 148 149 295 299 443 448 30-29 60-60 90-90 77 153 218 424 218 424z" horiz-adv-x="1000" />
|
|
64
|
+
|
|
65
|
+
<glyph glyph-name="connection-multi" unicode="" d="M916 798l-410-109 64-95-486-327 25-38 486 328 62-92 259 333 0 0z m0-328l-411-109 151-224 260 333 0 0z m-409-245l-63-43 25-37 63 42-25 38z m-126-85l-62-42 25-38 62 43-25 37z m-133-90l-63-43 25-37 63 43-25 37z m-126-85l-38-26 25-37 38 26-25 37z" horiz-adv-x="1000" />
|
|
66
|
+
|
|
67
|
+
<glyph glyph-name="drag" unicode="" d="M563 100l187 0 0-188-187 0z m0 313l187 0 0-188-187 0z m-313-313l188 0 0-188-188 0z m0 313l188 0 0-188-188 0z m313 312l187 0 0-187-187 0z m-313 0l188 0 0-187-188 0z" horiz-adv-x="1000" />
|
|
68
|
+
|
|
69
|
+
<glyph glyph-name="lasso-tool" unicode="" d="M303 798l0-218 103 0 0 218-103 0z m-248-246l0-103 218 0 0 103-218 0z m379 0l0-103 219 0 0 103-219 0z m349-30l0-40 123 0 0-117 40 0 0 157-163 0z m-480-104l0-218 103 0 0 218-103 0z m603-159l0-77 40 0 0 77-40 0z m0-190l0-116-119 0 0-40 159 0 0 156-40 0z m-570-1l0-157 159 0 0 40-119 0 0 117-40 0z m264-117l0-40 82 0 0 40-82 0z" horiz-adv-x="1000" />
|
|
70
|
+
|
|
71
|
+
<glyph glyph-name="screw-wrench" unicode="" d="M756 704c-55 0-108-22-147-61-39-39-61-92-61-147 0-55 22-108 61-147 39-39 92-61 147-61 91 0 171 59 198 146l-149-40-116 77 62 124 79 21 78 21c-39 42-94 67-152 67z m-247-278l-461-316c-14-42 32-111 80-114l451 310c-36 31-61 73-70 120z" horiz-adv-x="1000" />
|
|
72
|
+
|
|
73
|
+
<glyph glyph-name="trash" unicode="" d="M429 743c-58-4-70 11-71-52l0-9-172-56c-20-5-20-29 0-30l624 0c19 0 19 25 0 30l-168 55 0 10c0 62-7 48-71 52l-71 0z m-215-204c-14 0-25-12-24-26l50-555c1-12 11-22 24-22l457 0c13 0 23 9 25 22l64 554c2 15-9 27-24 27l-143 0-143 0z m27-49l259 0 259 0-59-505-414 0z m120-73c-1 0-2 0-3 0-16-1-28-15-25-31l44-320c2-15 16-26 31-24 15 2 25 17 22 32l-44 319c-2 13-12 23-25 24z m280 0c-13 0-25-10-27-24l-44-319c-3-15 7-30 22-32 16-2 29 9 31 24l44 320c3 16-9 30-26 31z" horiz-adv-x="1000" />
|
|
74
|
+
|
|
75
|
+
<glyph glyph-name="bpmn-io" unicode="" d="M674 41h-348v-191h348z m-348 809v-714h176c114 0 171 57 171 166v58c0 76-23 133-81 157 48 24 67 71 67 143v28c0 105-48 162-162 162z m114-100h57c43 0 57-24 57-76v-38c0-57-23-76-66-76h-48z m-5-300h53c47 0 71-19 71-86v-62c0-52-19-71-57-71h-67z" horiz-adv-x="1000" />
|
|
76
|
+
|
|
77
|
+
<glyph glyph-name="decision-table" unicode="" d="M37 677l0-327 0-71 0-46 0-210 216 0 47 0 663 0 0 327 0 327-926 0z m46-219l170 0 0-179-170 0 0 71 0 108z m217 0l617 0 0-108 0-71-617 0 0 179z m-217-225l170 0 0-164-170 0 0 164z m217 0l617 0 0-164-617 0 0 164z" horiz-adv-x="1000" />
|
|
78
|
+
|
|
79
|
+
<glyph glyph-name="literal-expression" unicode="" d="M383 834c-52 0-99-12-134-41-34-28-54-73-54-131 0-32-2-160-2-193 0-30-22-66-97-66l-20 0 0-99 20 0c74 0 97-43 97-66 0-32 2-159 2-189 0-63 20-109 55-139 35-29 82-40 133-40l45 0 0 104-41 0c-29 0-46 8-57 21-12 13-18 34-18 63 0 29-1 138-1 168l0 0c0 42-16 76-39 101-11 11-24 20-37 27 13 7 25 16 36 27 24 23 40 57 40 99l0 0c0 31 1 147 1 174 0 28 6 47 16 58 11 11 28 18 59 18l41 0 0 104-45 0z m195 0l0-104 41 0c31 0 47-7 58-18 10-11 16-30 16-58 0-27 1-143 1-174 0-42 16-75 39-99 11-11 23-20 36-27-13-7-25-16-36-27-24-24-39-59-39-101 0-31-1-139-1-167 0-30-7-51-18-64-11-13-28-21-56-21l-41 0 0-103 44 0c51 0 98 11 132 40 35 29 55 76 55 138 0 31 2 157 2 189 0 8 3 19 10 29 6 6 12 12 17 18 15 11 37 19 69 19l20 0 0 99-20 0c-74 0-96 36-96 66 0 33-2 162-2 193 0 58-20 103-54 131-34 29-81 41-133 41l-44 0z m266-504c0 0 0 0 1 0 0 0-1-1-1-1l0 1z" horiz-adv-x="1000" />
|
|
80
|
+
|
|
81
|
+
<glyph glyph-name="edit" unicode="" d="M203-7l50 51-131 131-51-51v-60h72v-71h60z m291 518q0 12-12 12-5 0-9-4l-303-302q-4-4-4-10 0-12 13-12 5 0 9 4l303 302q3 4 3 10z m-30 107l232-232-464-465h-232v233z m381-54q0-29-20-50l-93-93-232 233 93 92q20 21 50 21 29 0 51-21l131-131q20-22 20-51z" horiz-adv-x="857.1" />
|
|
82
|
+
|
|
83
|
+
<glyph glyph-name="cut" unicode="" d="M536 350q14 0 25-11t10-25-10-25-25-10-25 10-11 25 11 25 25 11z m167-36l283-222q16-11 14-31-3-20-19-28l-72-36q-7-4-16-4-10 0-17 4l-385 216-62-36q-4-3-7-3 8-28 6-54-4-43-31-83t-74-69q-74-47-154-47-76 0-124 44-51 47-44 116 4 42 31 82t73 69q74 47 155 47 46 0 84-18 5 8 13 13l68 40-68 41q-8 5-13 12-38-17-84-17-81 0-155 47-46 30-73 69t-31 82q-3 33 8 63t36 52q47 44 124 44 80 0 154-47 46-29 74-68t31-83q2-27-6-54 3-1 7-3l62-37 385 216q7 5 17 5 9 0 16-4l72-36q16-9 19-28 2-20-14-32z m-380 145q26 24 12 61t-59 65q-52 33-107 33-42 0-63-20-26-24-12-60t59-66q51-33 107-33 41 0 63 20z m-47-415q45 28 59 65t-12 60q-22 20-63 20-56 0-107-33-45-28-59-65t12-60q21-20 63-20 55 0 107 33z m99 342l54-33v7q0 20 18 31l8 4-44 26-15-14q-1-2-5-6t-7-7q-1-1-2-2t-2-1z m125-125l54-18 410 321-71 36-429-240v-64l-89-53 5-5q1-1 4-3 2-2 6-7t6-6l15-15z m393-232l71 35-290 228-99-77q-1-2-7-4z" horiz-adv-x="1000" />
|
|
84
|
+
|
|
85
|
+
<glyph glyph-name="hand-tool" unicode="" d="M498 750c-19 0-36-11-45-26-8-15-12-33-14-53-5-40-1-88-1-131 0-22 0-45 0-67-6 14-11 28-15 39l0 0 0 0c-16 40-30 81-50 111-10 15-21 27-36 34-16 8-34 7-52 0l0-1 0 0c-18-8-28-24-32-41-3-17 0-35 4-54 9-39 26-84 38-128 10-35 19-70 27-100-12 11-24 23-38 35-23 20-49 38-75 48-27 10-57 11-80-9l0 0 0 0c-18-17-27-37-24-57 2-20 13-38 27-56 29-36 74-75 118-128 49-58 102-152 140-201l5-7 332 0 3 12c7 21 14 62 26 114 11 51 27 112 47 165 28 71 56 138 68 191 6 26 9 49 4 70-5 20-22 37-45 41-20 4-39-5-52-19-14-13-24-31-33-52-8-15-14-33-21-50 0 29 0 36 0 75-1 43 2 92-1 131-2 19-5 37-12 51-7 14-22 26-40 25-17 1-32-7-41-19-10-13-16-28-20-44-9-34-13-74-19-107-3-16-6-32-9-47-2 16-4 33-6 51-4 40-6 88-15 128-4 19-9 37-19 51-9 15-25 26-43 25l1 0c0 0-1 0-2 0z m0-33c0 0 1 0 1 0l1 0 0 0c6 0 9-2 14-10 5-8 10-23 14-40 8-36 11-83 15-125 9-90 22-156 22-156l33 1c0 0 13 75 26 149 6 35 11 75 18 104 4 14 9 26 14 32 5 6 7 7 14 7l1 0 1 0c6 0 5 0 9-7 4-7 7-21 8-39 3-35 1-83 1-128 0-84 1-160 1-160l32-7c19 41 35 91 52 128 9 19 18 34 27 43 8 8 14 10 22 9l0 0 0 0c13-2 16-6 19-17 2-10 1-30-5-54-11-47-39-114-66-186-22-56-37-118-49-170-10-42-17-79-22-99l-289 0c-35 47-86 136-136 196-46 55-92 95-117 127-13 16-20 29-21 38-1 10 1 17 14 29 11 10 25 10 45 3 20-8 44-24 65-43 44-37 80-82 80-82l29 15c0 0-21 87-43 167-13 47-30 92-38 126-4 17-5 32-3 41 1 9 4 13 12 17 11 5 17 4 23 1 7-3 15-11 23-23 16-24 31-64 46-104l0 0c16-42 47-117 47-117l32 6c0 0 3 83 2 151-1 44-4 92 0 128 2 17 6 31 10 39 5 8 8 10 16 10z" horiz-adv-x="1000" />
|
|
86
|
+
|
|
87
|
+
<glyph glyph-name="paste" unicode="" d="M429-79h500v358h-233q-22 0-37 15t-16 38v232h-214v-643z m142 804v36q0 7-5 12t-12 6h-393q-7 0-13-6t-5-12v-36q0-7 5-13t13-5h393q7 0 12 5t5 13z m143-375h167l-167 167v-167z m286-71v-375q0-23-16-38t-38-16h-535q-23 0-38 16t-16 38v89h-303q-23 0-38 16t-16 37v750q0 23 16 38t38 16h607q22 0 38-16t15-38v-183q12-7 20-15l228-228q16-15 27-42t11-49z" horiz-adv-x="1000" />
|
|
88
|
+
</font>
|
|
89
|
+
</defs>
|
|
90
|
+
</svg>
|