@finos/legend-application-pure-ide-deployment 8.19.0 → 8.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ide/index.html +1 -1
- package/dist/ide/static/{index.b4808e56.css → index.353c81c8.css} +3 -3
- package/dist/ide/static/{index.b4808e56.css.map → index.353c81c8.css.map} +1 -1
- package/dist/ide/static/{index.7c14b04f.js → index.5f7924e5.js} +2 -2
- package/dist/ide/static/{index.7c14b04f.js.map → index.5f7924e5.js.map} +1 -1
- package/dist/ide/version.json +1 -1
- package/package.json +2 -2
@@ -1,2 +1,2 @@
|
|
1
|
-
(()=>{"use strict";var e,t,s,i,n,a={80398:(e,t,s)=>{const i=JSON.parse('{"i8":"6.2.8","Rw":{"k":"@finos/legend-logger-plugin-web-console"}}');var n,a=s(91004);class r{name;version;signature;uuid}class o{name;version;uuid=(0,a.Z)();constructor(e,t){this.name=e,this.version=t}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getInfo(){const e=new r;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e}configure(e){return this}}class l{name;version;signature;uuid;plugins=[]}class c{name;version;uuid=(0,a.Z)();plugins=[];constructor(e,t,s){this.name=e,this.version=t,this.plugins=s}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getPlugins(){return[...this.plugins]}getInfo(){const e=new l;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e.plugins=this.plugins.map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),e}configure(e){return this}install(e){this.plugins.forEach((t=>t.install(e)))}}class d{plugins=[];presets=[];usePlugins(e){return this.plugins=e,this}usePresets(e){return this.presets=e,this}configure(e){Object.keys(e).forEach((t=>{const s=e[t];this.presets.forEach((e=>{e.getName()===t&&e.configure(s)})),this.plugins.forEach((e=>{e.getName()===t&&e.configure(s)}))}))}install(){this.plugins.forEach((e=>e.install(this))),this.presets.forEach((e=>e.install(this)))}getInfo(){return{plugins:this.plugins.filter((e=>!this.getHiddenPluginNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),presets:this.presets.filter((e=>!this.getHiddenPresetNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name)))}}getHiddenPluginNames(){return[]}getHiddenPresetNames(){return[]}}!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(n=n||(n={}));class h{channel;name;timestamp=Date.now();static create(e){const t=new h;return t.name=e,t}}class u extends o{level=n.DEBUG;setLevel(e){this.level=e}install(e){e.registerLoggerPlugin(this)}debug(e,...t){this.level<=n.DEBUG&&this._debug(e,...t)}info(e,...t){this.level<=n.INFO&&this._info(e,...t)}warn(e,...t){this.level<=n.WARN&&this._warn(e,...t)}error(e,...t){this.level<=n.ERROR&&this._error(e,...t)}}class p{loggers=[];registerPlugins(e){this.loggers=e}debug(e,...t){this.loggers.forEach((s=>s.debug(e,...t)))}info(e,...t){this.loggers.forEach((s=>s.info(e,...t)))}warn(e,...t){this.loggers.forEach((s=>s.warn(e,...t)))}error(e,...t){this.loggers.forEach((s=>s.error(e,...t)))}}const{debug:_,info:m,warn:g,error:E}=console;class f extends u{constructor(){super(i.Rw.k,i.i8)}_debug(e,...t){_(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_info(e,...t){m(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_warn(e,...t){g(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_error(e,...t){E(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}var T,C,x=s(52322),N=s(17029),O=s(80075),A=s(90361);!function(e){e.LEGEND="LEGEND",e.TEMPORARY__VSCODE_LIGHT="vs"}(T=T||(T={})),function(e){e.TEXT="text",e.PURE="pure",e.JSON="json",e.JAVA="java",e.MARKDOWN="markdown",e.SQL="sql"}(C=C||(C={}));var S=s(85928),y=s(21112);const I=e=>e.constructor,v=()=>()=>{},R=e=>e.length?e[0]:void 0,P=e=>new Promise(((t,s)=>setTimeout((()=>{try{t(e())}catch(e){s(e)}}),0))),w=(e,t,s=((e,t)=>e===t))=>!e.find((e=>s(e,t)))&&(e.push(t),!0),L=(e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t))),a=e.findIndex((e=>i(e,s)));return-1!==n&&-1!==a&&(e[n]=s,e[a]=t,!0)},b=(e,t,s=((e,t)=>e===t))=>{const i=e.findIndex((e=>s(e,t)));return-1!==i&&(e.splice(i,1),!0)};class D extends Error{uuid=(0,a.Z)();constructor(e){super(),this.message=void 0===e||""===e?"(no error message)":e}get detail(){return this.message}}class M extends Error{constructor(e,t,s){if(super(s||(t instanceof Error?t.message:t)),this.name=e,t instanceof Error){const e=(this.message.match(/\n/g)??[]).length+1;this.stack=`${(this.stack??"").split("\n").slice(0,e+1).join("\n")}\nCaused by: ${t.stack}`}else"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack}}class k extends M{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class F extends M{constructor(e,t){super("Unsupported Operation Error",e||t?`${e}${t?`\n${((e,t)=>{const s=(i={printFunctionName:!1,maxDepth:t?.deep?void 0:1},(0,S.Z)(i,(e=>void 0!==e)));var i;return(0,y.WU)(e,s).replace(/.*\s\{/g,"{").replace(/\[.*\]/g,(e=>["[Array]","[Function]"].includes(e)?e:"[Object]"))})(t)}`:""}`:void 0)}}function j(e){if(!(e instanceof Error))throw new k("Expected error to be thrown")}const U=e=>{try{return e()}catch{return}};class V extends M{constructor(e,t){super("Assertion Error",e,t)}}const G=e=>null!=e;function z(e,t=""){if(null==e)throw new V(t||"Value is nullable")}const B=(e,t="")=>(z(e,t),e),$=e=>t=>((e,t)=>e instanceof t)(t,e);function H(e,t,s=""){if(!(e instanceof t))throw new V(s||`Value is expected to be of type '${t.name}'`)}const Y=(e,t,s="")=>(H(e,t,s),e);function W(e,t=""){if(""===B(e,t))throw new V(t||"Expected string value to be non-empty")}function K(e,t=""){return W(e,t),e}function Z(e,t=""){if(!e)throw new V(t||"Expected predicate to be truthy")}const X=e=>"string"==typeof e,q=e=>"object"==typeof e&&null!==e;var J=s(39391),Q=s(33654),ee=s(34126);s(72659);const te=J.W,se="charset=utf-8";var ie,ne,ae;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(ie=ie||(ie={})),function(e){e.APPLICATION_JSON="application/json",e.APPLICATION_XML="application/xml",e.APPLICATION_ZLIB="application/zlib",e.TEXT_PLAIN="text/plain",e.TEXT_CSV="text/csv",e.ALL="*/*"}(ne=ne||(ne={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(ae=ae||(ae={}));const re={mode:"cors",credentials:"include",redirect:"manual"},oe=(e,t)=>{const s={};return e&&Object.entries(e).forEach((([e,t])=>{s[e]=t})),t&&Object.entries(t).forEach((([e,t])=>{s[e]=t})),s};class le extends Error{response;payload;constructor(e,t){super(),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="Network Client Error",this.response=e;const{status:s,statusText:i,url:n}=e,a=`Received response with status ${s} (${i}) for ${n}`;this.message=(t?(e=>{if(q(e))return X(e.message)?e.message:JSON.stringify(e);let t;try{t=JSON.parse(e)}catch{}return t&&X(t.message)?t.message:e})(t).substring(0,5e3):"")||a,this.payload=t}}const ce=async(e,t,s)=>{if(s?.preprocess?.(e),!e.ok){let t;try{t=await e.text(),t=JSON.parse(t)}catch{}return Promise.reject(new le(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===te.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case ne.APPLICATION_JSON:return e.json();case ne.TEXT_PLAIN:return e.text();default:return Promise.reject(new le(e,`Can't process response for request with Content-Type '${i}'`))}},de=async(e,t,s)=>s?.autoReAuthenticateUrl?(e=>new Promise((t=>{const s="AUTO_AUTHENTICATION_IFRAME";document.getElementById(s)?.remove();const i=document.createElement("iframe");i.id=s,i.src=e,i.style.display="none",i.addEventListener("load",(()=>{i.remove(),t()})),document.body.appendChild(i)})))(s.autoReAuthenticateUrl).then((()=>fetch(e,t))).then((e=>ce(e,t,s))):fetch(e,t).then((e=>ce(e,t,s))),he=(e,t)=>{const s={};return s.Accept=ne.APPLICATION_JSON,e!==ae.GET&&(s[ie.CONTENT_TYPE]=`${ne.APPLICATION_JSON};${se}`),oe(s,t)};class ue{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...re,...e?.options??{}}}async get(e,t={},s,i,n,a){return this.request(ae.GET,e,void 0,t,s,i,n,a)}async put(e,t={},s={},i,n,a,r){return this.request(ae.PUT,e,t,s,i,n,a,r)}async post(e,t={},s={},i,n,a,r){return this.request(ae.POST,e,t,s,i,n,a,r)}async delete(e,t={},s={},i,n,a,r){return this.request(ae.DELETE,e,t,s,i,n,a,r)}async request(e,t,s,i,n,a,r,o){const l=((e,t,s)=>{if(!e&&!U((()=>new URL(t))))throw new Error(`Can't build URL string: base URL is not specified and the provided URL '${t}' is not absolute`);const i=new URL(t,e);return s instanceof Object&&Object.entries(s).forEach((([e,t])=>{void 0!==t&&(Array.isArray(t)?t.filter(G).forEach((t=>i.searchParams.append(e,t.toString()))):i.searchParams.append(e,t.toString()))})),i.toString()})(this.baseUrl,t,a??{});let c;if((X(s)||q(s))&&r?.enableCompression&&(Z(e!==ae.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,Q.Wt)(q(e)?JSON.stringify(e):e)]))(s),n=oe(n,{[ie.CONTENT_TYPE]:`${ne.APPLICATION_ZLIB};${se}`})),void 0!==s)if(X(s)||s instanceof Blob)c=s;else{if(!q(s))throw new V("Request body can only be either a 'string' or an 'object'");c=JSON.stringify(s)}const d={...this.options,...i,method:e,body:c,headers:he(e,n)};return fetch(l,d).then((e=>(e=>0===e.status||e.status===te.UNAUTHORIZED)(e)?de(l,d,o):ce(e,d,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?de(l,d,o):Promise.reject(e)))}}const pe=(e,t,s)=>{const i=new Blob([t],{type:s}),n=URL.createObjectURL(i),a=document.createElement("a");"string"==typeof a.download?(document.body.appendChild(a),a.download=e,a.href=n,a.click(),document.body.removeChild(a)):location.replace(n)};var _e;!function(e){e.TEXT_EDITOR_FONT_LOADED="application.load.font.success",e.APPLICATION_SETUP_FAILURE="application.setup.failure",e.ILLEGAL_APPLICATION_STATE_OCCURRED="application.error.illegal-state",e.APPLICATION_CONFIGURATION_FAILURE="application.configuration.failure",e.APPLICATION_DOCUMENTATION_FETCH_FAILURE="application.fetch.documentation.failure",e.APPLICATION_DOCUMENTATION_LOAD_SKIPPED="application.load.documentation.skipped",e.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK_FAILURE="application.load.documentation.requirement-check.failure",e.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE="application.load.keyboard-shortcuts.configuration-check.failure",e.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED="application.load.contextual-documentation.skipped",e.APPLICATION_COMMAND_CENTER_REGISTRATION_FAILURE="application.command-center.registration.failure",e.APPLICATION_LOADED="application.load.success",e.APPLICATION_LOAD_FAILURE="application.load.failure",e.DEVELOPMENT_ISSUE="development.issue",e.APPLICATION_CONTEXT_ACCESSED="application.context.accessed",e.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED="application.virtual-assistant.documentation-entry.accessed"}(_e=_e||(_e={}));const me="::",ge="###",Ee=["$implicit"];var fe,Te,Ce,xe,Ne;(Ne=fe=fe||(fe={})).CORE="CORE",Ne.MAIN="ROOT",Ne.MODEL_GENERATION="MODEL_GENERATION_ROOT",Ne.SYSTEM="SYSTEM_ROOT",Ne.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(xe=Te=Te||(Te={})).STRING="String",xe.BOOLEAN="Boolean",xe.BINARY="Binary",xe.NUMBER="Number",xe.INTEGER="Integer",xe.FLOAT="Float",xe.DECIMAL="Decimal",xe.DATE="Date",xe.STRICTDATE="StrictDate",xe.DATETIME="DateTime",xe.STRICTTIME="StrictTime",xe.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(Ce=Ce||(Ce={}));const Oe=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var Ae,Se,ye,Ie,ve,Re,Pe,we,Le,be;(Se=Ae=Ae||(Ae={})).ANY="meta::pure::metamodel::type::Any",Se.NIL="meta::pure::metamodel::type::Nil",Se.PROFILE_DOC="meta::pure::profiles::doc",Se.PROFILE_TEMPORAL="meta::pure::profiles::temporal",Se.PROFILE="meta::pure::metamodel::extension::Profile",Se.ENUMERATION="meta::pure::metamodel::type::Enumeration",Se.MEASURE="meta::pure::metamodel::type::Measure",Se.CLASS="meta::pure::metamodel::type::Class",Se.ASSOCIATION="meta::pure::metamodel::relationship::Association",Se.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",Se.FLAT_DATA="meta::flatData::metamodel::FlatData",Se.DATABASE="meta::relational::metamodel::Database",Se.MAPPING="meta::pure::mapping::Mapping",Se.SERVICE="meta::legend::service::metamodel::Service",Se.CONNECTION="meta::pure::runtime::PackageableConnection",Se.RUNTIME="meta::pure::runtime::PackageableRuntime",Se.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",Se.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",Se.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",Se.DATA_ELEMENT="meta::pure::data::DataElement",Se.TDS_ROW="meta::pure::tds::TDSRow",(Re=ye=ye||(ye={})).BUSINESS_TEMPORAL="businesstemporal",Re.PROCESSING_TEMPORAL="processingtemporal",Re.BITEMPORAL="bitemporal",(ve=Ie=Ie||(Ie={})).ALL_VERSIONS="AllVersions",ve.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(we=Pe=Pe||(Pe={})).STORE="STORE",we.MAPPING="MAPPING",we.RUNTIME="RUNTIME",we.FILE_GENERATION="FILE_GENERATION",we.SERVICE="SERVICE",(be=Le=Le||(Le={})).TODAY="meta::pure::functions::date::today",be.NOW="meta::pure::functions::date::now",be.FIRST_DAY_OF_WEEK="meta::pure::functions::date::firstDayOfThisWeek",be.FIRST_DAY_OF_MONTH="meta::pure::functions::date::firstDayOfThisMonth",be.FIRST_DAY_OF_QUARTER="meta::pure::functions::date::firstDayOfThisQuarter",be.FIRST_DAY_OF_YEAR="meta::pure::functions::date::firstDayOfThisYear",be.PREVIOUS_DAY_OF_WEEK="meta::pure::functions::date::previousDayOfWeek",be.IS_ON_DAY="meta::pure::functions::date::isOnDay",be.IS_ON_OR_AFTER_DAY="meta::pure::functions::date::isOnOrAfterDay",be.IS_AFTER_DAY="meta::pure::functions::date::isAfterDay",be.IS_ON_OR_BEFORE_DAY="meta::pure::functions::date::isOnOrBeforeDay",be.IS_BEFORE_DAY="meta::pure::functions::date::isBeforeDay",be.MINUS="meta::pure::functions::math::minus",be.ADJUST="meta::pure::functions::date::adjust",be.LET="meta::pure::functions::lang::letFunction";const De="yyyy-MM-dd'T'HH:mm:ssxxxx";var Me,ke,Fe;!function(e){e.PROFILE="Profile",e.CLASS="Class",e.ENUMERATION="Enum",e.MEASURE="Measure",e.ASSOCIATION="Association",e.FUNCTION="function",e.MAPPING="Mapping",e.FLAT_DATA="FlatData",e.DATABASE="Database",e.SERVICE="Service",e.RUNTIME="Runtime",e.CONNECTION="Connection",e.FILE_GENERATION="FileGeneration",e.GENERATION_SPECIFICATION="GenerationSpecification",e.DATA_ELEMENT="Data"}(Me=Me||(Me={})),function(e){e.JSON_MODEL_CONNECTION="JsonModelConnection",e.XML_MODEL_CONNECTION="XmlModelConnection",e.MODEL_CHAIN_CONNECTION="ModelChainConnection",e.RELATIONAL_DATABASE_CONNECTION="RelationalDatabaseConnection",e.FLAT_DATA_CONNECTION="FlatDataConnection"}(ke=ke||(ke={})),function(e){e.PURE="Pure",e.CONNECTION="Connection",e.RUNTIME="Runtime",e.MAPPING="Mapping",e.SERVICE="Service",e.FLATDATA="FlatData",e.RELATIONAL="Relational",e.GENERATION_SPECIFICATION="GenerationSpecification",e.FILE_GENERATION_SPECIFICATION="FileGeneration",e.DATA="Data"}(Fe=Fe||(Fe={}));const je=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`;var Ue;!function(e){e.WHITESPACE="",e.KEYWORD="keyword",e.IDENTIFIER="identifier",e.OPERATOR="operator",e.DELIMITER="delimiter",e.PARSER="parser",e.NUMBER="number",e.DATE="date",e.COLOR="color",e.PACKAGE="package",e.STRING="string",e.COMMENT="comment",e.LANGUAGE_STRUCT="language-struct",e.MULTIPLICITY="multiplicity",e.GENERICS="generics",e.PROPERTY="property",e.VARIABLE="variable",e.TYPE="type",e.INVALID="invalid"}(Ue=Ue||(Ue={}));const Ve={base:"vs-dark",inherit:!0,colors:{},rules:[{token:Ue.IDENTIFIER,foreground:"dcdcaa"},{token:Ue.NUMBER,foreground:"b5cea8"},{token:Ue.DATE,foreground:"b5cea8"},{token:Ue.COLOR,foreground:"b5cea8"},{token:Ue.PACKAGE,foreground:"808080"},{token:Ue.PARSER,foreground:"c586c0"},{token:Ue.LANGUAGE_STRUCT,foreground:"c586c0"},{token:Ue.MULTIPLICITY,foreground:"2d796b"},{token:Ue.GENERICS,foreground:"2d796b"},{token:Ue.PROPERTY,foreground:"9cdcfe"},{token:Ue.VARIABLE,foreground:"4fc1ff"},{token:Ue.TYPE,foreground:"3dc9b0"}]},Ge={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"},{open:"<<",close:">>"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}};var ze=s(79013);class Be{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,ze.qC)(this.schema,e)}fromJson(e){return(0,ze.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,S.Z)(t,(e=>null!==e))):e);var t}}const $e=e=>(0,ze.PG)((t=>void 0===t?ze.AM:(0,ze.qC)(e,t)),(t=>(0,ze.vB)(e,t))),He=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?ze.AM:[],Ye=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?ze.AM:[]:ze.AM,We=e=>(0,ze.PG)((()=>e),(()=>e));var Ke=s(4e4);class Ze{_documentationKey;markdownText;title;text;url;related;static serialization=new Be((0,ze.yu)(Ze,{markdownText:(0,ze.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,ze.jt)((0,ze.pb)((0,ze.Ru)())),title:(0,ze.jt)((0,ze.Ru)()),text:(0,ze.jt)((0,ze.Ru)()),url:(0,ze.jt)((0,ze.Ru)())}));static create(e,t){const s=Ze.serialization.fromJson(e);return s._documentationKey=t,s}}const Xe=e=>Object.entries(e).map((e=>({key:e[0],content:Ze.create(e[1],e[0])})));class qe{url;docRegistry=new Map;contextualDocIndex=new Map;constructor(e){this.url=e.config.documentationUrl,e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedDocumentationEntries?.()??[])).forEach((t=>{this.hasDocEntry(t.key)?e.log.warn(h.create(_e.APPLICATION_DOCUMENTATION_LOAD_SKIPPED),t.key):this.docRegistry.set(t.key,t.content)})),e.config.keyedDocumentationEntries.forEach((e=>this.docRegistry.set(e.key,e.content)));const t=e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraContextualDocumentationEntries?.()??[])),s=[];(0,Ke.Z)(e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraRequiredDocumentationKeys?.()??[])).concat(t.map((e=>e.documentationKey)))).forEach((e=>{this.docRegistry.has(e)||s.push(e)})),s.length&&e.log.warn(h.create(_e.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK_FAILURE),`Can't find corresponding documentation entry for keys:\n${s.map((e=>`- ${e}`)).join("\n")}`),t.forEach((t=>{if(this.hasContextualDocEntry(t.context))e.log.warn(h.create(_e.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED),t.context);else{const e=this.getDocEntry(t.documentationKey);e&&this.contextualDocIndex.set(t.context,e)}})),e.config.contextualDocEntries.forEach((e=>{const t=this.getDocEntry(e.documentationKey);t&&this.contextualDocIndex.set(e.context,t)}))}getDocEntry(e){return this.docRegistry.get(e)}hasDocEntry(e){return this.docRegistry.has(e)}getContextualDocEntry(e){return this.contextualDocIndex.get(e)}hasContextualDocEntry(e){return this.contextualDocIndex.has(e)}getAllDocEntries(){return Array.from(this.docRegistry.values())}publishDocRegistry(){const e={};return this.docRegistry.forEach(((t,s)=>{e[s]=Ze.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t._documentationKey})),e}}class Je{}class Qe extends Je{debug(e,...t){console.debug(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}info(e,...t){console.info(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}warn(e,...t){console.warn(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}error(e,...t){console.error(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}class et{config;logger;pluginManager;basePresets=[];basePlugins=[];baseUrl;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new Qe}setup(e){return this.baseUrl=K(e.baseUrl,"Can't setup application: 'baseUrl' is missing or empty"),this.pluginRegister=e.pluginRegister,this._isConfigured=!0,this}withBasePresets(e){return this.basePresets=e,this.withPresets([])}withBasePlugins(e){return this.basePlugins=e,this.withPlugins([])}withPresets(e){return this.pluginManager.usePresets([...this.basePresets,...e]),this}withPlugins(e){return this.pluginManager.usePlugins([...this.basePlugins,...e]),this}async fetchApplicationConfiguration(e){const t=new ue;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){j(e),this.logger.error(h.create(_e.APPLICATION_CONFIGURATION_FAILURE),e)}z(s,"Can't fetch Legend application configuration");try{i=await t.get(`${window.location.origin}${e}version.json`)}catch(e){j(e),this.logger.error(h.create(_e.APPLICATION_CONFIGURATION_FAILURE),e)}return z(i,"Can't fetch Legend application version"),[await this.configureApplication({configData:s,versionData:i,baseUrl:e}),s.extensions??{}]}async loadDocumentationRegistryData(e){const t={};await Promise.all([...e.documentationRegistryEntries,...this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraDocumentationRegistryEntries?.()??[]))].map((async e=>{try{const s=new ue(e.simple?{options:{credentials:"omit"}}:{}),i=await s.get(K(e.url,"Can't load documentation registry: 'url' field is missing or empty"));z(i.entries,"Can't load documentation registry data: 'entries' field is missing");const n=e.includes?.map((e=>new RegExp(`^${e.trim().replace(/[\^$\\.+?()[\]{}|]/g,"\\$&").replace(/\*/g,".*")}$`)));Object.entries(i.entries).forEach((([e,s])=>{n&&!n.some((t=>t.test(e)))||t[e]||(t[e]=s)}))}catch(e){j(e),this.logger.warn(h.create(_e.APPLICATION_DOCUMENTATION_FETCH_FAILURE),e)}}))),e.keyedDocumentationEntries=[...Xe(t),...e.keyedDocumentationEntries]}async start(){z(this._isConfigured,"Legend application has not been configured properly. Make sure to run setup() before start()");try{const[e,t]=await this.fetchApplicationConfiguration(this.baseUrl);this.config=e,this.pluginRegister?.(this.pluginManager,this.config),this.pluginManager.configure(t),this.pluginManager.install(),await Promise.all([this.loadDocumentationRegistryData(e)]),await this.loadApplication(),await Promise.all(this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraApplicationSetups?.()??[])).map((e=>e(this.pluginManager)))),this.logger.info(h.create(_e.APPLICATION_LOADED),"Legend application loaded")}catch(e){throw j(e),this.logger.error(h.create(_e.APPLICATION_LOAD_FAILURE),"Failed to load Legend application"),e}}}var tt=s(74926),st=s(69038),it=s(2784);class nt{historyAPI;_isNavigationBlocked=!1;_forceBypassNavigationBlocking=!1;_blockCheckers=[];_beforeUnloadListener=e=>{this._forceBypassNavigationBlocking||this._blockCheckers.some((e=>e()))&&(e.returnValue="")};onBlock;onNativePlatformNavigationBlock;constructor(e){(0,O.rC)(this,{_isNavigationBlocked:O.LO,isNavigationBlocked:O.Fl,blockNavigation:O.aD,unblockNavigation:O.aD}),this.historyAPI=e}get window(){return B(window,"Window object is not available in non-web environment")}goToLocation(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=this.generateAddress(e)};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}reload(e){e?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const t=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.reload()};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(t):t()}goToAddress(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=e};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}visitAddress(e){this.window.open(e,"_blank")}updateCurrentLocation(e){this.historyAPI.push(e)}getCurrentAddress(){return this.window.location.href}getCurrentLocation(){return this.historyAPI.location.pathname}generateAddress(e){return this.window.location.origin+this.historyAPI.createHref({pathname:e})}blockNavigation(e,t,s){this._isNavigationBlocked=!0,this.onBlock=t,this.onNativePlatformNavigationBlock=s,this.window.history.pushState(null,"",this.getCurrentAddress()),this.window.onpopstate=()=>{window.history.forward(),this.onNativePlatformNavigationBlock?.()},this._blockCheckers=e,this.window.removeEventListener("beforeunload",this._beforeUnloadListener),this.window.addEventListener("beforeunload",this._beforeUnloadListener)}unblockNavigation(){this._isNavigationBlocked=!1,this.onBlock=void 0,this.window.onpopstate=null,this._blockCheckers=[],this.window.removeEventListener("beforeunload",this._beforeUnloadListener)}get isNavigationBlocked(){return this._isNavigationBlocked}}var at=s(40979);const rt=(0,it.createContext)(void 0),ot=({children:e})=>{const t=(0,at.k6)(),s=(0,st.fv)((()=>new nt(t)));return(0,x.jsx)(rt.Provider,{value:s,children:e})};class lt{plugins=[];registerPlugins(e){this.plugins=e}setUserId(e){this.plugins.forEach((t=>t.setUserId(e)))}logEvent(e,t){this.plugins.forEach((s=>s.logEvent(e,t)))}}var ct;!function(e){e.USER="user",e.ENV="env",e.RESULT="result",e.ERROR="error",e.HTTP_STATUS="status",e.HTTP_REQUEST_METHOD="method",e.HTTP_REQUEST_URL="url"}(ct=ct||(ct={}));class dt{traceEntries=[];setup(e){this.traceEntries=e}bootstrap(e){this.traceEntries.forEach((t=>{t.plugin.bootstrap(t.clientSpan,e)}))}reportSuccess(){this.traceEntries.forEach((e=>{e.plugin.concludeClientSpan(e.clientSpan,void 0)}))}reportError(e){this.traceEntries.forEach((t=>{t.plugin.concludeClientSpan(t.clientSpan,e)}))}close(){this.traceEntries.forEach((e=>{e.plugin.concludeServerSpan(e.serverSpan)}))}}class ht{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const n=new dt;return e&&n.setup(this.plugins.map((n=>{const a=n.createClientSpan(e);return{clientSpan:a,serverSpan:n.createServerSpan(a,t,s,i),plugin:n}}))),n}}var ut,pt,_t,mt=s(94174);!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(ut||(ut={}));class gt{state;_message;_messageFormatter;constructor(){this.state=ut.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=ut.INITIAL,this}inProgress(){return this.state=ut.IN_PROGRESS,this}fail(){return this.state=ut.FAILED,this}pass(){return this.state=ut.SUCCEEDED,this}complete(e=!0){return e?this.pass():this.fail(),this}get isInInitialState(){return this.state===ut.INITIAL}get isInProgress(){return this.state===ut.IN_PROGRESS}get hasFailed(){return this.state===ut.FAILED}get hasSucceeded(){return this.state===ut.SUCCEEDED}get message(){return this._message?this._messageFormatter?this._messageFormatter(this._message):this._message:void 0}get hasCompleted(){return this.hasFailed||this.hasSucceeded}static create(){return(0,O.rC)(new gt,{state:O.LO,_message:O.LO,reset:O.aD,inProgress:O.aD,pass:O.aD,fail:O.aD,complete:O.aD,setMessage:O.aD,isInInitialState:O.Fl,isInProgress:O.Fl,hasFailed:O.Fl,hasSucceeded:O.Fl,hasCompleted:O.Fl,message:O.Fl})}}!function(e){e.STANDARD="standard",e.INCLUDE="include match",e.EXACT="exact match",e.INVERSE="excludes exact match"}(pt=pt||(pt={}));class Et{currentMode=pt.STANDARD;onSearchModeChange;constructor(e){(0,O.rC)(this,{currentMode:O.LO,isAdvancedSearchActive:O.Fl,setCurrentMode:O.aD}),this.onSearchModeChange=e}get isAdvancedSearchActive(){return this.currentMode!==pt.STANDARD}generateSearchText(e){switch(this.currentMode){case pt.INCLUDE:return`'"${e}"`;case pt.EXACT:return`="${e}"`;case pt.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(_t=_t||(_t={}));class ft{uuid=(0,a.Z)();documentationKey;title;content;url;isOpen=!1;constructor(e){(0,O.rC)(this,{isOpen:O.LO,setIsOpen:O.aD}),this.documentationKey=e._documentationKey,this.title=K(e.title),this.content=e.markdownText??e.text,this.url=e.url}setIsOpen(e){this.isOpen=e}}class Tt{uuid=(0,a.Z)();context;title;content;url;related;constructor(e,t,s){this.context=e,this.title=t.title,this.content=t.markdownText??t.text,this.url=t.url,this.related=s}}const Ct=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class xt{applicationStore;panelRenderingKey=(0,a.Z)();isHidden=!1;isOpen=!1;selectedTab=_t.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=gt.create();searchText="";searchResults=[];showSearchConfigurationMenu=!1;isOverSearchLimit=!1;constructor(e){(0,O.rC)(this,{isHidden:O.LO,isOpen:O.LO,panelRenderingKey:O.LO,isOverSearchLimit:O.LO,selectedTab:O.LO,searchText:O.LO,searchResults:O.LO,currentDocumentationEntry:O.LO,showSearchConfigurationMenu:O.LO,currentContextualDocumentationEntry:O.Fl,setIsHidden:O.aD,setIsOpen:O.aD,setSelectedTab:O.aD,setSearchText:O.aD,resetSearch:O.aD,search:O.aD,openDocumentationEntry:O.aD,refreshPanelRendering:O.aD,setShowSearchConfigurationMenu:O.aD}),this.applicationStore=e,this.searchEngine=new mt.Fuse(this.applicationStore.documentationService.getAllDocEntries().filter(Ct),{includeScore:!0,shouldSort:!0,ignoreLocation:!0,threshold:.2,keys:[{name:"title",weight:4},{name:"text",weight:1},{name:"markdownText.value",weight:1}],useExtendedSearch:!0}),this.searchConfigurationState=new Et((()=>{this.search()}))}get currentContextualDocumentationEntry(){if(!this.applicationStore.navigationContextService.currentContext)return;const e=this.applicationStore.navigationContextService.currentContext.key,t=this.applicationStore.documentationService.getContextualDocEntry(e);return t?new Tt(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter(G).filter(Ct).map((e=>new ft(e)))):void 0}openDocumentationEntry(e){const t=this.applicationStore.documentationService.getAllDocEntries().find((t=>t._documentationKey===e));t&&(this.setIsOpen(!0),this.setIsHidden(!1),this.currentDocumentationEntry=new ft(t),this.currentDocumentationEntry.setIsOpen(!0),this.resetSearch())}setIsHidden(e){this.isHidden=e}hideAssistant(){this.setIsHidden(!0),this.setIsOpen(!1)}toggleAssistant(){this.isHidden?this.setIsHidden(!1):this.hideAssistant()}setIsOpen(e){this.isOpen=e}setSelectedTab(e){this.selectedTab=e}refreshPanelRendering(){this.panelRenderingKey=(0,a.Z)()}setSearchText(e){this.searchText=e}resetSearch(){this.searchText="",this.searchResults=[],this.searchState.complete()}search(){this.searchText?(this.currentDocumentationEntry=void 0,this.searchState.inProgress(),this.searchResults=Array.from(this.searchEngine.search(this.searchConfigurationState.generateSearchText(this.searchText),{limit:101}).values()).map((e=>new ft(e.item))),this.searchResults.length>100?(this.isOverSearchLimit=!0,this.searchResults=this.searchResults.slice(0,100)):this.isOverSearchLimit=!1,this.searchState.complete()):this.searchResults=[]}setShowSearchConfigurationMenu(e){this.showSearchConfigurationMenu=e}}class Nt{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}class Ot{static logEvent_ApplicationInitialized(e,t){e.logEvent(_e.APPLICATION_LOADED,t)}static logEvent_ApplicationContextAccessed(e,t){e.logEvent(_e.APPLICATION_CONTEXT_ACCESSED,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(_e.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED,t)}}class At{applicationStore;contextStack=[];constructor(e){(0,O.rC)(this,{contextStack:O.LO,currentContext:O.Fl,push:O.aD,pop:O.aD}),this.applicationStore=e}get currentContext(){return this.contextStack.length?this.contextStack[this.contextStack.length-1]:void 0}push(e){const t=this.contextStack.filter((e=>!e.isTransient));if(t.find((t=>t.key===e.key)))throw new k(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&Ot.logEvent_ApplicationContextAccessed(this.applicationStore.telemetryService,{key:e.key}),this.contextStack=t}pop(e){const t=this.contextStack.find((t=>t.key===e.key));if(!t)return;const s=this.contextStack.indexOf(t);-1!==s&&(this.contextStack=this.contextStack.slice(0,s).filter((e=>!e.isTransient)))}}class St{applicationStore;commandRegistry=new Map;constructor(e){(0,O.rC)(this,{commandRegistry:O.LO,registerCommand:O.aD,deregisterCommand:O.aD}),this.applicationStore=e}registerCommand(e){const t=e.key;this.commandRegistry.has(t)?this.applicationStore.log.warn(h.create(_e.APPLICATION_COMMAND_CENTER_REGISTRATION_FAILURE),"Can't register command: command is already registered"):this.commandRegistry.set(t,e)}deregisterCommand(e){this.commandRegistry.delete(e)}runCommand(e,t){const s=this.commandRegistry.get(e);return!(!s||s.trigger&&!s.trigger()||(s.action?.(t),0))}}class yt{applicationStore;keyMap=new Map;commandKeyMap=new Map;isHotkeysBlocked=!1;constructor(e){(0,O.rC)(this,{keyMap:O.LO,commandKeyMap:O.LO,isHotkeysBlocked:O.LO,updateHotkey:O.aD,blockGlobalHotkeys:O.aD,unblockGlobalHotkeys:O.aD}),this.applicationStore=e;const t=[];this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedCommandConfigEntries?.()??[])).forEach((e=>{e.content.defaultKeyboardShortcut&&this.commandKeyMap.get(e.key)&&w(t,e.key),this.updateHotkey(e.key,e.content.defaultKeyboardShortcut)})),t.length&&this.applicationStore.log.warn(h.create(_e.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE),`Found multiple key bindings in configuration for commands:\n${t.map((e=>`- ${e}`)).join("\n")}`)}blockGlobalHotkeys(){this.isHotkeysBlocked=!0}unblockGlobalHotkeys(){this.isHotkeysBlocked=!1}updateHotkey(e,t){const s=this.commandKeyMap.get(e);this.commandKeyMap.set(e,t),s&&this.keyMap.set(s,(this.keyMap.get(s)??[]).filter((t=>t===e))),t&&this.keyMap.set(t,[...(this.keyMap.get(t)??[]).filter((t=>t!==e)),e])}dispatch(e){if(this.isHotkeysBlocked)return;const t=this.keyMap.get(e)??[];for(const e of t)if(this.applicationStore.commandCenter.runCommand(e))return}}var It,vt;!function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(It=It||(It={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(vt=vt||(vt={}));const Rt=6e3;var Pt;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(Pt=Pt||(Pt={}));class wt{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class Lt{config;pluginManager;navigator;navigationContextService;notification;blockingAlertInfo;actionAlertInfo;log=new p;documentationService;assistantService;eventService=new Nt;telemetryService=new lt;tracerService=new ht;commandCenter;keyboardShortcutsService;backdropContainerElementID;showBackdrop=!1;TEMPORARY__isLightThemeEnabled=!1;constructor(e,t,s){(0,O.rC)(this,{notification:O.LO,blockingAlertInfo:O.LO,actionAlertInfo:O.LO,TEMPORARY__isLightThemeEnabled:O.LO,backdropContainerElementID:O.LO,showBackdrop:O.LO,setBackdropContainerElementID:O.aD,setShowBackdrop:O.aD,setBlockingAlert:O.aD,setActionAlertInfo:O.aD,setNotification:O.aD,notify:O.aD,notifySuccess:O.aD,notifyWarning:O.aD,notifyIllegalState:O.aD,notifyError:O.aD,TEMPORARY__setIsLightThemeEnabled:O.aD}),this.config=e,this.navigator=t,this.pluginManager=s,this.log.registerPlugins(s.getLoggerPlugins()),this.navigationContextService=new At(this),this.documentationService=new qe(this),this.assistantService=new xt(this),this.telemetryService.registerPlugins(s.getTelemetryServicePlugins()),this.commandCenter=new St(this),this.keyboardShortcutsService=new yt(this),this.tracerService.registerPlugins(s.getTracerServicePlugins()),this.eventService.registerEventNotifierPlugins(s.getEventNotifierPlugins())}TEMPORARY__setIsLightThemeEnabled(e){this.TEMPORARY__isLightThemeEnabled=e}setBackdropContainerElementID(e){this.backdropContainerElementID=e}setShowBackdrop(e){this.showBackdrop=e}setBlockingAlert(e){e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.blockingAlertInfo=e}setActionAlertInfo(e){this.actionAlertInfo&&e&&this.notifyIllegalState("Action alert is stacked: new alert is invoked while another one is being displayed"),e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.actionAlertInfo=e}setNotification(e){this.notification=e}notify(e,t,s){this.setNotification(new wt(Pt.INFO,e,t??[],null===s?void 0:s??Rt))}notifySuccess(e,t,s){this.setNotification(new wt(Pt.SUCCESS,e,t??[],null===s?void 0:s??Rt))}notifyWarning(e,t,s){this.setNotification(new wt(Pt.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??Rt))}notifyIllegalState(e,t,s){this.setNotification(new wt(Pt.ILEGAL_STATE,X(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??Rt))}notifyError(e,t){let s;e instanceof D?s=e.detail:e instanceof Error?s=e.message:(Z(X(e),"Can't display error"),s=e),s&&this.setNotification(new wt(Pt.ERROR,s,t??[],void 0))}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return j(e),this.notifyIllegalState(e.message),t}};alertUnhandledError=e=>{this.log.error(h.create(_e.ILLEGAL_APPLICATION_STATE_OCCURRED),"Encountered unhandled error in component tree",e),this.notifyIllegalState(e.message)};guardUnhandledError=e=>()=>{e().catch(this.alertUnhandledError)};async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.notifyError(e)}))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}}const bt=(0,it.createContext)(void 0),Dt=({children:e,config:t,pluginManager:s})=>{const i=B((0,it.useContext)(rt),"Can't find web application navigator in context"),n=(0,st.fv)((()=>new Lt(t,i,s)));return(0,x.jsx)(bt.Provider,{value:n,children:e})},Mt=()=>B((0,it.useContext)(bt),"Can't find application store in context");class kt{appName;baseUrl;env;documentationUrl;documentationRegistryEntries=[];keyedDocumentationEntries=[];contextualDocEntries=[];appVersion;appVersionBuildTime;appVersionCommitId;constructor(e){var t;this.baseUrl=e.baseUrl,this.appName=K(e.configData.appName,"Can't configure application: 'appName' field is missing or empty"),this.env=K(e.configData.env,"Can't configure application: 'env' field is missing or empty"),this.documentationUrl=e.configData.documentation?.url,this.documentationRegistryEntries=e.configData.documentation?.registry??[],this.keyedDocumentationEntries=Xe(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=B(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=B(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=B(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}}class Ft extends kt{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),z(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=K(e.configData.pure.url,"Can't configure application: 'pure.url' field is missing or empty"),void 0!==e.configData.pure.dynamic&&(this.useDynamicPureServer=Boolean(e.configData.pure.dynamic))}}class jt extends d{loggerPlugins=[];telemetryServicePlugins=[];tracerServicePlugins=[];eventNotifierPlugins=[];applicationPlugins=[];registerLoggerPlugin(e){this.loggerPlugins.push(e)}registerTelemetryServicePlugin(e){this.telemetryServicePlugins.push(e)}registerTracerServicePlugin(e){this.tracerServicePlugins.push(e)}registerEventNotifierPlugin(e){this.eventNotifierPlugins.push(e)}registerApplicationPlugin(e){this.applicationPlugins.push(e)}getLoggerPlugins(){return[...this.loggerPlugins]}getTelemetryServicePlugins(){return[...this.telemetryServicePlugins]}getTracerServicePlugins(){return[...this.tracerServicePlugins]}getEventNotifierPlugins(){return[...this.eventNotifierPlugins]}getApplicationPlugins(){return[...this.applicationPlugins]}}class Ut extends jt{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new Ut}registerPureProtocolProcessorPlugin(e){this.pureProtocolProcessorPlugins.push(e)}registerPureGraphManagerPlugin(e){this.pureGraphManagerPlugins.push(e)}registerPureGraphPlugin(e){this.pureGraphPlugins.push(e)}getPureGraphManagerPlugins(){return[...this.pureGraphManagerPlugins]}getPureProtocolProcessorPlugins(){return[...this.pureProtocolProcessorPlugins]}getPureGraphPlugins(){return[...this.pureGraphPlugins]}}const Vt=JSON.parse('{"i8":"7.1.10","Rw":{"NA":"@finos/legend-graph-manager-preset-dsl-diagram","zE":"@finos/legend-pure-protocol-processor-plugin-dsl-diagram","LW":"@finos/legend-pure-graph-manager-plugin-dsl-diagram","f1":"@finos/legend-pure-graph-plugin-dsl-diagram"}}');class Gt extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const zt=e=>t=>(0,O.bi)(t)?t:e(t),Bt=e=>(t,s)=>(0,O.bi)(t)?t:e(t,s),$t=e=>{(0,O.rC)(e,{_isDeleted:O.LO,_isDisposed:O.LO,name:O.LO,package:O.LO,isDeleted:O.Fl,path:O.Fl,_elementHashCode:O.Fl,hashCode:O.Fl,setIsDeleted:O.aD,dispose:O.aD})},Ht=zt((e=>(0,O.rC)(e,{value:O.LO,valueForSerialization:O.Fl})));var Yt=s(34485),Wt=s(3096);const Kt=e=>Yt.sha1().update(e).digest("hex"),Zt=e=>Kt(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Kt(e):e.hashCode)).join(","));var Xt,qt;(qt=Xt=Xt||(Xt={})).PACKAGE="PACKAGE",qt.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",qt.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",qt.PROFILE="PROFILE",qt.TAG_POINTER="TAG_POINTER",qt.STEREOTYPE_POINTER="STEREOTYPE_POINTER",qt.TAGGED_VALUE="TAGGED_VALUE",qt.ENUMERATION="ENUMERATION",qt.ENUM_VALUE="ENUM_VALUE",qt.CLASS="CLASS",qt.PROPERTY="PROPERTY",qt.PROPERTY_POINTER="PROPERTY_POINTER",qt.MULTIPLICITY="MULTIPLICITY",qt.CONSTRAINT="CONSTRAINT",qt.DERIVED_PROPERTY="DERIVED_PROPERTY",qt.ASSOCIATION="ASSOCIATION",qt.FUNCTION="FUNCTION",qt.MEASURE="MEASURE",qt.UNIT="UNIT",qt.RUNTIME="RUNTIME",qt.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",qt.ENGINE_RUNTIME="ENGINE_RUNTIME",qt.LEGACY_RUNTIME="LEGACY_RUNTIME",qt.RUNTIME_POINTER="RUNTIME_POINTER",qt.STORE_CONNECTIONS="STORE_CONNECTIONS",qt.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",qt.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",qt.CONNECTION_POINTER="CONNECTION_POINTER",qt.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",qt.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",qt.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",qt.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",qt.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",qt.FLAT_DATA="FLAT_DATA",qt.FLAT_DATA_SECTION="FLAT_DATA_SECTION",qt.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",qt.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",qt.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",qt.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",qt.FLAT_DATA_STRING="FLAT_DATA_STRING",qt.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",qt.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",qt.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",qt.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",qt.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",qt.FLAT_DATA_DATE="FLAT_DATA_DATE",qt.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",qt.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",qt.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",qt.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",qt.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",qt.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",qt.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",qt.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER",qt.DATABASE="DATABASE",qt.DATABASE_SCHEMA="DATABASE_SCHEMA",qt.DATABASE_JOIN="DATABASE_JOIN",qt.DATABASE_FILTER="DATABASE_FILTER",qt.DATBASE_VIEW="DATBASE_VIEW",qt.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",qt.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",qt.RELATIONAL="RELATIONAL",qt.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",qt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",qt.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",qt.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",qt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",qt.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",qt.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",qt.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",qt.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",qt.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",qt.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",qt.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",qt.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",qt.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",qt.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",qt.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",qt.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",qt.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",qt.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",qt.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",qt.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",qt.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",qt.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",qt.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",qt.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",qt.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",qt.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",qt.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",qt.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",qt.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",qt.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",qt.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",qt.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",qt.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",qt.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",qt.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",qt.BUSINESS_MILESTONING="BUSINESS_MILESTONING",qt.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",qt.PROCESSING_MILESTONING="PROCESSING_MILESTONING",qt.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",qt.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",qt.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",qt.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",qt.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",qt.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",qt.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",qt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",qt.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",qt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",qt.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",qt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",qt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",qt.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",qt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",qt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",qt.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",qt.SCHEMA_MAPPER="SCHEMA_MAPPER",qt.TABLE_MAPPER="TABLE_MAPPER",qt.MAPPING="MAPPING",qt.MAPPING_INCLUDE="MAPPING_INCLUDE",qt.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",qt.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",qt.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",qt.ENUMERATION_MAPPING="ENUMERATION_MAPPING",qt.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",qt.SET_IMPLEMENTATION="SET_IMPLEMENTATION",qt.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",qt.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",qt.PROPERTY_MAPPING="PROPERTY_MAPPING",qt.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",qt.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",qt.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",qt.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",qt.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",qt.MAPPING_TEST="MAPPING_TEST",qt.STORE_TEST_DATA="STORE_TEST_DATA",qt.INPUT_DATA="INPUT_DATA",qt.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",qt.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",qt.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",qt.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",qt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",qt.FILTER_MAPPING="FILTER_MAPPING",qt.COLUMN_MAPPING="COLUMN_MAPPING",qt.GROUP_BY_MAPPING="GROUP_BY_MAPPING",qt.SERVICE="SERVICE",qt.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",qt.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",qt.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",qt.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",qt.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",qt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",qt.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",qt.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",qt.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",qt.SERVICE_TEST_DATA="SERVICE_TEST_DATA",qt.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",qt.SERVICE_TEST="SERVICE_TEST",qt.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",qt.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",qt.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",qt.GENERATION_TREE="GENERATION_TREE",qt.GENERATION_TREE_NODE="GENERATION_TREE_NODE",qt.FILE_GENERATION="FILE_GENERATION",qt.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",qt.SECTION_INDEX="SECTION_INDEX",qt.SECTION="SECTION",qt.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",qt.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",qt.RAW_LAMBDA="RAW_LAMBDA",qt.RAW_VARIABLE="RAW_VARIABLE",qt.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",qt.BINDING_TRANSFORMER="BINDING_TRANSFORMER",qt.ASSERT_FAIL="ASSERT_FAIL",qt.ASSERT_PASS="ASSERT_PASS",qt.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",qt.EQUAL_TO="EQUAL_TO",qt.EQUAL_TO_JSON="EQUAL_TO_JSON",qt.EQUAL_TO_TDS="EQUAL_TO_TDS",qt.TEST_RESULT="TEST_RESULT",qt.TEST_ERROR="TEST_ERROR",qt.TEST_FAILED="TEST_FAILED",qt.TEST_PASSED="TEST_PASSED",qt.ATOMIC_TEST_ID="ATOMIC_TEST_ID",qt.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",qt.MODEL_STORE_DATA="MODEL_STORE_DATA",qt.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",qt.DATA_ELEMENT="DATA_ELEMENT",qt.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",qt.RELATIONAL_TDS="RELATIONAL_TDS",qt.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",qt.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",qt.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",qt.EXPRESSION="EXPRESSION",qt.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",qt.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",qt.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",qt.INSTANCE_VALUE="INSTANCE_VALUE",qt.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",qt.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",qt.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",qt.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",qt.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",qt.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",qt.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",qt.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",qt.FUNCTION_TYPE="FUNCTION_TYPE",qt.LAMBDA_FUNCTION="LAMBDA_FUNCTION",qt.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",qt.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",qt.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",qt.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",qt.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",qt.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",qt.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE";const Jt=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},Z(q(t=e),"Can't hash non-object value"),Wt(t,s);var t,s},Qt=(e,t)=>Zt([e?Jt(e):"",t?Jt(t):""]),es=(e,t)=>[Xt.PACKAGEABLE_ELEMENT_POINTER,e,t].map(Kt).join(",");class ts{stereotypes=[];taggedValues=[]}class ss extends ts{name}class is extends ss{_UUID=(0,a.Z)();_isDeleted=!1;_isDisposed=!1;package;constructor(e){super(),this.name=e}get isDeleted(){return this._isDeleted}setIsDeleted(e){this._isDeleted=e}get path(){if(!this.package)return this.name;const e=this.package.path;return e?`${e}::${this.name}`:this.name}dispose(){this._isDisposed=!0;try{this.hashCode}catch{}}get _elementHashCode(){return Zt([Xt.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new k(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class ns extends is{}class as extends ns{_subclasses=[];_generatedMilestonedProperties=[];properties=[];propertiesFromAssociations=[];derivedProperties=[];generalizations=[];constraints=[];dispose(){super.dispose(),this._subclasses=[],this.generalizations.forEach((e=>{const t=e.value.rawType;t._isDisposed||(t._subclasses=t._subclasses.filter((e=>!e._isDisposed)))}))}get _elementHashCode(){return Zt([Xt.CLASS,this.path,Zt(this.properties),Zt(this.derivedProperties),Zt(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),Zt(this.constraints),Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class rs extends ns{}class os extends rs{values=[];get _elementHashCode(){return Zt([Xt.ENUMERATION,this.path,Zt(this.values),Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class ls extends rs{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return Zt([Xt.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new F}}class cs extends ns{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return Zt([Xt.MEASURE,this.path,this.canonicalUnit??"",Zt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class ds extends is{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class hs{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return Zt([Xt.SECTION,this.parserName,Zt(this.elements.map((e=>e.valueForSerialization??"")))])}}class us extends hs{imports=[];get hashCode(){return Zt([Xt.IMPORT_AWARE_CODE_SECTION,super.hashCode,Zt(this.imports.map((e=>e.valueForSerialization??"")))])}}class ps extends hs{get hashCode(){return Zt([Xt.DEFAULT_CODE_SECTION,super.hashCode])}}class _s{_UUID=(0,a.Z)()}class ms extends _s{ownerReference;constructor(e){super(),this.ownerReference=e}}class gs extends _s{value;constructor(e){super(),this.value=e}}class Es extends gs{constructor(e){super(e)}static create(e){return new Es(e)}get valueForSerialization(){return this.value.path}}const fs=zt((e=>(0,O.rC)(e,{name:O.LO,value:O.LO.ref,hashCode:O.Fl}))),Ts=zt((e=>($t(e),(0,O.rC)(e,{type:O.LO,generationOutputPath:O.LO,scopeElements:O.LO,configurationProperties:O.LO,_elementHashCode:O.KG}),e.scopeElements.forEach((e=>{e instanceof gs&&Ht(e)})),e.configurationProperties.forEach(fs),e))),Cs=zt((e=>((0,O.rC)(e,{id:O.LO,hashCode:O.Fl}),Ht(e.generationElement),e))),xs=zt((e=>($t(e),(0,O.rC)(e,{generationNodes:O.LO,fileGenerations:O.LO,_elementHashCode:O.KG}),e.generationNodes.forEach(Cs),e.fileGenerations.forEach(Ht),e)));var Ns=s(67295),Os=s(72531);const As=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,Ss=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],ys=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,Ns.P)(e,void 0,s);return z(i,"Can't stringify lossless JSON value"),i})((0,Os.Q)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};class Is{}class vs extends Is{expectedOutput;constructor(e){super(),this.expectedOutput=ys(e)}get hashCode(){return Zt([Xt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class Rs{}class Ps extends Rs{mappings=[];connections=[];get hashCode(){return Zt([Xt.ENGINE_RUNTIME,Zt(this.mappings.map((e=>es(Pe.MAPPING,e.valueForSerialization??"")))),Zt(this.connections.filter((e=>e.storeConnections.length)))])}}class ws extends Rs{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return Zt([Xt.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class Ls{}class bs extends Ls{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return Zt([Xt.FLAT_DATA_INPUT_DATA,es(Pe.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var Ds,Ms,ks;(ks=Ds=Ds||(Ds={})).JSON="JSON",ks.XML="XML";class Fs extends Ls{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===Ds.JSON?ys(s):s}get hashCode(){return Zt([Xt.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(Ms=Ms||(Ms={}));class js extends Ls{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return Zt([Xt.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const Us=zt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),Ht(e.type),e))),Vs=zt((e=>(0,O.rC)(e,{body:O.LO.ref,parameters:O.LO.ref,hashCode:O.Fl}))),Gs=zt((e=>((0,O.rC)(e,{name:O.LO,multiplicity:O.LO,hashCode:O.Fl}),Ht(e.type),e)));class zs{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){Vs(e)}visit_RawVariableExpression(e){Gs(e)}visit_RawPrimitiveInstanceValue(e){Us(e)}}Bt(((e,t)=>(e.accept_RawValueSpecificationVisitor(new zs(t)),e)));class Bs{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class $s extends Bs{trueString;falseString;get hashCode(){return Zt([Xt.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class Hs extends Bs{get hashCode(){return Zt([Xt.FLAT_DATA_STRING])}}class Ys extends Bs{get hashCode(){return Zt([Xt.FLAT_DATA_NUMBER])}}class Ws extends Bs{dateFormat;timeZone;get hashCode(){return Zt([Xt.FLAT_DATA_DATE,this.dateFormat?Zt(this.dateFormat):"",this.timeZone??""])}}class Ks extends Bs{fields=[];get hashCode(){return Zt([Xt.FLAT_DATA_RECORD_TYPE,Zt(this.fields)])}}const Zs=Bt(((e,t)=>(Sr(e,t),(0,O.rC)(e,{flatData:O.LO,sectionName:O.LO,hashCode:O.Fl}),e))),Xs=zt((e=>((0,O.rC)(e,{label:O.LO,flatDataDataType:O.LO,optional:O.LO,address:O.LO,hashCode:O.Fl}),(e=>{e instanceof $s?(0,O.rC)(e,{trueString:O.LO,falseString:O.LO,hashCode:O.Fl}):e instanceof Hs||e instanceof Ys?(0,O.rC)(e,{hashCode:O.Fl}):e instanceof Ws?(0,O.rC)(e,{dateFormat:O.LO,timeZone:O.LO,hashCode:O.Fl}):e instanceof Ks&&zt(qs)(e)})(e.flatDataDataType),e)));function qs(e){return(0,O.rC)(e,{fields:O.LO,hashCode:O.Fl}),e.fields.forEach(Xs),e}zt(qs);const Js=zt(qs),Qs=zt((e=>((0,O.rC)(e,{name:O.LO,value:O.LO,hashCode:O.Fl}),e))),ei=zt((e=>((0,O.rC)(e,{driverId:O.LO,name:O.LO,sectionProperties:O.LO,recordType:O.LO,hashCode:O.Fl}),e.sectionProperties.forEach(Qs),e.recordType&&Js(e.recordType),e))),ti=(zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Ht(e.ownerReference),e))),zt((e=>($t(e),(0,O.rC)(e,{sections:O.LO,_elementHashCode:O.KG}),e.sections.forEach(ei),e)))),si=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),ii=Bt(((e,t)=>(br(e,t),(0,O.rC)(e,{filter:O.LO,hashCode:O.Fl}),si(e.sourceRootRecordType),e.filter&&Vs(e.filter),e))),ni=Bt(((e,t)=>(Sr(e,t),br(e,t),(0,O.rC)(e,{rootInstanceSetImplementation:O.LO,hashCode:O.Fl}),e))),ai=Bt(((e,t)=>(Sr(e,t),(0,O.rC)(e,{transformer:O.LO,transform:O.LO,hashCode:O.Fl}),Vs(e.transform),e))),ri=zt((e=>((0,O.rC)(e,{data:O.LO,hashCode:O.Fl}),Ht(e.sourceFlatData),e))),oi=zt((e=>((0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),e)));class li{}class ci extends li{serverPrincipal;get hashCode(){return Zt([Xt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class di extends li{get hashCode(){return Zt([Xt.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class hi extends li{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return Zt([Xt.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class ui extends li{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return Zt([Xt.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class pi extends li{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return Zt([Xt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class _i extends li{get hashCode(){return Zt([Xt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class mi extends li{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return Zt([Xt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,Zt(this.additionalGcpScopes)])}}class gi extends li{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return Zt([Xt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class Ei extends li{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return Zt([Xt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class fi{}class Ti extends fi{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return Zt([Xt.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class Ci extends fi{hostname;port;protocol;httpPath;constructor(e,t,s,i){super(),this.hostname=e,this.port=t,this.protocol=s,this.httpPath=i}get hashCode(){return Zt([Xt.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class xi extends fi{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return Zt([Xt.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class Ni extends fi{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return Zt([Xt.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",Zt(this.testDataSetupSqls)])}}class Oi extends fi{accountName;region;warehouseName;databaseName;cloudType;quotedIdentifiersIgnoreCase;proxyHost;proxyPort;nonProxyHosts;organization;accountType;role;constructor(e,t,s,i){super(),this.region=t,this.warehouseName=s,this.databaseName=i,this.accountName=e}get hashCode(){return Zt([Xt.SNOWFLAKE_DATASOURCE_SPECIFICATION,this.accountName,this.region,this.warehouseName,this.databaseName,this.cloudType??"",this.proxyHost??"",this.proxyPort??"",this.nonProxyHosts??"",this.organization??"",this.accountType??"",this.role??"",this.quotedIdentifiersIgnoreCase?.toString()??""])}}class Ai extends fi{clusterID;databaseName;host;port;region;endpointURL;constructor(e,t,s,i,n,a){super(),this.clusterID=n,this.region=a,this.host=i,this.databaseName=e,this.endpointURL=t,this.port=s}get hashCode(){return Zt([Xt.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class Si extends fi{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return Zt([Xt.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class yi{_UUID=(0,a.Z)()}class Ii extends yi{mappers=[];get hashCode(){return Zt([Xt.MAPPER_POST_PROCESSOR,Zt(this.mappers)])}}const vi="{target}",Ri="default";class Pi{}class wi extends Pi{}class Li extends wi{}class bi extends Li{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return Zt([Xt.RELATIONAL_OPERATION_DYNA_FUNC,this.name,Zt(this.parameters)])}}var Di;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(Di=Di||(Di={}));const Mi=e=>[e].concat(e.children.length?Mi(e.children[0]):[]);class ki extends Pi{relationalOperationElement;joinTreeNode;get hashCode(){return Zt([Xt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,Zt(this.joinTreeNode?Mi(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class Fi extends Pi{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new F}}class ji extends Pi{alias;column;columnName;get hashCode(){return Zt([Xt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?vi:this.alias.name,this.column.value.name])}}class Ui extends Pi{value;constructor(e){super(),this.value=e}get hashCode(){return Zt([Xt.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class Vi extends Pi{values=[];get hashCode(){return Zt([Xt.RELATIONAL_OPERATION_LITERAL_LIST,Zt(this.values)])}}class Gi extends Pi{owner;name;type;nullable;get hashCode(){return Zt([Xt.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class zi{}class Bi extends zi{infinityDate}class $i{}class Hi extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_BIGINT])}}class Yi extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_SMALLINT])}}class Wi extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_TINYINT])}}class Ki extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_INTEGER])}}class Zi extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_FLOAT])}}class Xi extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_DOUBLE])}}class qi extends $i{size;constructor(e){super(),this.size=e}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class Ji extends $i{size;constructor(e){super(),this.size=e}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class Qi extends $i{size;constructor(e){super(),this.size=e}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class en extends $i{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class tn extends $i{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class sn extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_TIMESTAMP])}}class nn extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_VARCHAR])}}class an extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_BIT])}}class rn extends $i{size;constructor(e){super(),this.size=e}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class on extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_REAL])}}class ln extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class cn extends ms{ownerReference;constructor(e){super(e),this.ownerReference=e}}class dn extends cn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Xt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Kt).join(",")}get selfJoinPointerHashCode(){return[Xt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Ri,vi].map(Kt).join(",")}}class hn extends cn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Xt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Kt).join(",")}get selfJoinPointerHashCode(){return[Xt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Ri,vi].map(Kt).join(",")}}class un{}class pn extends un{_UUID=(0,a.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return Zt([this.from,this.to])}}class _n extends pn{get hashCode(){return Zt([super.hashCode,Xt.SCHEMA_MAPPER])}}class mn extends pn{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return Zt([super.hashCode,Xt.TABLE_MAPPER,this.schema])}}const gn=zt((e=>((0,O.rC)(e,{packageableElementIncludes:O.LO,packageableElementExcludes:O.LO,hashCode:O.Fl}),e.packageableElementIncludes.forEach(Ht),e.packageableElementExcludes.forEach(Ht),e))),En=(zt((e=>(fr(e),(0,O.rC)(e,{schemaSet:O.LO,schemaId:O.LO,contentType:O.LO,modelUnit:O.LO,_elementHashCode:O.KG}),e.schemaSet&&Ht(e.schemaSet),gn(e.modelUnit),e))),zt((e=>((0,O.rC)(e,{binding:O.LO,hashCode:O.Fl}),Ht(e.binding),e)))),fn=zt((e=>((0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),e))),Tn=(zt((e=>(qr(e),(0,O.rC)(e,{externalSource:O.LO,hashCode:O.Fl}),fn(e.externalSource),e))),zt((e=>(0,O.rC)(e,{id:O.LO,location:O.LO,content:O.LO,hashCode:O.Fl})))),Cn=(zt((e=>($t(e),(0,O.rC)(e,{format:O.LO,schemas:O.LO,_elementHashCode:O.KG}),e.schemas.forEach(Tn),e))),zt((e=>e instanceof Hi||e instanceof Yi||e instanceof Wi||e instanceof Ki||e instanceof Zi||e instanceof Xi||e instanceof sn||e instanceof Date||e instanceof nn||e instanceof an||e instanceof on||e instanceof ln?(0,O.rC)(e,{hashCode:O.Fl}):e instanceof qi||e instanceof Ji||e instanceof Qi||e instanceof rn?(0,O.rC)(e,{size:O.LO,hashCode:O.Fl}):e instanceof en||e instanceof tn?(0,O.rC)(e,{precision:O.LO,scale:O.LO,hashCode:O.Fl}):e))),xn=zt((e=>((0,O.rC)(e,{name:O.LO,type:O.LO,nullable:O.LO,hashCode:O.Fl}),Cn(e.type),e))),Nn=zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl,selfJoinPointerHashCode:O.Fl}),Ht(e.ownerReference),e))),On=zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl,selfJoinPointerHashCode:O.Fl}),Ht(e.ownerReference),e))),An=zt((e=>((0,O.rC)(e,{relation:O.LO,name:O.LO,database:O.LO,isSelfJoinTarget:O.LO}),(e=>{e instanceof hn?On(e):e instanceof dn&&Nn(e)})(e.relation),e))),Sn=zt((e=>((0,O.rC)(e,{name:O.LO,parameters:O.LO,hashCode:O.Fl}),e.parameters.forEach(bn),e))),yn=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),In=zt((e=>((0,O.rC)(e,{alias:O.LO,column:O.LO,columnName:O.LO,hashCode:O.Fl}),An(e.alias),yn(e.column),e))),vn=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),Rn=zt((e=>((0,O.rC)(e,{alias:O.LO,children:O.LO,joinType:O.LO,hashCode:O.Fl}),e.alias&&An(e.alias),e.children.forEach(Rn),vn(e.join),e))),Pn=zt((e=>((0,O.rC)(e,{relationalOperationElement:O.LO,joinTreeNode:O.LO,hashCode:O.Fl}),e.relationalOperationElement&&bn(e.relationalOperationElement),e.joinTreeNode&&Rn(e.joinTreeNode),e))),wn=zt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),e.value instanceof Pi&&bn(e.value),e))),Ln=zt((e=>((0,O.rC)(e,{values:O.LO,hashCode:O.Fl}),e.values.forEach(wn),e)));function bn(e){return e instanceof bi?Sn(e):e instanceof Fi?An(e):e instanceof ji?In(e):e instanceof Gi?xn(e):e instanceof Ui?wn(e):e instanceof Vi?Ln(e):e instanceof ki?Pn(e):e}const Dn=zt((e=>e)),Mn=Bt(((e,t)=>{if(e instanceof Bi)return Dn(e);const s=t.plugins.flatMap((e=>e.getExtraMilestoningObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})),kn=zt((e=>((0,O.rC)(e,{columnName:O.LO,relationalOperationElement:O.LO,hashCode:O.Fl}),bn(e.relationalOperationElement),e))),Fn=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),jn=zt((e=>((0,O.rC)(e,{joinTreeNode:O.LO,database:O.LO,filterName:O.LO,hashCode:O.Fl}),e.joinTreeNode&&Rn(e.joinTreeNode),Fn(e.filter),e))),Un=zt((e=>((0,O.rC)(e,{columns:O.LO}),e.columns.forEach(bn),e))),Vn=e=>{(0,O.rC)(e,{columns:O.LO,name:O.LO})},Gn=Bt(((e,t)=>(Vn(e),(0,O.rC)(e,{primaryKey:O.LO,hashCode:O.Fl}),e.primaryKey.forEach(xn),e.milestoning.forEach((e=>Mn(e,t))),e))),zn=Bt(((e,t)=>(Vn(e),(0,O.rC)(e,{primaryKey:O.LO,columnMappings:O.LO,filter:O.LO,distinct:O.LO,groupBy:O.LO,hashCode:O.Fl}),e.primaryKey.forEach(xn),e.columnMappings.forEach(kn),e.filter&&jn(e.filter),e.groupBy&&Un(e.groupBy),e))),Bn=Bt(((e,t)=>((0,O.rC)(e,{name:O.LO,tables:O.LO,views:O.LO,hashCode:O.Fl}),e.tables.forEach((e=>Gn(e,t))),e.views.forEach((e=>zn(e,t))),e))),$n=zt((e=>((0,O.rC)(e,{name:O.LO,operation:O.LO,hashCode:O.Fl}),bn(e.operation),e))),Hn=zt((e=>((0,O.rC)(e,{name:O.LO,target:O.LO,aliases:O.LO,operation:O.LO,hashCode:O.Fl}),e.target&&An(e.target),bn(e.operation),e))),Yn=Bt(((e,t)=>($t(e),(0,O.rC)(e,{schemas:O.LO,joins:O.LO,filters:O.LO,_elementHashCode:O.KG}),e.schemas.forEach((e=>Bn(e,t))),e.joins.forEach(Hn),e.filters.forEach($n),e))),Wn=Bt(((e,t)=>(Sr(e,t),(0,O.rC)(e,{transformer:O.LO,relationalOperation:O.LO.ref,bindingTransformer:O.LO,hashCode:O.Fl}),e.bindingTransformer&&En(e.bindingTransformer),e))),Kn=(e,t)=>(br(e,t),Sr(e,t),(0,O.rC)(e,{id:O.LO,rootInstanceSetImplementation:O.LO,primaryKey:O.LO}),e.primaryKey.forEach(bn),e),Zn=Bt(Kn),Xn=Bt(((e,t)=>(Kn(e,t),(0,O.rC)(e,{inlineSetImplementation:O.LO}),Vr(e.inlineSetImplementation,t),e))),qn=Bt(((e,t)=>(Kn(e,t),(0,O.rC)(e,{otherwisePropertyMapping:O.LO,hashCode:O.Fl}),vr(e.otherwisePropertyMapping,t),e))),Jn=Bt(((e,t)=>(br(e,t),(0,O.rC)(e,{primaryKey:O.LO}),e.primaryKey.forEach(bn),e))),Qn=Bt(((e,t)=>(br(e,t),(0,O.rC)(e,{columnMappings:O.LO,filter:O.LO,distinct:O.LO,groupBy:O.LO,mainTableAlias:O.LO,superSetImplementationId:O.LO,hashCode:O.Fl}),e.columnMappings.forEach(kn),e.filter&&jn(e.filter),e.groupBy&&Un(e.groupBy),e.mainTableAlias&&An(e.mainTableAlias),e))),ea=zt((e=>((0,O.rC)(e,{data:O.LO,inputType:O.LO,hashCode:O.Fl}),Ht(e.database),e))),ta=zt((e=>(0,O.rC)(e,{host:O.LO,port:O.LO,databaseName:O.LO,hashCode:O.Fl}))),sa=zt((e=>(0,O.rC)(e,{hostname:O.LO,port:O.LO,protocol:O.LO,httpPath:O.LO,hashCode:O.Fl}))),ia=zt((e=>(0,O.rC)(e,{databaseName:O.LO,directory:O.LO,autoServerMode:O.LO,hashCode:O.Fl}))),na=zt((e=>(0,O.rC)(e,{testDataSetupCsv:O.LO,testDataSetupSqls:O.LO,hashCode:O.Fl}))),aa=zt((e=>(0,O.rC)(e,{accountName:O.LO,region:O.LO,warehouseName:O.LO,databaseName:O.LO,cloudType:O.LO,quotedIdentifiersIgnoreCase:O.LO,proxyHost:O.LO,proxyPort:O.LO,nonProxyHosts:O.LO,organization:O.LO,accountType:O.LO,role:O.LO,hashCode:O.Fl}))),ra=zt((e=>(0,O.rC)(e,{databaseName:O.LO,endpointURL:O.LO,port:O.LO,region:O.LO,clusterID:O.LO,host:O.LO,hashCode:O.Fl}))),oa=zt((e=>(0,O.rC)(e,{projectId:O.LO,defaultDataset:O.LO,proxyHost:O.LO,proxyPort:O.LO,hashCode:O.Fl}))),la=zt((e=>(0,O.rC)(e,{serverPrincipal:O.LO,hashCode:O.Fl}))),ca=zt((e=>(0,O.rC)(e,{hashCode:O.Fl}))),da=zt((e=>(0,O.rC)(e,{apiToken:O.LO,hashCode:O.Fl}))),ha=zt((e=>(0,O.rC)(e,{oauthKey:O.LO,scopeName:O.LO,hashCode:O.Fl}))),ua=zt((e=>(0,O.rC)(e,{privateKeyVaultReference:O.LO,passPhraseVaultReference:O.LO,publicUserName:O.LO,hashCode:O.Fl}))),pa=zt((e=>(0,O.rC)(e,{hashCode:O.Fl}))),_a=zt((e=>(0,O.rC)(e,{hashCode:O.Fl,userNameVaultReference:O.LO,passwordVaultReference:O.LO,baseVaultReference:O.LO}))),ma=zt((e=>(0,O.rC)(e,{hashCode:O.Fl,serviceAccountEmail:O.LO,additionalGcpScopes:O.LO}))),ga=zt((e=>(0,O.rC)(e,{hashCode:O.Fl,vaultReference:O.LO}))),Ea=e=>{(0,O.rC)(e,{from:O.LO,to:O.LO,hashCode:O.Fl})},fa=zt((e=>(Ea(e),e))),Ta=zt((e=>(Ea(e),(0,O.rC)(e,{schema:O.LO}),fa(e.schema),e))),Ca=Bt(((e,t)=>((e=>{qr(e),(0,O.rC)(e,{type:O.LO,timeZone:O.LO,quoteIdentifiers:O.LO})})(e),(0,O.rC)(e,{datasourceSpecification:O.LO,authenticationStrategy:O.LO,postProcessors:O.LO,hashCode:O.Fl}),((e,t)=>{if(e instanceof Ti)return ta(e);if(e instanceof Ci)return sa(e);if(e instanceof xi)return ia(e);if(e instanceof Ni)return na(e);if(e instanceof Oi)return aa(e);if(e instanceof Ai)return ra(e);if(e instanceof Si)return oa(e);const s=t.plugins.flatMap((e=>e.getExtraDatasourceSpecificationObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.datasourceSpecification,t),((e,t)=>{if(e instanceof ci)return la(e);if(e instanceof di)return ca(e);if(e instanceof hi)return da(e);if(e instanceof ui)return ha(e);if(e instanceof pi)return ua(e);if(e instanceof _i)return pa(e);if(e instanceof gi)return _a(e);if(e instanceof mi)return ma(e);if(e instanceof Ei)return ga(e);const s=t.plugins.flatMap((e=>e.getExtraAuthenticationStrategyObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.authenticationStrategy,t),e.postProcessors.forEach((e=>{((e,t)=>{if(e instanceof Ii)return(e=>((e=>{(0,O.rC)(e,{hashCode:O.Fl})})(e),(0,O.rC)(e,{mappers:O.LO}),e.mappers.forEach((e=>{(e=>{e instanceof _n?fa(e):e instanceof mn&&Ta(e)})(e)})),e))(e);const s=t.plugins.flatMap((e=>e.getExtraPostProcessorObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e,t)})),e)));class xa{id}class Na extends xa{__parent;assertions=[]}class Oa extends xa{__parent;tests=[]}class Aa extends Na{serializationFormat;parameters=[];keys=[];get hashCode(){return Zt([Xt.SERVICE_TEST,this.id,Zt(this.assertions),Zt(this.parameters),Zt(this.keys),this.serializationFormat??""])}}class Sa extends Na{query;get hashCode(){return Zt([Xt.MAPPING_TEST,this.query,this.id,Zt(this.assertions)])}}class ya extends Oa{storeTestDatas=[];get hashCode(){return Zt([Xt.MAPPING_TEST_SUITE,Zt(this.storeTestDatas),this.id,Zt(this.tests)])}}class Ia extends Oa{testData;get hashCode(){return Zt([Xt.SERVICE_TEST_SUITE,this.id,Zt(this.tests),this.testData])}}class va{id;parentTest}class Ra extends va{expected;get hashCode(){return Zt([Xt.EQUAL_TO,this.id,Jt(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class Pa extends va{expected;get hashCode(){return Zt([Xt.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class wa extends va{expected;get hashCode(){return Zt([Xt.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class La{}class ba extends La{dataElement;get hashCode(){return Zt([Xt.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class Da extends La{contentType;data;get hashCode(){return Zt([Xt.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class Ma extends La{instances;get hashCode(){return Zt([Xt.MODEL_STORE_DATA,Zt(Array.from(this.instances.keys()).map((e=>e.path))),Jt(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class ka extends La{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return Zt([Xt.RELATIONAL_CSV_DATA_TABLE,Zt(this.tables)])}}const Fa=zt((e=>((0,O.rC)(e,{contentType:O.LO,data:O.LO,hashCode:O.Fl}),e))),ja=zt((e=>((0,O.rC)(e,{dataElement:O.LO,hashCode:O.Fl}),e))),Ua=zt((e=>((0,O.rC)(e,{instances:O.LO,hashCode:O.Fl}),e))),Va=zt((e=>((0,O.rC)(e,{values:O.LO,table:O.LO,schema:O.LO,hashCode:O.Fl}),e))),Ga=zt((e=>((0,O.rC)(e,{tables:O.LO,hashCode:O.Fl}),e.tables.forEach(Va),e)));function za(e,t){if(e instanceof ba)return ja(e);if(e instanceof Da)return Fa(e);if(e instanceof Ma)return Ua(e);if(e instanceof ka)return Ga(e);const s=t.plugins.flatMap((e=>e.getExtraEmbeddedDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}const Ba=Bt(((e,t)=>($t(e),(0,O.rC)(e,{stereotypes:O.LO,taggedValues:O.LO,data:O.LO,_elementHashCode:O.KG}),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),za(e.data,t),e)));class $a{}class Ha extends $a{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return Zt([Xt.SERVICE_PURE_EXECUTION,this.func])}}class Ya extends Ha{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return Zt([Xt.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class Wa extends Ha{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return Zt([Xt.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,Zt(this.executionParameters)])}}class Ka{_OWNER;constructor(e){this._OWNER=e}}class Za extends Ka{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return Zt([Xt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,Zt(this.asserts)])}}class Xa extends Ka{tests=[];get hashCode(){return Zt([Xt.SERVICE_LEGACY_MULTI_EXECUTION_TEST,Zt(this.tests)])}}const qa=Bt(((e,t)=>((0,O.rC)(e,{connectionId:O.LO,testData:O.LO,hashCode:O.Fl}),za(e.testData,t),e))),Ja=zt((e=>((0,O.rC)(e,{name:O.LO,value:O.LO.ref,hashCode:O.Fl}),e))),Qa=zt((e=>((0,O.rC)(e,{assertion:O.LO,hashCode:O.Fl,id:O.LO}),Vs(e.assertion),e))),er=zt((e=>((0,O.rC)(e,{assertions:O.LO,description:O.LO,parameters:O.LO,hashCode:O.Fl}),e.assertions.forEach(Qa),e.parameters.forEach(Vs),e))),tr=Bt(((e,t)=>((0,O.rC)(e,{connectionsTestData:O.LO,hashCode:O.Fl}),e.connectionsTestData.forEach((e=>qa(e,t))),e))),sr=zt((e=>((0,O.rC)(e,{id:O.LO,serializationFormat:O.LO,assertions:O.LO,parameters:O.LO,keys:O.LO,hashCode:O.Fl}),e.parameters.forEach(Ja),e.assertions.forEach(Er),e))),ir=Bt(((e,t)=>((0,O.rC)(e,{id:O.LO,tests:O.LO,testData:O.LO,hashCode:O.Fl}),e.tests.forEach((e=>gr(e,t))),tr(e.testData,t),e))),nr=zt((e=>((0,O.rC)(e,{parametersValues:O.LO,assert:O.LO,singleExecutionTestParent:O.LO,hashCode:O.Fl}),Vs(e.assert),e))),ar=zt((e=>((0,O.rC)(e,{data:O.LO,asserts:O.LO,hashCode:O.Fl}),e.asserts.forEach(nr),e))),rr=zt((e=>(ar(e),(0,O.rC)(e,{key:O.LO}),e))),or=zt((e=>((0,O.rC)(e,{tests:O.LO,hashCode:O.Fl}),e.tests.forEach(rr),e))),lr=e=>{(0,O.rC)(e,{func:O.LO}),Vs(e.func)},cr=Bt(((e,t)=>(lr(e),(0,O.rC)(e,{runtime:O.LO,hashCode:O.Fl}),e.mapping&&Ht(e.mapping),e.runtime&&co(e.runtime,t),e))),dr=Bt(((e,t)=>((0,O.rC)(e,{key:O.LO,runtime:O.LO,hashCode:O.Fl}),Ht(e.mapping),co(e.runtime,t),e))),hr=Bt(((e,t)=>(lr(e),(0,O.rC)(e,{executionKey:O.LO,executionParameters:O.LO,hashCode:O.Fl}),e.executionParameters.forEach((e=>dr(e,t))),e))),ur=Bt(((e,t)=>($t(e),(0,O.rC)(e,{pattern:O.LO,owners:O.LO,documentation:O.LO,autoActivateUpdates:O.LO,execution:O.LO,test:O.LO,tests:O.LO,postValidations:O.LO,patternParameters:O.Fl,_elementHashCode:O.KG}),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),((e,t)=>{e instanceof Ya?cr(e,t):e instanceof Wa&&hr(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Za?ar(e):e instanceof Xa&&or(e)})(e.test),e.tests.forEach((e=>ir(e,t))),e.postValidations.forEach((e=>er(e))),e))),pr=zt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),e))),_r=zt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),Fa(e.expected),e))),mr=zt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),Fa(e.expected),e)));function gr(e,t){if(e instanceof Aa)return sr(e);if(e instanceof Sa)return Cr(e);const s=t.plugins.flatMap((e=>e.getExtraAtomicTestObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}function Er(e){return e instanceof Ra?pr(e):e instanceof Pa?mr(e):e instanceof wa?_r(e):e}const fr=e=>{$t(e),(0,O.rC)(e,{includes:O.LO}),e.includes.forEach(Ht)},Tr=Bt(((e,t)=>((0,O.rC)(e,{store:O.LO,data:O.LO,hashCode:O.Fl}),za(e.data,t),e))),Cr=zt((e=>((0,O.rC)(e,{id:O.LO,query:O.LO,assertions:O.LO,hashCode:O.Fl}),e.assertions.forEach(Er),e))),xr=Bt(((e,t)=>((0,O.rC)(e,{id:O.LO,tests:O.LO,storeTestDatas:O.LO,hashCode:O.Fl}),e.tests.forEach((e=>gr(e,t))),e.storeTestDatas.forEach((e=>Tr(e,t))),e))),Nr=zt((e=>((0,O.rC)(e,{value:O.LO,valueForSerialization:O.Fl}),Ht(e.ownerReference),e))),Or=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),Ar=zt((e=>((0,O.rC)(e,{localMappingProperty:O.LO,localMappingPropertyType:O.LO,localMappingPropertyMultiplicity:O.LO,hashCode:O.Fl}),Ht(e.localMappingPropertyType),e))),Sr=(e,t)=>{(0,O.rC)(e,{sourceSetImplementation:O.LO,targetSetImplementation:O.LO}),Lo(e.property),Or(e.sourceSetImplementation),e.targetSetImplementation&&Or(e.targetSetImplementation),e.localMappingProperty&&Ar(e.localMappingProperty)},yr=Bt(((e,t)=>(Sr(e,t),(0,O.rC)(e,{transformer:O.LO,transform:O.LO,explodeProperty:O.LO,hashCode:O.Fl}),e.transformer&&Nr(e.transformer),Vs(e.transform),e)));class Ir{observerContext;constructor(e){this.observerContext=e}visit_PropertyMapping(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraPropertyMappingObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_PurePropertyMapping(e){yr(e,this.observerContext)}visit_FlatDataPropertyMapping(e){ai(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){ni(e,this.observerContext)}visit_RelationalPropertyMapping(e){Wn(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){Zs(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){Zn(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){Xn(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){qn(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const vr=(e,t)=>(e.accept_PropertyMappingVisitor(new Ir(t)),e),Rr=zt((e=>(0,O.rC)(e,{isDefault:O.Fl,valueForSerialization:O.Fl}))),Pr=zt((e=>(0,O.rC)(e,{valueForSerialization:O.Fl}))),wr=e=>{(0,O.rC)(e,{root:O.LO}),Ht(e.class),Rr(e.id),Pr(e.root)},Lr=zt((e=>((0,O.rC)(e,{setImplementation:O.LO,class:O.LO,properties:O.LO}),e))),br=(e,t)=>{wr(e),(0,O.rC)(e,{mappingClass:O.LO,propertyMappings:O.LO}),e.mappingClass&&Lr(e.mappingClass),e.propertyMappings.forEach((e=>vr(e,t)))},Dr=zt((e=>((0,O.rC)(e,{}),Or(e.setImplementation),e))),Mr=e=>{wr(e),(0,O.rC)(e,{parameters:O.LO,operation:O.LO,hashCode:O.Fl}),e.parameters.forEach(Dr)},kr=zt((e=>(Mr(e),e))),Fr=zt((e=>(Mr(e),(0,O.rC)(e,{validationFunction:O.LO}),Vs(e.validationFunction),e))),jr=Bt(((e,t)=>(br(e,t),(0,O.rC)(e,{filter:O.LO,hashCode:O.Fl}),e.srcClass&&Ht(e.srcClass),e.filter&&Vs(e.filter),e)));class Ur{observerContext;constructor(e){this.observerContext=e}visit_SetImplementation(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraSetImplementationObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_MergeOperationSetImplementation(e){Fr(e)}visit_OperationSetImplementation(e){kr(e)}visit_PureInstanceSetImplementation(e){jr(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){ii(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){Jn(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){Qn(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Vr=(e,t)=>(e.accept_SetImplementationVisitor(new Ur(t)),e),Gr=zt((e=>((0,O.rC)(e,{original:O.LO,substitute:O.LO}),Ht(e.original),Ht(e.substitute),e))),zr=zt((e=>((0,O.rC)(e,{included:O.LO,storeSubstitutions:O.LO}),Ht(e.included),e.storeSubstitutions.forEach(Gr),e))),Br=zt((e=>(0,O.rC)(e,{value:O.LO}))),$r=zt((e=>((0,O.rC)(e,{sourceValues:O.LO,hashCode:O.Fl}),yo(e.enum),e.sourceValues.forEach(Br),e))),Hr=zt((e=>((0,O.rC)(e,{sourceType:O.LO,enumValueMappings:O.LO,hashCode:O.Fl}),Ht(e.enumeration),Rr(e.id),e.sourceType&&Ht(e.sourceType),e.enumValueMappings.forEach($r),e))),Yr=Bt(((e,t)=>((0,O.rC)(e,{id:O.LO,stores:O.LO,propertyMappings:O.LO,hashCode:O.Fl}),Ht(e.association),Rr(e.id),e.stores.forEach(Ht),e.propertyMappings.forEach((e=>vr(e,t))),e))),Wr=zt((e=>((0,O.rC)(e,{inputType:O.LO,data:O.LO,hashCode:O.Fl}),Ht(e.sourceClass),e))),Kr=zt((e=>(0,O.rC)(e,{expectedOutput:O.LO,hashCode:O.Fl}))),Zr=Bt(((e,t)=>((0,O.rC)(e,{name:O.LO,query:O.LO,inputData:O.LO,assert:O.LO,hashCode:O.Fl}),Vs(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof Fs)return Wr(e);if(e instanceof bs)return ri(e);if(e instanceof js)return ea(e);const s=t.plugins.flatMap((e=>e.getExtraMappingTestInputDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})(e,t))),((e,t)=>{e instanceof vs&&Kr(e)})(e.assert),e))),Xr=Bt(((e,t)=>($t(e),(0,O.rC)(e,{includes:O.LO,classMappings:O.LO,enumerationMappings:O.LO,associationMappings:O.LO,test:O.LO,tests:O.LO,_elementHashCode:O.KG}),e.includes.forEach(zr),e.classMappings.forEach((e=>Vr(e,t))),e.enumerationMappings.forEach(Hr),e.associationMappings.forEach((e=>Yr(e,t))),e.test.forEach((e=>Zr(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof Ia?ir(e,t):e instanceof ya?xr(e,t):e}(e,t))),e))),qr=e=>{(0,O.rC)(e,{store:O.LO}),Ht(e.store)},Jr=zt((e=>(qr(e),(0,O.rC)(e,{hashCode:O.Fl}),e))),Qr=zt((e=>(qr(e),(0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),Ht(e.class),e))),eo=zt((e=>(qr(e),(0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),Ht(e.class),e))),to=zt((e=>(qr(e),(0,O.rC)(e,{mappings:O.LO,hashCode:O.Fl}),e.mappings.forEach(Ht),e)));class so{observerContext;constructor(e){this.observerContext=e}visit_Connection(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraConnectionObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_ConnectionPointer(e){Jr(e)}visit_ModelChainConnection(e){to(e)}visit_JsonModelConnection(e){Qr(e)}visit_XmlModelConnection(e){eo(e)}visit_FlatDataConnection(e){oi(e)}visit_RelationalDatabaseConnection(e){Ca(e,this.observerContext)}}const io=(e,t)=>(e.accept_ConnectionVisitor(new so(t)),e),no=Bt(((e,t)=>($t(e),(0,O.rC)(e,{connectionValue:O.LO,_elementHashCode:O.KG}),io(e.connectionValue,t),e))),ao=Bt(((e,t)=>((0,O.rC)(e,{id:O.LO,connection:O.LO,hashCode:O.Fl}),io(e.connection,t),e))),ro=Bt(((e,t)=>((0,O.rC)(e,{storeConnections:O.LO,hashCode:O.Fl}),Ht(e.store),e.storeConnections.forEach((e=>ao(e,t))),e))),oo=Bt(((e,t)=>((0,O.rC)(e,{mappings:O.LO,connections:O.LO,hashCode:O.Fl}),e.mappings.forEach(Ht),e.connections.forEach((e=>ro(e,t))),e))),lo=zt((e=>((0,O.rC)(e,{hashCode:O.Fl}),Ht(e.packageableRuntime),e))),co=(e,t)=>e instanceof ws?lo(e):e instanceof Ps?oo(e,t):e,ho=Bt(((e,t)=>($t(e),(0,O.rC)(e,{runtimeValue:O.LO,_elementHashCode:O.KG}),oo(e.runtimeValue,t),e)));class uo{observerContext;constructor(e){this.observerContext=e}visit_PackageableElement(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraElementObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_Package(e){_o(e,this.observerContext)}visit_SectionIndex(e){xo(e)}visit_PrimitiveType(e){}visit_Profile(e){Ao(e)}visit_Enumeration(e){Io(e)}visit_Measure(e){Ro(e)}visit_Class(e){Do(e)}visit_Association(e){Mo(e)}visit_ConcreteFunctionDefinition(e){ko(e)}visit_FlatData(e){ti(e)}visit_Database(e){Yn(e,this.observerContext)}visit_Mapping(e){Xr(e,this.observerContext)}visit_Service(e){ur(e,this.observerContext)}visit_PackageableRuntime(e){ho(e,this.observerContext)}visit_PackageableConnection(e){no(e,this.observerContext)}visit_FileGenerationSpecification(e){Ts(e)}visit_GenerationSpecification(e){xs(e)}visit_DataElement(e){Ba(e,this.observerContext)}}const po=Bt(((e,t)=>(e.accept_PackageableElementVisitor(new uo(t)),e))),_o=Bt(((e,t)=>((e=>{$t(e),(0,O.rC)(e,{children:O.LO,hashCode:O.KG})})(e),e.children.forEach((e=>{e instanceof ds?_o(e,t):po(e,t)})),e))),mo=zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Ht(e.ownerReference),e))),go=zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),e))),Eo=zt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),go(e.tag),e))),fo=zt((e=>(0,O.rC)(e,{rawType:O.LO}))),To=zt((e=>((0,O.rC)(e,{value:O.LO}),fo(e.value),Ht(e.ownerReference),e))),Co=zt((e=>((0,O.rC)(e,{parserName:O.LO,elements:O.LO}),e instanceof us?(0,O.rC)(e,{imports:O.LO,hashCode:O.Fl}):e instanceof ps&&(0,O.rC)(e,{hashCode:O.Fl}),e))),xo=zt((e=>($t(e),(0,O.rC)(e,{sections:O.LO,_elementHashCode:O.KG}),e.sections.forEach(Co),e))),No=zt((e=>(0,O.rC)(e,{value:O.LO}))),Oo=zt((e=>(0,O.rC)(e,{value:O.LO}))),Ao=zt((e=>($t(e),(0,O.rC)(e,{p_stereotypes:O.LO,p_tags:O.LO,_elementHashCode:O.KG}),e.p_stereotypes.forEach(No),e.p_tags.forEach(Oo),e))),So=zt((e=>((0,O.rC)(e,{name:O.LO,stereotypes:O.LO,taggedValues:O.LO,hashCode:O.Fl}),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),yo=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),Io=zt((e=>($t(e),(0,O.rC)(e,{values:O.LO,stereotypes:O.LO,taggedValues:O.LO,_elementHashCode:O.KG}),e.values.forEach(So),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),vo=zt((e=>((0,O.rC)(e,{measure:O.LO,conversionFunction:O.LO,hashCode:O.Fl}),e.conversionFunction&&Vs(e.conversionFunction),e))),Ro=zt((e=>($t(e),(0,O.rC)(e,{canonicalUnit:O.LO,nonCanonicalUnits:O.LO,_elementHashCode:O.KG}),e.canonicalUnit&&vo(e.canonicalUnit),e.nonCanonicalUnits.forEach(vo),e))),Po=zt((e=>((0,O.rC)(e,{name:O.LO,multiplicity:O.LO,stereotypes:O.LO,taggedValues:O.LO,hashCode:O.Fl}),To(e.genericType),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),wo=zt((e=>((0,O.rC)(e,{name:O.LO,multiplicity:O.LO,stereotypes:O.LO,taggedValues:O.LO,body:O.LO.ref,parameters:O.LO.ref,hashCode:O.Fl}),To(e.genericType),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),Lo=zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Ht(e.ownerReference),e))),bo=zt((e=>((0,O.rC)(e,{name:O.LO,functionDefinition:O.LO,externalId:O.LO,enforcementLevel:O.LO,messageFunction:O.LO,hashCode:O.Fl}),Vs(e.functionDefinition),e.messageFunction&&Vs(e.messageFunction),e))),Do=zt((e=>($t(e),(0,O.rC)(e,{_subclasses:O.LO,properties:O.LO,propertiesFromAssociations:O.LO,derivedProperties:O.LO,generalizations:O.LO,constraints:O.LO,stereotypes:O.LO,taggedValues:O.LO,dispose:O.KG,_elementHashCode:O.KG}),e.properties.forEach(Po),e.propertiesFromAssociations.forEach(Po),e.derivedProperties.forEach(wo),e.generalizations.forEach(To),e.constraints.forEach(bo),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),Mo=zt((e=>($t(e),(0,O.rC)(e,{properties:O.LO,stereotypes:O.LO,taggedValues:O.LO,derivedProperties:O.LO,_elementHashCode:O.KG}),e.properties.forEach(Po),e.derivedProperties.forEach(wo),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),ko=zt((e=>($t(e),(0,O.rC)(e,{functionName:O.LO,returnMultiplicity:O.LO,parameters:O.LO.shallow,expressionSequence:O.LO.ref,stereotypes:O.LO,taggedValues:O.LO,_elementHashCode:O.KG}),e.parameters.forEach(Gs),Ht(e.returnType),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),Fo=zt((e=>e instanceof os?Io(e):e instanceof ls?vo(e):e instanceof as?Do(e):e instanceof cs?Ro(e):e)),jo=(zt((e=>e instanceof os?Io(e):e instanceof ls?vo(e):e)),zt((e=>(0,O.rC)(e,{_dummyObservable:O.LO})))),Uo=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),Vo=zt((e=>(jo(e),(0,O.rC)(e,{id:O.LO,hideProperties:O.LO,hideTaggedValues:O.LO,hideStereotypes:O.LO,hashCode:O.Fl}),Ht(e.class),e))),Go=zt((e=>(Uo(e.classView),e))),zo=zt((e=>((0,O.rC)(e,{path:O.LO,pathForSerialization:O.Fl}),Go(e.from),Go(e.to),e))),Bo=zt((e=>(zo(e),(0,O.rC)(e,{hashCode:O.Fl}),e))),$o=zt((e=>(zo(e),(0,O.rC)(e,{hashCode:O.Fl}),Lo(e.property),Ht(e.association),e))),Ho=zt((e=>(zo(e),(0,O.rC)(e,{hashCode:O.Fl}),Lo(e.property),e))),Yo=zt((e=>($t(e),(0,O.rC)(e,{classViews:O.LO,associationViews:O.LO,generalizationViews:O.LO,propertyViews:O.LO,_elementHashCode:O.KG}),e.classViews.forEach(Vo),e.associationViews.forEach($o),e.generalizationViews.forEach(Bo),e.propertyViews.forEach(Ho),e)));var Wo;!function(e){e.DIAGRAM="DIAGRAM",e.CLASS_VIEW="CLASS_VIEW",e.PROPERTY_VIEW="PROPERTY_VIEW",e.ASSOCIATION_VIEW="ASSOCIATION_VIEW",e.PROPERTY_HOLDER_VIEW="PROPERTY_HOLDER_VIEW",e.GENERALIZATION_VIEW="GENERALIZATION_VIEW",e.RELATIONSHIP_VIEW="RELATIONSHIP_VIEW",e.POINT="POINT",e.RECTANGLE="RECTANGLE",e.POSITIONED_RECTANGLE="POSITIONED_RECTANGLE"}(Wo=Wo||(Wo={}));class Ko extends is{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return Zt([Wo.DIAGRAM,this.path,Zt(this.classViews),Zt(this.generalizationViews),Zt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const Zo="Diagram";class Xo extends Gt{constructor(){super(Vt.Rw.LW,Vt.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[Zo]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof Ko)return Zo}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Ko)return Yo(e)}]}}class qo{package;name;get path(){return`${this.package}::${this.name}`}get hashCode(){return Zt([Xt.PACKAGEABLE_ELEMENT,this.path])}}class Jo extends qo{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return Zt([Wo.DIAGRAM,this.path,Zt(this.classViews),Zt(this.generalizationViews),Zt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class Qo{rectangle;position;get hashCode(){return Zt([Wo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class el extends Qo{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return Zt([Wo.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class tl{x;y;get hashCode(){return Zt([Wo.POINT,this.x.toString(),this.y.toString()])}}class sl{width;height;get hashCode(){return Zt([Wo.RECTANGLE,this.width.toString(),this.height.toString()])}}class il{points=[]}class nl{sourceView;targetView;line;get hashCode(){return Zt([Wo.RELATIONSHIP_VIEW,this.sourceView,this.targetView,Zt(this.line.points)])}}class al extends nl{property;get hashCode(){return Zt([Wo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class rl extends al{get hashCode(){return Zt([Wo.PROPERTY_VIEW,super.hashCode])}}class ol extends nl{get hashCode(){return Zt([Wo.GENERALIZATION_VIEW,super.hashCode])}}class ll{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Zt([Xt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new ll(0,0);static ZERO_ONE=new ll(0,1);static ZERO_MANY=new ll(0,void 0);static ONE=new ll(1,1);static ONE_MANY=new ll(1,void 0)}new Be((0,ze.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,ze.Ru)(),startLine:(0,ze.Ru)(),startColumn:(0,ze.Ru)(),endLine:(0,ze.Ru)(),endColumn:(0,ze.Ru)()})),(0,ze.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return Zt([Xt.PACKAGEABLE_ELEMENT_POINTER,this.type,this.path])}},{path:(0,ze.Ru)(),type:(0,ze.Ru)()});const cl=(0,ze.yu)(ll,{lowerBound:(0,ze.Ru)(),upperBound:(0,ze.jt)((0,ze.Ru)())});class dl{class;property;get hashCode(){return Zt([Xt.PROPERTY_POINTER,this.property,this.class??""])}}class hl{}class ul{queryTimeOutInSeconds=null;enableConstraints=!0}var pl,_l;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(pl||(pl={})),function(e){e.LAMBDA="lambda",e.VARIABLE="var",e.CINTEGER="integer",e.CDECIMAL="decimal",e.CSTRING="string",e.CBOOLEAN="boolean",e.CFLOAT="float",e.CDATETIME="dateTime",e.CSTRICTDATE="strictDate",e.CSTRICTTIME="strictTime",e.CLATESTDATE="latestDate"}(_l=_l||(_l={})),(0,ze.yu)(class extends ul{},{_type:We(pl.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,ze.Ru)(),enableConstraints:(0,ze.Ru)()});const ml=(0,ze.yu)(class extends hl{body;parameters;get hashCode(){return Zt([Xt.RAW_LAMBDA,Qt(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:We(_l.LAMBDA),body:(0,ze.LZ)(),parameters:(0,ze.LZ)()}),gl=(0,ze.yu)(class extends hl{class;name;multiplicity;get hashCode(){return Zt([Xt.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:We(_l.VARIABLE),class:(0,ze.Ru)(),multiplicity:$e(cl),name:(0,ze.Ru)()});(0,ze.yu)(class extends hl{multiplicity=ll.ONE;type;value;get hashCode(){return Zt([Xt.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,ze.bm)("_type",(0,ze.PG)((e=>{switch(e){case Te.INTEGER:return _l.CINTEGER;case Te.DECIMAL:return _l.CDECIMAL;case Te.STRING:return _l.CSTRING;case Te.BOOLEAN:return _l.CBOOLEAN;case Te.FLOAT:return _l.CFLOAT;case Te.DATETIME:return _l.CDATETIME;case Te.STRICTDATE:return _l.CSTRICTDATE;case Te.STRICTTIME:return _l.CSTRICTTIME;case Te.LATESTDATE:return _l.CLATESTDATE;default:throw new F(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case _l.CINTEGER:return Te.INTEGER;case _l.CDECIMAL:return Te.DECIMAL;case _l.CSTRING:return Te.STRING;case _l.CBOOLEAN:return Te.BOOLEAN;case _l.CFLOAT:return Te.FLOAT;case _l.CDATETIME:return Te.DATETIME;case _l.CSTRICTDATE:return Te.STRICTDATE;case _l.CSTRICTTIME:return Te.STRICTTIME;case _l.CLATESTDATE:return Te.LATESTDATE;default:throw new F(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,ze.jt)((0,ze.Ru)())});const El=(0,ze.yu)(dl,{class:(0,ze.jt)((0,ze.Ru)()),property:(0,ze.Ru)()}),fl=(0,ze.yu)(class{profile;value;get hashCode(){return Zt([Xt.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,ze.Ru)(),value:(0,ze.Ru)()}),Tl=(0,ze.yu)(class{profile;value;get hashCode(){return Zt([Xt.TAG_POINTER,this.value,this.profile])}},{profile:(0,ze.Ru)(),value:(0,ze.Ru)()}),Cl=(0,ze.yu)(class{tag;value;get hashCode(){return Zt([Xt.TAGGED_VALUE,this.tag,this.value])}},{tag:$e(Tl),value:(0,ze.Ru)()}),xl=((0,ze.yu)(class extends qo{stereotypes=[];tags=[];get hashCode(){return Zt([Xt.PROFILE,this.path,Zt(this.stereotypes),Zt(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:We("profile"),name:(0,ze.Ru)(),package:(0,ze.Ru)(),stereotypes:(0,ze.pb)((0,ze.Ru)()),tags:(0,ze.pb)((0,ze.Ru)())}),(0,ze.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return Zt([Xt.ENUM_VALUE,this.value,Zt(this.stereotypes),Zt(this.taggedValues)])}},{stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1}))),value:(0,ze.Ru)()})),Nl=((0,ze.yu)(class extends qo{values=[];stereotypes=[];taggedValues=[];get hashCode(){return Zt([Xt.ENUMERATION,this.path,Zt(this.values),Zt(this.stereotypes),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:We("Enumeration"),name:(0,ze.Ru)(),package:(0,ze.Ru)(),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1}))),values:(0,ze.pb)($e(xl))}),(0,ze.yu)(class extends qo{measure;conversionFunction;get hashCode(){return Zt([Xt.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new F}},{_type:We("unit"),conversionFunction:(0,ze.jt)($e(ml)),measure:(0,ze.Ru)(),name:(0,ze.Ru)(),package:(0,ze.Ru)()})),Ol=((0,ze.yu)(class extends qo{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return Zt([Xt.MEASURE,this.path,this.canonicalUnit??"",Zt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:We("measure"),canonicalUnit:(0,ze.jt)($e(Nl)),name:(0,ze.Ru)(),nonCanonicalUnits:(0,ze.pb)($e(Nl)),package:(0,ze.Ru)()}),(0,ze.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return Zt([Xt.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",Zt(this.stereotypes),Zt(this.taggedValues)])}},{aggregation:(0,ze.jt)((0,ze.Ru)()),multiplicity:$e(cl),name:(0,ze.Ru)(),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1}))),type:(0,ze.Ru)()})),Al=(0,ze.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return Zt([Xt.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,Zt(this.stereotypes),Zt(this.taggedValues),Qt(this.parameters,this.body)])}},{body:(0,ze.LZ)(),name:(0,ze.Ru)(),parameters:(0,ze.LZ)(),returnMultiplicity:$e(cl),returnType:(0,ze.Ru)(),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1})))}),Sl=(0,ze.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return Zt([Xt.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,ze.jt)((0,ze.Ru)()),externalId:(0,ze.jt)((0,ze.Ru)()),functionDefinition:$e(ml),messageFunction:(0,ze.jt)($e(ml)),name:(0,ze.Ru)()}),yl=((0,ze.yu)(class extends qo{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return Zt([Xt.CLASS,this.path,Zt(this.properties),Zt(this.derivedProperties),Zt(this.superTypes),Zt(this.constraints),Zt(this.stereotypes),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:We("class"),constraints:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Sl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Sl,e)),{skipIfEmpty:!1}))),name:(0,ze.Ru)(),originalMilestonedProperties:(0,ze.PG)((e=>Ye(e,(e=>ze.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>ze.AM),{skipIfEmpty:!1}))),package:(0,ze.Ru)(),properties:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Ol,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Ol,e)),{skipIfEmpty:!1}))),derivedProperties:(0,ze.bm)("qualifiedProperties",(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Al,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Al,e)),{skipIfEmpty:!1})))),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),superTypes:(0,ze.PG)((e=>Ye(e,(e=>e),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>e),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1})))}),(0,ze.yu)(class extends qo{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return Zt([Xt.ASSOCIATION,this.path,Zt(this.properties),Zt(this.derivedProperties),Zt(this.stereotypes),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:We("association"),name:(0,ze.Ru)(),originalMilestonedProperties:(0,ze.PG)((e=>Ye(e,(e=>ze.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>ze.AM),{skipIfEmpty:!1}))),package:(0,ze.Ru)(),properties:(0,ze.pb)($e(Ol)),derivedProperties:(0,ze.bm)("qualifiedProperties",(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Al,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Al,e)),{skipIfEmpty:!1})))),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1})))}),(0,ze.yu)(class extends qo{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return Zt([Xt.FUNCTION,this.path,Zt(this.parameters),this.returnType,Zt(this.taggedValues),Zt(this.stereotypes),Qt(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:We("function"),body:(0,ze.pb)((0,ze.LZ)()),name:(0,ze.Ru)(),package:(0,ze.Ru)(),parameters:(0,ze.pb)($e(gl)),postConstraints:(0,ze.pb)((0,ze.Ru)()),preConstraints:(0,ze.pb)((0,ze.Ru)()),returnMultiplicity:$e(cl),returnType:(0,ze.Ru)(),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1})))}),"diagram"),Il=(0,ze.yu)(tl,{x:(0,ze.Ru)(),y:(0,ze.Ru)()}),vl=(0,ze.yu)(sl,{height:(0,ze.Ru)(),width:(0,ze.Ru)()}),Rl=(0,ze.yu)(il,{points:(0,ze.pb)($e(Il))}),Pl=(0,ze.yu)(el,{class:(0,ze.Ru)(),hideProperties:(0,ze.jt)((0,ze.Ru)()),hideStereotypes:(0,ze.jt)((0,ze.Ru)()),hideTaggedValues:(0,ze.jt)((0,ze.Ru)()),id:(0,ze.Ru)(),position:$e(Il),rectangle:$e(vl)}),wl=(0,ze.yu)(rl,{line:$e(Rl),property:$e(El),sourceView:(0,ze.Ru)(),targetView:(0,ze.Ru)()}),Ll=(0,ze.yu)(ol,{line:$e(Rl),sourceView:(0,ze.Ru)(),targetView:(0,ze.Ru)()}),bl=(0,ze.yu)(Jo,{_type:We(yl),classViews:(0,ze.pb)($e(Pl)),generalizationViews:(0,ze.pb)($e(Ll)),name:(0,ze.Ru)(),package:(0,ze.Ru)(),propertyViews:(0,ze.pb)($e(wl))});class Dl extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var Ml=s(95903);const kl=(e,t)=>{const s=e.lastIndexOf(me);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+me.length,e.length)]},Fl=(e,t)=>`${e?`${e}::`:""}${t}`,jl=(e,t)=>{e.children.push(t),t.package=e},Ul=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Vl=(e,t,s,i)=>{const n=t.indexOf(me),a=-1===n?t:t.substring(0,n);let r;if(r=e.children.find((e=>e instanceof ds&&e.name===a)),!r){if(!s)throw new V(`Can't find child package '${a}' in package '${e.path}'`);Z(!Ee.includes(a),`Can't create package with reserved name '${a}'`),r=new ds(a),r.package=e,e.children.push(r)}return i&&i.set(Fl(e.path,a),r),-1!==n?Vl(r,t.substring(n+me.length),s,i):r},Gl=(e,t,s,i)=>{if(i){const n=i.get(Fl(e.path,t));if(n)return n;let a=t;for(;""!==a;){const n=Fl(e.path,a),r=i.get(n);if(r)return Vl(r,t.substring(a.length+me.length,t.length),s,i);const o=a.lastIndexOf(me);a=-1!==o?a.substring(0,o):""}}return Vl(e,t,s,i)},zl=(e,t,s)=>(W(t,"Package path is required"),Gl(e.root,t,!0,s)),Bl=(e,t)=>Y(e.rawType,t),$l=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=Bl(e.value,as);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},Hl=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Yl=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Wl=(e,t)=>`${B(e,"Package path is required")}::${B(t,"Name is required")}`;class Kl{elementClassName;_class;prerequisites=[];firstPass;secondPass;thirdPass;fourthPass;fifthPass;constructor(e){this.elementClassName=e.elementClassName,this._class=e._class,this.prerequisites=e.prerequisites??[],this.firstPass=e.firstPass,this.secondPass=e.secondPass,this.thirdPass=e.thirdPass,this.fourthPass=e.fourthPass,this.fifthPass=e.fifthPass}getElementProtocolClass(){return this._class}getPrerequisiteElementProtocolClasses(){return this.prerequisites}runFirstPass(e,t,s,i){W(e.package,"Element 'package' field is missing or empty"),W(e.name,"Element 'name' field is missing or empty"),((e,t,s)=>{if(s){if(s.has(e))throw new V(`Element '${e}' already exists`);s.add(e)}else Z(!t.graph.getNullableElement(e),`Element '${e}' already exists`)})(Wl(e.package,e.name),t,i);const n=this.firstPass(e,t);return jl(zl(t.currentSubGraph,e.package,s),n),n}runSecondPass(e,t){this.secondPass?.(e,t)}runThirdPass(e,t){this.thirdPass?.(e,t)}runFourthPass(e,t){this.fourthPass?.(e,t)}runFifthPass(e,t){this.fifthPass?.(e,t)}}const Zl=e=>e.classView.value.id,Xl=e=>{const t=new rl,s=new il;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new dl;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=Zl(e.from),t.targetView=Zl(e.to),t},ql=e=>{const t=new ol,s=new il;return s.points=e.pathForSerialization,t.line=s,t.sourceView=Zl(e.from),t.targetView=Zl(e.to),t},Jl=e=>{const t=new el;return t.class=e.class.valueForSerialization??"",t.hideProperties=e.hideProperties,t.hideStereotypes=e.hideStereotypes,t.hideTaggedValues=e.hideTaggedValues,t.id=e.id,t.position=((e,t)=>{const s=new tl;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new sl;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class Ql{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return Zt([Wo.POINT,this.x.toString(),this.y.toString()])}}class ec{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return Zt([Wo.RECTANGLE,this.width.toString(),this.height.toString()])}}class tc{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new Ql(this.position.x+this.rectangle.width/2,this.position.y+this.rectangle.height/2);contains(e,t){const s=this.normalizeBox(this);return e>s.position.x&&e<s.position.x+s.rectangle.width&&t>s.position.y&&t<s.position.y+s.rectangle.height}normalizeBox(e){let t=e;return e.rectangle.width<0&&(t=new tc(new Ql(e.position.x+e.rectangle.width,e.position.y),new ec(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new tc(new Ql(e.position.x,e.position.y+e.rectangle.height),new ec(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,Zt([Wo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class sc extends tc{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new Ql(0,0),new ec(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return Zt([Wo.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class ic{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class nc extends ms{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class ac extends nc{ownerReference;constructor(e){const t=Es.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new ac(e)}}class rc{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new ic(ac.create(t)),this.to=new ic(ac.create(s))}computeEdgeEndpoint(e,t=!0){const s=e.classView.value,i=e.classView.value.center(),n=i.x+(e._offsetX??0),a=i.y+(e._offsetY??0);return s.contains(n,a)?new Ql(n,a):(t&&(e._offsetX=0,e._offsetY=0),new Ql(i.x,i.y))}buildFullPath(e=!0){return[this.computeEdgeEndpoint(this.from,e),...this.path,this.computeEdgeEndpoint(this.to,e)]}static pruneUnnecessaryInsidePoints=(e,t,s)=>{if(!e.length)return[];let i=0,n=e[i];for(;i<e.length-1&&t.contains(n.x,n.y);)i++,n=e[i];let a=e.length-1,r=e[a];for(;a>0&&s.contains(r.x,r.y);)a--,r=e[a];return e.slice(i-1,a+2)};get pathForSerialization(){return rc.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return Zt([Wo.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,Zt(this.pathForSerialization)])}}class oc extends rc{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return Zt([Wo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class lc extends oc{get hashCode(){return Zt([Wo.PROPERTY_VIEW,super.hashCode])}}class cc extends rc{get hashCode(){return Zt([Wo.GENERALIZATION_VIEW,super.hashCode])}}class dc{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new dc(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new dc(this.x/e,this.y/e)}normal(e){return new dc(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const hc=(e,t)=>e.classViews.find((e=>e.id===t)),uc=(e,t)=>{e.path=t},pc=e=>{const t=e.buildFullPath(),s=rc.pruneUnnecessaryInsidePoints(t,e.from.classView.value,e.to.classView.value);if(s[0]!==t[0]){const t=e.from.classView.value.center();e.from._offsetX=s[0].x-t.x,e.from._offsetY=s[0].y-t.y}if(s[s.length-1]!==t[t.length-1]){const t=e.to.classView.value.center();e.to._offsetX=s[s.length-1].x-t.x,e.to._offsetY=s[s.length-1].y-t.y}const i=[];for(let e=0;e<s.length-2;e++){const t=dc.fromPoints(s[e+1],s[e]).unit(),n=dc.fromPoints(s[e+1],s[e+2]).unit(),a=t.dotProduct(n),r=180*Math.acos(a)/Math.PI;Math.abs(r-180)>5&&i.push(s[e+1])}uc(e,i)},_c=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),mc=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),gc=e=>new Ql(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),Ec=e=>{const t=gc(e);return new tc(new Ql(t.x-5,t.y-5),new ec(10,10))},fc=(e,t)=>(t=e.normalizeBox(t),e.contains(t.position.x,t.position.y)||e.contains(t.position.x+t.rectangle.width,t.position.y)||e.contains(t.position.x,t.position.y+t.rectangle.height)||e.contains(t.position.x+t.rectangle.width,t.position.y+t.rectangle.height)),Tc=e=>{const t=B(e.x,"Point 'x' coordinate is missing"),s=B(e.y,"Point 'y' coordinate is missing");return new Ql(t,s)};class Cc extends Dl{constructor(){super(Vt.Rw.zE,Vt.i8)}V1_getExtraElementBuilders(){return[new Kl({elementClassName:"Diagram",_class:Jo,firstPass:(e,t)=>{H(e,Jo);const s=new Ko(e.name),i=Wl(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Ko),s},secondPass:(e,t)=>{H(e,Jo);const s=(i=Wl(e.package,e.name),n=t.currentSubGraph,B(n.getOwnNullableExtensionElement(i,Ko),`Can't find diagram '${i}'`));var i,n;s.classViews=e.classViews.map((e=>((e,t,s)=>{W(e.class,"Class view 'class' field is missing or empty"),W(e.id,"Class view 'id' field is missing or empty"),z(e.rectangle,"Class view 'rectangle' field is missing"),z(e.position,"Class view 'position' field is missing");const i=new sc(s,e.id,t.resolveClass(e.class));return i.hideProperties=e.hideProperties,i.hideTaggedValues=e.hideTaggedValues,i.hideStereotypes=e.hideStereotypes,i.rectangle=(e=>{const t=B(e.width,"Rectangle 'width' is missing"),s=B(e.height,"Rectangle 'height' is missing");return new ec(t,s)})(e.rectangle),i.position=Tc(e.position),i})(e,t,s))),s.propertyViews=e.propertyViews.map((e=>((e,t,s)=>{z(e.property,"Property view 'property' field is missing"),z(e.line,"Property view 'line' field is missing");const i=B(hc(s,B(e.sourceView)),"Property view 'sourceView' field is missing"),n=B(hc(s,B(e.targetView)),"Property view 'targetView' field is missing"),a=t.resolveOwnProperty(e.property),r=new lc(s,a,i,n);return r.path=e.line.points.map((e=>Tc(e))),pc(r),r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t)=>{z(e.line,"Generalization view 'line' field is missing");const s=B(hc(t,B(e.sourceView)),"Generalization view 'sourceView' field is missing"),i=B(hc(t,B(e.targetView)),"Generalization view 'targetView' field is missing"),n=new cc(t,s,i);return n.path=e.line.points.map((e=>Tc(e))),pc(n),n})(e,s)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof Jo)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof Jo)return(0,ze.qC)(bl,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===yl)return(0,ze.vB)(bl,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Ko)return(e=>{const t=new Jo;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(Jl),t.generalizationViews=e.generalizationViews.map(ql),t.propertyViews=e.propertyViews.map(Xl),t})(e)}]}}class xc extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class Nc extends xc{constructor(){super(Vt.Rw.f1,Vt.i8)}getExtraPureGraphExtensionClasses(){return[Ko]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Ko).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof as?Hl(e.property.ownerReference.value):e.property.ownerReference.value.properties).map((e=>e.name)).includes(e.property.value.name))).forEach((t=>b(e.propertyViews,t))),e.classViews.filter((e=>!t.getNullableClass(e.class.value.path))).forEach((t=>b(e.classViews,t))),e.generalizationViews.filter((e=>{const s=e.from.classView.value.class.value,i=e.to.classView.value.class.value;return!t.getNullableClass(s.path)||!t.getNullableClass(i.path)||0===s.generalizations.filter((e=>e.value.rawType===i)).length})).forEach((t=>b(e.generalizationViews,t)))})(t,e)))}]}}class Oc extends c{constructor(){super(Vt.Rw.NA,Vt.i8,[new Nc,new Xo,new Cc])}}var Ac=s(5453),Sc=s(3493),yc=s(53908);const Ic=(0,Ac.Z)({transitions:{create:()=>"none"}}),vc=e=>{const{children:t}=e;return(0,x.jsx)(Sc.Z,{injectFirst:!0,children:(0,x.jsx)(yc.Z,{theme:Ic,children:t})})};var Rc=s(83820),Pc=s(99631),wc=s(12238),Lc=s(78683),bc=s(20889),Dc=s(6277);const Mc=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Dc.clsx)(t,i),children:s})};return s.displayName=e,s},kc=e=>{const{children:t,darkMode:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Dc.clsx)("modal",{"modal--dark":s},i),children:t})},Fc=e=>{const{title:t,icon:s,className:i}=e;return(0,x.jsxs)("div",{className:(0,Dc.clsx)("modal__title",i),children:[s&&(0,x.jsx)("div",{className:"modal__title__icon",children:s}),(0,x.jsx)("div",{className:"modal__title__label",children:(n=t,(n??"").trim().replace(/\b(?:\w+)\b/gu,(e=>Ss.includes(e.toLowerCase())?e.toLowerCase():As(e))).replace(/^(?:\w+)\b/u,(e=>As(e))).replace(/\b(?:\w+)$/u,(e=>As(e))))})]});var n},jc=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,x.jsx)("div",{className:(0,Dc.clsx)("modal__header",i),children:(0,x.jsx)(Fc,{title:t})}):(0,x.jsx)("div",{className:(0,Dc.clsx)("modal__header",i),children:s})},Uc=(Mc("ModalHeaderActions","modal__header__actions"),Mc("ModalBody","modal__body")),Vc=Mc("ModalFooter","modal__footer"),Gc=e=>{switch(e){case vt.PROCEED_WITH_CAUTION:return"btn--caution";case vt.PROCEED:case vt.STANDARD:default:return"btn--dark"}},zc=(0,st.Pi)((e=>{const{info:t}=e,s=Mt(),{title:i,message:n,prompt:a,type:r,onClose:o,onEnter:l,actions:c}=t,d=()=>{o?.(),s.setActionAlertInfo(void 0)};return(0,x.jsx)(bc.Z,{open:Boolean(s.actionAlertInfo),onClose:v,TransitionProps:{onEnter:()=>l?.()},children:(0,x.jsxs)("form",{onSubmit:e=>{e.preventDefault(),c.find((e=>e.default))?.handler?.(),d()},className:`modal search-modal modal--dark blocking-alert blocking-alert--${(r??It.STANDARD).toLowerCase()}`,children:[i&&(0,x.jsx)(jc,{title:i}),(0,x.jsxs)(Uc,{children:[(0,x.jsx)("div",{className:"blocking-alert__summary-text",children:n}),(0,x.jsx)("div",{className:"blocking-alert__prompt-text",children:a})]}),(0,x.jsxs)(Vc,{children:[c.map((e=>(0,x.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${Gc(e.type??vt.STANDARD)}`,onClick:t=>{t.preventDefault(),e.handler?.(),d()},autoFocus:Boolean(e.default),children:e.label},e.label))),!c.length&&(0,x.jsx)("button",{type:"button",className:"btn btn--dark blocking-alert__action--standard",onClick:d,children:"Cancel"})]})]})})})),Bc=(0,st.Pi)((()=>{const e=Mt().actionAlertInfo;return e?(0,x.jsx)(zc,{info:e}):null})),$c=e=>{const{isLoading:t}=e,s=(0,it.useRef)(null);return(0,it.useEffect)((()=>{s.current&&(t?s.current.parentElement?.classList.add("panel-loading-indicator__container"):s.current.parentElement?.classList.remove("panel-loading-indicator__container"))}),[t]),(0,x.jsx)("div",{ref:s,className:"panel-loading-indicator"+(t?"":"--disabled")})},Hc=(0,st.Pi)((()=>{const e=Mt().blockingAlertInfo;return e?(0,x.jsx)(bc.Z,{open:Boolean(e),onClose:v,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,x.jsxs)(kc,{darkMode:!0,className:"blocking-alert",children:[(0,x.jsx)($c,{isLoading:Boolean(e.showLoading)}),(0,x.jsxs)(Uc,{children:[(0,x.jsx)("div",{className:"blocking-alert__message",children:e.message}),e.prompt&&(0,x.jsx)("div",{className:"blocking-alert__message__prompt",children:e.prompt})]})]})}):null}));var Yc=s(12889),Wc=s(58619),Kc=s(33029);const Zc=(0,st.Pi)((()=>{const e=Mt(),t=e.notification,s=Boolean(t),i=t?.message??"",n=t?.severity??Pt.INFO,[a,r]=(0,it.useState)(!1);let o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,x.jsx)(Yc.uMt,{})});switch(n){case Pt.ILEGAL_STATE:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Yc.nnZ,{})});break;case Pt.ERROR:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Yc.xDH,{})});break;case Pt.WARNING:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,x.jsx)(Yc.LPM,{})});break;case Pt.SUCCESS:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,x.jsx)(Yc.rE2,{})})}const l=()=>{e.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.copyTextToClipboard(i)));return(0,x.jsx)(Wc.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:e.notification?e.notification.autoHideDuration??null:Rt,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,x.jsx)(Kc.Z,{classes:{root:"notification__content",message:"notification__message",action:"notification__actions"},message:(0,x.jsxs)("div",{className:"notification__message__content",children:[o,(0,x.jsx)("div",{className:(0,Dc.clsx)("notification__message__content__text",{"notification__message__content__text--expanded":a}),onClick:c,title:"Click to Copy",children:i})]}),action:[(0,x.jsx)("button",{className:"notification__action",id:"expand_button",onClick:()=>r(!a),tabIndex:-1,title:a?"Collapse":"Expand",children:a?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.g8U,{})},"expand"),(0,x.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,x.jsx)(Yc.q1B,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var Xc;!function(e){e.TAB="Tab",e.CAPSLOCK="CapsLock",e.SHIFT="Shift",e.META="Meta",e.ALT="Alt",e.CONTROL="Control",e.SPACE="Space",e.ESC="Escape",e.LEFT="ArrowLeft",e.RIGHT="ArrowRight",e.UP="ArrowUp",e.DOWN="ArrowDown",e.ENTER="Enter",e.DELETE="Delete",e.BACKSPACE="Backspace"}(Xc=Xc||(Xc={}));var qc=s(11826);const Jc=e=>{const{children:t,classes:s,...i}=e;return(0,x.jsx)(qc.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},Qc=e=>{const{className:t,children:s,menuProps:i,content:n,disabled:a,onClose:r,onOpen:o}=e,l=(0,it.useRef)(null),[c,d]=(0,it.useState)(!1),[h,u]=(0,it.useState)(),[p,_]=(0,it.useState)(0),[m,g]=(0,it.useState)(0),E=()=>{u(void 0),d(!1),g(0),_(0)},f=e=>{e.stopPropagation(),e.preventDefault(),E(),r?.()},T=e=>{if(e.stopPropagation(),e.preventDefault(),!a&&(o?.(),l.current)){const t=l.current.getBoundingClientRect(),s=t.left+(window.scrollX||document.documentElement.scrollLeft),i=t.top+(window.scrollY||document.documentElement.scrollTop),{clientX:n,clientY:a,target:o}=e,c=o;if(h!==c&&!(document.elementsFromPoint(n,a).some((e=>e===c))&&s<=n&&n<=s+t.width&&i<=a&&a<=i+t.height))return E(),void r?.();u(c),d(!0),g(a),_(n)}};return(0,x.jsxs)("div",{ref:l,className:t,onContextMenu:T,children:[s,(0,x.jsx)(Jc,{open:c,anchorPosition:{left:p,top:m},onClose:f,anchorReference:"anchorPosition",BackdropProps:{invisible:!0,onContextMenu:T},disableRestoreFocus:!0,transitionDuration:0,onClick:f,...i,children:n},`${p}, ${m}`)]})},ed=(0,it.forwardRef)((function(e,t){const{className:s,children:i,...n}=e;return(0,x.jsx)("div",{ref:t,className:(0,Dc.clsx)("menu",s),...n,children:i})})),td=e=>{const{className:t,onClick:s,disabled:i,children:n,...a}=e;return(0,x.jsx)("button",{className:(0,Dc.clsx)("menu__item",t),disabled:Boolean(i),onClick:s,...a,children:n})},sd=Mc("MenuContentDivider","menu__divider");Mc("MenuContentItemIcon","menu__item__icon"),Mc("MenuContentItemLabel","menu__item__label");var id=s(52794),nd=s(71215);const ad=e=>(0,x.jsx)(id.D,{className:(0,Dc.clsx)("markdown-content",e.className),remarkPlugins:[nd.Z],children:e.value.value});var rd=s(62515);const od=e=>{const{children:t}=e,{ref:s,width:i,height:n}=(0,rd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[a,r]=(0,it.useState)(!1),{ref:o,width:l,height:c}=(0,rd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,it.useEffect)((()=>{r((l??0)>(i??0)+40&&(c??0)>(n??0)+40)}),[l,c,i,n]),(0,x.jsx)("div",{ref:o,className:"panel__content__blank",children:(0,x.jsx)("div",{ref:s,className:(0,Dc.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!a}),children:t})})};var ld=s(91222);const cd=e=>{const{children:t,...s}=e;return(0,x.jsx)(ld.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var dd=s(13474),hd=s(65068),ud=s(41327),pd=s(47793),_d=s(36569),md=s(46678);const gd=e=>{const{children:t,options:s,size:i,className:n,...a}=e,r=((e,t)=>{const s=[];for(let i=0;i<e.length;i+=t)s.push(e.slice(i,i+t));return s})(s,i);return(0,x.jsxs)("div",{className:(0,Dc.clsx)("mui-radio-group",n),children:[r.map(((e,t)=>(0,x.jsx)("div",{children:(0,x.jsx)(pd.Z,{className:"mui-radio-group__group",...a,children:e.map((e=>(0,x.jsx)(_d.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,x.jsx)(md.Z,{className:"mui-radio-group__group__item__radio-btn"}),label:(0,x.jsx)("div",{className:"mui-radio-group__group__item__label",children:e})},e)))})},t))),t]})};var Ed;!function(e){e.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX="question.how-to-use-advanced-search-syntax",e.QUESTION_WHEN_TO_CONFIGURE_PLATFORM_VERSIONS="question.when-to-configure-project-platform-dependencies-versions",e.QUESTION_HOW_TO_WRITE_A_SERVICE_TEST="question.how-to-write-a-service-test",e.QUESTION_HOW_TO_ADD_PARAMETERS_TO_QUERY="question.how-to-add-parameters-to-query",e.QUESTION_HOW_TO_ADD_CONSTANTS_TO_QUERY="question.how-to-add-constants-to-query",e.QUESTION_HOW_TO_WRITE_SERVICE_CONNECTION_TEST_DATA="question.how-to-write-service-connection-test-data",e.QUESTION_HOW_TO_CREATE_A_DATA_ELEMENT="question.how-to-create-a-data-element"}(Ed=Ed||(Ed={}));const fd=(0,st.Pi)((e=>{const{configState:t}=e,s=Mt();return(0,x.jsxs)("div",{className:"text-search-advanced-config__panel",children:[(0,x.jsxs)("div",{className:"text-search-advanced-config__panel__header__label",children:["search config",(0,x.jsx)("button",{className:"text-search-advanced-config__panel__header__hint",tabIndex:-1,onClick:()=>s.assistantService.openDocumentationEntry(Ed.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,x.jsx)(Yc.uMt,{})})]}),(0,x.jsx)("div",{children:(0,x.jsx)(gd,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[pt.STANDARD,pt.INCLUDE,pt.EXACT,pt.INVERSE],size:1})})]})})),Td=(0,st.Pi)((e=>{const{entry:t}=e,s=Mt(),i=()=>{t.isOpen||Ot.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},n=s.guardUnhandledError((()=>s.copyTextToClipboard(t.documentationKey)));return(0,x.jsx)(Qc,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsx)(ed,{children:(0,x.jsx)(td,{onClick:n,children:"Copy Documentation Key"})}),children:(0,x.jsxs)("div",{className:"virtual-assistant__doc-entry",children:[(0,x.jsxs)("div",{className:"virtual-assistant__doc-entry__header",children:[(0,x.jsx)("button",{className:(0,Dc.clsx)("virtual-assistant__doc-entry__expand-icon",{"virtual-assistant__doc-entry__expand-icon--disabled":!t.content}),disabled:!t.content,tabIndex:-1,onClick:i,children:t.isOpen?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.XCv,{})}),t.url?(0,x.jsx)("a",{className:"virtual-assistant__doc-entry__title virtual-assistant__doc-entry__title--link",rel:"noopener noreferrer",target:"_blank",href:t.url,onClick:()=>{Ot.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey})},title:"Click to see external documentation",children:t.title}):(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__title",onClick:i,children:t.title})]}),t.isOpen&&t.content&&(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__content",children:X(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__content__text",children:t.content}):(0,x.jsx)(ad,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),Cd=(0,st.Pi)((()=>{const e=Mt(),t=e.assistantService.currentContextualDocumentationEntry,s=e.guardUnhandledError((()=>e.copyTextToClipboard(t?.context??""))),i=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.currentContext?.key??""))),n=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.contextStack.map((e=>e.key)).join(" > "))));return(0,x.jsxs)(Qc,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(ed,{children:[(0,x.jsx)(td,{onClick:s,children:"Copy Context ID"}),(0,x.jsx)(td,{onClick:i,children:"Copy Current Context ID"}),(0,x.jsx)(td,{onClick:n,children:"Copy Context Stack"})]}),children:[t&&(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__content",children:[t.title&&(0,x.jsx)("div",{className:"virtual-assistant__contextual-support__title",children:t.title}),t.content&&(0,x.jsx)(x.Fragment,{children:X(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,x.jsx)(ad,{className:"virtual-assistant__contextual-support__markdown-text",value:t.content})}),t.related.length&&(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries",children:[(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries__title",children:["Related entries (",t.related.length,")"]}),t.related.map((e=>(0,x.jsx)(Td,{entry:e},e.uuid)))]})]}),!t&&(0,x.jsx)(od,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Yc.jZm,{className:"virtual-assistant__panel__placeholder__icon"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No contextual documentation found!"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__instruction",children:"Keep using the app. When contextual help is available, we will let you know!"})]})})]})})),xd=(0,st.Pi)((()=>{const e=Mt(),t=(0,it.useRef)(null),s=(0,it.useRef)(null),i=e.assistantService,n=i.searchText,a=(0,it.useMemo)((()=>(0,dd.Z)((()=>i.search()),100)),[i]);return(0,it.useEffect)((()=>{t.current?.focus()}),[]),(0,x.jsxs)("div",{className:"virtual-assistant__search",children:[(0,x.jsxs)("div",{className:"virtual-assistant__search__header",children:[(0,x.jsx)("input",{ref:t,onClick:()=>{document.querySelectorAll('[role="dialog"]').length&&t.current!==document.activeElement&&i.refreshPanelRendering()},className:(0,Dc.clsx)("virtual-assistant__search__input input--dark",{"virtual-assistant__search__input--searching":n}),spellCheck:!1,onChange:e=>{i.setSearchText(e.target.value),a()},value:n,placeholder:"Ask me a question"}),n&&(0,x.jsx)("div",{className:"virtual-assistant__search__input__search__count",children:i.searchResults.length+(i.isOverSearchLimit?"+":"")}),(0,x.jsx)("button",{ref:s,className:(0,Dc.clsx)("virtual-assistant__search__input__config__trigger",{"virtual-assistant__search__input__config__trigger--toggled":i.showSearchConfigurationMenu,"virtual-assistant__search__input__config__trigger--active":i.searchConfigurationState.isAdvancedSearchActive}),tabIndex:-1,onClick:()=>i.setShowSearchConfigurationMenu(!i.showSearchConfigurationMenu),title:(i.searchConfigurationState.isAdvancedSearchActive?"Advanced search is currently active\n":"")+"Click to toggle search config menu",children:(0,x.jsx)(Yc.IEm,{})}),n?(0,x.jsx)("button",{className:"virtual-assistant__search__input__clear-btn",tabIndex:-1,onClick:()=>{i.resetSearch(),i.currentDocumentationEntry=void 0,t.current?.focus()},title:"Clear",children:(0,x.jsx)(Yc.q1B,{})}):(0,x.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,x.jsx)(Yc.W1M,{})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,x.jsx)($c,{isLoading:i.searchState.isInProgress}),(0,x.jsx)("div",{className:(0,Dc.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":i.showSearchConfigurationMenu}),children:(0,x.jsx)(fd,{configState:i.searchConfigurationState})}),i.currentDocumentationEntry&&(0,x.jsx)("div",{className:"virtual-assistant__search__results",children:(0,x.jsx)(Td,{entry:i.currentDocumentationEntry},i.currentDocumentationEntry.uuid)}),!i.currentDocumentationEntry&&(0,x.jsxs)(x.Fragment,{children:[Boolean(i.searchResults.length)&&(0,x.jsx)("div",{className:"virtual-assistant__search__results",children:i.searchResults.map((e=>(0,x.jsx)(Td,{entry:e},e.uuid)))}),n&&!i.searchResults.length&&(0,x.jsx)(od,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Yc.DXi,{className:"virtual-assistant__panel__placeholder__icon"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No result..."})]})}),!n&&!i.searchResults.length&&(0,x.jsx)(Qc,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(ed,{children:[(0,x.jsx)(td,{onClick:()=>{pe(`documentation-registry_${(0,hd.Z)(new Date(Date.now()),De)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),ne.APPLICATION_JSON)},children:"Download documentation registry"}),(0,x.jsx)(td,{onClick:()=>{pe(`documentation-registry_${(0,hd.Z)(new Date(Date.now()),De)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),ne.APPLICATION_JSON)},children:"Download contextual documentation mapping"})]}),children:(0,x.jsxs)("div",{className:"virtual-assistant__character",children:[(0,x.jsxs)("div",{className:"virtual-assistant__character__figure",children:[(0,x.jsx)(Yc.Oag,{className:"virtual-assistant__character__hat"}),(0,x.jsx)(Yc.ce8,{className:"virtual-assistant__character__glasses"}),(0,x.jsx)(Yc.dRK,{className:"virtual-assistant__character__beard"})]}),(0,x.jsx)("div",{className:"virtual-assistant__character__greeting",children:"Bonjour, It's Pierre!"}),(0,x.jsx)("div",{className:"virtual-assistant__character__question",children:"How can I help today?"})]})})]})]})]})})),Nd=(0,st.Pi)((e=>{const{triggerElement:t}=e,s=Mt().assistantService,i=s.currentContextualDocumentationEntry,n=s.selectedTab;return(0,x.jsx)(cd,{open:s.isOpen,className:"virtual-assistant__panel__container",anchorEl:t,hideBackdrop:!0,PaperProps:{classes:{root:"virtual-assistant__panel__container__root"}},disableEnforceFocus:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"},children:(0,x.jsxs)("div",{className:"virtual-assistant__panel",tabIndex:0,onKeyDown:e=>{"Tab"===e.key&&(e.preventDefault(),e.stopPropagation())},children:[(0,x.jsxs)("div",{className:"virtual-assistant__panel__header",children:[(0,x.jsxs)("div",{className:"virtual-assistant__panel__header__tabs",children:[(0,x.jsx)("div",{className:(0,Dc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===_t.SEARCH}),onClick:()=>s.setSelectedTab(_t.SEARCH),title:"Search",children:(0,x.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,x.jsx)(Yc.W1M,{})})}),(0,x.jsx)("div",{className:(0,Dc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===_t.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(_t.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,x.jsx)(Yc.kdY,{}),i&&(0,x.jsx)("div",{className:"virtual-assistant__panel__header__tab__indicator",title:"Contextual support available"})]})})]}),(0,x.jsx)("div",{className:"virtual-assistant__panel__header__actions",children:(0,x.jsx)("button",{className:"virtual-assistant__panel__header__action",tabIndex:-1,onClick:()=>s.setIsOpen(!1),title:"Close panel",children:(0,x.jsx)(Yc.Two,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__panel__content",children:[n===_t.SEARCH&&(0,x.jsx)(xd,{}),n===_t.CONTEXTUAL_SUPPORT&&(0,x.jsx)(Cd,{})]})]})},s.panelRenderingKey)})),Od=(0,st.Pi)((()=>{const[e,t]=(0,it.useState)(!1),[s,i]=(0,it.useState)((0,a.Z)()),n=Mt(),r=(0,it.useRef)(null),o=n.assistantService,l=o.currentContextualDocumentationEntry;return(0,it.useEffect)((()=>{o.isHidden&&i((0,a.Z)())}),[o.isHidden]),(0,x.jsx)(ud,{bounds:"parent",onStart:()=>t(!0),onStop:()=>t(!1),handle:".virtual-assistant__station__drag-handle",children:(0,x.jsxs)("div",{className:"virtual-assistant",ref:r,children:[(0,x.jsxs)("div",{className:(0,Dc.clsx)("virtual-assistant__station",{"virtual-assistant__station--hidden":o.isHidden,"virtual-assistant__station--active":Boolean(l)}),children:[(0,x.jsx)("button",{className:"virtual-assistant__station__trigger",tabIndex:-1,onClick:()=>{!o.isOpen&&l&&o.setSelectedTab(_t.CONTEXTUAL_SUPPORT),o.setIsOpen(!o.isOpen)},title:o.isOpen?"Click to close assistant panel":(l?"Contextual support available.\n":"")+"Click to open assistant panel...",children:o.isOpen?(0,x.jsx)(Yc.Two,{className:"virtual-assistant__station__trigger__close"}):l?(0,x.jsx)(Yc.J$M,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,x.jsx)(Qc,{className:(0,Dc.clsx)("virtual-assistant__station__drag-handle",{"virtual-assistant__station__drag-handle--dragging":e}),menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(ed,{children:[(0,x.jsx)(td,{onClick:()=>{o.setIsOpen(!1),i((0,a.Z)())},children:"Reset Position"}),(0,x.jsx)(td,{onClick:()=>n.assistantService.hideAssistant(),children:"Hide Assistant"})]}),children:(0,x.jsx)("div",{className:"virtual-assistant__station__drag-handle__content",title:e?void 0:"Grab to drag assistant",children:(0,x.jsx)(Yc.POq,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,x.jsx)(Nd,{triggerElement:r.current})]})},s)})),Ad="app.container",Sd="app.backdrop-container",yd=["Meta+KeyP","Control+KeyP","Meta+KeyS","Control+KeyS","F8","F10","F11","Meta+Shift+KeyP","Control+Shift+KeyP","Meta+KeyB","Control+KeyB","F7","Alt+F7"],Id=e=>(0,x.jsx)("div",{className:"backdrop__container",id:e.elementID}),vd=(0,st.Pi)((e=>{const{children:t}=e,s=Mt(),i=s.backdropContainerElementID?document.getElementById(s.backdropContainerElementID)??document.getElementById(Sd):document.getElementById(Sd),n=((e,t)=>{const s={};return e.forEach(((e,i)=>{e&&(s[i]={combinations:[e],handler:t(e)})})),s.INTERNAL__PLATFORM_NATIVE_KEYBOARD_COMMAND={combinations:yd,handler:e=>{e?.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,(e=>t=>{yd.includes(e)&&t?.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,it.useEffect)((()=>{const e=function(e){const t=new Map;let s=null;return i=>{i instanceof KeyboardEvent&&(Object.values(e).flatMap((e=>e.combinations.map((t=>({combination:t,handler:e.handler}))))).filter((e=>e.combination.length)).forEach((e=>{const s=e.combination,n=e.combination.trim().split(" ").map((e=>{const t=e.split(/\b\+/),s=B(t.pop(),"Can't parse key binding: last part must be a non-modifier key");return{modifiers:t,key:s}}));if(!n.length)return;const a=t.get(s)??n,r=B(a[0]),o=((e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![Xc.SHIFT,Xc.META,Xc.ALT,Xc.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))))(i,r);o?a.length>1?t.set(s,a.slice(1)):(t.delete(s),e.handler(i)):i.getModifierState(i.key)||t.delete(s)})),s&&clearTimeout(s),s=setTimeout(t.clear.bind(t),1e3))}}(n);return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n]),(0,x.jsxs)(vc,{children:[(0,x.jsx)(Hc,{}),(0,x.jsx)(Bc,{}),(0,x.jsx)(Zc,{}),s.showBackdrop&&(0,x.jsx)(Rc.Z,{container:i,children:(0,x.jsx)(Pc.Z,{className:"backdrop",open:s.showBackdrop})}),(0,x.jsx)(wc.W,{backend:Lc.PD,children:(0,x.jsxs)("div",{className:"app__container",id:Ad,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,x.jsx)(Id,{elementID:Sd}),(0,x.jsx)(Od,{}),t]})})]})}));class Rd{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const Pd=(0,it.createContext)(void 0),wd=({children:e})=>{const t=Mt(),s=(0,st.fv)((()=>new Rd(t)));return(0,x.jsx)(Pd.Provider,{value:s,children:e})};var Ld,bd;!function(e){e.CONCEPT="CONCEPT",e.FILE="FILE"}(Ld=Ld||(Ld={})),function(e){e.CONSOLE="CONSOLE",e.SEARCH_RESULT="SEARCH_RESULT",e.TEST_RUNNER="TEST_RUNNER"}(bd=bd||(bd={}));const Dd="dummy_problem_marker_owner",Md=e=>e.startsWith("/")?e.substring(1,e.length):e;class kd{content;constructor(){(0,O.rC)(this,{content:O.LO,setContent:O.aD})}setContent(e){this.content=e}}(0,ze.yu)(kd,{content:(0,ze.Ru)()});class Fd{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class jd extends Fd{error;constructor(e,t,s,i){super(e,t,s),this.error=i}}class Ud{uuid=(0,a.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class Vd{currentTab;tabs=[];constructor(){(0,O.rC)(this,{currentTab:O.LO,tabs:O.LO,setCurrentTab:O.aD,closeTab:O.aD,closeAllTabs:O.aD,closeAllOtherTabs:O.aD,openTab:O.aD,swapTabs:O.aD})}setCurrentTab(e){this.currentTab=e}closeAllOtherTabs(e){z(this.tabs.find((t=>t===e)),"Specified tab should be currently opened"),this.setCurrentTab(e),this.tabs=[e]}closeAllTabs(){this.setCurrentTab(void 0),this.tabs=[]}swapTabs(e,t){L(this.tabs,e,t)}openTab(e){if(!this.tabs.find((t=>t.match(e))))if(this.currentTab){const t=this.tabs.findIndex((e=>e===this.currentTab));this.tabs.splice(t+1,0,e)}else this.tabs.push(e);this.setCurrentTab(e),e.onOpen()}closeTab(e){const t=this.tabs.findIndex((t=>t.match(e)));if(Z(-1!==t,"Can't close a tab which is not opened"),this.tabs.splice(t,1),this.currentTab===e)if(this.tabs.length){const e=t-1;this.setCurrentTab(e>=0?this.tabs[e]:this.tabs[0])}else this.setCurrentTab(void 0);e.onClose()}}class Gd extends Ud{editorStore;constructor(e){super(),this.editorStore=e}}class zd extends Vd{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}}var Bd;!function(e){e.SEARCH_FILE="editor.search.file",e.SEARCH_TEXT="editor.search.text",e.GO_TO_FILE="editor.go-to-file",e.TOGGLE_AUX_PANEL="editor.toggle-auxiliary-panel",e.EXECUTE="editor.execute",e.FULL_RECOMPILE="editor.full-compile",e.FULL_RECOMPILE_WITH_FULL_INIT="editor.full-compile.with-init",e.RUN_ALL_TESTS="editor.run-all-tests",e.RUN_RELAVANT_TESTS="editor.run-relavant-tests",e.GO_TO_DEFINITION="editor.file-editor.go-to-definition",e.GO_BACK="editor.file-editor.go-back",e.FIND_USAGES="editor.file-editor.find-usage"}(Bd=Bd||(Bd={}));const $d={[Bd.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN"},[Bd.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF"},[Bd.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[Bd.TOGGLE_AUX_PANEL]:{title:"Toggle auxiliary panel",defaultKeyboardShortcut:"Control+Backquote"},[Bd.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[Bd.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[Bd.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[Bd.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[Bd.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"},[Bd.GO_TO_DEFINITION]:{title:"Go to definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[Bd.GO_BACK]:{title:"Go back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[Bd.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"}};var Hd;!function(e){e.RECENTER="editor.diagram-editor.recenter",e.USE_ZOOM_TOOL="editor.diagram-editor.use-zoom-tool",e.USE_VIEW_TOOL="editor.diagram-editor.use-view-tool",e.USE_PAN_TOOL="editor.diagram-editor.use-pan-tool"}(Hd=Hd||(Hd={}));const Yd={[Hd.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[Hd.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[Hd.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[Hd.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};class Wd{model;editor;viewState;forcedCursorPosition;wrapText=!1;constructor(e){(0,O.rC)(this,{viewState:O.LO.ref,editor:O.LO.ref,forcedCursorPosition:O.LO.ref,wrapText:O.LO,setViewState:O.aD,setEditor:O.aD,setForcedCursorPosition:O.aD,setWrapText:O.aD}),this.model=A.editor.createModel(e.uuid,C.PURE),this.model.updateOptions({tabSize:2})}setViewState(e){this.viewState=e}setEditor(e){this.editor=e}setForcedCursorPosition(e){this.forcedCursorPosition=e}setWrapText(e){const t=this.wrapText;this.wrapText=e,t!==e&&this.editor&&(this.editor.updateOptions({wordWrap:e?"on":"off"}),this.editor.focus())}}class Kd extends Gd{file;filePath;textEditorState=new Wd(this);constructor(e,t,s){super(e),(0,O.rC)(this,{file:O.LO,setFile:O.aD}),this.file=t,this.filePath=s}get label(){return Md(this.filePath)}get description(){return`File: ${Md(this.filePath)}`}get fileName(){return B((e=this.filePath.split("/")).length?e[e.length-1]:void 0);var e}match(e){return e instanceof Kd&&this.filePath===e.filePath}onClose(){this.textEditorState.model.dispose()}setFile(e){this.file=e}showError(e){var t,s,i;t=this.textEditorState.model,s=[{message:e.error.message,startLineNumber:e.line,startColumn:e.column,endLineNumber:e.line,endColumn:e.column}],i=this.uuid,A.editor.setModelMarkers(t,i??Dd,s.map((e=>({startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn+1,message:""===e.message?"(no error message)":e.message,severity:A.MarkerSeverity.Error}))))}clearError(){var e;e=this.uuid,A.editor.removeAllMarkers(e??Dd)}registerCommands(){this.editorStore.applicationStore.commandCenter.registerCommand({key:Bd.GO_TO_DEFINITION,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&(0,O.fl)(this.editorStore.executeNavigation(new Fd(this.filePath,e.lineNumber,e.column))).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Bd.GO_BACK,action:()=>{(0,O.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Bd.FIND_USAGES,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){const t=new Fd(this.filePath,e.lineNumber,e.column);(0,O.fl)(this.editorStore.findUsages(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}})}deregisterCommands(){[Bd.GO_TO_DEFINITION,Bd.GO_BACK,Bd.FIND_USAGES].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class Zd{editorStore;treeData;selectedNode;loadInitialDataState=gt.create();refreshDataState=gt.create();constructor(e){(0,O.rC)(this,{treeData:O.LO.ref,loadInitialDataState:O.LO,refreshDataState:O.LO,initialize:O.ls,expandNode:O.ls,openNode:O.ls,refreshTreeData:O.ls,setTreeData:O.aD,setSelectedNode:O.aD}),this.editorStore=e}getTreeData(){return B(this.treeData,"Tree data has not been initialized")}*initialize(){if(this.loadInitialDataState.isInProgress)this.editorStore.applicationStore.notifyWarning("Tree state initialization is in progress");else{this.loadInitialDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes()),this.loadInitialDataState.pass()}catch(e){j(e),this.editorStore.applicationStore.notifyError(e),this.loadInitialDataState.fail()}}}setSelectedNode(e){e!==this.selectedNode&&(this.selectedNode&&(this.selectedNode.isSelected=!1),e&&(e.isSelected=!0),this.selectedNode=e,this.refreshTree())}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...B(this.treeData)})}*expandNode(e){if(!e.isLoading)if(this.getTreeData().nodes.has(e.id)&&e.childrenIds)e.isLoading=!1,e.isOpen=!0,this.refreshTree();else{e.isLoading=!0;try{const t=yield this.getChildNodes(e);this.processChildNodes(e,t),e.isOpen=!0,this.refreshTree()}catch(e){j(e),this.editorStore.applicationStore.notifyError(e)}finally{e.isLoading=!1}}}*refreshTreeData(){const e=new Set(Array.from(this.getTreeData().nodes.values()).filter((e=>e.isOpen)).map((e=>e.id))),t=this.selectedNode?.id;this.refreshDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes())}catch(e){return j(e),this.editorStore.applicationStore.notifyError(e),void this.refreshDataState.fail()}const s=this.getTreeData().rootIds.map((e=>B(this.getTreeData().nodes.get(e)))).filter((t=>e.has(t.id)));yield this.refreshOpenNodes(s,e),t&&this.getTreeData().nodes.has(t)&&this.setSelectedNode(B(this.getTreeData().nodes.get(t)))}async refreshOpenNodes(e,t){return await Promise.all(e.map((e=>(t.delete(e.id),(0,O.fl)(this.expandNode(e)).catch((()=>{})))))),(e=e.flatMap((e=>e.childrenIds??[])).map((e=>B(this.getTreeData().nodes.get(e)))).filter((e=>t.has(e.id)))).length?this.refreshOpenNodes(e,t):Promise.resolve()}}class Xd{id;path}class qd extends Xd{file;statusType}(0,ze.yu)(qd,{id:(0,ze.Ru)(),path:(0,ze.Ru)(),file:(0,ze.Ru)(),statusType:(0,ze.Ru)()});class Jd extends Xd{repo}(0,ze.yu)(Jd,{id:(0,ze.Ru)(),path:(0,ze.Ru)(),repo:(0,ze.Ru)()});class Qd{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof Jd}get isFileNode(){return this.li_attr instanceof qd}getNodeAttribute(e){return Y(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,ze.yu)(Qd,{li_attr:(0,ze.PG)((()=>ze.AM),(e=>e.file&&"true"===e.file?(0,ze.vB)(qd,e):(0,ze.vB)(Jd,e))),text:(0,ze.Ru)(),icon:(0,ze.Ru)(),children:(0,ze.Ru)(),state:(0,ze.Ru)()});const eh=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},th=e=>e.endsWith(".pure"),sh=e=>`file_${e}`;class ih extends Zd{nodeForCreateNewFile;nodeForCreateNewDirectory;constructor(e){super(e),(0,O.rC)(this,{nodeForCreateNewFile:O.LO,nodeForCreateNewDirectory:O.LO,setNodeForCreateNewFile:O.aD,setNodeForCreateNewDirectory:O.aD,revealPath:O.ls})}setNodeForCreateNewFile=e=>{Z(!e||e.data.isFolderNode,"Node selected for creating a new file from must be a directory"),this.nodeForCreateNewFile=e};setNodeForCreateNewDirectory=e=>{Z(!e||e.data.isFolderNode,"Node selected for creating a new directory from must be a directory"),this.nodeForCreateNewDirectory=e};async getRootNodes(){return(await this.editorStore.client.getDirectoryChildren()).map((e=>(0,ze.vB)(Qd,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.editorStore.client.getDirectoryChildren(e.data.li_attr.path)).map((e=>(0,ze.vB)(Qd,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((e=>{const t=e.li_attr.id;i.push(t),s.nodes.set(t,{data:e,id:t,label:e.text,isLoading:!1})})),e.childrenIds=i}*openNode(e){e.data.isFileNode&&(yield(0,O.fl)(this.editorStore.loadFile(e.data.li_attr.path)))}*revealPath(e,t,s){t&&this.editorStore.setActiveActivity(Ld.FILE,{keepShowingIfMatchedCurrent:!0});const i=[];let n=e;for(;n;)i.unshift(n),n=eh(n);for(const e of i)if(th(e))yield(0,O.fl)(this.editorStore.loadFile(e,s));else{const t=B(this.getTreeData().nodes.get(sh(e)),`Can't find directory node with path '${e}'`);yield(0,O.fl)(this.expandNode(t))}const a=B(this.getTreeData().nodes.get(sh(e)),`Can't find file node with path '${e}'`);this.setSelectedNode(a)}}var nh,ah,rh,oh;!function(e){e.PACKAGE="Package",e.PROFILE="Profile",e.CLASS="Class",e.ASSOCIATION="Association",e.PROPERTY="Property",e.ENUMERATION="Enumeration",e.ENUM_VALUE="Enum",e.MEASURE="Measure",e.UNIT="Unit",e.FUNCTION="ConcreteFunctionDefinition",e.NATIVE_FUNCTION="NativeFunction",e.DIAGRAM="Diagram",e.DATABASE="Database",e.MAPPING="Mapping"}(nh=nh||(nh={}));class lh{pureId;pureType;get id(){return this.pureId}}class ch extends lh{deprecated}(0,ze.yu)(ch,{pureId:(0,ze.Ru)(),pureType:(0,ze.Ru)(),deprecated:(0,ze.Ru)()});class dh extends lh{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,ze.yu)(dh,{pureId:(0,ze.Ru)(),pureType:(0,ze.Ru)(),RO:(0,ze.Ru)(),classPath:(0,ze.Ru)(),file:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)()});class hh extends lh{RO;notpublic;user;file;line;column}(0,ze.yu)(hh,{pureId:(0,ze.Ru)(),pureType:(0,ze.Ru)(),RO:(0,ze.Ru)(),notpublic:(0,ze.Ru)(),user:(0,ze.Ru)(),file:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)()});class uh{li_attr;id;text;icon;children;state;getNodeAttribute(e){return Y(this.li_attr,e,`Expected concept node attribute to be of type '${e.name}'`)}}(0,ze.yu)(uh,{li_attr:(0,ze.PG)((()=>ze.AM),(e=>e.classPath?(0,ze.vB)(dh,e):e.file?(0,ze.vB)(hh,e):(0,ze.vB)(ch,e))),id:(0,ze.Ru)(),text:(0,ze.Ru)(),icon:(0,ze.Ru)(),children:(0,ze.Ru)(),state:(0,ze.Ru)()});class ph extends Zd{loadConceptActivity=gt.create();statusText;constructor(e){super(e),(0,O.rC)(this,{statusText:O.LO,setStatusText:O.aD,pullConceptsActivity:O.aD,pollConceptsActivity:O.ls})}setStatusText(e){this.statusText=e}async getRootNodes(){return await(0,O.fl)(this.pollConceptsActivity()),(await this.editorStore.client.getConceptChildren()).map((e=>(0,ze.vB)(uh,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.editorStore.client.getConceptChildren(e.data.li_attr.pureId)).map((e=>(0,ze.vB)(uh,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((e=>{const t=e.li_attr.id;i.push(t),s.nodes.set(t,{data:e,id:t,label:e.text,isLoading:!1})})),e.childrenIds=i}*openNode(e){(e.data.li_attr instanceof dh||e.data.li_attr instanceof hh)&&("Diagram"===e.data.li_attr.pureType?yield(0,O.fl)(this.editorStore.loadDiagram(e.data.li_attr.file,e.data.li_attr.pureId,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10))):yield(0,O.fl)(this.editorStore.loadFile(e.data.li_attr.file,new Fd(e.data.li_attr.file,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10)))))}*pollConceptsActivity(){if(this.loadConceptActivity.isInInitialState){this.loadConceptActivity.inProgress(),this.setStatusText("Loading concepts activity...");try{yield this.pullConceptsActivity()}finally{this.setStatusText(void 0),this.loadConceptActivity.reset()}}}async pullConceptsActivity(){const e=await this.editorStore.client.getConceptActivity();return e.text&&this.setStatusText(`Preparing - ${e.text}`),e.initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullConceptsActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}}class _h{cached;datamarts;text}(0,ze.yu)(_h,{cached:(0,ze.Ru)(),datamarts:(0,ze.pb)((0,ze.Ru)()),text:(0,ze.Ru)()});class mh extends _h{error;sessionError}(0,ze.yu)(mh,{cached:(0,ze.Ru)(),datamarts:(0,ze.pb)((0,ze.Ru)()),text:(0,ze.Ru)(),error:(0,ze.Ru)(),sessionError:(0,ze.Ru)()});class gh extends mh{RO;line;column;source}(0,ze.yu)(gh,{cached:(0,ze.Ru)(),datamarts:(0,ze.pb)((0,ze.Ru)()),text:(0,ze.Ru)(),RO:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),source:(0,ze.Ru)(),error:(0,ze.Ru)(),sessionError:(0,ze.Ru)()});class Eh{text;reinit}class fh extends Eh{cache;modifiedFiles=[]}(0,ze.yu)(fh,{text:(0,ze.Ru)(),cache:(0,ze.Ru)(),modifiedFiles:(0,ze.pb)((0,ze.Ru)()),reinit:(0,ze.Ru)()});class Th extends Eh{RO;line;column;source;error;sessionError}(0,ze.yu)(Th,{text:(0,ze.Ru)(),RO:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),source:(0,ze.Ru)(),error:(0,ze.Ru)(),sessionError:(0,ze.Ru)()});class Ch{RO;line;column;source}(0,ze.yu)(Ch,{RO:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),source:(0,ze.Ru)()});class xh extends Eh{jumpTo}(0,ze.yu)(xh,{text:(0,ze.Ru)(),jumpTo:(0,ze.Ry)(Ch)});class Nh{uuid=(0,a.Z)();sourceID;line;column;foundName}(0,ze.yu)(Nh,{sourceID:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),foundName:(0,ze.Ru)()});class Oh{uuid=(0,a.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,ze.yu)(Oh,{sourceID:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),foundName:(0,ze.Ru)(),add:(0,ze.Ru)(),messageToBeModified:(0,ze.Ru)(),fileToBeModified:(0,ze.Ru)(),lineToBeModified:(0,ze.Ru)(),columnToBeModified:(0,ze.Ru)()});class Ah extends Th{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,ze.yu)(Ah,{candidateName:(0,ze.Ru)(),candidatesWithPackageImported:(0,ze.pb)((0,ze.Ry)(Nh)),candidatesWithPackageNotImported:(0,ze.pb)((0,ze.Ry)(Oh))});class Sh extends Th{candidateName;candidates=[]}(0,ze.yu)(Sh,{candidateName:(0,ze.Ru)(),candidates:(0,ze.pb)((0,ze.Ry)(Oh))});class yh{id;parentId;file;line;column}(0,ze.yu)(yh,{id:(0,ze.Ru)(),parentId:(0,ze.Ru)(),file:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)()});class Ih{children=[];li_attr;text;type}(0,ze.yu)(Ih,{children:(0,ze.pb)((0,ze.Ry)(Ih)),li_attr:(0,ze.Ry)(yh),text:(0,ze.Ru)(),type:(0,ze.Ru)()});class vh extends Eh{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,ze.yu)(vh,{count:(0,ze.Ru)(),filterPaths:(0,ze.pb)((0,ze.Ru)()),path:(0,ze.Ru)(),relevantTestsOnly:(0,ze.Ru)(),runnerId:(0,ze.Ru)(),tests:(0,ze.pb)((0,ze.Ry)(Ih))});class Rh{uuid=(0,a.Z)()}class Ph{uuid=(0,a.Z)();startLine;startColumn;endLine;endColumn;constructor(e,t,s,i){this.startLine=e,this.startColumn=t,this.endLine=s,this.endColumn=i}}(0,ze.yu)(Ph,{startLine:(0,ze.Ru)(),startColumn:(0,ze.Ru)(),endLine:(0,ze.Ru)(),endColumn:(0,ze.Ru)()});class wh extends Rh{sourceId;coordinates=[];constructor(){super(),(0,O.rC)(this,{coordinates:O.LO,dismissCoordinate:O.aD})}setCoordinates(e){this.coordinates=e}dismissCoordinate(e){b(this.coordinates,e)}}(0,ze.yu)(wh,{sourceId:(0,ze.Ru)(),coordinates:(0,ze.pb)((0,ze.Ry)(Ph))});class Lh{editorStore;constructor(e){this.editorStore=e}}class bh extends Lh{searchEntries=[];constructor(e,t){super(e),(0,O.rC)(this,{searchEntries:O.LO,numberOfFiles:O.Fl,numberOfResults:O.Fl}),this.searchEntries=t}dismissSearchEntry(e){b(this.searchEntries,e),this.searchEntries.length||this.editorStore.setSearchState(void 0)}get numberOfFiles(){return this.searchEntries.length}get numberOfResults(){return this.searchEntries.flatMap((e=>e.coordinates)).length}}class Dh extends bh{}class Mh extends bh{usageConcept;constructor(e,t,s){const i=new Map;s.forEach((e=>{let t;i.has(e.source)?t=B(i.get(e.source)):(t=new wh,t.sourceId=e.source,i.set(e.source,t)),t.coordinates.push(new Ph(e.startLine,e.startColumn,e.endLine,e.endColumn))})),super(e,Array.from(i.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=B(i.get(e));return t.setCoordinates(t.coordinates.sort(((e,t)=>e.startColumn-t.startColumn)).sort(((e,t)=>e.startLine-t.startLine))),t}))),this.usageConcept=t}}class kh extends Lh{result;constructor(e,t){super(e),this.result=t}}class Fh extends Lh{result;constructor(e,t){super(e),this.result=t}}!function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(ah=ah||(ah={}));class jh{status;test}class Uh extends jh{test=[]}(0,ze.yu)(Uh,{status:(0,ze.Ru)(),test:(0,ze.pb)((0,ze.Ru)())});class Vh{text;RO;line;column;source;error}(0,ze.yu)(Vh,{text:(0,ze.Ru)(),RO:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),source:(0,ze.Ru)(),error:(0,ze.Ru)()});class Gh extends jh{test=[];error}(0,ze.yu)(Gh,{status:(0,ze.Ru)(),test:(0,ze.pb)((0,ze.Ru)()),error:(0,ze.Ry)(Vh)});class zh{}class Bh extends zh{finished;tests=[]}(0,ze.yu)(Bh,{finished:(0,ze.Ru)(),tests:(0,ze.pb)((0,ze.PG)((()=>ze.AM),(e=>e.error?(0,ze.vB)(Gh,e):(0,ze.vB)(Uh,e))))});class $h extends zh{error;text}(0,ze.yu)($h,{error:(0,ze.Ru)(),text:(0,ze.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(rh=rh||(rh={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(oh=oh||(oh={}));class Hh{_START_TIME;total;time=0;passedTests=new Set;failedTests=new Map;testsWithError=new Map;notRunTests;results=new Map;constructor(e){(0,O.rC)(this,{total:O.LO,time:O.LO,passedTests:O.LO,failedTests:O.LO,testsWithError:O.LO,notRunTests:O.LO,results:O.LO,passed:O.Fl,error:O.Fl,failed:O.Fl,passedTestIds:O.Fl,failedTestIds:O.Fl,testWithErrorIds:O.Fl,notRunTestIds:O.Fl,numberOfTestsRun:O.Fl,runPercentage:O.Fl,suiteStatus:O.Fl,setTime:O.aD,addResult:O.aD}),this._START_TIME=Date.now(),this.total=e.size,this.notRunTests=new Set(e)}get passed(){return this.passedTests.size}get error(){return this.testsWithError.size}get failed(){return this.failedTests.size}get passedTestIds(){return Array.from(this.passedTests.values())}get failedTestIds(){return Array.from(this.failedTests.keys())}get testWithErrorIds(){return Array.from(this.testsWithError.keys())}get notRunTestIds(){return Array.from(this.notRunTests.values())}get numberOfTestsRun(){return this.passed+this.error+this.failed}get runPercentage(){return Math.floor(100*this.numberOfTestsRun/this.total)}get suiteStatus(){return this.failed+this.error?rh.FAILED:this.passed?rh.PASSED:rh.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case ah.PASSED:this.passedTests.add(t);break;case ah.FAILED:this.failedTests.set(t,Y(e,Gh));break;case ah.ERROR:this.testsWithError.set(t,Y(e,Gh));break;default:throw new F(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class Yh{editorStore;testExecutionResult;checkTestRunnerState=gt.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=gt.create();treeData;viewAsList=!1;constructor(e,t){(0,O.rC)(this,{testResultInfo:O.LO.ref,allTests:O.LO,selectedTestId:O.LO,treeData:O.LO.ref,viewAsList:O.LO,setViewAsList:O.aD,setSelectedTestId:O.aD,setTestResultInfo:O.aD,setTreeData:O.aD,refreshTree:O.aD,collapseTree:O.aD,expandTree:O.aD,buildTreeDataByLayer:O.aD,pullTestRunnerResult:O.aD,buildTestTreeData:O.ls,pollTestRunnerResult:O.ls,rerunTestSuite:O.ls,cancelTestRun:O.ls}),this.editorStore=e,this.testExecutionResult=t}getTreeData(){return B(this.treeData,"Test tree data has not been initialized")}setViewAsList(e){this.viewAsList=e}setSelectedTestId(e){this.selectedTestId=e}setTestResultInfo(e){this.testResultInfo=e}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...B(this.treeData)})}*buildTestTreeData(){if(this.treeBuildingState.isInProgress)return;this.treeBuildingState.inProgress();const e=this.testExecutionResult.tests.map((e=>{const t=e.li_attr.id;return e.type&&this.allTests.set(t,e),t})),t=new Map;this.treeData={rootIds:e,nodes:t},yield this.buildTreeDataByLayer(this.testExecutionResult.tests),this.treeBuildingState.reset()}collapseTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),this.refreshTree()}expandTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!0})),this.refreshTree()}async buildTreeDataByLayer(e){const t=this.getTreeData(),s=[];return await Promise.all(e.map((e=>new Promise(((i,n)=>setTimeout((()=>{const a=e.li_attr.id,r={id:a,label:e.text,data:e,childrenIds:e.type?void 0:[],isLoading:!1};if(e.type&&this.allTests.set(a,e),t.nodes.set(a,r),"Root"!==e.li_attr.parentId)try{const s=B(t.nodes.get((o=e,`test${this.testExecutionResult.runnerId}_${o.li_attr.parentId}`)),`Can't find parent test node with ID '${e.li_attr.parentId}'`);s.childrenIds?w(s.childrenIds,a):s.childrenIds=[a]}catch(e){return void n(e)}var o;s.push(...e.children),i()}),0)))))),s.length?this.buildTreeDataByLayer(s):Promise.resolve()}*pollTestRunnerResult(){if(this.checkTestRunnerState.isInInitialState){this.checkTestRunnerState.inProgress();try{Z(this.allTests.size===this.testExecutionResult.count,`Number of tests scanned in tree (${this.allTests.size}) does not match the number of total reported tests (${this.testExecutionResult.count})`);const e=new Hh(new Set(this.allTests.keys()));this.testResultInfo=e,yield this.pullTestRunnerResult(e)}finally{this.checkTestRunnerState.reset()}}}async pullTestRunnerResult(e){const t=(s=await this.editorStore.client.checkTestRunner(this.testExecutionResult.runnerId)).error?(0,ze.vB)($h,s):(0,ze.vB)(Bh,s);var s;return t instanceof Bh?(await Promise.all(t.tests.map((t=>P((()=>{return e.addResult(t,(s=t,`test${this.testExecutionResult.runnerId}_${s.test.join("_")}`));var s}))))),t.finished?Promise.resolve():new Promise(((t,s)=>setTimeout((()=>{try{t(this.pullTestRunnerResult(e))}catch(e){j(e),this.editorStore.applicationStore.notifyWarning("Failed to run test"+(e.message?`: ${e.message}`:"")),s(e)}}),1e3)))):(this.setTestResultInfo(void 0),Promise.resolve())}*rerunTestSuite(){this.editorStore.testRunState.isInProgress||(yield(0,O.fl)(this.editorStore.executeTests(this.testExecutionResult.path,this.testExecutionResult.relevantTestsOnly)))}*cancelTestRun(){this.editorStore.testRunState.isInProgress&&(yield this.editorStore.client.cancelTestRunner(this.testExecutionResult.runnerId),this.editorStore.applicationStore.notifyWarning(`Stopped running test (id: ${this.testExecutionResult.runnerId}) successfully!`))}}const Wh=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Kh{source;line;column;startLine;startColumn;endLine;endColumn}(0,ze.yu)(Kh,{source:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),startLine:(0,ze.Ru)(),startColumn:(0,ze.Ru)(),endLine:(0,ze.Ru)(),endColumn:(0,ze.Ru)()});class Zh{}class Xh extends Zh{error;errorDialog;text}(0,ze.yu)(Xh,{error:(0,ze.Ru)(),errorDialog:(0,ze.Ru)(),text:(0,ze.Ru)()});class qh{networkClient;userId="localuser";sessionId=`${this.userId}@${Date.now()}@abcd`;compilerMode;mode;constructor(e){this.networkClient=e}get baseUrl(){return B(this.networkClient.baseUrl,"Pure client has not been configured properly")}initialize=e=>this.networkClient.get(`${this.baseUrl}/initialize`,void 0,void 0,{requestCache:e,sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getInitializationActivity=()=>this.networkClient.get(`${this.baseUrl}/initializationActivity`,void 0,void 0,{sessionId:this.sessionId});getFile=e=>this.networkClient.get(`${this.baseUrl}/fileAsJson/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getDirectoryChildren=e=>this.networkClient.get(`${this.baseUrl}/dir`,void 0,void 0,{parameters:e??"/",mode:this.mode,sessionId:this.sessionId});getConceptChildren=e=>this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::display_ide(String[1]):String[1]",param:e?`'${e}'`:"'::'",format:"raw",mode:this.mode,sessionId:this.sessionId});getConceptActivity=()=>this.networkClient.get(`${this.baseUrl}/conceptsActivity`,void 0,void 0,{sessionId:this.sessionId});execute=(e,t,s)=>this.networkClient.post(`${this.baseUrl}/${t}`,{extraParams:s,openFiles:e},void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getExecutionActivity=()=>this.networkClient.get(`${this.baseUrl}/executionActivity`,void 0,void 0,{sessionId:this.sessionId});findFiles=(e,t)=>this.networkClient.get(`${this.baseUrl}/findPureFiles`,void 0,void 0,{file:e,regex:t});searchText=(e,t,s,i=2e3)=>this.networkClient.get(`${this.baseUrl}/findInSources`,void 0,void 0,{string:e,caseSensitive:t,regex:s,limit:i});checkTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCheck`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});cancelTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCancel`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});getConceptPath=(e,t,s)=>this.networkClient.get(`${this.baseUrl}/getConceptPath`,void 0,void 0,{file:e,line:t,column:s});getUsages=(e,t)=>this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:e,param:t});createFile=e=>this.networkClient.get(`${this.baseUrl}/newFile/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});createFolder=e=>this.networkClient.get(`${this.baseUrl}/newFolder/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});deleteDirectoryOrFile=e=>this.networkClient.get(`${this.baseUrl}/deleteFile/${e}`,void 0,void 0,{sessionId:this.sessionId});getDiagramInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramInfo_String_1__String_1_",param:[`'${e}'`]}));getDiagramClassInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramClassInfo_String_1__String_1_",param:[`'${e}'`]}))}class Jh{_initialDefaultSize;_tempSize;size;defaultSize;snapSize;maxSize;constructor(e){this.size=e.initial,this._tempSize=e.default,this.defaultSize=e.default,this._initialDefaultSize=e.default,this.snapSize=e.snap,(0,O.rC)(this,{_tempSize:O.LO,size:O.LO,defaultSize:O.LO,snapSize:O.LO,maxSize:O.LO,isOpen:O.Fl,isMaximizable:O.Fl,isMaximized:O.Fl,setSize:O.aD,open:O.aD,close:O.aD,toggle:O.aD,setMaxSize:O.aD,maximize:O.aD,minimize:O.aD,toggleMaximize:O.aD})}get isOpen(){return 0!==this.size}get isMaximizable(){return void 0!==this.maxSize}get isMaximized(){return void 0!==this.maxSize&&this.size===this.maxSize}setSize(e){e=Math.max(e,0),this.maxSize&&(e=Math.min(e,this.maxSize)),this.size!==e&&(void 0!==this.snapSize?e>this.size?this.maxSize&&e>this.maxSize-this.snapSize?this.size=this.maxSize:this.size=e<this.snapSize?this.defaultSize:e:this.size=e<this.snapSize?0:e:this.size=e)}open(){0===this.size&&(this.size=this._tempSize)}close(){0!==this.size&&(this._tempSize=this.size||this.defaultSize,this.size=0)}toggle(){0===this.size?this.open():this.close()}setMaxSize(e){this._tempSize=Math.min(this._tempSize,e),this.size=Math.min(this.size,e),this.defaultSize=Math.min(this._initialDefaultSize,e),this.maxSize=e}maximize(){void 0!==this.maxSize&&this.size!==this.maxSize&&(this._tempSize=this.size,this.size=this.maxSize)}minimize(){void 0!==this.maxSize&&this.size===this.maxSize&&(this.size=this._tempSize===this.maxSize?this.defaultSize:this._tempSize)}toggleMaximize(){void 0!==this.maxSize&&(this.size===this.maxSize?this.minimize():this.maximize())}}var Qh,eu=s(1367);class tu{_UUID=(0,a.Z)();_OWNER;name;genericType;multiplicity;stereotypes=[];taggedValues=[];body;parameters;constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return Zt([Xt.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues),Qt(this.parameters,this.body)])}}class su extends ms{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class iu extends su{ownerReference;constructor(e){const t=Es.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new iu(e)}}class nu{_UUID=(0,a.Z)();rawType;constructor(e){this.rawType=e}}class au{_UUID=(0,a.Z)();_OWNER;name;multiplicity;genericType;aggregation;stereotypes=[];taggedValues=[];constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return Zt([Xt.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues)])}}class ru{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Zt([Xt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new ru(0,0);static ZERO_ONE=new ru(0,1);static ZERO_MANY=new ru(0,void 0);static ONE=new ru(1,1);static ONE_MANY=new ru(1,void 0)}class ou extends ms{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Xt.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(Kt).join(",")}}class lu extends ou{ownerReference;constructor(e){const t=Es.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new lu(e)}}class cu extends rs{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new cu(Te.STRING);static BOOLEAN=new cu(Te.BOOLEAN);static BINARY=new cu(Te.BINARY);static NUMBER=new cu(Te.NUMBER);static INTEGER=new cu(Te.INTEGER);static FLOAT=new cu(Te.FLOAT);static DECIMAL=new cu(Te.DECIMAL);static DATE=new cu(Te.DATE);static STRICTDATE=new cu(Te.STRICTDATE);static DATETIME=new cu(Te.DATETIME);static STRICTTIME=new cu(Te.STRICTTIME);static LATESTDATE=new cu(Te.LATESTDATE)}!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(Qh=Qh||(Qh={}));class du extends oc{association;constructor(e,t,s,i,n){super(e,s,i,n),this.association=t}get hashCode(){return Zt([Wo.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const hu=()=>new as(""),uu=(e,t)=>new au("",ru.ONE,iu.create(new nu(e)),t),pu=(0,O.aD)(((e,t)=>{e.value=t})),_u=((0,O.aD)(((e,t)=>{b(e.properties,t)})),(0,O.aD)(((e,t)=>{w(e.properties,Po(t))}))),mu=((0,O.aD)(((e,t,s)=>{L(e.properties,t,s)})),(0,O.aD)(((e,t)=>{b(e.derivedProperties,t)})),(0,O.aD)(((e,t)=>{w(e.derivedProperties,wo(t))})),(0,O.aD)(((e,t,s)=>{L(e.derivedProperties,t,s)})),(0,O.aD)(((e,t)=>{w(e.constraints,bo(t))})),(0,O.aD)(((e,t)=>{b(e.constraints,t)})),(0,O.aD)(((e,t,s)=>{L(e.constraints,t,s)})),(0,O.aD)(((e,t)=>{w(e.generalizations,To(t))}))),gu=((0,O.aD)(((e,t)=>{b(e.generalizations,t)})),(0,O.aD)(((e,t,s)=>{L(e.generalizations,t,s)})),(0,O.aD)(((e,t)=>{w(e._subclasses,t)})),(0,O.aD)(((e,t)=>{b(e._subclasses,t)})),(0,O.aD)(((e,t)=>{To(e),fo(t),e.value=t,e.ownerReference.value=t.rawType}))),Eu=((0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{gu(e.genericType,fo(t))})),(0,O.aD)(((e,t)=>{e.multiplicity=t})),(0,O.aD)(((e,t)=>{e.aggregation=t})),(0,O.aD)(((e,t)=>{e.value=No(t),pu(e.ownerReference,t._OWNER)})),(0,O.aD)(((e,t)=>{w(e.taggedValues,Eo(t))})),(0,O.aD)(((e,t)=>{b(e.taggedValues,t)})),(0,O.aD)(((e,t)=>{w(e.stereotypes,mo(t))})),(0,O.aD)(((e,t)=>{b(e.stereotypes,t)})),(0,O.aD)(((e,t)=>{e.tag.value=Oo(t),e.tag.ownerReference.value=t._OWNER})),(0,O.aD)(((e,t)=>{e.value=t})),(0,O.aD)(((e,t)=>{e.value=t})),(0,O.aD)(((e,t,s)=>{L(e.taggedValues,t,s)})),(0,O.aD)(((e,t,s)=>{L(e.stereotypes,t,s)})),(0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{e.functionDefinition=Vs(t)})),(0,O.aD)(((e,t)=>{w(e.p_tags,Oo(t))})),(0,O.aD)(((e,t)=>{b(e.p_tags,t)})),(0,O.aD)(((e,t)=>{w(e.p_stereotypes,No(t))})),(0,O.aD)(((e,t)=>{b(e.p_stereotypes,t)})),(0,O.aD)(((e,t,s)=>{L(e.p_tags,t,s)})),(0,O.aD)(((e,t,s)=>{L(e.p_stereotypes,t,s)})),(0,O.aD)(((e,t)=>{b(e.parameters,t)})),(0,O.aD)(((e,t)=>{w(e.parameters,Gs(t))})),(0,O.aD)(((e,t)=>{pu(e.returnType,Fo(t))})),(0,O.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,O.aD)(((e,t,s)=>{L(e.parameters,t,s)})),(0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{w(e.values,So(t))})),(0,O.aD)(((e,t)=>{b(e.values,t)})),(0,O.aD)(((e,t,s)=>{L(e.values,t,s)})),(0,O.aD)(((e,t)=>{e.value=So(t),pu(e.ownerReference,t._OWNER)})),(0,O.aD)(((e,t,s)=>{const i=((e,t)=>{const s=e.properties.findIndex((e=>e===t));return Z(-1!==s,`Can't find property '${t.name}' in association '${e.path}'`),B(e.properties[(s+1)%2])})(e,t),n=Y(t.genericType.ownerReference.value,as,`Association property '${t.name}' must be of type 'class'`);var a;((a=n).package||a.name)&&Z(b(n.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${n.path}'`),w(s.propertiesFromAssociations,i);const r=new nu(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,O.aD)(((e,t)=>{e.canonicalUnit=vo(t)})),(0,O.aD)(((e,t)=>{e.conversionFunction=Vs(t)})),(0,O.aD)(((e,t)=>{e.classViews=t.map(Vo)}))),fu=(0,O.aD)(((e,t)=>{w(e.classViews,Vo(t))})),Tu=(0,O.aD)(((e,t)=>{b(e.classViews,t)})),Cu=(0,O.aD)(((e,t)=>{e.associationViews=t.map($o)})),xu=(0,O.aD)(((e,t)=>{b(e.associationViews,t)})),Nu=(0,O.aD)(((e,t)=>{e.generalizationViews=t.map(Bo)})),Ou=(0,O.aD)(((e,t)=>{w(e.generalizationViews,Bo(t))})),Au=(0,O.aD)(((e,t)=>{b(e.generalizationViews,t)})),Su=(0,O.aD)(((e,t)=>{e.propertyViews=t.map(Ho)})),yu=(0,O.aD)(((e,t)=>{w(e.propertyViews,Ho(t))})),Iu=(0,O.aD)(((e,t)=>{b(e.propertyViews,t)})),vu=(0,O.aD)(((e,t)=>{e.hideProperties=t})),Ru=(0,O.aD)(((e,t)=>{e.hideStereotypes=t})),Pu=(0,O.aD)(((e,t)=>{e.hideTaggedValues=t})),wu=(0,O.aD)(((e,t)=>{e._offsetX=t})),Lu=(0,O.aD)(((e,t)=>{e._offsetY=t})),bu=(0,O.aD)(((e,t,s)=>{((e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t)));-1!==n&&(e[n]=s)})(e.path,t,s)})),Du=(0,O.aD)(pc),Mu=(0,O.aD)(((e,t,s,i,n)=>{for(const n of e.path)if(Math.sqrt((t-n.x)*(t-n.x)+(s-n.y)*(s-n.y))<10/i)return n;const a=e.buildFullPath(n),r=[];let o;for(let e=0;e<a.length-1;e++){const n=a[e],l=a[e+1],c=new dc(n.x,n.y).normal(new dc(l.x,l.y)).unit(),d=dc.fromPoints(n,new Ql(t,s));if(Math.abs(c.dotProduct(d))<5/i){const e=(n.x<l.x?n.x:l.x)-5/i,a=(n.x<l.x?l.x:n.x)+5/i,c=(n.y<l.y?n.y:l.y)-5/i,d=(n.y<l.y?l.y:n.y)+5/i;e<=t&&t<=a&&c<=s&&s<=d&&(o=new Ql(t,s),r.push(o))}e<a.length-2&&r.push(a[e+1])}return o&&n&&uc(e,r),o})),ku=(0,O.aD)(uc),Fu=(0,O.aD)(((e,t)=>{e.rectangle=t})),ju=(0,O.aD)(((e,t)=>{e.position=t})),Uu=(0,O.aD)((e=>{e._dummyObservable={}}));var Vu,Gu,zu;!function(e){e[e.LAYOUT=0]="LAYOUT",e[e.PAN=1]="PAN",e[e.ZOOM_IN=2]="ZOOM_IN",e[e.ZOOM_OUT=3]="ZOOM_OUT",e[e.ADD_RELATIONSHIP=4]="ADD_RELATIONSHIP",e[e.ADD_CLASS=5]="ADD_CLASS"}(Vu=Vu||(Vu={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(Gu=Gu||(Gu={})),function(e){e[e.ALIGN_LEFT=0]="ALIGN_LEFT",e[e.ALIGN_CENTER=1]="ALIGN_CENTER",e[e.ALIGN_RIGHT=2]="ALIGN_RIGHT",e[e.ALIGN_TOP=3]="ALIGN_TOP",e[e.ALIGN_MIDDLE=4]="ALIGN_MIDDLE",e[e.ALIGN_BOTTOM=5]="ALIGN_BOTTOM",e[e.SPACE_HORIZONTALLY=6]="SPACE_HORIZONTALLY",e[e.SPACE_VERTICALLY=7]="SPACE_VERTICALLY"}(zu=zu||(zu={}));const Bu=.05,$u=[50,75,90,100,110,125,150,200,250,300,400],Hu=e=>(e instanceof tu?"/ ":"")+e.name;class Yu{diagram;isReadOnly;div;canvas;ctx;canvasDimension;canvasCenter;virtualScreen;screenOffset;zoom;interactionMode;relationshipMode;triangle;diamond;fontFamily;fontSize;lineHeight;truncateText;maxLineLength;screenPadding;classViewSpaceX;classViewSpaceY;propertySpacing;showScreenGrid;showScreenBoxGuide;screenGridAxisTickLength;screenGridSpacingX;screenGridSpacingY;screenGridLineWidth;screenGridLineColor;screenGridLabelTextColor;screenGuideLineColor;screenGuideLabelTextColor;showCanvasGrid;showCanvasBoxGuide;showScreenOffsetGuide;canvasGridAxisTickLength;canvasGridSpacingX;canvasGridSpacingY;canvasGridLineWidth;canvasGridLineColor;canvasGridLabelTextColor;canvasGuideLineColor;canvasGuideLabelTextColor;screenOffsetGuideLineColor;screenOffsetGuideLabelTextColor;defaultLineWidth;defaultLineColor;canvasColor;backgroundColor;classViewFillColor;classViewHeaderTextColor;classViewPropertyTextColor;classViewPrimitivePropertyTextColor;classViewDerivedPropertyTextColor;relationshipViewTextColor;propertyViewOwnedDiamondColor;propertyViewSharedDiamondColor;generalizationViewInheritanceTriangeFillColor;selectionBoxBorderColor;selection;selectionStart;selectedClassCorner;selectedClassProperty;selectedClasses;selectedPropertyOrAssociation;selectedInheritance;selectedPoint;_selectedClassesInitialPositions;startClassView;handleAddRelationship;mouseOverClassCorner;mouseOverClassName;mouseOverClassView;mouseOverClassProperty;mouseOverPropertyHolderViewLabel;cursorPosition;leftClick;middleClick;rightClick;clickX;clickY;positionBeforeLastMove;onAddClassViewClick=()=>{};onClassViewRightClick=()=>{};onBackgroundDoubleClick;onClassViewDoubleClick;onClassNameDoubleClick;onClassPropertyDoubleClick;handleEditClassView=()=>{};handleEditProperty=()=>{};handleAddSimpleProperty=()=>{};constructor(e,t){(0,O.rC)(this,{isReadOnly:O.LO,interactionMode:O.LO,relationshipMode:O.LO,zoom:O.LO,mouseOverClassView:O.LO,mouseOverClassName:O.LO,mouseOverClassCorner:O.LO,mouseOverClassProperty:O.LO,mouseOverPropertyHolderViewLabel:O.LO,selectionStart:O.LO,selectedClassCorner:O.LO,selectedClasses:O.LO,selectedPropertyOrAssociation:O.LO,selectedInheritance:O.LO,leftClick:O.LO,middleClick:O.LO,rightClick:O.LO,changeMode:O.aD,setIsReadOnly:O.aD,setMouseOverClassView:O.aD,setMouseOverClassName:O.aD,setMouseOverClassCorner:O.aD,setMouseOverClassProperty:O.aD,setMouseOverPropertyHolderViewLabel:O.aD,setSelectionStart:O.aD,setSelectedClassCorner:O.aD,setSelectedClasses:O.aD,setSelectedPropertyOrAssociation:O.aD,setSelectedInheritance:O.aD,setLeftClick:O.aD,setMiddleClick:O.aD,setRightClick:O.aD,setZoomLevel:O.aD,align:O.aD}),this.diagram=t,this.div=e,this.div.childNodes.forEach((e=>this.div.removeChild(e))),this.canvas=document.createElement("canvas"),this.canvasDimension=new ec(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Ql(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height,this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.div.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.screenOffset=new Ql(0,0),this.virtualScreen=new tc(new Ql(0,0),new ec(0,0)),this.zoom=1,this.triangle=[new Ql(0,0),new Ql(-15,-10),new Ql(-15,10)],this.diamond=[new Ql(0,0),new Ql(-10,-5),new Ql(-20,0),new Ql(-10,5)],this.fontFamily="Arial",this.fontSize=12,this.lineHeight=14,this.truncateText=!0,this.maxLineLength=40,this.showScreenGrid=!1,this.showScreenBoxGuide=!0,this.screenGridAxisTickLength=50,this.screenGridSpacingX=100,this.screenGridSpacingY=100,this.screenGridLineWidth=.5,this.showCanvasGrid=!1,this.showCanvasBoxGuide=!0,this.showScreenOffsetGuide=!0,this.canvasGridAxisTickLength=50,this.canvasGridSpacingX=100,this.canvasGridSpacingY=100,this.canvasGridLineWidth=.5,this.defaultLineWidth=1,this.screenGridLineColor="rgba(61,126,154,0.56)",this.screenGridLabelTextColor="rgba(61,126,154,0.56)",this.screenGuideLineColor="red",this.screenGuideLabelTextColor="red",this.canvasGridLineColor="green",this.canvasGridLabelTextColor="green",this.canvasGuideLineColor="orange",this.canvasGuideLabelTextColor="orange",this.screenOffsetGuideLineColor="purple",this.screenOffsetGuideLabelTextColor="purple",this.defaultLineColor="rgb(0,0,0)",this.canvasColor="rgb(220,220,220)",this.backgroundColor="rgb(255,255,255)",this.classViewFillColor="rgb(185,185,185)",this.classViewHeaderTextColor="rgb(0,0,0)",this.classViewPropertyTextColor="rgb(0,0,0)",this.classViewPrimitivePropertyTextColor="rgb(255,255,255)",this.classViewDerivedPropertyTextColor="rgb(100,100,100)",this.relationshipViewTextColor="rgb(0,0,0)",this.propertyViewSharedDiamondColor="rgb(255,255,255)",this.propertyViewOwnedDiamondColor="rgb(0,0,0)",this.generalizationViewInheritanceTriangeFillColor="rgb(255,255,255)",this.selectionBoxBorderColor="rgba(0,0,0, 0.02)",this.interactionMode=Vu.LAYOUT,this.relationshipMode=Gu.NONE,this.isReadOnly=!1,this.screenPadding=20,this.classViewSpaceX=10,this.classViewSpaceY=4,this.propertySpacing=10,this.selectionStart=void 0,this.selection=void 0,this.selectedClasses=[],this._selectedClassesInitialPositions=[],this.cursorPosition=new Ql(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new Ql(0,0),this.div.onwheel=this.mousewheel.bind(this),this.div.onmousedown=this.mousedown.bind(this),this.div.onkeydown=this.keydown.bind(this),this.div.ondblclick=this.mousedblclick.bind(this),this.div.onmouseup=this.mouseup.bind(this),this.div.onmousemove=this.mousemove.bind(this)}setIsReadOnly(e){this.isReadOnly=e}setMouseOverClassView(e){this.mouseOverClassView=e}setMouseOverClassName(e){this.mouseOverClassName=e}setMouseOverClassCorner(e){this.mouseOverClassCorner=e}setMouseOverClassProperty(e){this.mouseOverClassProperty=e}setMouseOverPropertyHolderViewLabel(e){this.mouseOverPropertyHolderViewLabel=e}setSelectionStart(e){this.selectionStart=e}setSelectedClassCorner(e){this.selectedClassCorner=e}setSelectedClasses(e){this.selectedClasses=e}setSelectedPropertyOrAssociation(e){this.selectedPropertyOrAssociation=e}setSelectedInheritance(e){this.selectedInheritance=e}setLeftClick(e){this.leftClick=e}setMiddleClick(e){this.middleClick=e}setRightClick(e){this.rightClick=e}setZoomLevel(e){this.zoom=e}render(){this.diagram.classViews.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),this.refresh()}refresh(){this.refreshCanvas(),this.drawScreen()}refreshCanvas(){this.canvasDimension=new ec(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Ql(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height}clearScreen(){this.ctx.fillStyle=this.canvasColor,this.ctx.fillRect(0,0,this.canvasDimension.width,this.canvasDimension.height)}drawScreen(){this.manageVirtualScreen(),this.clearScreen(),this.drawAll()}autoRecenter(){this.center(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}center(e,t){this.screenOffset=new Ql(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case Vu.LAYOUT:case Vu.PAN:case Vu.ZOOM_IN:case Vu.ZOOM_OUT:case Vu.ADD_CLASS:if(t!==Gu.NONE)throw new k(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case Vu.ADD_RELATIONSHIP:if(t===Gu.NONE)throw new k("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new F(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===Vu.ADD_RELATIONSHIP)switch(t){case Gu.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||$l(e.class.value).includes(t.class.value)||$l(t.class.value).includes(e.class.value)||mu(e.class.value,iu.create(new nu(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new cc(this.diagram,e,t);return Ou(this.diagram,s),s}};break;case Gu.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new au(`property_${e.class.value.properties.length+1}`,ru.ONE,iu.create(new nu(t.class.value)),e.class.value);if(_u(e.class.value,s),e!==t){const i=new lc(this.diagram,lu.create(s),e,t);return yu(this.diagram,i),i}};break;default:throw new F(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case zu.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>ju(t,new Ql(e,t.position.y))));break}case zu.ALIGN_CENTER:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.x+t.rectangle.width/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>ju(t,new Ql(e-t.rectangle.width/2,t.position.y))));break}case zu.ALIGN_RIGHT:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.x+t.rectangle.width)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>ju(t,new Ql(e-t.rectangle.width,t.position.y))));break}case zu.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>ju(t,new Ql(t.position.x,e))));break}case zu.ALIGN_MIDDLE:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.y+t.rectangle.height/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>ju(t,new Ql(t.position.x,e-t.rectangle.height/2))));break}case zu.ALIGN_BOTTOM:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.y+t.rectangle.height)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>ju(t,new Ql(t.position.x,e-t.rectangle.height))));break}case zu.SPACE_HORIZONTALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.x-t.position.x));if(2===e.length){const t=e[0],s=e[1];ju(s,new Ql(t.position.x+t.rectangle.width,s.position.y))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.x-(i.position.x+i.rectangle.width))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];ju(n,new Ql(i.position.x+i.rectangle.width+s,n.position.y))}}break}case zu.SPACE_VERTICALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.y-t.position.y));if(2===e.length){const t=e[0],s=e[1];ju(s,new Ql(s.position.x,t.position.y+t.rectangle.height))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.y-(i.position.y+i.rectangle.height))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];ju(n,new Ql(n.position.x,i.position.y+i.rectangle.height+s))}}break}}this.drawScreen()}}truncateTextWithEllipsis(e,t=this.maxLineLength){return e.length>t?`${e.substring(0,t+1-"...".length)}...`:e}canvasCoordinateToModelCoordinate(e){return new Ql((e.x-this.canvasCenter.x)/this.zoom-this.screenOffset.x+this.canvasCenter.x,(e.y-this.canvasCenter.y)/this.zoom-this.screenOffset.y+this.canvasCenter.y)}modelCoordinateToCanvasCoordinate(e){return new Ql((e.x-this.canvasCenter.x+this.screenOffset.x)*this.zoom+this.canvasCenter.x,(e.y-this.canvasCenter.y+this.screenOffset.y)*this.zoom+this.canvasCenter.y)}eventCoordinateToCanvasCoordinate(e){return new Ql(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new Ql(e.x-this.div.scrollLeft+this.divPosition.x,e.y-this.div.scrollTop+this.divPosition.y)}hasPropertyView(e,t){return this.diagram.propertyViews.filter((s=>s.property.value===t&&s.from.classView.value===e)).length>0}get divPosition(){return(e=>{let t=0,s=0;for(;e.offsetParent;)t+=e.offsetLeft-e.scrollLeft+e.clientLeft,s+=e.offsetTop-e.scrollTop+e.clientTop,e=e.offsetParent;return new Ql(t,s)})(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=B(this.diagram.classViews[0]);let t=e.position.x,s=e.position.y,i=e.position.x+e.rectangle.width,n=e.position.y+e.rectangle.height;for(const e of this.diagram.classViews)t=Math.min(t,e.position.x),s=Math.min(s,e.position.y),i=Math.max(i,e.position.x+e.rectangle.width),n=Math.max(n,e.position.y+e.rectangle.height);const a=this.diagram.associationViews.concat(this.diagram.generalizationViews).concat(this.diagram.propertyViews);for(const e of a){const a=rc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof lc){const r=this.drawLinePropertyText(a[a.length-2],a[a.length-1],e.to.classView.value,e.property.value,!1);t=Math.min(t,r.position.x),s=Math.min(s,r.position.y),i=Math.max(i,gc(r).x),n=Math.max(n,gc(r).y)}for(const a of e.path)t=Math.min(t,a.x),s=Math.min(s,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y)}this.virtualScreen=new tc(new Ql(t,s),new ec(i-t,n-s))}else this.setZoomLevel(1),this.screenOffset=new Ql(0,0),this.virtualScreen=new tc(new Ql(this.canvasDimension.width/2,this.canvasDimension.height/2),new ec(0,0))}executeZoom(e,t){e=Math.max(e,Bu);const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)),i=this.zoom;this.setZoomLevel(e),this.screenOffset=new Ql(((s.x-this.canvasCenter.x)*(i-e)+this.screenOffset.x*i)/e,((s.y-this.canvasCenter.y)*(i-e)+this.screenOffset.y*i)/e),this.clearScreen(),this.drawAll()}zoomPoint(e,t){this.executeZoom(e,t)}zoomCenter(e){this.setZoomLevel(Math.max(e,Bu)),this.clearScreen(),this.drawAll()}zoomToFit(){this.autoRecenter(),this.zoomCenter(Math.max(Math.min(this.canvas.width/(this.virtualScreen.rectangle.width+2*this.screenPadding+20),this.canvas.height/(this.virtualScreen.rectangle.height+2*this.screenPadding+20)),Bu))}addClassView(e,t){if(!this.isReadOnly){const s=this.diagram.classViews.map((e=>e.id));let i=(0,a.Z)();for(;s.includes(i);)i=(0,a.Z)();const n=new sc(this.diagram,i,Es.create(e));return ju(n,t??this.canvasCoordinateToModelCoordinate(new Ql(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),fu(this.diagram,n),Uu(n),this.diagram.classViews.filter((t=>t.class.value!==e)).forEach((t=>{const s=t.class.value;e.generalizations.map((e=>e.value.rawType)).includes(s)&&Ou(this.diagram,new cc(this.diagram,n,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&Ou(this.diagram,new cc(this.diagram,t,n)),Hl(e).forEach((e=>{e.genericType.value.rawType===s&&yu(this.diagram,new lc(this.diagram,lu.create(e),n,t))})),Hl(s).forEach((s=>{s.genericType.value.rawType===e&&yu(this.diagram,new lc(this.diagram,lu.create(s),t,n))}))})),this.drawClassView(n),this.drawScreen(),n}}drawBoundingBox(){this.ctx.fillStyle=this.backgroundColor,this.ctx.lineWidth=1,this.ctx.fillRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom),this.ctx.strokeRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom)}drawDiagram(){this.diagram.associationViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.generalizationViews.forEach((e=>this.drawInheritance(e))),this.diagram.propertyViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.classViews.forEach((e=>this.drawClassView(e))),this.showCanvasGrid&&this.drawCanvasGrid(),this.showScreenGrid&&this.drawScreenGrid()}drawAll(){this.drawBoundingBox(),this.drawDiagram()}drawScreenGrid(){const e=(this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t=(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y,s=(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,i=(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom;this.ctx.beginPath(),this.ctx.fillStyle=this.screenGridLabelTextColor,this.ctx.strokeStyle=this.screenGridLineColor,this.ctx.lineWidth=this.screenGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`;let n=0;for(let a=e;a<e+s-2*this.screenPadding;a+=this.screenGridSpacingX*this.zoom)this.ctx.fillText(`${n}`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+n)}]`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding-this.lineHeight)*this.zoom),this.ctx.moveTo(a,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.lineTo(a,t+i-this.screenPadding*this.zoom),this.ctx.stroke(),n+=this.screenGridSpacingX;let a=0;for(let n=t;n<t+i-2*this.screenPadding;n+=this.screenGridSpacingY*this.zoom)this.ctx.fillText(`${a}`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+a)}]`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+(5+this.lineHeight)*this.zoom),this.ctx.moveTo(e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n),this.ctx.lineTo(e+s-this.screenPadding*this.zoom,n),this.ctx.stroke(),a+=this.screenGridSpacingY;this.showScreenBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.screenGuideLabelTextColor,this.ctx.strokeStyle=this.screenGuideLineColor,this.ctx.moveTo(e,t),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.lineTo(e,t),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.width/2)}`,e+s/2-(this.screenPadding-5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2)}]`,e+s/2-(this.screenPadding-5)*this.zoom,t+(5+this.lineHeight)*this.zoom),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.height/2)}`,e+5*this.zoom,t+i/2-(this.screenPadding-5)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}]`,e+5*this.zoom,t+i/2-(this.screenPadding-5-this.lineHeight)*this.zoom),this.ctx.lineTo(e,t+i/2-this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i/2-this.screenPadding*this.zoom),this.ctx.stroke()),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawCanvasGrid(){const e=-this.canvasCenter.x*this.zoom+this.canvasCenter.x,t=-this.canvasCenter.y*this.zoom+this.canvasCenter.y,s=this.canvasDimension.width,i=this.canvasDimension.height;this.ctx.setLineDash([5,5]),this.ctx.fillStyle=this.canvasGridLabelTextColor,this.ctx.strokeStyle=this.canvasGridLineColor,this.ctx.lineWidth=this.canvasGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,this.ctx.beginPath();let n=0;for(let t=e;t<s;t+=this.canvasGridSpacingX*this.zoom)0!==t&&this.ctx.fillText(`[${Math.round(n)}]`,t+5*this.zoom,5*this.zoom),this.ctx.moveTo(t,0),this.ctx.lineTo(t,i),this.ctx.stroke(),n+=this.canvasGridSpacingX;let a=0;for(let e=t;e<i;e+=this.canvasGridSpacingY*this.zoom)0!==e&&this.ctx.fillText(`[${Math.round(a)}]`,5*this.zoom,e+5*this.zoom),this.ctx.moveTo(0,e),this.ctx.lineTo(s,e),this.ctx.stroke(),a+=this.canvasGridSpacingY;if(this.showCanvasBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.canvasGuideLabelTextColor,this.ctx.strokeStyle=this.canvasGuideLineColor,this.ctx.fillText(`[${Math.round(s/2)}]`,s/2+5*this.zoom,5*this.zoom),this.ctx.moveTo(s/2,0),this.ctx.lineTo(s/2,i),this.ctx.stroke(),this.ctx.fillText(`[${Math.round(i/2)}]`,5*this.zoom,i/2+5*this.zoom),this.ctx.moveTo(0,i/2),this.ctx.lineTo(s,i/2),this.ctx.stroke()),this.showScreenOffsetGuide){const s=5,i=35;this.ctx.beginPath(),this.ctx.setLineDash([]),this.ctx.fillStyle=this.screenOffsetGuideLabelTextColor,this.ctx.strokeStyle=this.screenOffsetGuideLineColor,this.ctx.arc(e+this.screenOffset.x*this.zoom,t+this.screenOffset.y*this.zoom,s*this.zoom,0,2*Math.PI),this.ctx.moveTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x+2*s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y+2*s)*this.zoom),this.ctx.stroke(),this.ctx.setLineDash([5,5]),this.ctx.moveTo(e,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+0),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.stroke(),this.ctx.beginPath(),this.screenOffset.x>=i&&this.screenOffset.y>=i?(this.ctx.fillText(`[${Math.round(this.screenOffset.x)}]`,e+(this.screenOffset.x+5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.screenOffset.y)}]`,e+5*this.zoom,t+(this.screenOffset.y+5)*this.zoom)):this.screenOffset.x>=0&&this.screenOffset.y>=0?this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(this.screenOffset.x+s+5)*this.zoom,t+(this.screenOffset.y+s+5)*this.zoom):this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(s+5)*this.zoom,t+(s+5)*this.zoom)}this.ctx.setLineDash([]),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawClassViewProperty(e,t,s,i,n){this.ctx.font=this.mouseOverClassView===e&&this.mouseOverClassProperty===t?`bold ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`:`${n?"bold":""} ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const a=Hu(t);let r=this.ctx.measureText(`${a} : `).width;n||(this.ctx.fillText(`${a} : `,s,i),this.ctx.fillText(t.genericType.value.rawType.name,s+r,i),t.genericType.value.rawType instanceof os&&(this.ctx.beginPath(),this.ctx.moveTo(s+r,i+(this.fontSize-1)*this.zoom),this.ctx.lineTo(s+r+this.ctx.measureText(t.genericType.value.rawType.name).width,i+(this.fontSize-1)*this.zoom),this.ctx.stroke())),r+=this.ctx.measureText(t.genericType.value.rawType.name).width,this.ctx.font=`${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const o=je(t.multiplicity.lowerBound,t.multiplicity.upperBound);return n||this.ctx.fillText(`[${o}]`,s+r,i),r+=this.ctx.measureText(`[${o}]`).width,r}computeClassNameWidth(e){return this.ctx.font=`bold ${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top",this.ctx.measureText(this.truncateTextWithEllipsis(e.class.value.name)).width}ensureClassViewMeetMinDimensions(e){let t=this.computeClassNameWidth(e),s=this.lineHeight+2*this.classViewSpaceY;if(!e.hideStereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;for(const i of e.class.value.stereotypes){const e=`<< ${this.truncateTextWithEllipsis(i.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(!e.hideTaggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top";for(const i of e.class.value.taggedValues){const e=`{ ${this.truncateTextWithEllipsis(`${i.tag.value.value} = ${i.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(e.hideProperties||(Hl(e.class.value).forEach((i=>{if(!this.hasPropertyView(e,i)){const n=this.drawClassViewProperty(e,i,0,0,!0);t=Math.max(t,n),s+=this.lineHeight}})),s+=2*this.classViewSpaceY),t+=2*this.classViewSpaceX,!this.isReadOnly){const i=e.rectangle.width&&e.rectangle.width>t?e.rectangle.width:t,n=e.rectangle.height&&e.rectangle.height>s?e.rectangle.height:s;Fu(e,new ec(i,n))}}drawClassView(e){const t=this.computeClassNameWidth(e);this.ensureClassViewMeetMinDimensions(e),this.ctx.fillStyle=this.classViewFillColor;const s=this.modelCoordinateToCanvasCoordinate(e.position);this.ctx.fillRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom),this.ctx.lineWidth=0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(e)?2:1,this.ctx.strokeRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom);const i=e.position.x,n=e.position.y;this.ctx.lineWidth=1,this.ctx.fillStyle=this.classViewHeaderTextColor;let a=n;if(this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,!e.hideStereotypes)for(const t of e.class.value.stereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`<< ${this.truncateTextWithEllipsis(t.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}this.ctx.font=`bold ${this.fontSize*this.zoom}px ${this.fontFamily}`;const r=this.truncateTextWithEllipsis(e.class.value.name);if(this.ctx.fillText(r,(i+this.screenOffset.x+(e.rectangle.width-t)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight,!e.hideTaggedValues)for(const t of e.class.value.taggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`{ ${this.truncateTextWithEllipsis(`${t.tag.value.value} = ${t.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}if(a+=3*this.classViewSpaceY,!e.hideProperties){this.ctx.beginPath();const t=(n+this.screenOffset.y+this.lineHeight+(e.hideStereotypes?0:e.class.value.stereotypes.length*this.lineHeight)+(e.hideTaggedValues?0:e.class.value.taggedValues.length*this.lineHeight)+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.ctx.moveTo((i+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.lineTo((i+this.screenOffset.x+e.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.stroke();for(const t of Hl(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof tu?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof cu?this.classViewPrimitivePropertyTextColor:this.classViewPropertyTextColor;const s=(i+this.screenOffset.x+this.classViewSpaceX-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,n=(a+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.drawClassViewProperty(e,t,s,n,!1),a+=this.lineHeight}}Uu(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,n,a){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=Hu(e),o=je(e.multiplicity.lowerBound,e.multiplicity.upperBound),l=this.ctx.measureText(r).width,c=this.ctx.measureText(o).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`;const d=t(l),h=s(l),u=this.modelCoordinateToCanvasCoordinate(new Ql(t(l),s(l)));a||this.ctx.fillText(r,u.x,u.y);const p=i(c),_=n(c),m=this.modelCoordinateToCanvasCoordinate(new Ql(i(c),n(c)));a||this.ctx.fillText(o,m.x,m.y);const g=new Ql(Math.min(d,p),Math.min(h,_));return new tc(g,new ec(Math.max(d,p)+Math.max(l,c)-g.x,Math.max(h,_)+this.lineHeight-g.y))}drawLinePropertyText(e,t,s,i,n){this.ctx.textBaseline="top",this.ctx.fillStyle=this.relationshipViewTextColor;const a=e.x,r=e.y,o=t.x,l=t.y,c=s.rectangle;if(r<l){const e=a+(o-a)/(l-r)*(s.position.y-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),n)}else{const e=a+(o-a)/(l-r)*(s.position.y+c.height-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),n)}if(a<o){const e=r+(l-r)/(o-a)*(s.position.x-a);if(e>s.position.y&&e<s.position.y+c.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}else{const e=r+(l-r)/(o-a)*(s.position.x+s.rectangle.width-a);if(e>s.position.y&&e<s.position.y+s.rectangle.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}return new tc(new Ql(0,0),new ec(0,0))}drawPropertyOrAssociation(e){const t=rc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),s=e.property.value;if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],e.to.classView.value,s,!1),this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedPropertyOrAssociation?2:1,t.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke(),this.ctx.lineWidth=1,s instanceof au){const i=t[1],n=t[0],a=i.x,r=i.y,o=n.x,l=n.y,c=e.from;let d=0,h=0;if(l>r){const e=a+(o-a)/(l-r)*(c.classView.value.position.y-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=a+(o-a)/(l-r)*(c.classView.value.position.y+c.classView.value.rectangle.height-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y+c.classView.value.rectangle.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(o>a){const e=r+(l-r)/(o-a)*(c.classView.value.position.x-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=r+(l-r)/(o-a)*(c.classView.value.position.x+c.classView.value.rectangle.width-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x+c.classView.value.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(s.aggregation===Qh.COMPOSITE||s.aggregation===Qh.SHARED){let e=Math.atan((l-r)/(o-a));e=o>=a?e:e+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(d+(this.screenOffset.x+_c(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+mc(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+_c(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+mc(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+_c(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+mc(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+_c(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+mc(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+_c(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+mc(this.diamond[0],e))*this.zoom),s.aggregation===Qh.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===Qh.COMPOSITE&&(this.ctx.fillStyle=this.propertyViewOwnedDiamondColor),this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}}}drawInheritance(e){const t=e.to.classView.value.rectangle,s=rc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),i=s[s.length-2].x,n=s[s.length-2].y,a=s[s.length-1].x,r=s[s.length-1].y;let o=0,l=0;if(r>n){const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y+t.height-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y+t.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(a>i){const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x+t.width-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x+t.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedInheritance?2:1,s.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke();let c=Math.atan((r-n)/(a-i));c=a>=i?c:c+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(o+(this.screenOffset.x+_c(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+mc(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+_c(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+mc(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+_c(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+mc(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+_c(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+mc(this.triangle[0],c))*this.zoom),this.ctx.fillStyle=this.generalizationViewInheritanceTriangeFillColor,this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}reorderDiagramDomain(e,t){const s=t.classViews.filter((t=>t!==e));return s.push(e),s}potentiallyShiftRelationships(e,t,s,i){e.forEach((e=>{-1!==t.indexOf(e.from.classView.value)&&-1!==t.indexOf(e.to.classView.value)&&ku(e,e.path.map((e=>new Ql(e.x-s,e.y-i))))}))}recenter(){if(0!==this.selectedClasses.length){const e=R(this.selectedClasses);e&&this.center(e.position.x+e.rectangle.width/2,e.position.y+e.rectangle.height/2)}else this.autoRecenter()}switchToZoomMode(){this.changeMode(this.interactionMode!==Vu.ZOOM_IN?Vu.ZOOM_IN:Vu.ZOOM_OUT,Gu.NONE)}switchToViewMode(){this.changeMode(Vu.LAYOUT,Gu.NONE)}switchToPanMode(){this.changeMode(Vu.PAN,Gu.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(Vu.ADD_RELATIONSHIP,Gu.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(Vu.ADD_RELATIONSHIP,Gu.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(Vu.ADD_CLASS,Gu.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof as&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Ql(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof as&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}keydown(e){var t;if(t=e,document.getElementById(Ad)?.dispatchEvent(new KeyboardEvent(t.type,t)),"Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{Tu(this.diagram,e),Cu(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Nu(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Su(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof du?xu(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof lc&&Iu(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&Au(this.diagram,this.selectedInheritance),this.setSelectedClasses([]),this.drawScreen());else if("KeyE"===e.code)this.selectedClassProperty?(this.handleEditProperty(this.selectedClassProperty.property,this.selectedClassProperty.selectionPoint,void 0),e.preventDefault()):this.selectedPropertyOrAssociation?(this.handleEditProperty(this.selectedPropertyOrAssociation.property.value,this.selectedPoint??(this.selectedPropertyOrAssociation.path.length?this.selectedPropertyOrAssociation.path[0]:this.selectedPropertyOrAssociation.from.classView.value.center()),this.selectedPropertyOrAssociation),e.preventDefault()):1===this.selectedClasses.length&&this.handleEditClassView(this.selectedClasses[0]);else if(e.altKey&&"KeyP"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{vu(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Ru(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Pu(e,!e.hideTaggedValues)})),this.drawScreen());else if(e.altKey&&"ArrowDown"===e.code)this.isReadOnly||1!==this.selectedClasses.length||this.handleAddSimpleProperty(this.selectedClasses[0]);else if("ArrowUp"===e.code){const e=this.getSuperTypeLevels(this.selectedClasses,this.diagram,0,1),t=this.layoutTaxonomy(e,this.diagram,!1,!0);t[0].forEach((e=>fu(this.diagram,e))),t[1].forEach((e=>Ou(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,eu.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new sc(this.diagram,(0,a.Z)(),Es.create(e)))))),(e=>e.class.value));if(e.length>0){e.forEach((e=>this.ensureClassViewMeetMinDimensions(e)));const t=this.layoutTaxonomy([e,this.selectedClasses],this.diagram,!1,!1);t[0].forEach((e=>fu(this.diagram,e))),t[1].forEach((e=>Ou(this.diagram,e)))}this.drawScreen()}}mouseup(e){if(!this.isReadOnly)switch(this.interactionMode){case Vu.LAYOUT:this.diagram.generalizationViews.forEach((e=>Du(e))),this.diagram.associationViews.forEach((e=>Du(e))),this.diagram.propertyViews.forEach((e=>Du(e)));break;case Vu.ADD_CLASS:{const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)));this.onAddClassViewClick(t),this.changeMode(Vu.LAYOUT,Gu.NONE);break}case Vu.ZOOM_IN:{const t=Math.round(100*this.zoom);let s;s=t<=$u[0]-10?10*Math.floor(t/10)+10:t>=$u[$u.length-1]?100*Math.floor(t/100)+100:B($u.find((e=>e>t))),this.zoomPoint(s/100,new Ql(e.x,e.y));break}case Vu.ZOOM_OUT:{const t=Math.round(100*this.zoom);let s;s=t<=$u[0]?10*Math.ceil(t/10)-10:t>=$u[$u.length-1]+100?100*Math.ceil(t/100)-100:B((0,Ml.Z)($u,(e=>e<t))),this.zoomPoint(s/100,new Ql(e.x,e.y));break}case Vu.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)));for(let e=this.diagram.classViews.length-1;e>=0;e--){const s=this.diagram.classViews[e];if(s.contains(t.x,t.y)){const e=this.handleAddRelationship(this.startClassView,s);e&&(wu(e.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),Lu(e.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),wu(e.to,-(s.position.x+s.rectangle.width/2-t.x)),Lu(e.to,-(s.position.y+s.rectangle.height/2-t.y)))}}this.changeMode(Vu.LAYOUT,Gu.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){if([Vu.ADD_RELATIONSHIP,Vu.ADD_CLASS,Vu.ZOOM_IN,Vu.ZOOM_OUT].includes(this.interactionMode))return;const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)));if(this.mouseOverClassProperty&&this.onClassPropertyDoubleClick)return void this.onClassPropertyDoubleClick(this.mouseOverClassProperty,t,void 0);if(this.mouseOverClassName&&this.onClassNameDoubleClick)return void this.onClassNameDoubleClick(this.mouseOverClassName,t);const s=this.diagram.classViews.find((e=>e.contains(t.x,t.y)));s&&this.onClassViewDoubleClick?this.onClassViewDoubleClick(s,t):this.mouseOverPropertyHolderViewLabel&&this.onClassPropertyDoubleClick?this.onClassPropertyDoubleClick(this.mouseOverPropertyHolderViewLabel.property.value,t,this.mouseOverPropertyHolderViewLabel):this.onBackgroundDoubleClick&&this.onBackgroundDoubleClick(t)}mousedown(e){this.setSelectionStart(void 0),this.setSelectedClassCorner(void 0),this.setSelectedPropertyOrAssociation(void 0),this.setSelectedInheritance(void 0),this.selection=void 0,this.selectedClassProperty=void 0,this.selectedPoint=void 0,this.startClassView=void 0;const t=this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case Vu.PAN:return void(this.positionBeforeLastMove=new Ql(e.x,e.y));case Vu.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(Ec(t).contains(s.x,s.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||Eu(this.diagram,this.reorderDiagramDomain(B(this.selectedClassCorner),this.diagram));break}}if(!this.selectedClassCorner)if(this.mouseOverClassProperty)this.selectedClassProperty={property:this.mouseOverClassProperty,selectionPoint:s},this.setSelectedClasses([]);else{let e=!1;for(let i=this.diagram.classViews.length-1;i>=0;i--){const n=this.diagram.classViews[i];if(n.contains(s.x,s.y)){0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(n)||this.setSelectedClasses([n]),this.isReadOnly||Eu(this.diagram,this.reorderDiagramDomain(this.selectedClasses[0],this.diagram)),this.clickX=t.x/this.zoom-this.screenOffset.x,this.clickY=t.y/this.zoom-this.screenOffset.y,this._selectedClassesInitialPositions=this.selectedClasses.map((e=>({classView:e,oldPos:new Ql(e.position.x,e.position.y)}))),e=!0;break}}if(e||this.setSelectedClasses([]),!this.selectedClasses.length){for(const e of this.diagram.generalizationViews){const t=Mu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedInheritance(e);break}}if(!this.selectedPoint)for(const e of this.diagram.associationViews){const t=Mu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}if(!this.selectedPoint)for(const e of this.diagram.propertyViews){const t=Mu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}this.selectedPoint||this.setSelectionStart(s)}}break;case Vu.ADD_RELATIONSHIP:this.setSelectionStart(s),this.startClassView=void 0;for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];t.contains(s.x,s.y)&&(this.startClassView=t)}this.startClassView||this.changeMode(Vu.LAYOUT,Gu.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=new Ql(e.x,e.y));if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=new Ql(e.x,e.y),void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,s),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){if(e.preventDefault(),e.stopImmediatePropagation(),Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;const t=this.zoom-e.deltaY/120*.05;this.executeZoom(t,new Ql(e.x,e.y))}mousemove(e){if(this.cursorPosition=new Ql(e.x,e.y),this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===Vu.PAN)this.screenOffset=new Ql(this.screenOffset.x+(e.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(e.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=new Ql(e.x,e.y),this.clearScreen(),this.drawAll();else if(this.leftClick){const t=this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);switch(this.interactionMode){case Vu.LAYOUT:if(this.selectedClassCorner&&(Fu(this.selectedClassCorner,new ec(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),Uu(this.selectedClassCorner),this.drawClassView(this.selectedClassCorner),this.drawScreen()),!this.selectionStart&&this.selectedClasses.length&&!this.isReadOnly){let e=0,s=0;this.selectedClasses.forEach(((i,n)=>{const a=this._selectedClassesInitialPositions.length>n?this._selectedClassesInitialPositions[n]:void 0;if(a){const n=t.x/this.zoom-this.screenOffset.x-(this.clickX-a.oldPos.x),r=t.y/this.zoom-this.screenOffset.y-(this.clickY-a.oldPos.y);e=i.position.x-n,s=i.position.y-r,ju(i,new Ql(n,r)),Uu(i)}})),this.potentiallyShiftRelationships(this.diagram.associationViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.propertyViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.generalizationViews,this.selectedClasses,e,s),this.drawScreen()}if(this.selectedPoint&&(this.selectedPropertyOrAssociation?bu(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&bu(this.selectedInheritance,this.selectedPoint,s),this.selectedPoint=s,this.drawScreen()),this.selectionStart){this.clearScreen(),this.drawAll();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.fillStyle=this.selectionBoxBorderColor,this.ctx.fillRect(e.x,e.y,t.x-e.x,t.y-e.y),this.ctx.strokeRect(e.x,e.y,t.x-e.x,t.y-e.y);const s=(t.x-e.x)/this.zoom,i=(t.y-e.y)/this.zoom;this.selection=new tc(new Ql(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new ec(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(fc(this.selection,e)||fc(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case Vu.ADD_RELATIONSHIP:if(this.selectionStart&&this.startClassView){this.clearScreen(),this.drawBoundingBox();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(t.x,t.y),this.ctx.stroke(),this.drawDiagram()}}}else{this.drawScreen();const t=this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);this.setMouseOverClassView(void 0),this.setMouseOverClassName(void 0),this.setMouseOverClassCorner(void 0),this.setMouseOverClassProperty(void 0),this.setMouseOverPropertyHolderViewLabel(void 0);for(const e of this.diagram.classViews.slice().reverse())if(e.contains(s.x,s.y)){this.setMouseOverClassView(e),Ec(e).contains(s.x,s.y)&&this.setMouseOverClassCorner(e);const i=e.class.value;let n=e.position.y+this.classViewSpaceY;n+=e.hideStereotypes?0:i.stereotypes.length*this.fontSize;const a=this.computeClassNameWidth(e);new tc(this.modelCoordinateToCanvasCoordinate(new Ql(e.position.x+(e.rectangle.width-a)/2,n)),new ec(a,this.lineHeight)).contains(t.x,t.y)&&this.setMouseOverClassName(e),n+=this.lineHeight,n+=e.hideTaggedValues?0:i.taggedValues.length*this.fontSize,n+=this.classViewSpaceY;for(const s of Hl(i))this.hasPropertyView(e,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new tc(this.modelCoordinateToCanvasCoordinate(new Ql(e.position.x+this.classViewSpaceX,n)),new ec(this.drawClassViewProperty(e,s,0,0,!0)*this.zoom,this.fontSize*this.zoom)).contains(t.x,t.y)&&this.setMouseOverClassProperty(s),n+=this.fontSize);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=rc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],e.to.classView.value,e.property.value,!1).contains(s.x,s.y)){this.setMouseOverPropertyHolderViewLabel(e);break}}}}getSuperTypeLevels(e,t,s,i){if(e.length){const n=(0,eu.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new sc(t,(0,a.Z)(),Es.create(Bl(e.value,as))))))),(e=>e.class.value));if(n.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),-1===i||s<i){const a=this.getSuperTypeLevels(n,t,s+1,i);return a.push(e),a}return[e]}return[]}layoutTaxonomy(e,t,s,i){return e.reverse(),[e.flatMap(((t,n)=>{let a=0,r=0,o=0,l=0;if(n>0){const t=e[n-1];if(t.length){const e=[...t].sort(((e,t)=>e.position.x-t.position.x));o=e[0].position.x,a=e[e.length-1].position.x+e[e.length-1].rectangle.width-e[0].position.x;const s=[...t].sort(((e,t)=>e.position.y-t.position.y));l=s[0].position.y,r=s[s.length-1].position.y+s[s.length-1].rectangle.height-s[0].position.y}}const c=Math.max(...t.map((e=>e.rectangle.height))),d=o+a/2-t.map((e=>e.rectangle.width)).reduce(((e,t)=>e+t+10))/2,h=i?l-c-30:l+r+30;return(s||n>0)&&(ju(t[0],new Ql(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];ju(e,new Ql(i.position.x+i.rectangle.width+10,h))}}))),t})),(i?e:e.slice().reverse()).slice(0,e.length-1).flatMap(((s,i)=>s.flatMap((s=>e[i+1].flatMap((e=>s.class.value.generalizations.map((e=>e.value.rawType)).includes(e.class.value)?new cc(t,s,e):[]))))))]}}class Wu{_UUID=(0,a.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return Zt([Xt.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class Ku extends ms{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Xt.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Kt).join(",")}}class Zu extends Ku{ownerReference;constructor(e){const t=Es.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Zu(e)}}class Xu extends ms{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Xt.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Kt).join(",")}}class qu extends Xu{ownerReference;constructor(e){const t=Es.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new qu(e)}}class Ju extends is{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[uu(hu(),hu()),uu(hu(),hu())];t[0]._OWNER=this,t[1]._OWNER=this,this.properties=t}get _elementHashCode(){return Zt([Xt.ASSOCIATION,this.path,Zt(this.properties),Zt(this.derivedProperties),Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class Qu extends is{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return Zt([Xt.MAPPING,this.path,Zt(this.classMappings),Zt(this.enumerationMappings),Zt(this.associationMappings),Zt(this.test),Zt(this.includes),Zt(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class ep extends is{p_stereotypes=[];p_tags=[];get _elementHashCode(){return Zt([Xt.PROFILE,this.path,Zt(this.p_stereotypes.map((e=>e.value))),Zt(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class tp extends is{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];postValidations=[];get patternParameters(){return(0,Ke.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return Zt([Xt.SERVICE,Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues),this.path,this.pattern,Zt(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",Zt(this.tests),Zt(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class sp extends is{functionName;constructor(e){super(e),this.functionName=e}}class ip extends sp{}class np extends ip{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return Zt([Xt.FUNCTION,this.path,Zt(this.parameters),this.returnType.valueForSerialization??"",Zt(this.taggedValues),Zt(this.stereotypes.map((e=>e.pointerHashCode))),Qt(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class ap extends is{includes=[]}class rp extends ap{sections=[];get _elementHashCode(){return Zt([Xt.FLAT_DATA,this.path,Zt(this.includes.map((e=>e.valueForSerialization??""))),Zt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class op extends is{runtimeValue;get _elementHashCode(){return Zt([Xt.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class lp extends is{connectionValue;get _elementHashCode(){return Zt([Xt.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class cp extends is{}class dp extends cp{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return Zt([Xt.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",Zt(this.scopeElements.map((e=>e instanceof gs?e.valueForSerialization??"":e))),Zt(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class hp extends is{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return Zt([Xt.GENERATION_TREE,this.path,Zt(this.generationNodes),Zt(this.fileGenerations.map((e=>es(Pe.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class up extends ap{schemas=[];joins=[];filters=[];get _elementHashCode(){return Zt([Xt.DATABASE,this.path,Zt(this.includes.map((e=>e.valueForSerialization??""))),Zt(this.schemas),Zt(this.joins),Zt(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class pp{_class;index=new Map;constructor(e){this._class=e}getElementClass(){return this._class}get elements(){return Array.from(this.index.values())}getElement(e){return this.index.get(e)}setElement(e,t){this.index.set(e,t)}deleteElement(e){this.index.delete(e)}renameElement(e,t){const s=this.getElement(e);s&&(this.deleteElement(e),this.setElement(t,s))}}class _p extends is{data;get hashCode(){return Zt([Xt.DATA_ELEMENT,this.path,Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}const mp=new Set([is,ns,rs,cu,as,Ju,os,np,ep,cs,ls,class extends is{sections=[];get _elementHashCode(){return Zt([Xt.SECTION_INDEX,this.path,Zt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}},ap,Qu,lp,op,tp,hp,dp,_p]);class gp{root;extensions=[];elementSectionIndex=new Map;sectionIndicesIndex=new Map;profilesIndex=new Map;typesIndex=new Map;associationsIndex=new Map;functionsIndex=new Map;storesIndex=new Map;mappingsIndex=new Map;connectionsIndex=new Map;runtimesIndex=new Map;servicesIndex=new Map;generationSpecificationsIndex=new Map;fileGenerationsIndex=new Map;dataElementsIndex=new Map;constructor(e,t){this.root=new ds(e),this.extensions=this.createGraphExtensions(t)}createGraphExtensions(e){return e.map((e=>{if(mp.has(e))throw new k("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new pp(e)}))}get ownSectionIndices(){return Array.from(this.sectionIndicesIndex.values())}get ownProfiles(){return Array.from(this.profilesIndex.values())}get ownEnumerations(){return Array.from(this.typesIndex.values()).filter($(os))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter($(cs))}get ownClasses(){return Array.from(this.typesIndex.values()).filter($(as))}get ownTypes(){return Array.from(this.typesIndex.values())}get ownAssociations(){return Array.from(this.associationsIndex.values())}get ownFunctions(){return Array.from(this.functionsIndex.values())}get ownStores(){return Array.from(this.storesIndex.values())}get ownFlatDatas(){return Array.from(this.storesIndex.values()).filter($(rp))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter($(up))}get ownMappings(){return Array.from(this.mappingsIndex.values())}get ownServices(){return Array.from(this.servicesIndex.values())}get ownRuntimes(){return Array.from(this.runtimesIndex.values())}get ownConnections(){return Array.from(this.connectionsIndex.values())}get ownFileGenerations(){return Array.from(this.fileGenerationsIndex.values())}get ownDataElements(){return Array.from(this.dataElementsIndex.values())}get ownGenerationSpecifications(){return Array.from(this.generationSpecificationsIndex.values())}get ownTestables(){return[...this.ownServices,...this.ownMappings]}getExtensionElements(e){return this.getExtensionForElementClass(e).elements}getExtensionForElementClass(e){const t=this.extensions.filter((t=>t.getElementClass()===e));if(0===t.length)throw new F("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new k("Found multiple extensions for the specified element class");return t[0]}getOwnNullableSection=e=>this.elementSectionIndex.get(e);getOwnNullableSectionIndex=e=>this.sectionIndicesIndex.get(e);getOwnNullableProfile=e=>this.profilesIndex.get(e);getOwnNullableType=e=>this.typesIndex.get(e);getOwnNullableClass=e=>{const t=this.getOwnNullableType(e);return t instanceof as?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof os?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof cs?t:void 0};getOwnNullableAssociation=e=>this.associationsIndex.get(e);getOwnNullableFunction=e=>this.functionsIndex.get(e);getOwnNullableStore=e=>this.storesIndex.get(e);getOwnNullableMapping=e=>this.mappingsIndex.get(e);getOwnNullableConnection=e=>this.connectionsIndex.get(e);getOwnNullableRuntime=e=>this.runtimesIndex.get(e);getOwnNullableService=e=>this.servicesIndex.get(e);getOwnNullableGenerationSpecification=e=>this.generationSpecificationsIndex.get(e);getOwnNullableFileGeneration=e=>this.fileGenerationsIndex.get(e);getOwnNullableDataElement=e=>this.dataElementsIndex.get(e);getOwnSectionIndex=e=>B(this.getOwnNullableSectionIndex(e),`Can't find section index '${e}'`);getOwnProfile=e=>B(this.getOwnNullableProfile(e),`Can't find profile '${e}'`);getOwnType=e=>B(this.getOwnNullableType(e),`Can't find type '${e}'`);getOwnClass=e=>B(this.getOwnNullableClass(e),`Can't find class '${e}'`);getOwnEnumeration=e=>B(this.getOwnNullableEnumeration(e),`Can't find enumeration '${e}'`);getOwnMeasure=e=>B(this.getOwnNullableMeasure(e),`Can't find measure '${e}'`);getOwnAssociation=e=>B(this.getOwnNullableAssociation(e),`Can't find association '${e}'`);getOwnFunction=e=>B(this.getOwnNullableFunction(e),`Can't find function '${e}'`);getOwnStore=e=>B(this.getOwnNullableStore(e),`Can't find store '${e}'`);getOwnDatabase=e=>Y(this.getOwnNullableStore(e),up,`Can't find database '${e}'`);getOwnFlatDataStore=e=>Y(this.getOwnNullableStore(e),rp,`Can't find flat-data store '${e}'`);getOwnMapping=e=>B(this.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getOwnConnection=e=>B(this.getOwnNullableConnection(e),`Can't find connection '${e}'`);getOwnRuntime=e=>B(this.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getOwnService=e=>B(this.getOwnNullableService(e),`Can't find service '${e}'`);getOwnGenerationSpecification=e=>B(this.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getOwnFileGeneration=e=>B(this.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getOwnDataElement=e=>B(this.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getOwnNullableExtensionElement(e,t){return this.getExtensionForElementClass(t).getElement(e)}setOwnSection(e,t){this.elementSectionIndex.set(e,t)}setOwnSectionIndex(e,t){this.sectionIndicesIndex.set(e,t)}setOwnProfile(e,t){this.profilesIndex.set(e,t)}setOwnType(e,t){this.typesIndex.set(e,t)}setOwnAssociation(e,t){this.associationsIndex.set(e,t)}setOwnFunction(e,t){this.functionsIndex.set(e,t)}setOwnStore(e,t){this.storesIndex.set(e,t)}setOwnMapping(e,t){this.mappingsIndex.set(e,t)}setOwnConnection(e,t){this.connectionsIndex.set(e,t)}setOwnRuntime(e,t){this.runtimesIndex.set(e,t)}setOwnService(e,t){this.servicesIndex.set(e,t)}setOwnGenerationSpecification(e,t){this.generationSpecificationsIndex.set(e,t)}setOwnFileGeneration(e,t){this.fileGenerationsIndex.set(e,t)}setOwnDataElement(e,t){this.dataElementsIndex.set(e,t)}setOwnElementInExtension(e,t,s){this.getExtensionForElementClass(s).setElement(e,t)}get allOwnElements(){return[...this.ownProfiles,...this.ownEnumerations,...this.ownMeasures,...this.ownClasses,...this.ownAssociations,...this.ownFunctions,...this.ownStores,...this.ownMappings,...this.ownServices,...this.ownRuntimes,...this.ownConnections,...this.ownGenerationSpecifications,...this.ownFileGenerations,...this.ownDataElements,...this.extensions.flatMap((e=>e.elements))]}async dispose(){this.allOwnElements.length&&await Promise.all(this.allOwnElements.map((e=>P((()=>{e.dispose()})))))}getNullablePackage=e=>e?U((()=>Gl(this.root,e,!1,void 0))):this.root;getOwnNullableElement(e,t){let s=this.sectionIndicesIndex.get(e)??this.typesIndex.get(e)??this.profilesIndex.get(e)??this.associationsIndex.get(e)??this.functionsIndex.get(e)??this.storesIndex.get(e)??this.mappingsIndex.get(e)??this.servicesIndex.get(e)??this.runtimesIndex.get(e)??this.connectionsIndex.get(e)??this.fileGenerationsIndex.get(e)??this.dataElementsIndex.get(e)??this.generationSpecificationsIndex.get(e);if(!s)for(const t of this.extensions){const i=t.getElement(e);if(i){s=i;break}}return t&&!s?this.getNullablePackage(e):s}addOwnElement(e,t){jl(t?zl(this,t,void 0):this.root,e),e instanceof Qu?this.setOwnMapping(e.path,e):e instanceof ap?this.setOwnStore(e.path,e):e instanceof ns?this.setOwnType(e.path,e):e instanceof Ju?this.setOwnAssociation(e.path,e):e instanceof ep?this.setOwnProfile(e.path,e):e instanceof np?this.setOwnFunction(e.path,e):e instanceof tp?this.setOwnService(e.path,e):e instanceof lp?this.setOwnConnection(e.path,e):e instanceof op?this.setOwnRuntime(e.path,e):e instanceof dp?this.setOwnFileGeneration(e.path,e):e instanceof hp?this.setOwnGenerationSpecification(e.path,e):e instanceof _p?this.setOwnDataElement(e.path,e):e instanceof ds||this.getExtensionForElementClass(I(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&Ul(e.package,e),e instanceof Qu?this.mappingsIndex.delete(e.path):e instanceof ap?this.storesIndex.delete(e.path):e instanceof ns?(this.typesIndex.delete(e.path),e instanceof cs&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof Ju?this.associationsIndex.delete(e.path):e instanceof ep?this.profilesIndex.delete(e.path):e instanceof np?this.functionsIndex.delete(e.path):e instanceof tp?this.servicesIndex.delete(e.path):e instanceof op?this.runtimesIndex.delete(e.path):e instanceof lp?this.connectionsIndex.delete(e.path):e instanceof dp?this.fileGenerationsIndex.delete(e.path):e instanceof hp?this.generationSpecificationsIndex.delete(e.path):e instanceof _p?this.dataElementsIndex.delete(e.path):e instanceof ds?e.children.forEach((e=>this.deleteOwnElement(e))):this.getExtensionForElementClass(I(e)).deleteElement(e.path)}renameOwnElement(e,t,s){if(t===s)return;if(!s)throw new F(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof ds&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof ds)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new F(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new F(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,n]=kl(s);if(!(e instanceof ds)){const t=this.getNullablePackage(i)??(""!==i?zl(this,i,void 0):this.root);e.name=n,e instanceof np&&(e.functionName=(a=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Yl(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Yl(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(a))))),e.package!==t&&(e.package&&Ul(e.package,e),jl(t,e))}var a,r;if(e instanceof Qu)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof ap)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof ns)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof cs&&(e.canonicalUnit&&(this.typesIndex.delete(e.canonicalUnit.path),this.typesIndex.set(e.canonicalUnit.path.replace(t,s),e.canonicalUnit)),e.nonCanonicalUnits.forEach((e=>{this.typesIndex.delete(e.path),this.typesIndex.set(e.path.replace(t,s),e)})));else if(e instanceof Ju)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof ep)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof np)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof tp)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof op)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof lp)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof dp)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof _p)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof hp)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof ds){const a=new Map;if(e.children.forEach((e=>{a.set(e.path,e)})),e.name=n,!e.package)throw new k("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){Ul(r,e);const t=""!==i?zl(this,i,void 0):this.root;jl(t,e)}a.forEach(((e,i)=>{this.renameOwnElement(e,i,i.replace(t,s))}))}else this.getExtensionForElementClass(I(e)).renameElement(t,s)}TEMPORARY__deleteOwnSectionIndex(){this.sectionIndicesIndex.forEach((e=>{e.setIsDeleted(!0),this.sectionIndicesIndex.delete(e.path)})),this.sectionIndicesIndex=new Map,this.elementSectionIndex=new Map}}class Ep extends gp{constructor(e,t){super(fe.PROJECT_DEPENDENCY_ROOT,e),this.root=t}}const fp=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class Tp{root=new ds(fe.PROJECT_DEPENDENCY_ROOT);projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.keys()).forEach((e=>{this.projectDependencyModelsIndex.set(e,new Ep(this.extensionElementClasses,this.root))}))}get hasDependencies(){return Boolean(this.projectDependencyModelsIndex.size)}get dependencyGraphs(){return Array.from(this.projectDependencyModelsIndex.values())}get allOwnElements(){return this.dependencyGraphs.flatMap((e=>e.allOwnElements))}getOwnNullableSectionIndex=fp(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=fp(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=fp(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=fp(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=fp(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=fp(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=fp(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=fp(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=fp(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=fp(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=fp(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=fp(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=fp(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=fp(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=fp(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=fp(this,((e,t)=>e.getOwnNullableDataElement(t)));getOwnNullableExtensionElement(e,t){for(const s of this.dependencyGraphs){const i=s.getExtensionForElementClass(t).getElement(e);if(i)return i}}get sectionIndices(){return this.dependencyGraphs.flatMap((e=>e.ownSectionIndices))}get profiles(){return this.dependencyGraphs.flatMap((e=>e.ownProfiles))}get enumerations(){return this.dependencyGraphs.flatMap((e=>e.ownEnumerations))}get measures(){return this.dependencyGraphs.flatMap((e=>e.ownMeasures))}get classes(){return this.dependencyGraphs.flatMap((e=>e.ownClasses))}get types(){return this.dependencyGraphs.flatMap((e=>e.ownTypes))}get associations(){return this.dependencyGraphs.flatMap((e=>e.ownAssociations))}get functions(){return this.dependencyGraphs.flatMap((e=>e.ownFunctions))}get stores(){return this.dependencyGraphs.flatMap((e=>e.ownStores))}get databases(){return this.dependencyGraphs.flatMap((e=>e.ownDatabases))}get mappings(){return this.dependencyGraphs.flatMap((e=>e.ownMappings))}get services(){return this.dependencyGraphs.flatMap((e=>e.ownServices))}get runtimes(){return this.dependencyGraphs.flatMap((e=>e.ownRuntimes))}get connections(){return this.dependencyGraphs.flatMap((e=>e.ownConnections))}get dataElements(){return this.dependencyGraphs.flatMap((e=>e.ownDataElements))}get generationSpecifications(){return this.dependencyGraphs.flatMap((e=>e.ownGenerationSpecifications))}get fileGenerations(){return this.dependencyGraphs.flatMap((e=>e.ownFileGenerations))}getExtensionElements(e){return this.dependencyGraphs.flatMap((t=>t.getExtensionElements(e)))}getModel(e){return B(this.projectDependencyModelsIndex.get(e),`Can't find dependency model with project ID '${e}'`)}getNullableElement(e,t){return this.dependencyGraphs.find((s=>Boolean(s.getOwnNullableElement(e,t))))?.getOwnNullableElement(e,t)}}class Cp extends ap{static NAME="ModelStore";static INSTANCE=new Cp;constructor(){super(Cp.NAME)}accept_PackageableElementVisitor(e){throw new F}}class xp extends gp{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(fe.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(Cp.NAME,Cp.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[cu.STRING,cu.BOOLEAN,cu.BINARY,cu.NUMBER,cu.INTEGER,cu.FLOAT,cu.DECIMAL,cu.DATE,cu.STRICTDATE,cu.DATETIME,cu.STRICTTIME,cu.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class Np extends gp{autoImports=[];constructor(e){super(fe.SYSTEM,e)}initializeAutoImports(){this.autoImports=Oe.map((e=>Y(this.getOwnNullableElement(e,!0),ds,`Can't find auto-import package '${e}'`)))}}class Op extends gp{constructor(e){super(fe.MODEL_GENERATION,e)}}class Ap extends gp{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(fe.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new Op(i),this.dependencyManager=new Tp(i)}get autoImports(){return this.systemModel.autoImports}get primitiveTypes(){return this.coreModel.primitiveTypes}get sectionIndices(){return[...this.coreModel.ownSectionIndices,...this.systemModel.ownSectionIndices,...this.dependencyManager.sectionIndices,...this.ownSectionIndices,...this.generationModel.ownSectionIndices]}get profiles(){return[...this.coreModel.ownProfiles,...this.systemModel.ownProfiles,...this.dependencyManager.profiles,...this.ownProfiles,...this.generationModel.ownProfiles]}get enumerations(){return[...this.coreModel.ownEnumerations,...this.systemModel.ownEnumerations,...this.dependencyManager.enumerations,...this.ownEnumerations,...this.generationModel.ownEnumerations]}get measures(){return[...this.coreModel.ownMeasures,...this.systemModel.ownMeasures,...this.dependencyManager.measures,...this.ownMeasures,...this.generationModel.ownMeasures]}get classes(){return[...this.coreModel.ownClasses,...this.systemModel.ownClasses,...this.dependencyManager.classes,...this.ownClasses,...this.generationModel.ownClasses]}get types(){return[...this.coreModel.ownTypes,...this.systemModel.ownTypes,...this.dependencyManager.types,...this.ownTypes,...this.generationModel.ownTypes]}get associations(){return[...this.coreModel.ownAssociations,...this.systemModel.ownAssociations,...this.dependencyManager.associations,...this.ownAssociations,...this.generationModel.ownAssociations]}get functions(){return[...this.coreModel.ownFunctions,...this.systemModel.ownFunctions,...this.dependencyManager.functions,...this.ownFunctions,...this.generationModel.ownFunctions]}get stores(){return[...this.coreModel.ownStores,...this.systemModel.ownStores,...this.dependencyManager.stores,...this.ownStores,...this.generationModel.ownStores]}get databases(){return[...this.coreModel.ownDatabases,...this.systemModel.ownDatabases,...this.dependencyManager.databases,...this.ownDatabases,...this.generationModel.ownDatabases]}get mappings(){return[...this.coreModel.ownMappings,...this.systemModel.ownMappings,...this.dependencyManager.mappings,...this.ownMappings,...this.generationModel.ownMappings]}get services(){return[...this.coreModel.ownServices,...this.systemModel.ownServices,...this.dependencyManager.services,...this.ownServices,...this.generationModel.ownServices]}get runtimes(){return[...this.coreModel.ownRuntimes,...this.systemModel.ownRuntimes,...this.dependencyManager.runtimes,...this.ownRuntimes,...this.generationModel.ownRuntimes]}get connections(){return[...this.coreModel.ownConnections,...this.systemModel.ownConnections,...this.dependencyManager.connections,...this.ownConnections,...this.generationModel.ownConnections]}get dataElements(){return[...this.coreModel.ownDataElements,...this.systemModel.ownDataElements,...this.dependencyManager.dataElements,...this.ownDataElements,...this.generationModel.ownDataElements]}get generationSpecifications(){return[...this.coreModel.ownGenerationSpecifications,...this.systemModel.ownGenerationSpecifications,...this.dependencyManager.generationSpecifications,...this.ownGenerationSpecifications,...this.generationModel.ownGenerationSpecifications]}get fileGenerations(){return[...this.coreModel.ownFileGenerations,...this.systemModel.ownFileGenerations,...this.dependencyManager.fileGenerations,...this.ownFileGenerations,...this.generationModel.ownFileGenerations]}get allElements(){return[...this.coreModel.allOwnElements,...this.systemModel.allOwnElements,...this.dependencyManager.allOwnElements,...this.allOwnElements,...this.generationModel.allOwnElements]}get allOwnTestables(){const e=this.graphPlugins.flatMap((e=>e.getExtraTestablesCollectors?.()??[])).map((e=>e(this)));return[...this.ownTestables].concat(...e)}getPrimitiveType=e=>B(this.coreModel.primitiveTypesIndex.get(e),`Can't find primitive type '${e}'`);getType=e=>B(this.getOwnNullableType(e)??this.generationModel.getOwnNullableType(e)??this.dependencyManager.getOwnNullableType(e)??this.systemModel.getOwnNullableType(e)??this.coreModel.getOwnNullableType(e),`Can't find type '${e}'`);getProfile=e=>B(this.getOwnNullableProfile(e)??this.generationModel.getOwnNullableProfile(e)??this.dependencyManager.getOwnNullableProfile(e)??this.systemModel.getOwnNullableProfile(e),`Can't find profile '${e}'`);getEnumeration=e=>Y(this.getType(e),os,`Can't find enumeration '${e}'`);getMeasure=e=>Y(this.getType(e),cs,`Can't find measure '${e}'`);getUnit=e=>Y(this.getType(e),ls,`Can't find unit '${e}'`);getClass=e=>Y(this.getType(e),as,`Can't find class '${e}'`);getAssociation=e=>B(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e),`Can't find association '${e}'`);getPropertyOwner=e=>B(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e)??Y(this.getType(e),as),`Can't find property owner '${e}'`);getFunction=e=>Y(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),np,`Can't find function '${e}'`);getStore=e=>B(this.getOwnNullableStore(e)??this.generationModel.getOwnNullableStore(e)??this.dependencyManager.getOwnNullableStore(e)??this.systemModel.getOwnNullableStore(e)??this.coreModel.getOwnNullableStore(e),`Can't find store '${e}'`);getFlatDataStore=e=>Y(this.getStore(e),rp,`Can't find flat-data store '${e}'`);getDatabase=e=>Y(this.getStore(e),up,`Can't find database store '${e}'`);getMapping=e=>B(this.getOwnNullableMapping(e)??this.generationModel.getOwnNullableMapping(e)??this.dependencyManager.getOwnNullableMapping(e)??this.systemModel.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getService=e=>B(this.getOwnNullableService(e)??this.generationModel.getOwnNullableService(e)??this.dependencyManager.getOwnNullableService(e)??this.systemModel.getOwnNullableService(e),`Can't find service '${e}'`);getConnection=e=>B(this.getOwnNullableConnection(e)??this.generationModel.getOwnNullableConnection(e)??this.dependencyManager.getOwnNullableConnection(e)??this.systemModel.getOwnNullableConnection(e),`Can't find connection '${e}'`);getRuntime=e=>B(this.getOwnNullableRuntime(e)??this.generationModel.getOwnNullableRuntime(e)??this.dependencyManager.getOwnNullableRuntime(e)??this.systemModel.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getGenerationSpecification=e=>B(this.getOwnNullableGenerationSpecification(e)??this.generationModel.getOwnNullableGenerationSpecification(e)??this.dependencyManager.getOwnNullableGenerationSpecification(e)??this.systemModel.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getFileGeneration=e=>B(this.getOwnNullableFileGeneration(e)??this.generationModel.getOwnNullableFileGeneration(e)??this.dependencyManager.getOwnNullableFileGeneration(e)??this.systemModel.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getDataElement=e=>B(this.getOwnNullableDataElement(e)??this.generationModel.getOwnNullableDataElement(e)??this.dependencyManager.getOwnNullableDataElement(e)??this.systemModel.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getExtensionElement(e,t,s){return B(this.getOwnNullableExtensionElement(e,t)??this.generationModel.getOwnNullableExtensionElement(e,t)??this.dependencyManager.getOwnNullableExtensionElement(e,t)??this.systemModel.getOwnNullableExtensionElement(e,t),s??`Can't find element '${e}'`)}getElement=(e,t)=>B(this.getNullableElement(e,t),`Can't find element '${e}'`);getNullableClass=e=>U((()=>this.getClass(e)));getNullableMapping=e=>U((()=>this.getMapping(e)));getNullableService=e=>U((()=>this.getService(e)));getNullableRuntime=e=>U((()=>this.getRuntime(e)));getNullableFileGeneration=e=>U((()=>this.getFileGeneration(e)));getNullableElement(e,t){const s=super.getOwnNullableElement(e)??this.dependencyManager.getNullableElement(e)??this.generationModel.getOwnNullableElement(e)??this.systemModel.getOwnNullableElement(e)??this.coreModel.getOwnNullableElement(e);return t&&!s?this.getNullablePackage(e)??this.dependencyManager.getNullableElement(e,!0)??this.generationModel.getNullablePackage(e)??this.systemModel.getNullablePackage(e):s}getMultiplicity(e,t){let s;return 1===e&&1===t?s=ru.ONE:0===e&&1===t?s=ru.ZERO_ONE:0===e&&void 0===t?s=ru.ZERO_MANY:1===e&&void 0===t?s=ru.ONE_MANY:0===e&&0===t&&(s=ru.ZERO),s??new ru(e,t)}addElement(e,t){const s=Fl(t??"",e.name);if(this.getNullableElement(s,!1))throw new k(`Can't create element '${s}': another element with the same path already existed`);super.addOwnElement(e,t)}deleteElement(e){super.deleteOwnElement(e);const t=this.graphPlugins.flatMap((e=>e.getExtraDeadReferencesCleaners?.()??[]));for(const e of t)e(this)}renameElement(e,t){if(this.getNullableElement(t,!1))throw new k(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class Sp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class yp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Ip{source;line;column;startLine;startColumn;endLine;endColumn}(0,ze.yu)(Ip,{column:(0,ze.Ru)(),endLine:(0,ze.Ru)(),endColumn:(0,ze.Ru)(),line:(0,ze.Ru)(),source:(0,ze.Ru)(),startLine:(0,ze.Ru)(),startColumn:(0,ze.Ru)()});class vp{package;name;tags=[];stereotypes=[]}(0,ze.yu)(vp,{name:(0,ze.Ru)(),package:(0,ze.Ru)(),stereotypes:(0,ze.pb)((0,ze.Ru)()),tags:(0,ze.pb)((0,ze.Ru)())});class Rp{profile;value}(0,ze.yu)(Rp,{profile:(0,ze.Ru)(),value:(0,ze.Ru)()});class Pp{profile;value}(0,ze.yu)(Pp,{profile:(0,ze.Ru)(),value:(0,ze.Ru)()});class wp{tag;value}(0,ze.yu)(wp,{tag:(0,ze.Ry)(Pp),value:(0,ze.Ru)()});class Lp{rawType;typeParameter}(0,ze.yu)(Lp,{rawType:(0,ze.jt)((0,ze.Ru)()),typeParameter:(0,ze.jt)((0,ze.Ru)())});class bp{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,ze.yu)(bp,{aggregation:(0,ze.Ru)(),genericType:(0,ze.Ry)(Lp),multiplicity:(0,ze.Ru)(),name:(0,ze.Ru)(),stereotypes:(0,ze.pb)((0,ze.Ry)(Rp)),taggedValues:(0,ze.pb)((0,ze.Ry)(wp))});class Dp{package;name;sourceInformation}(0,ze.yu)(Dp,{name:(0,ze.Ru)(),package:(0,ze.Ru)(),sourceInformation:(0,ze.Ry)(Ip)});class Mp{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,ze.yu)(Mp,{generalizations:(0,ze.pb)((0,ze.Ry)(Lp)),name:(0,ze.Ru)(),package:(0,ze.Ru)(),properties:(0,ze.pb)((0,ze.Ry)(bp)),qualifiedProperties:(0,ze.pb)((0,ze.Ry)(bp)),sourceInformation:(0,ze.Ry)(Ip),stereotypes:(0,ze.pb)((0,ze.Ry)(Rp)),taggedValues:(0,ze.pb)((0,ze.Ry)(wp))});class kp{package;name;enumValues=[]}(0,ze.yu)(kp,{name:(0,ze.Ru)(),package:(0,ze.Ru)(),enumValues:(0,ze.pb)((0,ze.Ru)())});class Fp{x;y}(0,ze.yu)(Fp,{x:(0,ze.Ru)(),y:(0,ze.Ru)()});class jp{height;width}(0,ze.yu)(jp,{height:(0,ze.Ru)(),width:(0,ze.Ru)()});class Up{points=[]}(0,ze.yu)(Up,{points:(0,ze.pb)((0,ze.Ry)(Fp))});class Vp{id;source;target;geometry}(0,ze.yu)(Vp,{geometry:(0,ze.Ry)(Up),id:(0,ze.Ru)(),source:(0,ze.Ru)(),target:(0,ze.Ru)()});class Gp{name;owningType}(0,ze.yu)(Gp,{name:(0,ze.Ru)(),owningType:(0,ze.Ru)()});class zp{id;source;target;property;geometry}(0,ze.yu)(zp,{geometry:(0,ze.Ry)(Up),id:(0,ze.Ru)(),property:(0,ze.Ry)(Gp),source:(0,ze.Ru)(),target:(0,ze.Ru)()});class Bp{id;type;position;rectangleGeometry}(0,ze.yu)(Bp,{id:(0,ze.Ru)(),position:(0,ze.Ry)(Fp),rectangleGeometry:(0,ze.Ry)(jp),type:(0,ze.Ru)()});class $p{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,ze.yu)($p,{name:(0,ze.Ru)(),generalizationViews:(0,ze.pb)((0,ze.Ry)(Vp)),package:(0,ze.Ru)(),propertyViews:(0,ze.pb)((0,ze.Ry)(zp)),sourceInformation:(0,ze.Ry)(Ip),stereotypes:(0,ze.pb)((0,ze.Ry)(Rp)),taggedValues:(0,ze.pb)((0,ze.Ry)(wp)),typeViews:(0,ze.pb)((0,ze.Ry)(Bp))});class Hp{classes=[];enumerations=[];profiles=[]}(0,ze.yu)(Hp,{classes:(0,ze.pb)((0,ze.Ry)(Mp)),enumerations:(0,ze.pb)((0,ze.Ry)(kp)),profiles:(0,ze.pb)((0,ze.Ry)(vp))});class Yp{name;diagram;domainInfo}(0,ze.yu)(Yp,{diagram:(0,ze.Ry)($p),name:(0,ze.Ru)(),domainInfo:(0,ze.jt)((0,ze.Ry)(Hp))});class Wp{class;enumerations=[];profiles=[];specializations=[]}(0,ze.yu)(Wp,{class:(0,ze.Ry)(Mp),enumerations:(0,ze.pb)((0,ze.Ry)(kp)),profiles:(0,ze.pb)((0,ze.Ry)(vp)),specializations:(0,ze.pb)((0,ze.Ry)(Dp))});const Kp=e=>{const t=e.classViews.map((e=>` TypeView ${e.id}(\n type=${e.class.value.path},\n position=(${e.position.x.toFixed(5)}, ${e.position.y.toFixed(5)}),\n width=${e.rectangle.width.toFixed(5)},\n height=${e.rectangle.height.toFixed(5)},\n stereotypesVisible=true,\n attributesVisible=true,\n attributeStereotypesVisible=true,\n attributeTypesVisible=true,\n color=#FFFFCC,\n lineWidth=1.0)`)),s=e.generalizationViews.map(((e,t)=>` GeneralizationView gview_${t}(\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n color=#000000,\n lineWidth=-1.0,\n lineStyle=SIMPLE)`)),i=e.propertyViews.map(((e,t)=>` PropertyView pview_${t}(\n property=${e.property.value._OWNER.path}.${e.property.value.name},\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n propertyPosition=(0.0,0.0),\n multiplicityPosition=(0.0,0.0),\n color=#000000,\n lineWidth=-1.0,\n stereotypesVisible=true,\n nameVisible=true,\n lineStyle=SIMPLE)`));return`Diagram ${e.path}(width=0.0, height=0.0)\n{\n${[...t,...s,...i].join("\n\n")}\n}`},Zp=(e,t,s,i)=>{const n=t.getOwnNullableClass(e);if(!n){const[n,a]=kl(e),r=new as(a);return jl(Gl(t.root,n,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return n},Xp=e=>{if("*"===e)return new ru(0,void 0);{const t=e.split("..");if(1===t.length)return new ru(parseInt(B(t[0]),10),parseInt(B(t[0]),10));if(2===t.length)return new ru(parseInt(B(t[0]),10),"*"===t[1]?void 0:parseInt(B(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},qp=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,n;w(e.taggedValues,new Wu(Zu.create((i=s.getProfile(t.tag.profile),n=t.tag.value,B(i.p_tags.find((e=>e.value===n)),`Can't find tag '${n}' in profile '${i.path}'`))),t.value))})),t.stereotypes.forEach((t=>{var i,n;w(e.stereotypes,qu.create((i=s.getProfile(t.profile),n=t.value,B(i.p_stereotypes.find((e=>e.value===n)),`Can't find stereotype '${n}' in profile '${i.path}'`))))})),t.generalizations.filter((e=>Boolean(e.rawType))).forEach((t=>{const n=Zp(B(t.rawType),s,i,void 0);w(e.generalizations,iu.create(new nu(n))),w(n._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const n=new au(t.name,Xp(t.multiplicity),iu.create(new nu(s.getOwnNullableEnumeration(B(t.genericType.rawType))??Zp(B(t.genericType.rawType),s,i,void 0))),e);n.aggregation="Composite"===t.aggregation?Qh.COMPOSITE:"Shared"===t.aggregation?Qh.SHARED:void 0,w(e.properties,n)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{w(e.derivedProperties,new tu(t.name,Xp(t.multiplicity),iu.create(new nu(s.getOwnNullableEnumeration(B(t.genericType.rawType))??Zp(B(t.genericType.rawType),s,i,void 0))),e))}))},Jp=e=>{const t=new Ap(new xp([]),new Np([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new as(e.name);jl(Gl(t.root,e.package,!0,new Map),i),t.setOwnType(i.path,i),s.set(i.path,{sourceInformation:e.sourceInformation,isStubbed:!1})})),i.profiles.forEach((e=>{const s=new ep(e.name);jl(Gl(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>w(s.p_tags,new Sp(s,e)))),e.stereotypes.forEach((e=>w(s.p_stereotypes,new yp(s,e))))})),i.enumerations.forEach((e=>{const s=new os(e.name);jl(Gl(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":me}${e.name}`,n=t.getClass(i);qp(n,e,t,s)}))}const i=e.diagram,n=new Ko(i.name);return jl(Gl(t.root,i.package,!0,new Map),n),i.typeViews.forEach((e=>{const s=new sc(n,e.id,Es.create(t.getClass(e.type)));s.position=new Ql(e.position.x,e.position.y),s.rectangle=new ec(e.rectangleGeometry.width,e.rectangleGeometry.height),w(n.classViews,s)})),i.propertyViews.forEach((e=>{const s=new lc(n,lu.create((i=t.getClass(e.property.owningType),a=e.property.name,B(i instanceof as?Hl(i).find((e=>e.name===a)):i.properties.find((e=>e.name===a)),`Can't find property '${a}' of '${i.path}'`))),B(n.classViews.find((t=>t.id===e.source))),B(n.classViews.find((t=>t.id===e.target))));var i,a;s.path=e.geometry.points.map((e=>new Ql(e.x,e.y))),pc(s),w(n.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new cc(n,B(n.classViews.find((t=>t.id===e.source))),B(n.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new Ql(e.x,e.y))),pc(t),w(n.generalizationViews,t)})),[n,t,s]};class Qp extends Gd{diagramInfo;_renderer;diagram;diagramClasses;graph;diagramPath;filePath;fileLine;fileColumn;constructor(e,t,s,i,n,a){super(e),(0,O.rC)(this,{_renderer:O.LO,diagram:O.LO,diagramInfo:O.LO,diagramName:O.Fl,diagramCursorClass:O.Fl,addClassView:O.ls,rebuild:O.aD,setRenderer:O.aD}),this.diagramPath=s,this.filePath=i,this.fileLine=n,this.fileColumn=a,this.diagramInfo=t;const[r,o,l]=Jp(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return Md(this.diagramPath)}get description(){return`Diagram: ${Md(this.diagramPath)}`}get diagramName(){return e=this.diagramPath,B((0,Ml.Z)(e.split(me)));var e}match(e){return e instanceof Qp&&this.diagramPath===e.diagramPath}get renderer(){return B(this._renderer,"Diagram renderer must be initialized (this is likely caused by calling this method at the wrong place)")}get isDiagramRendererInitialized(){return Boolean(this._renderer)}get diagramCursorClass(){if(!this.isDiagramRendererInitialized)return"";if(this.renderer.middleClick||this.renderer.rightClick)return"diagram-editor__cursor--grabbing";switch(this.renderer.interactionMode){case Vu.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case Vu.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case Vu.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case Vu.LAYOUT:return this.renderer.selectionStart?"diagram-editor__cursor--crosshair":this.renderer.mouseOverClassCorner||this.renderer.selectedClassCorner?"diagram-editor__cursor--resize":this.renderer.mouseOverClassView?"diagram-editor__cursor--pointer":"";default:return""}}rebuild(e){this.diagramInfo=e;const[t,s,i]=Jp(e);this.diagram=t,this.graph=s,this.diagramClasses=i,this.fileLine=e.diagram.sourceInformation.line,this.fileColumn=e.diagram.sourceInformation.column}setupRenderer(){this.renderer.onClassViewDoubleClick=e=>{const t=this.diagramClasses.get(e.class.value.path)?.sourceInformation;if(t){const e=new Fd(t.source,t.startLine,t.startColumn);(0,O.fl)(this.editorStore.executeNavigation(e)).catch(this.editorStore.applicationStore.alertUnhandledError)}}}setRenderer(e){this._renderer=e}*addClassView(e,t){const s=((e,t,s)=>{e.profiles.forEach((e=>{const s=`${e.package}${""===e.package?"":me}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new ep(e.name);jl(Gl(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>w(s.p_tags,new Sp(s,e)))),e.stereotypes.forEach((e=>w(s.p_stereotypes,new yp(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":me}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new os(e.name);jl(Gl(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,n=`${i.package}${""===i.package?"":me}${i.name}`;let a=t.getOwnNullableClass(n);a||(a=new as(i.name),jl(Gl(t.root,i.package,!0,new Map),a),t.setOwnType(a.path,a));const r=s.get(a.path)?.isStubbed??!0;return s.set(a.path,{sourceInformation:i.sourceInformation,isStubbed:!1}),e.specializations.forEach((e=>{const i=B(a),n=Zp(B(`${e.package}${""===e.package?"":me}${e.name}`),t,s,e.sourceInformation);w(i._subclasses,n),n.generalizations.map((e=>e.value.rawType)).includes(i)||w(n.generalizations,iu.create(new nu(i)))})),r&&qp(a,i,t,s),a})((0,ze.vB)(Wp,yield this.editorStore.client.getDiagramClassInfo(e)),this.graph,this.diagramClasses),i=this.renderer.addClassView(s,t);i&&(i.id=((e,t)=>{if(!t.match(/^[\w_-]+$/))throw new Error("Token must only contain digits, letters, or special characters _ and -");return`cview_${e.map((e=>{const t=e.match(new RegExp("^cview_(?<count>\\d+)$"));return t?.groups?.count?parseInt(t.groups.count,10):0})).reduce(((e,t)=>Math.max(e,t)),0)+1}`})(this.diagram.classViews.map((e=>e.id)),"cview"))}registerCommands(){const e=()=>this.editorStore.tabManagerState.currentTab===this&&this.isDiagramRendererInitialized;this.editorStore.applicationStore.commandCenter.registerCommand({key:Hd.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Hd.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Hd.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Hd.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[Hd.RECENTER,Hd.USE_ZOOM_TOOL,Hd.USE_VIEW_TOOL,Hd.USE_PAN_TOOL].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class e_{text="";isCaseSensitive=!1;isRegExp=!1;constructor(){(0,O.rC)(this,{text:O.LO,isCaseSensitive:O.LO,isRegExp:O.LO,reset:O.aD,setText:O.aD,setCaseSensitive:O.aD,setRegExp:O.aD})}reset(){this.setText(""),this.setCaseSensitive(!1),this.setRegExp(!1)}setText(e){this.text=e}setCaseSensitive(e){this.isCaseSensitive=e}toggleCaseSensitive(){this.setCaseSensitive(!this.isCaseSensitive)}setRegExp(e){this.isRegExp=e}toggleRegExp(){this.setRegExp(!this.isRegExp)}}class t_ extends D{}class s_{applicationStore;initState=gt.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=bd.CONSOLE;auxPanelDisplayState=new Jh({initial:0,default:300,snap:100});activeActivity=Ld.CONCEPT;sideBarDisplayState=new Jh({initial:300,default:300,snap:150});tabManagerState=new zd(this);executionState=gt.create();navigationStack=[];consoleText;fileSearchCommandLoadingState=gt.create();fileSearchCommandState=new e_;openFileSearchCommand=!1;fileSearchCommandResults=[];textSearchCommandLoadingState=gt.create();textSearchCommandState=new e_;openTextSearchCommand=!1;searchState;testRunState=gt.create();testRunnerState;constructor(e){(0,O.rC)(this,{isMaxAuxPanelSizeSet:O.LO,activeAuxPanelMode:O.LO,activeActivity:O.LO,consoleText:O.LO,navigationStack:O.LO,openFileSearchCommand:O.LO,fileSearchCommandResults:O.LO,fileSearchCommandState:O.LO,openTextSearchCommand:O.LO,textSearchCommandState:O.LO,searchState:O.LO,testRunnerState:O.LO,setOpenFileSearchCommand:O.aD,setOpenTextSearchCommand:O.aD,setActiveAuxPanelMode:O.aD,setActiveActivity:O.aD,setConsoleText:O.aD,setSearchState:O.aD,setTestRunnerState:O.aD,pullInitializationActivity:O.aD,pullExecutionStatus:O.aD,initialize:O.ls,checkIfSessionWakingUp:O.ls,loadDiagram:O.ls,loadFile:O.ls,reloadFile:O.ls,execute:O.ls,executeGo:O.ls,manageExecuteGoResult:O.ls,executeTests:O.ls,executeFullTestSuite:O.ls,executeNavigation:O.ls,navigateBack:O.ls,executeSaveAndReset:O.ls,fullReCompile:O.ls,refreshTrees:O.ls,updateFileUsingSuggestionCandidate:O.ls,updateFile:O.ls,searchFile:O.ls,searchText:O.ls,findUsages:O.ls,command:O.ls,createNewDirectory:O.ls,createNewFile:O.ls,deleteDirectoryOrFile:O.ls}),this.applicationStore=e,this.directoryTreeState=new ih(this),this.conceptTreeState=new ph(this),this.client=new qh(new ue({baseUrl:this.applicationStore.config.useDynamicPureServer?window.location.origin:this.applicationStore.config.pureUrl}))}setOpenFileSearchCommand(e){this.openFileSearchCommand=e}setOpenTextSearchCommand(e){this.openTextSearchCommand=e}setActiveAuxPanelMode(e){this.activeAuxPanelMode=e}setConsoleText(e){this.consoleText=e}setSearchState(e){this.searchState=e}setTestRunnerState(e){this.testRunnerState=e}cleanUp(){this.applicationStore.setBlockingAlert(void 0),this.applicationStore.setActionAlertInfo(void 0)}*initialize(e,t,s,i){if(this.initState.isInInitialState){this.client.mode=s,this.client.compilerMode=i,this.initState.inProgress();try{const s=this.client.initialize(!e);this.applicationStore.setBlockingAlert({message:"Loading Pure IDE...",prompt:"Please be patient as we are building the initial application state",showLoading:!0}),yield this.pullInitializationActivity(),this.applicationStore.setBlockingAlert(void 0);const i=(0,O.fl)(this.loadFile("/welcome.pure")),a=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(n=yield s).error?n.source?(0,ze.vB)(gh,n):(0,ze.vB)(mh,n):(0,ze.vB)(_h,n);o.text&&(this.setConsoleText(o.text),this.setActiveAuxPanelMode(bd.CONSOLE),this.auxPanelDisplayState.open()),o instanceof mh?o.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof gh&&(yield(0,O.fl)(this.loadFile(o.source,new jd(o.source,o.line,o.column,new t_((o.text??"").split("\n").filter(Boolean)[0]))))):(t&&(yield t()),yield Promise.all([i,a,r]))}catch(e){return j(e),this.applicationStore.notifyError(e),this.initState.fail(),void this.applicationStore.setBlockingAlert({message:"Failed to initialize IDE",prompt:"Make sure the IDE server is working, otherwise try to restart it"})}var n;this.initState.pass()}else this.applicationStore.notifyIllegalState("Editor store is re-initialized")}*checkIfSessionWakingUp(e){this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",showLoading:!0}),yield this.pullInitializationActivity((t=>{t.text&&this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",prompt:t.text,showLoading:!0})})),this.applicationStore.setBlockingAlert(void 0)}async pullInitializationActivity(e){return(await this.client.getInitializationActivity()).initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullInitializationActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}registerCommands(){this.applicationStore.commandCenter.registerCommand({key:Bd.SEARCH_FILE,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:Bd.SEARCH_TEXT,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenTextSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:Bd.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof Kd&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,!0)}}),this.applicationStore.commandCenter.registerCommand({key:Bd.TOGGLE_AUX_PANEL,trigger:()=>this.initState.hasSucceeded,action:()=>this.auxPanelDisplayState.toggle()}),this.applicationStore.commandCenter.registerCommand({key:Bd.EXECUTE,action:()=>{(0,O.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Bd.FULL_RECOMPILE,action:()=>{(0,O.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Bd.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,O.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Bd.RUN_ALL_TESTS,action:()=>{(0,O.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Bd.RUN_RELAVANT_TESTS,action:()=>{(0,O.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[Bd.SEARCH_FILE,Bd.SEARCH_TEXT,Bd.GO_TO_FILE,Bd.TOGGLE_AUX_PANEL,Bd.EXECUTE,Bd.FULL_RECOMPILE,Bd.FULL_RECOMPILE_WITH_FULL_INIT,Bd.RUN_ALL_TESTS,Bd.RUN_RELAVANT_TESTS].forEach((e=>this.applicationStore.commandCenter.deregisterCommand(e)))}setActiveActivity(e,t){this.sideBarDisplayState.isOpen?e!==this.activeActivity||t?.keepShowingIfMatchedCurrent||this.sideBarDisplayState.close():this.sideBarDisplayState.open(),this.activeActivity=e}*loadDiagram(e,t,s,i){let n=this.tabManagerState.tabs.find((e=>e instanceof Qp&&e.diagramPath===t));n||(yield(0,O.fl)(this.checkIfSessionWakingUp()),n=new Qp(this,(0,ze.vB)(Yp,yield this.client.getDiagramInfo(t)),t,e,s,i)),this.tabManagerState.openTab(n)}*loadFile(e,t){let s=this.tabManagerState.tabs.find((t=>t instanceof Kd&&t.filePath===e));s||(yield(0,O.fl)(this.checkIfSessionWakingUp()),s=new Kd(this,(0,ze.vB)(kd,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof jd&&s.showError(t))}*reloadFile(e){const t=[];yield Promise.all(this.tabManagerState.tabs.map((async s=>{if(s instanceof Kd&&s.filePath===e)s.setFile((0,ze.vB)(kd,await this.client.getFile(e)));else if(s instanceof Qp&&s.filePath===e)try{s.rebuild((0,ze.vB)(Yp,await this.client.getDiagramInfo(s.diagramPath)))}catch{t.push(s)}}))),t.forEach((e=>this.tabManagerState.closeTab(e)))}*execute(e,t,s,i,n){if(this.initState.hasSucceeded)if(this.executionState.isInProgress)this.applicationStore.notifyWarning("Another execution is already in progress!");else{this.searchState instanceof bh||this.setSearchState(void 0),this.executionState.inProgress();try{const r=this.tabManagerState.tabs.map((e=>e instanceof Kd?{path:e.filePath,code:e.file.content}:e instanceof Qp?{diagram:e.diagramPath,code:Kp(e.diagram)}:void 0)).filter(G),o=this.client.execute(r,e,t),l=1e3;let c,d=!1;yield Promise.all([o.then((e=>{d=!0,c=e})),new Promise((e=>setTimeout((()=>{!d&&s&&(this.applicationStore.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),e(this.pullExecutionStatus())),e()}),l,!0)))]);const h=(a=B(c)).error?a.candidateName&&a.PureUnmatchedFunctionException?(0,ze.vB)(Ah,a):a.candidateName&&a.candidates?(0,ze.vB)(Sh,a):(0,ze.vB)(Th,a):a.jumpTo?(0,ze.vB)(xh,a):a.tests?(0,ze.vB)(vh,a):(0,ze.vB)(fh,a);this.applicationStore.setBlockingAlert(void 0),n?.avoidUpdatingConsoleText||this.setConsoleText(h.text),h instanceof Th?(this.applicationStore.notifyWarning("Execution failed!"),h.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:h.sessionError}):yield(0,O.fl)(i(h))):h instanceof fh?(this.applicationStore.notifySuccess("Execution succeeded!"),h.reinit?(this.applicationStore.setBlockingAlert({message:"Reinitializing...",prompt:"Please do not refresh the application",showLoading:!0}),this.initState.reset(),yield(0,O.fl)(this.initialize(!1,(()=>(0,O.fl)(this.execute(e,t,s,i))),this.client.mode,this.client.compilerMode))):yield(0,O.fl)(i(h))):yield(0,O.fl)(i(h))}finally{this.applicationStore.setBlockingAlert(void 0),this.executionState.reset()}var a}else this.applicationStore.notifyWarning("Can't execute while initializing application")}async pullExecutionStatus(){const e=await this.client.getExecutionActivity();return this.applicationStore.setBlockingAlert({message:"Executing...",prompt:e.text?e.text:"Please do not refresh the application",showLoading:!0}),e.executing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullExecutionStatus())}catch(e){t(e)}}),500))):(this.applicationStore.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),Promise.resolve())}*executeGo(){yield(0,O.fl)(this.execute("executeGo",{},!0,(e=>(0,O.fl)(this.manageExecuteGoResult(e)))))}*manageExecuteGoResult(e){const t=(0,O.fl)(this.refreshTrees());if(e instanceof Th)yield(0,O.fl)(this.loadFile(e.source,new jd(e.source,e.line,e.column,new t_(e.text.split("\n").filter(Boolean)[0])))),e instanceof Ah?(this.setSearchState(new kh(this,e)),this.setActiveAuxPanelMode(bd.SEARCH_RESULT),this.auxPanelDisplayState.open()):e instanceof Sh&&(this.setSearchState(new Fh(this,e)),this.setActiveAuxPanelMode(bd.SEARCH_RESULT),this.auxPanelDisplayState.open());else if(e instanceof fh&&e.modifiedFiles.length)for(const t of e.modifiedFiles)yield(0,O.fl)(this.reloadFile(t));yield t}*executeTests(e,t){t?this.applicationStore.notifyUnsupportedFeature("Run relevant tests"):this.testRunState.isInProgress?this.applicationStore.notifyWarning("Test runner is working. Please try again later"):(this.testRunState.inProgress(),yield(0,O.fl)(this.execute("executeTests",{path:e,relevantTestsOnly:t},!1,(async e=>{const t=(0,O.fl)(this.refreshTrees());if(e instanceof Th)await(0,O.fl)(this.loadFile(e.source,new jd(e.source,e.line,e.column,new t_(e.text.split("\n").filter(Boolean)[0])))),this.setActiveAuxPanelMode(bd.CONSOLE),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof vh){this.setActiveAuxPanelMode(bd.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new Yh(this,e);this.setTestRunnerState(t),await(0,O.fl)(t.buildTestTreeData()),t.refreshTree(),await(0,O.fl)(t.pollTestRunnerResult()),this.testRunState.pass()}await t}))))}*executeFullTestSuite(e){yield(0,O.fl)(this.executeTests("::",e))}*executeNavigation(e){this.navigationStack.push(e),yield(0,O.fl)(this.execute("getConcept",{file:e.file,line:e.line,column:e.column},!1,(async e=>{e instanceof xh&&await(0,O.fl)(this.loadFile(e.jumpTo.source,new Fd(e.jumpTo.source,e.jumpTo.line,e.jumpTo.column)))}),{avoidUpdatingConsoleText:!0}))}*navigateBack(){if(0!==this.navigationStack.length){if(this.navigationStack.length>0){const e=this.navigationStack.pop();e&&(yield(0,O.fl)(this.loadFile(e.file,e)))}}else this.applicationStore.notifyWarning("Can't navigate back any further - navigation stack is empty")}*executeSaveAndReset(e){yield(0,O.fl)(this.execute("executeSaveAndReset",{},!0,(async t=>{this.initState.reset(),await(0,O.fl)(this.initialize(e,void 0,this.client.mode,this.client.compilerMode)),this.setActiveActivity(Ld.CONCEPT,{keepShowingIfMatchedCurrent:!0})})))}*fullReCompile(e){this.applicationStore.setActionAlertInfo({message:"Are you sure you want to perform a full re-compile?",prompt:"This may take a long time to complete",type:It.CAUTION,actions:[{label:"Perform full re-compile",type:vt.PROCEED_WITH_CAUTION,handler:()=>{(0,O.fl)(this.executeSaveAndReset(e)).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:vt.PROCEED,default:!0}]})}*refreshTrees(){yield Promise.all([this.directoryTreeState.refreshTreeData(),this.conceptTreeState.refreshTreeData()])}*updateFileUsingSuggestionCandidate(e){this.setSearchState(void 0),yield(0,O.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActiveAuxPanelMode(bd.CONSOLE),this.auxPanelDisplayState.open()}*updateFile(e,t,s,i,n){yield(0,O.fl)(this.execute("updateSource",{updatePath:e,updateSources:[{path:e,line:t,column:s,add:i,message:n}]},!1,(e=>(0,O.fl)(this.manageExecuteGoResult(e)))))}*searchFile(){this.fileSearchCommandLoadingState.isInProgress||(this.fileSearchCommandLoadingState.inProgress(),this.fileSearchCommandResults=yield this.client.findFiles(this.fileSearchCommandState.text,this.fileSearchCommandState.isRegExp),this.fileSearchCommandLoadingState.pass())}*searchText(){if(!this.textSearchCommandLoadingState.isInProgress){this.textSearchCommandLoadingState.inProgress(),this.setActiveAuxPanelMode(bd.SEARCH_RESULT),this.auxPanelDisplayState.open();try{const e=(yield this.client.searchText(this.textSearchCommandState.text,this.textSearchCommandState.isCaseSensitive,this.textSearchCommandState.isRegExp)).map((e=>(e=>(0,ze.vB)(wh,e))(e)));this.setSearchState(new Dh(this,e)),this.textSearchCommandLoadingState.pass()}catch(e){j(e),this.applicationStore.notifyError(e),this.textSearchCommandLoadingState.fail()}}}*findUsages(e){const t="Error finding references. Please make sure that the code compiles and that you are looking for references of non primitive types!";let s;try{s=yield this.client.getConceptPath(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning(t)}try{this.applicationStore.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${Wh(s)}`,showLoading:!0});const e=(yield this.client.getUsages(s.owner?s.type?"meta::pure::ide::findusages::findUsagesForEnum_String_1__String_1__SourceInformation_MANY_":"meta::pure::ide::findusages::findUsagesForProperty_String_1__String_1__SourceInformation_MANY_":"meta::pure::ide::findusages::findUsagesForPath_String_1__SourceInformation_MANY_",(s.owner?[`'${s.owner}'`]:[]).concat(`'${s.path}'`))).map((e=>(0,ze.vB)(Kh,e)));this.setSearchState(new Mh(this,s,e)),this.setActiveAuxPanelMode(bd.SEARCH_RESULT),this.auxPanelDisplayState.open()}catch{this.applicationStore.notifyWarning(t)}finally{this.applicationStore.setBlockingAlert(void 0)}}*command(e){try{const s=(t=yield e()).error?(0,ze.vB)(Xh,t):new Zh;return!(s instanceof Xh&&(s.errorDialog?this.applicationStore.notifyWarning(`Error: ${s.text}`):this.setConsoleText(s.text),1))}catch(e){return j(e),this.applicationStore.notifyError(e),!1}var t}*createNewDirectory(e){yield(0,O.fl)(this.command((()=>this.client.createFolder(Md(e))))),yield(0,O.fl)(this.directoryTreeState.refreshTreeData())}*createNewFile(e){const t=yield(0,O.fl)(this.command((()=>this.client.createFile(Md(e)))));yield(0,O.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,O.fl)(this.loadFile(e)))}*deleteDirectoryOrFile(e,t,s){const i=async()=>{await(0,O.fl)(this.command((()=>this.client.deleteDirectoryOrFile(Md(e))))),this.tabManagerState.tabs.filter((t=>t instanceof Kd&&t.filePath.startsWith(e))).forEach((e=>this.tabManagerState.closeTab(e))),await(0,O.fl)(this.directoryTreeState.refreshTreeData())};this.applicationStore.setActionAlertInfo({message:`Are you sure you would like to delete this ${t?"directory":"file"}?`,prompt:s?"Beware! This directory is not empty, this action is not undo-able, you have to manually revert using VCS":"Beware! This action is not undo-able, you have to manually revert using VCS",type:It.CAUTION,actions:[{label:"Delete anyway",type:vt.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:vt.PROCEED,default:!0}]})}}const i_=(0,it.createContext)(void 0),n_=({children:e})=>{const t=Mt(),s=(0,st.fv)((()=>new s_(t)));return(0,x.jsx)(i_.Provider,{value:s,children:e})},a_=()=>B((0,it.useContext)(i_),"Can't find editor store in context"),r_=(0,st.Pi)((()=>{const e=a_();return(0,x.jsxs)("div",{className:"console-panel",children:[e.consoleText&&(0,x.jsx)("pre",{className:"console-panel__content",children:e.consoleText.trim()}),!e.consoleText&&(0,x.jsx)(od,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Execute to see output"}),(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F9"})})]})})})})]})})),o_=(0,st.Pi)((e=>{const{searchState:t,searchEntry:s}=e,i=a_(),n=Mt(),a=e=>()=>(0,O.fl)(i.loadFile(s.sourceId,new Fd(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,x.jsxs)("div",{className:"search-panel__entry",children:[(0,x.jsxs)("div",{className:"search-panel__entry__header",children:[(0,x.jsxs)("div",{className:"search-panel__entry__header__title",children:[(0,x.jsx)("div",{className:"search-panel__entry__header__title__label",children:(0,x.jsx)(Yc.QqN,{})}),(0,x.jsx)("div",{className:"search-panel__entry__header__title__content",children:Md(s.sourceId)})]}),(0,x.jsxs)("div",{className:"search-panel__entry__header__actions",children:[(0,x.jsx)("div",{className:"search-panel__entry__header__action search-panel__entry__header__action--with-counter",children:(0,x.jsx)("div",{className:"search-panel__entry__header__action__counter",children:s.coordinates.length})}),(0,x.jsx)("button",{className:"search-panel__entry__header__action search-panel__entry__header__action--hidden",tabIndex:-1,title:"Dismiss",onClick:()=>t.dismissSearchEntry(s),children:(0,x.jsx)(Yc.q1B,{})})]})]}),(0,x.jsx)("div",{className:"search-panel__entry__content",children:s.coordinates.map((e=>(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label search-panel__entry__content__item__label--full",title:"Go to Result",onClick:a(e),children:`line: ${e.startLine} - column: ${e.startColumn}`}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action search-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,x.jsx)(Yc.q1B,{})})})]},e.uuid)))})]})})),l_=(0,st.Pi)((e=>{const{searchState:t}=e,s=a_();return t.searchEntries.length?(0,x.jsxs)("div",{className:"search-panel__content",children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} result(s) in ${t.numberOfFiles} files for '${s.textSearchCommandState.text}'`}),t.searchEntries.map((e=>(0,x.jsx)(o_,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(od,{children:`No occurrences found for '${s.textSearchCommandState.text}'`})})),c_=(0,st.Pi)((e=>{const{usageState:t}=e;return t.searchEntries.length?(0,x.jsxs)("div",{className:"search-panel__content",children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} usages(s) in ${t.numberOfFiles} files for ${Wh(t.usageConcept)}`}),t.searchEntries.map((e=>(0,x.jsx)(o_,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(od,{children:`No usages found for ${Wh(t.usageConcept)}`})})),d_=(0,st.Pi)((e=>{const{candidate:t}=e,s=a_(),i=Mt(),n=()=>{(0,O.fl)(s.loadFile(t.sourceID,new Fd(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)};return(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Go to Result",onClick:n,children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${Md(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:n,children:(0,x.jsx)(Yc.bK4,{})})})]})})),h_=(0,st.Pi)((e=>{const{candidate:t}=e,s=a_(),i=Mt();return(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Add Suggested Import",onClick:()=>{(0,O.fl)(s.updateFileUsingSuggestionCandidate(t)).catch(i.alertUnhandledError)},children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${Md(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:()=>{(0,O.fl)(s.loadFile(t.sourceID,new Fd(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,x.jsx)(Yc.bK4,{})})})]})})),u_=(0,st.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,x.jsxs)("div",{className:"search-panel__content",children:[!s.candidatesWithPackageImported.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages already imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageImported.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages already imported, would match the function '${s.candidateName}' if you changed the parameters`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageImported.map((e=>(0,x.jsx)(d_,{candidate:e},e.uuid)))})]}),!s.candidatesWithPackageNotImported.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages not imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageNotImported.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages not imported, match the function '${s.candidateName}'. Click on result to import the necessary package`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageNotImported.map((e=>(0,x.jsx)(h_,{candidate:e},e.uuid)))})]})]})})),p_=(0,st.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,x.jsxs)("div",{className:"search-panel__content",children:[!s.candidates.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No possible matches found for '${s.candidateName}'`}),Boolean(s.candidates.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Found possible matches for '${s.candidateName}'. Click on result to import the necessary package`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidates.map((e=>(0,x.jsx)(h_,{candidate:e},e.uuid)))})]})]})})),__=(0,st.Pi)((()=>{const e=a_();return(0,x.jsxs)("div",{className:"search-panel",children:[(0,x.jsx)($c,{isLoading:e.textSearchCommandLoadingState.isInProgress}),!e.searchState&&(0,x.jsx)(od,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Search something"}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Yc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Yc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F"})]})]})})})}),e.searchState instanceof Mh&&(0,x.jsx)(c_,{usageState:e.searchState}),e.searchState instanceof Dh&&(0,x.jsx)(l_,{searchState:e.searchState}),e.searchState instanceof kh&&(0,x.jsx)(u_,{searchState:e.searchState}),e.searchState instanceof Fh&&(0,x.jsx)(p_,{searchState:e.searchState})]})})),m_=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:n,onNodeSelect:a}=e;return(0,x.jsxs)("div",{className:(0,Dc.clsx)("tree-view__node__container",{[`${n}__tree-view__node__container`]:n}),onClick:()=>a?.(t),style:{paddingLeft:(s-1)*(i??1)+"rem",display:"flex"},children:[(0,x.jsx)("div",{className:(0,Dc.clsx)("tree-view__node__icon",{[`${n}__tree-view__node__icon`]:n}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.XCv,{}))}),(0,x.jsx)("div",{className:(0,Dc.clsx)("tree-view__node__label",{[`${n}__tree-view__node__label`]:n}),children:t.label})]})},g_=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:n,classPrefix:a,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:g_,TreeNodeContainer:m_},d=r?{...c,...r}:c;return(0,x.jsxs)("div",{className:(0,Dc.clsx)("tree-view__node__block",{[`${a}__tree-view__node__block`]:a}),children:[(0,x.jsx)(d.TreeNodeContainer,{node:t,level:s+1,stepPaddingInRem:o,classPrefix:a,onNodeSelect:i,innerProps:l}),t.isOpen&&n(t).map((e=>(0,x.jsx)(d.TreeNodeView,{node:e,level:s+1,components:r,classPrefix:a,onNodeSelect:i,getChildNodes:n,innerProps:l},e.id)))]})},E_=e=>{const{treeData:t,className:s,classPrefix:i,components:n,onNodeSelect:a,getChildNodes:r,getRootNodes:o,innerProps:l}=e,c=o?.(t)??t.rootIds.map((e=>t.nodes.get(e))).filter(G),d={TreeNodeView:g_,TreeNodeContainer:m_},h=n?{...d,...n}:d;return(0,x.jsx)("div",{className:(0,Dc.clsx)("tree-view__node__root",s??"",{[`${i}__tree-view__node__root`]:i}),children:c.map((e=>(0,x.jsx)(h.TreeNodeView,{level:0,node:e,getChildNodes:r,components:h,onNodeSelect:a,classPrefix:i,innerProps:l},e.id)))})};var f_=s(410);const T_=f_.gs,C_="resizable-panel--collapsed",x_=(e,t)=>({collapsiblePanel:{className:(0,Dc.clsx)(...t?.classes??[],{[C_]:e}),onStartResize:e=>{e.domElement.classList.remove(C_),t?.onStartResize?.(e)},onStopResize:e=>{const s=Number(e.domElement.style.flexGrow);s<=.01?e.domElement.style.flexGrow="0":s>=.99&&(e.domElement.style.flexGrow="1"),t?.onStopResize?.(e)},size:!e&&t?.size?t.size:0,flex:e?0:void 0},remainingPanel:{flex:e?1:void 0}}),N_=f_.jW,O_=f_.nN,A_=e=>(0,x.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var S_=s(70177);const y_=(0,st.Pi)((e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,{testRunnerState:r,onNodeOpen:o,onNodeExpand:l,onNodeCompress:c,renderNodeLabel:d}=a,h=a_(),u=Mt(),p=r.testResultInfo,_=!t.data.type,m=t.id===r.selectedTestId;let g;switch(p?((e,t)=>{const s=e.id;return Boolean(e.data.type)?((e,t)=>t.passedTests.has(e)?oh.PASSED:t.failedTests.has(e)?oh.FAILED:t.testsWithError.has(e)?oh.ERROR:oh.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(s)))||t.testWithErrorIds.some((e=>e.startsWith(s)))?oh.FAILED:t.notRunTestIds.some((e=>e.startsWith(s)))?oh.RUNNING:oh.PASSED})(t,p):void 0){case oh.PASSED:g=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--passed",children:(0,x.jsx)(Yc.rE2,{})});break;case oh.FAILED:g=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--failed",children:(0,x.jsx)(Yc.$Ow,{})});break;case oh.ERROR:g=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--error",children:(0,x.jsx)(Yc.xDH,{})});break;case oh.RUNNING:g=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--running",children:(0,x.jsx)(Yc.VRP,{})});break;default:g=(0,x.jsx)(Yc.pTE,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,x.jsxs)("div",{className:(0,Dc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected":m}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t),_?E():o(t)},onDoubleClick:()=>{_?E():(0,O.fl)(h.loadFile(t.data.li_attr.file,new Fd(t.data.li_attr.file,Number.parseInt(t.data.li_attr.line,10),Number.parseInt(t.data.li_attr.column,10)))).catch(u.alertUnhandledError)},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:E,children:_?t.isOpen?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:g})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:d?.(t)??t.label})]})})),I_=(0,st.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=e=>t.setSelectedTestId(e.id),n=e=>{let t=e.id.split("__")[0];if(!t)return e.label;const s=t.split("_");return t=s.slice(1,s.length).join(me),(0,x.jsxs)("div",{className:"test-runner-list__item__label",children:[(0,x.jsx)("div",{className:"test-runner-list__item__label__name",children:e.label}),(0,x.jsx)("div",{className:"test-runner-list__item__label__path",children:t})]})};return(0,x.jsx)("div",{className:"explorer__content",children:Array.from(t.allTests.keys()).map((e=>s.nodes.get(e))).filter(G).map((e=>(0,x.jsx)(y_,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:n,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),v_=(0,st.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=0===s.nodes.size;return(0,x.jsxs)("div",{className:"explorer__content",children:[i&&(0,x.jsx)(od,{children:"No tests found"}),!i&&(0,x.jsx)(E_,{components:{TreeNodeContainer:y_},treeData:s,onNodeSelect:()=>{},getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>s.nodes.get(e))).filter(G),innerProps:{testRunnerState:t,onNodeOpen:e=>t.setSelectedTestId(e.id),onNodeExpand:e=>{e.isOpen=!0,t.refreshTree()},onNodeCompress:e=>{e.isOpen=!1,t.refreshTree()}}})]})})),R_=(0,st.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,n=a_(),a=Mt(),r=i.results.get(s),o=B(t.allTests.get(s),`Can't find info for test with ID '${s}'`);return(0,x.jsxs)("div",{className:"panel",children:[(0,x.jsxs)("div",{className:"panel__header",children:[(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__label",children:o.text})}),(0,x.jsx)("div",{className:"panel__header__actions",children:(0,x.jsx)("button",{className:"panel__header__action",tabIndex:-1,title:"Open File",onClick:()=>{(0,O.fl)(n.loadFile(o.li_attr.file,new Fd(o.li_attr.file,Number.parseInt(o.li_attr.line,10),Number.parseInt(o.li_attr.column,10)))).catch(a.alertUnhandledError)},children:(0,x.jsx)(Yc.qdB,{})})})]}),(0,x.jsxs)("div",{className:"panel__content test-runner-panel__result",children:[!r&&(0,x.jsx)("div",{className:"test-runner-panel__result__content",children:"Running..."}),r instanceof Uh&&(0,x.jsx)("div",{className:"test-runner-panel__result__content",children:"Test passed!"}),r instanceof Gh&&(0,x.jsx)("pre",{className:"test-runner-panel__result__content",children:r.error.text})]})]})})),P_=(0,st.Pi)((e=>{const{testRunnerState:t}=e,s=a_(),i=Mt(),n=t.testExecutionResult.count,a=t.testResultInfo,r=a?.suiteStatus??rh.NONE,o=a?.runPercentage??0;return(0,x.jsx)("div",{className:"test-runner-panel__content",children:(0,x.jsxs)(T_,{orientation:"vertical",children:[(0,x.jsx)(N_,{minSize:400,children:(0,x.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,x.jsx)($c,{isLoading:t.treeBuildingState.isInProgress}),(0,x.jsxs)("div",{className:"panel__header",children:[(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsxs)("div",{className:"panel__header__title__content test-runner-panel__explorer__report",children:[(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview",children:[(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--total",children:[n," total"]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--passed",children:[a?.passed??0," ",(0,x.jsx)(Yc.rE2,{})]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--failed",children:[a?.failed??0," ",(0,x.jsx)(Yc.$Ow,{})]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--error",children:[a?.error??0," ",(0,x.jsx)(Yc.xDH,{})]})]}),a&&(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__time",children:[a.time,"ms"]})]})}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.setViewAsList(!t.viewAsList),title:t.viewAsList?"View As Tree":"View As List",children:t.viewAsList?(0,x.jsx)(Yc.NEI,{className:"test-runner-panel__icon--tree-view"}):(0,x.jsx)(Yc.VjU,{className:"test-runner-panel__icon--list-view"})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.expandTree(),title:"Expand All",children:(0,x.jsx)(Yc.Qq,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,x.jsx)(Yc.jG4,{})}),(0,x.jsx)("button",{className:"panel__header__action",tabIndex:-1,disabled:!s.testRunState.isInProgress,onClick:()=>{(0,O.fl)(t.cancelTestRun()).catch(i.alertUnhandledError)},title:"Stop",children:(0,x.jsx)(Yc.SCS,{})}),(0,x.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,O.fl)(t.rerunTestSuite()).catch(i.alertUnhandledError)},disabled:s.testRunState.isInProgress,title:"Run Suite",children:(0,x.jsx)(Yc.o1U,{})})]})]}),(0,x.jsx)("div",{className:"test-runner-panel__header__status",children:(0,x.jsx)(S_.Z,{className:`test-runner-panel__progress-bar test-runner-panel__progress-bar--${r.toLowerCase()}`,classes:{bar:`test-runner-panel__progress-bar__bar test-runner-panel__progress-bar__bar--${r.toLowerCase()}`},variant:"determinate",value:o})}),(0,x.jsx)("div",{className:"panel__content",children:t.treeData&&(0,x.jsxs)(x.Fragment,{children:[!t.viewAsList&&(0,x.jsx)(v_,{testRunnerState:t}),t.viewAsList&&(0,x.jsx)(I_,{testRunnerState:t})]})})]})}),(0,x.jsx)(O_,{children:(0,x.jsx)(A_,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsxs)(N_,{minSize:400,children:[t.selectedTestId&&!a&&(0,x.jsx)("div",{}),t.selectedTestId&&a&&(0,x.jsx)(R_,{testRunnerState:t,selectedTestId:t.selectedTestId,testResultInfo:a}),!t.selectedTestId&&(0,x.jsxs)("div",{className:"panel",children:[(0,x.jsx)("div",{className:"panel__header"}),(0,x.jsx)("div",{className:"panel__content",children:(0,x.jsx)(od,{children:"No test selected"})})]}),(0,x.jsx)("div",{})]})]})})})),w_=(0,st.Pi)((()=>{const e=a_().testRunnerState;return(0,x.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,x.jsx)(od,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content",children:[(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run full test suite"}),(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run relevant tests only"}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Yc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,x.jsx)(P_,{testRunnerState:e})]})})),L_=(0,st.Pi)((()=>{const e=a_(),t={[bd.CONSOLE]:{mode:bd.CONSOLE,name:"CONSOLE",icon:void 0,isVisible:!0},[bd.SEARCH_RESULT]:{mode:bd.SEARCH_RESULT,name:"SEARCH",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--search",children:(0,x.jsx)(Yc.W1M,{})}),isVisible:!0},[bd.TEST_RUNNER]:{mode:bd.TEST_RUNNER,name:"TEST",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--test",children:(0,x.jsx)(Yc.Vzd,{})}),isVisible:!0}},s=Object.values(bd).filter((e=>G(t[e])&&t[e].isVisible)),i=t=>e.activeAuxPanelMode===t&&s.includes(t);return(0,it.useEffect)((()=>{s.includes(e.activeAuxPanelMode)||e.setActiveAuxPanelMode(bd.CONSOLE)}),[e,s,e.activeAuxPanelMode]),(0,x.jsxs)("div",{className:"panel auxiliary-panel",children:[(0,x.jsxs)("div",{className:"panel__header",children:[(0,x.jsx)("div",{className:"auxiliary-panel__header__tabs",children:s.map((e=>t[e])).filter(G).map((t=>{return(0,x.jsxs)("button",{tabIndex:-1,className:(0,Dc.clsx)("auxiliary-panel__header__tab",{"auxiliary-panel__header__tab--active":e.activeAuxPanelMode===t.mode}),onClick:(s=t.mode,()=>e.setActiveAuxPanelMode(s)),children:[t.icon&&(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon",children:t.icon}),(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__title",children:t.name})]},t.mode);var s}))}),(0,x.jsxs)("div",{className:"auxiliary-panel__header__actions",children:[(0,x.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggleMaximize(),tabIndex:-1,title:"Toggle Expand/Collapse",children:e.auxPanelDisplayState.isMaximized?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.g8U,{})}),(0,x.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,x.jsx)(Yc.b0D,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content",children:[i(bd.CONSOLE)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(r_,{})}),i(bd.SEARCH_RESULT)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(__,{})}),i(bd.TEST_RUNNER)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(w_,{})})]})]})}));var b_=s(42689);const D_=()=>(0,x.jsx)("div",{className:"icon color--package",children:(0,x.jsx)(Yc.jtq,{})}),M_=()=>(0,x.jsx)("div",{className:"icon color--class",children:"C"}),k_=()=>(0,x.jsx)("div",{className:"icon color--association",children:"A"}),F_=()=>(0,x.jsx)("div",{className:"icon color--enumeration",children:"E"}),j_=()=>(0,x.jsx)("div",{className:"icon color--measure",children:"M"}),U_=()=>(0,x.jsx)("div",{className:"icon color--unit",children:"u"}),V_=()=>(0,x.jsx)("div",{className:"icon color--profile",children:"P"}),G_=()=>(0,x.jsx)("div",{className:"icon icon--function color--function",children:(0,x.jsx)(Yc.eid,{})}),z_=()=>(0,x.jsx)("div",{className:"icon color--mapping",children:(0,x.jsx)(Yc.Zlt,{})}),B_=()=>(0,x.jsx)("div",{children:(0,x.jsx)(Yc.UOT,{})}),$_=()=>(0,x.jsx)("div",{className:"icon icon--function color--native-function",children:(0,x.jsx)(Yc.eid,{})}),H_=()=>(0,x.jsx)("div",{className:"icon icon--property color--property",children:(0,x.jsx)(Yc.HXR,{})}),Y_=()=>(0,x.jsx)("div",{className:"icon color--diagram",children:(0,x.jsx)(Yc.oF7,{})}),W_=()=>(0,x.jsx)("div",{className:"icon icon--database",children:(0,x.jsx)(Yc.VHe,{})}),K_=e=>{switch(e){case nh.PACKAGE:return(0,x.jsx)(D_,{});case nh.PROFILE:return(0,x.jsx)(V_,{});case nh.CLASS:return(0,x.jsx)(M_,{});case nh.ASSOCIATION:return(0,x.jsx)(k_,{});case nh.PROPERTY:return(0,x.jsx)(H_,{});case nh.ENUMERATION:return(0,x.jsx)(F_,{});case nh.MEASURE:return(0,x.jsx)(j_,{});case nh.UNIT:return(0,x.jsx)(U_,{});case nh.FUNCTION:return(0,x.jsx)(G_,{});case nh.NATIVE_FUNCTION:return(0,x.jsx)($_,{});case nh.DIAGRAM:return(0,x.jsx)(Y_,{});case nh.DATABASE:return(0,x.jsx)(W_,{});case nh.MAPPING:return(0,x.jsx)(z_,{});default:return(0,x.jsx)(B_,{})}},Z_=(0,st.Pi)((0,it.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,n=s.data.li_attr.pureType,a=a_(),r=Mt();return(0,x.jsxs)("div",{ref:t,className:"explorer__context-menu",children:[n===nh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename package"),children:"Rename"}),n===nh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename property"),children:"Rename"}),n!==nh.PACKAGE&&n!==nh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename"),children:"Rename"}),n===nh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{(0,O.fl)(a.executeTests(s.data.li_attr.pureId)).catch(r.alertUnhandledError)},children:"Run tests"}),n!==nh.PACKAGE&&n!==nh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Move file"),children:"Move"}),n===nh.FUNCTION&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{window.open(`${a.client.baseUrl}/execute?func=${s.data.li_attr.pureId}&mode=${a.client.mode}`,"_blank")},children:"Service (JSON)"}),n!==nh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i(s),children:"View Source"})]})})));var X_;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(X_=X_||(X_={}));const q_=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,it.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d,viewConceptSource:h}=a,u=[nh.PACKAGE,nh.CLASS,nh.ASSOCIATION].includes(t.data.li_attr.pureType),p=()=>{t.isLoading||(t.isOpen?d(t):c(t))},[,_]=(0,b_.c)((()=>({type:"Class"===t.data.li_attr.pureType?X_.CLASS:X_.UNSUPPORTED,item:t.data})),[t]);return(0,x.jsx)(Qc,{content:(0,x.jsx)(Z_,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Dc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},ref:_,onDoubleClick:()=>{t.isLoading||(u&&p(),n?.(t),l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,x.jsx)(Yc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:p,children:u?t.isOpen?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:K_(t.data.li_attr.pureType)})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:t.label})]})})},J_=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,x.jsx)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:(0,x.jsx)(E_,{components:{TreeNodeContainer:q_},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(G),innerProps:{onNodeOpen:e=>{(0,O.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,O.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()},viewConceptSource:t=>{const s=t.data.li_attr;(s instanceof hh||s instanceof dh)&&e.directoryTreeState.revealPath(s.file,!0,new Fd(s.file,Number.parseInt(s.line,10),Number.parseInt(s.column,10)))}}})})})),Q_=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.conceptTreeState;return(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsx)("div",{className:"panel__header side-bar__header",children:(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"CONCEPTS"})})}),(0,x.jsx)("div",{className:"panel__content side-bar__content",children:(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsxs)("div",{className:"panel__header explorer__header",children:[(0,x.jsx)("div",{className:"panel__header__title"}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,O.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,x.jsx)(Yc.DuK,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,x.jsx)(Yc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)($c,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(J_,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,x.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(od,{children:"Failed to build concept tree"})]})]})})]})})),em=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.directoryTreeState.nodeForCreateNewFile,[i,n]=(0,it.useState)(""),a=(0,it.useRef)(null),r=()=>e.directoryTreeState.setNodeForCreateNewFile(void 0),o=n=>{s&&(n.preventDefault(),r(),(0,O.fl)(e.createNewFile(`${s.data.li_attr.path}/${i}`)).catch(t.alertUnhandledError))};return(0,x.jsx)(bc.Z,{open:Boolean(s),onClose:r,TransitionProps:{onEnter:()=>{n(""),a.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Create a new file"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:o,children:(0,x.jsx)("input",{ref:a,className:"command-modal__content__input input--dark",onChange:e=>n(e.target.value),value:i})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:o,children:"Create"})]})]})})})),tm=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.directoryTreeState.nodeForCreateNewDirectory,[i,n]=(0,it.useState)(""),a=(0,it.useRef)(null),r=()=>e.directoryTreeState.setNodeForCreateNewDirectory(void 0),o=n=>{s&&(n.preventDefault(),r(),(0,O.fl)(e.createNewDirectory(`${s.data.li_attr.path}/${i}`)).catch(t.alertUnhandledError))};return(0,x.jsx)(bc.Z,{open:Boolean(s),onClose:r,TransitionProps:{onEnter:()=>{n(""),a.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Create a new directory"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:o,children:(0,x.jsx)("input",{ref:a,className:"command-modal__content__input input--dark",onChange:e=>n(e.target.value),value:i})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:o,children:"Create"})]})]})})})),sm=(0,st.Pi)((0,it.forwardRef)((function(e,t){const{node:s}=e,i=Mt(),n=a_(),a=s.data.isFolderNode,r=Boolean(s.data.children);return(0,x.jsxs)("div",{ref:t,className:"explorer__context-menu",children:[a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>n.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>n.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Folder"}),!a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i.notifyUnsupportedFeature("Rename file"),children:"Rename"}),(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{(0,O.fl)(n.deleteDirectoryOrFile(s.data.li_attr.path,a,r)).catch(i.alertUnhandledError)},children:"Delete"}),!a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i.notifyUnsupportedFeature("Move file"),children:"Move"})]})}))),im=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,it.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d}=a,h=t.data.isFolderNode,u=h?t.isOpen?(0,x.jsx)("div",{children:(0,x.jsx)(Yc.ry,{})}):(0,x.jsx)("div",{children:(0,x.jsx)(Yc.ROc,{})}):(0,x.jsx)(Yc.QqN,{className:"explorer__icon--file"}),p=()=>{t.isLoading||(t.isOpen?d(t):c(t))};return(0,x.jsx)(Qc,{content:(0,x.jsx)(sm,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Dc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},onDoubleClick:()=>{t.isLoading||(h?p():l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,x.jsx)(Yc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:p,children:h?t.isOpen?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:u})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:t.label})]})})},nm=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,x.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,x.jsx)(E_,{components:{TreeNodeContainer:im},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(G),innerProps:{onNodeOpen:e=>{(0,O.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,O.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()}}}),(0,x.jsx)(em,{}),(0,x.jsx)(tm,{})]})})),am=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.directoryTreeState;return(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsx)("div",{className:"panel__header side-bar__header",children:(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"FILES"})})}),(0,x.jsx)("div",{className:"panel__content side-bar__content",children:(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsxs)("div",{className:"panel__header explorer__header",children:[(0,x.jsx)("div",{className:"panel__header__title"}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,O.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,x.jsx)(Yc.DuK,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof Kd&&(0,O.fl)(s.revealPath(i.filePath,!1)).catch(t.alertUnhandledError)},title:"Focus",children:(0,x.jsx)(Yc.cOE,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,x.jsx)(Yc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)($c,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(nm,{}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(od,{children:"Failed to build directory tree"})]})]})})]})})),rm=(0,st.Pi)((()=>{const e=a_();return(0,x.jsx)("div",{className:"side-bar",children:(0,x.jsx)("div",{className:(0,Dc.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case Ld.CONCEPT:return(0,x.jsx)(Q_,{});case Ld.FILE:return(0,x.jsx)(am,{});default:return null}})()},e.activeActivity)})})),om=e=>{const{className:t}=e;return(0,x.jsx)("div",{className:(0,Dc.clsx)("logo",t),children:(0,x.jsxs)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",width:"1em",height:"1em",viewBox:"0 0 215 215",xmlns:"https://www.w3.org/2000/svg",children:[(0,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.jsx)("path",{d:"M141.9,86.5L141.9,68.1C141.9,66.5 140.7,65.2 139.1,65.2L66.5,65.2C64.9,65.2 63.7,66.5 63.7,68.1L63.7,86.5C63.7,88.1 64.9,89.4 66.5,89.4L139.1,89.4C140.7,89.4 141.9,88.1 141.9,86.5Z"})}),(0,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.jsx)("path",{d:"M118.4,116.9L118.4,98.5C118.4,96.9 117.5,95.6 116.4,95.6L65.7,95.6C64.6,95.6 63.7,96.9 63.7,98.5L63.7,116.9C63.7,118.5 64.6,119.8 65.7,119.8L116.5,119.8C117.6,119.8 118.4,118.6 118.4,116.9Z"})}),(0,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.jsx)("path",{d:"M141.9,147.3L141.9,129C141.9,127.4 140.7,126.1 139.1,126.1L66.5,126.1C64.9,126.1 63.7,127.4 63.7,129L63.7,147.4C63.7,149 64.9,150.3 66.5,150.3L139.1,150.3C140.7,150.3 141.9,149 141.9,147.3Z"})}),(0,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.jsx)("path",{d:"M205,170.7L152.7,139.1C150,137.4 147.7,138.7 147.7,141.9L147.7,157.9L55.8,157.9L55.8,59.4L67.2,59.4C70.4,59.4 71.7,57.2 70,54.4L38.4,2.1C36.7,-0.6 34.1,-0.6 32.4,2.1L0.7,54.4C-1,57.1 0.3,59.4 3.5,59.4L15.6,59.4L15.6,185.5C15.6,188.5 18,190.9 21,190.9L147.7,190.9L147.7,205.7C147.7,208.9 149.9,210.1 152.7,208.5L205,176.9C207.7,175.1 207.7,172.4 205,170.7Z"})})]})})},lm=(0,st.Pi)((()=>{const e=a_(),t=t=>()=>e.setActiveActivity(t),s=[{mode:Ld.CONCEPT,title:"Concept Explorer",icon:(0,x.jsx)(Yc.DE2,{})},{mode:Ld.FILE,title:"File Explorer",icon:(0,x.jsx)(Yc.QqN,{})}].filter((e=>Boolean(e)));return(0,x.jsxs)("div",{className:"activity-bar",children:[(0,x.jsx)("div",{className:"activity-bar__logo",children:(0,x.jsx)(om,{})}),(0,x.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,x.jsx)("button",{className:(0,Dc.clsx)("activity-bar__item",{"activity-bar__item--active":e.sideBarDisplayState.isOpen&&e.activeActivity===s.mode}),onClick:t(s.mode),tabIndex:-1,title:`${s.title}${s.info?` - ${s.info}`:""}`,children:s.icon},s.mode)))})]})})),cm=(0,st.Pi)((e=>{const t=a_(),s=Mt();return(0,x.jsxs)("div",{className:"editor__status-bar",children:[(0,x.jsx)("div",{className:"editor__status-bar__left",children:(0,x.jsx)("div",{className:"editor__status-bar__workspace"})}),(0,x.jsxs)("div",{className:"editor__status-bar__right",children:[(0,x.jsx)("button",{className:(0,Dc.clsx)("editor__status-bar__action editor__status-bar__compile-btn",{"editor__status-bar__compile-btn--wiggling":t.executionState.isInProgress}),disabled:t.executionState.isInProgress,onClick:()=>{(0,O.fl)(t.executeGo()).catch(s.alertUnhandledError)},tabIndex:-1,title:"Execute (F9)",children:(0,x.jsx)(Yc.pgN,{})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":Boolean(t.auxPanelDisplayState.isOpen)}),onClick:()=>t.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Toggle auxiliary panel (Ctrl + `)",children:(0,x.jsx)(Yc.FxN,{})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":!s.assistantService.isHidden}),onClick:()=>s.assistantService.toggleAssistant(),tabIndex:-1,title:"Toggle assistant",children:(0,x.jsx)(Yc.UHp,{})})]})]})})),dm=e=>{(0,it.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},hm="Diagram",um="Diagram",pm=(0,st.Pi)((e=>{const{editorState:t}=e,s=(0,it.useRef)(void 0),i=(0,it.useRef)(void 0),n=(0,it.useRef)(null),[a,r]=(0,it.useState)(),o=a_(),l=Mt(),c=t.file.content,{ref:d,width:h,height:u}=(0,rd.NB)();(0,it.useEffect)((()=>{if(!a&&n.current){const e=n.current,s=A.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,bracketPairColorization:{enabled:!1},detectIndentation:!1,tabSize:2,language:C.PURE,theme:T.LEGEND,wordWrap:t.textEditorState.wrapText?"on":"off"});s._codeEditorService.openCodeEditor=async()=>{const e=s.getPosition();e&&(0,O.fl)(o.executeNavigation(new Fd(t.filePath,e.lineNumber,e.column))).catch(l.alertUnhandledError)},s.updateOptions({gotoLocation:{multiple:"goto",multipleDefinitions:"goto",alternativeDefinitionCommand:"DUMMY"}}),s.onDidChangeModelContent((()=>{const e=s.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),s.setModel(t.textEditorState.model),t.textEditorState.viewState&&s.restoreViewState(t.textEditorState.viewState),s.focus(),t.textEditorState.setEditor(s),r(s)}}),[o,l,t,a]),a&&(a.getValue()!==c&&a.setValue(c),t.textEditorState.forcedCursorPosition&&(((e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)})(a,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0)));const p=a?A.editor.tokenize(a.getValue(),C.PURE):[];return i.current?.dispose(),i.current=A.languages.registerDefinitionProvider(C.PURE,{provideDefinition:(e,s)=>{const i=B(p[s.lineNumber-1]);let n,a;for(let e=1;e<i.length;++e){const t=B(i[e]);if(t.offset+1>s.column){n=B(i[e-1]),a={startLineNumber:s.lineNumber,startColumn:n.offset+1,endLineNumber:s.lineNumber,endColumn:t.offset+1};break}}return n&&a&&[Ue.TYPE,Ue.VARIABLE,Ue.PROPERTY,Ue.IDENTIFIER].includes((r=n.type,B(R(r.split(".")))))?[{uri:t.textEditorState.model.uri,range:a}]:[];var r}}),s.current?.dispose(),s.current=A.languages.registerCompletionItemProvider(C.PURE,{triggerCharacters:["#"],provideCompletionItems:(e,t)=>{let s=[];return s=s.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a={startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber,endColumn:n.endColumn};var r;return r=t.getValueInRange(a).trim(),Boolean(r.match(/\s/))||s.forEach((e=>{i.push({label:{label:`###${e.text}`,description:e.description},kind:A.languages.CompletionItemKind.Keyword,insertText:`###${e.insertText}\n`,range:a,documentation:e.documentation?e.documentation.markdownText?{value:e.documentation.markdownText.value}:e.documentation.text:void 0})})),i})(t,e,[{text:Fe.PURE,description:"(core Pure)",insertText:Fe.PURE},{text:Fe.MAPPING,description:"(dsl)",insertText:Fe.MAPPING},{text:Fe.CONNECTION,description:"(dsl)",insertText:Fe.CONNECTION},{text:Fe.RUNTIME,description:"(dsl)",insertText:Fe.RUNTIME},{text:Fe.RELATIONAL,description:"(external store)",insertText:Fe.RELATIONAL},{text:hm,description:"(dsl)",insertText:um}])),s=s.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),r=`###${Fe.PURE}\n${a}`.split("\n").filter((e=>e.startsWith(ge))),o=(e=>{if(e.startsWith(ge))return e.substring(ge.length).split(" ")[0]})(r[r.length-1]??"");return o&&s(o).forEach((t=>{i.push({label:{label:t.text,description:t.description},kind:A.languages.CompletionItemKind.Snippet,insertTextRules:A.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${t.insertText}\n`,range:{startLineNumber:e.lineNumber,startColumn:n.startColumn,endLineNumber:e.lineNumber,endColumn:n.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})})),i})(t,e,(e=>(e=>{switch(e){case Fe.PURE:return[{text:Me.CLASS,description:"(blank)",insertText:"Class ${1:model::NewClass}\n// example of a constraint\n// [\n// SomeConstraint: true\n// ]\n{\n ${2:// example of a standard property\n // prop1: String[1];\n\n // example of a derived property\n // derivation1() {''\\}: String[1];}\n}"},{text:Me.CLASS,description:"with property",insertText:"Class ${1:model::NewClass}\n{\n ${2:prop1}: ${3:String[1]};\n}"},{text:Me.CLASS,description:"with inheritance",insertText:"Class ${1:model::NewClass} extends ${2:model::ParentClass}\n{\n ${3:// class content}\n}"},{text:Me.CLASS,description:"with constraint",insertText:"Class ${1:model::NewClass}\n[\n ${3:SomeConstraint: true}\n]\n{\n ${2:// class content}\n}"},{text:Me.PROFILE,insertText:"Profile ${1:model::NewProfile}\n{\n stereotypes: [${2:}];\n tags: [${3:}];\n}"},{text:Me.ENUMERATION,insertText:"Enum ${1:model::NewEnumeration}\n{\n ${2:VALUE_1,\n VALUE_2}\n}"},{text:Me.ASSOCIATION,insertText:"Association ${1:model::NewAssociation}\n{\n ${2:prop1}: ${3:model::Type1[1]};\n ${4:prop2}: ${5:model::Type2[1]};\n}"},{text:Me.FUNCTION,description:"(blank)",insertText:"function ${1:model::NewEnumeration}(${2:param1: String[1]}): ${3:String[1]}\n{\n ${4:''; // function content}\n}"},{text:Me.FUNCTION,insertText:"function ${1:model::NewEnumeration}(): String[1]\n{\n ''\n}"}];case Fe.MAPPING:return[{text:Me.MAPPING,description:"(blank)",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:// mapping content}\n)"},{text:Me.MAPPING,description:"with model-to-model mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Pure\n {\n ~src ${3:model::SourceClass}\n // example of property mappings\n // prop1: $src.prop1\n }\n)"},{text:Me.MAPPING,description:"with relational mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Relational {\n ~mainTable ${3:[model::SomeDatabase]SomeTable}\n // example of property mappings\n // prop1: [model::SomeDatabase]SomeTable.col1,\n }\n)"},{text:Me.MAPPING,description:"with enumeration mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetEnumeration}: EnumerationMapping ${3:EnumerationMappingID}\n {\n // example of enum-value mapping\n // VAL_1: ['val1'],\n // VAL_2: ['val2', 'val_2']\n }\n)"}];case Fe.RELATIONAL:return[{text:Me.DATABASE,description:"(blank)",insertText:"Database ${1:model::NewDatabase}\n(\n // example database schema\n // Schema SOME_SCHEMA\n // (\n // Table TABLE_1\n // (\n // COL_1 VARCHAR(200)\n // )\n // Table TABLE_2\n // (\n // COL_2 VARCHAR(200) PRIMARY_KEY\n // )\n // )\n\n // example database join\n // Join SomeJoin(SOME_SCHEMA.TABLE_1.COL_1 = SCHEMA1.TABLE_2.COL_2)\n\n ${2:// database content}\n)"}];case hm:return[{text:um,description:"(blank)",insertText:"Diagram ${1:model::NewDiagram}(width=0.0, height=0.0)\n(\n // NOTE: it is recommended to use diagram visual editor\n // to edit diagram: double-click on the diagram in\n // the concept explorer tree to open the editor\n)"}];default:return[]}})(e)))),s=s.concat(((e,t,s=[])=>{const i=t.getWordUntilPosition(e);return[{text:"let",description:"new variable",insertText:"let ${1:} = ${2:};"},{text:"let",description:"new collection",insertText:"let ${1:} = [${2:}];"},{text:"cast",description:"type casting",insertText:"cast(@${1:model::SomeClass})"},{text:"if",description:"(conditional)",insertText:"if(${1:'true'}, | ${2:/* if true do this */}, | ${3:/* if false do this */})"},{text:"case",description:"(conditional)",insertText:"case(${1:}, ${2:'true'}, ${3:'false'})"},{text:"match",description:"(conditional)",insertText:"match([x:${1:String[1]}, ${2:''}])"},{text:"map",description:"(collection)",insertText:"map(x|${1:})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"fold",description:"(collection)",insertText:"fold({a, b| ${1:$a + $b}}, ${2:0})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"sort",description:"(collection)",insertText:"sort()"},{text:"in",description:"(collection)",insertText:"in()"},{text:"slice",description:"(collection)",insertText:"slice(${1:1},${2:2})"},{text:"removeDuplicates",description:"(collection)",insertText:"removeDuplicates()"},{text:"toOne",description:"(collection)",insertText:"toOne(${1:})"},{text:"toOneMany",description:"(collection)",insertText:"toOneMany(${1:})"},{text:"isEmpty",description:"(collection)",insertText:"isEmpty()"},{text:"endsWith",description:"(string)",insertText:"endsWith()"},{text:"startsWith",description:"(string)",insertText:"startsWith()"},...s].map((t=>({label:{label:t.text,description:t.description},kind:A.languages.CompletionItemKind.Snippet,insertTextRules:A.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:t.insertText,range:{startLineNumber:e.lineNumber,startColumn:i.startColumn,endLineNumber:e.lineNumber,endColumn:i.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})))})(t,e,[{text:"print",description:"(io)",insertText:"print(${1:})"},{text:"println",description:"(io)",insertText:"println(${1:})"}])),{suggestions:s}}}),dm(t),(0,it.useEffect)((()=>{void 0!==h&&void 0!==u&&a?.layout({width:h,height:u})}),[a,h,u]),(0,it.useEffect)((()=>()=>{a&&(t.textEditorState.setViewState(a.saveViewState()??void 0),a.dispose()),i.current?.dispose(),s.current?.dispose()}),[t,a]),(0,x.jsxs)("div",{className:"panel edit-panel file-editor",children:[(0,x.jsx)("div",{className:"panel__header file-editor__header",children:(0,x.jsx)("div",{className:"file-editor__header__actions",children:(0,x.jsx)("button",{className:(0,Dc.clsx)("file-editor__header__action",{"file-editor__header__action--active":t.textEditorState.wrapText}),tabIndex:-1,onClick:()=>t.textEditorState.setWrapText(!t.textEditorState.wrapText),title:"Toggle Text Wrap",children:(0,x.jsx)(Yc.NK0,{className:"file-editor__icon--text-wrap"})})})}),(0,x.jsx)("div",{className:"panel__content file-editor__content",children:(0,x.jsx)("div",{ref:d,className:"text-editor__container",children:(0,x.jsx)("div",{className:"text-editor__body",ref:n})})})]})}));var _m=s(8533);const mm=e=>{const{open:t,className:s,children:i,menuProps:n,content:a,title:r,disabled:o,onClose:l,onOpen:c}=e,d=(0,it.useRef)(null),[h,u]=(0,it.useState)(null);return(0,it.useEffect)((()=>{void 0!==t&&(t&&!h&&d.current?u(d.current):!t&&h&&u(null))}),[h,t]),(0,x.jsxs)("button",{ref:d,className:s,disabled:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),o||(h?(l?.(),u(null)):d.current&&(c?.(),u(d.current)))},tabIndex:-1,title:r,children:[i,(0,x.jsx)(Jc,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:h,open:(void 0===t||Boolean(t))&&Boolean(h),BackdropProps:{invisible:!0},elevation:0,marginThreshold:0,disableRestoreFocus:!0,...n,children:a})]})},gm=(0,st.Pi)((0,it.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=Mt(),n=s.diagram,a=t,{width:r,height:o}=(0,rd.NB)({refreshMode:"debounce",refreshRate:50,targetRef:a});(0,it.useEffect)((()=>{if(a.current){const e=new Yu(a.current,n);s.setRenderer(e),s.setupRenderer(),e.render(),e.autoRecenter()}}),[a,s,n]),(0,it.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,it.useCallback)(((e,t)=>{if(e instanceof uh){const n=t.getClientOffset(),a=n?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new Ql(n.x,n.y))):void 0;(0,O.fl)(s.addClassView(e.li_attr.pureId,a)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,_m.L)((()=>({accept:X_.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(a),(0,x.jsx)("div",{ref:a,className:(0,Dc.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),Em=(0,st.Pi)((e=>{const{diagramEditorState:t}=e,s=a_(),i=Mt(),n=e=>()=>{t.renderer.zoomCenter(e/100)},a=t.renderer.selectedClasses.length<2;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align left",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_LEFT),children:(0,x.jsx)(Yc.eRw,{className:"diagram-editor__icon--aligner"})}),(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align center",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_CENTER),children:(0,x.jsx)(Yc.UPo,{className:"diagram-editor__icon--aligner"})}),(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align right",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_RIGHT),children:(0,x.jsx)(Yc.B_D,{className:"diagram-editor__icon--aligner"})})]}),(0,x.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,x.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align top",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_TOP),children:(0,x.jsx)(Yc.Cti,{className:"diagram-editor__icon--aligner"})}),(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align middle",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_MIDDLE),children:(0,x.jsx)(Yc.w0Y,{className:"diagram-editor__icon--aligner"})}),(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align bottom",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_BOTTOM),children:(0,x.jsx)(Yc.HLb,{className:"diagram-editor__icon--aligner"})})]}),(0,x.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,x.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space horizontally",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.SPACE_HORIZONTALLY),children:(0,x.jsx)(Yc.ppk,{className:"diagram-editor__icon--aligner"})}),(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space vertically",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.SPACE_VERTICALLY),children:(0,x.jsx)(Yc.LyQ,{className:"diagram-editor__icon--aligner"})})]}),(0,x.jsxs)(mm,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,x.jsxs)(ed,{children:[(0,x.jsx)(td,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,x.jsx)(sd,{}),$u.map((e=>(0,x.jsxs)(td,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:n(e),children:[e,"%"]},e)))]}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:7},children:[(0,x.jsxs)("div",{className:"diagram-editor__header__dropdown__label diagram-editor__header__zoomer__dropdown__label",children:[Math.round(100*t.renderer.zoom),"%"]}),(0,x.jsx)("div",{className:"diagram-editor__header__dropdown__trigger diagram-editor__header__zoomer__dropdown__trigger",children:(0,x.jsx)(Yc.VAA,{})})]}),(0,x.jsx)("div",{className:"diagram-editor__header__actions",children:(0,x.jsx)("button",{className:"diagram-editor__header__action",tabIndex:-1,onClick:()=>{(0,O.fl)(s.loadFile(t.filePath,new Fd(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,x.jsx)(Yc.qdB,{className:"diagram-editor__icon--go-to-file"})})})]})})),fm=(0,st.Pi)((e=>{const{diagramEditorState:t}=e,s=t.renderer,i=(e,t)=>()=>s.changeMode(e,t);return(0,x.jsxs)("div",{className:"diagram-editor__tools",children:[(0,x.jsx)("button",{className:(0,Dc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Vu.LAYOUT}),tabIndex:-1,onClick:i(Vu.LAYOUT,Gu.NONE),title:"View Tool (V)",children:(0,x.jsx)(Yc.Hrt,{className:"diagram-editor__icon--layout"})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Vu.PAN}),tabIndex:-1,onClick:i(Vu.PAN,Gu.NONE),title:"Pan Tool (M)",children:(0,x.jsx)(Yc.tPC,{className:"diagram-editor__icon--pan"})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Vu.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(Vu.ZOOM_IN,Gu.NONE),children:(0,x.jsx)(Yc.Sd5,{className:"diagram-editor__icon--zoom-in"})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Vu.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(Vu.ZOOM_OUT,Gu.NONE),children:(0,x.jsx)(Yc.xLV,{className:"diagram-editor__icon--zoom-out"})})]})})),Tm=(0,st.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,it.useRef)(null);return dm(t),(0,x.jsxs)("div",{className:"diagram-editor",children:[(0,x.jsx)("div",{className:"diagram-editor__header",children:t.isDiagramRendererInitialized&&(0,x.jsx)(Em,{diagramEditorState:t})}),(0,x.jsx)("div",{className:"diagram-editor__content",children:(0,x.jsxs)("div",{className:"diagram-editor__stage",children:[t.isDiagramRendererInitialized&&(0,x.jsx)(fm,{diagramEditorState:t}),(0,x.jsx)(gm,{diagramEditorState:t,ref:s})]})})]})}));var Cm=s(98533),xm=s(84153);const Nm=e=>{const{children:t,label:s,showPlaceholder:i,className:n}=e;return i?(0,x.jsx)("div",{className:(0,Dc.clsx)(["dnd__entry-dropzone__placeholder",n]),children:(0,x.jsx)("div",{className:"dnd__entry-dropzone__placeholder__content",children:(0,x.jsx)("div",{className:"dnd__entry-dropzone__placeholder__label",children:s??""})})}):(0,x.jsx)(x.Fragment,{children:t})};function Om(e){const{labelGetter:t,types:s}=e,{itemType:i,item:n,isDragging:a,currentPosition:r}=(0,Cm.f)((e=>({itemType:e.getItemType(),item:e.getItem(),isDragging:e.isDragging(),initialOffset:e.getInitialSourceClientOffset(),currentPosition:e.getClientOffset()})));return a&&n&&i&&s.includes(i.toString())?(0,x.jsx)(Rc.Z,{children:(0,x.jsx)("div",{className:"dnd__drag-preview-layer",children:(0,x.jsx)("div",{className:"dnd__drag-preview-layer__content",style:r?{transform:`translate(${r.x/10+2}rem, ${r.y/10+1}rem)`}:{display:"none"},children:t(n)})})}):null}const Am=e=>{if(Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;let t;e.stopPropagation(),t=0===e.deltaY?e.deltaY:e.deltaY<0?-Math.abs(e.deltaY):Math.abs(e.deltaY),e.currentTarget.scrollBy(t,0)},Sm=(0,st.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,x.jsxs)(ed,{children:[(0,x.jsx)(td,{onClick:()=>s.closeTab(t),children:"Close"}),(0,x.jsx)(td,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,x.jsx)(td,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),ym=(0,st.Pi)((e=>{const t=(0,it.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:n}=e,a=(0,it.useCallback)(((e,n)=>{const a=e.tab,r=i,o=s.tabs.findIndex((e=>e===a)),l=s.tabs.findIndex((e=>e===r)),c=t.current?.getBoundingClientRect(),d=((c?.left??0)-(c?.right??0))/2,h=(n.getClientOffset()?.x??0)-(c?.right??0);o<l&&h<d||o>l&&h>d||s.swapTabs(a,r)}),[s,i]),[{isBeingDraggedEditorPanel:r},o]=(0,_m.L)((()=>({accept:[s.dndType],hover:(e,t)=>a(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[a]),l=i===r,[,c,d]=(0,b_.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,it.useEffect)((()=>{e((0,xm.r)())}),[e])})(d),(0,x.jsx)("div",{ref:t,className:(0,Dc.clsx)("tab-manager__tab",{"tab-manager__tab--active":i===s.currentTab,"tab-manager__tab--dragged":l}),onMouseUp:(h=i,e=>{1===e.nativeEvent.button&&s.closeTab(h)}),children:(0,x.jsx)(Nm,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,x.jsxs)(Qc,{content:(0,x.jsx)(Sm,{tabState:i,managerTabState:s}),className:"tab-manager__tab__content",children:[(0,x.jsx)("button",{className:"tab-manager__tab__label",tabIndex:-1,onClick:()=>s.openTab(i),title:i.description,children:n?.(i)??i.label}),(0,x.jsx)("button",{className:"tab-manager__tab__close-btn",onClick:()=>s.closeTab(i),tabIndex:-1,title:"Close",children:(0,x.jsx)(Yc.q1B,{})})]})})});var h})),Im=(0,st.Pi)((e=>{const{managerTabState:t}=e;return(0,x.jsx)(mm,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,x.jsx)(ed,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,x.jsxs)(td,{className:"tab-manager__menu__item",onClick:()=>t.openTab(e),children:[(0,x.jsx)("div",{className:"tab-manager__menu__item__label",children:e.label}),(0,x.jsx)("div",{className:"tab-manager__menu__item__close-btn",onClick:s=>{s.stopPropagation(),t.closeTab(e)},tabIndex:-1,title:"Close",children:(0,x.jsx)(Yc.q1B,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,x.jsx)(Yc.v4q,{})})})),vm=(0,st.Pi)((e=>{const{tabManagerState:t,tabRenderer:s}=e;return(0,x.jsxs)("div",{className:"tab-manager",children:[(0,x.jsxs)("div",{className:"tab-manager__content",onWheel:Am,children:[t.tabs.map((e=>(0,x.jsx)(ym,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,x.jsx)(Om,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,x.jsx)(Im,{managerTabState:t})]})})),Rm=()=>{const[e,t]=(0,it.useState)(!1),{ref:s,width:i,height:n}=(0,rd.NB)();return(0,it.useEffect)((()=>{t((i??0)>300&&(n??0)>150)}),[i,n]),(0,x.jsx)("div",{ref:s,className:"edit-panel__splash-screen",children:(0,x.jsxs)("div",{className:(0,Dc.clsx)("edit-panel__splash-screen__content",{"edit-panel__splash-screen__content--hidden":!e}),children:[(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Execute the 'go' function"}),(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F9"})})]}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Run the full test suite"}),(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Search for a file"}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Yc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},Pm=(0,st.Pi)((()=>{const e=a_(),t=e.tabManagerState.currentTab;return t?(0,x.jsxs)("div",{className:"panel edit-panel",children:[(0,x.jsxs)("div",{className:"panel__header edit-panel__header",children:[(0,x.jsx)("div",{className:"edit-panel__header__tabs",children:(0,x.jsx)(vm,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof Kd){const s=e.tabManagerState.tabs.filter((e=>e instanceof Kd&&e.fileName===t.fileName)).length>1;return(0,x.jsxs)("div",{className:"edit-panel__header__tab",children:[(0,x.jsx)("div",{className:"edit-panel__header__tab__icon",children:(0,x.jsx)(Yc.QqN,{className:"edit-panel__header__tab__icon--file"})}),(0,x.jsx)("div",{className:"edit-panel__header__tab__label",children:t.fileName}),s&&(0,x.jsx)("div",{className:"edit-panel__header__tab__path",children:t.filePath})]})}if(t instanceof Qp){const s=e.tabManagerState.tabs.filter((e=>e instanceof Qp&&e.diagramName===t.diagramName)).length>1;return(0,x.jsxs)("div",{className:"edit-panel__header__tab",children:[(0,x.jsx)("div",{className:"edit-panel__header__tab__icon",children:(0,x.jsx)(Y_,{})}),(0,x.jsx)("div",{className:"edit-panel__header__tab__label",children:t.diagramName}),s&&(0,x.jsx)("div",{className:"edit-panel__header__tab__path",children:t.diagramPath})]})}return t.label}})}),(0,x.jsx)("div",{className:"panel__header__actions"})]}),(0,x.jsx)("div",{className:"panel__content edit-panel__content",children:t instanceof Kd?(0,x.jsx)(pm,{editorState:t}):t instanceof Qp?(0,x.jsx)(Tm,{diagramEditorState:t}):null},t.uuid)]}):(0,x.jsx)(Rm,{})}));var wm=s(50166),Lm=s(35247);const bm=e=>{const t=3.5*parseInt(getComputedStyle(document.documentElement).fontSize,10),{options:s,children:i,getValue:n,selectProps:a}=e,[r]=n(),o=s.indexOf(r)*t,l=i.length?i.findIndex((e=>e.props.isFocused)):0,c=(0,it.useRef)(null);return(0,it.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,x.jsx)(wm.t7,{className:a.darkMode?"scrollbar--light selector-menu--dark":"",ref:c,width:"100%",height:Math.min(i.length,6)*t,itemCount:i.length,itemSize:t,initialScrollOffset:o,children:({index:e,style:t})=>(0,x.jsx)("div",{style:t,children:i[e]})}):(0,x.jsx)("div",{className:"selector-menu--no-match "+(a.darkMode?"selector-menu--dark":""),children:a.noMatchMessage??"No match found"})},Dm=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__loading-indicator selector-input--dark__loading-indicator",children:(0,x.jsx)(Yc.VRP,{})}),Mm=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__dropdown-indicator",children:(0,x.jsx)(Yc.VAA,{})}),km=e=>{const{innerProps:{ref:t,...s}}=e;return(0,x.jsx)("div",{...s,ref:t,children:(0,x.jsx)("div",{className:"selector-input__indicator selector-input__clear-indicator",children:(0,x.jsx)(Yc.q1B,{})})})},Fm=e=>(0,x.jsx)(Lm.baseComponents.Input,{...e,isHidden:!1}),jm=(0,it.forwardRef)((function(e,t){const{option:s,allowCreating:i,noMatchMessage:n,disabled:a,components:r,className:o,darkMode:l,hasError:c,...d}=e,h=i?Lm.CreatableSelect:Lm.Select,u=l?"selector-input--dark":"selector-input";return(0,x.jsx)(h,{styles:{menuPortal:e=>({...e,zIndex:9999})},menuPortalTarget:document.body,ref:t,isDisabled:Boolean(a),className:`${u} ${o} ${c?"selector-input--has-error":""}`,classNamePrefix:u,components:{ClearIndicator:km,DropdownIndicator:Mm,LoadingIndicator:Dm,MenuList:bm,Input:Fm,...r},...{...d,darkMode:l,noMatchMessage:n}})})),Um=(e,t)=>e.label.localeCompare(t.label),Vm=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.fileSearchCommandLoadingState,i=e.fileSearchCommandState,n=(0,it.useRef)(null),a=(0,it.useMemo)((()=>(0,dd.Z)((()=>{(0,O.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,x.jsx)(bc.Z,{open:e.openFileSearchCommand,onClose:r,TransitionProps:{onEnter:()=>{n.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Open file"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)(jm,{ref:n,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(Um),onChange:s=>{s?.value&&(r(),i.reset(),(0,O.fl)(e.loadFile(s.value)).catch(t.alertUnhandledError))},onInputChange:e=>{i.setText(e),a.cancel(),a()},placeholder:"Enter file name or path",escapeClearsValue:!0,darkMode:!0,isLoading:s.isInProgress}),(0,x.jsx)("button",{className:(0,Dc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":i.isRegExp}),title:`Use Regular Expression (${i.isRegExp?"on":"off"})`,onClick:()=>i.toggleRegExp(),children:(0,x.jsx)(Yc.x47,{})})]})]})})})),Gm=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.textSearchCommandState,i=(0,it.useRef)(null),n=()=>e.setOpenTextSearchCommand(!1),a=s=>{s.preventDefault(),n(),(0,O.fl)(e.searchText()).catch(t.alertUnhandledError)};return(0,x.jsx)(bc.Z,{open:e.openTextSearchCommand,onClose:n,TransitionProps:{onEnter:()=>{i.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Search"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:a,children:(0,x.jsx)("input",{ref:i,className:"command-modal__content__input input--dark",onChange:e=>s.setText(e.target.value),value:s.text})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isCaseSensitive}),title:`Match Case (${s.isCaseSensitive?"on":"off"})`,onClick:()=>s.toggleCaseSensitive(),children:(0,x.jsx)(Yc.a2g,{})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isRegExp}),title:`Use Regular Expression (${s.isRegExp?"on":"off"})`,onClick:()=>s.toggleRegExp(),children:(0,x.jsx)(Yc.x47,{})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark btn--caution",onClick:a,children:"Search"})]})]})})})),zm=(Bm=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.initState.hasSucceeded,{ref:i,width:n,height:a}=(0,rd.NB)(),r=x_(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),o=x_(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),l=x_(e.auxPanelDisplayState.isMaximized);return(0,it.useEffect)((()=>{i.current&&e.auxPanelDisplayState.setMaxSize(i.current.offsetHeight)}),[e,i,a,n]),(0,it.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,it.useEffect)((()=>{const s=((e,t=!1)=>t?(0,ee.parseUrl)(e).query:(0,ee.parse)(e))(window.location.search);(0,O.fl)(e.initialize(!1,void 0,s.mode,s.fastCompile)).catch(t.alertUnhandledError)}),[e,t]),(0,it.useEffect)((()=>(t.navigator.blockNavigation([()=>!0],void 0,(()=>t.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigator.unblockNavigation()})),[e,t]),dm(e),(0,x.jsxs)("div",{className:"editor",children:[(0,x.jsxs)("div",{className:"editor__body",children:[(0,x.jsx)(lm,{}),(0,x.jsx)("div",{className:"editor__content-container",ref:i,children:(0,x.jsx)("div",{className:"editor__content",children:(0,x.jsxs)(T_,{orientation:"vertical",children:[(0,x.jsx)(N_,{...r.collapsiblePanel,direction:1,children:(0,x.jsx)(rm,{})}),(0,x.jsx)(O_,{}),(0,x.jsx)(N_,{...r.remainingPanel,minSize:300,children:(0,x.jsxs)(T_,{orientation:"horizontal",children:[(0,x.jsx)(N_,{...l.collapsiblePanel,...0===e.auxPanelDisplayState.size?o.remainingPanel:{},children:(0,x.jsx)(Pm,{})}),(0,x.jsx)(O_,{children:(0,x.jsx)(A_,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsx)(N_,{...o.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?l.remainingPanel:{},direction:-1,children:(0,x.jsx)(L_,{})})]})})]})})})]}),(0,x.jsx)(cm,{actionsDisabled:!s}),s&&(0,x.jsx)(Vm,{}),s&&(0,x.jsx)(Gm,{})]})})),function(){return(0,x.jsx)(n_,{children:(0,x.jsx)(Bm,{})})});var Bm;const $m=()=>(0,x.jsx)(wd,{children:(0,x.jsx)(vd,{children:(0,x.jsx)(zm,{})})}),Hm=JSON.parse('{"i8":"6.2.16","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class Ym extends o{}class Wm extends Ym{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class Km extends Wm{static NAME=Hm.Rw.p;constructor(){super(Km.NAME,Hm.i8)}getExtraKeyedCommandConfigEntries(){return[$d,Yd].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class Zm extends et{static create(){const e=new Zm(Ut.create());return e.withBasePlugins([new Km]),e.withBasePresets([new Oc]),e}async configureApplication(e){return new Ft(e)}async loadApplication(){await(async(e,t)=>{(e=>{var t,s;A.editor.defineTheme(T.LEGEND,Ve),A.editor.addKeybindingRules([{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyB,command:null},{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyO,command:null},{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyP,command:null},{keybinding:A.KeyCode.F1,command:null},{keybinding:A.KeyCode.F8,command:null},{keybinding:A.KeyCode.F9,command:null},{keybinding:A.KeyMod.Shift|A.KeyCode.F10,command:null}]),A.languages.register({id:C.PURE}),A.languages.setLanguageConfiguration(C.PURE,Ge),A.languages.setMonarchTokensProvider(C.PURE,(t=e.getPureGraphManagerPlugins().flatMap((e=>e.getExtraPureGrammarKeywords?.()??[])),s=e.getPureGraphManagerPlugins().flatMap((e=>e.getExtraPureGrammarParserNames?.()??[])),{defaultToken:"invalid",tokenPostfix:".pure",keywords:[...t,"Schema","Table","Join","View","primaryKey","groupBy","mainTable","let","extends","true","false","projects",Me.CLASS,Me.ASSOCIATION,Me.ENUMERATION,Me.MEASURE,Me.PROFILE,Me.FUNCTION,Me.MAPPING,Me.RUNTIME,Me.CONNECTION,Me.FILE_GENERATION,Me.GENERATION_SPECIFICATION,Me.DATA_ELEMENT,ke.JSON_MODEL_CONNECTION,ke.MODEL_CHAIN_CONNECTION,ke.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",Me.SERVICE,Me.FLAT_DATA,Me.DATABASE,ke.FLAT_DATA_CONNECTION,ke.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@","<<",">>"],languageStructs:["import","native"],parsers:[Fe.PURE,Fe.CONNECTION,Fe.RUNTIME,Fe.MAPPING,Fe.SERVICE,Fe.FLATDATA,Fe.RELATIONAL,Fe.GENERATION_SPECIFICATION,Fe.FILE_GENERATION_SPECIFICATION,Fe.DATA].concat(s).map((e=>`###${e}`)),identifier:/[a-zA-Z_$][\w$]*/,symbols:/[=><!~?:&|+\-*/^%#@]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,multiplicity:/\[(?:\d+(?:\.\.(?:\d+|\*|))?|\*)\]/,package:/(?:[\w_]+::)+/,generics:/<.+>/,date:/%-?\d+(?:-\d+(?:-\d+(?:T(?:\d+(?::\d+(?::\d+(?:.\d+)?)?)?)(?:[+-][0-9]{4})?)))/,time:/%\d+(?::\d+(?::\d+(?:.\d+)?)?)?/,tokenizer:{root:[{include:"@pure"},{include:"@date"},{include:"@color"},[/^\s*###[\w]+/,{cases:{"@parsers":Ue.PARSER,"@default":Ue.INVALID}}],[/(@identifier)/,{cases:{"@languageStructs":Ue.LANGUAGE_STRUCT,"@keywords":`${Ue.KEYWORD}.$0`,"@default":Ue.IDENTIFIER}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":Ue.OPERATOR,"@default":Ue.IDENTIFIER}}],{include:"@number"},[/[;,.]/,Ue.DELIMITER],[/'([^'\\]|\\.)*$/,`${Ue.STRING}.invalid`],[/'/,Ue.STRING,"@string"],{include:"@characters"}],pure:[[/(@package\*)/,[Ue.PACKAGE]],[/(@package?)(@identifier)(@generics?)(\s*)(@multiplicity)/,[Ue.PACKAGE,Ue.TYPE,Ue.GENERICS,Ue.WHITESPACE,Ue.MULTIPLICITY]],[/(@package)(@identifier)(@generics?)/,[Ue.PACKAGE,Ue.TYPE,Ue.GENERICS]],[/([@^])(?:\s*)(@package?)(@identifier)(@generics?)(@multiplicity?)/,[`${Ue.TYPE}.operator`,Ue.PACKAGE,Ue.TYPE,Ue.GENERICS,Ue.MULTIPLICITY]],[/(\.\s*)(@identifier)/,[Ue.DELIMITER,Ue.PROPERTY]],[/(@identifier)(\s*[:=])/,[Ue.PROPERTY,Ue.OPERATOR]],[/(@identifier)(\.)(@identifier)/,[Ue.TYPE,Ue.OPERATOR,Ue.PROPERTY]],[/(let)(\s+)(@identifier)(\s*[:=])/,[Ue.KEYWORD,Ue.WHITESPACE,Ue.VARIABLE,Ue.OPERATOR]],[/(\$@identifier)/,[Ue.VARIABLE]]],date:[[/(%latest)/,[`${Ue.DATE}.latest`]],[/(@date)/,[Ue.DATE]],[/(@time)/,[`${Ue.DATE}.time`]]],color:[[/(#[0-9a-fA-F]{6})/,[Ue.COLOR]]],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,`${Ue.NUMBER}.float`],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,`${Ue.NUMBER}.float`],[/0[xX](@hexdigits)[Ll]?/,`${Ue.NUMBER}.hex`],[/0(@octaldigits)[Ll]?/,`${Ue.NUMBER}.octal`],[/0[bB](@binarydigits)[Ll]?/,`${Ue.NUMBER}.binary`],[/(@digits)[fFdD]/,`${Ue.NUMBER}.float`],[/(@digits)[lL]?/,Ue.NUMBER]],whitespace:[[/[ \t\r\n]+/,Ue.WHITESPACE],[/\/\*\*(?!\/)/,`${Ue.COMMENT}.doc`,"@doc"],[/\/\*/,Ue.COMMENT,"@comment"],[/\/\/.*$/,Ue.COMMENT]],comment:[[/[^/*]+/,Ue.COMMENT],[/\*\//,Ue.COMMENT,"@pop"],[/[/*]/,Ue.COMMENT]],doc:[[/[^/*]+/,`${Ue.COMMENT}.doc`],[/\/\*/,`${Ue.COMMENT}.doc.invalid`],[/\*\//,`${Ue.COMMENT}.doc`,"@pop"],[/[/*]/,`${Ue.COMMENT}.doc`]],string:[[/[^\\']+/,Ue.STRING],[/@escapes/,`${Ue.STRING}.escape`],[/\\./,`${Ue.STRING}.escape.invalid`],[/'/,Ue.STRING,"@pop"]],characters:[[/'[^\\']'/,Ue.STRING],[/(')(@escapes)(')/,[Ue.STRING,`${Ue.STRING}.escape`,Ue.STRING]],[/'/,`${Ue.STRING}.invalid`]]}}))})(e);const s="Monospaced font 'Roboto Mono' has not been loaded properly, text editor display problems might occur";await document.fonts.load("1em Roboto Mono").then((()=>{document.fonts.check("1em Roboto Mono")?(A.editor.remeasureFonts(),t.info(h.create(_e.TEXT_EDITOR_FONT_LOADED),"Monospaced font 'Roboto Mono' has been loaded")):t.error(h.create(_e.APPLICATION_SETUP_FAILURE),s)})).catch((()=>t.error(h.create(_e.APPLICATION_SETUP_FAILURE),s))),(0,O.jQ)({enforceActions:"observed"})})(this.pluginManager,this.logger),(0,N.s)((()=>{let e=document.getElementsByTagName("root").length?document.getElementsByTagName("root")[0]:void 0;return e||(e=document.createElement("root"),document.body.appendChild(e)),e})()).render((0,x.jsx)(tt.VK,{basename:this.baseUrl,children:(0,x.jsx)(ot,{children:(0,x.jsx)(Dt,{config:this.config,pluginManager:this.pluginManager,children:(0,x.jsx)($m,{})})})}))}}class Xm{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){Zm.create().setup({baseUrl:e}).withPresets(Xm.getPresetCollection()).withPlugins(Xm.getPluginCollection()).start().catch((e=>{throw e}))}}Xm.run("/ide/")},94174:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Fuse=void 0;var n=s(71659);Object.defineProperty(t,"Fuse",{enumerable:!0,get:function(){return i(n).default}})},12889:(e,t,s)=>{t.J$M=t.DE2=t.W1M=t.oF7=t.bK4=t.o1U=t.Zlt=t.jG4=t.uMt=t.pTE=t.UOT=t.pgN=t.VAA=t.IEm=t.pOD=t.xDH=t.q1B=t.cOE=void 0,t.QqN=t.SCS=t.$Ow=t.ROc=t.ry=t.FxN=t.Qq=t.VRP=t.nnZ=t.LPM=t.rE2=void 0,t.Two=t.qdB=t.NK0=t.UHp=t.VjU=t.NEI=t.DuK=t.ce8=t.dRK=t.VHe=t.DXi=t.jZm=t.Oag=t.kdY=void 0,t.xLV=t.Sd5=t.tPC=t.Hrt=t.jtq=t.HXR=t.LyQ=t.ppk=t.B_D=t.UPo=t.eRw=t.HLb=t.w0Y=t.Cti=t.POq=t.Vzd=t.b0D=t.XCv=t.g8U=t.v4q=t.a2g=t.x47=void 0,t.eid=void 0;var i=s(18978);Object.defineProperty(t,"cOE",{enumerable:!0,get:function(){return i.FaCrosshairs}}),Object.defineProperty(t,"q1B",{enumerable:!0,get:function(){return i.FaTimes}}),Object.defineProperty(t,"xDH",{enumerable:!0,get:function(){return i.FaTimesCircle}}),Object.defineProperty(t,"pOD",{enumerable:!0,get:function(){return i.FaPlus}}),Object.defineProperty(t,"IEm",{enumerable:!0,get:function(){return i.FaCog}}),Object.defineProperty(t,"VAA",{enumerable:!0,get:function(){return i.FaCaretDown}}),Object.defineProperty(t,"pgN",{enumerable:!0,get:function(){return i.FaHammer}}),Object.defineProperty(t,"UOT",{enumerable:!0,get:function(){return i.FaQuestion}}),Object.defineProperty(t,"pTE",{enumerable:!0,get:function(){return i.FaQuestionCircle}}),Object.defineProperty(t,"uMt",{enumerable:!0,get:function(){return i.FaInfoCircle}}),Object.defineProperty(t,"jG4",{enumerable:!0,get:function(){return i.FaCompress}}),Object.defineProperty(t,"Zlt",{enumerable:!0,get:function(){return i.FaMap}}),Object.defineProperty(t,"o1U",{enumerable:!0,get:function(){return i.FaPlay}}),Object.defineProperty(t,"bK4",{enumerable:!0,get:function(){return i.FaArrowAltCircleRight}}),Object.defineProperty(t,"oF7",{enumerable:!0,get:function(){return i.FaShapes}}),Object.defineProperty(t,"W1M",{enumerable:!0,get:function(){return i.FaSearch}}),Object.defineProperty(t,"DE2",{enumerable:!0,get:function(){return i.FaList}}),Object.defineProperty(t,"J$M",{enumerable:!0,get:function(){return i.FaCircle}}),Object.defineProperty(t,"rE2",{enumerable:!0,get:function(){return i.FaCheckCircle}}),Object.defineProperty(t,"LPM",{enumerable:!0,get:function(){return i.FaExclamationTriangle}}),Object.defineProperty(t,"nnZ",{enumerable:!0,get:function(){return i.FaBug}}),Object.defineProperty(t,"VRP",{enumerable:!0,get:function(){return i.FaCircleNotch}}),Object.defineProperty(t,"Qq",{enumerable:!0,get:function(){return i.FaExpand}}),Object.defineProperty(t,"FxN",{enumerable:!0,get:function(){return i.FaTerminal}}),Object.defineProperty(t,"ry",{enumerable:!0,get:function(){return i.FaFolderOpen}}),Object.defineProperty(t,"ROc",{enumerable:!0,get:function(){return i.FaFolder}}),Object.defineProperty(t,"$Ow",{enumerable:!0,get:function(){return i.FaExclamationCircle}}),Object.defineProperty(t,"SCS",{enumerable:!0,get:function(){return i.FaBan}}),Object.defineProperty(t,"QqN",{enumerable:!0,get:function(){return i.FaFileAlt}}),Object.defineProperty(t,"kdY",{enumerable:!0,get:function(){return i.FaMapMarkerAlt}}),Object.defineProperty(t,"Oag",{enumerable:!0,get:function(){return i.FaHatWizard}}),Object.defineProperty(t,"jZm",{enumerable:!0,get:function(){return i.FaRegLaughWink}}),Object.defineProperty(t,"DXi",{enumerable:!0,get:function(){return i.FaRegSadTear}}),Object.defineProperty(t,"VHe",{enumerable:!0,get:function(){return i.FaDatabase}});var n=s(1553);Object.defineProperty(t,"dRK",{enumerable:!0,get:function(){return n.GiBeard}}),Object.defineProperty(t,"ce8",{enumerable:!0,get:function(){return n.GiSunglasses}});var a=s(65186);Object.defineProperty(t,"DuK",{enumerable:!0,get:function(){return a.MdRefresh}}),Object.defineProperty(t,"NEI",{enumerable:!0,get:function(){return a.MdSubject}}),Object.defineProperty(t,"VjU",{enumerable:!0,get:function(){return a.MdViewHeadline}}),Object.defineProperty(t,"UHp",{enumerable:!0,get:function(){return a.MdAssistant}});var r=s(49385);Object.defineProperty(t,"NK0",{enumerable:!0,get:function(){return r.VscWordWrap}}),Object.defineProperty(t,"qdB",{enumerable:!0,get:function(){return r.VscGoToFile}}),Object.defineProperty(t,"Two",{enumerable:!0,get:function(){return r.VscClose}}),Object.defineProperty(t,"x47",{enumerable:!0,get:function(){return r.VscRegex}}),Object.defineProperty(t,"a2g",{enumerable:!0,get:function(){return r.VscCaseSensitive}});var o=s(70563);Object.defineProperty(t,"v4q",{enumerable:!0,get:function(){return o.GoChevronDown}}),Object.defineProperty(t,"g8U",{enumerable:!0,get:function(){return o.GoChevronUp}}),Object.defineProperty(t,"XCv",{enumerable:!0,get:function(){return o.GoChevronRight}}),Object.defineProperty(t,"b0D",{enumerable:!0,get:function(){return o.GoX}});s(16636);var l=s(91914);Object.defineProperty(t,"Vzd",{enumerable:!0,get:function(){return l.IoFlaskSharp}});var c=s(8799);Object.defineProperty(t,"POq",{enumerable:!0,get:function(){return c.BsGripVertical}}),Object.defineProperty(t,"Cti",{enumerable:!0,get:function(){return c.BsAlignTop}}),Object.defineProperty(t,"w0Y",{enumerable:!0,get:function(){return c.BsAlignMiddle}}),Object.defineProperty(t,"HLb",{enumerable:!0,get:function(){return c.BsAlignBottom}}),Object.defineProperty(t,"eRw",{enumerable:!0,get:function(){return c.BsAlignStart}}),Object.defineProperty(t,"UPo",{enumerable:!0,get:function(){return c.BsAlignCenter}}),Object.defineProperty(t,"B_D",{enumerable:!0,get:function(){return c.BsAlignEnd}}),Object.defineProperty(t,"ppk",{enumerable:!0,get:function(){return c.BsDistributeHorizontal}}),Object.defineProperty(t,"LyQ",{enumerable:!0,get:function(){return c.BsDistributeVertical}});var d=s(77245);Object.defineProperty(t,"HXR",{enumerable:!0,get:function(){return d.BiAtom}});s(30924);var h=s(34543);Object.defineProperty(t,"jtq",{enumerable:!0,get:function(){return h.FiPackage}}),Object.defineProperty(t,"Hrt",{enumerable:!0,get:function(){return h.FiMousePointer}}),Object.defineProperty(t,"tPC",{enumerable:!0,get:function(){return h.FiMove}}),Object.defineProperty(t,"Sd5",{enumerable:!0,get:function(){return h.FiZoomIn}}),Object.defineProperty(t,"xLV",{enumerable:!0,get:function(){return h.FiZoomOut}});s(75100);var u=s(58920);Object.defineProperty(t,"eid",{enumerable:!0,get:function(){return u.TbMathFunction}})},35247:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.baseComponents=t.createFilter=t.Select=t.CreatableSelect=void 0;var n=s(54319);Object.defineProperty(t,"CreatableSelect",{enumerable:!0,get:function(){return i(n).default}});var a=s(31776);Object.defineProperty(t,"Select",{enumerable:!0,get:function(){return i(a).default}}),Object.defineProperty(t,"createFilter",{enumerable:!0,get:function(){return a.createFilter}}),Object.defineProperty(t,"baseComponents",{enumerable:!0,get:function(){return a.components}})}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={id:e,loaded:!1,exports:{}};return a[e].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=a,o.amdO={},e=[],o.O=(t,s,i,n)=>{if(!s){var a=1/0;for(d=0;d<e.length;d++){for(var[s,i,n]=e[d],r=!0,l=0;l<s.length;l++)(!1&n||a>=n)&&Object.keys(o.O).every((e=>o.O[e](s[l])))?s.splice(l--,1):(r=!1,n<a&&(a=n));if(r){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[s,i,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},s=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,i){if(1&i&&(e=this(e)),8&i)return e;if("object"==typeof e&&e){if(4&i&&e.__esModule)return e;if(16&i&&"function"==typeof e.then)return e}var n=Object.create(null);o.r(n);var a={};t=t||[null,s({}),s([]),s(s)];for(var r=2&i&&e;"object"==typeof r&&!~t.indexOf(r);r=s(r))Object.getOwnPropertyNames(r).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,o.d(n,a),n},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,s)=>(o.f[s](e,t),t)),[])),o.u=e=>"static/"+e+"."+{246:"bd837eb4",399:"7ad47fd9",471:"bde04e4b",947:"50215a8f"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},n="@finos/legend-application-pure-ide-deployment:",o.l=(e,t,s,a)=>{if(i[e])i[e].push(t);else{var r,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var h=c[d];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==n+s){r=h;break}}r||(l=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,o.nc&&r.setAttribute("nonce",o.nc),r.setAttribute("data-webpack",n+s),r.src=e),i[e]=[t];var u=(t,s)=>{r.onerror=r.onload=null,clearTimeout(p);var n=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),n&&n.forEach((e=>e(s))),t)return t(s)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),l&&document.head.appendChild(r)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/ide/",(()=>{var e={826:0};o.f.j=(t,s)=>{var i=o.o(e,t)?e[t]:void 0;if(0!==i)if(i)s.push(i[2]);else{var n=new Promise(((s,n)=>i=e[t]=[s,n]));s.push(i[2]=n);var a=o.p+o.u(t),r=new Error;o.l(a,(s=>{if(o.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var n=s&&("load"===s.type?"missing":s.type),a=s&&s.target&&s.target.src;r.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",r.name="ChunkLoadError",r.type=n,r.request=a,i[1](r)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,s)=>{var i,n,[a,r,l]=s,c=0;if(a.some((t=>0!==e[t]))){for(i in r)o.o(r,i)&&(o.m[i]=r[i]);if(l)var d=l(o)}for(t&&t(s);c<a.length;c++)n=a[c],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(d)},s=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var l=o.O(void 0,[736],(()=>o(80398)));l=o.O(l)})();
|
2
|
-
//# sourceMappingURL=index.
|
1
|
+
(()=>{"use strict";var e,t,s,i,n,a={80398:(e,t,s)=>{const i=JSON.parse('{"i8":"6.2.8","Rw":{"k":"@finos/legend-logger-plugin-web-console"}}');var n,a=s(91004);class r{name;version;signature;uuid}class o{name;version;uuid=(0,a.Z)();constructor(e,t){this.name=e,this.version=t}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getInfo(){const e=new r;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e}configure(e){return this}}class l{name;version;signature;uuid;plugins=[]}class c{name;version;uuid=(0,a.Z)();plugins=[];constructor(e,t,s){this.name=e,this.version=t,this.plugins=s}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getPlugins(){return[...this.plugins]}getInfo(){const e=new l;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e.plugins=this.plugins.map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),e}configure(e){return this}install(e){this.plugins.forEach((t=>t.install(e)))}}class d{plugins=[];presets=[];usePlugins(e){return this.plugins=e,this}usePresets(e){return this.presets=e,this}configure(e){Object.keys(e).forEach((t=>{const s=e[t];this.presets.forEach((e=>{e.getName()===t&&e.configure(s)})),this.plugins.forEach((e=>{e.getName()===t&&e.configure(s)}))}))}install(){this.plugins.forEach((e=>e.install(this))),this.presets.forEach((e=>e.install(this)))}getInfo(){return{plugins:this.plugins.filter((e=>!this.getHiddenPluginNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),presets:this.presets.filter((e=>!this.getHiddenPresetNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name)))}}getHiddenPluginNames(){return[]}getHiddenPresetNames(){return[]}}!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(n=n||(n={}));class h{channel;name;timestamp=Date.now();static create(e){const t=new h;return t.name=e,t}}class u extends o{level=n.DEBUG;setLevel(e){this.level=e}install(e){e.registerLoggerPlugin(this)}debug(e,...t){this.level<=n.DEBUG&&this._debug(e,...t)}info(e,...t){this.level<=n.INFO&&this._info(e,...t)}warn(e,...t){this.level<=n.WARN&&this._warn(e,...t)}error(e,...t){this.level<=n.ERROR&&this._error(e,...t)}}class p{loggers=[];registerPlugins(e){this.loggers=e}debug(e,...t){this.loggers.forEach((s=>s.debug(e,...t)))}info(e,...t){this.loggers.forEach((s=>s.info(e,...t)))}warn(e,...t){this.loggers.forEach((s=>s.warn(e,...t)))}error(e,...t){this.loggers.forEach((s=>s.error(e,...t)))}}const{debug:_,info:m,warn:g,error:E}=console;class f extends u{constructor(){super(i.Rw.k,i.i8)}_debug(e,...t){_(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_info(e,...t){m(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_warn(e,...t){g(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_error(e,...t){E(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}var T,C,x=s(52322),N=s(17029),O=s(80075),A=s(90361);!function(e){e.LEGEND="LEGEND",e.TEMPORARY__VSCODE_LIGHT="vs"}(T=T||(T={})),function(e){e.TEXT="text",e.PURE="pure",e.JSON="json",e.JAVA="java",e.MARKDOWN="markdown",e.SQL="sql"}(C=C||(C={}));var S=s(85928),y=s(21112);const I=e=>e.constructor,v=()=>()=>{},R=e=>e.length?e[0]:void 0,P=e=>new Promise(((t,s)=>setTimeout((()=>{try{t(e())}catch(e){s(e)}}),0))),w=(e,t,s=((e,t)=>e===t))=>!e.find((e=>s(e,t)))&&(e.push(t),!0),L=(e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t))),a=e.findIndex((e=>i(e,s)));return-1!==n&&-1!==a&&(e[n]=s,e[a]=t,!0)},b=(e,t,s=((e,t)=>e===t))=>{const i=e.findIndex((e=>s(e,t)));return-1!==i&&(e.splice(i,1),!0)};class D extends Error{uuid=(0,a.Z)();constructor(e){super(),this.message=void 0===e||""===e?"(no error message)":e}get detail(){return this.message}}class M extends Error{constructor(e,t,s){if(super(s||(t instanceof Error?t.message:t)),this.name=e,t instanceof Error){const e=(this.message.match(/\n/g)??[]).length+1;this.stack=`${(this.stack??"").split("\n").slice(0,e+1).join("\n")}\nCaused by: ${t.stack}`}else"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack}}class k extends M{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class F extends M{constructor(e,t){super("Unsupported Operation Error",e||t?`${e}${t?`\n${((e,t)=>{const s=(i={printFunctionName:!1,maxDepth:t?.deep?void 0:1},(0,S.Z)(i,(e=>void 0!==e)));var i;return(0,y.WU)(e,s).replace(/.*\s\{/g,"{").replace(/\[.*\]/g,(e=>["[Array]","[Function]"].includes(e)?e:"[Object]"))})(t)}`:""}`:void 0)}}function j(e){if(!(e instanceof Error))throw new k("Expected error to be thrown")}const U=e=>{try{return e()}catch{return}};class V extends M{constructor(e,t){super("Assertion Error",e,t)}}const G=e=>null!=e;function z(e,t=""){if(null==e)throw new V(t||"Value is nullable")}const B=(e,t="")=>(z(e,t),e),$=e=>t=>((e,t)=>e instanceof t)(t,e);function H(e,t,s=""){if(!(e instanceof t))throw new V(s||`Value is expected to be of type '${t.name}'`)}const Y=(e,t,s="")=>(H(e,t,s),e);function W(e,t=""){if(""===B(e,t))throw new V(t||"Expected string value to be non-empty")}function K(e,t=""){return W(e,t),e}function Z(e,t=""){if(!e)throw new V(t||"Expected predicate to be truthy")}const X=e=>"string"==typeof e,q=e=>"object"==typeof e&&null!==e;var J=s(39391),Q=s(33654),ee=s(34126);s(72659);const te=J.W,se="charset=utf-8";var ie,ne,ae;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(ie=ie||(ie={})),function(e){e.APPLICATION_JSON="application/json",e.APPLICATION_XML="application/xml",e.APPLICATION_ZLIB="application/zlib",e.TEXT_PLAIN="text/plain",e.TEXT_CSV="text/csv",e.ALL="*/*"}(ne=ne||(ne={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(ae=ae||(ae={}));const re={mode:"cors",credentials:"include",redirect:"manual"},oe=(e,t)=>{const s={};return e&&Object.entries(e).forEach((([e,t])=>{s[e]=t})),t&&Object.entries(t).forEach((([e,t])=>{s[e]=t})),s};class le extends Error{response;payload;constructor(e,t){super(),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="Network Client Error",this.response=e;const{status:s,statusText:i,url:n}=e,a=`Received response with status ${s} (${i}) for ${n}`;this.message=(t?(e=>{if(q(e))return X(e.message)?e.message:JSON.stringify(e);let t;try{t=JSON.parse(e)}catch{}return t&&X(t.message)?t.message:e})(t).substring(0,5e3):"")||a,this.payload=t}}const ce=async(e,t,s)=>{if(s?.preprocess?.(e),!e.ok){let t;try{t=await e.text(),t=JSON.parse(t)}catch{}return Promise.reject(new le(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===te.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case ne.APPLICATION_JSON:return e.json();case ne.TEXT_PLAIN:return e.text();default:return Promise.reject(new le(e,`Can't process response for request with Content-Type '${i}'`))}},de=async(e,t,s)=>s?.autoReAuthenticateUrl?(e=>new Promise((t=>{const s="AUTO_AUTHENTICATION_IFRAME";document.getElementById(s)?.remove();const i=document.createElement("iframe");i.id=s,i.src=e,i.style.display="none",i.addEventListener("load",(()=>{i.remove(),t()})),document.body.appendChild(i)})))(s.autoReAuthenticateUrl).then((()=>fetch(e,t))).then((e=>ce(e,t,s))):fetch(e,t).then((e=>ce(e,t,s))),he=(e,t)=>{const s={};return s.Accept=ne.APPLICATION_JSON,e!==ae.GET&&(s[ie.CONTENT_TYPE]=`${ne.APPLICATION_JSON};${se}`),oe(s,t)};class ue{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...re,...e?.options??{}}}async get(e,t={},s,i,n,a){return this.request(ae.GET,e,void 0,t,s,i,n,a)}async put(e,t={},s={},i,n,a,r){return this.request(ae.PUT,e,t,s,i,n,a,r)}async post(e,t={},s={},i,n,a,r){return this.request(ae.POST,e,t,s,i,n,a,r)}async delete(e,t={},s={},i,n,a,r){return this.request(ae.DELETE,e,t,s,i,n,a,r)}async request(e,t,s,i,n,a,r,o){const l=((e,t,s)=>{if(!e&&!U((()=>new URL(t))))throw new Error(`Can't build URL string: base URL is not specified and the provided URL '${t}' is not absolute`);const i=new URL(t,e);return s instanceof Object&&Object.entries(s).forEach((([e,t])=>{void 0!==t&&(Array.isArray(t)?t.filter(G).forEach((t=>i.searchParams.append(e,t.toString()))):i.searchParams.append(e,t.toString()))})),i.toString()})(this.baseUrl,t,a??{});let c;if((X(s)||q(s))&&r?.enableCompression&&(Z(e!==ae.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,Q.Wt)(q(e)?JSON.stringify(e):e)]))(s),n=oe(n,{[ie.CONTENT_TYPE]:`${ne.APPLICATION_ZLIB};${se}`})),void 0!==s)if(X(s)||s instanceof Blob)c=s;else{if(!q(s))throw new V("Request body can only be either a 'string' or an 'object'");c=JSON.stringify(s)}const d={...this.options,...i,method:e,body:c,headers:he(e,n)};return fetch(l,d).then((e=>(e=>0===e.status||e.status===te.UNAUTHORIZED)(e)?de(l,d,o):ce(e,d,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?de(l,d,o):Promise.reject(e)))}}const pe=(e,t,s)=>{const i=new Blob([t],{type:s}),n=URL.createObjectURL(i),a=document.createElement("a");"string"==typeof a.download?(document.body.appendChild(a),a.download=e,a.href=n,a.click(),document.body.removeChild(a)):location.replace(n)};var _e;!function(e){e.TEXT_EDITOR_FONT_LOADED="application.load.font.success",e.APPLICATION_SETUP_FAILURE="application.setup.failure",e.ILLEGAL_APPLICATION_STATE_OCCURRED="application.error.illegal-state",e.APPLICATION_CONFIGURATION_FAILURE="application.configuration.failure",e.APPLICATION_DOCUMENTATION_FETCH_FAILURE="application.fetch.documentation.failure",e.APPLICATION_DOCUMENTATION_LOAD_SKIPPED="application.load.documentation.skipped",e.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK_FAILURE="application.load.documentation.requirement-check.failure",e.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE="application.load.keyboard-shortcuts.configuration-check.failure",e.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED="application.load.contextual-documentation.skipped",e.APPLICATION_COMMAND_CENTER_REGISTRATION_FAILURE="application.command-center.registration.failure",e.APPLICATION_LOADED="application.load.success",e.APPLICATION_LOAD_FAILURE="application.load.failure",e.DEVELOPMENT_ISSUE="development.issue",e.APPLICATION_CONTEXT_ACCESSED="application.context.accessed",e.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED="application.virtual-assistant.documentation-entry.accessed"}(_e=_e||(_e={}));const me="::",ge="###",Ee=["$implicit"];var fe,Te,Ce,xe,Ne;(Ne=fe=fe||(fe={})).CORE="CORE",Ne.MAIN="ROOT",Ne.MODEL_GENERATION="MODEL_GENERATION_ROOT",Ne.SYSTEM="SYSTEM_ROOT",Ne.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(xe=Te=Te||(Te={})).STRING="String",xe.BOOLEAN="Boolean",xe.BINARY="Binary",xe.NUMBER="Number",xe.INTEGER="Integer",xe.FLOAT="Float",xe.DECIMAL="Decimal",xe.DATE="Date",xe.STRICTDATE="StrictDate",xe.DATETIME="DateTime",xe.STRICTTIME="StrictTime",xe.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(Ce=Ce||(Ce={}));const Oe=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var Ae,Se,ye,Ie,ve,Re,Pe,we,Le,be;(Se=Ae=Ae||(Ae={})).ANY="meta::pure::metamodel::type::Any",Se.NIL="meta::pure::metamodel::type::Nil",Se.PROFILE_DOC="meta::pure::profiles::doc",Se.PROFILE_TEMPORAL="meta::pure::profiles::temporal",Se.PROFILE="meta::pure::metamodel::extension::Profile",Se.ENUMERATION="meta::pure::metamodel::type::Enumeration",Se.MEASURE="meta::pure::metamodel::type::Measure",Se.CLASS="meta::pure::metamodel::type::Class",Se.ASSOCIATION="meta::pure::metamodel::relationship::Association",Se.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",Se.FLAT_DATA="meta::flatData::metamodel::FlatData",Se.DATABASE="meta::relational::metamodel::Database",Se.MAPPING="meta::pure::mapping::Mapping",Se.SERVICE="meta::legend::service::metamodel::Service",Se.CONNECTION="meta::pure::runtime::PackageableConnection",Se.RUNTIME="meta::pure::runtime::PackageableRuntime",Se.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",Se.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",Se.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",Se.DATA_ELEMENT="meta::pure::data::DataElement",Se.TDS_ROW="meta::pure::tds::TDSRow",(Re=ye=ye||(ye={})).BUSINESS_TEMPORAL="businesstemporal",Re.PROCESSING_TEMPORAL="processingtemporal",Re.BITEMPORAL="bitemporal",(ve=Ie=Ie||(Ie={})).ALL_VERSIONS="AllVersions",ve.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(we=Pe=Pe||(Pe={})).STORE="STORE",we.MAPPING="MAPPING",we.RUNTIME="RUNTIME",we.FILE_GENERATION="FILE_GENERATION",we.SERVICE="SERVICE",(be=Le=Le||(Le={})).TODAY="meta::pure::functions::date::today",be.NOW="meta::pure::functions::date::now",be.FIRST_DAY_OF_WEEK="meta::pure::functions::date::firstDayOfThisWeek",be.FIRST_DAY_OF_MONTH="meta::pure::functions::date::firstDayOfThisMonth",be.FIRST_DAY_OF_QUARTER="meta::pure::functions::date::firstDayOfThisQuarter",be.FIRST_DAY_OF_YEAR="meta::pure::functions::date::firstDayOfThisYear",be.PREVIOUS_DAY_OF_WEEK="meta::pure::functions::date::previousDayOfWeek",be.IS_ON_DAY="meta::pure::functions::date::isOnDay",be.IS_ON_OR_AFTER_DAY="meta::pure::functions::date::isOnOrAfterDay",be.IS_AFTER_DAY="meta::pure::functions::date::isAfterDay",be.IS_ON_OR_BEFORE_DAY="meta::pure::functions::date::isOnOrBeforeDay",be.IS_BEFORE_DAY="meta::pure::functions::date::isBeforeDay",be.MINUS="meta::pure::functions::math::minus",be.ADJUST="meta::pure::functions::date::adjust",be.LET="meta::pure::functions::lang::letFunction";const De="yyyy-MM-dd'T'HH:mm:ssxxxx";var Me,ke,Fe;!function(e){e.PROFILE="Profile",e.CLASS="Class",e.ENUMERATION="Enum",e.MEASURE="Measure",e.ASSOCIATION="Association",e.FUNCTION="function",e.MAPPING="Mapping",e.FLAT_DATA="FlatData",e.DATABASE="Database",e.SERVICE="Service",e.RUNTIME="Runtime",e.CONNECTION="Connection",e.FILE_GENERATION="FileGeneration",e.GENERATION_SPECIFICATION="GenerationSpecification",e.DATA_ELEMENT="Data"}(Me=Me||(Me={})),function(e){e.JSON_MODEL_CONNECTION="JsonModelConnection",e.XML_MODEL_CONNECTION="XmlModelConnection",e.MODEL_CHAIN_CONNECTION="ModelChainConnection",e.RELATIONAL_DATABASE_CONNECTION="RelationalDatabaseConnection",e.FLAT_DATA_CONNECTION="FlatDataConnection"}(ke=ke||(ke={})),function(e){e.PURE="Pure",e.CONNECTION="Connection",e.RUNTIME="Runtime",e.MAPPING="Mapping",e.SERVICE="Service",e.FLATDATA="FlatData",e.RELATIONAL="Relational",e.GENERATION_SPECIFICATION="GenerationSpecification",e.FILE_GENERATION_SPECIFICATION="FileGeneration",e.DATA="Data"}(Fe=Fe||(Fe={}));const je=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`;var Ue;!function(e){e.WHITESPACE="",e.KEYWORD="keyword",e.IDENTIFIER="identifier",e.OPERATOR="operator",e.DELIMITER="delimiter",e.PARSER="parser",e.NUMBER="number",e.DATE="date",e.COLOR="color",e.PACKAGE="package",e.STRING="string",e.COMMENT="comment",e.LANGUAGE_STRUCT="language-struct",e.MULTIPLICITY="multiplicity",e.GENERICS="generics",e.PROPERTY="property",e.VARIABLE="variable",e.TYPE="type",e.INVALID="invalid"}(Ue=Ue||(Ue={}));const Ve={base:"vs-dark",inherit:!0,colors:{},rules:[{token:Ue.IDENTIFIER,foreground:"dcdcaa"},{token:Ue.NUMBER,foreground:"b5cea8"},{token:Ue.DATE,foreground:"b5cea8"},{token:Ue.COLOR,foreground:"b5cea8"},{token:Ue.PACKAGE,foreground:"808080"},{token:Ue.PARSER,foreground:"c586c0"},{token:Ue.LANGUAGE_STRUCT,foreground:"c586c0"},{token:Ue.MULTIPLICITY,foreground:"2d796b"},{token:Ue.GENERICS,foreground:"2d796b"},{token:Ue.PROPERTY,foreground:"9cdcfe"},{token:Ue.VARIABLE,foreground:"4fc1ff"},{token:Ue.TYPE,foreground:"3dc9b0"}]},Ge={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"},{open:"<<",close:">>"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}};var ze=s(79013);class Be{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,ze.qC)(this.schema,e)}fromJson(e){return(0,ze.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,S.Z)(t,(e=>null!==e))):e);var t}}const $e=e=>(0,ze.PG)((t=>void 0===t?ze.AM:(0,ze.qC)(e,t)),(t=>(0,ze.vB)(e,t))),He=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?ze.AM:[],Ye=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?ze.AM:[]:ze.AM,We=e=>(0,ze.PG)((()=>e),(()=>e));var Ke=s(4e4);class Ze{_documentationKey;markdownText;title;text;url;related;static serialization=new Be((0,ze.yu)(Ze,{markdownText:(0,ze.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,ze.jt)((0,ze.pb)((0,ze.Ru)())),title:(0,ze.jt)((0,ze.Ru)()),text:(0,ze.jt)((0,ze.Ru)()),url:(0,ze.jt)((0,ze.Ru)())}));static create(e,t){const s=Ze.serialization.fromJson(e);return s._documentationKey=t,s}}const Xe=e=>Object.entries(e).map((e=>({key:e[0],content:Ze.create(e[1],e[0])})));class qe{url;docRegistry=new Map;contextualDocIndex=new Map;constructor(e){this.url=e.config.documentationUrl,e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedDocumentationEntries?.()??[])).forEach((t=>{this.hasDocEntry(t.key)?e.log.warn(h.create(_e.APPLICATION_DOCUMENTATION_LOAD_SKIPPED),t.key):this.docRegistry.set(t.key,t.content)})),e.config.keyedDocumentationEntries.forEach((e=>this.docRegistry.set(e.key,e.content)));const t=e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraContextualDocumentationEntries?.()??[])),s=[];(0,Ke.Z)(e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraRequiredDocumentationKeys?.()??[])).concat(t.map((e=>e.documentationKey)))).forEach((e=>{this.docRegistry.has(e)||s.push(e)})),s.length&&e.log.warn(h.create(_e.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK_FAILURE),`Can't find corresponding documentation entry for keys:\n${s.map((e=>`- ${e}`)).join("\n")}`),t.forEach((t=>{if(this.hasContextualDocEntry(t.context))e.log.warn(h.create(_e.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED),t.context);else{const e=this.getDocEntry(t.documentationKey);e&&this.contextualDocIndex.set(t.context,e)}})),e.config.contextualDocEntries.forEach((e=>{const t=this.getDocEntry(e.documentationKey);t&&this.contextualDocIndex.set(e.context,t)}))}getDocEntry(e){return this.docRegistry.get(e)}hasDocEntry(e){return this.docRegistry.has(e)}getContextualDocEntry(e){return this.contextualDocIndex.get(e)}hasContextualDocEntry(e){return this.contextualDocIndex.has(e)}getAllDocEntries(){return Array.from(this.docRegistry.values())}publishDocRegistry(){const e={};return this.docRegistry.forEach(((t,s)=>{e[s]=Ze.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t._documentationKey})),e}}class Je{}class Qe extends Je{debug(e,...t){console.debug(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}info(e,...t){console.info(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}warn(e,...t){console.warn(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}error(e,...t){console.error(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}class et{config;logger;pluginManager;basePresets=[];basePlugins=[];baseUrl;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new Qe}setup(e){return this.baseUrl=K(e.baseUrl,"Can't setup application: 'baseUrl' is missing or empty"),this.pluginRegister=e.pluginRegister,this._isConfigured=!0,this}withBasePresets(e){return this.basePresets=e,this.withPresets([])}withBasePlugins(e){return this.basePlugins=e,this.withPlugins([])}withPresets(e){return this.pluginManager.usePresets([...this.basePresets,...e]),this}withPlugins(e){return this.pluginManager.usePlugins([...this.basePlugins,...e]),this}async fetchApplicationConfiguration(e){const t=new ue;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){j(e),this.logger.error(h.create(_e.APPLICATION_CONFIGURATION_FAILURE),e)}z(s,"Can't fetch Legend application configuration");try{i=await t.get(`${window.location.origin}${e}version.json`)}catch(e){j(e),this.logger.error(h.create(_e.APPLICATION_CONFIGURATION_FAILURE),e)}return z(i,"Can't fetch Legend application version"),[await this.configureApplication({configData:s,versionData:i,baseUrl:e}),s.extensions??{}]}async loadDocumentationRegistryData(e){const t={};await Promise.all([...e.documentationRegistryEntries,...this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraDocumentationRegistryEntries?.()??[]))].map((async e=>{try{const s=new ue(e.simple?{options:{credentials:"omit"}}:{}),i=await s.get(K(e.url,"Can't load documentation registry: 'url' field is missing or empty"));z(i.entries,"Can't load documentation registry data: 'entries' field is missing");const n=e.includes?.map((e=>new RegExp(`^${e.trim().replace(/[\^$\\.+?()[\]{}|]/g,"\\$&").replace(/\*/g,".*")}$`)));Object.entries(i.entries).forEach((([e,s])=>{n&&!n.some((t=>t.test(e)))||t[e]||(t[e]=s)}))}catch(e){j(e),this.logger.warn(h.create(_e.APPLICATION_DOCUMENTATION_FETCH_FAILURE),e)}}))),e.keyedDocumentationEntries=[...Xe(t),...e.keyedDocumentationEntries]}async start(){z(this._isConfigured,"Legend application has not been configured properly. Make sure to run setup() before start()");try{const[e,t]=await this.fetchApplicationConfiguration(this.baseUrl);this.config=e,this.pluginRegister?.(this.pluginManager,this.config),this.pluginManager.configure(t),this.pluginManager.install(),await Promise.all([this.loadDocumentationRegistryData(e)]),await this.loadApplication(),await Promise.all(this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraApplicationSetups?.()??[])).map((e=>e(this.pluginManager)))),this.logger.info(h.create(_e.APPLICATION_LOADED),"Legend application loaded")}catch(e){throw j(e),this.logger.error(h.create(_e.APPLICATION_LOAD_FAILURE),"Failed to load Legend application"),e}}}var tt=s(74926),st=s(69038),it=s(2784);class nt{historyAPI;_isNavigationBlocked=!1;_forceBypassNavigationBlocking=!1;_blockCheckers=[];_beforeUnloadListener=e=>{this._forceBypassNavigationBlocking||this._blockCheckers.some((e=>e()))&&(e.returnValue="")};onBlock;onNativePlatformNavigationBlock;constructor(e){(0,O.rC)(this,{_isNavigationBlocked:O.LO,isNavigationBlocked:O.Fl,blockNavigation:O.aD,unblockNavigation:O.aD}),this.historyAPI=e}get window(){return B(window,"Window object is not available in non-web environment")}goToLocation(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=this.generateAddress(e)};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}reload(e){e?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const t=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.reload()};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(t):t()}goToAddress(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=e};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}visitAddress(e){this.window.open(e,"_blank")}updateCurrentLocation(e){this.historyAPI.push(e)}getCurrentAddress(){return this.window.location.href}getCurrentLocation(){return this.historyAPI.location.pathname}generateAddress(e){return this.window.location.origin+this.historyAPI.createHref({pathname:e})}blockNavigation(e,t,s){this._isNavigationBlocked=!0,this.onBlock=t,this.onNativePlatformNavigationBlock=s,this.window.history.pushState(null,"",this.getCurrentAddress()),this.window.onpopstate=()=>{window.history.forward(),this.onNativePlatformNavigationBlock?.()},this._blockCheckers=e,this.window.removeEventListener("beforeunload",this._beforeUnloadListener),this.window.addEventListener("beforeunload",this._beforeUnloadListener)}unblockNavigation(){this._isNavigationBlocked=!1,this.onBlock=void 0,this.window.onpopstate=null,this._blockCheckers=[],this.window.removeEventListener("beforeunload",this._beforeUnloadListener)}get isNavigationBlocked(){return this._isNavigationBlocked}}var at=s(40979);const rt=(0,it.createContext)(void 0),ot=({children:e})=>{const t=(0,at.k6)(),s=(0,st.fv)((()=>new nt(t)));return(0,x.jsx)(rt.Provider,{value:s,children:e})};class lt{plugins=[];registerPlugins(e){this.plugins=e}setUserId(e){this.plugins.forEach((t=>t.setUserId(e)))}logEvent(e,t){this.plugins.forEach((s=>s.logEvent(e,t)))}}var ct;!function(e){e.USER="user",e.ENV="env",e.RESULT="result",e.ERROR="error",e.HTTP_STATUS="status",e.HTTP_REQUEST_METHOD="method",e.HTTP_REQUEST_URL="url"}(ct=ct||(ct={}));class dt{traceEntries=[];setup(e){this.traceEntries=e}bootstrap(e){this.traceEntries.forEach((t=>{t.plugin.bootstrap(t.clientSpan,e)}))}reportSuccess(){this.traceEntries.forEach((e=>{e.plugin.concludeClientSpan(e.clientSpan,void 0)}))}reportError(e){this.traceEntries.forEach((t=>{t.plugin.concludeClientSpan(t.clientSpan,e)}))}close(){this.traceEntries.forEach((e=>{e.plugin.concludeServerSpan(e.serverSpan)}))}}class ht{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const n=new dt;return e&&n.setup(this.plugins.map((n=>{const a=n.createClientSpan(e);return{clientSpan:a,serverSpan:n.createServerSpan(a,t,s,i),plugin:n}}))),n}}var ut,pt,_t,mt=s(94174);!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(ut||(ut={}));class gt{state;_message;_messageFormatter;constructor(){this.state=ut.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=ut.INITIAL,this}inProgress(){return this.state=ut.IN_PROGRESS,this}fail(){return this.state=ut.FAILED,this}pass(){return this.state=ut.SUCCEEDED,this}complete(e=!0){return e?this.pass():this.fail(),this}get isInInitialState(){return this.state===ut.INITIAL}get isInProgress(){return this.state===ut.IN_PROGRESS}get hasFailed(){return this.state===ut.FAILED}get hasSucceeded(){return this.state===ut.SUCCEEDED}get message(){return this._message?this._messageFormatter?this._messageFormatter(this._message):this._message:void 0}get hasCompleted(){return this.hasFailed||this.hasSucceeded}static create(){return(0,O.rC)(new gt,{state:O.LO,_message:O.LO,reset:O.aD,inProgress:O.aD,pass:O.aD,fail:O.aD,complete:O.aD,setMessage:O.aD,isInInitialState:O.Fl,isInProgress:O.Fl,hasFailed:O.Fl,hasSucceeded:O.Fl,hasCompleted:O.Fl,message:O.Fl})}}!function(e){e.STANDARD="standard",e.INCLUDE="include match",e.EXACT="exact match",e.INVERSE="excludes exact match"}(pt=pt||(pt={}));class Et{currentMode=pt.STANDARD;onSearchModeChange;constructor(e){(0,O.rC)(this,{currentMode:O.LO,isAdvancedSearchActive:O.Fl,setCurrentMode:O.aD}),this.onSearchModeChange=e}get isAdvancedSearchActive(){return this.currentMode!==pt.STANDARD}generateSearchText(e){switch(this.currentMode){case pt.INCLUDE:return`'"${e}"`;case pt.EXACT:return`="${e}"`;case pt.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(_t=_t||(_t={}));class ft{uuid=(0,a.Z)();documentationKey;title;content;url;isOpen=!1;constructor(e){(0,O.rC)(this,{isOpen:O.LO,setIsOpen:O.aD}),this.documentationKey=e._documentationKey,this.title=K(e.title),this.content=e.markdownText??e.text,this.url=e.url}setIsOpen(e){this.isOpen=e}}class Tt{uuid=(0,a.Z)();context;title;content;url;related;constructor(e,t,s){this.context=e,this.title=t.title,this.content=t.markdownText??t.text,this.url=t.url,this.related=s}}const Ct=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class xt{applicationStore;panelRenderingKey=(0,a.Z)();isHidden=!1;isOpen=!1;selectedTab=_t.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=gt.create();searchText="";searchResults=[];showSearchConfigurationMenu=!1;isOverSearchLimit=!1;constructor(e){(0,O.rC)(this,{isHidden:O.LO,isOpen:O.LO,panelRenderingKey:O.LO,isOverSearchLimit:O.LO,selectedTab:O.LO,searchText:O.LO,searchResults:O.LO,currentDocumentationEntry:O.LO,showSearchConfigurationMenu:O.LO,currentContextualDocumentationEntry:O.Fl,setIsHidden:O.aD,setIsOpen:O.aD,setSelectedTab:O.aD,setSearchText:O.aD,resetSearch:O.aD,search:O.aD,openDocumentationEntry:O.aD,refreshPanelRendering:O.aD,setShowSearchConfigurationMenu:O.aD}),this.applicationStore=e,this.searchEngine=new mt.Fuse(this.applicationStore.documentationService.getAllDocEntries().filter(Ct),{includeScore:!0,shouldSort:!0,ignoreLocation:!0,threshold:.2,keys:[{name:"title",weight:4},{name:"text",weight:1},{name:"markdownText.value",weight:1}],useExtendedSearch:!0}),this.searchConfigurationState=new Et((()=>{this.search()}))}get currentContextualDocumentationEntry(){if(!this.applicationStore.navigationContextService.currentContext)return;const e=this.applicationStore.navigationContextService.currentContext.key,t=this.applicationStore.documentationService.getContextualDocEntry(e);return t?new Tt(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter(G).filter(Ct).map((e=>new ft(e)))):void 0}openDocumentationEntry(e){const t=this.applicationStore.documentationService.getAllDocEntries().find((t=>t._documentationKey===e));t&&(this.setIsOpen(!0),this.setIsHidden(!1),this.currentDocumentationEntry=new ft(t),this.currentDocumentationEntry.setIsOpen(!0),this.resetSearch())}setIsHidden(e){this.isHidden=e}hideAssistant(){this.setIsHidden(!0),this.setIsOpen(!1)}toggleAssistant(){this.isHidden?this.setIsHidden(!1):this.hideAssistant()}setIsOpen(e){this.isOpen=e}setSelectedTab(e){this.selectedTab=e}refreshPanelRendering(){this.panelRenderingKey=(0,a.Z)()}setSearchText(e){this.searchText=e}resetSearch(){this.searchText="",this.searchResults=[],this.searchState.complete()}search(){this.searchText?(this.currentDocumentationEntry=void 0,this.searchState.inProgress(),this.searchResults=Array.from(this.searchEngine.search(this.searchConfigurationState.generateSearchText(this.searchText),{limit:101}).values()).map((e=>new ft(e.item))),this.searchResults.length>100?(this.isOverSearchLimit=!0,this.searchResults=this.searchResults.slice(0,100)):this.isOverSearchLimit=!1,this.searchState.complete()):this.searchResults=[]}setShowSearchConfigurationMenu(e){this.showSearchConfigurationMenu=e}}class Nt{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}class Ot{static logEvent_ApplicationInitialized(e,t){e.logEvent(_e.APPLICATION_LOADED,t)}static logEvent_ApplicationContextAccessed(e,t){e.logEvent(_e.APPLICATION_CONTEXT_ACCESSED,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(_e.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED,t)}}class At{applicationStore;contextStack=[];constructor(e){(0,O.rC)(this,{contextStack:O.LO,currentContext:O.Fl,push:O.aD,pop:O.aD}),this.applicationStore=e}get currentContext(){return this.contextStack.length?this.contextStack[this.contextStack.length-1]:void 0}push(e){const t=this.contextStack.filter((e=>!e.isTransient));if(t.find((t=>t.key===e.key)))throw new k(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&Ot.logEvent_ApplicationContextAccessed(this.applicationStore.telemetryService,{key:e.key}),this.contextStack=t}pop(e){const t=this.contextStack.find((t=>t.key===e.key));if(!t)return;const s=this.contextStack.indexOf(t);-1!==s&&(this.contextStack=this.contextStack.slice(0,s).filter((e=>!e.isTransient)))}}class St{applicationStore;commandRegistry=new Map;constructor(e){(0,O.rC)(this,{commandRegistry:O.LO,registerCommand:O.aD,deregisterCommand:O.aD}),this.applicationStore=e}registerCommand(e){const t=e.key;this.commandRegistry.has(t)?this.applicationStore.log.warn(h.create(_e.APPLICATION_COMMAND_CENTER_REGISTRATION_FAILURE),"Can't register command: command is already registered"):this.commandRegistry.set(t,e)}deregisterCommand(e){this.commandRegistry.delete(e)}runCommand(e,t){const s=this.commandRegistry.get(e);return!(!s||s.trigger&&!s.trigger()||(s.action?.(t),0))}}class yt{applicationStore;keyMap=new Map;commandKeyMap=new Map;isHotkeysBlocked=!1;constructor(e){(0,O.rC)(this,{keyMap:O.LO,commandKeyMap:O.LO,isHotkeysBlocked:O.LO,updateHotkey:O.aD,blockGlobalHotkeys:O.aD,unblockGlobalHotkeys:O.aD}),this.applicationStore=e;const t=[];this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedCommandConfigEntries?.()??[])).forEach((e=>{e.content.defaultKeyboardShortcut&&this.commandKeyMap.get(e.key)&&w(t,e.key),this.updateHotkey(e.key,e.content.defaultKeyboardShortcut)})),t.length&&this.applicationStore.log.warn(h.create(_e.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE),`Found multiple key bindings in configuration for commands:\n${t.map((e=>`- ${e}`)).join("\n")}`)}blockGlobalHotkeys(){this.isHotkeysBlocked=!0}unblockGlobalHotkeys(){this.isHotkeysBlocked=!1}updateHotkey(e,t){const s=this.commandKeyMap.get(e);this.commandKeyMap.set(e,t),s&&this.keyMap.set(s,(this.keyMap.get(s)??[]).filter((t=>t===e))),t&&this.keyMap.set(t,[...(this.keyMap.get(t)??[]).filter((t=>t!==e)),e])}dispatch(e){if(this.isHotkeysBlocked)return;const t=this.keyMap.get(e)??[];for(const e of t)if(this.applicationStore.commandCenter.runCommand(e))return}}var It,vt;!function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(It=It||(It={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(vt=vt||(vt={}));const Rt=6e3;var Pt;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(Pt=Pt||(Pt={}));class wt{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class Lt{config;pluginManager;navigator;navigationContextService;notification;blockingAlertInfo;actionAlertInfo;log=new p;documentationService;assistantService;eventService=new Nt;telemetryService=new lt;tracerService=new ht;commandCenter;keyboardShortcutsService;backdropContainerElementID;showBackdrop=!1;TEMPORARY__isLightThemeEnabled=!1;constructor(e,t,s){(0,O.rC)(this,{notification:O.LO,blockingAlertInfo:O.LO,actionAlertInfo:O.LO,TEMPORARY__isLightThemeEnabled:O.LO,backdropContainerElementID:O.LO,showBackdrop:O.LO,setBackdropContainerElementID:O.aD,setShowBackdrop:O.aD,setBlockingAlert:O.aD,setActionAlertInfo:O.aD,setNotification:O.aD,notify:O.aD,notifySuccess:O.aD,notifyWarning:O.aD,notifyIllegalState:O.aD,notifyError:O.aD,TEMPORARY__setIsLightThemeEnabled:O.aD}),this.config=e,this.navigator=t,this.pluginManager=s,this.log.registerPlugins(s.getLoggerPlugins()),this.navigationContextService=new At(this),this.documentationService=new qe(this),this.assistantService=new xt(this),this.telemetryService.registerPlugins(s.getTelemetryServicePlugins()),this.commandCenter=new St(this),this.keyboardShortcutsService=new yt(this),this.tracerService.registerPlugins(s.getTracerServicePlugins()),this.eventService.registerEventNotifierPlugins(s.getEventNotifierPlugins())}TEMPORARY__setIsLightThemeEnabled(e){this.TEMPORARY__isLightThemeEnabled=e}setBackdropContainerElementID(e){this.backdropContainerElementID=e}setShowBackdrop(e){this.showBackdrop=e}setBlockingAlert(e){e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.blockingAlertInfo=e}setActionAlertInfo(e){this.actionAlertInfo&&e&&this.notifyIllegalState("Action alert is stacked: new alert is invoked while another one is being displayed"),e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.actionAlertInfo=e}setNotification(e){this.notification=e}notify(e,t,s){this.setNotification(new wt(Pt.INFO,e,t??[],null===s?void 0:s??Rt))}notifySuccess(e,t,s){this.setNotification(new wt(Pt.SUCCESS,e,t??[],null===s?void 0:s??Rt))}notifyWarning(e,t,s){this.setNotification(new wt(Pt.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??Rt))}notifyIllegalState(e,t,s){this.setNotification(new wt(Pt.ILEGAL_STATE,X(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??Rt))}notifyError(e,t){let s;e instanceof D?s=e.detail:e instanceof Error?s=e.message:(Z(X(e),"Can't display error"),s=e),s&&this.setNotification(new wt(Pt.ERROR,s,t??[],void 0))}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return j(e),this.notifyIllegalState(e.message),t}};alertUnhandledError=e=>{this.log.error(h.create(_e.ILLEGAL_APPLICATION_STATE_OCCURRED),"Encountered unhandled error in component tree",e),this.notifyIllegalState(e.message)};guardUnhandledError=e=>()=>{e().catch(this.alertUnhandledError)};async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.notifyError(e)}))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}}const bt=(0,it.createContext)(void 0),Dt=({children:e,config:t,pluginManager:s})=>{const i=B((0,it.useContext)(rt),"Can't find web application navigator in context"),n=(0,st.fv)((()=>new Lt(t,i,s)));return(0,x.jsx)(bt.Provider,{value:n,children:e})},Mt=()=>B((0,it.useContext)(bt),"Can't find application store in context");class kt{appName;baseUrl;env;documentationUrl;documentationRegistryEntries=[];keyedDocumentationEntries=[];contextualDocEntries=[];appVersion;appVersionBuildTime;appVersionCommitId;constructor(e){var t;this.baseUrl=e.baseUrl,this.appName=K(e.configData.appName,"Can't configure application: 'appName' field is missing or empty"),this.env=K(e.configData.env,"Can't configure application: 'env' field is missing or empty"),this.documentationUrl=e.configData.documentation?.url,this.documentationRegistryEntries=e.configData.documentation?.registry??[],this.keyedDocumentationEntries=Xe(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=B(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=B(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=B(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}}class Ft extends kt{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),z(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=K(e.configData.pure.url,"Can't configure application: 'pure.url' field is missing or empty"),void 0!==e.configData.pure.dynamic&&(this.useDynamicPureServer=Boolean(e.configData.pure.dynamic))}}class jt extends d{loggerPlugins=[];telemetryServicePlugins=[];tracerServicePlugins=[];eventNotifierPlugins=[];applicationPlugins=[];registerLoggerPlugin(e){this.loggerPlugins.push(e)}registerTelemetryServicePlugin(e){this.telemetryServicePlugins.push(e)}registerTracerServicePlugin(e){this.tracerServicePlugins.push(e)}registerEventNotifierPlugin(e){this.eventNotifierPlugins.push(e)}registerApplicationPlugin(e){this.applicationPlugins.push(e)}getLoggerPlugins(){return[...this.loggerPlugins]}getTelemetryServicePlugins(){return[...this.telemetryServicePlugins]}getTracerServicePlugins(){return[...this.tracerServicePlugins]}getEventNotifierPlugins(){return[...this.eventNotifierPlugins]}getApplicationPlugins(){return[...this.applicationPlugins]}}class Ut extends jt{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new Ut}registerPureProtocolProcessorPlugin(e){this.pureProtocolProcessorPlugins.push(e)}registerPureGraphManagerPlugin(e){this.pureGraphManagerPlugins.push(e)}registerPureGraphPlugin(e){this.pureGraphPlugins.push(e)}getPureGraphManagerPlugins(){return[...this.pureGraphManagerPlugins]}getPureProtocolProcessorPlugins(){return[...this.pureProtocolProcessorPlugins]}getPureGraphPlugins(){return[...this.pureGraphPlugins]}}const Vt=JSON.parse('{"i8":"7.1.11","Rw":{"NA":"@finos/legend-graph-manager-preset-dsl-diagram","zE":"@finos/legend-pure-protocol-processor-plugin-dsl-diagram","LW":"@finos/legend-pure-graph-manager-plugin-dsl-diagram","f1":"@finos/legend-pure-graph-plugin-dsl-diagram"}}');class Gt extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const zt=e=>t=>(0,O.bi)(t)?t:e(t),Bt=e=>(t,s)=>(0,O.bi)(t)?t:e(t,s),$t=e=>{(0,O.rC)(e,{_isDeleted:O.LO,_isDisposed:O.LO,name:O.LO,package:O.LO,isDeleted:O.Fl,path:O.Fl,_elementHashCode:O.Fl,hashCode:O.Fl,setIsDeleted:O.aD,dispose:O.aD})},Ht=zt((e=>(0,O.rC)(e,{value:O.LO,valueForSerialization:O.Fl})));var Yt=s(34485),Wt=s(3096);const Kt=e=>Yt.sha1().update(e).digest("hex"),Zt=e=>Kt(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Kt(e):e.hashCode)).join(","));var Xt,qt;(qt=Xt=Xt||(Xt={})).PACKAGE="PACKAGE",qt.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",qt.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",qt.PROFILE="PROFILE",qt.TAG_POINTER="TAG_POINTER",qt.STEREOTYPE_POINTER="STEREOTYPE_POINTER",qt.TAGGED_VALUE="TAGGED_VALUE",qt.ENUMERATION="ENUMERATION",qt.ENUM_VALUE="ENUM_VALUE",qt.CLASS="CLASS",qt.PROPERTY="PROPERTY",qt.PROPERTY_POINTER="PROPERTY_POINTER",qt.MULTIPLICITY="MULTIPLICITY",qt.CONSTRAINT="CONSTRAINT",qt.DERIVED_PROPERTY="DERIVED_PROPERTY",qt.ASSOCIATION="ASSOCIATION",qt.FUNCTION="FUNCTION",qt.MEASURE="MEASURE",qt.UNIT="UNIT",qt.RUNTIME="RUNTIME",qt.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",qt.ENGINE_RUNTIME="ENGINE_RUNTIME",qt.LEGACY_RUNTIME="LEGACY_RUNTIME",qt.RUNTIME_POINTER="RUNTIME_POINTER",qt.STORE_CONNECTIONS="STORE_CONNECTIONS",qt.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",qt.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",qt.CONNECTION_POINTER="CONNECTION_POINTER",qt.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",qt.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",qt.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",qt.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",qt.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",qt.FLAT_DATA="FLAT_DATA",qt.FLAT_DATA_SECTION="FLAT_DATA_SECTION",qt.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",qt.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",qt.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",qt.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",qt.FLAT_DATA_STRING="FLAT_DATA_STRING",qt.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",qt.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",qt.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",qt.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",qt.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",qt.FLAT_DATA_DATE="FLAT_DATA_DATE",qt.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",qt.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",qt.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",qt.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",qt.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",qt.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",qt.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",qt.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER",qt.DATABASE="DATABASE",qt.DATABASE_SCHEMA="DATABASE_SCHEMA",qt.DATABASE_JOIN="DATABASE_JOIN",qt.DATABASE_FILTER="DATABASE_FILTER",qt.DATBASE_VIEW="DATBASE_VIEW",qt.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",qt.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",qt.RELATIONAL="RELATIONAL",qt.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",qt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",qt.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",qt.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",qt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",qt.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",qt.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",qt.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",qt.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",qt.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",qt.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",qt.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",qt.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",qt.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",qt.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",qt.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",qt.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",qt.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",qt.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",qt.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",qt.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",qt.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",qt.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",qt.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",qt.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",qt.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",qt.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",qt.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",qt.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",qt.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",qt.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",qt.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",qt.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",qt.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",qt.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",qt.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",qt.BUSINESS_MILESTONING="BUSINESS_MILESTONING",qt.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",qt.PROCESSING_MILESTONING="PROCESSING_MILESTONING",qt.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",qt.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",qt.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",qt.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",qt.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",qt.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",qt.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",qt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",qt.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",qt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",qt.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",qt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",qt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",qt.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",qt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",qt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",qt.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",qt.SCHEMA_MAPPER="SCHEMA_MAPPER",qt.TABLE_MAPPER="TABLE_MAPPER",qt.MAPPING="MAPPING",qt.MAPPING_INCLUDE="MAPPING_INCLUDE",qt.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",qt.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",qt.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",qt.ENUMERATION_MAPPING="ENUMERATION_MAPPING",qt.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",qt.SET_IMPLEMENTATION="SET_IMPLEMENTATION",qt.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",qt.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",qt.PROPERTY_MAPPING="PROPERTY_MAPPING",qt.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",qt.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",qt.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",qt.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",qt.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",qt.MAPPING_TEST="MAPPING_TEST",qt.STORE_TEST_DATA="STORE_TEST_DATA",qt.INPUT_DATA="INPUT_DATA",qt.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",qt.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",qt.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",qt.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",qt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",qt.FILTER_MAPPING="FILTER_MAPPING",qt.COLUMN_MAPPING="COLUMN_MAPPING",qt.GROUP_BY_MAPPING="GROUP_BY_MAPPING",qt.SERVICE="SERVICE",qt.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",qt.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",qt.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",qt.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",qt.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",qt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",qt.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",qt.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",qt.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",qt.SERVICE_TEST_DATA="SERVICE_TEST_DATA",qt.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",qt.SERVICE_TEST="SERVICE_TEST",qt.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",qt.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",qt.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",qt.GENERATION_TREE="GENERATION_TREE",qt.GENERATION_TREE_NODE="GENERATION_TREE_NODE",qt.FILE_GENERATION="FILE_GENERATION",qt.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",qt.SECTION_INDEX="SECTION_INDEX",qt.SECTION="SECTION",qt.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",qt.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",qt.RAW_LAMBDA="RAW_LAMBDA",qt.RAW_VARIABLE="RAW_VARIABLE",qt.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",qt.BINDING_TRANSFORMER="BINDING_TRANSFORMER",qt.ASSERT_FAIL="ASSERT_FAIL",qt.ASSERT_PASS="ASSERT_PASS",qt.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",qt.EQUAL_TO="EQUAL_TO",qt.EQUAL_TO_JSON="EQUAL_TO_JSON",qt.EQUAL_TO_TDS="EQUAL_TO_TDS",qt.TEST_RESULT="TEST_RESULT",qt.TEST_ERROR="TEST_ERROR",qt.TEST_FAILED="TEST_FAILED",qt.TEST_PASSED="TEST_PASSED",qt.ATOMIC_TEST_ID="ATOMIC_TEST_ID",qt.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",qt.MODEL_STORE_DATA="MODEL_STORE_DATA",qt.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",qt.DATA_ELEMENT="DATA_ELEMENT",qt.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",qt.RELATIONAL_TDS="RELATIONAL_TDS",qt.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",qt.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",qt.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",qt.EXPRESSION="EXPRESSION",qt.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",qt.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",qt.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",qt.INSTANCE_VALUE="INSTANCE_VALUE",qt.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",qt.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",qt.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",qt.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",qt.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",qt.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",qt.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",qt.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",qt.FUNCTION_TYPE="FUNCTION_TYPE",qt.LAMBDA_FUNCTION="LAMBDA_FUNCTION",qt.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",qt.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",qt.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",qt.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",qt.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",qt.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",qt.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE";const Jt=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},Z(q(t=e),"Can't hash non-object value"),Wt(t,s);var t,s},Qt=(e,t)=>Zt([e?Jt(e):"",t?Jt(t):""]),es=(e,t)=>[Xt.PACKAGEABLE_ELEMENT_POINTER,e,t].map(Kt).join(",");class ts{stereotypes=[];taggedValues=[]}class ss extends ts{name}class is extends ss{_UUID=(0,a.Z)();_isDeleted=!1;_isDisposed=!1;package;constructor(e){super(),this.name=e}get isDeleted(){return this._isDeleted}setIsDeleted(e){this._isDeleted=e}get path(){if(!this.package)return this.name;const e=this.package.path;return e?`${e}::${this.name}`:this.name}dispose(){this._isDisposed=!0;try{this.hashCode}catch{}}get _elementHashCode(){return Zt([Xt.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new k(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class ns extends is{}class as extends ns{_subclasses=[];_generatedMilestonedProperties=[];properties=[];propertiesFromAssociations=[];derivedProperties=[];generalizations=[];constraints=[];dispose(){super.dispose(),this._subclasses=[],this.generalizations.forEach((e=>{const t=e.value.rawType;t._isDisposed||(t._subclasses=t._subclasses.filter((e=>!e._isDisposed)))}))}get _elementHashCode(){return Zt([Xt.CLASS,this.path,Zt(this.properties),Zt(this.derivedProperties),Zt(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),Zt(this.constraints),Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class rs extends ns{}class os extends rs{values=[];get _elementHashCode(){return Zt([Xt.ENUMERATION,this.path,Zt(this.values),Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class ls extends rs{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return Zt([Xt.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new F}}class cs extends ns{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return Zt([Xt.MEASURE,this.path,this.canonicalUnit??"",Zt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class ds extends is{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class hs{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return Zt([Xt.SECTION,this.parserName,Zt(this.elements.map((e=>e.valueForSerialization??"")))])}}class us extends hs{imports=[];get hashCode(){return Zt([Xt.IMPORT_AWARE_CODE_SECTION,super.hashCode,Zt(this.imports.map((e=>e.valueForSerialization??"")))])}}class ps extends hs{get hashCode(){return Zt([Xt.DEFAULT_CODE_SECTION,super.hashCode])}}class _s{_UUID=(0,a.Z)()}class ms extends _s{ownerReference;constructor(e){super(),this.ownerReference=e}}class gs extends _s{value;constructor(e){super(),this.value=e}}class Es extends gs{constructor(e){super(e)}static create(e){return new Es(e)}get valueForSerialization(){return this.value.path}}const fs=zt((e=>(0,O.rC)(e,{name:O.LO,value:O.LO.ref,hashCode:O.Fl}))),Ts=zt((e=>($t(e),(0,O.rC)(e,{type:O.LO,generationOutputPath:O.LO,scopeElements:O.LO,configurationProperties:O.LO,_elementHashCode:O.KG}),e.scopeElements.forEach((e=>{e instanceof gs&&Ht(e)})),e.configurationProperties.forEach(fs),e))),Cs=zt((e=>((0,O.rC)(e,{id:O.LO,hashCode:O.Fl}),Ht(e.generationElement),e))),xs=zt((e=>($t(e),(0,O.rC)(e,{generationNodes:O.LO,fileGenerations:O.LO,_elementHashCode:O.KG}),e.generationNodes.forEach(Cs),e.fileGenerations.forEach(Ht),e)));var Ns=s(67295),Os=s(72531);const As=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,Ss=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],ys=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,Ns.P)(e,void 0,s);return z(i,"Can't stringify lossless JSON value"),i})((0,Os.Q)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};class Is{}class vs extends Is{expectedOutput;constructor(e){super(),this.expectedOutput=ys(e)}get hashCode(){return Zt([Xt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class Rs{}class Ps extends Rs{mappings=[];connections=[];get hashCode(){return Zt([Xt.ENGINE_RUNTIME,Zt(this.mappings.map((e=>es(Pe.MAPPING,e.valueForSerialization??"")))),Zt(this.connections.filter((e=>e.storeConnections.length)))])}}class ws extends Rs{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return Zt([Xt.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class Ls{}class bs extends Ls{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return Zt([Xt.FLAT_DATA_INPUT_DATA,es(Pe.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var Ds,Ms,ks;(ks=Ds=Ds||(Ds={})).JSON="JSON",ks.XML="XML";class Fs extends Ls{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===Ds.JSON?ys(s):s}get hashCode(){return Zt([Xt.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(Ms=Ms||(Ms={}));class js extends Ls{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return Zt([Xt.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const Us=zt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),Ht(e.type),e))),Vs=zt((e=>(0,O.rC)(e,{body:O.LO.ref,parameters:O.LO.ref,hashCode:O.Fl}))),Gs=zt((e=>((0,O.rC)(e,{name:O.LO,multiplicity:O.LO,hashCode:O.Fl}),Ht(e.type),e)));class zs{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){Vs(e)}visit_RawVariableExpression(e){Gs(e)}visit_RawPrimitiveInstanceValue(e){Us(e)}}Bt(((e,t)=>(e.accept_RawValueSpecificationVisitor(new zs(t)),e)));class Bs{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class $s extends Bs{trueString;falseString;get hashCode(){return Zt([Xt.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class Hs extends Bs{get hashCode(){return Zt([Xt.FLAT_DATA_STRING])}}class Ys extends Bs{get hashCode(){return Zt([Xt.FLAT_DATA_NUMBER])}}class Ws extends Bs{dateFormat;timeZone;get hashCode(){return Zt([Xt.FLAT_DATA_DATE,this.dateFormat?Zt(this.dateFormat):"",this.timeZone??""])}}class Ks extends Bs{fields=[];get hashCode(){return Zt([Xt.FLAT_DATA_RECORD_TYPE,Zt(this.fields)])}}const Zs=Bt(((e,t)=>(Sr(e,t),(0,O.rC)(e,{flatData:O.LO,sectionName:O.LO,hashCode:O.Fl}),e))),Xs=zt((e=>((0,O.rC)(e,{label:O.LO,flatDataDataType:O.LO,optional:O.LO,address:O.LO,hashCode:O.Fl}),(e=>{e instanceof $s?(0,O.rC)(e,{trueString:O.LO,falseString:O.LO,hashCode:O.Fl}):e instanceof Hs||e instanceof Ys?(0,O.rC)(e,{hashCode:O.Fl}):e instanceof Ws?(0,O.rC)(e,{dateFormat:O.LO,timeZone:O.LO,hashCode:O.Fl}):e instanceof Ks&&zt(qs)(e)})(e.flatDataDataType),e)));function qs(e){return(0,O.rC)(e,{fields:O.LO,hashCode:O.Fl}),e.fields.forEach(Xs),e}zt(qs);const Js=zt(qs),Qs=zt((e=>((0,O.rC)(e,{name:O.LO,value:O.LO,hashCode:O.Fl}),e))),ei=zt((e=>((0,O.rC)(e,{driverId:O.LO,name:O.LO,sectionProperties:O.LO,recordType:O.LO,hashCode:O.Fl}),e.sectionProperties.forEach(Qs),e.recordType&&Js(e.recordType),e))),ti=(zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Ht(e.ownerReference),e))),zt((e=>($t(e),(0,O.rC)(e,{sections:O.LO,_elementHashCode:O.KG}),e.sections.forEach(ei),e)))),si=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),ii=Bt(((e,t)=>(br(e,t),(0,O.rC)(e,{filter:O.LO,hashCode:O.Fl}),si(e.sourceRootRecordType),e.filter&&Vs(e.filter),e))),ni=Bt(((e,t)=>(Sr(e,t),br(e,t),(0,O.rC)(e,{rootInstanceSetImplementation:O.LO,hashCode:O.Fl}),e))),ai=Bt(((e,t)=>(Sr(e,t),(0,O.rC)(e,{transformer:O.LO,transform:O.LO,hashCode:O.Fl}),Vs(e.transform),e))),ri=zt((e=>((0,O.rC)(e,{data:O.LO,hashCode:O.Fl}),Ht(e.sourceFlatData),e))),oi=zt((e=>((0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),e)));class li{}class ci extends li{serverPrincipal;get hashCode(){return Zt([Xt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class di extends li{get hashCode(){return Zt([Xt.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class hi extends li{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return Zt([Xt.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class ui extends li{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return Zt([Xt.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class pi extends li{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return Zt([Xt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class _i extends li{get hashCode(){return Zt([Xt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class mi extends li{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return Zt([Xt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,Zt(this.additionalGcpScopes)])}}class gi extends li{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return Zt([Xt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class Ei extends li{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return Zt([Xt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class fi{}class Ti extends fi{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return Zt([Xt.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class Ci extends fi{hostname;port;protocol;httpPath;constructor(e,t,s,i){super(),this.hostname=e,this.port=t,this.protocol=s,this.httpPath=i}get hashCode(){return Zt([Xt.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class xi extends fi{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return Zt([Xt.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class Ni extends fi{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return Zt([Xt.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",Zt(this.testDataSetupSqls)])}}class Oi extends fi{accountName;region;warehouseName;databaseName;cloudType;quotedIdentifiersIgnoreCase;proxyHost;proxyPort;nonProxyHosts;organization;accountType;role;constructor(e,t,s,i){super(),this.region=t,this.warehouseName=s,this.databaseName=i,this.accountName=e}get hashCode(){return Zt([Xt.SNOWFLAKE_DATASOURCE_SPECIFICATION,this.accountName,this.region,this.warehouseName,this.databaseName,this.cloudType??"",this.proxyHost??"",this.proxyPort??"",this.nonProxyHosts??"",this.organization??"",this.accountType??"",this.role??"",this.quotedIdentifiersIgnoreCase?.toString()??""])}}class Ai extends fi{clusterID;databaseName;host;port;region;endpointURL;constructor(e,t,s,i,n,a){super(),this.clusterID=n,this.region=a,this.host=i,this.databaseName=e,this.endpointURL=t,this.port=s}get hashCode(){return Zt([Xt.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class Si extends fi{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return Zt([Xt.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class yi{_UUID=(0,a.Z)()}class Ii extends yi{mappers=[];get hashCode(){return Zt([Xt.MAPPER_POST_PROCESSOR,Zt(this.mappers)])}}const vi="{target}",Ri="default";class Pi{}class wi extends Pi{}class Li extends wi{}class bi extends Li{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return Zt([Xt.RELATIONAL_OPERATION_DYNA_FUNC,this.name,Zt(this.parameters)])}}var Di;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(Di=Di||(Di={}));const Mi=e=>[e].concat(e.children.length?Mi(e.children[0]):[]);class ki extends Pi{relationalOperationElement;joinTreeNode;get hashCode(){return Zt([Xt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,Zt(this.joinTreeNode?Mi(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class Fi extends Pi{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new F}}class ji extends Pi{alias;column;columnName;get hashCode(){return Zt([Xt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?vi:this.alias.name,this.column.value.name])}}class Ui extends Pi{value;constructor(e){super(),this.value=e}get hashCode(){return Zt([Xt.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class Vi extends Pi{values=[];get hashCode(){return Zt([Xt.RELATIONAL_OPERATION_LITERAL_LIST,Zt(this.values)])}}class Gi extends Pi{owner;name;type;nullable;get hashCode(){return Zt([Xt.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class zi{}class Bi extends zi{infinityDate}class $i{}class Hi extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_BIGINT])}}class Yi extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_SMALLINT])}}class Wi extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_TINYINT])}}class Ki extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_INTEGER])}}class Zi extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_FLOAT])}}class Xi extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_DOUBLE])}}class qi extends $i{size;constructor(e){super(),this.size=e}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class Ji extends $i{size;constructor(e){super(),this.size=e}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class Qi extends $i{size;constructor(e){super(),this.size=e}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class en extends $i{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class tn extends $i{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class sn extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_TIMESTAMP])}}class nn extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_VARCHAR])}}class an extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_BIT])}}class rn extends $i{size;constructor(e){super(),this.size=e}get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class on extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_REAL])}}class ln extends $i{get hashCode(){return Zt([Xt.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class cn extends ms{ownerReference;constructor(e){super(e),this.ownerReference=e}}class dn extends cn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Xt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Kt).join(",")}get selfJoinPointerHashCode(){return[Xt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Ri,vi].map(Kt).join(",")}}class hn extends cn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Xt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Kt).join(",")}get selfJoinPointerHashCode(){return[Xt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Ri,vi].map(Kt).join(",")}}class un{}class pn extends un{_UUID=(0,a.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return Zt([this.from,this.to])}}class _n extends pn{get hashCode(){return Zt([super.hashCode,Xt.SCHEMA_MAPPER])}}class mn extends pn{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return Zt([super.hashCode,Xt.TABLE_MAPPER,this.schema])}}const gn=zt((e=>((0,O.rC)(e,{packageableElementIncludes:O.LO,packageableElementExcludes:O.LO,hashCode:O.Fl}),e.packageableElementIncludes.forEach(Ht),e.packageableElementExcludes.forEach(Ht),e))),En=(zt((e=>(fr(e),(0,O.rC)(e,{schemaSet:O.LO,schemaId:O.LO,contentType:O.LO,modelUnit:O.LO,_elementHashCode:O.KG}),e.schemaSet&&Ht(e.schemaSet),gn(e.modelUnit),e))),zt((e=>((0,O.rC)(e,{binding:O.LO,hashCode:O.Fl}),Ht(e.binding),e)))),fn=zt((e=>((0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),e))),Tn=(zt((e=>(qr(e),(0,O.rC)(e,{externalSource:O.LO,hashCode:O.Fl}),fn(e.externalSource),e))),zt((e=>(0,O.rC)(e,{id:O.LO,location:O.LO,content:O.LO,hashCode:O.Fl})))),Cn=(zt((e=>($t(e),(0,O.rC)(e,{format:O.LO,schemas:O.LO,_elementHashCode:O.KG}),e.schemas.forEach(Tn),e))),zt((e=>e instanceof Hi||e instanceof Yi||e instanceof Wi||e instanceof Ki||e instanceof Zi||e instanceof Xi||e instanceof sn||e instanceof Date||e instanceof nn||e instanceof an||e instanceof on||e instanceof ln?(0,O.rC)(e,{hashCode:O.Fl}):e instanceof qi||e instanceof Ji||e instanceof Qi||e instanceof rn?(0,O.rC)(e,{size:O.LO,hashCode:O.Fl}):e instanceof en||e instanceof tn?(0,O.rC)(e,{precision:O.LO,scale:O.LO,hashCode:O.Fl}):e))),xn=zt((e=>((0,O.rC)(e,{name:O.LO,type:O.LO,nullable:O.LO,hashCode:O.Fl}),Cn(e.type),e))),Nn=zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl,selfJoinPointerHashCode:O.Fl}),Ht(e.ownerReference),e))),On=zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl,selfJoinPointerHashCode:O.Fl}),Ht(e.ownerReference),e))),An=zt((e=>((0,O.rC)(e,{relation:O.LO,name:O.LO,database:O.LO,isSelfJoinTarget:O.LO}),(e=>{e instanceof hn?On(e):e instanceof dn&&Nn(e)})(e.relation),e))),Sn=zt((e=>((0,O.rC)(e,{name:O.LO,parameters:O.LO,hashCode:O.Fl}),e.parameters.forEach(bn),e))),yn=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),In=zt((e=>((0,O.rC)(e,{alias:O.LO,column:O.LO,columnName:O.LO,hashCode:O.Fl}),An(e.alias),yn(e.column),e))),vn=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),Rn=zt((e=>((0,O.rC)(e,{alias:O.LO,children:O.LO,joinType:O.LO,hashCode:O.Fl}),e.alias&&An(e.alias),e.children.forEach(Rn),vn(e.join),e))),Pn=zt((e=>((0,O.rC)(e,{relationalOperationElement:O.LO,joinTreeNode:O.LO,hashCode:O.Fl}),e.relationalOperationElement&&bn(e.relationalOperationElement),e.joinTreeNode&&Rn(e.joinTreeNode),e))),wn=zt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),e.value instanceof Pi&&bn(e.value),e))),Ln=zt((e=>((0,O.rC)(e,{values:O.LO,hashCode:O.Fl}),e.values.forEach(wn),e)));function bn(e){return e instanceof bi?Sn(e):e instanceof Fi?An(e):e instanceof ji?In(e):e instanceof Gi?xn(e):e instanceof Ui?wn(e):e instanceof Vi?Ln(e):e instanceof ki?Pn(e):e}const Dn=zt((e=>e)),Mn=Bt(((e,t)=>{if(e instanceof Bi)return Dn(e);const s=t.plugins.flatMap((e=>e.getExtraMilestoningObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})),kn=zt((e=>((0,O.rC)(e,{columnName:O.LO,relationalOperationElement:O.LO,hashCode:O.Fl}),bn(e.relationalOperationElement),e))),Fn=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),jn=zt((e=>((0,O.rC)(e,{joinTreeNode:O.LO,database:O.LO,filterName:O.LO,hashCode:O.Fl}),e.joinTreeNode&&Rn(e.joinTreeNode),Fn(e.filter),e))),Un=zt((e=>((0,O.rC)(e,{columns:O.LO}),e.columns.forEach(bn),e))),Vn=e=>{(0,O.rC)(e,{columns:O.LO,name:O.LO})},Gn=Bt(((e,t)=>(Vn(e),(0,O.rC)(e,{primaryKey:O.LO,hashCode:O.Fl}),e.primaryKey.forEach(xn),e.milestoning.forEach((e=>Mn(e,t))),e))),zn=Bt(((e,t)=>(Vn(e),(0,O.rC)(e,{primaryKey:O.LO,columnMappings:O.LO,filter:O.LO,distinct:O.LO,groupBy:O.LO,hashCode:O.Fl}),e.primaryKey.forEach(xn),e.columnMappings.forEach(kn),e.filter&&jn(e.filter),e.groupBy&&Un(e.groupBy),e))),Bn=Bt(((e,t)=>((0,O.rC)(e,{name:O.LO,tables:O.LO,views:O.LO,hashCode:O.Fl}),e.tables.forEach((e=>Gn(e,t))),e.views.forEach((e=>zn(e,t))),e))),$n=zt((e=>((0,O.rC)(e,{name:O.LO,operation:O.LO,hashCode:O.Fl}),bn(e.operation),e))),Hn=zt((e=>((0,O.rC)(e,{name:O.LO,target:O.LO,aliases:O.LO,operation:O.LO,hashCode:O.Fl}),e.target&&An(e.target),bn(e.operation),e))),Yn=Bt(((e,t)=>($t(e),(0,O.rC)(e,{schemas:O.LO,joins:O.LO,filters:O.LO,_elementHashCode:O.KG}),e.schemas.forEach((e=>Bn(e,t))),e.joins.forEach(Hn),e.filters.forEach($n),e))),Wn=Bt(((e,t)=>(Sr(e,t),(0,O.rC)(e,{transformer:O.LO,relationalOperation:O.LO.ref,bindingTransformer:O.LO,hashCode:O.Fl}),e.bindingTransformer&&En(e.bindingTransformer),e))),Kn=(e,t)=>(br(e,t),Sr(e,t),(0,O.rC)(e,{id:O.LO,rootInstanceSetImplementation:O.LO,primaryKey:O.LO}),e.primaryKey.forEach(bn),e),Zn=Bt(Kn),Xn=Bt(((e,t)=>(Kn(e,t),(0,O.rC)(e,{inlineSetImplementation:O.LO}),Vr(e.inlineSetImplementation,t),e))),qn=Bt(((e,t)=>(Kn(e,t),(0,O.rC)(e,{otherwisePropertyMapping:O.LO,hashCode:O.Fl}),vr(e.otherwisePropertyMapping,t),e))),Jn=Bt(((e,t)=>(br(e,t),(0,O.rC)(e,{primaryKey:O.LO}),e.primaryKey.forEach(bn),e))),Qn=Bt(((e,t)=>(br(e,t),(0,O.rC)(e,{columnMappings:O.LO,filter:O.LO,distinct:O.LO,groupBy:O.LO,mainTableAlias:O.LO,superSetImplementationId:O.LO,hashCode:O.Fl}),e.columnMappings.forEach(kn),e.filter&&jn(e.filter),e.groupBy&&Un(e.groupBy),e.mainTableAlias&&An(e.mainTableAlias),e))),ea=zt((e=>((0,O.rC)(e,{data:O.LO,inputType:O.LO,hashCode:O.Fl}),Ht(e.database),e))),ta=zt((e=>(0,O.rC)(e,{host:O.LO,port:O.LO,databaseName:O.LO,hashCode:O.Fl}))),sa=zt((e=>(0,O.rC)(e,{hostname:O.LO,port:O.LO,protocol:O.LO,httpPath:O.LO,hashCode:O.Fl}))),ia=zt((e=>(0,O.rC)(e,{databaseName:O.LO,directory:O.LO,autoServerMode:O.LO,hashCode:O.Fl}))),na=zt((e=>(0,O.rC)(e,{testDataSetupCsv:O.LO,testDataSetupSqls:O.LO,hashCode:O.Fl}))),aa=zt((e=>(0,O.rC)(e,{accountName:O.LO,region:O.LO,warehouseName:O.LO,databaseName:O.LO,cloudType:O.LO,quotedIdentifiersIgnoreCase:O.LO,proxyHost:O.LO,proxyPort:O.LO,nonProxyHosts:O.LO,organization:O.LO,accountType:O.LO,role:O.LO,hashCode:O.Fl}))),ra=zt((e=>(0,O.rC)(e,{databaseName:O.LO,endpointURL:O.LO,port:O.LO,region:O.LO,clusterID:O.LO,host:O.LO,hashCode:O.Fl}))),oa=zt((e=>(0,O.rC)(e,{projectId:O.LO,defaultDataset:O.LO,proxyHost:O.LO,proxyPort:O.LO,hashCode:O.Fl}))),la=zt((e=>(0,O.rC)(e,{serverPrincipal:O.LO,hashCode:O.Fl}))),ca=zt((e=>(0,O.rC)(e,{hashCode:O.Fl}))),da=zt((e=>(0,O.rC)(e,{apiToken:O.LO,hashCode:O.Fl}))),ha=zt((e=>(0,O.rC)(e,{oauthKey:O.LO,scopeName:O.LO,hashCode:O.Fl}))),ua=zt((e=>(0,O.rC)(e,{privateKeyVaultReference:O.LO,passPhraseVaultReference:O.LO,publicUserName:O.LO,hashCode:O.Fl}))),pa=zt((e=>(0,O.rC)(e,{hashCode:O.Fl}))),_a=zt((e=>(0,O.rC)(e,{hashCode:O.Fl,userNameVaultReference:O.LO,passwordVaultReference:O.LO,baseVaultReference:O.LO}))),ma=zt((e=>(0,O.rC)(e,{hashCode:O.Fl,serviceAccountEmail:O.LO,additionalGcpScopes:O.LO}))),ga=zt((e=>(0,O.rC)(e,{hashCode:O.Fl,vaultReference:O.LO}))),Ea=e=>{(0,O.rC)(e,{from:O.LO,to:O.LO,hashCode:O.Fl})},fa=zt((e=>(Ea(e),e))),Ta=zt((e=>(Ea(e),(0,O.rC)(e,{schema:O.LO}),fa(e.schema),e))),Ca=Bt(((e,t)=>((e=>{qr(e),(0,O.rC)(e,{type:O.LO,timeZone:O.LO,quoteIdentifiers:O.LO})})(e),(0,O.rC)(e,{datasourceSpecification:O.LO,authenticationStrategy:O.LO,postProcessors:O.LO,hashCode:O.Fl}),((e,t)=>{if(e instanceof Ti)return ta(e);if(e instanceof Ci)return sa(e);if(e instanceof xi)return ia(e);if(e instanceof Ni)return na(e);if(e instanceof Oi)return aa(e);if(e instanceof Ai)return ra(e);if(e instanceof Si)return oa(e);const s=t.plugins.flatMap((e=>e.getExtraDatasourceSpecificationObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.datasourceSpecification,t),((e,t)=>{if(e instanceof ci)return la(e);if(e instanceof di)return ca(e);if(e instanceof hi)return da(e);if(e instanceof ui)return ha(e);if(e instanceof pi)return ua(e);if(e instanceof _i)return pa(e);if(e instanceof gi)return _a(e);if(e instanceof mi)return ma(e);if(e instanceof Ei)return ga(e);const s=t.plugins.flatMap((e=>e.getExtraAuthenticationStrategyObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.authenticationStrategy,t),e.postProcessors.forEach((e=>{((e,t)=>{if(e instanceof Ii)return(e=>((e=>{(0,O.rC)(e,{hashCode:O.Fl})})(e),(0,O.rC)(e,{mappers:O.LO}),e.mappers.forEach((e=>{(e=>{e instanceof _n?fa(e):e instanceof mn&&Ta(e)})(e)})),e))(e);const s=t.plugins.flatMap((e=>e.getExtraPostProcessorObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e,t)})),e)));class xa{id}class Na extends xa{__parent;assertions=[]}class Oa extends xa{__parent;tests=[]}class Aa extends Na{serializationFormat;parameters=[];keys=[];get hashCode(){return Zt([Xt.SERVICE_TEST,this.id,Zt(this.assertions),Zt(this.parameters),Zt(this.keys),this.serializationFormat??""])}}class Sa extends Na{query;get hashCode(){return Zt([Xt.MAPPING_TEST,this.query,this.id,Zt(this.assertions)])}}class ya extends Oa{storeTestDatas=[];get hashCode(){return Zt([Xt.MAPPING_TEST_SUITE,Zt(this.storeTestDatas),this.id,Zt(this.tests)])}}class Ia extends Oa{testData;get hashCode(){return Zt([Xt.SERVICE_TEST_SUITE,this.id,Zt(this.tests),this.testData])}}class va{id;parentTest}class Ra extends va{expected;get hashCode(){return Zt([Xt.EQUAL_TO,this.id,Jt(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class Pa extends va{expected;get hashCode(){return Zt([Xt.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class wa extends va{expected;get hashCode(){return Zt([Xt.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class La{}class ba extends La{dataElement;get hashCode(){return Zt([Xt.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class Da extends La{contentType;data;get hashCode(){return Zt([Xt.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class Ma extends La{instances;get hashCode(){return Zt([Xt.MODEL_STORE_DATA,Zt(Array.from(this.instances.keys()).map((e=>e.path))),Jt(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class ka extends La{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return Zt([Xt.RELATIONAL_CSV_DATA_TABLE,Zt(this.tables)])}}const Fa=zt((e=>((0,O.rC)(e,{contentType:O.LO,data:O.LO,hashCode:O.Fl}),e))),ja=zt((e=>((0,O.rC)(e,{dataElement:O.LO,hashCode:O.Fl}),e))),Ua=zt((e=>((0,O.rC)(e,{instances:O.LO,hashCode:O.Fl}),e))),Va=zt((e=>((0,O.rC)(e,{values:O.LO,table:O.LO,schema:O.LO,hashCode:O.Fl}),e))),Ga=zt((e=>((0,O.rC)(e,{tables:O.LO,hashCode:O.Fl}),e.tables.forEach(Va),e)));function za(e,t){if(e instanceof ba)return ja(e);if(e instanceof Da)return Fa(e);if(e instanceof Ma)return Ua(e);if(e instanceof ka)return Ga(e);const s=t.plugins.flatMap((e=>e.getExtraEmbeddedDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}const Ba=Bt(((e,t)=>($t(e),(0,O.rC)(e,{stereotypes:O.LO,taggedValues:O.LO,data:O.LO,_elementHashCode:O.KG}),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),za(e.data,t),e)));class $a{}class Ha extends $a{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return Zt([Xt.SERVICE_PURE_EXECUTION,this.func])}}class Ya extends Ha{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return Zt([Xt.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class Wa extends Ha{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return Zt([Xt.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,Zt(this.executionParameters)])}}class Ka{_OWNER;constructor(e){this._OWNER=e}}class Za extends Ka{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return Zt([Xt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,Zt(this.asserts)])}}class Xa extends Ka{tests=[];get hashCode(){return Zt([Xt.SERVICE_LEGACY_MULTI_EXECUTION_TEST,Zt(this.tests)])}}const qa=Bt(((e,t)=>((0,O.rC)(e,{connectionId:O.LO,testData:O.LO,hashCode:O.Fl}),za(e.testData,t),e))),Ja=zt((e=>((0,O.rC)(e,{name:O.LO,value:O.LO.ref,hashCode:O.Fl}),e))),Qa=zt((e=>((0,O.rC)(e,{assertion:O.LO,hashCode:O.Fl,id:O.LO}),Vs(e.assertion),e))),er=zt((e=>((0,O.rC)(e,{assertions:O.LO,description:O.LO,parameters:O.LO,hashCode:O.Fl}),e.assertions.forEach(Qa),e.parameters.forEach(Vs),e))),tr=Bt(((e,t)=>((0,O.rC)(e,{connectionsTestData:O.LO,hashCode:O.Fl}),e.connectionsTestData.forEach((e=>qa(e,t))),e))),sr=zt((e=>((0,O.rC)(e,{id:O.LO,serializationFormat:O.LO,assertions:O.LO,parameters:O.LO,keys:O.LO,hashCode:O.Fl}),e.parameters.forEach(Ja),e.assertions.forEach(Er),e))),ir=Bt(((e,t)=>((0,O.rC)(e,{id:O.LO,tests:O.LO,testData:O.LO,hashCode:O.Fl}),e.tests.forEach((e=>gr(e,t))),tr(e.testData,t),e))),nr=zt((e=>((0,O.rC)(e,{parametersValues:O.LO,assert:O.LO,singleExecutionTestParent:O.LO,hashCode:O.Fl}),Vs(e.assert),e))),ar=zt((e=>((0,O.rC)(e,{data:O.LO,asserts:O.LO,hashCode:O.Fl}),e.asserts.forEach(nr),e))),rr=zt((e=>(ar(e),(0,O.rC)(e,{key:O.LO}),e))),or=zt((e=>((0,O.rC)(e,{tests:O.LO,hashCode:O.Fl}),e.tests.forEach(rr),e))),lr=e=>{(0,O.rC)(e,{func:O.LO}),Vs(e.func)},cr=Bt(((e,t)=>(lr(e),(0,O.rC)(e,{runtime:O.LO,hashCode:O.Fl}),e.mapping&&Ht(e.mapping),e.runtime&&co(e.runtime,t),e))),dr=Bt(((e,t)=>((0,O.rC)(e,{key:O.LO,runtime:O.LO,hashCode:O.Fl}),Ht(e.mapping),co(e.runtime,t),e))),hr=Bt(((e,t)=>(lr(e),(0,O.rC)(e,{executionKey:O.LO,executionParameters:O.LO,hashCode:O.Fl}),e.executionParameters.forEach((e=>dr(e,t))),e))),ur=Bt(((e,t)=>($t(e),(0,O.rC)(e,{pattern:O.LO,owners:O.LO,documentation:O.LO,autoActivateUpdates:O.LO,execution:O.LO,test:O.LO,tests:O.LO,postValidations:O.LO,patternParameters:O.Fl,_elementHashCode:O.KG}),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),((e,t)=>{e instanceof Ya?cr(e,t):e instanceof Wa&&hr(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Za?ar(e):e instanceof Xa&&or(e)})(e.test),e.tests.forEach((e=>ir(e,t))),e.postValidations.forEach((e=>er(e))),e))),pr=zt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),e))),_r=zt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),Fa(e.expected),e))),mr=zt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),Fa(e.expected),e)));function gr(e,t){if(e instanceof Aa)return sr(e);if(e instanceof Sa)return Cr(e);const s=t.plugins.flatMap((e=>e.getExtraAtomicTestObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}function Er(e){return e instanceof Ra?pr(e):e instanceof Pa?mr(e):e instanceof wa?_r(e):e}const fr=e=>{$t(e),(0,O.rC)(e,{includes:O.LO}),e.includes.forEach(Ht)},Tr=Bt(((e,t)=>((0,O.rC)(e,{store:O.LO,data:O.LO,hashCode:O.Fl}),za(e.data,t),e))),Cr=zt((e=>((0,O.rC)(e,{id:O.LO,query:O.LO,assertions:O.LO,hashCode:O.Fl}),e.assertions.forEach(Er),e))),xr=Bt(((e,t)=>((0,O.rC)(e,{id:O.LO,tests:O.LO,storeTestDatas:O.LO,hashCode:O.Fl}),e.tests.forEach((e=>gr(e,t))),e.storeTestDatas.forEach((e=>Tr(e,t))),e))),Nr=zt((e=>((0,O.rC)(e,{value:O.LO,valueForSerialization:O.Fl}),Ht(e.ownerReference),e))),Or=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),Ar=zt((e=>((0,O.rC)(e,{localMappingProperty:O.LO,localMappingPropertyType:O.LO,localMappingPropertyMultiplicity:O.LO,hashCode:O.Fl}),Ht(e.localMappingPropertyType),e))),Sr=(e,t)=>{(0,O.rC)(e,{sourceSetImplementation:O.LO,targetSetImplementation:O.LO}),Lo(e.property),Or(e.sourceSetImplementation),e.targetSetImplementation&&Or(e.targetSetImplementation),e.localMappingProperty&&Ar(e.localMappingProperty)},yr=Bt(((e,t)=>(Sr(e,t),(0,O.rC)(e,{transformer:O.LO,transform:O.LO,explodeProperty:O.LO,hashCode:O.Fl}),e.transformer&&Nr(e.transformer),Vs(e.transform),e)));class Ir{observerContext;constructor(e){this.observerContext=e}visit_PropertyMapping(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraPropertyMappingObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_PurePropertyMapping(e){yr(e,this.observerContext)}visit_FlatDataPropertyMapping(e){ai(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){ni(e,this.observerContext)}visit_RelationalPropertyMapping(e){Wn(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){Zs(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){Zn(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){Xn(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){qn(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const vr=(e,t)=>(e.accept_PropertyMappingVisitor(new Ir(t)),e),Rr=zt((e=>(0,O.rC)(e,{isDefault:O.Fl,valueForSerialization:O.Fl}))),Pr=zt((e=>(0,O.rC)(e,{valueForSerialization:O.Fl}))),wr=e=>{(0,O.rC)(e,{root:O.LO}),Ht(e.class),Rr(e.id),Pr(e.root)},Lr=zt((e=>((0,O.rC)(e,{setImplementation:O.LO,class:O.LO,properties:O.LO}),e))),br=(e,t)=>{wr(e),(0,O.rC)(e,{mappingClass:O.LO,propertyMappings:O.LO}),e.mappingClass&&Lr(e.mappingClass),e.propertyMappings.forEach((e=>vr(e,t)))},Dr=zt((e=>((0,O.rC)(e,{}),Or(e.setImplementation),e))),Mr=e=>{wr(e),(0,O.rC)(e,{parameters:O.LO,operation:O.LO,hashCode:O.Fl}),e.parameters.forEach(Dr)},kr=zt((e=>(Mr(e),e))),Fr=zt((e=>(Mr(e),(0,O.rC)(e,{validationFunction:O.LO}),Vs(e.validationFunction),e))),jr=Bt(((e,t)=>(br(e,t),(0,O.rC)(e,{filter:O.LO,hashCode:O.Fl}),e.srcClass&&Ht(e.srcClass),e.filter&&Vs(e.filter),e)));class Ur{observerContext;constructor(e){this.observerContext=e}visit_SetImplementation(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraSetImplementationObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_MergeOperationSetImplementation(e){Fr(e)}visit_OperationSetImplementation(e){kr(e)}visit_PureInstanceSetImplementation(e){jr(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){ii(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){Jn(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){Qn(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Vr=(e,t)=>(e.accept_SetImplementationVisitor(new Ur(t)),e),Gr=zt((e=>((0,O.rC)(e,{original:O.LO,substitute:O.LO}),Ht(e.original),Ht(e.substitute),e))),zr=zt((e=>((0,O.rC)(e,{included:O.LO,storeSubstitutions:O.LO}),Ht(e.included),e.storeSubstitutions.forEach(Gr),e))),Br=zt((e=>(0,O.rC)(e,{value:O.LO}))),$r=zt((e=>((0,O.rC)(e,{sourceValues:O.LO,hashCode:O.Fl}),yo(e.enum),e.sourceValues.forEach(Br),e))),Hr=zt((e=>((0,O.rC)(e,{sourceType:O.LO,enumValueMappings:O.LO,hashCode:O.Fl}),Ht(e.enumeration),Rr(e.id),e.sourceType&&Ht(e.sourceType),e.enumValueMappings.forEach($r),e))),Yr=Bt(((e,t)=>((0,O.rC)(e,{id:O.LO,stores:O.LO,propertyMappings:O.LO,hashCode:O.Fl}),Ht(e.association),Rr(e.id),e.stores.forEach(Ht),e.propertyMappings.forEach((e=>vr(e,t))),e))),Wr=zt((e=>((0,O.rC)(e,{inputType:O.LO,data:O.LO,hashCode:O.Fl}),Ht(e.sourceClass),e))),Kr=zt((e=>(0,O.rC)(e,{expectedOutput:O.LO,hashCode:O.Fl}))),Zr=Bt(((e,t)=>((0,O.rC)(e,{name:O.LO,query:O.LO,inputData:O.LO,assert:O.LO,hashCode:O.Fl}),Vs(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof Fs)return Wr(e);if(e instanceof bs)return ri(e);if(e instanceof js)return ea(e);const s=t.plugins.flatMap((e=>e.getExtraMappingTestInputDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})(e,t))),((e,t)=>{e instanceof vs&&Kr(e)})(e.assert),e))),Xr=Bt(((e,t)=>($t(e),(0,O.rC)(e,{includes:O.LO,classMappings:O.LO,enumerationMappings:O.LO,associationMappings:O.LO,test:O.LO,tests:O.LO,_elementHashCode:O.KG}),e.includes.forEach(zr),e.classMappings.forEach((e=>Vr(e,t))),e.enumerationMappings.forEach(Hr),e.associationMappings.forEach((e=>Yr(e,t))),e.test.forEach((e=>Zr(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof Ia?ir(e,t):e instanceof ya?xr(e,t):e}(e,t))),e))),qr=e=>{(0,O.rC)(e,{store:O.LO}),Ht(e.store)},Jr=zt((e=>(qr(e),(0,O.rC)(e,{hashCode:O.Fl}),e))),Qr=zt((e=>(qr(e),(0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),Ht(e.class),e))),eo=zt((e=>(qr(e),(0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),Ht(e.class),e))),to=zt((e=>(qr(e),(0,O.rC)(e,{mappings:O.LO,hashCode:O.Fl}),e.mappings.forEach(Ht),e)));class so{observerContext;constructor(e){this.observerContext=e}visit_Connection(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraConnectionObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_ConnectionPointer(e){Jr(e)}visit_ModelChainConnection(e){to(e)}visit_JsonModelConnection(e){Qr(e)}visit_XmlModelConnection(e){eo(e)}visit_FlatDataConnection(e){oi(e)}visit_RelationalDatabaseConnection(e){Ca(e,this.observerContext)}}const io=(e,t)=>(e.accept_ConnectionVisitor(new so(t)),e),no=Bt(((e,t)=>($t(e),(0,O.rC)(e,{connectionValue:O.LO,_elementHashCode:O.KG}),io(e.connectionValue,t),e))),ao=Bt(((e,t)=>((0,O.rC)(e,{id:O.LO,connection:O.LO,hashCode:O.Fl}),io(e.connection,t),e))),ro=Bt(((e,t)=>((0,O.rC)(e,{storeConnections:O.LO,hashCode:O.Fl}),Ht(e.store),e.storeConnections.forEach((e=>ao(e,t))),e))),oo=Bt(((e,t)=>((0,O.rC)(e,{mappings:O.LO,connections:O.LO,hashCode:O.Fl}),e.mappings.forEach(Ht),e.connections.forEach((e=>ro(e,t))),e))),lo=zt((e=>((0,O.rC)(e,{hashCode:O.Fl}),Ht(e.packageableRuntime),e))),co=(e,t)=>e instanceof ws?lo(e):e instanceof Ps?oo(e,t):e,ho=Bt(((e,t)=>($t(e),(0,O.rC)(e,{runtimeValue:O.LO,_elementHashCode:O.KG}),oo(e.runtimeValue,t),e)));class uo{observerContext;constructor(e){this.observerContext=e}visit_PackageableElement(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraElementObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_Package(e){_o(e,this.observerContext)}visit_SectionIndex(e){xo(e)}visit_PrimitiveType(e){}visit_Profile(e){Ao(e)}visit_Enumeration(e){Io(e)}visit_Measure(e){Ro(e)}visit_Class(e){Do(e)}visit_Association(e){Mo(e)}visit_ConcreteFunctionDefinition(e){ko(e)}visit_FlatData(e){ti(e)}visit_Database(e){Yn(e,this.observerContext)}visit_Mapping(e){Xr(e,this.observerContext)}visit_Service(e){ur(e,this.observerContext)}visit_PackageableRuntime(e){ho(e,this.observerContext)}visit_PackageableConnection(e){no(e,this.observerContext)}visit_FileGenerationSpecification(e){Ts(e)}visit_GenerationSpecification(e){xs(e)}visit_DataElement(e){Ba(e,this.observerContext)}}const po=Bt(((e,t)=>(e.accept_PackageableElementVisitor(new uo(t)),e))),_o=Bt(((e,t)=>((e=>{$t(e),(0,O.rC)(e,{children:O.LO,hashCode:O.KG})})(e),e.children.forEach((e=>{e instanceof ds?_o(e,t):po(e,t)})),e))),mo=zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Ht(e.ownerReference),e))),go=zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),e))),Eo=zt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),go(e.tag),e))),fo=zt((e=>(0,O.rC)(e,{rawType:O.LO}))),To=zt((e=>((0,O.rC)(e,{value:O.LO}),fo(e.value),Ht(e.ownerReference),e))),Co=zt((e=>((0,O.rC)(e,{parserName:O.LO,elements:O.LO}),e instanceof us?(0,O.rC)(e,{imports:O.LO,hashCode:O.Fl}):e instanceof ps&&(0,O.rC)(e,{hashCode:O.Fl}),e))),xo=zt((e=>($t(e),(0,O.rC)(e,{sections:O.LO,_elementHashCode:O.KG}),e.sections.forEach(Co),e))),No=zt((e=>(0,O.rC)(e,{value:O.LO}))),Oo=zt((e=>(0,O.rC)(e,{value:O.LO}))),Ao=zt((e=>($t(e),(0,O.rC)(e,{p_stereotypes:O.LO,p_tags:O.LO,_elementHashCode:O.KG}),e.p_stereotypes.forEach(No),e.p_tags.forEach(Oo),e))),So=zt((e=>((0,O.rC)(e,{name:O.LO,stereotypes:O.LO,taggedValues:O.LO,hashCode:O.Fl}),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),yo=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),Io=zt((e=>($t(e),(0,O.rC)(e,{values:O.LO,stereotypes:O.LO,taggedValues:O.LO,_elementHashCode:O.KG}),e.values.forEach(So),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),vo=zt((e=>((0,O.rC)(e,{measure:O.LO,conversionFunction:O.LO,hashCode:O.Fl}),e.conversionFunction&&Vs(e.conversionFunction),e))),Ro=zt((e=>($t(e),(0,O.rC)(e,{canonicalUnit:O.LO,nonCanonicalUnits:O.LO,_elementHashCode:O.KG}),e.canonicalUnit&&vo(e.canonicalUnit),e.nonCanonicalUnits.forEach(vo),e))),Po=zt((e=>((0,O.rC)(e,{name:O.LO,multiplicity:O.LO,stereotypes:O.LO,taggedValues:O.LO,hashCode:O.Fl}),To(e.genericType),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),wo=zt((e=>((0,O.rC)(e,{name:O.LO,multiplicity:O.LO,stereotypes:O.LO,taggedValues:O.LO,body:O.LO.ref,parameters:O.LO.ref,hashCode:O.Fl}),To(e.genericType),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),Lo=zt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Ht(e.ownerReference),e))),bo=zt((e=>((0,O.rC)(e,{name:O.LO,functionDefinition:O.LO,externalId:O.LO,enforcementLevel:O.LO,messageFunction:O.LO,hashCode:O.Fl}),Vs(e.functionDefinition),e.messageFunction&&Vs(e.messageFunction),e))),Do=zt((e=>($t(e),(0,O.rC)(e,{_subclasses:O.LO,properties:O.LO,propertiesFromAssociations:O.LO,derivedProperties:O.LO,generalizations:O.LO,constraints:O.LO,stereotypes:O.LO,taggedValues:O.LO,dispose:O.KG,_elementHashCode:O.KG}),e.properties.forEach(Po),e.propertiesFromAssociations.forEach(Po),e.derivedProperties.forEach(wo),e.generalizations.forEach(To),e.constraints.forEach(bo),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),Mo=zt((e=>($t(e),(0,O.rC)(e,{properties:O.LO,stereotypes:O.LO,taggedValues:O.LO,derivedProperties:O.LO,_elementHashCode:O.KG}),e.properties.forEach(Po),e.derivedProperties.forEach(wo),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),ko=zt((e=>($t(e),(0,O.rC)(e,{functionName:O.LO,returnMultiplicity:O.LO,parameters:O.LO.shallow,expressionSequence:O.LO.ref,stereotypes:O.LO,taggedValues:O.LO,_elementHashCode:O.KG}),e.parameters.forEach(Gs),Ht(e.returnType),e.stereotypes.forEach(mo),e.taggedValues.forEach(Eo),e))),Fo=zt((e=>e instanceof os?Io(e):e instanceof ls?vo(e):e instanceof as?Do(e):e instanceof cs?Ro(e):e)),jo=(zt((e=>e instanceof os?Io(e):e instanceof ls?vo(e):e)),zt((e=>(0,O.rC)(e,{_dummyObservable:O.LO})))),Uo=zt((e=>((0,O.rC)(e,{value:O.LO}),Ht(e.ownerReference),e))),Vo=zt((e=>(jo(e),(0,O.rC)(e,{id:O.LO,hideProperties:O.LO,hideTaggedValues:O.LO,hideStereotypes:O.LO,hashCode:O.Fl}),Ht(e.class),e))),Go=zt((e=>(Uo(e.classView),e))),zo=zt((e=>((0,O.rC)(e,{path:O.LO,pathForSerialization:O.Fl}),Go(e.from),Go(e.to),e))),Bo=zt((e=>(zo(e),(0,O.rC)(e,{hashCode:O.Fl}),e))),$o=zt((e=>(zo(e),(0,O.rC)(e,{hashCode:O.Fl}),Lo(e.property),Ht(e.association),e))),Ho=zt((e=>(zo(e),(0,O.rC)(e,{hashCode:O.Fl}),Lo(e.property),e))),Yo=zt((e=>($t(e),(0,O.rC)(e,{classViews:O.LO,associationViews:O.LO,generalizationViews:O.LO,propertyViews:O.LO,_elementHashCode:O.KG}),e.classViews.forEach(Vo),e.associationViews.forEach($o),e.generalizationViews.forEach(Bo),e.propertyViews.forEach(Ho),e)));var Wo;!function(e){e.DIAGRAM="DIAGRAM",e.CLASS_VIEW="CLASS_VIEW",e.PROPERTY_VIEW="PROPERTY_VIEW",e.ASSOCIATION_VIEW="ASSOCIATION_VIEW",e.PROPERTY_HOLDER_VIEW="PROPERTY_HOLDER_VIEW",e.GENERALIZATION_VIEW="GENERALIZATION_VIEW",e.RELATIONSHIP_VIEW="RELATIONSHIP_VIEW",e.POINT="POINT",e.RECTANGLE="RECTANGLE",e.POSITIONED_RECTANGLE="POSITIONED_RECTANGLE"}(Wo=Wo||(Wo={}));class Ko extends is{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return Zt([Wo.DIAGRAM,this.path,Zt(this.classViews),Zt(this.generalizationViews),Zt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const Zo="Diagram";class Xo extends Gt{constructor(){super(Vt.Rw.LW,Vt.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[Zo]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof Ko)return Zo}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Ko)return Yo(e)}]}}class qo{package;name;get path(){return`${this.package}::${this.name}`}get hashCode(){return Zt([Xt.PACKAGEABLE_ELEMENT,this.path])}}class Jo extends qo{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return Zt([Wo.DIAGRAM,this.path,Zt(this.classViews),Zt(this.generalizationViews),Zt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class Qo{rectangle;position;get hashCode(){return Zt([Wo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class el extends Qo{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return Zt([Wo.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class tl{x;y;get hashCode(){return Zt([Wo.POINT,this.x.toString(),this.y.toString()])}}class sl{width;height;get hashCode(){return Zt([Wo.RECTANGLE,this.width.toString(),this.height.toString()])}}class il{points=[]}class nl{sourceView;targetView;line;get hashCode(){return Zt([Wo.RELATIONSHIP_VIEW,this.sourceView,this.targetView,Zt(this.line.points)])}}class al extends nl{property;get hashCode(){return Zt([Wo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class rl extends al{get hashCode(){return Zt([Wo.PROPERTY_VIEW,super.hashCode])}}class ol extends nl{get hashCode(){return Zt([Wo.GENERALIZATION_VIEW,super.hashCode])}}class ll{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Zt([Xt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new ll(0,0);static ZERO_ONE=new ll(0,1);static ZERO_MANY=new ll(0,void 0);static ONE=new ll(1,1);static ONE_MANY=new ll(1,void 0)}new Be((0,ze.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,ze.Ru)(),startLine:(0,ze.Ru)(),startColumn:(0,ze.Ru)(),endLine:(0,ze.Ru)(),endColumn:(0,ze.Ru)()})),(0,ze.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return Zt([Xt.PACKAGEABLE_ELEMENT_POINTER,this.type,this.path])}},{path:(0,ze.Ru)(),type:(0,ze.Ru)()});const cl=(0,ze.yu)(ll,{lowerBound:(0,ze.Ru)(),upperBound:(0,ze.jt)((0,ze.Ru)())});class dl{class;property;get hashCode(){return Zt([Xt.PROPERTY_POINTER,this.property,this.class??""])}}class hl{}class ul{queryTimeOutInSeconds=null;enableConstraints=!0}var pl,_l;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(pl||(pl={})),function(e){e.LAMBDA="lambda",e.VARIABLE="var",e.CINTEGER="integer",e.CDECIMAL="decimal",e.CSTRING="string",e.CBOOLEAN="boolean",e.CFLOAT="float",e.CDATETIME="dateTime",e.CSTRICTDATE="strictDate",e.CSTRICTTIME="strictTime",e.CLATESTDATE="latestDate"}(_l=_l||(_l={})),(0,ze.yu)(class extends ul{},{_type:We(pl.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,ze.Ru)(),enableConstraints:(0,ze.Ru)()});const ml=(0,ze.yu)(class extends hl{body;parameters;get hashCode(){return Zt([Xt.RAW_LAMBDA,Qt(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:We(_l.LAMBDA),body:(0,ze.LZ)(),parameters:(0,ze.LZ)()}),gl=(0,ze.yu)(class extends hl{class;name;multiplicity;get hashCode(){return Zt([Xt.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:We(_l.VARIABLE),class:(0,ze.Ru)(),multiplicity:$e(cl),name:(0,ze.Ru)()});(0,ze.yu)(class extends hl{multiplicity=ll.ONE;type;value;get hashCode(){return Zt([Xt.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,ze.bm)("_type",(0,ze.PG)((e=>{switch(e){case Te.INTEGER:return _l.CINTEGER;case Te.DECIMAL:return _l.CDECIMAL;case Te.STRING:return _l.CSTRING;case Te.BOOLEAN:return _l.CBOOLEAN;case Te.FLOAT:return _l.CFLOAT;case Te.DATETIME:return _l.CDATETIME;case Te.STRICTDATE:return _l.CSTRICTDATE;case Te.STRICTTIME:return _l.CSTRICTTIME;case Te.LATESTDATE:return _l.CLATESTDATE;default:throw new F(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case _l.CINTEGER:return Te.INTEGER;case _l.CDECIMAL:return Te.DECIMAL;case _l.CSTRING:return Te.STRING;case _l.CBOOLEAN:return Te.BOOLEAN;case _l.CFLOAT:return Te.FLOAT;case _l.CDATETIME:return Te.DATETIME;case _l.CSTRICTDATE:return Te.STRICTDATE;case _l.CSTRICTTIME:return Te.STRICTTIME;case _l.CLATESTDATE:return Te.LATESTDATE;default:throw new F(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,ze.jt)((0,ze.Ru)())});const El=(0,ze.yu)(dl,{class:(0,ze.jt)((0,ze.Ru)()),property:(0,ze.Ru)()}),fl=(0,ze.yu)(class{profile;value;get hashCode(){return Zt([Xt.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,ze.Ru)(),value:(0,ze.Ru)()}),Tl=(0,ze.yu)(class{profile;value;get hashCode(){return Zt([Xt.TAG_POINTER,this.value,this.profile])}},{profile:(0,ze.Ru)(),value:(0,ze.Ru)()}),Cl=(0,ze.yu)(class{tag;value;get hashCode(){return Zt([Xt.TAGGED_VALUE,this.tag,this.value])}},{tag:$e(Tl),value:(0,ze.Ru)()}),xl=((0,ze.yu)(class extends qo{stereotypes=[];tags=[];get hashCode(){return Zt([Xt.PROFILE,this.path,Zt(this.stereotypes),Zt(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:We("profile"),name:(0,ze.Ru)(),package:(0,ze.Ru)(),stereotypes:(0,ze.pb)((0,ze.Ru)()),tags:(0,ze.pb)((0,ze.Ru)())}),(0,ze.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return Zt([Xt.ENUM_VALUE,this.value,Zt(this.stereotypes),Zt(this.taggedValues)])}},{stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1}))),value:(0,ze.Ru)()})),Nl=((0,ze.yu)(class extends qo{values=[];stereotypes=[];taggedValues=[];get hashCode(){return Zt([Xt.ENUMERATION,this.path,Zt(this.values),Zt(this.stereotypes),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:We("Enumeration"),name:(0,ze.Ru)(),package:(0,ze.Ru)(),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1}))),values:(0,ze.pb)($e(xl))}),(0,ze.yu)(class extends qo{measure;conversionFunction;get hashCode(){return Zt([Xt.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new F}},{_type:We("unit"),conversionFunction:(0,ze.jt)($e(ml)),measure:(0,ze.Ru)(),name:(0,ze.Ru)(),package:(0,ze.Ru)()})),Ol=((0,ze.yu)(class extends qo{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return Zt([Xt.MEASURE,this.path,this.canonicalUnit??"",Zt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:We("measure"),canonicalUnit:(0,ze.jt)($e(Nl)),name:(0,ze.Ru)(),nonCanonicalUnits:(0,ze.pb)($e(Nl)),package:(0,ze.Ru)()}),(0,ze.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return Zt([Xt.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",Zt(this.stereotypes),Zt(this.taggedValues)])}},{aggregation:(0,ze.jt)((0,ze.Ru)()),multiplicity:$e(cl),name:(0,ze.Ru)(),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1}))),type:(0,ze.Ru)()})),Al=(0,ze.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return Zt([Xt.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,Zt(this.stereotypes),Zt(this.taggedValues),Qt(this.parameters,this.body)])}},{body:(0,ze.LZ)(),name:(0,ze.Ru)(),parameters:(0,ze.LZ)(),returnMultiplicity:$e(cl),returnType:(0,ze.Ru)(),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1})))}),Sl=(0,ze.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return Zt([Xt.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,ze.jt)((0,ze.Ru)()),externalId:(0,ze.jt)((0,ze.Ru)()),functionDefinition:$e(ml),messageFunction:(0,ze.jt)($e(ml)),name:(0,ze.Ru)()}),yl=((0,ze.yu)(class extends qo{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return Zt([Xt.CLASS,this.path,Zt(this.properties),Zt(this.derivedProperties),Zt(this.superTypes),Zt(this.constraints),Zt(this.stereotypes),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:We("class"),constraints:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Sl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Sl,e)),{skipIfEmpty:!1}))),name:(0,ze.Ru)(),originalMilestonedProperties:(0,ze.PG)((e=>Ye(e,(e=>ze.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>ze.AM),{skipIfEmpty:!1}))),package:(0,ze.Ru)(),properties:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Ol,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Ol,e)),{skipIfEmpty:!1}))),derivedProperties:(0,ze.bm)("qualifiedProperties",(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Al,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Al,e)),{skipIfEmpty:!1})))),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),superTypes:(0,ze.PG)((e=>Ye(e,(e=>e),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>e),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1})))}),(0,ze.yu)(class extends qo{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return Zt([Xt.ASSOCIATION,this.path,Zt(this.properties),Zt(this.derivedProperties),Zt(this.stereotypes),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:We("association"),name:(0,ze.Ru)(),originalMilestonedProperties:(0,ze.PG)((e=>Ye(e,(e=>ze.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>ze.AM),{skipIfEmpty:!1}))),package:(0,ze.Ru)(),properties:(0,ze.pb)($e(Ol)),derivedProperties:(0,ze.bm)("qualifiedProperties",(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Al,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Al,e)),{skipIfEmpty:!1})))),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1})))}),(0,ze.yu)(class extends qo{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return Zt([Xt.FUNCTION,this.path,Zt(this.parameters),this.returnType,Zt(this.taggedValues),Zt(this.stereotypes),Qt(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:We("function"),body:(0,ze.pb)((0,ze.LZ)()),name:(0,ze.Ru)(),package:(0,ze.Ru)(),parameters:(0,ze.pb)($e(gl)),postConstraints:(0,ze.pb)((0,ze.Ru)()),preConstraints:(0,ze.pb)((0,ze.Ru)()),returnMultiplicity:$e(cl),returnType:(0,ze.Ru)(),stereotypes:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(fl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(fl,e)),{skipIfEmpty:!1}))),taggedValues:(0,ze.PG)((e=>Ye(e,(e=>(0,ze.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>He(e,(e=>(0,ze.vB)(Cl,e)),{skipIfEmpty:!1})))}),"diagram"),Il=(0,ze.yu)(tl,{x:(0,ze.Ru)(),y:(0,ze.Ru)()}),vl=(0,ze.yu)(sl,{height:(0,ze.Ru)(),width:(0,ze.Ru)()}),Rl=(0,ze.yu)(il,{points:(0,ze.pb)($e(Il))}),Pl=(0,ze.yu)(el,{class:(0,ze.Ru)(),hideProperties:(0,ze.jt)((0,ze.Ru)()),hideStereotypes:(0,ze.jt)((0,ze.Ru)()),hideTaggedValues:(0,ze.jt)((0,ze.Ru)()),id:(0,ze.Ru)(),position:$e(Il),rectangle:$e(vl)}),wl=(0,ze.yu)(rl,{line:$e(Rl),property:$e(El),sourceView:(0,ze.Ru)(),targetView:(0,ze.Ru)()}),Ll=(0,ze.yu)(ol,{line:$e(Rl),sourceView:(0,ze.Ru)(),targetView:(0,ze.Ru)()}),bl=(0,ze.yu)(Jo,{_type:We(yl),classViews:(0,ze.pb)($e(Pl)),generalizationViews:(0,ze.pb)($e(Ll)),name:(0,ze.Ru)(),package:(0,ze.Ru)(),propertyViews:(0,ze.pb)($e(wl))});class Dl extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var Ml=s(95903);const kl=(e,t)=>{const s=e.lastIndexOf(me);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+me.length,e.length)]},Fl=(e,t)=>`${e?`${e}::`:""}${t}`,jl=(e,t)=>{e.children.push(t),t.package=e},Ul=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Vl=(e,t,s,i)=>{const n=t.indexOf(me),a=-1===n?t:t.substring(0,n);let r;if(r=e.children.find((e=>e instanceof ds&&e.name===a)),!r){if(!s)throw new V(`Can't find child package '${a}' in package '${e.path}'`);Z(!Ee.includes(a),`Can't create package with reserved name '${a}'`),r=new ds(a),r.package=e,e.children.push(r)}return i&&i.set(Fl(e.path,a),r),-1!==n?Vl(r,t.substring(n+me.length),s,i):r},Gl=(e,t,s,i)=>{if(i){const n=i.get(Fl(e.path,t));if(n)return n;let a=t;for(;""!==a;){const n=Fl(e.path,a),r=i.get(n);if(r)return Vl(r,t.substring(a.length+me.length,t.length),s,i);const o=a.lastIndexOf(me);a=-1!==o?a.substring(0,o):""}}return Vl(e,t,s,i)},zl=(e,t,s)=>(W(t,"Package path is required"),Gl(e.root,t,!0,s)),Bl=(e,t)=>Y(e.rawType,t),$l=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=Bl(e.value,as);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},Hl=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Yl=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Wl=(e,t)=>`${B(e,"Package path is required")}::${B(t,"Name is required")}`;class Kl{elementClassName;_class;prerequisites=[];firstPass;secondPass;thirdPass;fourthPass;fifthPass;constructor(e){this.elementClassName=e.elementClassName,this._class=e._class,this.prerequisites=e.prerequisites??[],this.firstPass=e.firstPass,this.secondPass=e.secondPass,this.thirdPass=e.thirdPass,this.fourthPass=e.fourthPass,this.fifthPass=e.fifthPass}getElementProtocolClass(){return this._class}getPrerequisiteElementProtocolClasses(){return this.prerequisites}runFirstPass(e,t,s,i){W(e.package,"Element 'package' field is missing or empty"),W(e.name,"Element 'name' field is missing or empty"),((e,t,s)=>{if(s){if(s.has(e))throw new V(`Element '${e}' already exists`);s.add(e)}else Z(!t.graph.getNullableElement(e),`Element '${e}' already exists`)})(Wl(e.package,e.name),t,i);const n=this.firstPass(e,t);return jl(zl(t.currentSubGraph,e.package,s),n),n}runSecondPass(e,t){this.secondPass?.(e,t)}runThirdPass(e,t){this.thirdPass?.(e,t)}runFourthPass(e,t){this.fourthPass?.(e,t)}runFifthPass(e,t){this.fifthPass?.(e,t)}}const Zl=e=>e.classView.value.id,Xl=e=>{const t=new rl,s=new il;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new dl;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=Zl(e.from),t.targetView=Zl(e.to),t},ql=e=>{const t=new ol,s=new il;return s.points=e.pathForSerialization,t.line=s,t.sourceView=Zl(e.from),t.targetView=Zl(e.to),t},Jl=e=>{const t=new el;return t.class=e.class.valueForSerialization??"",t.hideProperties=e.hideProperties,t.hideStereotypes=e.hideStereotypes,t.hideTaggedValues=e.hideTaggedValues,t.id=e.id,t.position=((e,t)=>{const s=new tl;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new sl;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class Ql{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return Zt([Wo.POINT,this.x.toString(),this.y.toString()])}}class ec{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return Zt([Wo.RECTANGLE,this.width.toString(),this.height.toString()])}}class tc{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new Ql(this.position.x+this.rectangle.width/2,this.position.y+this.rectangle.height/2);contains(e,t){const s=this.normalizeBox(this);return e>s.position.x&&e<s.position.x+s.rectangle.width&&t>s.position.y&&t<s.position.y+s.rectangle.height}normalizeBox(e){let t=e;return e.rectangle.width<0&&(t=new tc(new Ql(e.position.x+e.rectangle.width,e.position.y),new ec(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new tc(new Ql(e.position.x,e.position.y+e.rectangle.height),new ec(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,Zt([Wo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class sc extends tc{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new Ql(0,0),new ec(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return Zt([Wo.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class ic{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class nc extends ms{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class ac extends nc{ownerReference;constructor(e){const t=Es.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new ac(e)}}class rc{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new ic(ac.create(t)),this.to=new ic(ac.create(s))}computeEdgeEndpoint(e,t=!0){const s=e.classView.value,i=e.classView.value.center(),n=i.x+(e._offsetX??0),a=i.y+(e._offsetY??0);return s.contains(n,a)?new Ql(n,a):(t&&(e._offsetX=0,e._offsetY=0),new Ql(i.x,i.y))}buildFullPath(e=!0){return[this.computeEdgeEndpoint(this.from,e),...this.path,this.computeEdgeEndpoint(this.to,e)]}static pruneUnnecessaryInsidePoints=(e,t,s)=>{if(!e.length)return[];let i=0,n=e[i];for(;i<e.length-1&&t.contains(n.x,n.y);)i++,n=e[i];let a=e.length-1,r=e[a];for(;a>0&&s.contains(r.x,r.y);)a--,r=e[a];return e.slice(i-1,a+2)};get pathForSerialization(){return rc.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return Zt([Wo.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,Zt(this.pathForSerialization)])}}class oc extends rc{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return Zt([Wo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class lc extends oc{get hashCode(){return Zt([Wo.PROPERTY_VIEW,super.hashCode])}}class cc extends rc{get hashCode(){return Zt([Wo.GENERALIZATION_VIEW,super.hashCode])}}class dc{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new dc(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new dc(this.x/e,this.y/e)}normal(e){return new dc(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const hc=(e,t)=>e.classViews.find((e=>e.id===t)),uc=(e,t)=>{e.path=t},pc=e=>{const t=e.buildFullPath(),s=rc.pruneUnnecessaryInsidePoints(t,e.from.classView.value,e.to.classView.value);if(s[0]!==t[0]){const t=e.from.classView.value.center();e.from._offsetX=s[0].x-t.x,e.from._offsetY=s[0].y-t.y}if(s[s.length-1]!==t[t.length-1]){const t=e.to.classView.value.center();e.to._offsetX=s[s.length-1].x-t.x,e.to._offsetY=s[s.length-1].y-t.y}const i=[];for(let e=0;e<s.length-2;e++){const t=dc.fromPoints(s[e+1],s[e]).unit(),n=dc.fromPoints(s[e+1],s[e+2]).unit(),a=t.dotProduct(n),r=180*Math.acos(a)/Math.PI;Math.abs(r-180)>5&&i.push(s[e+1])}uc(e,i)},_c=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),mc=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),gc=e=>new Ql(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),Ec=e=>{const t=gc(e);return new tc(new Ql(t.x-5,t.y-5),new ec(10,10))},fc=(e,t)=>(t=e.normalizeBox(t),e.contains(t.position.x,t.position.y)||e.contains(t.position.x+t.rectangle.width,t.position.y)||e.contains(t.position.x,t.position.y+t.rectangle.height)||e.contains(t.position.x+t.rectangle.width,t.position.y+t.rectangle.height)),Tc=e=>{const t=B(e.x,"Point 'x' coordinate is missing"),s=B(e.y,"Point 'y' coordinate is missing");return new Ql(t,s)};class Cc extends Dl{constructor(){super(Vt.Rw.zE,Vt.i8)}V1_getExtraElementBuilders(){return[new Kl({elementClassName:"Diagram",_class:Jo,firstPass:(e,t)=>{H(e,Jo);const s=new Ko(e.name),i=Wl(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Ko),s},secondPass:(e,t)=>{H(e,Jo);const s=(i=Wl(e.package,e.name),n=t.currentSubGraph,B(n.getOwnNullableExtensionElement(i,Ko),`Can't find diagram '${i}'`));var i,n;s.classViews=e.classViews.map((e=>((e,t,s)=>{W(e.class,"Class view 'class' field is missing or empty"),W(e.id,"Class view 'id' field is missing or empty"),z(e.rectangle,"Class view 'rectangle' field is missing"),z(e.position,"Class view 'position' field is missing");const i=new sc(s,e.id,t.resolveClass(e.class));return i.hideProperties=e.hideProperties,i.hideTaggedValues=e.hideTaggedValues,i.hideStereotypes=e.hideStereotypes,i.rectangle=(e=>{const t=B(e.width,"Rectangle 'width' is missing"),s=B(e.height,"Rectangle 'height' is missing");return new ec(t,s)})(e.rectangle),i.position=Tc(e.position),i})(e,t,s))),s.propertyViews=e.propertyViews.map((e=>((e,t,s)=>{z(e.property,"Property view 'property' field is missing"),z(e.line,"Property view 'line' field is missing");const i=B(hc(s,B(e.sourceView)),"Property view 'sourceView' field is missing"),n=B(hc(s,B(e.targetView)),"Property view 'targetView' field is missing"),a=t.resolveOwnProperty(e.property),r=new lc(s,a,i,n);return r.path=e.line.points.map((e=>Tc(e))),pc(r),r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t)=>{z(e.line,"Generalization view 'line' field is missing");const s=B(hc(t,B(e.sourceView)),"Generalization view 'sourceView' field is missing"),i=B(hc(t,B(e.targetView)),"Generalization view 'targetView' field is missing"),n=new cc(t,s,i);return n.path=e.line.points.map((e=>Tc(e))),pc(n),n})(e,s)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof Jo)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof Jo)return(0,ze.qC)(bl,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===yl)return(0,ze.vB)(bl,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Ko)return(e=>{const t=new Jo;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(Jl),t.generalizationViews=e.generalizationViews.map(ql),t.propertyViews=e.propertyViews.map(Xl),t})(e)}]}}class xc extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class Nc extends xc{constructor(){super(Vt.Rw.f1,Vt.i8)}getExtraPureGraphExtensionClasses(){return[Ko]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Ko).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof as?Hl(e.property.ownerReference.value):e.property.ownerReference.value.properties).map((e=>e.name)).includes(e.property.value.name))).forEach((t=>b(e.propertyViews,t))),e.classViews.filter((e=>!t.getNullableClass(e.class.value.path))).forEach((t=>b(e.classViews,t))),e.generalizationViews.filter((e=>{const s=e.from.classView.value.class.value,i=e.to.classView.value.class.value;return!t.getNullableClass(s.path)||!t.getNullableClass(i.path)||0===s.generalizations.filter((e=>e.value.rawType===i)).length})).forEach((t=>b(e.generalizationViews,t)))})(t,e)))}]}}class Oc extends c{constructor(){super(Vt.Rw.NA,Vt.i8,[new Nc,new Xo,new Cc])}}var Ac=s(5453),Sc=s(3493),yc=s(53908);const Ic=(0,Ac.Z)({transitions:{create:()=>"none"}}),vc=e=>{const{children:t}=e;return(0,x.jsx)(Sc.Z,{injectFirst:!0,children:(0,x.jsx)(yc.Z,{theme:Ic,children:t})})};var Rc=s(83820),Pc=s(99631),wc=s(12238),Lc=s(78683),bc=s(20889),Dc=s(6277);const Mc=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Dc.clsx)(t,i),children:s})};return s.displayName=e,s},kc=e=>{const{children:t,darkMode:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Dc.clsx)("modal",{"modal--dark":s},i),children:t})},Fc=e=>{const{title:t,icon:s,className:i}=e;return(0,x.jsxs)("div",{className:(0,Dc.clsx)("modal__title",i),children:[s&&(0,x.jsx)("div",{className:"modal__title__icon",children:s}),(0,x.jsx)("div",{className:"modal__title__label",children:(n=t,(n??"").trim().replace(/\b(?:\w+)\b/gu,(e=>Ss.includes(e.toLowerCase())?e.toLowerCase():As(e))).replace(/^(?:\w+)\b/u,(e=>As(e))).replace(/\b(?:\w+)$/u,(e=>As(e))))})]});var n},jc=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,x.jsx)("div",{className:(0,Dc.clsx)("modal__header",i),children:(0,x.jsx)(Fc,{title:t})}):(0,x.jsx)("div",{className:(0,Dc.clsx)("modal__header",i),children:s})},Uc=(Mc("ModalHeaderActions","modal__header__actions"),Mc("ModalBody","modal__body")),Vc=Mc("ModalFooter","modal__footer"),Gc=e=>{switch(e){case vt.PROCEED_WITH_CAUTION:return"btn--caution";case vt.PROCEED:case vt.STANDARD:default:return"btn--dark"}},zc=(0,st.Pi)((e=>{const{info:t}=e,s=Mt(),{title:i,message:n,prompt:a,type:r,onClose:o,onEnter:l,actions:c}=t,d=()=>{o?.(),s.setActionAlertInfo(void 0)};return(0,x.jsx)(bc.Z,{open:Boolean(s.actionAlertInfo),onClose:v,TransitionProps:{onEnter:()=>l?.()},children:(0,x.jsxs)("form",{onSubmit:e=>{e.preventDefault(),c.find((e=>e.default))?.handler?.(),d()},className:`modal search-modal modal--dark blocking-alert blocking-alert--${(r??It.STANDARD).toLowerCase()}`,children:[i&&(0,x.jsx)(jc,{title:i}),(0,x.jsxs)(Uc,{children:[(0,x.jsx)("div",{className:"blocking-alert__summary-text",children:n}),(0,x.jsx)("div",{className:"blocking-alert__prompt-text",children:a})]}),(0,x.jsxs)(Vc,{children:[c.map((e=>(0,x.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${Gc(e.type??vt.STANDARD)}`,onClick:t=>{t.preventDefault(),e.handler?.(),d()},autoFocus:Boolean(e.default),children:e.label},e.label))),!c.length&&(0,x.jsx)("button",{type:"button",className:"btn btn--dark blocking-alert__action--standard",onClick:d,children:"Cancel"})]})]})})})),Bc=(0,st.Pi)((()=>{const e=Mt().actionAlertInfo;return e?(0,x.jsx)(zc,{info:e}):null})),$c=e=>{const{isLoading:t}=e,s=(0,it.useRef)(null);return(0,it.useEffect)((()=>{s.current&&(t?s.current.parentElement?.classList.add("panel-loading-indicator__container"):s.current.parentElement?.classList.remove("panel-loading-indicator__container"))}),[t]),(0,x.jsx)("div",{ref:s,className:"panel-loading-indicator"+(t?"":"--disabled")})},Hc=(0,st.Pi)((()=>{const e=Mt().blockingAlertInfo;return e?(0,x.jsx)(bc.Z,{open:Boolean(e),onClose:v,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,x.jsxs)(kc,{darkMode:!0,className:"blocking-alert",children:[(0,x.jsx)($c,{isLoading:Boolean(e.showLoading)}),(0,x.jsxs)(Uc,{children:[(0,x.jsx)("div",{className:"blocking-alert__message",children:e.message}),e.prompt&&(0,x.jsx)("div",{className:"blocking-alert__message__prompt",children:e.prompt})]})]})}):null}));var Yc=s(12889),Wc=s(58619),Kc=s(33029);const Zc=(0,st.Pi)((()=>{const e=Mt(),t=e.notification,s=Boolean(t),i=t?.message??"",n=t?.severity??Pt.INFO,[a,r]=(0,it.useState)(!1);let o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,x.jsx)(Yc.uMt,{})});switch(n){case Pt.ILEGAL_STATE:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Yc.nnZ,{})});break;case Pt.ERROR:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Yc.xDH,{})});break;case Pt.WARNING:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,x.jsx)(Yc.LPM,{})});break;case Pt.SUCCESS:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,x.jsx)(Yc.rE2,{})})}const l=()=>{e.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.copyTextToClipboard(i)));return(0,x.jsx)(Wc.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:e.notification?e.notification.autoHideDuration??null:Rt,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,x.jsx)(Kc.Z,{classes:{root:"notification__content",message:"notification__message",action:"notification__actions"},message:(0,x.jsxs)("div",{className:"notification__message__content",children:[o,(0,x.jsx)("div",{className:(0,Dc.clsx)("notification__message__content__text",{"notification__message__content__text--expanded":a}),onClick:c,title:"Click to Copy",children:i})]}),action:[(0,x.jsx)("button",{className:"notification__action",id:"expand_button",onClick:()=>r(!a),tabIndex:-1,title:a?"Collapse":"Expand",children:a?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.g8U,{})},"expand"),(0,x.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,x.jsx)(Yc.q1B,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var Xc;!function(e){e.TAB="Tab",e.CAPSLOCK="CapsLock",e.SHIFT="Shift",e.META="Meta",e.ALT="Alt",e.CONTROL="Control",e.SPACE="Space",e.ESC="Escape",e.LEFT="ArrowLeft",e.RIGHT="ArrowRight",e.UP="ArrowUp",e.DOWN="ArrowDown",e.ENTER="Enter",e.DELETE="Delete",e.BACKSPACE="Backspace"}(Xc=Xc||(Xc={}));var qc=s(11826);const Jc=e=>{const{children:t,classes:s,...i}=e;return(0,x.jsx)(qc.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},Qc=e=>{const{className:t,children:s,menuProps:i,content:n,disabled:a,onClose:r,onOpen:o}=e,l=(0,it.useRef)(null),[c,d]=(0,it.useState)(!1),[h,u]=(0,it.useState)(),[p,_]=(0,it.useState)(0),[m,g]=(0,it.useState)(0),E=()=>{u(void 0),d(!1),g(0),_(0)},f=e=>{e.stopPropagation(),e.preventDefault(),E(),r?.()},T=e=>{if(e.stopPropagation(),e.preventDefault(),!a&&(o?.(),l.current)){const t=l.current.getBoundingClientRect(),s=t.left+(window.scrollX||document.documentElement.scrollLeft),i=t.top+(window.scrollY||document.documentElement.scrollTop),{clientX:n,clientY:a,target:o}=e,c=o;if(h!==c&&!(document.elementsFromPoint(n,a).some((e=>e===c))&&s<=n&&n<=s+t.width&&i<=a&&a<=i+t.height))return E(),void r?.();u(c),d(!0),g(a),_(n)}};return(0,x.jsxs)("div",{ref:l,className:t,onContextMenu:T,children:[s,(0,x.jsx)(Jc,{open:c,anchorPosition:{left:p,top:m},onClose:f,anchorReference:"anchorPosition",BackdropProps:{invisible:!0,onContextMenu:T},disableRestoreFocus:!0,transitionDuration:0,onClick:f,...i,children:n},`${p}, ${m}`)]})},ed=(0,it.forwardRef)((function(e,t){const{className:s,children:i,...n}=e;return(0,x.jsx)("div",{ref:t,className:(0,Dc.clsx)("menu",s),...n,children:i})})),td=e=>{const{className:t,onClick:s,disabled:i,children:n,...a}=e;return(0,x.jsx)("button",{className:(0,Dc.clsx)("menu__item",t),disabled:Boolean(i),onClick:s,...a,children:n})},sd=Mc("MenuContentDivider","menu__divider");Mc("MenuContentItemIcon","menu__item__icon"),Mc("MenuContentItemLabel","menu__item__label");var id=s(52794),nd=s(71215);const ad=e=>(0,x.jsx)(id.D,{className:(0,Dc.clsx)("markdown-content",e.className),remarkPlugins:[nd.Z],children:e.value.value});var rd=s(62515);const od=e=>{const{children:t}=e,{ref:s,width:i,height:n}=(0,rd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[a,r]=(0,it.useState)(!1),{ref:o,width:l,height:c}=(0,rd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,it.useEffect)((()=>{r((l??0)>(i??0)+40&&(c??0)>(n??0)+40)}),[l,c,i,n]),(0,x.jsx)("div",{ref:o,className:"panel__content__blank",children:(0,x.jsx)("div",{ref:s,className:(0,Dc.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!a}),children:t})})};var ld=s(91222);const cd=e=>{const{children:t,...s}=e;return(0,x.jsx)(ld.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var dd=s(13474),hd=s(65068),ud=s(41327),pd=s(47793),_d=s(36569),md=s(46678);const gd=e=>{const{children:t,options:s,size:i,className:n,...a}=e,r=((e,t)=>{const s=[];for(let i=0;i<e.length;i+=t)s.push(e.slice(i,i+t));return s})(s,i);return(0,x.jsxs)("div",{className:(0,Dc.clsx)("mui-radio-group",n),children:[r.map(((e,t)=>(0,x.jsx)("div",{children:(0,x.jsx)(pd.Z,{className:"mui-radio-group__group",...a,children:e.map((e=>(0,x.jsx)(_d.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,x.jsx)(md.Z,{className:"mui-radio-group__group__item__radio-btn"}),label:(0,x.jsx)("div",{className:"mui-radio-group__group__item__label",children:e})},e)))})},t))),t]})};var Ed;!function(e){e.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX="question.how-to-use-advanced-search-syntax",e.QUESTION_WHEN_TO_CONFIGURE_PLATFORM_VERSIONS="question.when-to-configure-project-platform-dependencies-versions",e.QUESTION_HOW_TO_WRITE_A_SERVICE_TEST="question.how-to-write-a-service-test",e.QUESTION_HOW_TO_ADD_PARAMETERS_TO_QUERY="question.how-to-add-parameters-to-query",e.QUESTION_HOW_TO_ADD_CONSTANTS_TO_QUERY="question.how-to-add-constants-to-query",e.QUESTION_HOW_TO_WRITE_SERVICE_CONNECTION_TEST_DATA="question.how-to-write-service-connection-test-data",e.QUESTION_HOW_TO_CREATE_A_DATA_ELEMENT="question.how-to-create-a-data-element"}(Ed=Ed||(Ed={}));const fd=(0,st.Pi)((e=>{const{configState:t}=e,s=Mt();return(0,x.jsxs)("div",{className:"text-search-advanced-config__panel",children:[(0,x.jsxs)("div",{className:"text-search-advanced-config__panel__header__label",children:["search config",(0,x.jsx)("button",{className:"text-search-advanced-config__panel__header__hint",tabIndex:-1,onClick:()=>s.assistantService.openDocumentationEntry(Ed.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,x.jsx)(Yc.uMt,{})})]}),(0,x.jsx)("div",{children:(0,x.jsx)(gd,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[pt.STANDARD,pt.INCLUDE,pt.EXACT,pt.INVERSE],size:1})})]})})),Td=(0,st.Pi)((e=>{const{entry:t}=e,s=Mt(),i=()=>{t.isOpen||Ot.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},n=s.guardUnhandledError((()=>s.copyTextToClipboard(t.documentationKey)));return(0,x.jsx)(Qc,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsx)(ed,{children:(0,x.jsx)(td,{onClick:n,children:"Copy Documentation Key"})}),children:(0,x.jsxs)("div",{className:"virtual-assistant__doc-entry",children:[(0,x.jsxs)("div",{className:"virtual-assistant__doc-entry__header",children:[(0,x.jsx)("button",{className:(0,Dc.clsx)("virtual-assistant__doc-entry__expand-icon",{"virtual-assistant__doc-entry__expand-icon--disabled":!t.content}),disabled:!t.content,tabIndex:-1,onClick:i,children:t.isOpen?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.XCv,{})}),t.url?(0,x.jsx)("a",{className:"virtual-assistant__doc-entry__title virtual-assistant__doc-entry__title--link",rel:"noopener noreferrer",target:"_blank",href:t.url,onClick:()=>{Ot.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey})},title:"Click to see external documentation",children:t.title}):(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__title",onClick:i,children:t.title})]}),t.isOpen&&t.content&&(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__content",children:X(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__content__text",children:t.content}):(0,x.jsx)(ad,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),Cd=(0,st.Pi)((()=>{const e=Mt(),t=e.assistantService.currentContextualDocumentationEntry,s=e.guardUnhandledError((()=>e.copyTextToClipboard(t?.context??""))),i=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.currentContext?.key??""))),n=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.contextStack.map((e=>e.key)).join(" > "))));return(0,x.jsxs)(Qc,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(ed,{children:[(0,x.jsx)(td,{onClick:s,children:"Copy Context ID"}),(0,x.jsx)(td,{onClick:i,children:"Copy Current Context ID"}),(0,x.jsx)(td,{onClick:n,children:"Copy Context Stack"})]}),children:[t&&(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__content",children:[t.title&&(0,x.jsx)("div",{className:"virtual-assistant__contextual-support__title",children:t.title}),t.content&&(0,x.jsx)(x.Fragment,{children:X(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,x.jsx)(ad,{className:"virtual-assistant__contextual-support__markdown-text",value:t.content})}),t.related.length&&(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries",children:[(0,x.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries__title",children:["Related entries (",t.related.length,")"]}),t.related.map((e=>(0,x.jsx)(Td,{entry:e},e.uuid)))]})]}),!t&&(0,x.jsx)(od,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Yc.jZm,{className:"virtual-assistant__panel__placeholder__icon"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No contextual documentation found!"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__instruction",children:"Keep using the app. When contextual help is available, we will let you know!"})]})})]})})),xd=(0,st.Pi)((()=>{const e=Mt(),t=(0,it.useRef)(null),s=(0,it.useRef)(null),i=e.assistantService,n=i.searchText,a=(0,it.useMemo)((()=>(0,dd.Z)((()=>i.search()),100)),[i]);return(0,it.useEffect)((()=>{t.current?.focus()}),[]),(0,x.jsxs)("div",{className:"virtual-assistant__search",children:[(0,x.jsxs)("div",{className:"virtual-assistant__search__header",children:[(0,x.jsx)("input",{ref:t,onClick:()=>{document.querySelectorAll('[role="dialog"]').length&&t.current!==document.activeElement&&i.refreshPanelRendering()},className:(0,Dc.clsx)("virtual-assistant__search__input input--dark",{"virtual-assistant__search__input--searching":n}),spellCheck:!1,onChange:e=>{i.setSearchText(e.target.value),a()},value:n,placeholder:"Ask me a question"}),n&&(0,x.jsx)("div",{className:"virtual-assistant__search__input__search__count",children:i.searchResults.length+(i.isOverSearchLimit?"+":"")}),(0,x.jsx)("button",{ref:s,className:(0,Dc.clsx)("virtual-assistant__search__input__config__trigger",{"virtual-assistant__search__input__config__trigger--toggled":i.showSearchConfigurationMenu,"virtual-assistant__search__input__config__trigger--active":i.searchConfigurationState.isAdvancedSearchActive}),tabIndex:-1,onClick:()=>i.setShowSearchConfigurationMenu(!i.showSearchConfigurationMenu),title:(i.searchConfigurationState.isAdvancedSearchActive?"Advanced search is currently active\n":"")+"Click to toggle search config menu",children:(0,x.jsx)(Yc.IEm,{})}),n?(0,x.jsx)("button",{className:"virtual-assistant__search__input__clear-btn",tabIndex:-1,onClick:()=>{i.resetSearch(),i.currentDocumentationEntry=void 0,t.current?.focus()},title:"Clear",children:(0,x.jsx)(Yc.q1B,{})}):(0,x.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,x.jsx)(Yc.W1M,{})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,x.jsx)($c,{isLoading:i.searchState.isInProgress}),(0,x.jsx)("div",{className:(0,Dc.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":i.showSearchConfigurationMenu}),children:(0,x.jsx)(fd,{configState:i.searchConfigurationState})}),i.currentDocumentationEntry&&(0,x.jsx)("div",{className:"virtual-assistant__search__results",children:(0,x.jsx)(Td,{entry:i.currentDocumentationEntry},i.currentDocumentationEntry.uuid)}),!i.currentDocumentationEntry&&(0,x.jsxs)(x.Fragment,{children:[Boolean(i.searchResults.length)&&(0,x.jsx)("div",{className:"virtual-assistant__search__results",children:i.searchResults.map((e=>(0,x.jsx)(Td,{entry:e},e.uuid)))}),n&&!i.searchResults.length&&(0,x.jsx)(od,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Yc.DXi,{className:"virtual-assistant__panel__placeholder__icon"}),(0,x.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No result..."})]})}),!n&&!i.searchResults.length&&(0,x.jsx)(Qc,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(ed,{children:[(0,x.jsx)(td,{onClick:()=>{pe(`documentation-registry_${(0,hd.Z)(new Date(Date.now()),De)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),ne.APPLICATION_JSON)},children:"Download documentation registry"}),(0,x.jsx)(td,{onClick:()=>{pe(`documentation-registry_${(0,hd.Z)(new Date(Date.now()),De)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),ne.APPLICATION_JSON)},children:"Download contextual documentation mapping"})]}),children:(0,x.jsxs)("div",{className:"virtual-assistant__character",children:[(0,x.jsxs)("div",{className:"virtual-assistant__character__figure",children:[(0,x.jsx)(Yc.Oag,{className:"virtual-assistant__character__hat"}),(0,x.jsx)(Yc.ce8,{className:"virtual-assistant__character__glasses"}),(0,x.jsx)(Yc.dRK,{className:"virtual-assistant__character__beard"})]}),(0,x.jsx)("div",{className:"virtual-assistant__character__greeting",children:"Bonjour, It's Pierre!"}),(0,x.jsx)("div",{className:"virtual-assistant__character__question",children:"How can I help today?"})]})})]})]})]})})),Nd=(0,st.Pi)((e=>{const{triggerElement:t}=e,s=Mt().assistantService,i=s.currentContextualDocumentationEntry,n=s.selectedTab;return(0,x.jsx)(cd,{open:s.isOpen,className:"virtual-assistant__panel__container",anchorEl:t,hideBackdrop:!0,PaperProps:{classes:{root:"virtual-assistant__panel__container__root"}},disableEnforceFocus:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"},children:(0,x.jsxs)("div",{className:"virtual-assistant__panel",tabIndex:0,onKeyDown:e=>{"Tab"===e.key&&(e.preventDefault(),e.stopPropagation())},children:[(0,x.jsxs)("div",{className:"virtual-assistant__panel__header",children:[(0,x.jsxs)("div",{className:"virtual-assistant__panel__header__tabs",children:[(0,x.jsx)("div",{className:(0,Dc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===_t.SEARCH}),onClick:()=>s.setSelectedTab(_t.SEARCH),title:"Search",children:(0,x.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,x.jsx)(Yc.W1M,{})})}),(0,x.jsx)("div",{className:(0,Dc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===_t.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(_t.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,x.jsx)(Yc.kdY,{}),i&&(0,x.jsx)("div",{className:"virtual-assistant__panel__header__tab__indicator",title:"Contextual support available"})]})})]}),(0,x.jsx)("div",{className:"virtual-assistant__panel__header__actions",children:(0,x.jsx)("button",{className:"virtual-assistant__panel__header__action",tabIndex:-1,onClick:()=>s.setIsOpen(!1),title:"Close panel",children:(0,x.jsx)(Yc.Two,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__panel__content",children:[n===_t.SEARCH&&(0,x.jsx)(xd,{}),n===_t.CONTEXTUAL_SUPPORT&&(0,x.jsx)(Cd,{})]})]})},s.panelRenderingKey)})),Od=(0,st.Pi)((()=>{const[e,t]=(0,it.useState)(!1),[s,i]=(0,it.useState)((0,a.Z)()),n=Mt(),r=(0,it.useRef)(null),o=n.assistantService,l=o.currentContextualDocumentationEntry;return(0,it.useEffect)((()=>{o.isHidden&&i((0,a.Z)())}),[o.isHidden]),(0,x.jsx)(ud,{bounds:"parent",onStart:()=>t(!0),onStop:()=>t(!1),handle:".virtual-assistant__station__drag-handle",children:(0,x.jsxs)("div",{className:"virtual-assistant",ref:r,children:[(0,x.jsxs)("div",{className:(0,Dc.clsx)("virtual-assistant__station",{"virtual-assistant__station--hidden":o.isHidden,"virtual-assistant__station--active":Boolean(l)}),children:[(0,x.jsx)("button",{className:"virtual-assistant__station__trigger",tabIndex:-1,onClick:()=>{!o.isOpen&&l&&o.setSelectedTab(_t.CONTEXTUAL_SUPPORT),o.setIsOpen(!o.isOpen)},title:o.isOpen?"Click to close assistant panel":(l?"Contextual support available.\n":"")+"Click to open assistant panel...",children:o.isOpen?(0,x.jsx)(Yc.Two,{className:"virtual-assistant__station__trigger__close"}):l?(0,x.jsx)(Yc.J$M,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,x.jsx)(Qc,{className:(0,Dc.clsx)("virtual-assistant__station__drag-handle",{"virtual-assistant__station__drag-handle--dragging":e}),menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(ed,{children:[(0,x.jsx)(td,{onClick:()=>{o.setIsOpen(!1),i((0,a.Z)())},children:"Reset Position"}),(0,x.jsx)(td,{onClick:()=>n.assistantService.hideAssistant(),children:"Hide Assistant"})]}),children:(0,x.jsx)("div",{className:"virtual-assistant__station__drag-handle__content",title:e?void 0:"Grab to drag assistant",children:(0,x.jsx)(Yc.POq,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,x.jsx)(Nd,{triggerElement:r.current})]})},s)})),Ad="app.container",Sd="app.backdrop-container",yd=["Meta+KeyP","Control+KeyP","Meta+KeyS","Control+KeyS","F8","F10","F11","Meta+Shift+KeyP","Control+Shift+KeyP","Meta+KeyB","Control+KeyB","F7","Alt+F7"],Id=e=>(0,x.jsx)("div",{className:"backdrop__container",id:e.elementID}),vd=(0,st.Pi)((e=>{const{children:t}=e,s=Mt(),i=s.backdropContainerElementID?document.getElementById(s.backdropContainerElementID)??document.getElementById(Sd):document.getElementById(Sd),n=((e,t)=>{const s={};return e.forEach(((e,i)=>{e&&(s[i]={combinations:[e],handler:t(e)})})),s.INTERNAL__PLATFORM_NATIVE_KEYBOARD_COMMAND={combinations:yd,handler:e=>{e?.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,(e=>t=>{yd.includes(e)&&t?.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,it.useEffect)((()=>{const e=function(e){const t=new Map;let s=null;return i=>{i instanceof KeyboardEvent&&(Object.values(e).flatMap((e=>e.combinations.map((t=>({combination:t,handler:e.handler}))))).filter((e=>e.combination.length)).forEach((e=>{const s=e.combination,n=e.combination.trim().split(" ").map((e=>{const t=e.split(/\b\+/),s=B(t.pop(),"Can't parse key binding: last part must be a non-modifier key");return{modifiers:t,key:s}}));if(!n.length)return;const a=t.get(s)??n,r=B(a[0]),o=((e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![Xc.SHIFT,Xc.META,Xc.ALT,Xc.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))))(i,r);o?a.length>1?t.set(s,a.slice(1)):(t.delete(s),e.handler(i)):i.getModifierState(i.key)||t.delete(s)})),s&&clearTimeout(s),s=setTimeout(t.clear.bind(t),1e3))}}(n);return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n]),(0,x.jsxs)(vc,{children:[(0,x.jsx)(Hc,{}),(0,x.jsx)(Bc,{}),(0,x.jsx)(Zc,{}),s.showBackdrop&&(0,x.jsx)(Rc.Z,{container:i,children:(0,x.jsx)(Pc.Z,{className:"backdrop",open:s.showBackdrop})}),(0,x.jsx)(wc.W,{backend:Lc.PD,children:(0,x.jsxs)("div",{className:"app__container",id:Ad,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,x.jsx)(Id,{elementID:Sd}),(0,x.jsx)(Od,{}),t]})})]})}));class Rd{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const Pd=(0,it.createContext)(void 0),wd=({children:e})=>{const t=Mt(),s=(0,st.fv)((()=>new Rd(t)));return(0,x.jsx)(Pd.Provider,{value:s,children:e})};var Ld,bd;!function(e){e.CONCEPT="CONCEPT",e.FILE="FILE"}(Ld=Ld||(Ld={})),function(e){e.CONSOLE="CONSOLE",e.SEARCH_RESULT="SEARCH_RESULT",e.TEST_RUNNER="TEST_RUNNER"}(bd=bd||(bd={}));const Dd="dummy_problem_marker_owner",Md=e=>e.startsWith("/")?e.substring(1,e.length):e;class kd{content;constructor(){(0,O.rC)(this,{content:O.LO,setContent:O.aD})}setContent(e){this.content=e}}(0,ze.yu)(kd,{content:(0,ze.Ru)()});class Fd{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class jd extends Fd{error;constructor(e,t,s,i){super(e,t,s),this.error=i}}class Ud{uuid=(0,a.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class Vd{currentTab;tabs=[];constructor(){(0,O.rC)(this,{currentTab:O.LO,tabs:O.LO,setCurrentTab:O.aD,closeTab:O.aD,closeAllTabs:O.aD,closeAllOtherTabs:O.aD,openTab:O.aD,swapTabs:O.aD})}setCurrentTab(e){this.currentTab=e}closeAllOtherTabs(e){z(this.tabs.find((t=>t===e)),"Specified tab should be currently opened"),this.setCurrentTab(e),this.tabs=[e]}closeAllTabs(){this.setCurrentTab(void 0),this.tabs=[]}swapTabs(e,t){L(this.tabs,e,t)}openTab(e){if(!this.tabs.find((t=>t.match(e))))if(this.currentTab){const t=this.tabs.findIndex((e=>e===this.currentTab));this.tabs.splice(t+1,0,e)}else this.tabs.push(e);this.setCurrentTab(e),e.onOpen()}closeTab(e){const t=this.tabs.findIndex((t=>t.match(e)));if(Z(-1!==t,"Can't close a tab which is not opened"),this.tabs.splice(t,1),this.currentTab===e)if(this.tabs.length){const e=t-1;this.setCurrentTab(e>=0?this.tabs[e]:this.tabs[0])}else this.setCurrentTab(void 0);e.onClose()}}class Gd extends Ud{editorStore;constructor(e){super(),this.editorStore=e}}class zd extends Vd{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}}var Bd;!function(e){e.SEARCH_FILE="editor.search.file",e.SEARCH_TEXT="editor.search.text",e.GO_TO_FILE="editor.go-to-file",e.TOGGLE_AUX_PANEL="editor.toggle-auxiliary-panel",e.EXECUTE="editor.execute",e.FULL_RECOMPILE="editor.full-compile",e.FULL_RECOMPILE_WITH_FULL_INIT="editor.full-compile.with-init",e.RUN_ALL_TESTS="editor.run-all-tests",e.RUN_RELAVANT_TESTS="editor.run-relavant-tests",e.GO_TO_DEFINITION="editor.file-editor.go-to-definition",e.GO_BACK="editor.file-editor.go-back",e.FIND_USAGES="editor.file-editor.find-usage"}(Bd=Bd||(Bd={}));const $d={[Bd.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN"},[Bd.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF"},[Bd.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[Bd.TOGGLE_AUX_PANEL]:{title:"Toggle auxiliary panel",defaultKeyboardShortcut:"Control+Backquote"},[Bd.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[Bd.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[Bd.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[Bd.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[Bd.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"},[Bd.GO_TO_DEFINITION]:{title:"Go to definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[Bd.GO_BACK]:{title:"Go back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[Bd.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"}};var Hd;!function(e){e.RECENTER="editor.diagram-editor.recenter",e.USE_ZOOM_TOOL="editor.diagram-editor.use-zoom-tool",e.USE_VIEW_TOOL="editor.diagram-editor.use-view-tool",e.USE_PAN_TOOL="editor.diagram-editor.use-pan-tool"}(Hd=Hd||(Hd={}));const Yd={[Hd.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[Hd.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[Hd.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[Hd.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};class Wd{model;editor;viewState;forcedCursorPosition;wrapText=!1;constructor(e){(0,O.rC)(this,{viewState:O.LO.ref,editor:O.LO.ref,forcedCursorPosition:O.LO.ref,wrapText:O.LO,setViewState:O.aD,setEditor:O.aD,setForcedCursorPosition:O.aD,setWrapText:O.aD}),this.model=A.editor.createModel(e.uuid,C.PURE),this.model.updateOptions({tabSize:2})}setViewState(e){this.viewState=e}setEditor(e){this.editor=e}setForcedCursorPosition(e){this.forcedCursorPosition=e}setWrapText(e){const t=this.wrapText;this.wrapText=e,t!==e&&this.editor&&(this.editor.updateOptions({wordWrap:e?"on":"off"}),this.editor.focus())}}class Kd extends Gd{file;filePath;textEditorState=new Wd(this);constructor(e,t,s){super(e),(0,O.rC)(this,{file:O.LO,setFile:O.aD}),this.file=t,this.filePath=s}get label(){return Md(this.filePath)}get description(){return`File: ${Md(this.filePath)}`}get fileName(){return B((e=this.filePath.split("/")).length?e[e.length-1]:void 0);var e}match(e){return e instanceof Kd&&this.filePath===e.filePath}onClose(){this.textEditorState.model.dispose()}setFile(e){this.file=e}showError(e){var t,s,i;t=this.textEditorState.model,s=[{message:e.error.message,startLineNumber:e.line,startColumn:e.column,endLineNumber:e.line,endColumn:e.column}],i=this.uuid,A.editor.setModelMarkers(t,i??Dd,s.map((e=>({startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn+1,message:""===e.message?"(no error message)":e.message,severity:A.MarkerSeverity.Error}))))}clearError(){var e;e=this.uuid,A.editor.removeAllMarkers(e??Dd)}registerCommands(){this.editorStore.applicationStore.commandCenter.registerCommand({key:Bd.GO_TO_DEFINITION,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&(0,O.fl)(this.editorStore.executeNavigation(new Fd(this.filePath,e.lineNumber,e.column))).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Bd.GO_BACK,action:()=>{(0,O.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Bd.FIND_USAGES,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){const t=new Fd(this.filePath,e.lineNumber,e.column);(0,O.fl)(this.editorStore.findUsages(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}})}deregisterCommands(){[Bd.GO_TO_DEFINITION,Bd.GO_BACK,Bd.FIND_USAGES].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class Zd{editorStore;treeData;selectedNode;loadInitialDataState=gt.create();refreshDataState=gt.create();constructor(e){(0,O.rC)(this,{treeData:O.LO.ref,loadInitialDataState:O.LO,refreshDataState:O.LO,initialize:O.ls,expandNode:O.ls,openNode:O.ls,refreshTreeData:O.ls,setTreeData:O.aD,setSelectedNode:O.aD}),this.editorStore=e}getTreeData(){return B(this.treeData,"Tree data has not been initialized")}*initialize(){if(this.loadInitialDataState.isInProgress)this.editorStore.applicationStore.notifyWarning("Tree state initialization is in progress");else{this.loadInitialDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes()),this.loadInitialDataState.pass()}catch(e){j(e),this.editorStore.applicationStore.notifyError(e),this.loadInitialDataState.fail()}}}setSelectedNode(e){e!==this.selectedNode&&(this.selectedNode&&(this.selectedNode.isSelected=!1),e&&(e.isSelected=!0),this.selectedNode=e,this.refreshTree())}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...B(this.treeData)})}*expandNode(e){if(!e.isLoading)if(this.getTreeData().nodes.has(e.id)&&e.childrenIds)e.isLoading=!1,e.isOpen=!0,this.refreshTree();else{e.isLoading=!0;try{const t=yield this.getChildNodes(e);this.processChildNodes(e,t),e.isOpen=!0,this.refreshTree()}catch(e){j(e),this.editorStore.applicationStore.notifyError(e)}finally{e.isLoading=!1}}}*refreshTreeData(){const e=new Set(Array.from(this.getTreeData().nodes.values()).filter((e=>e.isOpen)).map((e=>e.id))),t=this.selectedNode?.id;this.refreshDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes())}catch(e){return j(e),this.editorStore.applicationStore.notifyError(e),void this.refreshDataState.fail()}const s=this.getTreeData().rootIds.map((e=>B(this.getTreeData().nodes.get(e)))).filter((t=>e.has(t.id)));yield this.refreshOpenNodes(s,e),t&&this.getTreeData().nodes.has(t)&&this.setSelectedNode(B(this.getTreeData().nodes.get(t)))}async refreshOpenNodes(e,t){return await Promise.all(e.map((e=>(t.delete(e.id),(0,O.fl)(this.expandNode(e)).catch((()=>{})))))),(e=e.flatMap((e=>e.childrenIds??[])).map((e=>B(this.getTreeData().nodes.get(e)))).filter((e=>t.has(e.id)))).length?this.refreshOpenNodes(e,t):Promise.resolve()}}class Xd{id;path}class qd extends Xd{file;statusType}(0,ze.yu)(qd,{id:(0,ze.Ru)(),path:(0,ze.Ru)(),file:(0,ze.Ru)(),statusType:(0,ze.Ru)()});class Jd extends Xd{repo}(0,ze.yu)(Jd,{id:(0,ze.Ru)(),path:(0,ze.Ru)(),repo:(0,ze.Ru)()});class Qd{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof Jd}get isFileNode(){return this.li_attr instanceof qd}getNodeAttribute(e){return Y(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,ze.yu)(Qd,{li_attr:(0,ze.PG)((()=>ze.AM),(e=>e.file&&"true"===e.file?(0,ze.vB)(qd,e):(0,ze.vB)(Jd,e))),text:(0,ze.Ru)(),icon:(0,ze.Ru)(),children:(0,ze.Ru)(),state:(0,ze.Ru)()});const eh=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},th=e=>e.endsWith(".pure"),sh=e=>`file_${e}`;class ih extends Zd{nodeForCreateNewFile;nodeForCreateNewDirectory;constructor(e){super(e),(0,O.rC)(this,{nodeForCreateNewFile:O.LO,nodeForCreateNewDirectory:O.LO,setNodeForCreateNewFile:O.aD,setNodeForCreateNewDirectory:O.aD,revealPath:O.ls})}setNodeForCreateNewFile=e=>{Z(!e||e.data.isFolderNode,"Node selected for creating a new file from must be a directory"),this.nodeForCreateNewFile=e};setNodeForCreateNewDirectory=e=>{Z(!e||e.data.isFolderNode,"Node selected for creating a new directory from must be a directory"),this.nodeForCreateNewDirectory=e};async getRootNodes(){return(await this.editorStore.client.getDirectoryChildren()).map((e=>(0,ze.vB)(Qd,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.editorStore.client.getDirectoryChildren(e.data.li_attr.path)).map((e=>(0,ze.vB)(Qd,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((e=>{const t=e.li_attr.id;i.push(t),s.nodes.set(t,{data:e,id:t,label:e.text,isLoading:!1})})),e.childrenIds=i}*openNode(e){e.data.isFileNode&&(yield(0,O.fl)(this.editorStore.loadFile(e.data.li_attr.path)))}*revealPath(e,t,s){t&&this.editorStore.setActiveActivity(Ld.FILE,{keepShowingIfMatchedCurrent:!0});const i=[];let n=e;for(;n;)i.unshift(n),n=eh(n);for(const e of i)if(th(e))yield(0,O.fl)(this.editorStore.loadFile(e,s));else{const t=B(this.getTreeData().nodes.get(sh(e)),`Can't find directory node with path '${e}'`);yield(0,O.fl)(this.expandNode(t))}const a=B(this.getTreeData().nodes.get(sh(e)),`Can't find file node with path '${e}'`);this.setSelectedNode(a)}}var nh,ah,rh,oh;!function(e){e.PACKAGE="Package",e.PROFILE="Profile",e.CLASS="Class",e.ASSOCIATION="Association",e.PROPERTY="Property",e.ENUMERATION="Enumeration",e.ENUM_VALUE="Enum",e.MEASURE="Measure",e.UNIT="Unit",e.FUNCTION="ConcreteFunctionDefinition",e.NATIVE_FUNCTION="NativeFunction",e.DIAGRAM="Diagram",e.DATABASE="Database",e.MAPPING="Mapping"}(nh=nh||(nh={}));class lh{pureId;pureType;get id(){return this.pureId}}class ch extends lh{deprecated}(0,ze.yu)(ch,{pureId:(0,ze.Ru)(),pureType:(0,ze.Ru)(),deprecated:(0,ze.Ru)()});class dh extends lh{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,ze.yu)(dh,{pureId:(0,ze.Ru)(),pureType:(0,ze.Ru)(),RO:(0,ze.Ru)(),classPath:(0,ze.Ru)(),file:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)()});class hh extends lh{RO;notpublic;user;file;line;column}(0,ze.yu)(hh,{pureId:(0,ze.Ru)(),pureType:(0,ze.Ru)(),RO:(0,ze.Ru)(),notpublic:(0,ze.Ru)(),user:(0,ze.Ru)(),file:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)()});class uh{li_attr;id;text;icon;children;state;getNodeAttribute(e){return Y(this.li_attr,e,`Expected concept node attribute to be of type '${e.name}'`)}}(0,ze.yu)(uh,{li_attr:(0,ze.PG)((()=>ze.AM),(e=>e.classPath?(0,ze.vB)(dh,e):e.file?(0,ze.vB)(hh,e):(0,ze.vB)(ch,e))),id:(0,ze.Ru)(),text:(0,ze.Ru)(),icon:(0,ze.Ru)(),children:(0,ze.Ru)(),state:(0,ze.Ru)()});class ph extends Zd{loadConceptActivity=gt.create();statusText;constructor(e){super(e),(0,O.rC)(this,{statusText:O.LO,setStatusText:O.aD,pullConceptsActivity:O.aD,pollConceptsActivity:O.ls})}setStatusText(e){this.statusText=e}async getRootNodes(){return await(0,O.fl)(this.pollConceptsActivity()),(await this.editorStore.client.getConceptChildren()).map((e=>(0,ze.vB)(uh,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.editorStore.client.getConceptChildren(e.data.li_attr.pureId)).map((e=>(0,ze.vB)(uh,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((e=>{const t=e.li_attr.id;i.push(t),s.nodes.set(t,{data:e,id:t,label:e.text,isLoading:!1})})),e.childrenIds=i}*openNode(e){(e.data.li_attr instanceof dh||e.data.li_attr instanceof hh)&&("Diagram"===e.data.li_attr.pureType?yield(0,O.fl)(this.editorStore.loadDiagram(e.data.li_attr.file,e.data.li_attr.pureId,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10))):yield(0,O.fl)(this.editorStore.loadFile(e.data.li_attr.file,new Fd(e.data.li_attr.file,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10)))))}*pollConceptsActivity(){if(this.loadConceptActivity.isInInitialState){this.loadConceptActivity.inProgress(),this.setStatusText("Loading concepts activity...");try{yield this.pullConceptsActivity()}finally{this.setStatusText(void 0),this.loadConceptActivity.reset()}}}async pullConceptsActivity(){const e=await this.editorStore.client.getConceptActivity();return e.text&&this.setStatusText(`Preparing - ${e.text}`),e.initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullConceptsActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}}class _h{cached;datamarts;text}(0,ze.yu)(_h,{cached:(0,ze.Ru)(),datamarts:(0,ze.pb)((0,ze.Ru)()),text:(0,ze.Ru)()});class mh extends _h{error;sessionError}(0,ze.yu)(mh,{cached:(0,ze.Ru)(),datamarts:(0,ze.pb)((0,ze.Ru)()),text:(0,ze.Ru)(),error:(0,ze.Ru)(),sessionError:(0,ze.Ru)()});class gh extends mh{RO;line;column;source}(0,ze.yu)(gh,{cached:(0,ze.Ru)(),datamarts:(0,ze.pb)((0,ze.Ru)()),text:(0,ze.Ru)(),RO:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),source:(0,ze.Ru)(),error:(0,ze.Ru)(),sessionError:(0,ze.Ru)()});class Eh{text;reinit}class fh extends Eh{cache;modifiedFiles=[]}(0,ze.yu)(fh,{text:(0,ze.Ru)(),cache:(0,ze.Ru)(),modifiedFiles:(0,ze.pb)((0,ze.Ru)()),reinit:(0,ze.Ru)()});class Th extends Eh{RO;line;column;source;error;sessionError}(0,ze.yu)(Th,{text:(0,ze.Ru)(),RO:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),source:(0,ze.Ru)(),error:(0,ze.Ru)(),sessionError:(0,ze.Ru)()});class Ch{RO;line;column;source}(0,ze.yu)(Ch,{RO:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),source:(0,ze.Ru)()});class xh extends Eh{jumpTo}(0,ze.yu)(xh,{text:(0,ze.Ru)(),jumpTo:(0,ze.Ry)(Ch)});class Nh{uuid=(0,a.Z)();sourceID;line;column;foundName}(0,ze.yu)(Nh,{sourceID:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),foundName:(0,ze.Ru)()});class Oh{uuid=(0,a.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,ze.yu)(Oh,{sourceID:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),foundName:(0,ze.Ru)(),add:(0,ze.Ru)(),messageToBeModified:(0,ze.Ru)(),fileToBeModified:(0,ze.Ru)(),lineToBeModified:(0,ze.Ru)(),columnToBeModified:(0,ze.Ru)()});class Ah extends Th{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,ze.yu)(Ah,{candidateName:(0,ze.Ru)(),candidatesWithPackageImported:(0,ze.pb)((0,ze.Ry)(Nh)),candidatesWithPackageNotImported:(0,ze.pb)((0,ze.Ry)(Oh))});class Sh extends Th{candidateName;candidates=[]}(0,ze.yu)(Sh,{candidateName:(0,ze.Ru)(),candidates:(0,ze.pb)((0,ze.Ry)(Oh))});class yh{id;parentId;file;line;column}(0,ze.yu)(yh,{id:(0,ze.Ru)(),parentId:(0,ze.Ru)(),file:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)()});class Ih{children=[];li_attr;text;type}(0,ze.yu)(Ih,{children:(0,ze.pb)((0,ze.Ry)(Ih)),li_attr:(0,ze.Ry)(yh),text:(0,ze.Ru)(),type:(0,ze.Ru)()});class vh extends Eh{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,ze.yu)(vh,{count:(0,ze.Ru)(),filterPaths:(0,ze.pb)((0,ze.Ru)()),path:(0,ze.Ru)(),relevantTestsOnly:(0,ze.Ru)(),runnerId:(0,ze.Ru)(),tests:(0,ze.pb)((0,ze.Ry)(Ih))});class Rh{uuid=(0,a.Z)()}class Ph{uuid=(0,a.Z)();startLine;startColumn;endLine;endColumn;constructor(e,t,s,i){this.startLine=e,this.startColumn=t,this.endLine=s,this.endColumn=i}}(0,ze.yu)(Ph,{startLine:(0,ze.Ru)(),startColumn:(0,ze.Ru)(),endLine:(0,ze.Ru)(),endColumn:(0,ze.Ru)()});class wh extends Rh{sourceId;coordinates=[];constructor(){super(),(0,O.rC)(this,{coordinates:O.LO,dismissCoordinate:O.aD})}setCoordinates(e){this.coordinates=e}dismissCoordinate(e){b(this.coordinates,e)}}(0,ze.yu)(wh,{sourceId:(0,ze.Ru)(),coordinates:(0,ze.pb)((0,ze.Ry)(Ph))});class Lh{editorStore;constructor(e){this.editorStore=e}}class bh extends Lh{searchEntries=[];constructor(e,t){super(e),(0,O.rC)(this,{searchEntries:O.LO,numberOfFiles:O.Fl,numberOfResults:O.Fl}),this.searchEntries=t}dismissSearchEntry(e){b(this.searchEntries,e),this.searchEntries.length||this.editorStore.setSearchState(void 0)}get numberOfFiles(){return this.searchEntries.length}get numberOfResults(){return this.searchEntries.flatMap((e=>e.coordinates)).length}}class Dh extends bh{}class Mh extends bh{usageConcept;constructor(e,t,s){const i=new Map;s.forEach((e=>{let t;i.has(e.source)?t=B(i.get(e.source)):(t=new wh,t.sourceId=e.source,i.set(e.source,t)),t.coordinates.push(new Ph(e.startLine,e.startColumn,e.endLine,e.endColumn))})),super(e,Array.from(i.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=B(i.get(e));return t.setCoordinates(t.coordinates.sort(((e,t)=>e.startColumn-t.startColumn)).sort(((e,t)=>e.startLine-t.startLine))),t}))),this.usageConcept=t}}class kh extends Lh{result;constructor(e,t){super(e),this.result=t}}class Fh extends Lh{result;constructor(e,t){super(e),this.result=t}}!function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(ah=ah||(ah={}));class jh{status;test}class Uh extends jh{test=[]}(0,ze.yu)(Uh,{status:(0,ze.Ru)(),test:(0,ze.pb)((0,ze.Ru)())});class Vh{text;RO;line;column;source;error}(0,ze.yu)(Vh,{text:(0,ze.Ru)(),RO:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),source:(0,ze.Ru)(),error:(0,ze.Ru)()});class Gh extends jh{test=[];error}(0,ze.yu)(Gh,{status:(0,ze.Ru)(),test:(0,ze.pb)((0,ze.Ru)()),error:(0,ze.Ry)(Vh)});class zh{}class Bh extends zh{finished;tests=[]}(0,ze.yu)(Bh,{finished:(0,ze.Ru)(),tests:(0,ze.pb)((0,ze.PG)((()=>ze.AM),(e=>e.error?(0,ze.vB)(Gh,e):(0,ze.vB)(Uh,e))))});class $h extends zh{error;text}(0,ze.yu)($h,{error:(0,ze.Ru)(),text:(0,ze.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(rh=rh||(rh={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(oh=oh||(oh={}));class Hh{_START_TIME;total;time=0;passedTests=new Set;failedTests=new Map;testsWithError=new Map;notRunTests;results=new Map;constructor(e){(0,O.rC)(this,{total:O.LO,time:O.LO,passedTests:O.LO,failedTests:O.LO,testsWithError:O.LO,notRunTests:O.LO,results:O.LO,passed:O.Fl,error:O.Fl,failed:O.Fl,passedTestIds:O.Fl,failedTestIds:O.Fl,testWithErrorIds:O.Fl,notRunTestIds:O.Fl,numberOfTestsRun:O.Fl,runPercentage:O.Fl,suiteStatus:O.Fl,setTime:O.aD,addResult:O.aD}),this._START_TIME=Date.now(),this.total=e.size,this.notRunTests=new Set(e)}get passed(){return this.passedTests.size}get error(){return this.testsWithError.size}get failed(){return this.failedTests.size}get passedTestIds(){return Array.from(this.passedTests.values())}get failedTestIds(){return Array.from(this.failedTests.keys())}get testWithErrorIds(){return Array.from(this.testsWithError.keys())}get notRunTestIds(){return Array.from(this.notRunTests.values())}get numberOfTestsRun(){return this.passed+this.error+this.failed}get runPercentage(){return Math.floor(100*this.numberOfTestsRun/this.total)}get suiteStatus(){return this.failed+this.error?rh.FAILED:this.passed?rh.PASSED:rh.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case ah.PASSED:this.passedTests.add(t);break;case ah.FAILED:this.failedTests.set(t,Y(e,Gh));break;case ah.ERROR:this.testsWithError.set(t,Y(e,Gh));break;default:throw new F(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class Yh{editorStore;testExecutionResult;checkTestRunnerState=gt.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=gt.create();treeData;viewAsList=!1;constructor(e,t){(0,O.rC)(this,{testResultInfo:O.LO.ref,allTests:O.LO,selectedTestId:O.LO,treeData:O.LO.ref,viewAsList:O.LO,setViewAsList:O.aD,setSelectedTestId:O.aD,setTestResultInfo:O.aD,setTreeData:O.aD,refreshTree:O.aD,collapseTree:O.aD,expandTree:O.aD,buildTreeDataByLayer:O.aD,pullTestRunnerResult:O.aD,buildTestTreeData:O.ls,pollTestRunnerResult:O.ls,rerunTestSuite:O.ls,cancelTestRun:O.ls}),this.editorStore=e,this.testExecutionResult=t}getTreeData(){return B(this.treeData,"Test tree data has not been initialized")}setViewAsList(e){this.viewAsList=e}setSelectedTestId(e){this.selectedTestId=e}setTestResultInfo(e){this.testResultInfo=e}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...B(this.treeData)})}*buildTestTreeData(){if(this.treeBuildingState.isInProgress)return;this.treeBuildingState.inProgress();const e=this.testExecutionResult.tests.map((e=>{const t=e.li_attr.id;return e.type&&this.allTests.set(t,e),t})),t=new Map;this.treeData={rootIds:e,nodes:t},yield this.buildTreeDataByLayer(this.testExecutionResult.tests),this.treeBuildingState.reset()}collapseTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),this.refreshTree()}expandTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!0})),this.refreshTree()}async buildTreeDataByLayer(e){const t=this.getTreeData(),s=[];return await Promise.all(e.map((e=>new Promise(((i,n)=>setTimeout((()=>{const a=e.li_attr.id,r={id:a,label:e.text,data:e,childrenIds:e.type?void 0:[],isLoading:!1};if(e.type&&this.allTests.set(a,e),t.nodes.set(a,r),"Root"!==e.li_attr.parentId)try{const s=B(t.nodes.get((o=e,`test${this.testExecutionResult.runnerId}_${o.li_attr.parentId}`)),`Can't find parent test node with ID '${e.li_attr.parentId}'`);s.childrenIds?w(s.childrenIds,a):s.childrenIds=[a]}catch(e){return void n(e)}var o;s.push(...e.children),i()}),0)))))),s.length?this.buildTreeDataByLayer(s):Promise.resolve()}*pollTestRunnerResult(){if(this.checkTestRunnerState.isInInitialState){this.checkTestRunnerState.inProgress();try{Z(this.allTests.size===this.testExecutionResult.count,`Number of tests scanned in tree (${this.allTests.size}) does not match the number of total reported tests (${this.testExecutionResult.count})`);const e=new Hh(new Set(this.allTests.keys()));this.testResultInfo=e,yield this.pullTestRunnerResult(e)}finally{this.checkTestRunnerState.reset()}}}async pullTestRunnerResult(e){const t=(s=await this.editorStore.client.checkTestRunner(this.testExecutionResult.runnerId)).error?(0,ze.vB)($h,s):(0,ze.vB)(Bh,s);var s;return t instanceof Bh?(await Promise.all(t.tests.map((t=>P((()=>{return e.addResult(t,(s=t,`test${this.testExecutionResult.runnerId}_${s.test.join("_")}`));var s}))))),t.finished?Promise.resolve():new Promise(((t,s)=>setTimeout((()=>{try{t(this.pullTestRunnerResult(e))}catch(e){j(e),this.editorStore.applicationStore.notifyWarning("Failed to run test"+(e.message?`: ${e.message}`:"")),s(e)}}),1e3)))):(this.setTestResultInfo(void 0),Promise.resolve())}*rerunTestSuite(){this.editorStore.testRunState.isInProgress||(yield(0,O.fl)(this.editorStore.executeTests(this.testExecutionResult.path,this.testExecutionResult.relevantTestsOnly)))}*cancelTestRun(){this.editorStore.testRunState.isInProgress&&(yield this.editorStore.client.cancelTestRunner(this.testExecutionResult.runnerId),this.editorStore.applicationStore.notifyWarning(`Stopped running test (id: ${this.testExecutionResult.runnerId}) successfully!`))}}const Wh=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Kh{source;line;column;startLine;startColumn;endLine;endColumn}(0,ze.yu)(Kh,{source:(0,ze.Ru)(),line:(0,ze.Ru)(),column:(0,ze.Ru)(),startLine:(0,ze.Ru)(),startColumn:(0,ze.Ru)(),endLine:(0,ze.Ru)(),endColumn:(0,ze.Ru)()});class Zh{}class Xh extends Zh{error;errorDialog;text}(0,ze.yu)(Xh,{error:(0,ze.Ru)(),errorDialog:(0,ze.Ru)(),text:(0,ze.Ru)()});class qh{networkClient;userId="localuser";sessionId=`${this.userId}@${Date.now()}@abcd`;compilerMode;mode;constructor(e){this.networkClient=e}get baseUrl(){return B(this.networkClient.baseUrl,"Pure client has not been configured properly")}initialize=e=>this.networkClient.get(`${this.baseUrl}/initialize`,void 0,void 0,{requestCache:e,sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getInitializationActivity=()=>this.networkClient.get(`${this.baseUrl}/initializationActivity`,void 0,void 0,{sessionId:this.sessionId});getFile=e=>this.networkClient.get(`${this.baseUrl}/fileAsJson/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getDirectoryChildren=e=>this.networkClient.get(`${this.baseUrl}/dir`,void 0,void 0,{parameters:e??"/",mode:this.mode,sessionId:this.sessionId});getConceptChildren=e=>this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::display_ide(String[1]):String[1]",param:e?`'${e}'`:"'::'",format:"raw",mode:this.mode,sessionId:this.sessionId});getConceptActivity=()=>this.networkClient.get(`${this.baseUrl}/conceptsActivity`,void 0,void 0,{sessionId:this.sessionId});execute=(e,t,s)=>this.networkClient.post(`${this.baseUrl}/${t}`,{extraParams:s,openFiles:e},void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getExecutionActivity=()=>this.networkClient.get(`${this.baseUrl}/executionActivity`,void 0,void 0,{sessionId:this.sessionId});findFiles=(e,t)=>this.networkClient.get(`${this.baseUrl}/findPureFiles`,void 0,void 0,{file:e,regex:t});searchText=(e,t,s,i=2e3)=>this.networkClient.get(`${this.baseUrl}/findInSources`,void 0,void 0,{string:e,caseSensitive:t,regex:s,limit:i});checkTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCheck`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});cancelTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCancel`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});getConceptPath=(e,t,s)=>this.networkClient.get(`${this.baseUrl}/getConceptPath`,void 0,void 0,{file:e,line:t,column:s});getUsages=(e,t)=>this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:e,param:t});createFile=e=>this.networkClient.get(`${this.baseUrl}/newFile/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});createFolder=e=>this.networkClient.get(`${this.baseUrl}/newFolder/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});deleteDirectoryOrFile=e=>this.networkClient.get(`${this.baseUrl}/deleteFile/${e}`,void 0,void 0,{sessionId:this.sessionId});getDiagramInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramInfo_String_1__String_1_",param:[`'${e}'`]}));getDiagramClassInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramClassInfo_String_1__String_1_",param:[`'${e}'`]}))}class Jh{_initialDefaultSize;_tempSize;size;defaultSize;snapSize;maxSize;constructor(e){this.size=e.initial,this._tempSize=e.default,this.defaultSize=e.default,this._initialDefaultSize=e.default,this.snapSize=e.snap,(0,O.rC)(this,{_tempSize:O.LO,size:O.LO,defaultSize:O.LO,snapSize:O.LO,maxSize:O.LO,isOpen:O.Fl,isMaximizable:O.Fl,isMaximized:O.Fl,setSize:O.aD,open:O.aD,close:O.aD,toggle:O.aD,setMaxSize:O.aD,maximize:O.aD,minimize:O.aD,toggleMaximize:O.aD})}get isOpen(){return 0!==this.size}get isMaximizable(){return void 0!==this.maxSize}get isMaximized(){return void 0!==this.maxSize&&this.size===this.maxSize}setSize(e){e=Math.max(e,0),this.maxSize&&(e=Math.min(e,this.maxSize)),this.size!==e&&(void 0!==this.snapSize?e>this.size?this.maxSize&&e>this.maxSize-this.snapSize?this.size=this.maxSize:this.size=e<this.snapSize?this.defaultSize:e:this.size=e<this.snapSize?0:e:this.size=e)}open(){0===this.size&&(this.size=this._tempSize)}close(){0!==this.size&&(this._tempSize=this.size||this.defaultSize,this.size=0)}toggle(){0===this.size?this.open():this.close()}setMaxSize(e){this._tempSize=Math.min(this._tempSize,e),this.size=Math.min(this.size,e),this.defaultSize=Math.min(this._initialDefaultSize,e),this.maxSize=e}maximize(){void 0!==this.maxSize&&this.size!==this.maxSize&&(this._tempSize=this.size,this.size=this.maxSize)}minimize(){void 0!==this.maxSize&&this.size===this.maxSize&&(this.size=this._tempSize===this.maxSize?this.defaultSize:this._tempSize)}toggleMaximize(){void 0!==this.maxSize&&(this.size===this.maxSize?this.minimize():this.maximize())}}var Qh,eu=s(1367);class tu{_UUID=(0,a.Z)();_OWNER;name;genericType;multiplicity;stereotypes=[];taggedValues=[];body;parameters;constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return Zt([Xt.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues),Qt(this.parameters,this.body)])}}class su extends ms{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class iu extends su{ownerReference;constructor(e){const t=Es.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new iu(e)}}class nu{_UUID=(0,a.Z)();rawType;constructor(e){this.rawType=e}}class au{_UUID=(0,a.Z)();_OWNER;name;multiplicity;genericType;aggregation;stereotypes=[];taggedValues=[];constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return Zt([Xt.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues)])}}class ru{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Zt([Xt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new ru(0,0);static ZERO_ONE=new ru(0,1);static ZERO_MANY=new ru(0,void 0);static ONE=new ru(1,1);static ONE_MANY=new ru(1,void 0)}class ou extends ms{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Xt.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(Kt).join(",")}}class lu extends ou{ownerReference;constructor(e){const t=Es.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new lu(e)}}class cu extends rs{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new cu(Te.STRING);static BOOLEAN=new cu(Te.BOOLEAN);static BINARY=new cu(Te.BINARY);static NUMBER=new cu(Te.NUMBER);static INTEGER=new cu(Te.INTEGER);static FLOAT=new cu(Te.FLOAT);static DECIMAL=new cu(Te.DECIMAL);static DATE=new cu(Te.DATE);static STRICTDATE=new cu(Te.STRICTDATE);static DATETIME=new cu(Te.DATETIME);static STRICTTIME=new cu(Te.STRICTTIME);static LATESTDATE=new cu(Te.LATESTDATE)}!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(Qh=Qh||(Qh={}));class du extends oc{association;constructor(e,t,s,i,n){super(e,s,i,n),this.association=t}get hashCode(){return Zt([Wo.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const hu=()=>new as(""),uu=(e,t)=>new au("",ru.ONE,iu.create(new nu(e)),t),pu=(0,O.aD)(((e,t)=>{e.value=t})),_u=((0,O.aD)(((e,t)=>{b(e.properties,t)})),(0,O.aD)(((e,t)=>{w(e.properties,Po(t))}))),mu=((0,O.aD)(((e,t,s)=>{L(e.properties,t,s)})),(0,O.aD)(((e,t)=>{b(e.derivedProperties,t)})),(0,O.aD)(((e,t)=>{w(e.derivedProperties,wo(t))})),(0,O.aD)(((e,t,s)=>{L(e.derivedProperties,t,s)})),(0,O.aD)(((e,t)=>{w(e.constraints,bo(t))})),(0,O.aD)(((e,t)=>{b(e.constraints,t)})),(0,O.aD)(((e,t,s)=>{L(e.constraints,t,s)})),(0,O.aD)(((e,t)=>{w(e.generalizations,To(t))}))),gu=((0,O.aD)(((e,t)=>{b(e.generalizations,t)})),(0,O.aD)(((e,t,s)=>{L(e.generalizations,t,s)})),(0,O.aD)(((e,t)=>{w(e._subclasses,t)})),(0,O.aD)(((e,t)=>{b(e._subclasses,t)})),(0,O.aD)(((e,t)=>{To(e),fo(t),e.value=t,e.ownerReference.value=t.rawType}))),Eu=((0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{gu(e.genericType,fo(t))})),(0,O.aD)(((e,t)=>{e.multiplicity=t})),(0,O.aD)(((e,t)=>{e.aggregation=t})),(0,O.aD)(((e,t)=>{e.value=No(t),pu(e.ownerReference,t._OWNER)})),(0,O.aD)(((e,t)=>{w(e.taggedValues,Eo(t))})),(0,O.aD)(((e,t)=>{b(e.taggedValues,t)})),(0,O.aD)(((e,t)=>{w(e.stereotypes,mo(t))})),(0,O.aD)(((e,t)=>{b(e.stereotypes,t)})),(0,O.aD)(((e,t)=>{e.tag.value=Oo(t),e.tag.ownerReference.value=t._OWNER})),(0,O.aD)(((e,t)=>{e.value=t})),(0,O.aD)(((e,t)=>{e.value=t})),(0,O.aD)(((e,t,s)=>{L(e.taggedValues,t,s)})),(0,O.aD)(((e,t,s)=>{L(e.stereotypes,t,s)})),(0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{e.functionDefinition=Vs(t)})),(0,O.aD)(((e,t)=>{w(e.p_tags,Oo(t))})),(0,O.aD)(((e,t)=>{b(e.p_tags,t)})),(0,O.aD)(((e,t)=>{w(e.p_stereotypes,No(t))})),(0,O.aD)(((e,t)=>{b(e.p_stereotypes,t)})),(0,O.aD)(((e,t,s)=>{L(e.p_tags,t,s)})),(0,O.aD)(((e,t,s)=>{L(e.p_stereotypes,t,s)})),(0,O.aD)(((e,t)=>{b(e.parameters,t)})),(0,O.aD)(((e,t)=>{w(e.parameters,Gs(t))})),(0,O.aD)(((e,t)=>{pu(e.returnType,Fo(t))})),(0,O.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,O.aD)(((e,t,s)=>{L(e.parameters,t,s)})),(0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{w(e.values,So(t))})),(0,O.aD)(((e,t)=>{b(e.values,t)})),(0,O.aD)(((e,t,s)=>{L(e.values,t,s)})),(0,O.aD)(((e,t)=>{e.value=So(t),pu(e.ownerReference,t._OWNER)})),(0,O.aD)(((e,t,s)=>{const i=((e,t)=>{const s=e.properties.findIndex((e=>e===t));return Z(-1!==s,`Can't find property '${t.name}' in association '${e.path}'`),B(e.properties[(s+1)%2])})(e,t),n=Y(t.genericType.ownerReference.value,as,`Association property '${t.name}' must be of type 'class'`);var a;((a=n).package||a.name)&&Z(b(n.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${n.path}'`),w(s.propertiesFromAssociations,i);const r=new nu(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,O.aD)(((e,t)=>{e.canonicalUnit=vo(t)})),(0,O.aD)(((e,t)=>{e.conversionFunction=Vs(t)})),(0,O.aD)(((e,t)=>{e.classViews=t.map(Vo)}))),fu=(0,O.aD)(((e,t)=>{w(e.classViews,Vo(t))})),Tu=(0,O.aD)(((e,t)=>{b(e.classViews,t)})),Cu=(0,O.aD)(((e,t)=>{e.associationViews=t.map($o)})),xu=(0,O.aD)(((e,t)=>{b(e.associationViews,t)})),Nu=(0,O.aD)(((e,t)=>{e.generalizationViews=t.map(Bo)})),Ou=(0,O.aD)(((e,t)=>{w(e.generalizationViews,Bo(t))})),Au=(0,O.aD)(((e,t)=>{b(e.generalizationViews,t)})),Su=(0,O.aD)(((e,t)=>{e.propertyViews=t.map(Ho)})),yu=(0,O.aD)(((e,t)=>{w(e.propertyViews,Ho(t))})),Iu=(0,O.aD)(((e,t)=>{b(e.propertyViews,t)})),vu=(0,O.aD)(((e,t)=>{e.hideProperties=t})),Ru=(0,O.aD)(((e,t)=>{e.hideStereotypes=t})),Pu=(0,O.aD)(((e,t)=>{e.hideTaggedValues=t})),wu=(0,O.aD)(((e,t)=>{e._offsetX=t})),Lu=(0,O.aD)(((e,t)=>{e._offsetY=t})),bu=(0,O.aD)(((e,t,s)=>{((e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t)));-1!==n&&(e[n]=s)})(e.path,t,s)})),Du=(0,O.aD)(pc),Mu=(0,O.aD)(((e,t,s,i,n)=>{for(const n of e.path)if(Math.sqrt((t-n.x)*(t-n.x)+(s-n.y)*(s-n.y))<10/i)return n;const a=e.buildFullPath(n),r=[];let o;for(let e=0;e<a.length-1;e++){const n=a[e],l=a[e+1],c=new dc(n.x,n.y).normal(new dc(l.x,l.y)).unit(),d=dc.fromPoints(n,new Ql(t,s));if(Math.abs(c.dotProduct(d))<5/i){const e=(n.x<l.x?n.x:l.x)-5/i,a=(n.x<l.x?l.x:n.x)+5/i,c=(n.y<l.y?n.y:l.y)-5/i,d=(n.y<l.y?l.y:n.y)+5/i;e<=t&&t<=a&&c<=s&&s<=d&&(o=new Ql(t,s),r.push(o))}e<a.length-2&&r.push(a[e+1])}return o&&n&&uc(e,r),o})),ku=(0,O.aD)(uc),Fu=(0,O.aD)(((e,t)=>{e.rectangle=t})),ju=(0,O.aD)(((e,t)=>{e.position=t})),Uu=(0,O.aD)((e=>{e._dummyObservable={}}));var Vu,Gu,zu;!function(e){e[e.LAYOUT=0]="LAYOUT",e[e.PAN=1]="PAN",e[e.ZOOM_IN=2]="ZOOM_IN",e[e.ZOOM_OUT=3]="ZOOM_OUT",e[e.ADD_RELATIONSHIP=4]="ADD_RELATIONSHIP",e[e.ADD_CLASS=5]="ADD_CLASS"}(Vu=Vu||(Vu={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(Gu=Gu||(Gu={})),function(e){e[e.ALIGN_LEFT=0]="ALIGN_LEFT",e[e.ALIGN_CENTER=1]="ALIGN_CENTER",e[e.ALIGN_RIGHT=2]="ALIGN_RIGHT",e[e.ALIGN_TOP=3]="ALIGN_TOP",e[e.ALIGN_MIDDLE=4]="ALIGN_MIDDLE",e[e.ALIGN_BOTTOM=5]="ALIGN_BOTTOM",e[e.SPACE_HORIZONTALLY=6]="SPACE_HORIZONTALLY",e[e.SPACE_VERTICALLY=7]="SPACE_VERTICALLY"}(zu=zu||(zu={}));const Bu=.05,$u=[50,75,90,100,110,125,150,200,250,300,400],Hu=e=>(e instanceof tu?"/ ":"")+e.name;class Yu{diagram;isReadOnly;div;canvas;ctx;canvasDimension;canvasCenter;virtualScreen;screenOffset;zoom;interactionMode;relationshipMode;triangle;diamond;fontFamily;fontSize;lineHeight;truncateText;maxLineLength;screenPadding;classViewSpaceX;classViewSpaceY;propertySpacing;showScreenGrid;showScreenBoxGuide;screenGridAxisTickLength;screenGridSpacingX;screenGridSpacingY;screenGridLineWidth;screenGridLineColor;screenGridLabelTextColor;screenGuideLineColor;screenGuideLabelTextColor;showCanvasGrid;showCanvasBoxGuide;showScreenOffsetGuide;canvasGridAxisTickLength;canvasGridSpacingX;canvasGridSpacingY;canvasGridLineWidth;canvasGridLineColor;canvasGridLabelTextColor;canvasGuideLineColor;canvasGuideLabelTextColor;screenOffsetGuideLineColor;screenOffsetGuideLabelTextColor;defaultLineWidth;defaultLineColor;canvasColor;backgroundColor;classViewFillColor;classViewHeaderTextColor;classViewPropertyTextColor;classViewPrimitivePropertyTextColor;classViewDerivedPropertyTextColor;relationshipViewTextColor;propertyViewOwnedDiamondColor;propertyViewSharedDiamondColor;generalizationViewInheritanceTriangeFillColor;selectionBoxBorderColor;selection;selectionStart;selectedClassCorner;selectedClassProperty;selectedClasses;selectedPropertyOrAssociation;selectedInheritance;selectedPoint;_selectedClassesInitialPositions;startClassView;handleAddRelationship;mouseOverClassCorner;mouseOverClassName;mouseOverClassView;mouseOverClassProperty;mouseOverPropertyHolderViewLabel;cursorPosition;leftClick;middleClick;rightClick;clickX;clickY;positionBeforeLastMove;onAddClassViewClick=()=>{};onClassViewRightClick=()=>{};onBackgroundDoubleClick;onClassViewDoubleClick;onClassNameDoubleClick;onClassPropertyDoubleClick;handleEditClassView=()=>{};handleEditProperty=()=>{};handleAddSimpleProperty=()=>{};constructor(e,t){(0,O.rC)(this,{isReadOnly:O.LO,interactionMode:O.LO,relationshipMode:O.LO,zoom:O.LO,mouseOverClassView:O.LO,mouseOverClassName:O.LO,mouseOverClassCorner:O.LO,mouseOverClassProperty:O.LO,mouseOverPropertyHolderViewLabel:O.LO,selectionStart:O.LO,selectedClassCorner:O.LO,selectedClasses:O.LO,selectedPropertyOrAssociation:O.LO,selectedInheritance:O.LO,leftClick:O.LO,middleClick:O.LO,rightClick:O.LO,changeMode:O.aD,setIsReadOnly:O.aD,setMouseOverClassView:O.aD,setMouseOverClassName:O.aD,setMouseOverClassCorner:O.aD,setMouseOverClassProperty:O.aD,setMouseOverPropertyHolderViewLabel:O.aD,setSelectionStart:O.aD,setSelectedClassCorner:O.aD,setSelectedClasses:O.aD,setSelectedPropertyOrAssociation:O.aD,setSelectedInheritance:O.aD,setLeftClick:O.aD,setMiddleClick:O.aD,setRightClick:O.aD,setZoomLevel:O.aD,align:O.aD}),this.diagram=t,this.div=e,this.div.childNodes.forEach((e=>this.div.removeChild(e))),this.canvas=document.createElement("canvas"),this.canvasDimension=new ec(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Ql(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height,this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.div.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.screenOffset=new Ql(0,0),this.virtualScreen=new tc(new Ql(0,0),new ec(0,0)),this.zoom=1,this.triangle=[new Ql(0,0),new Ql(-15,-10),new Ql(-15,10)],this.diamond=[new Ql(0,0),new Ql(-10,-5),new Ql(-20,0),new Ql(-10,5)],this.fontFamily="Arial",this.fontSize=12,this.lineHeight=14,this.truncateText=!0,this.maxLineLength=40,this.showScreenGrid=!1,this.showScreenBoxGuide=!0,this.screenGridAxisTickLength=50,this.screenGridSpacingX=100,this.screenGridSpacingY=100,this.screenGridLineWidth=.5,this.showCanvasGrid=!1,this.showCanvasBoxGuide=!0,this.showScreenOffsetGuide=!0,this.canvasGridAxisTickLength=50,this.canvasGridSpacingX=100,this.canvasGridSpacingY=100,this.canvasGridLineWidth=.5,this.defaultLineWidth=1,this.screenGridLineColor="rgba(61,126,154,0.56)",this.screenGridLabelTextColor="rgba(61,126,154,0.56)",this.screenGuideLineColor="red",this.screenGuideLabelTextColor="red",this.canvasGridLineColor="green",this.canvasGridLabelTextColor="green",this.canvasGuideLineColor="orange",this.canvasGuideLabelTextColor="orange",this.screenOffsetGuideLineColor="purple",this.screenOffsetGuideLabelTextColor="purple",this.defaultLineColor="rgb(0,0,0)",this.canvasColor="rgb(220,220,220)",this.backgroundColor="rgb(255,255,255)",this.classViewFillColor="rgb(185,185,185)",this.classViewHeaderTextColor="rgb(0,0,0)",this.classViewPropertyTextColor="rgb(0,0,0)",this.classViewPrimitivePropertyTextColor="rgb(255,255,255)",this.classViewDerivedPropertyTextColor="rgb(100,100,100)",this.relationshipViewTextColor="rgb(0,0,0)",this.propertyViewSharedDiamondColor="rgb(255,255,255)",this.propertyViewOwnedDiamondColor="rgb(0,0,0)",this.generalizationViewInheritanceTriangeFillColor="rgb(255,255,255)",this.selectionBoxBorderColor="rgba(0,0,0, 0.02)",this.interactionMode=Vu.LAYOUT,this.relationshipMode=Gu.NONE,this.isReadOnly=!1,this.screenPadding=20,this.classViewSpaceX=10,this.classViewSpaceY=4,this.propertySpacing=10,this.selectionStart=void 0,this.selection=void 0,this.selectedClasses=[],this._selectedClassesInitialPositions=[],this.cursorPosition=new Ql(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new Ql(0,0),this.div.onwheel=this.mousewheel.bind(this),this.div.onmousedown=this.mousedown.bind(this),this.div.onkeydown=this.keydown.bind(this),this.div.ondblclick=this.mousedblclick.bind(this),this.div.onmouseup=this.mouseup.bind(this),this.div.onmousemove=this.mousemove.bind(this)}setIsReadOnly(e){this.isReadOnly=e}setMouseOverClassView(e){this.mouseOverClassView=e}setMouseOverClassName(e){this.mouseOverClassName=e}setMouseOverClassCorner(e){this.mouseOverClassCorner=e}setMouseOverClassProperty(e){this.mouseOverClassProperty=e}setMouseOverPropertyHolderViewLabel(e){this.mouseOverPropertyHolderViewLabel=e}setSelectionStart(e){this.selectionStart=e}setSelectedClassCorner(e){this.selectedClassCorner=e}setSelectedClasses(e){this.selectedClasses=e}setSelectedPropertyOrAssociation(e){this.selectedPropertyOrAssociation=e}setSelectedInheritance(e){this.selectedInheritance=e}setLeftClick(e){this.leftClick=e}setMiddleClick(e){this.middleClick=e}setRightClick(e){this.rightClick=e}setZoomLevel(e){this.zoom=e}render(){this.diagram.classViews.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),this.refresh()}refresh(){this.refreshCanvas(),this.drawScreen()}refreshCanvas(){this.canvasDimension=new ec(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new Ql(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height}clearScreen(){this.ctx.fillStyle=this.canvasColor,this.ctx.fillRect(0,0,this.canvasDimension.width,this.canvasDimension.height)}drawScreen(){this.manageVirtualScreen(),this.clearScreen(),this.drawAll()}autoRecenter(){this.center(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}center(e,t){this.screenOffset=new Ql(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case Vu.LAYOUT:case Vu.PAN:case Vu.ZOOM_IN:case Vu.ZOOM_OUT:case Vu.ADD_CLASS:if(t!==Gu.NONE)throw new k(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case Vu.ADD_RELATIONSHIP:if(t===Gu.NONE)throw new k("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new F(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===Vu.ADD_RELATIONSHIP)switch(t){case Gu.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||$l(e.class.value).includes(t.class.value)||$l(t.class.value).includes(e.class.value)||mu(e.class.value,iu.create(new nu(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new cc(this.diagram,e,t);return Ou(this.diagram,s),s}};break;case Gu.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new au(`property_${e.class.value.properties.length+1}`,ru.ONE,iu.create(new nu(t.class.value)),e.class.value);if(_u(e.class.value,s),e!==t){const i=new lc(this.diagram,lu.create(s),e,t);return yu(this.diagram,i),i}};break;default:throw new F(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case zu.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>ju(t,new Ql(e,t.position.y))));break}case zu.ALIGN_CENTER:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.x+t.rectangle.width/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>ju(t,new Ql(e-t.rectangle.width/2,t.position.y))));break}case zu.ALIGN_RIGHT:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.x+t.rectangle.width)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>ju(t,new Ql(e-t.rectangle.width,t.position.y))));break}case zu.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>ju(t,new Ql(t.position.x,e))));break}case zu.ALIGN_MIDDLE:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.y+t.rectangle.height/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>ju(t,new Ql(t.position.x,e-t.rectangle.height/2))));break}case zu.ALIGN_BOTTOM:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.y+t.rectangle.height)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>ju(t,new Ql(t.position.x,e-t.rectangle.height))));break}case zu.SPACE_HORIZONTALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.x-t.position.x));if(2===e.length){const t=e[0],s=e[1];ju(s,new Ql(t.position.x+t.rectangle.width,s.position.y))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.x-(i.position.x+i.rectangle.width))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];ju(n,new Ql(i.position.x+i.rectangle.width+s,n.position.y))}}break}case zu.SPACE_VERTICALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.y-t.position.y));if(2===e.length){const t=e[0],s=e[1];ju(s,new Ql(s.position.x,t.position.y+t.rectangle.height))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.y-(i.position.y+i.rectangle.height))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];ju(n,new Ql(n.position.x,i.position.y+i.rectangle.height+s))}}break}}this.drawScreen()}}truncateTextWithEllipsis(e,t=this.maxLineLength){return e.length>t?`${e.substring(0,t+1-"...".length)}...`:e}canvasCoordinateToModelCoordinate(e){return new Ql((e.x-this.canvasCenter.x)/this.zoom-this.screenOffset.x+this.canvasCenter.x,(e.y-this.canvasCenter.y)/this.zoom-this.screenOffset.y+this.canvasCenter.y)}modelCoordinateToCanvasCoordinate(e){return new Ql((e.x-this.canvasCenter.x+this.screenOffset.x)*this.zoom+this.canvasCenter.x,(e.y-this.canvasCenter.y+this.screenOffset.y)*this.zoom+this.canvasCenter.y)}eventCoordinateToCanvasCoordinate(e){return new Ql(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new Ql(e.x-this.div.scrollLeft+this.divPosition.x,e.y-this.div.scrollTop+this.divPosition.y)}hasPropertyView(e,t){return this.diagram.propertyViews.filter((s=>s.property.value===t&&s.from.classView.value===e)).length>0}get divPosition(){return(e=>{let t=0,s=0;for(;e.offsetParent;)t+=e.offsetLeft-e.scrollLeft+e.clientLeft,s+=e.offsetTop-e.scrollTop+e.clientTop,e=e.offsetParent;return new Ql(t,s)})(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=B(this.diagram.classViews[0]);let t=e.position.x,s=e.position.y,i=e.position.x+e.rectangle.width,n=e.position.y+e.rectangle.height;for(const e of this.diagram.classViews)t=Math.min(t,e.position.x),s=Math.min(s,e.position.y),i=Math.max(i,e.position.x+e.rectangle.width),n=Math.max(n,e.position.y+e.rectangle.height);const a=this.diagram.associationViews.concat(this.diagram.generalizationViews).concat(this.diagram.propertyViews);for(const e of a){const a=rc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof lc){const r=this.drawLinePropertyText(a[a.length-2],a[a.length-1],e.to.classView.value,e.property.value,!1);t=Math.min(t,r.position.x),s=Math.min(s,r.position.y),i=Math.max(i,gc(r).x),n=Math.max(n,gc(r).y)}for(const a of e.path)t=Math.min(t,a.x),s=Math.min(s,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y)}this.virtualScreen=new tc(new Ql(t,s),new ec(i-t,n-s))}else this.setZoomLevel(1),this.screenOffset=new Ql(0,0),this.virtualScreen=new tc(new Ql(this.canvasDimension.width/2,this.canvasDimension.height/2),new ec(0,0))}executeZoom(e,t){e=Math.max(e,Bu);const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)),i=this.zoom;this.setZoomLevel(e),this.screenOffset=new Ql(((s.x-this.canvasCenter.x)*(i-e)+this.screenOffset.x*i)/e,((s.y-this.canvasCenter.y)*(i-e)+this.screenOffset.y*i)/e),this.clearScreen(),this.drawAll()}zoomPoint(e,t){this.executeZoom(e,t)}zoomCenter(e){this.setZoomLevel(Math.max(e,Bu)),this.clearScreen(),this.drawAll()}zoomToFit(){this.autoRecenter(),this.zoomCenter(Math.max(Math.min(this.canvas.width/(this.virtualScreen.rectangle.width+2*this.screenPadding+20),this.canvas.height/(this.virtualScreen.rectangle.height+2*this.screenPadding+20)),Bu))}addClassView(e,t){if(!this.isReadOnly){const s=this.diagram.classViews.map((e=>e.id));let i=(0,a.Z)();for(;s.includes(i);)i=(0,a.Z)();const n=new sc(this.diagram,i,Es.create(e));return ju(n,t??this.canvasCoordinateToModelCoordinate(new Ql(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),fu(this.diagram,n),Uu(n),this.diagram.classViews.filter((t=>t.class.value!==e)).forEach((t=>{const s=t.class.value;e.generalizations.map((e=>e.value.rawType)).includes(s)&&Ou(this.diagram,new cc(this.diagram,n,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&Ou(this.diagram,new cc(this.diagram,t,n)),Hl(e).forEach((e=>{e.genericType.value.rawType===s&&yu(this.diagram,new lc(this.diagram,lu.create(e),n,t))})),Hl(s).forEach((s=>{s.genericType.value.rawType===e&&yu(this.diagram,new lc(this.diagram,lu.create(s),t,n))}))})),this.drawClassView(n),this.drawScreen(),n}}drawBoundingBox(){this.ctx.fillStyle=this.backgroundColor,this.ctx.lineWidth=1,this.ctx.fillRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom),this.ctx.strokeRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom)}drawDiagram(){this.diagram.associationViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.generalizationViews.forEach((e=>this.drawInheritance(e))),this.diagram.propertyViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.classViews.forEach((e=>this.drawClassView(e))),this.showCanvasGrid&&this.drawCanvasGrid(),this.showScreenGrid&&this.drawScreenGrid()}drawAll(){this.drawBoundingBox(),this.drawDiagram()}drawScreenGrid(){const e=(this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t=(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y,s=(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,i=(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom;this.ctx.beginPath(),this.ctx.fillStyle=this.screenGridLabelTextColor,this.ctx.strokeStyle=this.screenGridLineColor,this.ctx.lineWidth=this.screenGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`;let n=0;for(let a=e;a<e+s-2*this.screenPadding;a+=this.screenGridSpacingX*this.zoom)this.ctx.fillText(`${n}`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+n)}]`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding-this.lineHeight)*this.zoom),this.ctx.moveTo(a,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.lineTo(a,t+i-this.screenPadding*this.zoom),this.ctx.stroke(),n+=this.screenGridSpacingX;let a=0;for(let n=t;n<t+i-2*this.screenPadding;n+=this.screenGridSpacingY*this.zoom)this.ctx.fillText(`${a}`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+a)}]`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+(5+this.lineHeight)*this.zoom),this.ctx.moveTo(e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n),this.ctx.lineTo(e+s-this.screenPadding*this.zoom,n),this.ctx.stroke(),a+=this.screenGridSpacingY;this.showScreenBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.screenGuideLabelTextColor,this.ctx.strokeStyle=this.screenGuideLineColor,this.ctx.moveTo(e,t),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.lineTo(e,t),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.width/2)}`,e+s/2-(this.screenPadding-5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2)}]`,e+s/2-(this.screenPadding-5)*this.zoom,t+(5+this.lineHeight)*this.zoom),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.height/2)}`,e+5*this.zoom,t+i/2-(this.screenPadding-5)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}]`,e+5*this.zoom,t+i/2-(this.screenPadding-5-this.lineHeight)*this.zoom),this.ctx.lineTo(e,t+i/2-this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i/2-this.screenPadding*this.zoom),this.ctx.stroke()),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawCanvasGrid(){const e=-this.canvasCenter.x*this.zoom+this.canvasCenter.x,t=-this.canvasCenter.y*this.zoom+this.canvasCenter.y,s=this.canvasDimension.width,i=this.canvasDimension.height;this.ctx.setLineDash([5,5]),this.ctx.fillStyle=this.canvasGridLabelTextColor,this.ctx.strokeStyle=this.canvasGridLineColor,this.ctx.lineWidth=this.canvasGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,this.ctx.beginPath();let n=0;for(let t=e;t<s;t+=this.canvasGridSpacingX*this.zoom)0!==t&&this.ctx.fillText(`[${Math.round(n)}]`,t+5*this.zoom,5*this.zoom),this.ctx.moveTo(t,0),this.ctx.lineTo(t,i),this.ctx.stroke(),n+=this.canvasGridSpacingX;let a=0;for(let e=t;e<i;e+=this.canvasGridSpacingY*this.zoom)0!==e&&this.ctx.fillText(`[${Math.round(a)}]`,5*this.zoom,e+5*this.zoom),this.ctx.moveTo(0,e),this.ctx.lineTo(s,e),this.ctx.stroke(),a+=this.canvasGridSpacingY;if(this.showCanvasBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.canvasGuideLabelTextColor,this.ctx.strokeStyle=this.canvasGuideLineColor,this.ctx.fillText(`[${Math.round(s/2)}]`,s/2+5*this.zoom,5*this.zoom),this.ctx.moveTo(s/2,0),this.ctx.lineTo(s/2,i),this.ctx.stroke(),this.ctx.fillText(`[${Math.round(i/2)}]`,5*this.zoom,i/2+5*this.zoom),this.ctx.moveTo(0,i/2),this.ctx.lineTo(s,i/2),this.ctx.stroke()),this.showScreenOffsetGuide){const s=5,i=35;this.ctx.beginPath(),this.ctx.setLineDash([]),this.ctx.fillStyle=this.screenOffsetGuideLabelTextColor,this.ctx.strokeStyle=this.screenOffsetGuideLineColor,this.ctx.arc(e+this.screenOffset.x*this.zoom,t+this.screenOffset.y*this.zoom,s*this.zoom,0,2*Math.PI),this.ctx.moveTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x+2*s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y+2*s)*this.zoom),this.ctx.stroke(),this.ctx.setLineDash([5,5]),this.ctx.moveTo(e,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+0),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.stroke(),this.ctx.beginPath(),this.screenOffset.x>=i&&this.screenOffset.y>=i?(this.ctx.fillText(`[${Math.round(this.screenOffset.x)}]`,e+(this.screenOffset.x+5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.screenOffset.y)}]`,e+5*this.zoom,t+(this.screenOffset.y+5)*this.zoom)):this.screenOffset.x>=0&&this.screenOffset.y>=0?this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(this.screenOffset.x+s+5)*this.zoom,t+(this.screenOffset.y+s+5)*this.zoom):this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(s+5)*this.zoom,t+(s+5)*this.zoom)}this.ctx.setLineDash([]),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawClassViewProperty(e,t,s,i,n){this.ctx.font=this.mouseOverClassView===e&&this.mouseOverClassProperty===t?`bold ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`:`${n?"bold":""} ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const a=Hu(t);let r=this.ctx.measureText(`${a} : `).width;n||(this.ctx.fillText(`${a} : `,s,i),this.ctx.fillText(t.genericType.value.rawType.name,s+r,i),t.genericType.value.rawType instanceof os&&(this.ctx.beginPath(),this.ctx.moveTo(s+r,i+(this.fontSize-1)*this.zoom),this.ctx.lineTo(s+r+this.ctx.measureText(t.genericType.value.rawType.name).width,i+(this.fontSize-1)*this.zoom),this.ctx.stroke())),r+=this.ctx.measureText(t.genericType.value.rawType.name).width,this.ctx.font=`${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const o=je(t.multiplicity.lowerBound,t.multiplicity.upperBound);return n||this.ctx.fillText(`[${o}]`,s+r,i),r+=this.ctx.measureText(`[${o}]`).width,r}computeClassNameWidth(e){return this.ctx.font=`bold ${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top",this.ctx.measureText(this.truncateTextWithEllipsis(e.class.value.name)).width}ensureClassViewMeetMinDimensions(e){let t=this.computeClassNameWidth(e),s=this.lineHeight+2*this.classViewSpaceY;if(!e.hideStereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;for(const i of e.class.value.stereotypes){const e=`<< ${this.truncateTextWithEllipsis(i.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(!e.hideTaggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top";for(const i of e.class.value.taggedValues){const e=`{ ${this.truncateTextWithEllipsis(`${i.tag.value.value} = ${i.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(e.hideProperties||(Hl(e.class.value).forEach((i=>{if(!this.hasPropertyView(e,i)){const n=this.drawClassViewProperty(e,i,0,0,!0);t=Math.max(t,n),s+=this.lineHeight}})),s+=2*this.classViewSpaceY),t+=2*this.classViewSpaceX,!this.isReadOnly){const i=e.rectangle.width&&e.rectangle.width>t?e.rectangle.width:t,n=e.rectangle.height&&e.rectangle.height>s?e.rectangle.height:s;Fu(e,new ec(i,n))}}drawClassView(e){const t=this.computeClassNameWidth(e);this.ensureClassViewMeetMinDimensions(e),this.ctx.fillStyle=this.classViewFillColor;const s=this.modelCoordinateToCanvasCoordinate(e.position);this.ctx.fillRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom),this.ctx.lineWidth=0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(e)?2:1,this.ctx.strokeRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom);const i=e.position.x,n=e.position.y;this.ctx.lineWidth=1,this.ctx.fillStyle=this.classViewHeaderTextColor;let a=n;if(this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,!e.hideStereotypes)for(const t of e.class.value.stereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`<< ${this.truncateTextWithEllipsis(t.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}this.ctx.font=`bold ${this.fontSize*this.zoom}px ${this.fontFamily}`;const r=this.truncateTextWithEllipsis(e.class.value.name);if(this.ctx.fillText(r,(i+this.screenOffset.x+(e.rectangle.width-t)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight,!e.hideTaggedValues)for(const t of e.class.value.taggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`{ ${this.truncateTextWithEllipsis(`${t.tag.value.value} = ${t.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}if(a+=3*this.classViewSpaceY,!e.hideProperties){this.ctx.beginPath();const t=(n+this.screenOffset.y+this.lineHeight+(e.hideStereotypes?0:e.class.value.stereotypes.length*this.lineHeight)+(e.hideTaggedValues?0:e.class.value.taggedValues.length*this.lineHeight)+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.ctx.moveTo((i+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.lineTo((i+this.screenOffset.x+e.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.stroke();for(const t of Hl(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof tu?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof cu?this.classViewPrimitivePropertyTextColor:this.classViewPropertyTextColor;const s=(i+this.screenOffset.x+this.classViewSpaceX-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,n=(a+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.drawClassViewProperty(e,t,s,n,!1),a+=this.lineHeight}}Uu(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,n,a){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=Hu(e),o=je(e.multiplicity.lowerBound,e.multiplicity.upperBound),l=this.ctx.measureText(r).width,c=this.ctx.measureText(o).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`;const d=t(l),h=s(l),u=this.modelCoordinateToCanvasCoordinate(new Ql(t(l),s(l)));a||this.ctx.fillText(r,u.x,u.y);const p=i(c),_=n(c),m=this.modelCoordinateToCanvasCoordinate(new Ql(i(c),n(c)));a||this.ctx.fillText(o,m.x,m.y);const g=new Ql(Math.min(d,p),Math.min(h,_));return new tc(g,new ec(Math.max(d,p)+Math.max(l,c)-g.x,Math.max(h,_)+this.lineHeight-g.y))}drawLinePropertyText(e,t,s,i,n){this.ctx.textBaseline="top",this.ctx.fillStyle=this.relationshipViewTextColor;const a=e.x,r=e.y,o=t.x,l=t.y,c=s.rectangle;if(r<l){const e=a+(o-a)/(l-r)*(s.position.y-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),n)}else{const e=a+(o-a)/(l-r)*(s.position.y+c.height-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),n)}if(a<o){const e=r+(l-r)/(o-a)*(s.position.x-a);if(e>s.position.y&&e<s.position.y+c.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}else{const e=r+(l-r)/(o-a)*(s.position.x+s.rectangle.width-a);if(e>s.position.y&&e<s.position.y+s.rectangle.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}return new tc(new Ql(0,0),new ec(0,0))}drawPropertyOrAssociation(e){const t=rc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),s=e.property.value;if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],e.to.classView.value,s,!1),this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedPropertyOrAssociation?2:1,t.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke(),this.ctx.lineWidth=1,s instanceof au){const i=t[1],n=t[0],a=i.x,r=i.y,o=n.x,l=n.y,c=e.from;let d=0,h=0;if(l>r){const e=a+(o-a)/(l-r)*(c.classView.value.position.y-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=a+(o-a)/(l-r)*(c.classView.value.position.y+c.classView.value.rectangle.height-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y+c.classView.value.rectangle.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(o>a){const e=r+(l-r)/(o-a)*(c.classView.value.position.x-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=r+(l-r)/(o-a)*(c.classView.value.position.x+c.classView.value.rectangle.width-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x+c.classView.value.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(s.aggregation===Qh.COMPOSITE||s.aggregation===Qh.SHARED){let e=Math.atan((l-r)/(o-a));e=o>=a?e:e+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(d+(this.screenOffset.x+_c(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+mc(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+_c(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+mc(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+_c(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+mc(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+_c(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+mc(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+_c(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+mc(this.diamond[0],e))*this.zoom),s.aggregation===Qh.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===Qh.COMPOSITE&&(this.ctx.fillStyle=this.propertyViewOwnedDiamondColor),this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}}}drawInheritance(e){const t=e.to.classView.value.rectangle,s=rc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),i=s[s.length-2].x,n=s[s.length-2].y,a=s[s.length-1].x,r=s[s.length-1].y;let o=0,l=0;if(r>n){const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y+t.height-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y+t.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(a>i){const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x+t.width-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x+t.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedInheritance?2:1,s.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke();let c=Math.atan((r-n)/(a-i));c=a>=i?c:c+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(o+(this.screenOffset.x+_c(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+mc(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+_c(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+mc(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+_c(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+mc(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+_c(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+mc(this.triangle[0],c))*this.zoom),this.ctx.fillStyle=this.generalizationViewInheritanceTriangeFillColor,this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}reorderDiagramDomain(e,t){const s=t.classViews.filter((t=>t!==e));return s.push(e),s}potentiallyShiftRelationships(e,t,s,i){e.forEach((e=>{-1!==t.indexOf(e.from.classView.value)&&-1!==t.indexOf(e.to.classView.value)&&ku(e,e.path.map((e=>new Ql(e.x-s,e.y-i))))}))}recenter(){if(0!==this.selectedClasses.length){const e=R(this.selectedClasses);e&&this.center(e.position.x+e.rectangle.width/2,e.position.y+e.rectangle.height/2)}else this.autoRecenter()}switchToZoomMode(){this.changeMode(this.interactionMode!==Vu.ZOOM_IN?Vu.ZOOM_IN:Vu.ZOOM_OUT,Gu.NONE)}switchToViewMode(){this.changeMode(Vu.LAYOUT,Gu.NONE)}switchToPanMode(){this.changeMode(Vu.PAN,Gu.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(Vu.ADD_RELATIONSHIP,Gu.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(Vu.ADD_RELATIONSHIP,Gu.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(Vu.ADD_CLASS,Gu.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof as&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Ql(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof as&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}keydown(e){var t;if(t=e,document.getElementById(Ad)?.dispatchEvent(new KeyboardEvent(t.type,t)),"Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{Tu(this.diagram,e),Cu(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Nu(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Su(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof du?xu(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof lc&&Iu(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&Au(this.diagram,this.selectedInheritance),this.setSelectedClasses([]),this.drawScreen());else if("KeyE"===e.code)this.selectedClassProperty?(this.handleEditProperty(this.selectedClassProperty.property,this.selectedClassProperty.selectionPoint,void 0),e.preventDefault()):this.selectedPropertyOrAssociation?(this.handleEditProperty(this.selectedPropertyOrAssociation.property.value,this.selectedPoint??(this.selectedPropertyOrAssociation.path.length?this.selectedPropertyOrAssociation.path[0]:this.selectedPropertyOrAssociation.from.classView.value.center()),this.selectedPropertyOrAssociation),e.preventDefault()):1===this.selectedClasses.length&&this.handleEditClassView(this.selectedClasses[0]);else if(e.altKey&&"KeyP"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{vu(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Ru(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Pu(e,!e.hideTaggedValues)})),this.drawScreen());else if(e.altKey&&"ArrowDown"===e.code)this.isReadOnly||1!==this.selectedClasses.length||this.handleAddSimpleProperty(this.selectedClasses[0]);else if("ArrowUp"===e.code){const e=this.getSuperTypeLevels(this.selectedClasses,this.diagram,0,1),t=this.layoutTaxonomy(e,this.diagram,!1,!0);t[0].forEach((e=>fu(this.diagram,e))),t[1].forEach((e=>Ou(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,eu.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new sc(this.diagram,(0,a.Z)(),Es.create(e)))))),(e=>e.class.value));if(e.length>0){e.forEach((e=>this.ensureClassViewMeetMinDimensions(e)));const t=this.layoutTaxonomy([e,this.selectedClasses],this.diagram,!1,!1);t[0].forEach((e=>fu(this.diagram,e))),t[1].forEach((e=>Ou(this.diagram,e)))}this.drawScreen()}}mouseup(e){if(!this.isReadOnly)switch(this.interactionMode){case Vu.LAYOUT:this.diagram.generalizationViews.forEach((e=>Du(e))),this.diagram.associationViews.forEach((e=>Du(e))),this.diagram.propertyViews.forEach((e=>Du(e)));break;case Vu.ADD_CLASS:{const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)));this.onAddClassViewClick(t),this.changeMode(Vu.LAYOUT,Gu.NONE);break}case Vu.ZOOM_IN:{const t=Math.round(100*this.zoom);let s;s=t<=$u[0]-10?10*Math.floor(t/10)+10:t>=$u[$u.length-1]?100*Math.floor(t/100)+100:B($u.find((e=>e>t))),this.zoomPoint(s/100,new Ql(e.x,e.y));break}case Vu.ZOOM_OUT:{const t=Math.round(100*this.zoom);let s;s=t<=$u[0]?10*Math.ceil(t/10)-10:t>=$u[$u.length-1]+100?100*Math.ceil(t/100)-100:B((0,Ml.Z)($u,(e=>e<t))),this.zoomPoint(s/100,new Ql(e.x,e.y));break}case Vu.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)));for(let e=this.diagram.classViews.length-1;e>=0;e--){const s=this.diagram.classViews[e];if(s.contains(t.x,t.y)){const e=this.handleAddRelationship(this.startClassView,s);e&&(wu(e.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),Lu(e.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),wu(e.to,-(s.position.x+s.rectangle.width/2-t.x)),Lu(e.to,-(s.position.y+s.rectangle.height/2-t.y)))}}this.changeMode(Vu.LAYOUT,Gu.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){if([Vu.ADD_RELATIONSHIP,Vu.ADD_CLASS,Vu.ZOOM_IN,Vu.ZOOM_OUT].includes(this.interactionMode))return;const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)));if(this.mouseOverClassProperty&&this.onClassPropertyDoubleClick)return void this.onClassPropertyDoubleClick(this.mouseOverClassProperty,t,void 0);if(this.mouseOverClassName&&this.onClassNameDoubleClick)return void this.onClassNameDoubleClick(this.mouseOverClassName,t);const s=this.diagram.classViews.find((e=>e.contains(t.x,t.y)));s&&this.onClassViewDoubleClick?this.onClassViewDoubleClick(s,t):this.mouseOverPropertyHolderViewLabel&&this.onClassPropertyDoubleClick?this.onClassPropertyDoubleClick(this.mouseOverPropertyHolderViewLabel.property.value,t,this.mouseOverPropertyHolderViewLabel):this.onBackgroundDoubleClick&&this.onBackgroundDoubleClick(t)}mousedown(e){this.setSelectionStart(void 0),this.setSelectedClassCorner(void 0),this.setSelectedPropertyOrAssociation(void 0),this.setSelectedInheritance(void 0),this.selection=void 0,this.selectedClassProperty=void 0,this.selectedPoint=void 0,this.startClassView=void 0;const t=this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case Vu.PAN:return void(this.positionBeforeLastMove=new Ql(e.x,e.y));case Vu.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(Ec(t).contains(s.x,s.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||Eu(this.diagram,this.reorderDiagramDomain(B(this.selectedClassCorner),this.diagram));break}}if(!this.selectedClassCorner)if(this.mouseOverClassProperty)this.selectedClassProperty={property:this.mouseOverClassProperty,selectionPoint:s},this.setSelectedClasses([]);else{let e=!1;for(let i=this.diagram.classViews.length-1;i>=0;i--){const n=this.diagram.classViews[i];if(n.contains(s.x,s.y)){0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(n)||this.setSelectedClasses([n]),this.isReadOnly||Eu(this.diagram,this.reorderDiagramDomain(this.selectedClasses[0],this.diagram)),this.clickX=t.x/this.zoom-this.screenOffset.x,this.clickY=t.y/this.zoom-this.screenOffset.y,this._selectedClassesInitialPositions=this.selectedClasses.map((e=>({classView:e,oldPos:new Ql(e.position.x,e.position.y)}))),e=!0;break}}if(e||this.setSelectedClasses([]),!this.selectedClasses.length){for(const e of this.diagram.generalizationViews){const t=Mu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedInheritance(e);break}}if(!this.selectedPoint)for(const e of this.diagram.associationViews){const t=Mu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}if(!this.selectedPoint)for(const e of this.diagram.propertyViews){const t=Mu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}this.selectedPoint||this.setSelectionStart(s)}}break;case Vu.ADD_RELATIONSHIP:this.setSelectionStart(s),this.startClassView=void 0;for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];t.contains(s.x,s.y)&&(this.startClassView=t)}this.startClassView||this.changeMode(Vu.LAYOUT,Gu.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=new Ql(e.x,e.y));if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=new Ql(e.x,e.y),void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,s),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){if(e.preventDefault(),e.stopImmediatePropagation(),Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;const t=this.zoom-e.deltaY/120*.05;this.executeZoom(t,new Ql(e.x,e.y))}mousemove(e){if(this.cursorPosition=new Ql(e.x,e.y),this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===Vu.PAN)this.screenOffset=new Ql(this.screenOffset.x+(e.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(e.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=new Ql(e.x,e.y),this.clearScreen(),this.drawAll();else if(this.leftClick){const t=this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);switch(this.interactionMode){case Vu.LAYOUT:if(this.selectedClassCorner&&(Fu(this.selectedClassCorner,new ec(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),Uu(this.selectedClassCorner),this.drawClassView(this.selectedClassCorner),this.drawScreen()),!this.selectionStart&&this.selectedClasses.length&&!this.isReadOnly){let e=0,s=0;this.selectedClasses.forEach(((i,n)=>{const a=this._selectedClassesInitialPositions.length>n?this._selectedClassesInitialPositions[n]:void 0;if(a){const n=t.x/this.zoom-this.screenOffset.x-(this.clickX-a.oldPos.x),r=t.y/this.zoom-this.screenOffset.y-(this.clickY-a.oldPos.y);e=i.position.x-n,s=i.position.y-r,ju(i,new Ql(n,r)),Uu(i)}})),this.potentiallyShiftRelationships(this.diagram.associationViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.propertyViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.generalizationViews,this.selectedClasses,e,s),this.drawScreen()}if(this.selectedPoint&&(this.selectedPropertyOrAssociation?bu(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&bu(this.selectedInheritance,this.selectedPoint,s),this.selectedPoint=s,this.drawScreen()),this.selectionStart){this.clearScreen(),this.drawAll();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.fillStyle=this.selectionBoxBorderColor,this.ctx.fillRect(e.x,e.y,t.x-e.x,t.y-e.y),this.ctx.strokeRect(e.x,e.y,t.x-e.x,t.y-e.y);const s=(t.x-e.x)/this.zoom,i=(t.y-e.y)/this.zoom;this.selection=new tc(new Ql(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new ec(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(fc(this.selection,e)||fc(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case Vu.ADD_RELATIONSHIP:if(this.selectionStart&&this.startClassView){this.clearScreen(),this.drawBoundingBox();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(t.x,t.y),this.ctx.stroke(),this.drawDiagram()}}}else{this.drawScreen();const t=this.eventCoordinateToCanvasCoordinate(new Ql(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);this.setMouseOverClassView(void 0),this.setMouseOverClassName(void 0),this.setMouseOverClassCorner(void 0),this.setMouseOverClassProperty(void 0),this.setMouseOverPropertyHolderViewLabel(void 0);for(const e of this.diagram.classViews.slice().reverse())if(e.contains(s.x,s.y)){this.setMouseOverClassView(e),Ec(e).contains(s.x,s.y)&&this.setMouseOverClassCorner(e);const i=e.class.value;let n=e.position.y+this.classViewSpaceY;n+=e.hideStereotypes?0:i.stereotypes.length*this.fontSize;const a=this.computeClassNameWidth(e);new tc(this.modelCoordinateToCanvasCoordinate(new Ql(e.position.x+(e.rectangle.width-a)/2,n)),new ec(a,this.lineHeight)).contains(t.x,t.y)&&this.setMouseOverClassName(e),n+=this.lineHeight,n+=e.hideTaggedValues?0:i.taggedValues.length*this.fontSize,n+=this.classViewSpaceY;for(const s of Hl(i))this.hasPropertyView(e,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new tc(this.modelCoordinateToCanvasCoordinate(new Ql(e.position.x+this.classViewSpaceX,n)),new ec(this.drawClassViewProperty(e,s,0,0,!0)*this.zoom,this.fontSize*this.zoom)).contains(t.x,t.y)&&this.setMouseOverClassProperty(s),n+=this.fontSize);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=rc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],e.to.classView.value,e.property.value,!1).contains(s.x,s.y)){this.setMouseOverPropertyHolderViewLabel(e);break}}}}getSuperTypeLevels(e,t,s,i){if(e.length){const n=(0,eu.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new sc(t,(0,a.Z)(),Es.create(Bl(e.value,as))))))),(e=>e.class.value));if(n.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),-1===i||s<i){const a=this.getSuperTypeLevels(n,t,s+1,i);return a.push(e),a}return[e]}return[]}layoutTaxonomy(e,t,s,i){return e.reverse(),[e.flatMap(((t,n)=>{let a=0,r=0,o=0,l=0;if(n>0){const t=e[n-1];if(t.length){const e=[...t].sort(((e,t)=>e.position.x-t.position.x));o=e[0].position.x,a=e[e.length-1].position.x+e[e.length-1].rectangle.width-e[0].position.x;const s=[...t].sort(((e,t)=>e.position.y-t.position.y));l=s[0].position.y,r=s[s.length-1].position.y+s[s.length-1].rectangle.height-s[0].position.y}}const c=Math.max(...t.map((e=>e.rectangle.height))),d=o+a/2-t.map((e=>e.rectangle.width)).reduce(((e,t)=>e+t+10))/2,h=i?l-c-30:l+r+30;return(s||n>0)&&(ju(t[0],new Ql(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];ju(e,new Ql(i.position.x+i.rectangle.width+10,h))}}))),t})),(i?e:e.slice().reverse()).slice(0,e.length-1).flatMap(((s,i)=>s.flatMap((s=>e[i+1].flatMap((e=>s.class.value.generalizations.map((e=>e.value.rawType)).includes(e.class.value)?new cc(t,s,e):[]))))))]}}class Wu{_UUID=(0,a.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return Zt([Xt.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class Ku extends ms{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Xt.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Kt).join(",")}}class Zu extends Ku{ownerReference;constructor(e){const t=Es.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Zu(e)}}class Xu extends ms{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Xt.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Kt).join(",")}}class qu extends Xu{ownerReference;constructor(e){const t=Es.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new qu(e)}}class Ju extends is{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[uu(hu(),hu()),uu(hu(),hu())];t[0]._OWNER=this,t[1]._OWNER=this,this.properties=t}get _elementHashCode(){return Zt([Xt.ASSOCIATION,this.path,Zt(this.properties),Zt(this.derivedProperties),Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class Qu extends is{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return Zt([Xt.MAPPING,this.path,Zt(this.classMappings),Zt(this.enumerationMappings),Zt(this.associationMappings),Zt(this.test),Zt(this.includes),Zt(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class ep extends is{p_stereotypes=[];p_tags=[];get _elementHashCode(){return Zt([Xt.PROFILE,this.path,Zt(this.p_stereotypes.map((e=>e.value))),Zt(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class tp extends is{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];postValidations=[];get patternParameters(){return(0,Ke.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return Zt([Xt.SERVICE,Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues),this.path,this.pattern,Zt(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",Zt(this.tests),Zt(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class sp extends is{functionName;constructor(e){super(e),this.functionName=e}}class ip extends sp{}class np extends ip{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return Zt([Xt.FUNCTION,this.path,Zt(this.parameters),this.returnType.valueForSerialization??"",Zt(this.taggedValues),Zt(this.stereotypes.map((e=>e.pointerHashCode))),Qt(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class ap extends is{includes=[]}class rp extends ap{sections=[];get _elementHashCode(){return Zt([Xt.FLAT_DATA,this.path,Zt(this.includes.map((e=>e.valueForSerialization??""))),Zt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class op extends is{runtimeValue;get _elementHashCode(){return Zt([Xt.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class lp extends is{connectionValue;get _elementHashCode(){return Zt([Xt.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class cp extends is{}class dp extends cp{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return Zt([Xt.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",Zt(this.scopeElements.map((e=>e instanceof gs?e.valueForSerialization??"":e))),Zt(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class hp extends is{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return Zt([Xt.GENERATION_TREE,this.path,Zt(this.generationNodes),Zt(this.fileGenerations.map((e=>es(Pe.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class up extends ap{schemas=[];joins=[];filters=[];get _elementHashCode(){return Zt([Xt.DATABASE,this.path,Zt(this.includes.map((e=>e.valueForSerialization??""))),Zt(this.schemas),Zt(this.joins),Zt(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class pp{_class;index=new Map;constructor(e){this._class=e}getElementClass(){return this._class}get elements(){return Array.from(this.index.values())}getElement(e){return this.index.get(e)}setElement(e,t){this.index.set(e,t)}deleteElement(e){this.index.delete(e)}renameElement(e,t){const s=this.getElement(e);s&&(this.deleteElement(e),this.setElement(t,s))}}class _p extends is{data;get hashCode(){return Zt([Xt.DATA_ELEMENT,this.path,Zt(this.stereotypes.map((e=>e.pointerHashCode))),Zt(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}const mp=new Set([is,ns,rs,cu,as,Ju,os,np,ep,cs,ls,class extends is{sections=[];get _elementHashCode(){return Zt([Xt.SECTION_INDEX,this.path,Zt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}},ap,Qu,lp,op,tp,hp,dp,_p]);class gp{root;extensions=[];elementSectionIndex=new Map;sectionIndicesIndex=new Map;profilesIndex=new Map;typesIndex=new Map;associationsIndex=new Map;functionsIndex=new Map;storesIndex=new Map;mappingsIndex=new Map;connectionsIndex=new Map;runtimesIndex=new Map;servicesIndex=new Map;generationSpecificationsIndex=new Map;fileGenerationsIndex=new Map;dataElementsIndex=new Map;constructor(e,t){this.root=new ds(e),this.extensions=this.createGraphExtensions(t)}createGraphExtensions(e){return e.map((e=>{if(mp.has(e))throw new k("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new pp(e)}))}get ownSectionIndices(){return Array.from(this.sectionIndicesIndex.values())}get ownProfiles(){return Array.from(this.profilesIndex.values())}get ownEnumerations(){return Array.from(this.typesIndex.values()).filter($(os))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter($(cs))}get ownClasses(){return Array.from(this.typesIndex.values()).filter($(as))}get ownTypes(){return Array.from(this.typesIndex.values())}get ownAssociations(){return Array.from(this.associationsIndex.values())}get ownFunctions(){return Array.from(this.functionsIndex.values())}get ownStores(){return Array.from(this.storesIndex.values())}get ownFlatDatas(){return Array.from(this.storesIndex.values()).filter($(rp))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter($(up))}get ownMappings(){return Array.from(this.mappingsIndex.values())}get ownServices(){return Array.from(this.servicesIndex.values())}get ownRuntimes(){return Array.from(this.runtimesIndex.values())}get ownConnections(){return Array.from(this.connectionsIndex.values())}get ownFileGenerations(){return Array.from(this.fileGenerationsIndex.values())}get ownDataElements(){return Array.from(this.dataElementsIndex.values())}get ownGenerationSpecifications(){return Array.from(this.generationSpecificationsIndex.values())}get ownTestables(){return[...this.ownServices,...this.ownMappings]}getExtensionElements(e){return this.getExtensionForElementClass(e).elements}getExtensionForElementClass(e){const t=this.extensions.filter((t=>t.getElementClass()===e));if(0===t.length)throw new F("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new k("Found multiple extensions for the specified element class");return t[0]}getOwnNullableSection=e=>this.elementSectionIndex.get(e);getOwnNullableSectionIndex=e=>this.sectionIndicesIndex.get(e);getOwnNullableProfile=e=>this.profilesIndex.get(e);getOwnNullableType=e=>this.typesIndex.get(e);getOwnNullableClass=e=>{const t=this.getOwnNullableType(e);return t instanceof as?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof os?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof cs?t:void 0};getOwnNullableAssociation=e=>this.associationsIndex.get(e);getOwnNullableFunction=e=>this.functionsIndex.get(e);getOwnNullableStore=e=>this.storesIndex.get(e);getOwnNullableMapping=e=>this.mappingsIndex.get(e);getOwnNullableConnection=e=>this.connectionsIndex.get(e);getOwnNullableRuntime=e=>this.runtimesIndex.get(e);getOwnNullableService=e=>this.servicesIndex.get(e);getOwnNullableGenerationSpecification=e=>this.generationSpecificationsIndex.get(e);getOwnNullableFileGeneration=e=>this.fileGenerationsIndex.get(e);getOwnNullableDataElement=e=>this.dataElementsIndex.get(e);getOwnSectionIndex=e=>B(this.getOwnNullableSectionIndex(e),`Can't find section index '${e}'`);getOwnProfile=e=>B(this.getOwnNullableProfile(e),`Can't find profile '${e}'`);getOwnType=e=>B(this.getOwnNullableType(e),`Can't find type '${e}'`);getOwnClass=e=>B(this.getOwnNullableClass(e),`Can't find class '${e}'`);getOwnEnumeration=e=>B(this.getOwnNullableEnumeration(e),`Can't find enumeration '${e}'`);getOwnMeasure=e=>B(this.getOwnNullableMeasure(e),`Can't find measure '${e}'`);getOwnAssociation=e=>B(this.getOwnNullableAssociation(e),`Can't find association '${e}'`);getOwnFunction=e=>B(this.getOwnNullableFunction(e),`Can't find function '${e}'`);getOwnStore=e=>B(this.getOwnNullableStore(e),`Can't find store '${e}'`);getOwnDatabase=e=>Y(this.getOwnNullableStore(e),up,`Can't find database '${e}'`);getOwnFlatDataStore=e=>Y(this.getOwnNullableStore(e),rp,`Can't find flat-data store '${e}'`);getOwnMapping=e=>B(this.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getOwnConnection=e=>B(this.getOwnNullableConnection(e),`Can't find connection '${e}'`);getOwnRuntime=e=>B(this.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getOwnService=e=>B(this.getOwnNullableService(e),`Can't find service '${e}'`);getOwnGenerationSpecification=e=>B(this.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getOwnFileGeneration=e=>B(this.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getOwnDataElement=e=>B(this.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getOwnNullableExtensionElement(e,t){return this.getExtensionForElementClass(t).getElement(e)}setOwnSection(e,t){this.elementSectionIndex.set(e,t)}setOwnSectionIndex(e,t){this.sectionIndicesIndex.set(e,t)}setOwnProfile(e,t){this.profilesIndex.set(e,t)}setOwnType(e,t){this.typesIndex.set(e,t)}setOwnAssociation(e,t){this.associationsIndex.set(e,t)}setOwnFunction(e,t){this.functionsIndex.set(e,t)}setOwnStore(e,t){this.storesIndex.set(e,t)}setOwnMapping(e,t){this.mappingsIndex.set(e,t)}setOwnConnection(e,t){this.connectionsIndex.set(e,t)}setOwnRuntime(e,t){this.runtimesIndex.set(e,t)}setOwnService(e,t){this.servicesIndex.set(e,t)}setOwnGenerationSpecification(e,t){this.generationSpecificationsIndex.set(e,t)}setOwnFileGeneration(e,t){this.fileGenerationsIndex.set(e,t)}setOwnDataElement(e,t){this.dataElementsIndex.set(e,t)}setOwnElementInExtension(e,t,s){this.getExtensionForElementClass(s).setElement(e,t)}get allOwnElements(){return[...this.ownProfiles,...this.ownEnumerations,...this.ownMeasures,...this.ownClasses,...this.ownAssociations,...this.ownFunctions,...this.ownStores,...this.ownMappings,...this.ownServices,...this.ownRuntimes,...this.ownConnections,...this.ownGenerationSpecifications,...this.ownFileGenerations,...this.ownDataElements,...this.extensions.flatMap((e=>e.elements))]}async dispose(){this.allOwnElements.length&&await Promise.all(this.allOwnElements.map((e=>P((()=>{e.dispose()})))))}getNullablePackage=e=>e?U((()=>Gl(this.root,e,!1,void 0))):this.root;getOwnNullableElement(e,t){let s=this.sectionIndicesIndex.get(e)??this.typesIndex.get(e)??this.profilesIndex.get(e)??this.associationsIndex.get(e)??this.functionsIndex.get(e)??this.storesIndex.get(e)??this.mappingsIndex.get(e)??this.servicesIndex.get(e)??this.runtimesIndex.get(e)??this.connectionsIndex.get(e)??this.fileGenerationsIndex.get(e)??this.dataElementsIndex.get(e)??this.generationSpecificationsIndex.get(e);if(!s)for(const t of this.extensions){const i=t.getElement(e);if(i){s=i;break}}return t&&!s?this.getNullablePackage(e):s}addOwnElement(e,t){jl(t?zl(this,t,void 0):this.root,e),e instanceof Qu?this.setOwnMapping(e.path,e):e instanceof ap?this.setOwnStore(e.path,e):e instanceof ns?this.setOwnType(e.path,e):e instanceof Ju?this.setOwnAssociation(e.path,e):e instanceof ep?this.setOwnProfile(e.path,e):e instanceof np?this.setOwnFunction(e.path,e):e instanceof tp?this.setOwnService(e.path,e):e instanceof lp?this.setOwnConnection(e.path,e):e instanceof op?this.setOwnRuntime(e.path,e):e instanceof dp?this.setOwnFileGeneration(e.path,e):e instanceof hp?this.setOwnGenerationSpecification(e.path,e):e instanceof _p?this.setOwnDataElement(e.path,e):e instanceof ds||this.getExtensionForElementClass(I(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&Ul(e.package,e),e instanceof Qu?this.mappingsIndex.delete(e.path):e instanceof ap?this.storesIndex.delete(e.path):e instanceof ns?(this.typesIndex.delete(e.path),e instanceof cs&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof Ju?this.associationsIndex.delete(e.path):e instanceof ep?this.profilesIndex.delete(e.path):e instanceof np?this.functionsIndex.delete(e.path):e instanceof tp?this.servicesIndex.delete(e.path):e instanceof op?this.runtimesIndex.delete(e.path):e instanceof lp?this.connectionsIndex.delete(e.path):e instanceof dp?this.fileGenerationsIndex.delete(e.path):e instanceof hp?this.generationSpecificationsIndex.delete(e.path):e instanceof _p?this.dataElementsIndex.delete(e.path):e instanceof ds?e.children.forEach((e=>this.deleteOwnElement(e))):this.getExtensionForElementClass(I(e)).deleteElement(e.path)}renameOwnElement(e,t,s){if(t===s)return;if(!s)throw new F(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof ds&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof ds)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new F(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new F(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,n]=kl(s);if(!(e instanceof ds)){const t=this.getNullablePackage(i)??(""!==i?zl(this,i,void 0):this.root);e.name=n,e instanceof np&&(e.functionName=(a=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Yl(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Yl(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(a))))),e.package!==t&&(e.package&&Ul(e.package,e),jl(t,e))}var a,r;if(e instanceof Qu)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof ap)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof ns)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof cs&&(e.canonicalUnit&&(this.typesIndex.delete(e.canonicalUnit.path),this.typesIndex.set(e.canonicalUnit.path.replace(t,s),e.canonicalUnit)),e.nonCanonicalUnits.forEach((e=>{this.typesIndex.delete(e.path),this.typesIndex.set(e.path.replace(t,s),e)})));else if(e instanceof Ju)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof ep)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof np)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof tp)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof op)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof lp)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof dp)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof _p)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof hp)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof ds){const a=new Map;if(e.children.forEach((e=>{a.set(e.path,e)})),e.name=n,!e.package)throw new k("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){Ul(r,e);const t=""!==i?zl(this,i,void 0):this.root;jl(t,e)}a.forEach(((e,i)=>{this.renameOwnElement(e,i,i.replace(t,s))}))}else this.getExtensionForElementClass(I(e)).renameElement(t,s)}TEMPORARY__deleteOwnSectionIndex(){this.sectionIndicesIndex.forEach((e=>{e.setIsDeleted(!0),this.sectionIndicesIndex.delete(e.path)})),this.sectionIndicesIndex=new Map,this.elementSectionIndex=new Map}}class Ep extends gp{constructor(e,t){super(fe.PROJECT_DEPENDENCY_ROOT,e),this.root=t}}const fp=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class Tp{root=new ds(fe.PROJECT_DEPENDENCY_ROOT);projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.keys()).forEach((e=>{this.projectDependencyModelsIndex.set(e,new Ep(this.extensionElementClasses,this.root))}))}get hasDependencies(){return Boolean(this.projectDependencyModelsIndex.size)}get dependencyGraphs(){return Array.from(this.projectDependencyModelsIndex.values())}get allOwnElements(){return this.dependencyGraphs.flatMap((e=>e.allOwnElements))}getOwnNullableSectionIndex=fp(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=fp(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=fp(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=fp(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=fp(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=fp(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=fp(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=fp(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=fp(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=fp(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=fp(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=fp(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=fp(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=fp(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=fp(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=fp(this,((e,t)=>e.getOwnNullableDataElement(t)));getOwnNullableExtensionElement(e,t){for(const s of this.dependencyGraphs){const i=s.getExtensionForElementClass(t).getElement(e);if(i)return i}}get sectionIndices(){return this.dependencyGraphs.flatMap((e=>e.ownSectionIndices))}get profiles(){return this.dependencyGraphs.flatMap((e=>e.ownProfiles))}get enumerations(){return this.dependencyGraphs.flatMap((e=>e.ownEnumerations))}get measures(){return this.dependencyGraphs.flatMap((e=>e.ownMeasures))}get classes(){return this.dependencyGraphs.flatMap((e=>e.ownClasses))}get types(){return this.dependencyGraphs.flatMap((e=>e.ownTypes))}get associations(){return this.dependencyGraphs.flatMap((e=>e.ownAssociations))}get functions(){return this.dependencyGraphs.flatMap((e=>e.ownFunctions))}get stores(){return this.dependencyGraphs.flatMap((e=>e.ownStores))}get databases(){return this.dependencyGraphs.flatMap((e=>e.ownDatabases))}get mappings(){return this.dependencyGraphs.flatMap((e=>e.ownMappings))}get services(){return this.dependencyGraphs.flatMap((e=>e.ownServices))}get runtimes(){return this.dependencyGraphs.flatMap((e=>e.ownRuntimes))}get connections(){return this.dependencyGraphs.flatMap((e=>e.ownConnections))}get dataElements(){return this.dependencyGraphs.flatMap((e=>e.ownDataElements))}get generationSpecifications(){return this.dependencyGraphs.flatMap((e=>e.ownGenerationSpecifications))}get fileGenerations(){return this.dependencyGraphs.flatMap((e=>e.ownFileGenerations))}getExtensionElements(e){return this.dependencyGraphs.flatMap((t=>t.getExtensionElements(e)))}getModel(e){return B(this.projectDependencyModelsIndex.get(e),`Can't find dependency model with project ID '${e}'`)}getNullableElement(e,t){return this.dependencyGraphs.find((s=>Boolean(s.getOwnNullableElement(e,t))))?.getOwnNullableElement(e,t)}}class Cp extends ap{static NAME="ModelStore";static INSTANCE=new Cp;constructor(){super(Cp.NAME)}accept_PackageableElementVisitor(e){throw new F}}class xp extends gp{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(fe.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(Cp.NAME,Cp.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[cu.STRING,cu.BOOLEAN,cu.BINARY,cu.NUMBER,cu.INTEGER,cu.FLOAT,cu.DECIMAL,cu.DATE,cu.STRICTDATE,cu.DATETIME,cu.STRICTTIME,cu.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class Np extends gp{autoImports=[];constructor(e){super(fe.SYSTEM,e)}initializeAutoImports(){this.autoImports=Oe.map((e=>Y(this.getOwnNullableElement(e,!0),ds,`Can't find auto-import package '${e}'`)))}}class Op extends gp{constructor(e){super(fe.MODEL_GENERATION,e)}}class Ap extends gp{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(fe.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new Op(i),this.dependencyManager=new Tp(i)}get autoImports(){return this.systemModel.autoImports}get primitiveTypes(){return this.coreModel.primitiveTypes}get sectionIndices(){return[...this.coreModel.ownSectionIndices,...this.systemModel.ownSectionIndices,...this.dependencyManager.sectionIndices,...this.ownSectionIndices,...this.generationModel.ownSectionIndices]}get profiles(){return[...this.coreModel.ownProfiles,...this.systemModel.ownProfiles,...this.dependencyManager.profiles,...this.ownProfiles,...this.generationModel.ownProfiles]}get enumerations(){return[...this.coreModel.ownEnumerations,...this.systemModel.ownEnumerations,...this.dependencyManager.enumerations,...this.ownEnumerations,...this.generationModel.ownEnumerations]}get measures(){return[...this.coreModel.ownMeasures,...this.systemModel.ownMeasures,...this.dependencyManager.measures,...this.ownMeasures,...this.generationModel.ownMeasures]}get classes(){return[...this.coreModel.ownClasses,...this.systemModel.ownClasses,...this.dependencyManager.classes,...this.ownClasses,...this.generationModel.ownClasses]}get types(){return[...this.coreModel.ownTypes,...this.systemModel.ownTypes,...this.dependencyManager.types,...this.ownTypes,...this.generationModel.ownTypes]}get associations(){return[...this.coreModel.ownAssociations,...this.systemModel.ownAssociations,...this.dependencyManager.associations,...this.ownAssociations,...this.generationModel.ownAssociations]}get functions(){return[...this.coreModel.ownFunctions,...this.systemModel.ownFunctions,...this.dependencyManager.functions,...this.ownFunctions,...this.generationModel.ownFunctions]}get stores(){return[...this.coreModel.ownStores,...this.systemModel.ownStores,...this.dependencyManager.stores,...this.ownStores,...this.generationModel.ownStores]}get databases(){return[...this.coreModel.ownDatabases,...this.systemModel.ownDatabases,...this.dependencyManager.databases,...this.ownDatabases,...this.generationModel.ownDatabases]}get mappings(){return[...this.coreModel.ownMappings,...this.systemModel.ownMappings,...this.dependencyManager.mappings,...this.ownMappings,...this.generationModel.ownMappings]}get services(){return[...this.coreModel.ownServices,...this.systemModel.ownServices,...this.dependencyManager.services,...this.ownServices,...this.generationModel.ownServices]}get runtimes(){return[...this.coreModel.ownRuntimes,...this.systemModel.ownRuntimes,...this.dependencyManager.runtimes,...this.ownRuntimes,...this.generationModel.ownRuntimes]}get connections(){return[...this.coreModel.ownConnections,...this.systemModel.ownConnections,...this.dependencyManager.connections,...this.ownConnections,...this.generationModel.ownConnections]}get dataElements(){return[...this.coreModel.ownDataElements,...this.systemModel.ownDataElements,...this.dependencyManager.dataElements,...this.ownDataElements,...this.generationModel.ownDataElements]}get generationSpecifications(){return[...this.coreModel.ownGenerationSpecifications,...this.systemModel.ownGenerationSpecifications,...this.dependencyManager.generationSpecifications,...this.ownGenerationSpecifications,...this.generationModel.ownGenerationSpecifications]}get fileGenerations(){return[...this.coreModel.ownFileGenerations,...this.systemModel.ownFileGenerations,...this.dependencyManager.fileGenerations,...this.ownFileGenerations,...this.generationModel.ownFileGenerations]}get allElements(){return[...this.coreModel.allOwnElements,...this.systemModel.allOwnElements,...this.dependencyManager.allOwnElements,...this.allOwnElements,...this.generationModel.allOwnElements]}get allOwnTestables(){const e=this.graphPlugins.flatMap((e=>e.getExtraTestablesCollectors?.()??[])).map((e=>e(this)));return[...this.ownTestables].concat(...e)}getPrimitiveType=e=>B(this.coreModel.primitiveTypesIndex.get(e),`Can't find primitive type '${e}'`);getType=e=>B(this.getOwnNullableType(e)??this.generationModel.getOwnNullableType(e)??this.dependencyManager.getOwnNullableType(e)??this.systemModel.getOwnNullableType(e)??this.coreModel.getOwnNullableType(e),`Can't find type '${e}'`);getProfile=e=>B(this.getOwnNullableProfile(e)??this.generationModel.getOwnNullableProfile(e)??this.dependencyManager.getOwnNullableProfile(e)??this.systemModel.getOwnNullableProfile(e),`Can't find profile '${e}'`);getEnumeration=e=>Y(this.getType(e),os,`Can't find enumeration '${e}'`);getMeasure=e=>Y(this.getType(e),cs,`Can't find measure '${e}'`);getUnit=e=>Y(this.getType(e),ls,`Can't find unit '${e}'`);getClass=e=>Y(this.getType(e),as,`Can't find class '${e}'`);getAssociation=e=>B(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e),`Can't find association '${e}'`);getPropertyOwner=e=>B(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e)??Y(this.getType(e),as),`Can't find property owner '${e}'`);getFunction=e=>Y(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),np,`Can't find function '${e}'`);getStore=e=>B(this.getOwnNullableStore(e)??this.generationModel.getOwnNullableStore(e)??this.dependencyManager.getOwnNullableStore(e)??this.systemModel.getOwnNullableStore(e)??this.coreModel.getOwnNullableStore(e),`Can't find store '${e}'`);getFlatDataStore=e=>Y(this.getStore(e),rp,`Can't find flat-data store '${e}'`);getDatabase=e=>Y(this.getStore(e),up,`Can't find database store '${e}'`);getMapping=e=>B(this.getOwnNullableMapping(e)??this.generationModel.getOwnNullableMapping(e)??this.dependencyManager.getOwnNullableMapping(e)??this.systemModel.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getService=e=>B(this.getOwnNullableService(e)??this.generationModel.getOwnNullableService(e)??this.dependencyManager.getOwnNullableService(e)??this.systemModel.getOwnNullableService(e),`Can't find service '${e}'`);getConnection=e=>B(this.getOwnNullableConnection(e)??this.generationModel.getOwnNullableConnection(e)??this.dependencyManager.getOwnNullableConnection(e)??this.systemModel.getOwnNullableConnection(e),`Can't find connection '${e}'`);getRuntime=e=>B(this.getOwnNullableRuntime(e)??this.generationModel.getOwnNullableRuntime(e)??this.dependencyManager.getOwnNullableRuntime(e)??this.systemModel.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getGenerationSpecification=e=>B(this.getOwnNullableGenerationSpecification(e)??this.generationModel.getOwnNullableGenerationSpecification(e)??this.dependencyManager.getOwnNullableGenerationSpecification(e)??this.systemModel.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getFileGeneration=e=>B(this.getOwnNullableFileGeneration(e)??this.generationModel.getOwnNullableFileGeneration(e)??this.dependencyManager.getOwnNullableFileGeneration(e)??this.systemModel.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getDataElement=e=>B(this.getOwnNullableDataElement(e)??this.generationModel.getOwnNullableDataElement(e)??this.dependencyManager.getOwnNullableDataElement(e)??this.systemModel.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getExtensionElement(e,t,s){return B(this.getOwnNullableExtensionElement(e,t)??this.generationModel.getOwnNullableExtensionElement(e,t)??this.dependencyManager.getOwnNullableExtensionElement(e,t)??this.systemModel.getOwnNullableExtensionElement(e,t),s??`Can't find element '${e}'`)}getElement=(e,t)=>B(this.getNullableElement(e,t),`Can't find element '${e}'`);getNullableClass=e=>U((()=>this.getClass(e)));getNullableMapping=e=>U((()=>this.getMapping(e)));getNullableService=e=>U((()=>this.getService(e)));getNullableRuntime=e=>U((()=>this.getRuntime(e)));getNullableFileGeneration=e=>U((()=>this.getFileGeneration(e)));getNullableElement(e,t){const s=super.getOwnNullableElement(e)??this.dependencyManager.getNullableElement(e)??this.generationModel.getOwnNullableElement(e)??this.systemModel.getOwnNullableElement(e)??this.coreModel.getOwnNullableElement(e);return t&&!s?this.getNullablePackage(e)??this.dependencyManager.getNullableElement(e,!0)??this.generationModel.getNullablePackage(e)??this.systemModel.getNullablePackage(e):s}getMultiplicity(e,t){let s;return 1===e&&1===t?s=ru.ONE:0===e&&1===t?s=ru.ZERO_ONE:0===e&&void 0===t?s=ru.ZERO_MANY:1===e&&void 0===t?s=ru.ONE_MANY:0===e&&0===t&&(s=ru.ZERO),s??new ru(e,t)}addElement(e,t){const s=Fl(t??"",e.name);if(this.getNullableElement(s,!1))throw new k(`Can't create element '${s}': another element with the same path already existed`);super.addOwnElement(e,t)}deleteElement(e){super.deleteOwnElement(e);const t=this.graphPlugins.flatMap((e=>e.getExtraDeadReferencesCleaners?.()??[]));for(const e of t)e(this)}renameElement(e,t){if(this.getNullableElement(t,!1))throw new k(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class Sp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class yp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Ip{source;line;column;startLine;startColumn;endLine;endColumn}(0,ze.yu)(Ip,{column:(0,ze.Ru)(),endLine:(0,ze.Ru)(),endColumn:(0,ze.Ru)(),line:(0,ze.Ru)(),source:(0,ze.Ru)(),startLine:(0,ze.Ru)(),startColumn:(0,ze.Ru)()});class vp{package;name;tags=[];stereotypes=[]}(0,ze.yu)(vp,{name:(0,ze.Ru)(),package:(0,ze.Ru)(),stereotypes:(0,ze.pb)((0,ze.Ru)()),tags:(0,ze.pb)((0,ze.Ru)())});class Rp{profile;value}(0,ze.yu)(Rp,{profile:(0,ze.Ru)(),value:(0,ze.Ru)()});class Pp{profile;value}(0,ze.yu)(Pp,{profile:(0,ze.Ru)(),value:(0,ze.Ru)()});class wp{tag;value}(0,ze.yu)(wp,{tag:(0,ze.Ry)(Pp),value:(0,ze.Ru)()});class Lp{rawType;typeParameter}(0,ze.yu)(Lp,{rawType:(0,ze.jt)((0,ze.Ru)()),typeParameter:(0,ze.jt)((0,ze.Ru)())});class bp{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,ze.yu)(bp,{aggregation:(0,ze.Ru)(),genericType:(0,ze.Ry)(Lp),multiplicity:(0,ze.Ru)(),name:(0,ze.Ru)(),stereotypes:(0,ze.pb)((0,ze.Ry)(Rp)),taggedValues:(0,ze.pb)((0,ze.Ry)(wp))});class Dp{package;name;sourceInformation}(0,ze.yu)(Dp,{name:(0,ze.Ru)(),package:(0,ze.Ru)(),sourceInformation:(0,ze.Ry)(Ip)});class Mp{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,ze.yu)(Mp,{generalizations:(0,ze.pb)((0,ze.Ry)(Lp)),name:(0,ze.Ru)(),package:(0,ze.Ru)(),properties:(0,ze.pb)((0,ze.Ry)(bp)),qualifiedProperties:(0,ze.pb)((0,ze.Ry)(bp)),sourceInformation:(0,ze.Ry)(Ip),stereotypes:(0,ze.pb)((0,ze.Ry)(Rp)),taggedValues:(0,ze.pb)((0,ze.Ry)(wp))});class kp{package;name;enumValues=[]}(0,ze.yu)(kp,{name:(0,ze.Ru)(),package:(0,ze.Ru)(),enumValues:(0,ze.pb)((0,ze.Ru)())});class Fp{x;y}(0,ze.yu)(Fp,{x:(0,ze.Ru)(),y:(0,ze.Ru)()});class jp{height;width}(0,ze.yu)(jp,{height:(0,ze.Ru)(),width:(0,ze.Ru)()});class Up{points=[]}(0,ze.yu)(Up,{points:(0,ze.pb)((0,ze.Ry)(Fp))});class Vp{id;source;target;geometry}(0,ze.yu)(Vp,{geometry:(0,ze.Ry)(Up),id:(0,ze.Ru)(),source:(0,ze.Ru)(),target:(0,ze.Ru)()});class Gp{name;owningType}(0,ze.yu)(Gp,{name:(0,ze.Ru)(),owningType:(0,ze.Ru)()});class zp{id;source;target;property;geometry}(0,ze.yu)(zp,{geometry:(0,ze.Ry)(Up),id:(0,ze.Ru)(),property:(0,ze.Ry)(Gp),source:(0,ze.Ru)(),target:(0,ze.Ru)()});class Bp{id;type;position;rectangleGeometry}(0,ze.yu)(Bp,{id:(0,ze.Ru)(),position:(0,ze.Ry)(Fp),rectangleGeometry:(0,ze.Ry)(jp),type:(0,ze.Ru)()});class $p{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,ze.yu)($p,{name:(0,ze.Ru)(),generalizationViews:(0,ze.pb)((0,ze.Ry)(Vp)),package:(0,ze.Ru)(),propertyViews:(0,ze.pb)((0,ze.Ry)(zp)),sourceInformation:(0,ze.Ry)(Ip),stereotypes:(0,ze.pb)((0,ze.Ry)(Rp)),taggedValues:(0,ze.pb)((0,ze.Ry)(wp)),typeViews:(0,ze.pb)((0,ze.Ry)(Bp))});class Hp{classes=[];enumerations=[];profiles=[]}(0,ze.yu)(Hp,{classes:(0,ze.pb)((0,ze.Ry)(Mp)),enumerations:(0,ze.pb)((0,ze.Ry)(kp)),profiles:(0,ze.pb)((0,ze.Ry)(vp))});class Yp{name;diagram;domainInfo}(0,ze.yu)(Yp,{diagram:(0,ze.Ry)($p),name:(0,ze.Ru)(),domainInfo:(0,ze.jt)((0,ze.Ry)(Hp))});class Wp{class;enumerations=[];profiles=[];specializations=[]}(0,ze.yu)(Wp,{class:(0,ze.Ry)(Mp),enumerations:(0,ze.pb)((0,ze.Ry)(kp)),profiles:(0,ze.pb)((0,ze.Ry)(vp)),specializations:(0,ze.pb)((0,ze.Ry)(Dp))});const Kp=e=>{const t=e.classViews.map((e=>` TypeView ${e.id}(\n type=${e.class.value.path},\n position=(${e.position.x.toFixed(5)}, ${e.position.y.toFixed(5)}),\n width=${e.rectangle.width.toFixed(5)},\n height=${e.rectangle.height.toFixed(5)},\n stereotypesVisible=true,\n attributesVisible=true,\n attributeStereotypesVisible=true,\n attributeTypesVisible=true,\n color=#FFFFCC,\n lineWidth=1.0)`)),s=e.generalizationViews.map(((e,t)=>` GeneralizationView gview_${t}(\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n color=#000000,\n lineWidth=-1.0,\n lineStyle=SIMPLE)`)),i=e.propertyViews.map(((e,t)=>` PropertyView pview_${t}(\n property=${e.property.value._OWNER.path}.${e.property.value.name},\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n propertyPosition=(0.0,0.0),\n multiplicityPosition=(0.0,0.0),\n color=#000000,\n lineWidth=-1.0,\n stereotypesVisible=true,\n nameVisible=true,\n lineStyle=SIMPLE)`));return`Diagram ${e.path}(width=0.0, height=0.0)\n{\n${[...t,...s,...i].join("\n\n")}\n}`},Zp=(e,t,s,i)=>{const n=t.getOwnNullableClass(e);if(!n){const[n,a]=kl(e),r=new as(a);return jl(Gl(t.root,n,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return n},Xp=e=>{if("*"===e)return new ru(0,void 0);{const t=e.split("..");if(1===t.length)return new ru(parseInt(B(t[0]),10),parseInt(B(t[0]),10));if(2===t.length)return new ru(parseInt(B(t[0]),10),"*"===t[1]?void 0:parseInt(B(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},qp=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,n;w(e.taggedValues,new Wu(Zu.create((i=s.getProfile(t.tag.profile),n=t.tag.value,B(i.p_tags.find((e=>e.value===n)),`Can't find tag '${n}' in profile '${i.path}'`))),t.value))})),t.stereotypes.forEach((t=>{var i,n;w(e.stereotypes,qu.create((i=s.getProfile(t.profile),n=t.value,B(i.p_stereotypes.find((e=>e.value===n)),`Can't find stereotype '${n}' in profile '${i.path}'`))))})),t.generalizations.filter((e=>Boolean(e.rawType))).forEach((t=>{const n=Zp(B(t.rawType),s,i,void 0);w(e.generalizations,iu.create(new nu(n))),w(n._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const n=new au(t.name,Xp(t.multiplicity),iu.create(new nu(s.getOwnNullableEnumeration(B(t.genericType.rawType))??Zp(B(t.genericType.rawType),s,i,void 0))),e);n.aggregation="Composite"===t.aggregation?Qh.COMPOSITE:"Shared"===t.aggregation?Qh.SHARED:void 0,w(e.properties,n)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{w(e.derivedProperties,new tu(t.name,Xp(t.multiplicity),iu.create(new nu(s.getOwnNullableEnumeration(B(t.genericType.rawType))??Zp(B(t.genericType.rawType),s,i,void 0))),e))}))},Jp=e=>{const t=new Ap(new xp([]),new Np([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new as(e.name);jl(Gl(t.root,e.package,!0,new Map),i),t.setOwnType(i.path,i),s.set(i.path,{sourceInformation:e.sourceInformation,isStubbed:!1})})),i.profiles.forEach((e=>{const s=new ep(e.name);jl(Gl(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>w(s.p_tags,new Sp(s,e)))),e.stereotypes.forEach((e=>w(s.p_stereotypes,new yp(s,e))))})),i.enumerations.forEach((e=>{const s=new os(e.name);jl(Gl(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":me}${e.name}`,n=t.getClass(i);qp(n,e,t,s)}))}const i=e.diagram,n=new Ko(i.name);return jl(Gl(t.root,i.package,!0,new Map),n),i.typeViews.forEach((e=>{const s=new sc(n,e.id,Es.create(t.getClass(e.type)));s.position=new Ql(e.position.x,e.position.y),s.rectangle=new ec(e.rectangleGeometry.width,e.rectangleGeometry.height),w(n.classViews,s)})),i.propertyViews.forEach((e=>{const s=new lc(n,lu.create((i=t.getClass(e.property.owningType),a=e.property.name,B(i instanceof as?Hl(i).find((e=>e.name===a)):i.properties.find((e=>e.name===a)),`Can't find property '${a}' of '${i.path}'`))),B(n.classViews.find((t=>t.id===e.source))),B(n.classViews.find((t=>t.id===e.target))));var i,a;s.path=e.geometry.points.map((e=>new Ql(e.x,e.y))),pc(s),w(n.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new cc(n,B(n.classViews.find((t=>t.id===e.source))),B(n.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new Ql(e.x,e.y))),pc(t),w(n.generalizationViews,t)})),[n,t,s]};class Qp extends Gd{diagramInfo;_renderer;diagram;diagramClasses;graph;diagramPath;filePath;fileLine;fileColumn;constructor(e,t,s,i,n,a){super(e),(0,O.rC)(this,{_renderer:O.LO,diagram:O.LO,diagramInfo:O.LO,diagramName:O.Fl,diagramCursorClass:O.Fl,addClassView:O.ls,rebuild:O.aD,setRenderer:O.aD}),this.diagramPath=s,this.filePath=i,this.fileLine=n,this.fileColumn=a,this.diagramInfo=t;const[r,o,l]=Jp(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return Md(this.diagramPath)}get description(){return`Diagram: ${Md(this.diagramPath)}`}get diagramName(){return e=this.diagramPath,B((0,Ml.Z)(e.split(me)));var e}match(e){return e instanceof Qp&&this.diagramPath===e.diagramPath}get renderer(){return B(this._renderer,"Diagram renderer must be initialized (this is likely caused by calling this method at the wrong place)")}get isDiagramRendererInitialized(){return Boolean(this._renderer)}get diagramCursorClass(){if(!this.isDiagramRendererInitialized)return"";if(this.renderer.middleClick||this.renderer.rightClick)return"diagram-editor__cursor--grabbing";switch(this.renderer.interactionMode){case Vu.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case Vu.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case Vu.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case Vu.LAYOUT:return this.renderer.selectionStart?"diagram-editor__cursor--crosshair":this.renderer.mouseOverClassCorner||this.renderer.selectedClassCorner?"diagram-editor__cursor--resize":this.renderer.mouseOverClassView?"diagram-editor__cursor--pointer":"";default:return""}}rebuild(e){this.diagramInfo=e;const[t,s,i]=Jp(e);this.diagram=t,this.graph=s,this.diagramClasses=i,this.fileLine=e.diagram.sourceInformation.line,this.fileColumn=e.diagram.sourceInformation.column}setupRenderer(){this.renderer.onClassViewDoubleClick=e=>{const t=this.diagramClasses.get(e.class.value.path)?.sourceInformation;if(t){const e=new Fd(t.source,t.startLine,t.startColumn);(0,O.fl)(this.editorStore.executeNavigation(e)).catch(this.editorStore.applicationStore.alertUnhandledError)}}}setRenderer(e){this._renderer=e}*addClassView(e,t){const s=((e,t,s)=>{e.profiles.forEach((e=>{const s=`${e.package}${""===e.package?"":me}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new ep(e.name);jl(Gl(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>w(s.p_tags,new Sp(s,e)))),e.stereotypes.forEach((e=>w(s.p_stereotypes,new yp(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":me}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new os(e.name);jl(Gl(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,n=`${i.package}${""===i.package?"":me}${i.name}`;let a=t.getOwnNullableClass(n);a||(a=new as(i.name),jl(Gl(t.root,i.package,!0,new Map),a),t.setOwnType(a.path,a));const r=s.get(a.path)?.isStubbed??!0;return s.set(a.path,{sourceInformation:i.sourceInformation,isStubbed:!1}),e.specializations.forEach((e=>{const i=B(a),n=Zp(B(`${e.package}${""===e.package?"":me}${e.name}`),t,s,e.sourceInformation);w(i._subclasses,n),n.generalizations.map((e=>e.value.rawType)).includes(i)||w(n.generalizations,iu.create(new nu(i)))})),r&&qp(a,i,t,s),a})((0,ze.vB)(Wp,yield this.editorStore.client.getDiagramClassInfo(e)),this.graph,this.diagramClasses),i=this.renderer.addClassView(s,t);i&&(i.id=((e,t)=>{if(!t.match(/^[\w_-]+$/))throw new Error("Token must only contain digits, letters, or special characters _ and -");return`cview_${e.map((e=>{const t=e.match(new RegExp("^cview_(?<count>\\d+)$"));return t?.groups?.count?parseInt(t.groups.count,10):0})).reduce(((e,t)=>Math.max(e,t)),0)+1}`})(this.diagram.classViews.map((e=>e.id)),"cview"))}registerCommands(){const e=()=>this.editorStore.tabManagerState.currentTab===this&&this.isDiagramRendererInitialized;this.editorStore.applicationStore.commandCenter.registerCommand({key:Hd.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Hd.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Hd.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:Hd.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[Hd.RECENTER,Hd.USE_ZOOM_TOOL,Hd.USE_VIEW_TOOL,Hd.USE_PAN_TOOL].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class e_{text="";isCaseSensitive=!1;isRegExp=!1;constructor(){(0,O.rC)(this,{text:O.LO,isCaseSensitive:O.LO,isRegExp:O.LO,reset:O.aD,setText:O.aD,setCaseSensitive:O.aD,setRegExp:O.aD})}reset(){this.setText(""),this.setCaseSensitive(!1),this.setRegExp(!1)}setText(e){this.text=e}setCaseSensitive(e){this.isCaseSensitive=e}toggleCaseSensitive(){this.setCaseSensitive(!this.isCaseSensitive)}setRegExp(e){this.isRegExp=e}toggleRegExp(){this.setRegExp(!this.isRegExp)}}class t_ extends D{}class s_{applicationStore;initState=gt.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=bd.CONSOLE;auxPanelDisplayState=new Jh({initial:0,default:300,snap:100});activeActivity=Ld.CONCEPT;sideBarDisplayState=new Jh({initial:300,default:300,snap:150});tabManagerState=new zd(this);executionState=gt.create();navigationStack=[];consoleText;fileSearchCommandLoadingState=gt.create();fileSearchCommandState=new e_;openFileSearchCommand=!1;fileSearchCommandResults=[];textSearchCommandLoadingState=gt.create();textSearchCommandState=new e_;openTextSearchCommand=!1;searchState;testRunState=gt.create();testRunnerState;constructor(e){(0,O.rC)(this,{isMaxAuxPanelSizeSet:O.LO,activeAuxPanelMode:O.LO,activeActivity:O.LO,consoleText:O.LO,navigationStack:O.LO,openFileSearchCommand:O.LO,fileSearchCommandResults:O.LO,fileSearchCommandState:O.LO,openTextSearchCommand:O.LO,textSearchCommandState:O.LO,searchState:O.LO,testRunnerState:O.LO,setOpenFileSearchCommand:O.aD,setOpenTextSearchCommand:O.aD,setActiveAuxPanelMode:O.aD,setActiveActivity:O.aD,setConsoleText:O.aD,setSearchState:O.aD,setTestRunnerState:O.aD,pullInitializationActivity:O.aD,pullExecutionStatus:O.aD,initialize:O.ls,checkIfSessionWakingUp:O.ls,loadDiagram:O.ls,loadFile:O.ls,reloadFile:O.ls,execute:O.ls,executeGo:O.ls,manageExecuteGoResult:O.ls,executeTests:O.ls,executeFullTestSuite:O.ls,executeNavigation:O.ls,navigateBack:O.ls,executeSaveAndReset:O.ls,fullReCompile:O.ls,refreshTrees:O.ls,updateFileUsingSuggestionCandidate:O.ls,updateFile:O.ls,searchFile:O.ls,searchText:O.ls,findUsages:O.ls,command:O.ls,createNewDirectory:O.ls,createNewFile:O.ls,deleteDirectoryOrFile:O.ls}),this.applicationStore=e,this.directoryTreeState=new ih(this),this.conceptTreeState=new ph(this),this.client=new qh(new ue({baseUrl:this.applicationStore.config.useDynamicPureServer?window.location.origin:this.applicationStore.config.pureUrl}))}setOpenFileSearchCommand(e){this.openFileSearchCommand=e}setOpenTextSearchCommand(e){this.openTextSearchCommand=e}setActiveAuxPanelMode(e){this.activeAuxPanelMode=e}setConsoleText(e){this.consoleText=e}setSearchState(e){this.searchState=e}setTestRunnerState(e){this.testRunnerState=e}cleanUp(){this.applicationStore.setBlockingAlert(void 0),this.applicationStore.setActionAlertInfo(void 0)}*initialize(e,t,s,i){if(this.initState.isInInitialState){this.client.mode=s,this.client.compilerMode=i,this.initState.inProgress();try{const s=this.client.initialize(!e);this.applicationStore.setBlockingAlert({message:"Loading Pure IDE...",prompt:"Please be patient as we are building the initial application state",showLoading:!0}),yield this.pullInitializationActivity(),this.applicationStore.setBlockingAlert(void 0);const i=(0,O.fl)(this.loadFile("/welcome.pure")),a=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(n=yield s).error?n.source?(0,ze.vB)(gh,n):(0,ze.vB)(mh,n):(0,ze.vB)(_h,n);o.text&&(this.setConsoleText(o.text),this.setActiveAuxPanelMode(bd.CONSOLE),this.auxPanelDisplayState.open()),o instanceof mh?o.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof gh&&(yield(0,O.fl)(this.loadFile(o.source,new jd(o.source,o.line,o.column,new t_((o.text??"").split("\n").filter(Boolean)[0]))))):(t&&(yield t()),yield Promise.all([i,a,r]))}catch(e){return j(e),this.applicationStore.notifyError(e),this.initState.fail(),void this.applicationStore.setBlockingAlert({message:"Failed to initialize IDE",prompt:"Make sure the IDE server is working, otherwise try to restart it"})}var n;this.initState.pass()}else this.applicationStore.notifyIllegalState("Editor store is re-initialized")}*checkIfSessionWakingUp(e){this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",showLoading:!0}),yield this.pullInitializationActivity((t=>{t.text&&this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",prompt:t.text,showLoading:!0})})),this.applicationStore.setBlockingAlert(void 0)}async pullInitializationActivity(e){return(await this.client.getInitializationActivity()).initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullInitializationActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}registerCommands(){this.applicationStore.commandCenter.registerCommand({key:Bd.SEARCH_FILE,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:Bd.SEARCH_TEXT,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenTextSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:Bd.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof Kd&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,!0)}}),this.applicationStore.commandCenter.registerCommand({key:Bd.TOGGLE_AUX_PANEL,trigger:()=>this.initState.hasSucceeded,action:()=>this.auxPanelDisplayState.toggle()}),this.applicationStore.commandCenter.registerCommand({key:Bd.EXECUTE,action:()=>{(0,O.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Bd.FULL_RECOMPILE,action:()=>{(0,O.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Bd.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,O.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Bd.RUN_ALL_TESTS,action:()=>{(0,O.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:Bd.RUN_RELAVANT_TESTS,action:()=>{(0,O.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[Bd.SEARCH_FILE,Bd.SEARCH_TEXT,Bd.GO_TO_FILE,Bd.TOGGLE_AUX_PANEL,Bd.EXECUTE,Bd.FULL_RECOMPILE,Bd.FULL_RECOMPILE_WITH_FULL_INIT,Bd.RUN_ALL_TESTS,Bd.RUN_RELAVANT_TESTS].forEach((e=>this.applicationStore.commandCenter.deregisterCommand(e)))}setActiveActivity(e,t){this.sideBarDisplayState.isOpen?e!==this.activeActivity||t?.keepShowingIfMatchedCurrent||this.sideBarDisplayState.close():this.sideBarDisplayState.open(),this.activeActivity=e}*loadDiagram(e,t,s,i){let n=this.tabManagerState.tabs.find((e=>e instanceof Qp&&e.diagramPath===t));n||(yield(0,O.fl)(this.checkIfSessionWakingUp()),n=new Qp(this,(0,ze.vB)(Yp,yield this.client.getDiagramInfo(t)),t,e,s,i)),this.tabManagerState.openTab(n)}*loadFile(e,t){let s=this.tabManagerState.tabs.find((t=>t instanceof Kd&&t.filePath===e));s||(yield(0,O.fl)(this.checkIfSessionWakingUp()),s=new Kd(this,(0,ze.vB)(kd,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof jd&&s.showError(t))}*reloadFile(e){const t=[];yield Promise.all(this.tabManagerState.tabs.map((async s=>{if(s instanceof Kd&&s.filePath===e)s.setFile((0,ze.vB)(kd,await this.client.getFile(e)));else if(s instanceof Qp&&s.filePath===e)try{s.rebuild((0,ze.vB)(Yp,await this.client.getDiagramInfo(s.diagramPath)))}catch{t.push(s)}}))),t.forEach((e=>this.tabManagerState.closeTab(e)))}*execute(e,t,s,i,n){if(this.initState.hasSucceeded)if(this.executionState.isInProgress)this.applicationStore.notifyWarning("Another execution is already in progress!");else{this.searchState instanceof bh||this.setSearchState(void 0),this.executionState.inProgress();try{const r=this.tabManagerState.tabs.map((e=>e instanceof Kd?{path:e.filePath,code:e.file.content}:e instanceof Qp?{diagram:e.diagramPath,code:Kp(e.diagram)}:void 0)).filter(G),o=this.client.execute(r,e,t),l=1e3;let c,d=!1;yield Promise.all([o.then((e=>{d=!0,c=e})),new Promise((e=>setTimeout((()=>{!d&&s&&(this.applicationStore.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),e(this.pullExecutionStatus())),e()}),l,!0)))]);const h=(a=B(c)).error?a.candidateName&&a.PureUnmatchedFunctionException?(0,ze.vB)(Ah,a):a.candidateName&&a.candidates?(0,ze.vB)(Sh,a):(0,ze.vB)(Th,a):a.jumpTo?(0,ze.vB)(xh,a):a.tests?(0,ze.vB)(vh,a):(0,ze.vB)(fh,a);this.applicationStore.setBlockingAlert(void 0),n?.avoidUpdatingConsoleText||this.setConsoleText(h.text),h instanceof Th?(this.applicationStore.notifyWarning("Execution failed!"),h.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:h.sessionError}):yield(0,O.fl)(i(h))):h instanceof fh?(this.applicationStore.notifySuccess("Execution succeeded!"),h.reinit?(this.applicationStore.setBlockingAlert({message:"Reinitializing...",prompt:"Please do not refresh the application",showLoading:!0}),this.initState.reset(),yield(0,O.fl)(this.initialize(!1,(()=>(0,O.fl)(this.execute(e,t,s,i))),this.client.mode,this.client.compilerMode))):yield(0,O.fl)(i(h))):yield(0,O.fl)(i(h))}finally{this.applicationStore.setBlockingAlert(void 0),this.executionState.reset()}var a}else this.applicationStore.notifyWarning("Can't execute while initializing application")}async pullExecutionStatus(){const e=await this.client.getExecutionActivity();return this.applicationStore.setBlockingAlert({message:"Executing...",prompt:e.text?e.text:"Please do not refresh the application",showLoading:!0}),e.executing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullExecutionStatus())}catch(e){t(e)}}),500))):(this.applicationStore.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),Promise.resolve())}*executeGo(){yield(0,O.fl)(this.execute("executeGo",{},!0,(e=>(0,O.fl)(this.manageExecuteGoResult(e)))))}*manageExecuteGoResult(e){const t=(0,O.fl)(this.refreshTrees());if(e instanceof Th)yield(0,O.fl)(this.loadFile(e.source,new jd(e.source,e.line,e.column,new t_(e.text.split("\n").filter(Boolean)[0])))),e instanceof Ah?(this.setSearchState(new kh(this,e)),this.setActiveAuxPanelMode(bd.SEARCH_RESULT),this.auxPanelDisplayState.open()):e instanceof Sh&&(this.setSearchState(new Fh(this,e)),this.setActiveAuxPanelMode(bd.SEARCH_RESULT),this.auxPanelDisplayState.open());else if(e instanceof fh&&e.modifiedFiles.length)for(const t of e.modifiedFiles)yield(0,O.fl)(this.reloadFile(t));yield t}*executeTests(e,t){t?this.applicationStore.notifyUnsupportedFeature("Run relevant tests"):this.testRunState.isInProgress?this.applicationStore.notifyWarning("Test runner is working. Please try again later"):(this.testRunState.inProgress(),yield(0,O.fl)(this.execute("executeTests",{path:e,relevantTestsOnly:t},!1,(async e=>{const t=(0,O.fl)(this.refreshTrees());if(e instanceof Th)await(0,O.fl)(this.loadFile(e.source,new jd(e.source,e.line,e.column,new t_(e.text.split("\n").filter(Boolean)[0])))),this.setActiveAuxPanelMode(bd.CONSOLE),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof vh){this.setActiveAuxPanelMode(bd.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new Yh(this,e);this.setTestRunnerState(t),await(0,O.fl)(t.buildTestTreeData()),t.refreshTree(),await(0,O.fl)(t.pollTestRunnerResult()),this.testRunState.pass()}await t}))))}*executeFullTestSuite(e){yield(0,O.fl)(this.executeTests("::",e))}*executeNavigation(e){this.navigationStack.push(e),yield(0,O.fl)(this.execute("getConcept",{file:e.file,line:e.line,column:e.column},!1,(async e=>{e instanceof xh&&await(0,O.fl)(this.loadFile(e.jumpTo.source,new Fd(e.jumpTo.source,e.jumpTo.line,e.jumpTo.column)))}),{avoidUpdatingConsoleText:!0}))}*navigateBack(){if(0!==this.navigationStack.length){if(this.navigationStack.length>0){const e=this.navigationStack.pop();e&&(yield(0,O.fl)(this.loadFile(e.file,e)))}}else this.applicationStore.notifyWarning("Can't navigate back any further - navigation stack is empty")}*executeSaveAndReset(e){yield(0,O.fl)(this.execute("executeSaveAndReset",{},!0,(async t=>{this.initState.reset(),await(0,O.fl)(this.initialize(e,void 0,this.client.mode,this.client.compilerMode)),this.setActiveActivity(Ld.CONCEPT,{keepShowingIfMatchedCurrent:!0})})))}*fullReCompile(e){this.applicationStore.setActionAlertInfo({message:"Are you sure you want to perform a full re-compile?",prompt:"This may take a long time to complete",type:It.CAUTION,actions:[{label:"Perform full re-compile",type:vt.PROCEED_WITH_CAUTION,handler:()=>{(0,O.fl)(this.executeSaveAndReset(e)).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:vt.PROCEED,default:!0}]})}*refreshTrees(){yield Promise.all([this.directoryTreeState.refreshTreeData(),this.conceptTreeState.refreshTreeData()])}*updateFileUsingSuggestionCandidate(e){this.setSearchState(void 0),yield(0,O.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActiveAuxPanelMode(bd.CONSOLE),this.auxPanelDisplayState.open()}*updateFile(e,t,s,i,n){yield(0,O.fl)(this.execute("updateSource",{updatePath:e,updateSources:[{path:e,line:t,column:s,add:i,message:n}]},!1,(e=>(0,O.fl)(this.manageExecuteGoResult(e)))))}*searchFile(){this.fileSearchCommandLoadingState.isInProgress||(this.fileSearchCommandLoadingState.inProgress(),this.fileSearchCommandResults=yield this.client.findFiles(this.fileSearchCommandState.text,this.fileSearchCommandState.isRegExp),this.fileSearchCommandLoadingState.pass())}*searchText(){if(!this.textSearchCommandLoadingState.isInProgress){this.textSearchCommandLoadingState.inProgress(),this.setActiveAuxPanelMode(bd.SEARCH_RESULT),this.auxPanelDisplayState.open();try{const e=(yield this.client.searchText(this.textSearchCommandState.text,this.textSearchCommandState.isCaseSensitive,this.textSearchCommandState.isRegExp)).map((e=>(e=>(0,ze.vB)(wh,e))(e)));this.setSearchState(new Dh(this,e)),this.textSearchCommandLoadingState.pass()}catch(e){j(e),this.applicationStore.notifyError(e),this.textSearchCommandLoadingState.fail()}}}*findUsages(e){const t="Error finding references. Please make sure that the code compiles and that you are looking for references of non primitive types!";let s;try{s=yield this.client.getConceptPath(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning(t)}try{this.applicationStore.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${Wh(s)}`,showLoading:!0});const e=(yield this.client.getUsages(s.owner?s.type?"meta::pure::ide::findusages::findUsagesForEnum_String_1__String_1__SourceInformation_MANY_":"meta::pure::ide::findusages::findUsagesForProperty_String_1__String_1__SourceInformation_MANY_":"meta::pure::ide::findusages::findUsagesForPath_String_1__SourceInformation_MANY_",(s.owner?[`'${s.owner}'`]:[]).concat(`'${s.path}'`))).map((e=>(0,ze.vB)(Kh,e)));this.setSearchState(new Mh(this,s,e)),this.setActiveAuxPanelMode(bd.SEARCH_RESULT),this.auxPanelDisplayState.open()}catch{this.applicationStore.notifyWarning(t)}finally{this.applicationStore.setBlockingAlert(void 0)}}*command(e){try{const s=(t=yield e()).error?(0,ze.vB)(Xh,t):new Zh;return!(s instanceof Xh&&(s.errorDialog?this.applicationStore.notifyWarning(`Error: ${s.text}`):this.setConsoleText(s.text),1))}catch(e){return j(e),this.applicationStore.notifyError(e),!1}var t}*createNewDirectory(e){yield(0,O.fl)(this.command((()=>this.client.createFolder(Md(e))))),yield(0,O.fl)(this.directoryTreeState.refreshTreeData())}*createNewFile(e){const t=yield(0,O.fl)(this.command((()=>this.client.createFile(Md(e)))));yield(0,O.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,O.fl)(this.loadFile(e)))}*deleteDirectoryOrFile(e,t,s){const i=async()=>{await(0,O.fl)(this.command((()=>this.client.deleteDirectoryOrFile(Md(e))))),this.tabManagerState.tabs.filter((t=>t instanceof Kd&&t.filePath.startsWith(e))).forEach((e=>this.tabManagerState.closeTab(e))),await(0,O.fl)(this.directoryTreeState.refreshTreeData())};this.applicationStore.setActionAlertInfo({message:`Are you sure you would like to delete this ${t?"directory":"file"}?`,prompt:s?"Beware! This directory is not empty, this action is not undo-able, you have to manually revert using VCS":"Beware! This action is not undo-able, you have to manually revert using VCS",type:It.CAUTION,actions:[{label:"Delete anyway",type:vt.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:vt.PROCEED,default:!0}]})}}const i_=(0,it.createContext)(void 0),n_=({children:e})=>{const t=Mt(),s=(0,st.fv)((()=>new s_(t)));return(0,x.jsx)(i_.Provider,{value:s,children:e})},a_=()=>B((0,it.useContext)(i_),"Can't find editor store in context"),r_=(0,st.Pi)((()=>{const e=a_();return(0,x.jsxs)("div",{className:"console-panel",children:[e.consoleText&&(0,x.jsx)("pre",{className:"console-panel__content",children:e.consoleText.trim()}),!e.consoleText&&(0,x.jsx)(od,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Execute to see output"}),(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F9"})})]})})})})]})})),o_=(0,st.Pi)((e=>{const{searchState:t,searchEntry:s}=e,i=a_(),n=Mt(),a=e=>()=>(0,O.fl)(i.loadFile(s.sourceId,new Fd(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,x.jsxs)("div",{className:"search-panel__entry",children:[(0,x.jsxs)("div",{className:"search-panel__entry__header",children:[(0,x.jsxs)("div",{className:"search-panel__entry__header__title",children:[(0,x.jsx)("div",{className:"search-panel__entry__header__title__label",children:(0,x.jsx)(Yc.QqN,{})}),(0,x.jsx)("div",{className:"search-panel__entry__header__title__content",children:Md(s.sourceId)})]}),(0,x.jsxs)("div",{className:"search-panel__entry__header__actions",children:[(0,x.jsx)("div",{className:"search-panel__entry__header__action search-panel__entry__header__action--with-counter",children:(0,x.jsx)("div",{className:"search-panel__entry__header__action__counter",children:s.coordinates.length})}),(0,x.jsx)("button",{className:"search-panel__entry__header__action search-panel__entry__header__action--hidden",tabIndex:-1,title:"Dismiss",onClick:()=>t.dismissSearchEntry(s),children:(0,x.jsx)(Yc.q1B,{})})]})]}),(0,x.jsx)("div",{className:"search-panel__entry__content",children:s.coordinates.map((e=>(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label search-panel__entry__content__item__label--full",title:"Go to Result",onClick:a(e),children:`line: ${e.startLine} - column: ${e.startColumn}`}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action search-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,x.jsx)(Yc.q1B,{})})})]},e.uuid)))})]})})),l_=(0,st.Pi)((e=>{const{searchState:t}=e,s=a_();return t.searchEntries.length?(0,x.jsxs)("div",{className:"search-panel__content",children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} result(s) in ${t.numberOfFiles} files for '${s.textSearchCommandState.text}'`}),t.searchEntries.map((e=>(0,x.jsx)(o_,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(od,{children:`No occurrences found for '${s.textSearchCommandState.text}'`})})),c_=(0,st.Pi)((e=>{const{usageState:t}=e;return t.searchEntries.length?(0,x.jsxs)("div",{className:"search-panel__content",children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} usages(s) in ${t.numberOfFiles} files for ${Wh(t.usageConcept)}`}),t.searchEntries.map((e=>(0,x.jsx)(o_,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(od,{children:`No usages found for ${Wh(t.usageConcept)}`})})),d_=(0,st.Pi)((e=>{const{candidate:t}=e,s=a_(),i=Mt(),n=()=>{(0,O.fl)(s.loadFile(t.sourceID,new Fd(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)};return(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Go to Result",onClick:n,children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${Md(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:n,children:(0,x.jsx)(Yc.bK4,{})})})]})})),h_=(0,st.Pi)((e=>{const{candidate:t}=e,s=a_(),i=Mt();return(0,x.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Add Suggested Import",onClick:()=>{(0,O.fl)(s.updateFileUsingSuggestionCandidate(t)).catch(i.alertUnhandledError)},children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${Md(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,x.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,x.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:()=>{(0,O.fl)(s.loadFile(t.sourceID,new Fd(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,x.jsx)(Yc.bK4,{})})})]})})),u_=(0,st.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,x.jsxs)("div",{className:"search-panel__content",children:[!s.candidatesWithPackageImported.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages already imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageImported.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages already imported, would match the function '${s.candidateName}' if you changed the parameters`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageImported.map((e=>(0,x.jsx)(d_,{candidate:e},e.uuid)))})]}),!s.candidatesWithPackageNotImported.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages not imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageNotImported.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages not imported, match the function '${s.candidateName}'. Click on result to import the necessary package`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageNotImported.map((e=>(0,x.jsx)(h_,{candidate:e},e.uuid)))})]})]})})),p_=(0,st.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,x.jsxs)("div",{className:"search-panel__content",children:[!s.candidates.length&&(0,x.jsx)("div",{className:"search-panel__content__header",children:`No possible matches found for '${s.candidateName}'`}),Boolean(s.candidates.length)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"search-panel__content__header",children:`Found possible matches for '${s.candidateName}'. Click on result to import the necessary package`}),(0,x.jsx)("div",{className:"search-panel__entry",children:s.candidates.map((e=>(0,x.jsx)(h_,{candidate:e},e.uuid)))})]})]})})),__=(0,st.Pi)((()=>{const e=a_();return(0,x.jsxs)("div",{className:"search-panel",children:[(0,x.jsx)($c,{isLoading:e.textSearchCommandLoadingState.isInProgress}),!e.searchState&&(0,x.jsx)(od,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Search something"}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Yc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Yc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F"})]})]})})})}),e.searchState instanceof Mh&&(0,x.jsx)(c_,{usageState:e.searchState}),e.searchState instanceof Dh&&(0,x.jsx)(l_,{searchState:e.searchState}),e.searchState instanceof kh&&(0,x.jsx)(u_,{searchState:e.searchState}),e.searchState instanceof Fh&&(0,x.jsx)(p_,{searchState:e.searchState})]})})),m_=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:n,onNodeSelect:a}=e;return(0,x.jsxs)("div",{className:(0,Dc.clsx)("tree-view__node__container",{[`${n}__tree-view__node__container`]:n}),onClick:()=>a?.(t),style:{paddingLeft:(s-1)*(i??1)+"rem",display:"flex"},children:[(0,x.jsx)("div",{className:(0,Dc.clsx)("tree-view__node__icon",{[`${n}__tree-view__node__icon`]:n}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.XCv,{}))}),(0,x.jsx)("div",{className:(0,Dc.clsx)("tree-view__node__label",{[`${n}__tree-view__node__label`]:n}),children:t.label})]})},g_=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:n,classPrefix:a,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:g_,TreeNodeContainer:m_},d=r?{...c,...r}:c;return(0,x.jsxs)("div",{className:(0,Dc.clsx)("tree-view__node__block",{[`${a}__tree-view__node__block`]:a}),children:[(0,x.jsx)(d.TreeNodeContainer,{node:t,level:s+1,stepPaddingInRem:o,classPrefix:a,onNodeSelect:i,innerProps:l}),t.isOpen&&n(t).map((e=>(0,x.jsx)(d.TreeNodeView,{node:e,level:s+1,components:r,classPrefix:a,onNodeSelect:i,getChildNodes:n,innerProps:l},e.id)))]})},E_=e=>{const{treeData:t,className:s,classPrefix:i,components:n,onNodeSelect:a,getChildNodes:r,getRootNodes:o,innerProps:l}=e,c=o?.(t)??t.rootIds.map((e=>t.nodes.get(e))).filter(G),d={TreeNodeView:g_,TreeNodeContainer:m_},h=n?{...d,...n}:d;return(0,x.jsx)("div",{className:(0,Dc.clsx)("tree-view__node__root",s??"",{[`${i}__tree-view__node__root`]:i}),children:c.map((e=>(0,x.jsx)(h.TreeNodeView,{level:0,node:e,getChildNodes:r,components:h,onNodeSelect:a,classPrefix:i,innerProps:l},e.id)))})};var f_=s(410);const T_=f_.gs,C_="resizable-panel--collapsed",x_=(e,t)=>({collapsiblePanel:{className:(0,Dc.clsx)(...t?.classes??[],{[C_]:e}),onStartResize:e=>{e.domElement.classList.remove(C_),t?.onStartResize?.(e)},onStopResize:e=>{const s=Number(e.domElement.style.flexGrow);s<=.01?e.domElement.style.flexGrow="0":s>=.99&&(e.domElement.style.flexGrow="1"),t?.onStopResize?.(e)},size:!e&&t?.size?t.size:0,flex:e?0:void 0},remainingPanel:{flex:e?1:void 0}}),N_=f_.jW,O_=f_.nN,A_=e=>(0,x.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var S_=s(70177);const y_=(0,st.Pi)((e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,{testRunnerState:r,onNodeOpen:o,onNodeExpand:l,onNodeCompress:c,renderNodeLabel:d}=a,h=a_(),u=Mt(),p=r.testResultInfo,_=!t.data.type,m=t.id===r.selectedTestId;let g;switch(p?((e,t)=>{const s=e.id;return Boolean(e.data.type)?((e,t)=>t.passedTests.has(e)?oh.PASSED:t.failedTests.has(e)?oh.FAILED:t.testsWithError.has(e)?oh.ERROR:oh.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(s)))||t.testWithErrorIds.some((e=>e.startsWith(s)))?oh.FAILED:t.notRunTestIds.some((e=>e.startsWith(s)))?oh.RUNNING:oh.PASSED})(t,p):void 0){case oh.PASSED:g=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--passed",children:(0,x.jsx)(Yc.rE2,{})});break;case oh.FAILED:g=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--failed",children:(0,x.jsx)(Yc.$Ow,{})});break;case oh.ERROR:g=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--error",children:(0,x.jsx)(Yc.xDH,{})});break;case oh.RUNNING:g=(0,x.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--running",children:(0,x.jsx)(Yc.VRP,{})});break;default:g=(0,x.jsx)(Yc.pTE,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,x.jsxs)("div",{className:(0,Dc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected":m}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t),_?E():o(t)},onDoubleClick:()=>{_?E():(0,O.fl)(h.loadFile(t.data.li_attr.file,new Fd(t.data.li_attr.file,Number.parseInt(t.data.li_attr.line,10),Number.parseInt(t.data.li_attr.column,10)))).catch(u.alertUnhandledError)},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:E,children:_?t.isOpen?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:g})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:d?.(t)??t.label})]})})),I_=(0,st.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=e=>t.setSelectedTestId(e.id),n=e=>{let t=e.id.split("__")[0];if(!t)return e.label;const s=t.split("_");return t=s.slice(1,s.length).join(me),(0,x.jsxs)("div",{className:"test-runner-list__item__label",children:[(0,x.jsx)("div",{className:"test-runner-list__item__label__name",children:e.label}),(0,x.jsx)("div",{className:"test-runner-list__item__label__path",children:t})]})};return(0,x.jsx)("div",{className:"explorer__content",children:Array.from(t.allTests.keys()).map((e=>s.nodes.get(e))).filter(G).map((e=>(0,x.jsx)(y_,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:n,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),v_=(0,st.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=0===s.nodes.size;return(0,x.jsxs)("div",{className:"explorer__content",children:[i&&(0,x.jsx)(od,{children:"No tests found"}),!i&&(0,x.jsx)(E_,{components:{TreeNodeContainer:y_},treeData:s,onNodeSelect:()=>{},getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>s.nodes.get(e))).filter(G),innerProps:{testRunnerState:t,onNodeOpen:e=>t.setSelectedTestId(e.id),onNodeExpand:e=>{e.isOpen=!0,t.refreshTree()},onNodeCompress:e=>{e.isOpen=!1,t.refreshTree()}}})]})})),R_=(0,st.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,n=a_(),a=Mt(),r=i.results.get(s),o=B(t.allTests.get(s),`Can't find info for test with ID '${s}'`);return(0,x.jsxs)("div",{className:"panel",children:[(0,x.jsxs)("div",{className:"panel__header",children:[(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__label",children:o.text})}),(0,x.jsx)("div",{className:"panel__header__actions",children:(0,x.jsx)("button",{className:"panel__header__action",tabIndex:-1,title:"Open File",onClick:()=>{(0,O.fl)(n.loadFile(o.li_attr.file,new Fd(o.li_attr.file,Number.parseInt(o.li_attr.line,10),Number.parseInt(o.li_attr.column,10)))).catch(a.alertUnhandledError)},children:(0,x.jsx)(Yc.qdB,{})})})]}),(0,x.jsxs)("div",{className:"panel__content test-runner-panel__result",children:[!r&&(0,x.jsx)("div",{className:"test-runner-panel__result__content",children:"Running..."}),r instanceof Uh&&(0,x.jsx)("div",{className:"test-runner-panel__result__content",children:"Test passed!"}),r instanceof Gh&&(0,x.jsx)("pre",{className:"test-runner-panel__result__content",children:r.error.text})]})]})})),P_=(0,st.Pi)((e=>{const{testRunnerState:t}=e,s=a_(),i=Mt(),n=t.testExecutionResult.count,a=t.testResultInfo,r=a?.suiteStatus??rh.NONE,o=a?.runPercentage??0;return(0,x.jsx)("div",{className:"test-runner-panel__content",children:(0,x.jsxs)(T_,{orientation:"vertical",children:[(0,x.jsx)(N_,{minSize:400,children:(0,x.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,x.jsx)($c,{isLoading:t.treeBuildingState.isInProgress}),(0,x.jsxs)("div",{className:"panel__header",children:[(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsxs)("div",{className:"panel__header__title__content test-runner-panel__explorer__report",children:[(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview",children:[(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--total",children:[n," total"]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--passed",children:[a?.passed??0," ",(0,x.jsx)(Yc.rE2,{})]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--failed",children:[a?.failed??0," ",(0,x.jsx)(Yc.$Ow,{})]}),(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--error",children:[a?.error??0," ",(0,x.jsx)(Yc.xDH,{})]})]}),a&&(0,x.jsxs)("div",{className:"test-runner-panel__explorer__report__time",children:[a.time,"ms"]})]})}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.setViewAsList(!t.viewAsList),title:t.viewAsList?"View As Tree":"View As List",children:t.viewAsList?(0,x.jsx)(Yc.NEI,{className:"test-runner-panel__icon--tree-view"}):(0,x.jsx)(Yc.VjU,{className:"test-runner-panel__icon--list-view"})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.expandTree(),title:"Expand All",children:(0,x.jsx)(Yc.Qq,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,x.jsx)(Yc.jG4,{})}),(0,x.jsx)("button",{className:"panel__header__action",tabIndex:-1,disabled:!s.testRunState.isInProgress,onClick:()=>{(0,O.fl)(t.cancelTestRun()).catch(i.alertUnhandledError)},title:"Stop",children:(0,x.jsx)(Yc.SCS,{})}),(0,x.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,O.fl)(t.rerunTestSuite()).catch(i.alertUnhandledError)},disabled:s.testRunState.isInProgress,title:"Run Suite",children:(0,x.jsx)(Yc.o1U,{})})]})]}),(0,x.jsx)("div",{className:"test-runner-panel__header__status",children:(0,x.jsx)(S_.Z,{className:`test-runner-panel__progress-bar test-runner-panel__progress-bar--${r.toLowerCase()}`,classes:{bar:`test-runner-panel__progress-bar__bar test-runner-panel__progress-bar__bar--${r.toLowerCase()}`},variant:"determinate",value:o})}),(0,x.jsx)("div",{className:"panel__content",children:t.treeData&&(0,x.jsxs)(x.Fragment,{children:[!t.viewAsList&&(0,x.jsx)(v_,{testRunnerState:t}),t.viewAsList&&(0,x.jsx)(I_,{testRunnerState:t})]})})]})}),(0,x.jsx)(O_,{children:(0,x.jsx)(A_,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsxs)(N_,{minSize:400,children:[t.selectedTestId&&!a&&(0,x.jsx)("div",{}),t.selectedTestId&&a&&(0,x.jsx)(R_,{testRunnerState:t,selectedTestId:t.selectedTestId,testResultInfo:a}),!t.selectedTestId&&(0,x.jsxs)("div",{className:"panel",children:[(0,x.jsx)("div",{className:"panel__header"}),(0,x.jsx)("div",{className:"panel__content",children:(0,x.jsx)(od,{children:"No test selected"})})]}),(0,x.jsx)("div",{})]})]})})})),w_=(0,st.Pi)((()=>{const e=a_().testRunnerState;return(0,x.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,x.jsx)(od,{children:(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content",children:[(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run full test suite"}),(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run relevant tests only"}),(0,x.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Yc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,x.jsx)(P_,{testRunnerState:e})]})})),L_=(0,st.Pi)((()=>{const e=a_(),t={[bd.CONSOLE]:{mode:bd.CONSOLE,name:"CONSOLE",icon:void 0,isVisible:!0},[bd.SEARCH_RESULT]:{mode:bd.SEARCH_RESULT,name:"SEARCH",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--search",children:(0,x.jsx)(Yc.W1M,{})}),isVisible:!0},[bd.TEST_RUNNER]:{mode:bd.TEST_RUNNER,name:"TEST",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--test",children:(0,x.jsx)(Yc.Vzd,{})}),isVisible:!0}},s=Object.values(bd).filter((e=>G(t[e])&&t[e].isVisible)),i=t=>e.activeAuxPanelMode===t&&s.includes(t);return(0,it.useEffect)((()=>{s.includes(e.activeAuxPanelMode)||e.setActiveAuxPanelMode(bd.CONSOLE)}),[e,s,e.activeAuxPanelMode]),(0,x.jsxs)("div",{className:"panel auxiliary-panel",children:[(0,x.jsxs)("div",{className:"panel__header",children:[(0,x.jsx)("div",{className:"auxiliary-panel__header__tabs",children:s.map((e=>t[e])).filter(G).map((t=>{return(0,x.jsxs)("button",{tabIndex:-1,className:(0,Dc.clsx)("auxiliary-panel__header__tab",{"auxiliary-panel__header__tab--active":e.activeAuxPanelMode===t.mode}),onClick:(s=t.mode,()=>e.setActiveAuxPanelMode(s)),children:[t.icon&&(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon",children:t.icon}),(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__title",children:t.name})]},t.mode);var s}))}),(0,x.jsxs)("div",{className:"auxiliary-panel__header__actions",children:[(0,x.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggleMaximize(),tabIndex:-1,title:"Toggle Expand/Collapse",children:e.auxPanelDisplayState.isMaximized?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.g8U,{})}),(0,x.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,x.jsx)(Yc.b0D,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content",children:[i(bd.CONSOLE)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(r_,{})}),i(bd.SEARCH_RESULT)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(__,{})}),i(bd.TEST_RUNNER)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(w_,{})})]})]})}));var b_=s(42689);const D_=()=>(0,x.jsx)("div",{className:"icon color--package",children:(0,x.jsx)(Yc.jtq,{})}),M_=()=>(0,x.jsx)("div",{className:"icon color--class",children:"C"}),k_=()=>(0,x.jsx)("div",{className:"icon color--association",children:"A"}),F_=()=>(0,x.jsx)("div",{className:"icon color--enumeration",children:"E"}),j_=()=>(0,x.jsx)("div",{className:"icon color--measure",children:"M"}),U_=()=>(0,x.jsx)("div",{className:"icon color--unit",children:"u"}),V_=()=>(0,x.jsx)("div",{className:"icon color--profile",children:"P"}),G_=()=>(0,x.jsx)("div",{className:"icon icon--function color--function",children:(0,x.jsx)(Yc.eid,{})}),z_=()=>(0,x.jsx)("div",{className:"icon color--mapping",children:(0,x.jsx)(Yc.Zlt,{})}),B_=()=>(0,x.jsx)("div",{children:(0,x.jsx)(Yc.UOT,{})}),$_=()=>(0,x.jsx)("div",{className:"icon icon--function color--native-function",children:(0,x.jsx)(Yc.eid,{})}),H_=()=>(0,x.jsx)("div",{className:"icon icon--property color--property",children:(0,x.jsx)(Yc.HXR,{})}),Y_=()=>(0,x.jsx)("div",{className:"icon color--diagram",children:(0,x.jsx)(Yc.oF7,{})}),W_=()=>(0,x.jsx)("div",{className:"icon icon--database",children:(0,x.jsx)(Yc.VHe,{})}),K_=e=>{switch(e){case nh.PACKAGE:return(0,x.jsx)(D_,{});case nh.PROFILE:return(0,x.jsx)(V_,{});case nh.CLASS:return(0,x.jsx)(M_,{});case nh.ASSOCIATION:return(0,x.jsx)(k_,{});case nh.PROPERTY:return(0,x.jsx)(H_,{});case nh.ENUMERATION:return(0,x.jsx)(F_,{});case nh.MEASURE:return(0,x.jsx)(j_,{});case nh.UNIT:return(0,x.jsx)(U_,{});case nh.FUNCTION:return(0,x.jsx)(G_,{});case nh.NATIVE_FUNCTION:return(0,x.jsx)($_,{});case nh.DIAGRAM:return(0,x.jsx)(Y_,{});case nh.DATABASE:return(0,x.jsx)(W_,{});case nh.MAPPING:return(0,x.jsx)(z_,{});default:return(0,x.jsx)(B_,{})}},Z_=(0,st.Pi)((0,it.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,n=s.data.li_attr.pureType,a=a_(),r=Mt();return(0,x.jsxs)("div",{ref:t,className:"explorer__context-menu",children:[n===nh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename package"),children:"Rename"}),n===nh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename property"),children:"Rename"}),n!==nh.PACKAGE&&n!==nh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Rename"),children:"Rename"}),n===nh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{(0,O.fl)(a.executeTests(s.data.li_attr.pureId)).catch(r.alertUnhandledError)},children:"Run tests"}),n!==nh.PACKAGE&&n!==nh.PROPERTY&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>r.notifyUnsupportedFeature("Move file"),children:"Move"}),n===nh.FUNCTION&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{window.open(`${a.client.baseUrl}/execute?func=${s.data.li_attr.pureId}&mode=${a.client.mode}`,"_blank")},children:"Service (JSON)"}),n!==nh.PACKAGE&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i(s),children:"View Source"})]})})));var X_;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(X_=X_||(X_={}));const q_=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,it.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d,viewConceptSource:h}=a,u=[nh.PACKAGE,nh.CLASS,nh.ASSOCIATION].includes(t.data.li_attr.pureType),p=()=>{t.isLoading||(t.isOpen?d(t):c(t))},[,_]=(0,b_.c)((()=>({type:"Class"===t.data.li_attr.pureType?X_.CLASS:X_.UNSUPPORTED,item:t.data})),[t]);return(0,x.jsx)(Qc,{content:(0,x.jsx)(Z_,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Dc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},ref:_,onDoubleClick:()=>{t.isLoading||(u&&p(),n?.(t),l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,x.jsx)(Yc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:p,children:u?t.isOpen?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:K_(t.data.li_attr.pureType)})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:t.label})]})})},J_=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,x.jsx)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:(0,x.jsx)(E_,{components:{TreeNodeContainer:q_},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(G),innerProps:{onNodeOpen:e=>{(0,O.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,O.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()},viewConceptSource:t=>{const s=t.data.li_attr;(s instanceof hh||s instanceof dh)&&e.directoryTreeState.revealPath(s.file,!0,new Fd(s.file,Number.parseInt(s.line,10),Number.parseInt(s.column,10)))}}})})})),Q_=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.conceptTreeState;return(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsx)("div",{className:"panel__header side-bar__header",children:(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"CONCEPTS"})})}),(0,x.jsx)("div",{className:"panel__content side-bar__content",children:(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsxs)("div",{className:"panel__header explorer__header",children:[(0,x.jsx)("div",{className:"panel__header__title"}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,O.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,x.jsx)(Yc.DuK,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,x.jsx)(Yc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)($c,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(J_,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,x.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(od,{children:"Failed to build concept tree"})]})]})})]})})),em=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.directoryTreeState.nodeForCreateNewFile,[i,n]=(0,it.useState)(""),a=(0,it.useRef)(null),r=()=>e.directoryTreeState.setNodeForCreateNewFile(void 0),o=n=>{s&&(n.preventDefault(),r(),(0,O.fl)(e.createNewFile(`${s.data.li_attr.path}/${i}`)).catch(t.alertUnhandledError))};return(0,x.jsx)(bc.Z,{open:Boolean(s),onClose:r,TransitionProps:{onEnter:()=>{n(""),a.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Create a new file"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:o,children:(0,x.jsx)("input",{ref:a,className:"command-modal__content__input input--dark",onChange:e=>n(e.target.value),value:i})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:o,children:"Create"})]})]})})})),tm=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.directoryTreeState.nodeForCreateNewDirectory,[i,n]=(0,it.useState)(""),a=(0,it.useRef)(null),r=()=>e.directoryTreeState.setNodeForCreateNewDirectory(void 0),o=n=>{s&&(n.preventDefault(),r(),(0,O.fl)(e.createNewDirectory(`${s.data.li_attr.path}/${i}`)).catch(t.alertUnhandledError))};return(0,x.jsx)(bc.Z,{open:Boolean(s),onClose:r,TransitionProps:{onEnter:()=>{n(""),a.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Create a new directory"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:o,children:(0,x.jsx)("input",{ref:a,className:"command-modal__content__input input--dark",onChange:e=>n(e.target.value),value:i})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:o,children:"Create"})]})]})})})),sm=(0,st.Pi)((0,it.forwardRef)((function(e,t){const{node:s}=e,i=Mt(),n=a_(),a=s.data.isFolderNode,r=Boolean(s.data.children);return(0,x.jsxs)("div",{ref:t,className:"explorer__context-menu",children:[a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>n.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>n.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Folder"}),!a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i.notifyUnsupportedFeature("Rename file"),children:"Rename"}),(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>{(0,O.fl)(n.deleteDirectoryOrFile(s.data.li_attr.path,a,r)).catch(i.alertUnhandledError)},children:"Delete"}),!a&&(0,x.jsx)("div",{className:"explorer__context-menu__item",onClick:()=>i.notifyUnsupportedFeature("Move file"),children:"Move"})]})}))),im=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,it.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d}=a,h=t.data.isFolderNode,u=h?t.isOpen?(0,x.jsx)("div",{children:(0,x.jsx)(Yc.ry,{})}):(0,x.jsx)("div",{children:(0,x.jsx)(Yc.ROc,{})}):(0,x.jsx)(Yc.QqN,{className:"explorer__icon--file"}),p=()=>{t.isLoading||(t.isOpen?d(t):c(t))};return(0,x.jsx)(Qc,{content:(0,x.jsx)(sm,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Dc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},onDoubleClick:()=>{t.isLoading||(h?p():l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,x.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,x.jsx)(Yc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:p,children:h?t.isOpen?(0,x.jsx)(Yc.v4q,{}):(0,x.jsx)(Yc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:u})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:t.label})]})})},nm=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,x.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,x.jsx)(E_,{components:{TreeNodeContainer:im},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(G),innerProps:{onNodeOpen:e=>{(0,O.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,O.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()}}}),(0,x.jsx)(em,{}),(0,x.jsx)(tm,{})]})})),am=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.directoryTreeState;return(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsx)("div",{className:"panel__header side-bar__header",children:(0,x.jsx)("div",{className:"panel__header__title",children:(0,x.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"FILES"})})}),(0,x.jsx)("div",{className:"panel__content side-bar__content",children:(0,x.jsxs)("div",{className:"panel explorer",children:[(0,x.jsxs)("div",{className:"panel__header explorer__header",children:[(0,x.jsx)("div",{className:"panel__header__title"}),(0,x.jsxs)("div",{className:"panel__header__actions",children:[(0,x.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,O.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,x.jsx)(Yc.DuK,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof Kd&&(0,O.fl)(s.revealPath(i.filePath,!1)).catch(t.alertUnhandledError)},title:"Focus",children:(0,x.jsx)(Yc.cOE,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,x.jsx)(Yc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)($c,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(nm,{}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(od,{children:"Failed to build directory tree"})]})]})})]})})),rm=(0,st.Pi)((()=>{const e=a_();return(0,x.jsx)("div",{className:"side-bar",children:(0,x.jsx)("div",{className:(0,Dc.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case Ld.CONCEPT:return(0,x.jsx)(Q_,{});case Ld.FILE:return(0,x.jsx)(am,{});default:return null}})()},e.activeActivity)})})),om=e=>{const{className:t}=e;return(0,x.jsx)("div",{className:(0,Dc.clsx)("logo",t),children:(0,x.jsxs)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",width:"1em",height:"1em",viewBox:"0 0 215 215",xmlns:"https://www.w3.org/2000/svg",children:[(0,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.jsx)("path",{d:"M141.9,86.5L141.9,68.1C141.9,66.5 140.7,65.2 139.1,65.2L66.5,65.2C64.9,65.2 63.7,66.5 63.7,68.1L63.7,86.5C63.7,88.1 64.9,89.4 66.5,89.4L139.1,89.4C140.7,89.4 141.9,88.1 141.9,86.5Z"})}),(0,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.jsx)("path",{d:"M118.4,116.9L118.4,98.5C118.4,96.9 117.5,95.6 116.4,95.6L65.7,95.6C64.6,95.6 63.7,96.9 63.7,98.5L63.7,116.9C63.7,118.5 64.6,119.8 65.7,119.8L116.5,119.8C117.6,119.8 118.4,118.6 118.4,116.9Z"})}),(0,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.jsx)("path",{d:"M141.9,147.3L141.9,129C141.9,127.4 140.7,126.1 139.1,126.1L66.5,126.1C64.9,126.1 63.7,127.4 63.7,129L63.7,147.4C63.7,149 64.9,150.3 66.5,150.3L139.1,150.3C140.7,150.3 141.9,149 141.9,147.3Z"})}),(0,x.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,x.jsx)("path",{d:"M205,170.7L152.7,139.1C150,137.4 147.7,138.7 147.7,141.9L147.7,157.9L55.8,157.9L55.8,59.4L67.2,59.4C70.4,59.4 71.7,57.2 70,54.4L38.4,2.1C36.7,-0.6 34.1,-0.6 32.4,2.1L0.7,54.4C-1,57.1 0.3,59.4 3.5,59.4L15.6,59.4L15.6,185.5C15.6,188.5 18,190.9 21,190.9L147.7,190.9L147.7,205.7C147.7,208.9 149.9,210.1 152.7,208.5L205,176.9C207.7,175.1 207.7,172.4 205,170.7Z"})})]})})},lm=(0,st.Pi)((()=>{const e=a_(),t=t=>()=>e.setActiveActivity(t),s=[{mode:Ld.CONCEPT,title:"Concept Explorer",icon:(0,x.jsx)(Yc.DE2,{})},{mode:Ld.FILE,title:"File Explorer",icon:(0,x.jsx)(Yc.QqN,{})}].filter((e=>Boolean(e)));return(0,x.jsxs)("div",{className:"activity-bar",children:[(0,x.jsx)("div",{className:"activity-bar__logo",children:(0,x.jsx)(om,{})}),(0,x.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,x.jsx)("button",{className:(0,Dc.clsx)("activity-bar__item",{"activity-bar__item--active":e.sideBarDisplayState.isOpen&&e.activeActivity===s.mode}),onClick:t(s.mode),tabIndex:-1,title:`${s.title}${s.info?` - ${s.info}`:""}`,children:s.icon},s.mode)))})]})})),cm=(0,st.Pi)((e=>{const t=a_(),s=Mt();return(0,x.jsxs)("div",{className:"editor__status-bar",children:[(0,x.jsx)("div",{className:"editor__status-bar__left",children:(0,x.jsx)("div",{className:"editor__status-bar__workspace"})}),(0,x.jsxs)("div",{className:"editor__status-bar__right",children:[(0,x.jsx)("button",{className:(0,Dc.clsx)("editor__status-bar__action editor__status-bar__compile-btn",{"editor__status-bar__compile-btn--wiggling":t.executionState.isInProgress}),disabled:t.executionState.isInProgress,onClick:()=>{(0,O.fl)(t.executeGo()).catch(s.alertUnhandledError)},tabIndex:-1,title:"Execute (F9)",children:(0,x.jsx)(Yc.pgN,{})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":Boolean(t.auxPanelDisplayState.isOpen)}),onClick:()=>t.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Toggle auxiliary panel (Ctrl + `)",children:(0,x.jsx)(Yc.FxN,{})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":!s.assistantService.isHidden}),onClick:()=>s.assistantService.toggleAssistant(),tabIndex:-1,title:"Toggle assistant",children:(0,x.jsx)(Yc.UHp,{})})]})]})})),dm=e=>{(0,it.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},hm="Diagram",um="Diagram",pm=(0,st.Pi)((e=>{const{editorState:t}=e,s=(0,it.useRef)(void 0),i=(0,it.useRef)(void 0),n=(0,it.useRef)(null),[a,r]=(0,it.useState)(),o=a_(),l=Mt(),c=t.file.content,{ref:d,width:h,height:u}=(0,rd.NB)();(0,it.useEffect)((()=>{if(!a&&n.current){const e=n.current,s=A.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,bracketPairColorization:{enabled:!1},detectIndentation:!1,tabSize:2,language:C.PURE,theme:T.LEGEND,wordWrap:t.textEditorState.wrapText?"on":"off"});s._codeEditorService.openCodeEditor=async()=>{const e=s.getPosition();e&&(0,O.fl)(o.executeNavigation(new Fd(t.filePath,e.lineNumber,e.column))).catch(l.alertUnhandledError)},s.updateOptions({gotoLocation:{multiple:"goto",multipleDefinitions:"goto",alternativeDefinitionCommand:"DUMMY"}}),s.onDidChangeModelContent((()=>{const e=s.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),s.setModel(t.textEditorState.model),t.textEditorState.viewState&&s.restoreViewState(t.textEditorState.viewState),s.focus(),t.textEditorState.setEditor(s),r(s)}}),[o,l,t,a]),a&&(a.getValue()!==c&&a.setValue(c),t.textEditorState.forcedCursorPosition&&(((e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)})(a,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0)));const p=a?A.editor.tokenize(a.getValue(),C.PURE):[];return i.current?.dispose(),i.current=A.languages.registerDefinitionProvider(C.PURE,{provideDefinition:(e,s)=>{const i=B(p[s.lineNumber-1]);let n,a;for(let e=1;e<i.length;++e){const t=B(i[e]);if(t.offset+1>s.column){n=B(i[e-1]),a={startLineNumber:s.lineNumber,startColumn:n.offset+1,endLineNumber:s.lineNumber,endColumn:t.offset+1};break}}return n&&a&&[Ue.TYPE,Ue.VARIABLE,Ue.PROPERTY,Ue.IDENTIFIER].includes((r=n.type,B(R(r.split(".")))))?[{uri:t.textEditorState.model.uri,range:a}]:[];var r}}),s.current?.dispose(),s.current=A.languages.registerCompletionItemProvider(C.PURE,{triggerCharacters:["#"],provideCompletionItems:(e,t)=>{let s=[];return s=s.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a={startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber,endColumn:n.endColumn};var r;return r=t.getValueInRange(a).trim(),Boolean(r.match(/\s/))||s.forEach((e=>{i.push({label:{label:`###${e.text}`,description:e.description},kind:A.languages.CompletionItemKind.Keyword,insertText:`###${e.insertText}\n`,range:a,documentation:e.documentation?e.documentation.markdownText?{value:e.documentation.markdownText.value}:e.documentation.text:void 0})})),i})(t,e,[{text:Fe.PURE,description:"(core Pure)",insertText:Fe.PURE},{text:Fe.MAPPING,description:"(dsl)",insertText:Fe.MAPPING},{text:Fe.CONNECTION,description:"(dsl)",insertText:Fe.CONNECTION},{text:Fe.RUNTIME,description:"(dsl)",insertText:Fe.RUNTIME},{text:Fe.RELATIONAL,description:"(external store)",insertText:Fe.RELATIONAL},{text:hm,description:"(dsl)",insertText:um}])),s=s.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),r=`###${Fe.PURE}\n${a}`.split("\n").filter((e=>e.startsWith(ge))),o=(e=>{if(e.startsWith(ge))return e.substring(ge.length).split(" ")[0]})(r[r.length-1]??"");return o&&s(o).forEach((t=>{i.push({label:{label:t.text,description:t.description},kind:A.languages.CompletionItemKind.Snippet,insertTextRules:A.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${t.insertText}\n`,range:{startLineNumber:e.lineNumber,startColumn:n.startColumn,endLineNumber:e.lineNumber,endColumn:n.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})})),i})(t,e,(e=>(e=>{switch(e){case Fe.PURE:return[{text:Me.CLASS,description:"(blank)",insertText:"Class ${1:model::NewClass}\n// example of a constraint\n// [\n// SomeConstraint: true\n// ]\n{\n ${2:// example of a standard property\n // prop1: String[1];\n\n // example of a derived property\n // derivation1() {''\\}: String[1];}\n}"},{text:Me.CLASS,description:"with property",insertText:"Class ${1:model::NewClass}\n{\n ${2:prop1}: ${3:String[1]};\n}"},{text:Me.CLASS,description:"with inheritance",insertText:"Class ${1:model::NewClass} extends ${2:model::ParentClass}\n{\n ${3:// class content}\n}"},{text:Me.CLASS,description:"with constraint",insertText:"Class ${1:model::NewClass}\n[\n ${3:SomeConstraint: true}\n]\n{\n ${2:// class content}\n}"},{text:Me.PROFILE,insertText:"Profile ${1:model::NewProfile}\n{\n stereotypes: [${2:}];\n tags: [${3:}];\n}"},{text:Me.ENUMERATION,insertText:"Enum ${1:model::NewEnumeration}\n{\n ${2:VALUE_1,\n VALUE_2}\n}"},{text:Me.ASSOCIATION,insertText:"Association ${1:model::NewAssociation}\n{\n ${2:prop1}: ${3:model::Type1[1]};\n ${4:prop2}: ${5:model::Type2[1]};\n}"},{text:Me.FUNCTION,description:"(blank)",insertText:"function ${1:model::NewEnumeration}(${2:param1: String[1]}): ${3:String[1]}\n{\n ${4:''; // function content}\n}"},{text:Me.FUNCTION,insertText:"function ${1:model::NewEnumeration}(): String[1]\n{\n ''\n}"}];case Fe.MAPPING:return[{text:Me.MAPPING,description:"(blank)",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:// mapping content}\n)"},{text:Me.MAPPING,description:"with model-to-model mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Pure\n {\n ~src ${3:model::SourceClass}\n // example of property mappings\n // prop1: $src.prop1\n }\n)"},{text:Me.MAPPING,description:"with relational mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Relational {\n ~mainTable ${3:[model::SomeDatabase]SomeTable}\n // example of property mappings\n // prop1: [model::SomeDatabase]SomeTable.col1,\n }\n)"},{text:Me.MAPPING,description:"with enumeration mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetEnumeration}: EnumerationMapping ${3:EnumerationMappingID}\n {\n // example of enum-value mapping\n // VAL_1: ['val1'],\n // VAL_2: ['val2', 'val_2']\n }\n)"}];case Fe.RELATIONAL:return[{text:Me.DATABASE,description:"(blank)",insertText:"Database ${1:model::NewDatabase}\n(\n // example database schema\n // Schema SOME_SCHEMA\n // (\n // Table TABLE_1\n // (\n // COL_1 VARCHAR(200)\n // )\n // Table TABLE_2\n // (\n // COL_2 VARCHAR(200) PRIMARY_KEY\n // )\n // )\n\n // example database join\n // Join SomeJoin(SOME_SCHEMA.TABLE_1.COL_1 = SCHEMA1.TABLE_2.COL_2)\n\n ${2:// database content}\n)"}];case hm:return[{text:um,description:"(blank)",insertText:"Diagram ${1:model::NewDiagram}(width=0.0, height=0.0)\n(\n // NOTE: it is recommended to use diagram visual editor\n // to edit diagram: double-click on the diagram in\n // the concept explorer tree to open the editor\n)"}];default:return[]}})(e)))),s=s.concat(((e,t,s=[])=>{const i=t.getWordUntilPosition(e);return[{text:"let",description:"new variable",insertText:"let ${1:} = ${2:};"},{text:"let",description:"new collection",insertText:"let ${1:} = [${2:}];"},{text:"cast",description:"type casting",insertText:"cast(@${1:model::SomeClass})"},{text:"if",description:"(conditional)",insertText:"if(${1:'true'}, | ${2:/* if true do this */}, | ${3:/* if false do this */})"},{text:"case",description:"(conditional)",insertText:"case(${1:}, ${2:'true'}, ${3:'false'})"},{text:"match",description:"(conditional)",insertText:"match([x:${1:String[1]}, ${2:''}])"},{text:"map",description:"(collection)",insertText:"map(x|${1:})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"fold",description:"(collection)",insertText:"fold({a, b| ${1:$a + $b}}, ${2:0})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"sort",description:"(collection)",insertText:"sort()"},{text:"in",description:"(collection)",insertText:"in()"},{text:"slice",description:"(collection)",insertText:"slice(${1:1},${2:2})"},{text:"removeDuplicates",description:"(collection)",insertText:"removeDuplicates()"},{text:"toOne",description:"(collection)",insertText:"toOne(${1:})"},{text:"toOneMany",description:"(collection)",insertText:"toOneMany(${1:})"},{text:"isEmpty",description:"(collection)",insertText:"isEmpty()"},{text:"endsWith",description:"(string)",insertText:"endsWith()"},{text:"startsWith",description:"(string)",insertText:"startsWith()"},...s].map((t=>({label:{label:t.text,description:t.description},kind:A.languages.CompletionItemKind.Snippet,insertTextRules:A.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:t.insertText,range:{startLineNumber:e.lineNumber,startColumn:i.startColumn,endLineNumber:e.lineNumber,endColumn:i.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})))})(t,e,[{text:"print",description:"(io)",insertText:"print(${1:})"},{text:"println",description:"(io)",insertText:"println(${1:})"}])),{suggestions:s}}}),dm(t),(0,it.useEffect)((()=>{void 0!==h&&void 0!==u&&a?.layout({width:h,height:u})}),[a,h,u]),(0,it.useEffect)((()=>()=>{a&&(t.textEditorState.setViewState(a.saveViewState()??void 0),a.dispose()),i.current?.dispose(),s.current?.dispose()}),[t,a]),(0,x.jsxs)("div",{className:"panel edit-panel file-editor",children:[(0,x.jsx)("div",{className:"panel__header file-editor__header",children:(0,x.jsx)("div",{className:"file-editor__header__actions",children:(0,x.jsx)("button",{className:(0,Dc.clsx)("file-editor__header__action",{"file-editor__header__action--active":t.textEditorState.wrapText}),tabIndex:-1,onClick:()=>t.textEditorState.setWrapText(!t.textEditorState.wrapText),title:"Toggle Text Wrap",children:(0,x.jsx)(Yc.NK0,{className:"file-editor__icon--text-wrap"})})})}),(0,x.jsx)("div",{className:"panel__content file-editor__content",children:(0,x.jsx)("div",{ref:d,className:"text-editor__container",children:(0,x.jsx)("div",{className:"text-editor__body",ref:n})})})]})}));var _m=s(8533);const mm=e=>{const{open:t,className:s,children:i,menuProps:n,content:a,title:r,disabled:o,onClose:l,onOpen:c}=e,d=(0,it.useRef)(null),[h,u]=(0,it.useState)(null);return(0,it.useEffect)((()=>{void 0!==t&&(t&&!h&&d.current?u(d.current):!t&&h&&u(null))}),[h,t]),(0,x.jsxs)("button",{ref:d,className:s,disabled:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),o||(h?(l?.(),u(null)):d.current&&(c?.(),u(d.current)))},tabIndex:-1,title:r,children:[i,(0,x.jsx)(Jc,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:h,open:(void 0===t||Boolean(t))&&Boolean(h),BackdropProps:{invisible:!0},elevation:0,marginThreshold:0,disableRestoreFocus:!0,...n,children:a})]})},gm=(0,st.Pi)((0,it.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=Mt(),n=s.diagram,a=t,{width:r,height:o}=(0,rd.NB)({refreshMode:"debounce",refreshRate:50,targetRef:a});(0,it.useEffect)((()=>{if(a.current){const e=new Yu(a.current,n);s.setRenderer(e),s.setupRenderer(),e.render(),e.autoRecenter()}}),[a,s,n]),(0,it.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,it.useCallback)(((e,t)=>{if(e instanceof uh){const n=t.getClientOffset(),a=n?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new Ql(n.x,n.y))):void 0;(0,O.fl)(s.addClassView(e.li_attr.pureId,a)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,_m.L)((()=>({accept:X_.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(a),(0,x.jsx)("div",{ref:a,className:(0,Dc.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),Em=(0,st.Pi)((e=>{const{diagramEditorState:t}=e,s=a_(),i=Mt(),n=e=>()=>{t.renderer.zoomCenter(e/100)},a=t.renderer.selectedClasses.length<2;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align left",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_LEFT),children:(0,x.jsx)(Yc.eRw,{className:"diagram-editor__icon--aligner"})}),(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align center",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_CENTER),children:(0,x.jsx)(Yc.UPo,{className:"diagram-editor__icon--aligner"})}),(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align right",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_RIGHT),children:(0,x.jsx)(Yc.B_D,{className:"diagram-editor__icon--aligner"})})]}),(0,x.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,x.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align top",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_TOP),children:(0,x.jsx)(Yc.Cti,{className:"diagram-editor__icon--aligner"})}),(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align middle",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_MIDDLE),children:(0,x.jsx)(Yc.w0Y,{className:"diagram-editor__icon--aligner"})}),(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align bottom",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.ALIGN_BOTTOM),children:(0,x.jsx)(Yc.HLb,{className:"diagram-editor__icon--aligner"})})]}),(0,x.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,x.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space horizontally",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.SPACE_HORIZONTALLY),children:(0,x.jsx)(Yc.ppk,{className:"diagram-editor__icon--aligner"})}),(0,x.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space vertically",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(zu.SPACE_VERTICALLY),children:(0,x.jsx)(Yc.LyQ,{className:"diagram-editor__icon--aligner"})})]}),(0,x.jsxs)(mm,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,x.jsxs)(ed,{children:[(0,x.jsx)(td,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,x.jsx)(sd,{}),$u.map((e=>(0,x.jsxs)(td,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:n(e),children:[e,"%"]},e)))]}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:7},children:[(0,x.jsxs)("div",{className:"diagram-editor__header__dropdown__label diagram-editor__header__zoomer__dropdown__label",children:[Math.round(100*t.renderer.zoom),"%"]}),(0,x.jsx)("div",{className:"diagram-editor__header__dropdown__trigger diagram-editor__header__zoomer__dropdown__trigger",children:(0,x.jsx)(Yc.VAA,{})})]}),(0,x.jsx)("div",{className:"diagram-editor__header__actions",children:(0,x.jsx)("button",{className:"diagram-editor__header__action",tabIndex:-1,onClick:()=>{(0,O.fl)(s.loadFile(t.filePath,new Fd(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,x.jsx)(Yc.qdB,{className:"diagram-editor__icon--go-to-file"})})})]})})),fm=(0,st.Pi)((e=>{const{diagramEditorState:t}=e,s=t.renderer,i=(e,t)=>()=>s.changeMode(e,t);return(0,x.jsxs)("div",{className:"diagram-editor__tools",children:[(0,x.jsx)("button",{className:(0,Dc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Vu.LAYOUT}),tabIndex:-1,onClick:i(Vu.LAYOUT,Gu.NONE),title:"View Tool (V)",children:(0,x.jsx)(Yc.Hrt,{className:"diagram-editor__icon--layout"})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Vu.PAN}),tabIndex:-1,onClick:i(Vu.PAN,Gu.NONE),title:"Pan Tool (M)",children:(0,x.jsx)(Yc.tPC,{className:"diagram-editor__icon--pan"})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Vu.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(Vu.ZOOM_IN,Gu.NONE),children:(0,x.jsx)(Yc.Sd5,{className:"diagram-editor__icon--zoom-in"})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Vu.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(Vu.ZOOM_OUT,Gu.NONE),children:(0,x.jsx)(Yc.xLV,{className:"diagram-editor__icon--zoom-out"})})]})})),Tm=(0,st.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,it.useRef)(null);return dm(t),(0,x.jsxs)("div",{className:"diagram-editor",children:[(0,x.jsx)("div",{className:"diagram-editor__header",children:t.isDiagramRendererInitialized&&(0,x.jsx)(Em,{diagramEditorState:t})}),(0,x.jsx)("div",{className:"diagram-editor__content",children:(0,x.jsxs)("div",{className:"diagram-editor__stage",children:[t.isDiagramRendererInitialized&&(0,x.jsx)(fm,{diagramEditorState:t}),(0,x.jsx)(gm,{diagramEditorState:t,ref:s})]})})]})}));var Cm=s(98533),xm=s(84153);const Nm=e=>{const{children:t,label:s,showPlaceholder:i,className:n}=e;return i?(0,x.jsx)("div",{className:(0,Dc.clsx)(["dnd__entry-dropzone__placeholder",n]),children:(0,x.jsx)("div",{className:"dnd__entry-dropzone__placeholder__content",children:(0,x.jsx)("div",{className:"dnd__entry-dropzone__placeholder__label",children:s??""})})}):(0,x.jsx)(x.Fragment,{children:t})};function Om(e){const{labelGetter:t,types:s}=e,{itemType:i,item:n,isDragging:a,currentPosition:r}=(0,Cm.f)((e=>({itemType:e.getItemType(),item:e.getItem(),isDragging:e.isDragging(),initialOffset:e.getInitialSourceClientOffset(),currentPosition:e.getClientOffset()})));return a&&n&&i&&s.includes(i.toString())?(0,x.jsx)(Rc.Z,{children:(0,x.jsx)("div",{className:"dnd__drag-preview-layer",children:(0,x.jsx)("div",{className:"dnd__drag-preview-layer__content",style:r?{transform:`translate(${r.x/10+2}rem, ${r.y/10+1}rem)`}:{display:"none"},children:t(n)})})}):null}const Am=e=>{if(Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;let t;e.stopPropagation(),t=0===e.deltaY?e.deltaY:e.deltaY<0?-Math.abs(e.deltaY):Math.abs(e.deltaY),e.currentTarget.scrollBy(t,0)},Sm=(0,st.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,x.jsxs)(ed,{children:[(0,x.jsx)(td,{onClick:()=>s.closeTab(t),children:"Close"}),(0,x.jsx)(td,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,x.jsx)(td,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),ym=(0,st.Pi)((e=>{const t=(0,it.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:n}=e,a=(0,it.useCallback)(((e,n)=>{const a=e.tab,r=i,o=s.tabs.findIndex((e=>e===a)),l=s.tabs.findIndex((e=>e===r)),c=t.current?.getBoundingClientRect(),d=((c?.left??0)-(c?.right??0))/2,h=(n.getClientOffset()?.x??0)-(c?.right??0);o<l&&h<d||o>l&&h>d||s.swapTabs(a,r)}),[s,i]),[{isBeingDraggedEditorPanel:r},o]=(0,_m.L)((()=>({accept:[s.dndType],hover:(e,t)=>a(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[a]),l=i===r,[,c,d]=(0,b_.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,it.useEffect)((()=>{e((0,xm.r)())}),[e])})(d),(0,x.jsx)("div",{ref:t,className:(0,Dc.clsx)("tab-manager__tab",{"tab-manager__tab--active":i===s.currentTab,"tab-manager__tab--dragged":l}),onMouseUp:(h=i,e=>{1===e.nativeEvent.button&&s.closeTab(h)}),children:(0,x.jsx)(Nm,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,x.jsxs)(Qc,{content:(0,x.jsx)(Sm,{tabState:i,managerTabState:s}),className:"tab-manager__tab__content",children:[(0,x.jsx)("button",{className:"tab-manager__tab__label",tabIndex:-1,onClick:()=>s.openTab(i),title:i.description,children:n?.(i)??i.label}),(0,x.jsx)("button",{className:"tab-manager__tab__close-btn",onClick:()=>s.closeTab(i),tabIndex:-1,title:"Close",children:(0,x.jsx)(Yc.q1B,{})})]})})});var h})),Im=(0,st.Pi)((e=>{const{managerTabState:t}=e;return(0,x.jsx)(mm,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,x.jsx)(ed,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,x.jsxs)(td,{className:"tab-manager__menu__item",onClick:()=>t.openTab(e),children:[(0,x.jsx)("div",{className:"tab-manager__menu__item__label",children:e.label}),(0,x.jsx)("div",{className:"tab-manager__menu__item__close-btn",onClick:s=>{s.stopPropagation(),t.closeTab(e)},tabIndex:-1,title:"Close",children:(0,x.jsx)(Yc.q1B,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,x.jsx)(Yc.v4q,{})})})),vm=(0,st.Pi)((e=>{const{tabManagerState:t,tabRenderer:s}=e;return(0,x.jsxs)("div",{className:"tab-manager",children:[(0,x.jsxs)("div",{className:"tab-manager__content",onWheel:Am,children:[t.tabs.map((e=>(0,x.jsx)(ym,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,x.jsx)(Om,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,x.jsx)(Im,{managerTabState:t})]})})),Rm=()=>{const[e,t]=(0,it.useState)(!1),{ref:s,width:i,height:n}=(0,rd.NB)();return(0,it.useEffect)((()=>{t((i??0)>300&&(n??0)>150)}),[i,n]),(0,x.jsx)("div",{ref:s,className:"edit-panel__splash-screen",children:(0,x.jsxs)("div",{className:(0,Dc.clsx)("edit-panel__splash-screen__content",{"edit-panel__splash-screen__content--hidden":!e}),children:[(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Execute the 'go' function"}),(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F9"})})]}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Run the full test suite"}),(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,x.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Search for a file"}),(0,x.jsxs)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:[(0,x.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Yc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},Pm=(0,st.Pi)((()=>{const e=a_(),t=e.tabManagerState.currentTab;return t?(0,x.jsxs)("div",{className:"panel edit-panel",children:[(0,x.jsxs)("div",{className:"panel__header edit-panel__header",children:[(0,x.jsx)("div",{className:"edit-panel__header__tabs",children:(0,x.jsx)(vm,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof Kd){const s=e.tabManagerState.tabs.filter((e=>e instanceof Kd&&e.fileName===t.fileName)).length>1;return(0,x.jsxs)("div",{className:"edit-panel__header__tab",children:[(0,x.jsx)("div",{className:"edit-panel__header__tab__icon",children:(0,x.jsx)(Yc.QqN,{className:"edit-panel__header__tab__icon--file"})}),(0,x.jsx)("div",{className:"edit-panel__header__tab__label",children:t.fileName}),s&&(0,x.jsx)("div",{className:"edit-panel__header__tab__path",children:t.filePath})]})}if(t instanceof Qp){const s=e.tabManagerState.tabs.filter((e=>e instanceof Qp&&e.diagramName===t.diagramName)).length>1;return(0,x.jsxs)("div",{className:"edit-panel__header__tab",children:[(0,x.jsx)("div",{className:"edit-panel__header__tab__icon",children:(0,x.jsx)(Y_,{})}),(0,x.jsx)("div",{className:"edit-panel__header__tab__label",children:t.diagramName}),s&&(0,x.jsx)("div",{className:"edit-panel__header__tab__path",children:t.diagramPath})]})}return t.label}})}),(0,x.jsx)("div",{className:"panel__header__actions"})]}),(0,x.jsx)("div",{className:"panel__content edit-panel__content",children:t instanceof Kd?(0,x.jsx)(pm,{editorState:t}):t instanceof Qp?(0,x.jsx)(Tm,{diagramEditorState:t}):null},t.uuid)]}):(0,x.jsx)(Rm,{})}));var wm=s(50166),Lm=s(35247);const bm=e=>{const t=3.5*parseInt(getComputedStyle(document.documentElement).fontSize,10),{options:s,children:i,getValue:n,selectProps:a}=e,[r]=n(),o=s.indexOf(r)*t,l=i.length?i.findIndex((e=>e.props.isFocused)):0,c=(0,it.useRef)(null);return(0,it.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,x.jsx)(wm.t7,{className:a.darkMode?"scrollbar--light selector-menu--dark":"",ref:c,width:"100%",height:Math.min(i.length,6)*t,itemCount:i.length,itemSize:t,initialScrollOffset:o,children:({index:e,style:t})=>(0,x.jsx)("div",{style:t,children:i[e]})}):(0,x.jsx)("div",{className:"selector-menu--no-match "+(a.darkMode?"selector-menu--dark":""),children:a.noMatchMessage??"No match found"})},Dm=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__loading-indicator selector-input--dark__loading-indicator",children:(0,x.jsx)(Yc.VRP,{})}),Mm=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__dropdown-indicator",children:(0,x.jsx)(Yc.VAA,{})}),km=e=>{const{innerProps:{ref:t,...s}}=e;return(0,x.jsx)("div",{...s,ref:t,children:(0,x.jsx)("div",{className:"selector-input__indicator selector-input__clear-indicator",children:(0,x.jsx)(Yc.q1B,{})})})},Fm=e=>(0,x.jsx)(Lm.baseComponents.Input,{...e,isHidden:!1}),jm=(0,it.forwardRef)((function(e,t){const{option:s,allowCreating:i,noMatchMessage:n,disabled:a,components:r,className:o,darkMode:l,hasError:c,...d}=e,h=i?Lm.CreatableSelect:Lm.Select,u=l?"selector-input--dark":"selector-input";return(0,x.jsx)(h,{styles:{menuPortal:e=>({...e,zIndex:9999})},menuPortalTarget:document.body,ref:t,isDisabled:Boolean(a),className:`${u} ${o} ${c?"selector-input--has-error":""}`,classNamePrefix:u,components:{ClearIndicator:km,DropdownIndicator:Mm,LoadingIndicator:Dm,MenuList:bm,Input:Fm,...r},...{...d,darkMode:l,noMatchMessage:n}})})),Um=(e,t)=>e.label.localeCompare(t.label),Vm=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.fileSearchCommandLoadingState,i=e.fileSearchCommandState,n=(0,it.useRef)(null),a=(0,it.useMemo)((()=>(0,dd.Z)((()=>{(0,O.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,x.jsx)(bc.Z,{open:e.openFileSearchCommand,onClose:r,TransitionProps:{onEnter:()=>{n.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Open file"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)(jm,{ref:n,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(Um),onChange:s=>{s?.value&&(r(),i.reset(),(0,O.fl)(e.loadFile(s.value)).catch(t.alertUnhandledError))},onInputChange:e=>{i.setText(e),a.cancel(),a()},placeholder:"Enter file name or path",escapeClearsValue:!0,darkMode:!0,isLoading:s.isInProgress}),(0,x.jsx)("button",{className:(0,Dc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":i.isRegExp}),title:`Use Regular Expression (${i.isRegExp?"on":"off"})`,onClick:()=>i.toggleRegExp(),children:(0,x.jsx)(Yc.x47,{})})]})]})})})),Gm=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.textSearchCommandState,i=(0,it.useRef)(null),n=()=>e.setOpenTextSearchCommand(!1),a=s=>{s.preventDefault(),n(),(0,O.fl)(e.searchText()).catch(t.alertUnhandledError)};return(0,x.jsx)(bc.Z,{open:e.openTextSearchCommand,onClose:n,TransitionProps:{onEnter:()=>{i.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,x.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,x.jsx)("div",{className:"modal__title",children:"Search"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:a,children:(0,x.jsx)("input",{ref:i,className:"command-modal__content__input input--dark",onChange:e=>s.setText(e.target.value),value:s.text})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isCaseSensitive}),title:`Match Case (${s.isCaseSensitive?"on":"off"})`,onClick:()=>s.toggleCaseSensitive(),children:(0,x.jsx)(Yc.a2g,{})}),(0,x.jsx)("button",{className:(0,Dc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isRegExp}),title:`Use Regular Expression (${s.isRegExp?"on":"off"})`,onClick:()=>s.toggleRegExp(),children:(0,x.jsx)(Yc.x47,{})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark btn--caution",onClick:a,children:"Search"})]})]})})})),zm=(Bm=(0,st.Pi)((()=>{const e=a_(),t=Mt(),s=e.initState.hasSucceeded,{ref:i,width:n,height:a}=(0,rd.NB)(),r=x_(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),o=x_(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),l=x_(e.auxPanelDisplayState.isMaximized);return(0,it.useEffect)((()=>{i.current&&e.auxPanelDisplayState.setMaxSize(i.current.offsetHeight)}),[e,i,a,n]),(0,it.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,it.useEffect)((()=>{const s=((e,t=!1)=>t?(0,ee.parseUrl)(e).query:(0,ee.parse)(e))(window.location.search);(0,O.fl)(e.initialize(!1,void 0,s.mode,s.fastCompile)).catch(t.alertUnhandledError)}),[e,t]),(0,it.useEffect)((()=>(t.navigator.blockNavigation([()=>!0],void 0,(()=>t.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigator.unblockNavigation()})),[e,t]),dm(e),(0,x.jsxs)("div",{className:"editor",children:[(0,x.jsxs)("div",{className:"editor__body",children:[(0,x.jsx)(lm,{}),(0,x.jsx)("div",{className:"editor__content-container",ref:i,children:(0,x.jsx)("div",{className:"editor__content",children:(0,x.jsxs)(T_,{orientation:"vertical",children:[(0,x.jsx)(N_,{...r.collapsiblePanel,direction:1,children:(0,x.jsx)(rm,{})}),(0,x.jsx)(O_,{}),(0,x.jsx)(N_,{...r.remainingPanel,minSize:300,children:(0,x.jsxs)(T_,{orientation:"horizontal",children:[(0,x.jsx)(N_,{...l.collapsiblePanel,...0===e.auxPanelDisplayState.size?o.remainingPanel:{},children:(0,x.jsx)(Pm,{})}),(0,x.jsx)(O_,{children:(0,x.jsx)(A_,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsx)(N_,{...o.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?l.remainingPanel:{},direction:-1,children:(0,x.jsx)(L_,{})})]})})]})})})]}),(0,x.jsx)(cm,{actionsDisabled:!s}),s&&(0,x.jsx)(Vm,{}),s&&(0,x.jsx)(Gm,{})]})})),function(){return(0,x.jsx)(n_,{children:(0,x.jsx)(Bm,{})})});var Bm;const $m=()=>(0,x.jsx)(wd,{children:(0,x.jsx)(vd,{children:(0,x.jsx)(zm,{})})}),Hm=JSON.parse('{"i8":"6.2.17","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class Ym extends o{}class Wm extends Ym{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class Km extends Wm{static NAME=Hm.Rw.p;constructor(){super(Km.NAME,Hm.i8)}getExtraKeyedCommandConfigEntries(){return[$d,Yd].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class Zm extends et{static create(){const e=new Zm(Ut.create());return e.withBasePlugins([new Km]),e.withBasePresets([new Oc]),e}async configureApplication(e){return new Ft(e)}async loadApplication(){await(async(e,t)=>{(e=>{var t,s;A.editor.defineTheme(T.LEGEND,Ve),A.editor.addKeybindingRules([{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyB,command:null},{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyO,command:null},{keybinding:A.KeyMod.WinCtrl|A.KeyCode.KeyP,command:null},{keybinding:A.KeyCode.F1,command:null},{keybinding:A.KeyCode.F8,command:null},{keybinding:A.KeyCode.F9,command:null},{keybinding:A.KeyMod.Shift|A.KeyCode.F10,command:null}]),A.languages.register({id:C.PURE}),A.languages.setLanguageConfiguration(C.PURE,Ge),A.languages.setMonarchTokensProvider(C.PURE,(t=e.getPureGraphManagerPlugins().flatMap((e=>e.getExtraPureGrammarKeywords?.()??[])),s=e.getPureGraphManagerPlugins().flatMap((e=>e.getExtraPureGrammarParserNames?.()??[])),{defaultToken:"invalid",tokenPostfix:".pure",keywords:[...t,"Schema","Table","Join","View","primaryKey","groupBy","mainTable","let","extends","true","false","projects",Me.CLASS,Me.ASSOCIATION,Me.ENUMERATION,Me.MEASURE,Me.PROFILE,Me.FUNCTION,Me.MAPPING,Me.RUNTIME,Me.CONNECTION,Me.FILE_GENERATION,Me.GENERATION_SPECIFICATION,Me.DATA_ELEMENT,ke.JSON_MODEL_CONNECTION,ke.MODEL_CHAIN_CONNECTION,ke.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",Me.SERVICE,Me.FLAT_DATA,Me.DATABASE,ke.FLAT_DATA_CONNECTION,ke.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@","<<",">>"],languageStructs:["import","native"],parsers:[Fe.PURE,Fe.CONNECTION,Fe.RUNTIME,Fe.MAPPING,Fe.SERVICE,Fe.FLATDATA,Fe.RELATIONAL,Fe.GENERATION_SPECIFICATION,Fe.FILE_GENERATION_SPECIFICATION,Fe.DATA].concat(s).map((e=>`###${e}`)),identifier:/[a-zA-Z_$][\w$]*/,symbols:/[=><!~?:&|+\-*/^%#@]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,multiplicity:/\[(?:\d+(?:\.\.(?:\d+|\*|))?|\*)\]/,package:/(?:[\w_]+::)+/,generics:/<.+>/,date:/%-?\d+(?:-\d+(?:-\d+(?:T(?:\d+(?::\d+(?::\d+(?:.\d+)?)?)?)(?:[+-][0-9]{4})?)))/,time:/%\d+(?::\d+(?::\d+(?:.\d+)?)?)?/,tokenizer:{root:[{include:"@pure"},{include:"@date"},{include:"@color"},[/^\s*###[\w]+/,{cases:{"@parsers":Ue.PARSER,"@default":Ue.INVALID}}],[/(@identifier)/,{cases:{"@languageStructs":Ue.LANGUAGE_STRUCT,"@keywords":`${Ue.KEYWORD}.$0`,"@default":Ue.IDENTIFIER}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":Ue.OPERATOR,"@default":Ue.IDENTIFIER}}],{include:"@number"},[/[;,.]/,Ue.DELIMITER],[/'([^'\\]|\\.)*$/,`${Ue.STRING}.invalid`],[/'/,Ue.STRING,"@string"],{include:"@characters"}],pure:[[/(@package\*)/,[Ue.PACKAGE]],[/(@package?)(@identifier)(@generics?)(\s*)(@multiplicity)/,[Ue.PACKAGE,Ue.TYPE,Ue.GENERICS,Ue.WHITESPACE,Ue.MULTIPLICITY]],[/(@package)(@identifier)(@generics?)/,[Ue.PACKAGE,Ue.TYPE,Ue.GENERICS]],[/([@^])(?:\s*)(@package?)(@identifier)(@generics?)(@multiplicity?)/,[`${Ue.TYPE}.operator`,Ue.PACKAGE,Ue.TYPE,Ue.GENERICS,Ue.MULTIPLICITY]],[/(\.\s*)(@identifier)/,[Ue.DELIMITER,Ue.PROPERTY]],[/(@identifier)(\s*[:=])/,[Ue.PROPERTY,Ue.OPERATOR]],[/(@identifier)(\.)(@identifier)/,[Ue.TYPE,Ue.OPERATOR,Ue.PROPERTY]],[/(let)(\s+)(@identifier)(\s*[:=])/,[Ue.KEYWORD,Ue.WHITESPACE,Ue.VARIABLE,Ue.OPERATOR]],[/(\$@identifier)/,[Ue.VARIABLE]]],date:[[/(%latest)/,[`${Ue.DATE}.latest`]],[/(@date)/,[Ue.DATE]],[/(@time)/,[`${Ue.DATE}.time`]]],color:[[/(#[0-9a-fA-F]{6})/,[Ue.COLOR]]],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,`${Ue.NUMBER}.float`],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,`${Ue.NUMBER}.float`],[/0[xX](@hexdigits)[Ll]?/,`${Ue.NUMBER}.hex`],[/0(@octaldigits)[Ll]?/,`${Ue.NUMBER}.octal`],[/0[bB](@binarydigits)[Ll]?/,`${Ue.NUMBER}.binary`],[/(@digits)[fFdD]/,`${Ue.NUMBER}.float`],[/(@digits)[lL]?/,Ue.NUMBER]],whitespace:[[/[ \t\r\n]+/,Ue.WHITESPACE],[/\/\*\*(?!\/)/,`${Ue.COMMENT}.doc`,"@doc"],[/\/\*/,Ue.COMMENT,"@comment"],[/\/\/.*$/,Ue.COMMENT]],comment:[[/[^/*]+/,Ue.COMMENT],[/\*\//,Ue.COMMENT,"@pop"],[/[/*]/,Ue.COMMENT]],doc:[[/[^/*]+/,`${Ue.COMMENT}.doc`],[/\/\*/,`${Ue.COMMENT}.doc.invalid`],[/\*\//,`${Ue.COMMENT}.doc`,"@pop"],[/[/*]/,`${Ue.COMMENT}.doc`]],string:[[/[^\\']+/,Ue.STRING],[/@escapes/,`${Ue.STRING}.escape`],[/\\./,`${Ue.STRING}.escape.invalid`],[/'/,Ue.STRING,"@pop"]],characters:[[/'[^\\']'/,Ue.STRING],[/(')(@escapes)(')/,[Ue.STRING,`${Ue.STRING}.escape`,Ue.STRING]],[/'/,`${Ue.STRING}.invalid`]]}}))})(e);const s="Monospaced font 'Roboto Mono' has not been loaded properly, text editor display problems might occur";await document.fonts.load("1em Roboto Mono").then((()=>{document.fonts.check("1em Roboto Mono")?(A.editor.remeasureFonts(),t.info(h.create(_e.TEXT_EDITOR_FONT_LOADED),"Monospaced font 'Roboto Mono' has been loaded")):t.error(h.create(_e.APPLICATION_SETUP_FAILURE),s)})).catch((()=>t.error(h.create(_e.APPLICATION_SETUP_FAILURE),s))),(0,O.jQ)({enforceActions:"observed"})})(this.pluginManager,this.logger),(0,N.s)((()=>{let e=document.getElementsByTagName("root").length?document.getElementsByTagName("root")[0]:void 0;return e||(e=document.createElement("root"),document.body.appendChild(e)),e})()).render((0,x.jsx)(tt.VK,{basename:this.baseUrl,children:(0,x.jsx)(ot,{children:(0,x.jsx)(Dt,{config:this.config,pluginManager:this.pluginManager,children:(0,x.jsx)($m,{})})})}))}}class Xm{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){Zm.create().setup({baseUrl:e}).withPresets(Xm.getPresetCollection()).withPlugins(Xm.getPluginCollection()).start().catch((e=>{throw e}))}}Xm.run("/ide/")},94174:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Fuse=void 0;var n=s(71659);Object.defineProperty(t,"Fuse",{enumerable:!0,get:function(){return i(n).default}})},12889:(e,t,s)=>{t.J$M=t.DE2=t.W1M=t.oF7=t.bK4=t.o1U=t.Zlt=t.jG4=t.uMt=t.pTE=t.UOT=t.pgN=t.VAA=t.IEm=t.pOD=t.xDH=t.q1B=t.cOE=void 0,t.QqN=t.SCS=t.$Ow=t.ROc=t.ry=t.FxN=t.Qq=t.VRP=t.nnZ=t.LPM=t.rE2=void 0,t.Two=t.qdB=t.NK0=t.UHp=t.VjU=t.NEI=t.DuK=t.ce8=t.dRK=t.VHe=t.DXi=t.jZm=t.Oag=t.kdY=void 0,t.xLV=t.Sd5=t.tPC=t.Hrt=t.jtq=t.HXR=t.LyQ=t.ppk=t.B_D=t.UPo=t.eRw=t.HLb=t.w0Y=t.Cti=t.POq=t.Vzd=t.b0D=t.XCv=t.g8U=t.v4q=t.a2g=t.x47=void 0,t.eid=void 0;var i=s(18978);Object.defineProperty(t,"cOE",{enumerable:!0,get:function(){return i.FaCrosshairs}}),Object.defineProperty(t,"q1B",{enumerable:!0,get:function(){return i.FaTimes}}),Object.defineProperty(t,"xDH",{enumerable:!0,get:function(){return i.FaTimesCircle}}),Object.defineProperty(t,"pOD",{enumerable:!0,get:function(){return i.FaPlus}}),Object.defineProperty(t,"IEm",{enumerable:!0,get:function(){return i.FaCog}}),Object.defineProperty(t,"VAA",{enumerable:!0,get:function(){return i.FaCaretDown}}),Object.defineProperty(t,"pgN",{enumerable:!0,get:function(){return i.FaHammer}}),Object.defineProperty(t,"UOT",{enumerable:!0,get:function(){return i.FaQuestion}}),Object.defineProperty(t,"pTE",{enumerable:!0,get:function(){return i.FaQuestionCircle}}),Object.defineProperty(t,"uMt",{enumerable:!0,get:function(){return i.FaInfoCircle}}),Object.defineProperty(t,"jG4",{enumerable:!0,get:function(){return i.FaCompress}}),Object.defineProperty(t,"Zlt",{enumerable:!0,get:function(){return i.FaMap}}),Object.defineProperty(t,"o1U",{enumerable:!0,get:function(){return i.FaPlay}}),Object.defineProperty(t,"bK4",{enumerable:!0,get:function(){return i.FaArrowAltCircleRight}}),Object.defineProperty(t,"oF7",{enumerable:!0,get:function(){return i.FaShapes}}),Object.defineProperty(t,"W1M",{enumerable:!0,get:function(){return i.FaSearch}}),Object.defineProperty(t,"DE2",{enumerable:!0,get:function(){return i.FaList}}),Object.defineProperty(t,"J$M",{enumerable:!0,get:function(){return i.FaCircle}}),Object.defineProperty(t,"rE2",{enumerable:!0,get:function(){return i.FaCheckCircle}}),Object.defineProperty(t,"LPM",{enumerable:!0,get:function(){return i.FaExclamationTriangle}}),Object.defineProperty(t,"nnZ",{enumerable:!0,get:function(){return i.FaBug}}),Object.defineProperty(t,"VRP",{enumerable:!0,get:function(){return i.FaCircleNotch}}),Object.defineProperty(t,"Qq",{enumerable:!0,get:function(){return i.FaExpand}}),Object.defineProperty(t,"FxN",{enumerable:!0,get:function(){return i.FaTerminal}}),Object.defineProperty(t,"ry",{enumerable:!0,get:function(){return i.FaFolderOpen}}),Object.defineProperty(t,"ROc",{enumerable:!0,get:function(){return i.FaFolder}}),Object.defineProperty(t,"$Ow",{enumerable:!0,get:function(){return i.FaExclamationCircle}}),Object.defineProperty(t,"SCS",{enumerable:!0,get:function(){return i.FaBan}}),Object.defineProperty(t,"QqN",{enumerable:!0,get:function(){return i.FaFileAlt}}),Object.defineProperty(t,"kdY",{enumerable:!0,get:function(){return i.FaMapMarkerAlt}}),Object.defineProperty(t,"Oag",{enumerable:!0,get:function(){return i.FaHatWizard}}),Object.defineProperty(t,"jZm",{enumerable:!0,get:function(){return i.FaRegLaughWink}}),Object.defineProperty(t,"DXi",{enumerable:!0,get:function(){return i.FaRegSadTear}}),Object.defineProperty(t,"VHe",{enumerable:!0,get:function(){return i.FaDatabase}});var n=s(1553);Object.defineProperty(t,"dRK",{enumerable:!0,get:function(){return n.GiBeard}}),Object.defineProperty(t,"ce8",{enumerable:!0,get:function(){return n.GiSunglasses}});var a=s(65186);Object.defineProperty(t,"DuK",{enumerable:!0,get:function(){return a.MdRefresh}}),Object.defineProperty(t,"NEI",{enumerable:!0,get:function(){return a.MdSubject}}),Object.defineProperty(t,"VjU",{enumerable:!0,get:function(){return a.MdViewHeadline}}),Object.defineProperty(t,"UHp",{enumerable:!0,get:function(){return a.MdAssistant}});var r=s(49385);Object.defineProperty(t,"NK0",{enumerable:!0,get:function(){return r.VscWordWrap}}),Object.defineProperty(t,"qdB",{enumerable:!0,get:function(){return r.VscGoToFile}}),Object.defineProperty(t,"Two",{enumerable:!0,get:function(){return r.VscClose}}),Object.defineProperty(t,"x47",{enumerable:!0,get:function(){return r.VscRegex}}),Object.defineProperty(t,"a2g",{enumerable:!0,get:function(){return r.VscCaseSensitive}});var o=s(70563);Object.defineProperty(t,"v4q",{enumerable:!0,get:function(){return o.GoChevronDown}}),Object.defineProperty(t,"g8U",{enumerable:!0,get:function(){return o.GoChevronUp}}),Object.defineProperty(t,"XCv",{enumerable:!0,get:function(){return o.GoChevronRight}}),Object.defineProperty(t,"b0D",{enumerable:!0,get:function(){return o.GoX}});s(16636);var l=s(91914);Object.defineProperty(t,"Vzd",{enumerable:!0,get:function(){return l.IoFlaskSharp}});var c=s(8799);Object.defineProperty(t,"POq",{enumerable:!0,get:function(){return c.BsGripVertical}}),Object.defineProperty(t,"Cti",{enumerable:!0,get:function(){return c.BsAlignTop}}),Object.defineProperty(t,"w0Y",{enumerable:!0,get:function(){return c.BsAlignMiddle}}),Object.defineProperty(t,"HLb",{enumerable:!0,get:function(){return c.BsAlignBottom}}),Object.defineProperty(t,"eRw",{enumerable:!0,get:function(){return c.BsAlignStart}}),Object.defineProperty(t,"UPo",{enumerable:!0,get:function(){return c.BsAlignCenter}}),Object.defineProperty(t,"B_D",{enumerable:!0,get:function(){return c.BsAlignEnd}}),Object.defineProperty(t,"ppk",{enumerable:!0,get:function(){return c.BsDistributeHorizontal}}),Object.defineProperty(t,"LyQ",{enumerable:!0,get:function(){return c.BsDistributeVertical}});var d=s(77245);Object.defineProperty(t,"HXR",{enumerable:!0,get:function(){return d.BiAtom}});s(30924);var h=s(34543);Object.defineProperty(t,"jtq",{enumerable:!0,get:function(){return h.FiPackage}}),Object.defineProperty(t,"Hrt",{enumerable:!0,get:function(){return h.FiMousePointer}}),Object.defineProperty(t,"tPC",{enumerable:!0,get:function(){return h.FiMove}}),Object.defineProperty(t,"Sd5",{enumerable:!0,get:function(){return h.FiZoomIn}}),Object.defineProperty(t,"xLV",{enumerable:!0,get:function(){return h.FiZoomOut}});s(75100);var u=s(58920);Object.defineProperty(t,"eid",{enumerable:!0,get:function(){return u.TbMathFunction}})},35247:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.baseComponents=t.createFilter=t.Select=t.CreatableSelect=void 0;var n=s(54319);Object.defineProperty(t,"CreatableSelect",{enumerable:!0,get:function(){return i(n).default}});var a=s(31776);Object.defineProperty(t,"Select",{enumerable:!0,get:function(){return i(a).default}}),Object.defineProperty(t,"createFilter",{enumerable:!0,get:function(){return a.createFilter}}),Object.defineProperty(t,"baseComponents",{enumerable:!0,get:function(){return a.components}})}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={id:e,loaded:!1,exports:{}};return a[e].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=a,o.amdO={},e=[],o.O=(t,s,i,n)=>{if(!s){var a=1/0;for(d=0;d<e.length;d++){for(var[s,i,n]=e[d],r=!0,l=0;l<s.length;l++)(!1&n||a>=n)&&Object.keys(o.O).every((e=>o.O[e](s[l])))?s.splice(l--,1):(r=!1,n<a&&(a=n));if(r){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[s,i,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},s=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,i){if(1&i&&(e=this(e)),8&i)return e;if("object"==typeof e&&e){if(4&i&&e.__esModule)return e;if(16&i&&"function"==typeof e.then)return e}var n=Object.create(null);o.r(n);var a={};t=t||[null,s({}),s([]),s(s)];for(var r=2&i&&e;"object"==typeof r&&!~t.indexOf(r);r=s(r))Object.getOwnPropertyNames(r).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,o.d(n,a),n},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,s)=>(o.f[s](e,t),t)),[])),o.u=e=>"static/"+e+"."+{246:"bd837eb4",399:"7ad47fd9",471:"bde04e4b",947:"50215a8f"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},n="@finos/legend-application-pure-ide-deployment:",o.l=(e,t,s,a)=>{if(i[e])i[e].push(t);else{var r,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var h=c[d];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==n+s){r=h;break}}r||(l=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,o.nc&&r.setAttribute("nonce",o.nc),r.setAttribute("data-webpack",n+s),r.src=e),i[e]=[t];var u=(t,s)=>{r.onerror=r.onload=null,clearTimeout(p);var n=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),n&&n.forEach((e=>e(s))),t)return t(s)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),l&&document.head.appendChild(r)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/ide/",(()=>{var e={826:0};o.f.j=(t,s)=>{var i=o.o(e,t)?e[t]:void 0;if(0!==i)if(i)s.push(i[2]);else{var n=new Promise(((s,n)=>i=e[t]=[s,n]));s.push(i[2]=n);var a=o.p+o.u(t),r=new Error;o.l(a,(s=>{if(o.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var n=s&&("load"===s.type?"missing":s.type),a=s&&s.target&&s.target.src;r.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",r.name="ChunkLoadError",r.type=n,r.request=a,i[1](r)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,s)=>{var i,n,[a,r,l]=s,c=0;if(a.some((t=>0!==e[t]))){for(i in r)o.o(r,i)&&(o.m[i]=r[i]);if(l)var d=l(o)}for(t&&t(s);c<a.length;c++)n=a[c],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(d)},s=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var l=o.O(void 0,[736],(()=>o(80398)));l=o.O(l)})();
|
2
|
+
//# sourceMappingURL=index.5f7924e5.js.map
|