@finos/legend-application-pure-ide-deployment 8.21.0 → 8.22.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.
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var e,t,s,i,n,a={73449:(e,t,s)=>{const i=JSON.parse('{"i8":"6.2.9","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=>e.length?e[e.length-1]:void 0,w=e=>new Promise(((t,s)=>setTimeout((()=>{try{t(e())}catch(e){s(e)}}),0))),L=(e,t,s=((e,t)=>e===t))=>!e.find((e=>s(e,t)))&&(e.push(t),!0),b=(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)},D=(e,t,s=((e,t)=>e===t))=>{const i=e.findIndex((e=>s(e,t)));return-1!==i&&(e.splice(i,1),!0)};class M 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 k 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 F extends k{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class j extends k{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 U(e){if(!(e instanceof Error))throw new F("Expected error to be thrown")}const V=e=>{try{return e()}catch{return}};class G extends k{constructor(e,t){super("Assertion Error",e,t)}}const z=e=>null!=e;function B(e,t=""){if(null==e)throw new G(t||"Value is nullable")}const $=(e,t="")=>(B(e,t),e),H=e=>t=>((e,t)=>e instanceof t)(t,e);function Y(e,t,s=""){if(!(e instanceof t))throw new G(s||`Value is expected to be of type '${t.name}'`)}const W=(e,t,s="")=>(Y(e,t,s),e);function K(e,t=""){if(""===$(e,t))throw new G(t||"Expected string value to be non-empty")}function Z(e,t=""){return K(e,t),e}function X(e,t=""){if(!e)throw new G(t||"Expected predicate to be truthy")}const q=e=>"string"==typeof e,J=e=>"object"==typeof e&&null!==e;var Q=s(39391),ee=s(33654),te=s(34126);s(72659);const se=Q.W,ie="charset=utf-8";var ne,ae,re;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(ne=ne||(ne={})),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="*/*"}(ae=ae||(ae={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(re=re||(re={}));const oe={mode:"cors",credentials:"include",redirect:"manual"},le=(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 ce 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(J(e))return q(e.message)?e.message:JSON.stringify(e);let t;try{t=JSON.parse(e)}catch{}return t&&q(t.message)?t.message:e})(t).substring(0,5e3):"")||a,this.payload=t}}const de=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 ce(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===se.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case ae.APPLICATION_JSON:return e.json();case ae.TEXT_PLAIN:return e.text();default:return Promise.reject(new ce(e,`Can't process response for request with Content-Type '${i}'`))}},he=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=>de(e,t,s))):fetch(e,t).then((e=>de(e,t,s))),ue=(e,t)=>{const s={};return s.Accept=ae.APPLICATION_JSON,e!==re.GET&&(s[ne.CONTENT_TYPE]=`${ae.APPLICATION_JSON};${ie}`),le(s,t)};class pe{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...oe,...e?.options??{}}}async get(e,t={},s,i,n,a){return this.request(re.GET,e,void 0,t,s,i,n,a)}async put(e,t={},s={},i,n,a,r){return this.request(re.PUT,e,t,s,i,n,a,r)}async post(e,t={},s={},i,n,a,r){return this.request(re.POST,e,t,s,i,n,a,r)}async delete(e,t={},s={},i,n,a,r){return this.request(re.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&&!V((()=>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(z).forEach((t=>i.searchParams.append(e,t.toString()))):i.searchParams.append(e,t.toString()))})),i.toString()})(this.baseUrl,t,a??{});let c;if((q(s)||J(s))&&r?.enableCompression&&(X(e!==re.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,ee.Wt)(J(e)?JSON.stringify(e):e)]))(s),n=le(n,{[ne.CONTENT_TYPE]:`${ae.APPLICATION_ZLIB};${ie}`})),void 0!==s)if(q(s)||s instanceof Blob)c=s;else{if(!J(s))throw new G("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:ue(e,n)};return fetch(l,d).then((e=>(e=>0===e.status||e.status===se.UNAUTHORIZED)(e)?he(l,d,o):de(e,d,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?he(l,d,o):Promise.reject(e)))}}const _e=(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 me;!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"}(me=me||(me={}));const ge="::",Ee="###",fe=["$implicit"];var Te,Ce,xe,Ne,Oe;(Oe=Te=Te||(Te={})).CORE="CORE",Oe.MAIN="ROOT",Oe.MODEL_GENERATION="MODEL_GENERATION_ROOT",Oe.SYSTEM="SYSTEM_ROOT",Oe.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(Ne=Ce=Ce||(Ce={})).STRING="String",Ne.BOOLEAN="Boolean",Ne.BINARY="Binary",Ne.NUMBER="Number",Ne.INTEGER="Integer",Ne.FLOAT="Float",Ne.DECIMAL="Decimal",Ne.DATE="Date",Ne.STRICTDATE="StrictDate",Ne.DATETIME="DateTime",Ne.STRICTTIME="StrictTime",Ne.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(xe=xe||(xe={}));const Ae=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var Se,ye,Ie,ve,Re,Pe,we,Le,be,De;(ye=Se=Se||(Se={})).ANY="meta::pure::metamodel::type::Any",ye.NIL="meta::pure::metamodel::type::Nil",ye.PROFILE_DOC="meta::pure::profiles::doc",ye.PROFILE_TEMPORAL="meta::pure::profiles::temporal",ye.PROFILE="meta::pure::metamodel::extension::Profile",ye.ENUMERATION="meta::pure::metamodel::type::Enumeration",ye.MEASURE="meta::pure::metamodel::type::Measure",ye.CLASS="meta::pure::metamodel::type::Class",ye.ASSOCIATION="meta::pure::metamodel::relationship::Association",ye.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",ye.FLAT_DATA="meta::flatData::metamodel::FlatData",ye.DATABASE="meta::relational::metamodel::Database",ye.MAPPING="meta::pure::mapping::Mapping",ye.SERVICE="meta::legend::service::metamodel::Service",ye.CONNECTION="meta::pure::runtime::PackageableConnection",ye.RUNTIME="meta::pure::runtime::PackageableRuntime",ye.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",ye.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",ye.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",ye.DATA_ELEMENT="meta::pure::data::DataElement",ye.TDS_ROW="meta::pure::tds::TDSRow",(Pe=Ie=Ie||(Ie={})).BUSINESS_TEMPORAL="businesstemporal",Pe.PROCESSING_TEMPORAL="processingtemporal",Pe.BITEMPORAL="bitemporal",(Re=ve=ve||(ve={})).ALL_VERSIONS="AllVersions",Re.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(Le=we=we||(we={})).STORE="STORE",Le.MAPPING="MAPPING",Le.RUNTIME="RUNTIME",Le.FILE_GENERATION="FILE_GENERATION",Le.SERVICE="SERVICE",(De=be=be||(be={})).TODAY="meta::pure::functions::date::today",De.NOW="meta::pure::functions::date::now",De.FIRST_DAY_OF_WEEK="meta::pure::functions::date::firstDayOfThisWeek",De.FIRST_DAY_OF_MONTH="meta::pure::functions::date::firstDayOfThisMonth",De.FIRST_DAY_OF_QUARTER="meta::pure::functions::date::firstDayOfThisQuarter",De.FIRST_DAY_OF_YEAR="meta::pure::functions::date::firstDayOfThisYear",De.PREVIOUS_DAY_OF_WEEK="meta::pure::functions::date::previousDayOfWeek",De.IS_ON_DAY="meta::pure::functions::date::isOnDay",De.IS_ON_OR_AFTER_DAY="meta::pure::functions::date::isOnOrAfterDay",De.IS_AFTER_DAY="meta::pure::functions::date::isAfterDay",De.IS_ON_OR_BEFORE_DAY="meta::pure::functions::date::isOnOrBeforeDay",De.IS_BEFORE_DAY="meta::pure::functions::date::isBeforeDay",De.MINUS="meta::pure::functions::math::minus",De.ADJUST="meta::pure::functions::date::adjust",De.LET="meta::pure::functions::lang::letFunction";const Me="yyyy-MM-dd'T'HH:mm:ssxxxx";var ke,Fe,je;!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"}(ke=ke||(ke={})),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"}(Fe=Fe||(Fe={})),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"}(je=je||(je={}));const Ue=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`;var Ve;!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"}(Ve=Ve||(Ve={}));const Ge={base:"vs-dark",inherit:!0,colors:{},rules:[{token:Ve.IDENTIFIER,foreground:"dcdcaa"},{token:Ve.NUMBER,foreground:"b5cea8"},{token:Ve.DATE,foreground:"b5cea8"},{token:Ve.COLOR,foreground:"b5cea8"},{token:Ve.PACKAGE,foreground:"808080"},{token:Ve.PARSER,foreground:"c586c0"},{token:Ve.LANGUAGE_STRUCT,foreground:"c586c0"},{token:Ve.MULTIPLICITY,foreground:"2d796b"},{token:Ve.GENERICS,foreground:"2d796b"},{token:Ve.PROPERTY,foreground:"9cdcfe"},{token:Ve.VARIABLE,foreground:"4fc1ff"},{token:Ve.TYPE,foreground:"3dc9b0"}]},ze={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 Be=s(79013);class $e{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,Be.qC)(this.schema,e)}fromJson(e){return(0,Be.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,S.Z)(t,(e=>null!==e))):e);var t}}const He=e=>(0,Be.PG)((t=>void 0===t?Be.AM:(0,Be.qC)(e,t)),(t=>(0,Be.vB)(e,t))),Ye=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?Be.AM:[],We=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?Be.AM:[]:Be.AM,Ke=e=>(0,Be.PG)((()=>e),(()=>e));var Ze=s(4e4);class Xe{_documentationKey;markdownText;title;text;url;related;static serialization=new $e((0,Be.yu)(Xe,{markdownText:(0,Be.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,Be.jt)((0,Be.pb)((0,Be.Ru)())),title:(0,Be.jt)((0,Be.Ru)()),text:(0,Be.jt)((0,Be.Ru)()),url:(0,Be.jt)((0,Be.Ru)())}));static create(e,t){const s=Xe.serialization.fromJson(e);return s._documentationKey=t,s}}const qe=e=>Object.entries(e).map((e=>({key:e[0],content:Xe.create(e[1],e[0])})));class Je{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(me.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,Ze.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(me.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(me.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]=Xe.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t._documentationKey})),e}}class Qe{}class et extends Qe{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 tt{config;logger;pluginManager;basePresets=[];basePlugins=[];baseUrl;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new et}setup(e){return this.baseUrl=Z(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 pe;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){U(e),this.logger.error(h.create(me.APPLICATION_CONFIGURATION_FAILURE),e)}B(s,"Can't fetch Legend application configuration");try{i=await t.get(`${window.location.origin}${e}version.json`)}catch(e){U(e),this.logger.error(h.create(me.APPLICATION_CONFIGURATION_FAILURE),e)}return B(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 pe(e.simple?{options:{credentials:"omit"}}:{}),i=await s.get(Z(e.url,"Can't load documentation registry: 'url' field is missing or empty"));B(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){U(e),this.logger.warn(h.create(me.APPLICATION_DOCUMENTATION_FETCH_FAILURE),e)}}))),e.keyedDocumentationEntries=[...qe(t),...e.keyedDocumentationEntries]}async start(){B(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(me.APPLICATION_LOADED),"Legend application loaded")}catch(e){throw U(e),this.logger.error(h.create(me.APPLICATION_LOAD_FAILURE),"Failed to load Legend application"),e}}}var st=s(74926),it=s(69038),nt=s(2784);class at{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 $(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 rt=s(40979);const ot=(0,nt.createContext)(void 0),lt=({children:e})=>{const t=(0,rt.k6)(),s=(0,it.fv)((()=>new at(t)));return(0,x.jsx)(ot.Provider,{value:s,children:e})};class ct{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 dt;!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"}(dt=dt||(dt={}));class ht{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 ut{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const n=new ht;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 pt,_t,mt,gt=s(94174);!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(pt||(pt={}));class Et{state;_message;_messageFormatter;constructor(){this.state=pt.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=pt.INITIAL,this}inProgress(){return this.state=pt.IN_PROGRESS,this}fail(){return this.state=pt.FAILED,this}pass(){return this.state=pt.SUCCEEDED,this}complete(e=!0){return e?this.pass():this.fail(),this}get isInInitialState(){return this.state===pt.INITIAL}get isInProgress(){return this.state===pt.IN_PROGRESS}get hasFailed(){return this.state===pt.FAILED}get hasSucceeded(){return this.state===pt.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 Et,{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"}(_t=_t||(_t={}));class ft{currentMode=_t.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!==_t.STANDARD}generateSearchText(e){switch(this.currentMode){case _t.INCLUDE:return`'"${e}"`;case _t.EXACT:return`="${e}"`;case _t.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(mt=mt||(mt={}));class Tt{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=Z(e.title),this.content=e.markdownText??e.text,this.url=e.url}setIsOpen(e){this.isOpen=e}}class Ct{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 xt=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class Nt{applicationStore;panelRenderingKey=(0,a.Z)();isHidden=!1;isOpen=!1;selectedTab=mt.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=Et.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 gt.Fuse(this.applicationStore.documentationService.getAllDocEntries().filter(xt),{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 ft((()=>{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 Ct(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter(z).filter(xt).map((e=>new Tt(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 Tt(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 Tt(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 Ot{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}class At{static logEvent_ApplicationInitialized(e,t){e.logEvent(me.APPLICATION_LOADED,t)}static logEvent_ApplicationContextAccessed(e,t){e.logEvent(me.APPLICATION_CONTEXT_ACCESSED,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(me.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED,t)}}class St{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 F(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&At.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 yt{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(me.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 It{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)&&L(t,e.key),this.updateHotkey(e.key,e.content.defaultKeyboardShortcut)})),t.length&&this.applicationStore.log.warn(h.create(me.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 vt,Rt;!function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(vt=vt||(vt={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(Rt=Rt||(Rt={}));const Pt=6e3;var wt;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(wt=wt||(wt={}));class Lt{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class bt{config;pluginManager;navigator;navigationContextService;notification;blockingAlertInfo;actionAlertInfo;log=new p;documentationService;assistantService;eventService=new Ot;telemetryService=new ct;tracerService=new ut;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 St(this),this.documentationService=new Je(this),this.assistantService=new Nt(this),this.telemetryService.registerPlugins(s.getTelemetryServicePlugins()),this.commandCenter=new yt(this),this.keyboardShortcutsService=new It(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 Lt(wt.INFO,e,t??[],null===s?void 0:s??Pt))}notifySuccess(e,t,s){this.setNotification(new Lt(wt.SUCCESS,e,t??[],null===s?void 0:s??Pt))}notifyWarning(e,t,s){this.setNotification(new Lt(wt.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??Pt))}notifyIllegalState(e,t,s){this.setNotification(new Lt(wt.ILEGAL_STATE,q(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??Pt))}notifyError(e,t){let s;e instanceof M?s=e.detail:e instanceof Error?s=e.message:(X(q(e),"Can't display error"),s=e),s&&this.setNotification(new Lt(wt.ERROR,s,t??[],void 0))}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return U(e),this.notifyIllegalState(e.message),t}};alertUnhandledError=e=>{this.log.error(h.create(me.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 Dt=(0,nt.createContext)(void 0),Mt=({children:e,config:t,pluginManager:s})=>{const i=$((0,nt.useContext)(ot),"Can't find web application navigator in context"),n=(0,it.fv)((()=>new bt(t,i,s)));return(0,x.jsx)(Dt.Provider,{value:n,children:e})},kt=()=>$((0,nt.useContext)(Dt),"Can't find application store in context");class Ft{appName;baseUrl;env;documentationUrl;documentationRegistryEntries=[];keyedDocumentationEntries=[];contextualDocEntries=[];appVersion;appVersionBuildTime;appVersionCommitId;constructor(e){var t;this.baseUrl=e.baseUrl,this.appName=Z(e.configData.appName,"Can't configure application: 'appName' field is missing or empty"),this.env=Z(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=qe(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=$(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=$(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=$(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}}class jt extends Ft{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),B(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=Z(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 Ut 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 Vt extends Ut{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new Vt}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 Gt=JSON.parse('{"i8":"7.1.12","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 zt extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Bt=e=>t=>(0,O.bi)(t)?t:e(t),$t=e=>(t,s)=>(0,O.bi)(t)?t:e(t,s),Ht=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})},Yt=Bt((e=>(0,O.rC)(e,{value:O.LO,valueForSerialization:O.Fl})));var Wt=s(34485),Kt=s(3096);const Zt=e=>Wt.sha1().update(e).digest("hex"),Xt=e=>Zt(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Zt(e):e.hashCode)).join(","));var qt,Jt;(Jt=qt=qt||(qt={})).PACKAGE="PACKAGE",Jt.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Jt.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Jt.PROFILE="PROFILE",Jt.TAG_POINTER="TAG_POINTER",Jt.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Jt.TAGGED_VALUE="TAGGED_VALUE",Jt.ENUMERATION="ENUMERATION",Jt.ENUM_VALUE="ENUM_VALUE",Jt.CLASS="CLASS",Jt.PROPERTY="PROPERTY",Jt.PROPERTY_POINTER="PROPERTY_POINTER",Jt.MULTIPLICITY="MULTIPLICITY",Jt.CONSTRAINT="CONSTRAINT",Jt.DERIVED_PROPERTY="DERIVED_PROPERTY",Jt.ASSOCIATION="ASSOCIATION",Jt.FUNCTION="FUNCTION",Jt.MEASURE="MEASURE",Jt.UNIT="UNIT",Jt.RUNTIME="RUNTIME",Jt.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Jt.ENGINE_RUNTIME="ENGINE_RUNTIME",Jt.LEGACY_RUNTIME="LEGACY_RUNTIME",Jt.RUNTIME_POINTER="RUNTIME_POINTER",Jt.STORE_CONNECTIONS="STORE_CONNECTIONS",Jt.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Jt.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Jt.CONNECTION_POINTER="CONNECTION_POINTER",Jt.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Jt.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Jt.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Jt.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Jt.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Jt.FLAT_DATA="FLAT_DATA",Jt.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Jt.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Jt.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Jt.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Jt.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Jt.FLAT_DATA_STRING="FLAT_DATA_STRING",Jt.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Jt.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Jt.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Jt.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Jt.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Jt.FLAT_DATA_DATE="FLAT_DATA_DATE",Jt.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Jt.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Jt.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Jt.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Jt.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Jt.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Jt.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Jt.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER",Jt.DATABASE="DATABASE",Jt.DATABASE_SCHEMA="DATABASE_SCHEMA",Jt.DATABASE_JOIN="DATABASE_JOIN",Jt.DATABASE_FILTER="DATABASE_FILTER",Jt.DATBASE_VIEW="DATBASE_VIEW",Jt.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Jt.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Jt.RELATIONAL="RELATIONAL",Jt.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Jt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Jt.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Jt.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Jt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Jt.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Jt.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Jt.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Jt.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Jt.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Jt.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Jt.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Jt.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Jt.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Jt.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Jt.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Jt.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Jt.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Jt.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Jt.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Jt.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Jt.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Jt.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Jt.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Jt.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Jt.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Jt.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Jt.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Jt.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Jt.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Jt.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Jt.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Jt.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Jt.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Jt.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Jt.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Jt.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Jt.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Jt.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Jt.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Jt.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Jt.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Jt.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Jt.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Jt.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Jt.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Jt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Jt.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Jt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Jt.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Jt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Jt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Jt.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Jt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Jt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Jt.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Jt.SCHEMA_MAPPER="SCHEMA_MAPPER",Jt.TABLE_MAPPER="TABLE_MAPPER",Jt.MAPPING="MAPPING",Jt.MAPPING_INCLUDE="MAPPING_INCLUDE",Jt.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Jt.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Jt.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Jt.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Jt.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Jt.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Jt.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Jt.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Jt.PROPERTY_MAPPING="PROPERTY_MAPPING",Jt.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Jt.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Jt.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Jt.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Jt.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Jt.MAPPING_TEST="MAPPING_TEST",Jt.STORE_TEST_DATA="STORE_TEST_DATA",Jt.INPUT_DATA="INPUT_DATA",Jt.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Jt.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Jt.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Jt.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Jt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Jt.FILTER_MAPPING="FILTER_MAPPING",Jt.COLUMN_MAPPING="COLUMN_MAPPING",Jt.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Jt.SERVICE="SERVICE",Jt.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Jt.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Jt.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Jt.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Jt.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Jt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Jt.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Jt.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Jt.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Jt.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Jt.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Jt.SERVICE_TEST="SERVICE_TEST",Jt.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Jt.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",Jt.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",Jt.GENERATION_TREE="GENERATION_TREE",Jt.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Jt.FILE_GENERATION="FILE_GENERATION",Jt.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Jt.SECTION_INDEX="SECTION_INDEX",Jt.SECTION="SECTION",Jt.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Jt.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Jt.RAW_LAMBDA="RAW_LAMBDA",Jt.RAW_VARIABLE="RAW_VARIABLE",Jt.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Jt.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Jt.ASSERT_FAIL="ASSERT_FAIL",Jt.ASSERT_PASS="ASSERT_PASS",Jt.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Jt.EQUAL_TO="EQUAL_TO",Jt.EQUAL_TO_JSON="EQUAL_TO_JSON",Jt.EQUAL_TO_TDS="EQUAL_TO_TDS",Jt.TEST_RESULT="TEST_RESULT",Jt.TEST_ERROR="TEST_ERROR",Jt.TEST_FAILED="TEST_FAILED",Jt.TEST_PASSED="TEST_PASSED",Jt.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Jt.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Jt.MODEL_STORE_DATA="MODEL_STORE_DATA",Jt.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Jt.DATA_ELEMENT="DATA_ELEMENT",Jt.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Jt.RELATIONAL_TDS="RELATIONAL_TDS",Jt.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Jt.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Jt.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Jt.EXPRESSION="EXPRESSION",Jt.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Jt.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Jt.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Jt.INSTANCE_VALUE="INSTANCE_VALUE",Jt.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Jt.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Jt.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Jt.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Jt.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Jt.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Jt.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Jt.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Jt.FUNCTION_TYPE="FUNCTION_TYPE",Jt.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Jt.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Jt.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Jt.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Jt.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Jt.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Jt.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Jt.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE";const Qt=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},X(J(t=e),"Can't hash non-object value"),Kt(t,s);var t,s},es=(e,t)=>Xt([e?Qt(e):"",t?Qt(t):""]),ts=(e,t)=>[qt.PACKAGEABLE_ELEMENT_POINTER,e,t].map(Zt).join(",");class ss{stereotypes=[];taggedValues=[]}class is extends ss{name}class ns extends is{_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 Xt([qt.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new F(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class as extends ns{}class rs extends as{_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 Xt([qt.CLASS,this.path,Xt(this.properties),Xt(this.derivedProperties),Xt(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),Xt(this.constraints),Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class os extends as{}class ls extends os{values=[];get _elementHashCode(){return Xt([qt.ENUMERATION,this.path,Xt(this.values),Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class cs extends os{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return Xt([qt.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new j}}class ds extends as{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return Xt([qt.MEASURE,this.path,this.canonicalUnit??"",Xt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class hs extends ns{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class us{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return Xt([qt.SECTION,this.parserName,Xt(this.elements.map((e=>e.valueForSerialization??"")))])}}class ps extends us{imports=[];get hashCode(){return Xt([qt.IMPORT_AWARE_CODE_SECTION,super.hashCode,Xt(this.imports.map((e=>e.valueForSerialization??"")))])}}class _s extends us{get hashCode(){return Xt([qt.DEFAULT_CODE_SECTION,super.hashCode])}}class ms{_UUID=(0,a.Z)()}class gs extends ms{ownerReference;constructor(e){super(),this.ownerReference=e}}class Es extends ms{value;constructor(e){super(),this.value=e}}class fs extends Es{constructor(e){super(e)}static create(e){return new fs(e)}get valueForSerialization(){return this.value.path}}const Ts=Bt((e=>(0,O.rC)(e,{name:O.LO,value:O.LO.ref,hashCode:O.Fl}))),Cs=Bt((e=>(Ht(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 Es&&Yt(e)})),e.configurationProperties.forEach(Ts),e))),xs=Bt((e=>((0,O.rC)(e,{id:O.LO,hashCode:O.Fl}),Yt(e.generationElement),e))),Ns=Bt((e=>(Ht(e),(0,O.rC)(e,{generationNodes:O.LO,fileGenerations:O.LO,_elementHashCode:O.KG}),e.generationNodes.forEach(xs),e.fileGenerations.forEach(Yt),e)));var Os=s(67295),As=s(72531);const Ss=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,ys=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],Is=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,Os.P)(e,void 0,s);return B(i,"Can't stringify lossless JSON value"),i})((0,As.Q)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};class vs{}class Rs extends vs{expectedOutput;constructor(e){super(),this.expectedOutput=Is(e)}get hashCode(){return Xt([qt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class Ps{}class ws extends Ps{mappings=[];connections=[];get hashCode(){return Xt([qt.ENGINE_RUNTIME,Xt(this.mappings.map((e=>ts(we.MAPPING,e.valueForSerialization??"")))),Xt(this.connections.filter((e=>e.storeConnections.length)))])}}class Ls extends Ps{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return Xt([qt.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class bs{}class Ds extends bs{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return Xt([qt.FLAT_DATA_INPUT_DATA,ts(we.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var Ms,ks,Fs;(Fs=Ms=Ms||(Ms={})).JSON="JSON",Fs.XML="XML";class js extends bs{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===Ms.JSON?Is(s):s}get hashCode(){return Xt([qt.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(ks=ks||(ks={}));class Us extends bs{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return Xt([qt.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const Vs=Bt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),Yt(e.type),e))),Gs=Bt((e=>(0,O.rC)(e,{body:O.LO.ref,parameters:O.LO.ref,hashCode:O.Fl}))),zs=Bt((e=>((0,O.rC)(e,{name:O.LO,multiplicity:O.LO,hashCode:O.Fl}),Yt(e.type),e)));class Bs{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){Gs(e)}visit_RawVariableExpression(e){zs(e)}visit_RawPrimitiveInstanceValue(e){Vs(e)}}$t(((e,t)=>(e.accept_RawValueSpecificationVisitor(new Bs(t)),e)));class $s{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class Hs extends $s{trueString;falseString;get hashCode(){return Xt([qt.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class Ys extends $s{get hashCode(){return Xt([qt.FLAT_DATA_STRING])}}class Ws extends $s{get hashCode(){return Xt([qt.FLAT_DATA_NUMBER])}}class Ks extends $s{dateFormat;timeZone;get hashCode(){return Xt([qt.FLAT_DATA_DATE,this.dateFormat?Xt(this.dateFormat):"",this.timeZone??""])}}class Zs extends $s{fields=[];get hashCode(){return Xt([qt.FLAT_DATA_RECORD_TYPE,Xt(this.fields)])}}const Xs=$t(((e,t)=>(yr(e,t),(0,O.rC)(e,{flatData:O.LO,sectionName:O.LO,hashCode:O.Fl}),e))),qs=Bt((e=>((0,O.rC)(e,{label:O.LO,flatDataDataType:O.LO,optional:O.LO,address:O.LO,hashCode:O.Fl}),(e=>{e instanceof Hs?(0,O.rC)(e,{trueString:O.LO,falseString:O.LO,hashCode:O.Fl}):e instanceof Ys||e instanceof Ws?(0,O.rC)(e,{hashCode:O.Fl}):e instanceof Ks?(0,O.rC)(e,{dateFormat:O.LO,timeZone:O.LO,hashCode:O.Fl}):e instanceof Zs&&Bt(Js)(e)})(e.flatDataDataType),e)));function Js(e){return(0,O.rC)(e,{fields:O.LO,hashCode:O.Fl}),e.fields.forEach(qs),e}Bt(Js);const Qs=Bt(Js),ei=Bt((e=>((0,O.rC)(e,{name:O.LO,value:O.LO,hashCode:O.Fl}),e))),ti=Bt((e=>((0,O.rC)(e,{driverId:O.LO,name:O.LO,sectionProperties:O.LO,recordType:O.LO,hashCode:O.Fl}),e.sectionProperties.forEach(ei),e.recordType&&Qs(e.recordType),e))),si=(Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Yt(e.ownerReference),e))),Bt((e=>(Ht(e),(0,O.rC)(e,{sections:O.LO,_elementHashCode:O.KG}),e.sections.forEach(ti),e)))),ii=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),ni=$t(((e,t)=>(Dr(e,t),(0,O.rC)(e,{filter:O.LO,hashCode:O.Fl}),ii(e.sourceRootRecordType),e.filter&&Gs(e.filter),e))),ai=$t(((e,t)=>(yr(e,t),Dr(e,t),(0,O.rC)(e,{rootInstanceSetImplementation:O.LO,hashCode:O.Fl}),e))),ri=$t(((e,t)=>(yr(e,t),(0,O.rC)(e,{transformer:O.LO,transform:O.LO,hashCode:O.Fl}),Gs(e.transform),e))),oi=Bt((e=>((0,O.rC)(e,{data:O.LO,hashCode:O.Fl}),Yt(e.sourceFlatData),e))),li=Bt((e=>((0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),e)));class ci{}class di extends ci{serverPrincipal;get hashCode(){return Xt([qt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class hi extends ci{get hashCode(){return Xt([qt.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class ui extends ci{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return Xt([qt.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class pi extends ci{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return Xt([qt.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class _i extends ci{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return Xt([qt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class mi extends ci{get hashCode(){return Xt([qt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class gi extends ci{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return Xt([qt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,Xt(this.additionalGcpScopes)])}}class Ei extends ci{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return Xt([qt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class fi extends ci{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return Xt([qt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class Ti{}class Ci extends Ti{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return Xt([qt.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class xi extends Ti{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 Xt([qt.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class Ni extends Ti{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return Xt([qt.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class Oi extends Ti{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return Xt([qt.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",Xt(this.testDataSetupSqls)])}}class Ai extends Ti{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 Xt([qt.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 Si extends Ti{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 Xt([qt.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class yi extends Ti{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return Xt([qt.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class Ii{_UUID=(0,a.Z)()}class vi extends Ii{mappers=[];get hashCode(){return Xt([qt.MAPPER_POST_PROCESSOR,Xt(this.mappers)])}}const Ri="{target}",Pi="default";class wi{}class Li extends wi{}class bi extends Li{}class Di extends bi{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return Xt([qt.RELATIONAL_OPERATION_DYNA_FUNC,this.name,Xt(this.parameters)])}}var Mi;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(Mi=Mi||(Mi={}));const ki=e=>[e].concat(e.children.length?ki(e.children[0]):[]);class Fi extends wi{relationalOperationElement;joinTreeNode;get hashCode(){return Xt([qt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,Xt(this.joinTreeNode?ki(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class ji extends wi{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new j}}class Ui extends wi{alias;column;columnName;get hashCode(){return Xt([qt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?Ri:this.alias.name,this.column.value.name])}}class Vi extends wi{value;constructor(e){super(),this.value=e}get hashCode(){return Xt([qt.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class Gi extends wi{values=[];get hashCode(){return Xt([qt.RELATIONAL_OPERATION_LITERAL_LIST,Xt(this.values)])}}class zi extends wi{owner;name;type;nullable;get hashCode(){return Xt([qt.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class Bi{}class $i extends Bi{infinityDate}class Hi{}class Yi extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_BIGINT])}}class Wi extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_SMALLINT])}}class Ki extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_TINYINT])}}class Zi extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_INTEGER])}}class Xi extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_FLOAT])}}class qi extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_DOUBLE])}}class Ji extends Hi{size;constructor(e){super(),this.size=e}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class Qi extends Hi{size;constructor(e){super(),this.size=e}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class en extends Hi{size;constructor(e){super(),this.size=e}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class tn extends Hi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class sn extends Hi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class nn extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_TIMESTAMP])}}class an extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_VARCHAR])}}class rn extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_BIT])}}class on extends Hi{size;constructor(e){super(),this.size=e}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class ln extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_REAL])}}class cn extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class dn extends gs{ownerReference;constructor(e){super(e),this.ownerReference=e}}class hn extends dn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[qt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Zt).join(",")}get selfJoinPointerHashCode(){return[qt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Pi,Ri].map(Zt).join(",")}}class un extends dn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[qt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Zt).join(",")}get selfJoinPointerHashCode(){return[qt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Pi,Ri].map(Zt).join(",")}}class pn{}class _n extends pn{_UUID=(0,a.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return Xt([this.from,this.to])}}class mn extends _n{get hashCode(){return Xt([super.hashCode,qt.SCHEMA_MAPPER])}}class gn extends _n{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return Xt([super.hashCode,qt.TABLE_MAPPER,this.schema])}}const En=Bt((e=>((0,O.rC)(e,{packageableElementIncludes:O.LO,packageableElementExcludes:O.LO,hashCode:O.Fl}),e.packageableElementIncludes.forEach(Yt),e.packageableElementExcludes.forEach(Yt),e))),fn=(Bt((e=>(Tr(e),(0,O.rC)(e,{schemaSet:O.LO,schemaId:O.LO,contentType:O.LO,modelUnit:O.LO,_elementHashCode:O.KG}),e.schemaSet&&Yt(e.schemaSet),En(e.modelUnit),e))),Bt((e=>((0,O.rC)(e,{binding:O.LO,hashCode:O.Fl}),Yt(e.binding),e)))),Tn=Bt((e=>((0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),e))),Cn=(Bt((e=>(Jr(e),(0,O.rC)(e,{externalSource:O.LO,hashCode:O.Fl}),Tn(e.externalSource),e))),Bt((e=>(0,O.rC)(e,{id:O.LO,location:O.LO,content:O.LO,hashCode:O.Fl})))),xn=(Bt((e=>(Ht(e),(0,O.rC)(e,{format:O.LO,schemas:O.LO,_elementHashCode:O.KG}),e.schemas.forEach(Cn),e))),Bt((e=>e instanceof Yi||e instanceof Wi||e instanceof Ki||e instanceof Zi||e instanceof Xi||e instanceof qi||e instanceof nn||e instanceof Date||e instanceof an||e instanceof rn||e instanceof ln||e instanceof cn?(0,O.rC)(e,{hashCode:O.Fl}):e instanceof Ji||e instanceof Qi||e instanceof en||e instanceof on?(0,O.rC)(e,{size:O.LO,hashCode:O.Fl}):e instanceof tn||e instanceof sn?(0,O.rC)(e,{precision:O.LO,scale:O.LO,hashCode:O.Fl}):e))),Nn=Bt((e=>((0,O.rC)(e,{name:O.LO,type:O.LO,nullable:O.LO,hashCode:O.Fl}),xn(e.type),e))),On=Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl,selfJoinPointerHashCode:O.Fl}),Yt(e.ownerReference),e))),An=Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl,selfJoinPointerHashCode:O.Fl}),Yt(e.ownerReference),e))),Sn=Bt((e=>((0,O.rC)(e,{relation:O.LO,name:O.LO,database:O.LO,isSelfJoinTarget:O.LO}),(e=>{e instanceof un?An(e):e instanceof hn&&On(e)})(e.relation),e))),yn=Bt((e=>((0,O.rC)(e,{name:O.LO,parameters:O.LO,hashCode:O.Fl}),e.parameters.forEach(Dn),e))),In=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),vn=Bt((e=>((0,O.rC)(e,{alias:O.LO,column:O.LO,columnName:O.LO,hashCode:O.Fl}),Sn(e.alias),In(e.column),e))),Rn=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),Pn=Bt((e=>((0,O.rC)(e,{alias:O.LO,children:O.LO,joinType:O.LO,hashCode:O.Fl}),e.alias&&Sn(e.alias),e.children.forEach(Pn),Rn(e.join),e))),wn=Bt((e=>((0,O.rC)(e,{relationalOperationElement:O.LO,joinTreeNode:O.LO,hashCode:O.Fl}),e.relationalOperationElement&&Dn(e.relationalOperationElement),e.joinTreeNode&&Pn(e.joinTreeNode),e))),Ln=Bt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),e.value instanceof wi&&Dn(e.value),e))),bn=Bt((e=>((0,O.rC)(e,{values:O.LO,hashCode:O.Fl}),e.values.forEach(Ln),e)));function Dn(e){return e instanceof Di?yn(e):e instanceof ji?Sn(e):e instanceof Ui?vn(e):e instanceof zi?Nn(e):e instanceof Vi?Ln(e):e instanceof Gi?bn(e):e instanceof Fi?wn(e):e}const Mn=Bt((e=>e)),kn=$t(((e,t)=>{if(e instanceof $i)return Mn(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})),Fn=Bt((e=>((0,O.rC)(e,{columnName:O.LO,relationalOperationElement:O.LO,hashCode:O.Fl}),Dn(e.relationalOperationElement),e))),jn=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),Un=Bt((e=>((0,O.rC)(e,{joinTreeNode:O.LO,database:O.LO,filterName:O.LO,hashCode:O.Fl}),e.joinTreeNode&&Pn(e.joinTreeNode),jn(e.filter),e))),Vn=Bt((e=>((0,O.rC)(e,{columns:O.LO}),e.columns.forEach(Dn),e))),Gn=e=>{(0,O.rC)(e,{columns:O.LO,name:O.LO})},zn=$t(((e,t)=>(Gn(e),(0,O.rC)(e,{primaryKey:O.LO,hashCode:O.Fl}),e.primaryKey.forEach(Nn),e.milestoning.forEach((e=>kn(e,t))),e))),Bn=$t(((e,t)=>(Gn(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(Nn),e.columnMappings.forEach(Fn),e.filter&&Un(e.filter),e.groupBy&&Vn(e.groupBy),e))),$n=$t(((e,t)=>((0,O.rC)(e,{name:O.LO,tables:O.LO,views:O.LO,hashCode:O.Fl}),e.tables.forEach((e=>zn(e,t))),e.views.forEach((e=>Bn(e,t))),e))),Hn=Bt((e=>((0,O.rC)(e,{name:O.LO,operation:O.LO,hashCode:O.Fl}),Dn(e.operation),e))),Yn=Bt((e=>((0,O.rC)(e,{name:O.LO,target:O.LO,aliases:O.LO,operation:O.LO,hashCode:O.Fl}),e.target&&Sn(e.target),Dn(e.operation),e))),Wn=$t(((e,t)=>(Ht(e),(0,O.rC)(e,{schemas:O.LO,joins:O.LO,filters:O.LO,_elementHashCode:O.KG}),e.schemas.forEach((e=>$n(e,t))),e.joins.forEach(Yn),e.filters.forEach(Hn),e))),Kn=$t(((e,t)=>(yr(e,t),(0,O.rC)(e,{transformer:O.LO,relationalOperation:O.LO.ref,bindingTransformer:O.LO,hashCode:O.Fl}),e.bindingTransformer&&fn(e.bindingTransformer),e))),Zn=(e,t)=>(Dr(e,t),yr(e,t),(0,O.rC)(e,{id:O.LO,rootInstanceSetImplementation:O.LO,primaryKey:O.LO}),e.primaryKey.forEach(Dn),e),Xn=$t(Zn),qn=$t(((e,t)=>(Zn(e,t),(0,O.rC)(e,{inlineSetImplementation:O.LO}),Gr(e.inlineSetImplementation,t),e))),Jn=$t(((e,t)=>(Zn(e,t),(0,O.rC)(e,{otherwisePropertyMapping:O.LO,hashCode:O.Fl}),Rr(e.otherwisePropertyMapping,t),e))),Qn=$t(((e,t)=>(Dr(e,t),(0,O.rC)(e,{primaryKey:O.LO}),e.primaryKey.forEach(Dn),e))),ea=$t(((e,t)=>(Dr(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(Fn),e.filter&&Un(e.filter),e.groupBy&&Vn(e.groupBy),e.mainTableAlias&&Sn(e.mainTableAlias),e))),ta=Bt((e=>((0,O.rC)(e,{data:O.LO,inputType:O.LO,hashCode:O.Fl}),Yt(e.database),e))),sa=Bt((e=>(0,O.rC)(e,{host:O.LO,port:O.LO,databaseName:O.LO,hashCode:O.Fl}))),ia=Bt((e=>(0,O.rC)(e,{hostname:O.LO,port:O.LO,protocol:O.LO,httpPath:O.LO,hashCode:O.Fl}))),na=Bt((e=>(0,O.rC)(e,{databaseName:O.LO,directory:O.LO,autoServerMode:O.LO,hashCode:O.Fl}))),aa=Bt((e=>(0,O.rC)(e,{testDataSetupCsv:O.LO,testDataSetupSqls:O.LO,hashCode:O.Fl}))),ra=Bt((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}))),oa=Bt((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}))),la=Bt((e=>(0,O.rC)(e,{projectId:O.LO,defaultDataset:O.LO,proxyHost:O.LO,proxyPort:O.LO,hashCode:O.Fl}))),ca=Bt((e=>(0,O.rC)(e,{serverPrincipal:O.LO,hashCode:O.Fl}))),da=Bt((e=>(0,O.rC)(e,{hashCode:O.Fl}))),ha=Bt((e=>(0,O.rC)(e,{apiToken:O.LO,hashCode:O.Fl}))),ua=Bt((e=>(0,O.rC)(e,{oauthKey:O.LO,scopeName:O.LO,hashCode:O.Fl}))),pa=Bt((e=>(0,O.rC)(e,{privateKeyVaultReference:O.LO,passPhraseVaultReference:O.LO,publicUserName:O.LO,hashCode:O.Fl}))),_a=Bt((e=>(0,O.rC)(e,{hashCode:O.Fl}))),ma=Bt((e=>(0,O.rC)(e,{hashCode:O.Fl,userNameVaultReference:O.LO,passwordVaultReference:O.LO,baseVaultReference:O.LO}))),ga=Bt((e=>(0,O.rC)(e,{hashCode:O.Fl,serviceAccountEmail:O.LO,additionalGcpScopes:O.LO}))),Ea=Bt((e=>(0,O.rC)(e,{hashCode:O.Fl,vaultReference:O.LO}))),fa=e=>{(0,O.rC)(e,{from:O.LO,to:O.LO,hashCode:O.Fl})},Ta=Bt((e=>(fa(e),e))),Ca=Bt((e=>(fa(e),(0,O.rC)(e,{schema:O.LO}),Ta(e.schema),e))),xa=$t(((e,t)=>((e=>{Jr(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 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);if(e instanceof yi)return la(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 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 mi)return _a(e);if(e instanceof Ei)return ma(e);if(e instanceof gi)return ga(e);if(e instanceof fi)return Ea(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 vi)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 mn?Ta(e):e instanceof gn&&Ca(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 Na{id}class Oa extends Na{__parent;assertions=[]}class Aa extends Na{__parent;tests=[]}class Sa extends Oa{serializationFormat;parameters=[];keys=[];get hashCode(){return Xt([qt.SERVICE_TEST,this.id,Xt(this.assertions),Xt(this.parameters),Xt(this.keys),this.serializationFormat??""])}}class ya extends Oa{query;get hashCode(){return Xt([qt.MAPPING_TEST,this.query,this.id,Xt(this.assertions)])}}class Ia extends Aa{storeTestDatas=[];get hashCode(){return Xt([qt.MAPPING_TEST_SUITE,Xt(this.storeTestDatas),this.id,Xt(this.tests)])}}class va extends Aa{testData;get hashCode(){return Xt([qt.SERVICE_TEST_SUITE,this.id,Xt(this.tests),this.testData])}}class Ra{id;parentTest}class Pa extends Ra{expected;get hashCode(){return Xt([qt.EQUAL_TO,this.id,Qt(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class wa extends Ra{expected;get hashCode(){return Xt([qt.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class La extends Ra{expected;get hashCode(){return Xt([qt.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class ba{}class Da extends ba{dataElement;get hashCode(){return Xt([qt.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class Ma extends ba{contentType;data;get hashCode(){return Xt([qt.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class ka extends ba{instances;get hashCode(){return Xt([qt.MODEL_STORE_DATA,Xt(Array.from(this.instances.keys()).map((e=>e.path))),Qt(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class Fa extends ba{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return Xt([qt.RELATIONAL_CSV_DATA_TABLE,Xt(this.tables)])}}const ja=Bt((e=>((0,O.rC)(e,{contentType:O.LO,data:O.LO,hashCode:O.Fl}),e))),Ua=Bt((e=>((0,O.rC)(e,{dataElement:O.LO,hashCode:O.Fl}),e))),Va=Bt((e=>((0,O.rC)(e,{instances:O.LO,hashCode:O.Fl}),e))),Ga=Bt((e=>((0,O.rC)(e,{values:O.LO,table:O.LO,schema:O.LO,hashCode:O.Fl}),e))),za=Bt((e=>((0,O.rC)(e,{tables:O.LO,hashCode:O.Fl}),e.tables.forEach(Ga),e)));function Ba(e,t){if(e instanceof Da)return Ua(e);if(e instanceof Ma)return ja(e);if(e instanceof ka)return Va(e);if(e instanceof Fa)return za(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 $a=$t(((e,t)=>(Ht(e),(0,O.rC)(e,{stereotypes:O.LO,taggedValues:O.LO,data:O.LO,_elementHashCode:O.KG}),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),Ba(e.data,t),e)));class Ha{}class Ya extends Ha{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return Xt([qt.SERVICE_PURE_EXECUTION,this.func])}}class Wa extends Ya{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return Xt([qt.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class Ka extends Ya{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return Xt([qt.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,Xt(this.executionParameters)])}}class Za{_OWNER;constructor(e){this._OWNER=e}}class Xa extends Za{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return Xt([qt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,Xt(this.asserts)])}}class qa extends Za{tests=[];get hashCode(){return Xt([qt.SERVICE_LEGACY_MULTI_EXECUTION_TEST,Xt(this.tests)])}}const Ja=$t(((e,t)=>((0,O.rC)(e,{connectionId:O.LO,testData:O.LO,hashCode:O.Fl}),Ba(e.testData,t),e))),Qa=Bt((e=>((0,O.rC)(e,{name:O.LO,value:O.LO.ref,hashCode:O.Fl}),e))),er=Bt((e=>((0,O.rC)(e,{assertion:O.LO,hashCode:O.Fl,id:O.LO}),Gs(e.assertion),e))),tr=Bt((e=>((0,O.rC)(e,{assertions:O.LO,description:O.LO,parameters:O.LO,hashCode:O.Fl}),e.assertions.forEach(er),e.parameters.forEach(Gs),e))),sr=$t(((e,t)=>((0,O.rC)(e,{connectionsTestData:O.LO,hashCode:O.Fl}),e.connectionsTestData.forEach((e=>Ja(e,t))),e))),ir=Bt((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(Qa),e.assertions.forEach(fr),e))),nr=$t(((e,t)=>((0,O.rC)(e,{id:O.LO,tests:O.LO,testData:O.LO,hashCode:O.Fl}),e.tests.forEach((e=>Er(e,t))),sr(e.testData,t),e))),ar=Bt((e=>((0,O.rC)(e,{parametersValues:O.LO,assert:O.LO,singleExecutionTestParent:O.LO,hashCode:O.Fl}),Gs(e.assert),e))),rr=Bt((e=>((0,O.rC)(e,{data:O.LO,asserts:O.LO,hashCode:O.Fl}),e.asserts.forEach(ar),e))),or=Bt((e=>(rr(e),(0,O.rC)(e,{key:O.LO}),e))),lr=Bt((e=>((0,O.rC)(e,{tests:O.LO,hashCode:O.Fl}),e.tests.forEach(or),e))),cr=e=>{(0,O.rC)(e,{func:O.LO}),Gs(e.func)},dr=$t(((e,t)=>(cr(e),(0,O.rC)(e,{runtime:O.LO,hashCode:O.Fl}),e.mapping&&Yt(e.mapping),e.runtime&&ho(e.runtime,t),e))),hr=$t(((e,t)=>((0,O.rC)(e,{key:O.LO,runtime:O.LO,hashCode:O.Fl}),Yt(e.mapping),ho(e.runtime,t),e))),ur=$t(((e,t)=>(cr(e),(0,O.rC)(e,{executionKey:O.LO,executionParameters:O.LO,hashCode:O.Fl}),e.executionParameters.forEach((e=>hr(e,t))),e))),pr=$t(((e,t)=>(Ht(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(go),e.taggedValues.forEach(fo),((e,t)=>{e instanceof Wa?dr(e,t):e instanceof Ka&&ur(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Xa?rr(e):e instanceof qa&&lr(e)})(e.test),e.tests.forEach((e=>nr(e,t))),e.postValidations.forEach((e=>tr(e))),e))),_r=Bt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),e))),mr=Bt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),ja(e.expected),e))),gr=Bt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),ja(e.expected),e)));function Er(e,t){if(e instanceof Sa)return ir(e);if(e instanceof ya)return xr(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 fr(e){return e instanceof Pa?_r(e):e instanceof wa?gr(e):e instanceof La?mr(e):e}const Tr=e=>{Ht(e),(0,O.rC)(e,{includes:O.LO}),e.includes.forEach(Yt)},Cr=$t(((e,t)=>((0,O.rC)(e,{store:O.LO,data:O.LO,hashCode:O.Fl}),Ba(e.data,t),e))),xr=Bt((e=>((0,O.rC)(e,{id:O.LO,query:O.LO,assertions:O.LO,hashCode:O.Fl}),e.assertions.forEach(fr),e))),Nr=$t(((e,t)=>((0,O.rC)(e,{id:O.LO,tests:O.LO,storeTestDatas:O.LO,hashCode:O.Fl}),e.tests.forEach((e=>Er(e,t))),e.storeTestDatas.forEach((e=>Cr(e,t))),e))),Or=Bt((e=>((0,O.rC)(e,{value:O.LO,valueForSerialization:O.Fl}),Yt(e.ownerReference),e))),Ar=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),Sr=Bt((e=>((0,O.rC)(e,{localMappingProperty:O.LO,localMappingPropertyType:O.LO,localMappingPropertyMultiplicity:O.LO,hashCode:O.Fl}),Yt(e.localMappingPropertyType),e))),yr=(e,t)=>{(0,O.rC)(e,{sourceSetImplementation:O.LO,targetSetImplementation:O.LO}),bo(e.property),Ar(e.sourceSetImplementation),e.targetSetImplementation&&Ar(e.targetSetImplementation),e.localMappingProperty&&Sr(e.localMappingProperty)},Ir=$t(((e,t)=>(yr(e,t),(0,O.rC)(e,{transformer:O.LO,transform:O.LO,explodeProperty:O.LO,hashCode:O.Fl}),e.transformer&&Or(e.transformer),Gs(e.transform),e)));class vr{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){Ir(e,this.observerContext)}visit_FlatDataPropertyMapping(e){ri(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){ai(e,this.observerContext)}visit_RelationalPropertyMapping(e){Kn(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){Xs(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){Xn(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){qn(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){Jn(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const Rr=(e,t)=>(e.accept_PropertyMappingVisitor(new vr(t)),e),Pr=Bt((e=>(0,O.rC)(e,{isDefault:O.Fl,valueForSerialization:O.Fl}))),wr=Bt((e=>(0,O.rC)(e,{valueForSerialization:O.Fl}))),Lr=e=>{(0,O.rC)(e,{root:O.LO}),Yt(e.class),Pr(e.id),wr(e.root)},br=Bt((e=>((0,O.rC)(e,{setImplementation:O.LO,class:O.LO,properties:O.LO}),e))),Dr=(e,t)=>{Lr(e),(0,O.rC)(e,{mappingClass:O.LO,propertyMappings:O.LO}),e.mappingClass&&br(e.mappingClass),e.propertyMappings.forEach((e=>Rr(e,t)))},Mr=Bt((e=>((0,O.rC)(e,{}),Ar(e.setImplementation),e))),kr=e=>{Lr(e),(0,O.rC)(e,{parameters:O.LO,operation:O.LO,hashCode:O.Fl}),e.parameters.forEach(Mr)},Fr=Bt((e=>(kr(e),e))),jr=Bt((e=>(kr(e),(0,O.rC)(e,{validationFunction:O.LO}),Gs(e.validationFunction),e))),Ur=$t(((e,t)=>(Dr(e,t),(0,O.rC)(e,{filter:O.LO,hashCode:O.Fl}),e.srcClass&&Yt(e.srcClass),e.filter&&Gs(e.filter),e)));class Vr{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){jr(e)}visit_OperationSetImplementation(e){Fr(e)}visit_PureInstanceSetImplementation(e){Ur(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){ni(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){Qn(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){ea(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Gr=(e,t)=>(e.accept_SetImplementationVisitor(new Vr(t)),e),zr=Bt((e=>((0,O.rC)(e,{original:O.LO,substitute:O.LO}),Yt(e.original),Yt(e.substitute),e))),Br=Bt((e=>((0,O.rC)(e,{included:O.LO,storeSubstitutions:O.LO}),Yt(e.included),e.storeSubstitutions.forEach(zr),e))),$r=Bt((e=>(0,O.rC)(e,{value:O.LO}))),Hr=Bt((e=>((0,O.rC)(e,{sourceValues:O.LO,hashCode:O.Fl}),Io(e.enum),e.sourceValues.forEach($r),e))),Yr=Bt((e=>((0,O.rC)(e,{sourceType:O.LO,enumValueMappings:O.LO,hashCode:O.Fl}),Yt(e.enumeration),Pr(e.id),e.sourceType&&Yt(e.sourceType),e.enumValueMappings.forEach(Hr),e))),Wr=$t(((e,t)=>((0,O.rC)(e,{id:O.LO,stores:O.LO,propertyMappings:O.LO,hashCode:O.Fl}),Yt(e.association),Pr(e.id),e.stores.forEach(Yt),e.propertyMappings.forEach((e=>Rr(e,t))),e))),Kr=Bt((e=>((0,O.rC)(e,{inputType:O.LO,data:O.LO,hashCode:O.Fl}),Yt(e.sourceClass),e))),Zr=Bt((e=>(0,O.rC)(e,{expectedOutput:O.LO,hashCode:O.Fl}))),Xr=$t(((e,t)=>((0,O.rC)(e,{name:O.LO,query:O.LO,inputData:O.LO,assert:O.LO,hashCode:O.Fl}),Gs(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof js)return Kr(e);if(e instanceof Ds)return oi(e);if(e instanceof Us)return ta(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 Rs&&Zr(e)})(e.assert),e))),qr=$t(((e,t)=>(Ht(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(Br),e.classMappings.forEach((e=>Gr(e,t))),e.enumerationMappings.forEach(Yr),e.associationMappings.forEach((e=>Wr(e,t))),e.test.forEach((e=>Xr(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof va?nr(e,t):e instanceof Ia?Nr(e,t):e}(e,t))),e))),Jr=e=>{(0,O.rC)(e,{store:O.LO}),Yt(e.store)},Qr=Bt((e=>(Jr(e),(0,O.rC)(e,{hashCode:O.Fl}),e))),eo=Bt((e=>(Jr(e),(0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),Yt(e.class),e))),to=Bt((e=>(Jr(e),(0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),Yt(e.class),e))),so=Bt((e=>(Jr(e),(0,O.rC)(e,{mappings:O.LO,hashCode:O.Fl}),e.mappings.forEach(Yt),e)));class io{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){Qr(e)}visit_ModelChainConnection(e){so(e)}visit_JsonModelConnection(e){eo(e)}visit_XmlModelConnection(e){to(e)}visit_FlatDataConnection(e){li(e)}visit_RelationalDatabaseConnection(e){xa(e,this.observerContext)}}const no=(e,t)=>(e.accept_ConnectionVisitor(new io(t)),e),ao=$t(((e,t)=>(Ht(e),(0,O.rC)(e,{connectionValue:O.LO,_elementHashCode:O.KG}),no(e.connectionValue,t),e))),ro=$t(((e,t)=>((0,O.rC)(e,{id:O.LO,connection:O.LO,hashCode:O.Fl}),no(e.connection,t),e))),oo=$t(((e,t)=>((0,O.rC)(e,{storeConnections:O.LO,hashCode:O.Fl}),Yt(e.store),e.storeConnections.forEach((e=>ro(e,t))),e))),lo=$t(((e,t)=>((0,O.rC)(e,{mappings:O.LO,connections:O.LO,hashCode:O.Fl}),e.mappings.forEach(Yt),e.connections.forEach((e=>oo(e,t))),e))),co=Bt((e=>((0,O.rC)(e,{hashCode:O.Fl}),Yt(e.packageableRuntime),e))),ho=(e,t)=>e instanceof Ls?co(e):e instanceof ws?lo(e,t):e,uo=$t(((e,t)=>(Ht(e),(0,O.rC)(e,{runtimeValue:O.LO,_elementHashCode:O.KG}),lo(e.runtimeValue,t),e)));class po{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){mo(e,this.observerContext)}visit_SectionIndex(e){No(e)}visit_PrimitiveType(e){}visit_Profile(e){So(e)}visit_Enumeration(e){vo(e)}visit_Measure(e){Po(e)}visit_Class(e){Mo(e)}visit_Association(e){ko(e)}visit_ConcreteFunctionDefinition(e){Fo(e)}visit_FlatData(e){si(e)}visit_Database(e){Wn(e,this.observerContext)}visit_Mapping(e){qr(e,this.observerContext)}visit_Service(e){pr(e,this.observerContext)}visit_PackageableRuntime(e){uo(e,this.observerContext)}visit_PackageableConnection(e){ao(e,this.observerContext)}visit_FileGenerationSpecification(e){Cs(e)}visit_GenerationSpecification(e){Ns(e)}visit_DataElement(e){$a(e,this.observerContext)}}const _o=$t(((e,t)=>(e.accept_PackageableElementVisitor(new po(t)),e))),mo=$t(((e,t)=>((e=>{Ht(e),(0,O.rC)(e,{children:O.LO,hashCode:O.KG})})(e),e.children.forEach((e=>{e instanceof hs?mo(e,t):_o(e,t)})),e))),go=Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Yt(e.ownerReference),e))),Eo=Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),e))),fo=Bt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),Eo(e.tag),e))),To=Bt((e=>(0,O.rC)(e,{rawType:O.LO}))),Co=Bt((e=>((0,O.rC)(e,{value:O.LO}),To(e.value),Yt(e.ownerReference),e))),xo=Bt((e=>((0,O.rC)(e,{parserName:O.LO,elements:O.LO}),e instanceof ps?(0,O.rC)(e,{imports:O.LO,hashCode:O.Fl}):e instanceof _s&&(0,O.rC)(e,{hashCode:O.Fl}),e))),No=Bt((e=>(Ht(e),(0,O.rC)(e,{sections:O.LO,_elementHashCode:O.KG}),e.sections.forEach(xo),e))),Oo=Bt((e=>(0,O.rC)(e,{value:O.LO}))),Ao=Bt((e=>(0,O.rC)(e,{value:O.LO}))),So=Bt((e=>(Ht(e),(0,O.rC)(e,{p_stereotypes:O.LO,p_tags:O.LO,_elementHashCode:O.KG}),e.p_stereotypes.forEach(Oo),e.p_tags.forEach(Ao),e))),yo=Bt((e=>((0,O.rC)(e,{name:O.LO,stereotypes:O.LO,taggedValues:O.LO,hashCode:O.Fl}),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),Io=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),vo=Bt((e=>(Ht(e),(0,O.rC)(e,{values:O.LO,stereotypes:O.LO,taggedValues:O.LO,_elementHashCode:O.KG}),e.values.forEach(yo),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),Ro=Bt((e=>((0,O.rC)(e,{measure:O.LO,conversionFunction:O.LO,hashCode:O.Fl}),e.conversionFunction&&Gs(e.conversionFunction),e))),Po=Bt((e=>(Ht(e),(0,O.rC)(e,{canonicalUnit:O.LO,nonCanonicalUnits:O.LO,_elementHashCode:O.KG}),e.canonicalUnit&&Ro(e.canonicalUnit),e.nonCanonicalUnits.forEach(Ro),e))),wo=Bt((e=>((0,O.rC)(e,{name:O.LO,multiplicity:O.LO,stereotypes:O.LO,taggedValues:O.LO,hashCode:O.Fl}),Co(e.genericType),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),Lo=Bt((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}),Co(e.genericType),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),bo=Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Yt(e.ownerReference),e))),Do=Bt((e=>((0,O.rC)(e,{name:O.LO,functionDefinition:O.LO,externalId:O.LO,enforcementLevel:O.LO,messageFunction:O.LO,hashCode:O.Fl}),Gs(e.functionDefinition),e.messageFunction&&Gs(e.messageFunction),e))),Mo=Bt((e=>(Ht(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(wo),e.propertiesFromAssociations.forEach(wo),e.derivedProperties.forEach(Lo),e.generalizations.forEach(Co),e.constraints.forEach(Do),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),ko=Bt((e=>(Ht(e),(0,O.rC)(e,{properties:O.LO,stereotypes:O.LO,taggedValues:O.LO,derivedProperties:O.LO,_elementHashCode:O.KG}),e.properties.forEach(wo),e.derivedProperties.forEach(Lo),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),Fo=Bt((e=>(Ht(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(zs),Yt(e.returnType),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),jo=Bt((e=>e instanceof ls?vo(e):e instanceof cs?Ro(e):e instanceof rs?Mo(e):e instanceof ds?Po(e):e)),Uo=(Bt((e=>e instanceof ls?vo(e):e instanceof cs?Ro(e):e)),Bt((e=>(0,O.rC)(e,{_dummyObservable:O.LO})))),Vo=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),Go=Bt((e=>(Uo(e),(0,O.rC)(e,{id:O.LO,hideProperties:O.LO,hideTaggedValues:O.LO,hideStereotypes:O.LO,hashCode:O.Fl}),Yt(e.class),e))),zo=Bt((e=>(Vo(e.classView),e))),Bo=Bt((e=>((0,O.rC)(e,{path:O.LO,pathForSerialization:O.Fl}),zo(e.from),zo(e.to),e))),$o=Bt((e=>(Bo(e),(0,O.rC)(e,{hashCode:O.Fl}),e))),Ho=Bt((e=>(Bo(e),(0,O.rC)(e,{hashCode:O.Fl}),bo(e.property),Yt(e.association),e))),Yo=Bt((e=>(Bo(e),(0,O.rC)(e,{hashCode:O.Fl}),bo(e.property),e))),Wo=Bt((e=>(Ht(e),(0,O.rC)(e,{classViews:O.LO,associationViews:O.LO,generalizationViews:O.LO,propertyViews:O.LO,_elementHashCode:O.KG}),e.classViews.forEach(Go),e.associationViews.forEach(Ho),e.generalizationViews.forEach($o),e.propertyViews.forEach(Yo),e)));var Ko;!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"}(Ko=Ko||(Ko={}));class Zo extends ns{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return Xt([Ko.DIAGRAM,this.path,Xt(this.classViews),Xt(this.generalizationViews),Xt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const Xo="Diagram";class qo extends zt{constructor(){super(Gt.Rw.LW,Gt.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[Xo]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof Zo)return Xo}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Zo)return Wo(e)}]}}class Jo{package;name;get path(){return`${this.package}::${this.name}`}get hashCode(){return Xt([qt.PACKAGEABLE_ELEMENT,this.path])}}class Qo extends Jo{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return Xt([Ko.DIAGRAM,this.path,Xt(this.classViews),Xt(this.generalizationViews),Xt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class el{rectangle;position;get hashCode(){return Xt([Ko.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class tl extends el{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return Xt([Ko.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class sl{x;y;get hashCode(){return Xt([Ko.POINT,this.x.toString(),this.y.toString()])}}class il{width;height;get hashCode(){return Xt([Ko.RECTANGLE,this.width.toString(),this.height.toString()])}}class nl{points=[]}class al{sourceView;targetView;line;get hashCode(){return Xt([Ko.RELATIONSHIP_VIEW,this.sourceView,this.targetView,Xt(this.line.points)])}}class rl extends al{property;get hashCode(){return Xt([Ko.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class ol extends rl{get hashCode(){return Xt([Ko.PROPERTY_VIEW,super.hashCode])}}class ll extends al{get hashCode(){return Xt([Ko.GENERALIZATION_VIEW,super.hashCode])}}class cl{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Xt([qt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new cl(0,0);static ZERO_ONE=new cl(0,1);static ZERO_MANY=new cl(0,void 0);static ONE=new cl(1,1);static ONE_MANY=new cl(1,void 0)}new $e((0,Be.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)()})),(0,Be.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return Xt([qt.PACKAGEABLE_ELEMENT_POINTER,this.type,this.path])}},{path:(0,Be.Ru)(),type:(0,Be.Ru)()});const dl=(0,Be.yu)(cl,{lowerBound:(0,Be.Ru)(),upperBound:(0,Be.jt)((0,Be.Ru)())});class hl{class;property;get hashCode(){return Xt([qt.PROPERTY_POINTER,this.property,this.class??""])}}class ul{}class pl{queryTimeOutInSeconds=null;enableConstraints=!0}var _l,ml;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(_l||(_l={})),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"}(ml=ml||(ml={})),(0,Be.yu)(class extends pl{},{_type:Ke(_l.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,Be.Ru)(),enableConstraints:(0,Be.Ru)()});const gl=(0,Be.yu)(class extends ul{body;parameters;get hashCode(){return Xt([qt.RAW_LAMBDA,es(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:Ke(ml.LAMBDA),body:(0,Be.LZ)(),parameters:(0,Be.LZ)()}),El=(0,Be.yu)(class extends ul{class;name;multiplicity;get hashCode(){return Xt([qt.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:Ke(ml.VARIABLE),class:(0,Be.Ru)(),multiplicity:He(dl),name:(0,Be.Ru)()});(0,Be.yu)(class extends ul{multiplicity=cl.ONE;type;value;get hashCode(){return Xt([qt.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,Be.bm)("_type",(0,Be.PG)((e=>{switch(e){case Ce.INTEGER:return ml.CINTEGER;case Ce.DECIMAL:return ml.CDECIMAL;case Ce.STRING:return ml.CSTRING;case Ce.BOOLEAN:return ml.CBOOLEAN;case Ce.FLOAT:return ml.CFLOAT;case Ce.DATETIME:return ml.CDATETIME;case Ce.STRICTDATE:return ml.CSTRICTDATE;case Ce.STRICTTIME:return ml.CSTRICTTIME;case Ce.LATESTDATE:return ml.CLATESTDATE;default:throw new j(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case ml.CINTEGER:return Ce.INTEGER;case ml.CDECIMAL:return Ce.DECIMAL;case ml.CSTRING:return Ce.STRING;case ml.CBOOLEAN:return Ce.BOOLEAN;case ml.CFLOAT:return Ce.FLOAT;case ml.CDATETIME:return Ce.DATETIME;case ml.CSTRICTDATE:return Ce.STRICTDATE;case ml.CSTRICTTIME:return Ce.STRICTTIME;case ml.CLATESTDATE:return Ce.LATESTDATE;default:throw new j(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,Be.jt)((0,Be.Ru)())});const fl=(0,Be.yu)(hl,{class:(0,Be.jt)((0,Be.Ru)()),property:(0,Be.Ru)()}),Tl=(0,Be.yu)(class{profile;value;get hashCode(){return Xt([qt.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,Be.Ru)(),value:(0,Be.Ru)()}),Cl=(0,Be.yu)(class{profile;value;get hashCode(){return Xt([qt.TAG_POINTER,this.value,this.profile])}},{profile:(0,Be.Ru)(),value:(0,Be.Ru)()}),xl=(0,Be.yu)(class{tag;value;get hashCode(){return Xt([qt.TAGGED_VALUE,this.tag,this.value])}},{tag:He(Cl),value:(0,Be.Ru)()}),Nl=((0,Be.yu)(class extends Jo{stereotypes=[];tags=[];get hashCode(){return Xt([qt.PROFILE,this.path,Xt(this.stereotypes),Xt(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:Ke("profile"),name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ru)()),tags:(0,Be.pb)((0,Be.Ru)())}),(0,Be.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return Xt([qt.ENUM_VALUE,this.value,Xt(this.stereotypes),Xt(this.taggedValues)])}},{stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1}))),value:(0,Be.Ru)()})),Ol=((0,Be.yu)(class extends Jo{values=[];stereotypes=[];taggedValues=[];get hashCode(){return Xt([qt.ENUMERATION,this.path,Xt(this.values),Xt(this.stereotypes),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:Ke("Enumeration"),name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1}))),values:(0,Be.pb)(He(Nl))}),(0,Be.yu)(class extends Jo{measure;conversionFunction;get hashCode(){return Xt([qt.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new j}},{_type:Ke("unit"),conversionFunction:(0,Be.jt)(He(gl)),measure:(0,Be.Ru)(),name:(0,Be.Ru)(),package:(0,Be.Ru)()})),Al=((0,Be.yu)(class extends Jo{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return Xt([qt.MEASURE,this.path,this.canonicalUnit??"",Xt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:Ke("measure"),canonicalUnit:(0,Be.jt)(He(Ol)),name:(0,Be.Ru)(),nonCanonicalUnits:(0,Be.pb)(He(Ol)),package:(0,Be.Ru)()}),(0,Be.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return Xt([qt.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",Xt(this.stereotypes),Xt(this.taggedValues)])}},{aggregation:(0,Be.jt)((0,Be.Ru)()),multiplicity:He(dl),name:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1}))),type:(0,Be.Ru)()})),Sl=(0,Be.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return Xt([qt.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,Xt(this.stereotypes),Xt(this.taggedValues),es(this.parameters,this.body)])}},{body:(0,Be.LZ)(),name:(0,Be.Ru)(),parameters:(0,Be.LZ)(),returnMultiplicity:He(dl),returnType:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1})))}),yl=(0,Be.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return Xt([qt.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,Be.jt)((0,Be.Ru)()),externalId:(0,Be.jt)((0,Be.Ru)()),functionDefinition:He(gl),messageFunction:(0,Be.jt)(He(gl)),name:(0,Be.Ru)()}),Il=((0,Be.yu)(class extends Jo{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return Xt([qt.CLASS,this.path,Xt(this.properties),Xt(this.derivedProperties),Xt(this.superTypes),Xt(this.constraints),Xt(this.stereotypes),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:Ke("class"),constraints:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(yl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(yl,e)),{skipIfEmpty:!1}))),name:(0,Be.Ru)(),originalMilestonedProperties:(0,Be.PG)((e=>We(e,(e=>Be.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>Be.AM),{skipIfEmpty:!1}))),package:(0,Be.Ru)(),properties:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Al,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Al,e)),{skipIfEmpty:!1}))),derivedProperties:(0,Be.bm)("qualifiedProperties",(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Sl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Sl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),superTypes:(0,Be.PG)((e=>We(e,(e=>e),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>e),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1})))}),(0,Be.yu)(class extends Jo{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return Xt([qt.ASSOCIATION,this.path,Xt(this.properties),Xt(this.derivedProperties),Xt(this.stereotypes),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:Ke("association"),name:(0,Be.Ru)(),originalMilestonedProperties:(0,Be.PG)((e=>We(e,(e=>Be.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>Be.AM),{skipIfEmpty:!1}))),package:(0,Be.Ru)(),properties:(0,Be.pb)(He(Al)),derivedProperties:(0,Be.bm)("qualifiedProperties",(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Sl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Sl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1})))}),(0,Be.yu)(class extends Jo{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return Xt([qt.FUNCTION,this.path,Xt(this.parameters),this.returnType,Xt(this.taggedValues),Xt(this.stereotypes),es(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:Ke("function"),body:(0,Be.pb)((0,Be.LZ)()),name:(0,Be.Ru)(),package:(0,Be.Ru)(),parameters:(0,Be.pb)(He(El)),postConstraints:(0,Be.pb)((0,Be.Ru)()),preConstraints:(0,Be.pb)((0,Be.Ru)()),returnMultiplicity:He(dl),returnType:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1})))}),"diagram"),vl=(0,Be.yu)(sl,{x:(0,Be.Ru)(),y:(0,Be.Ru)()}),Rl=(0,Be.yu)(il,{height:(0,Be.Ru)(),width:(0,Be.Ru)()}),Pl=(0,Be.yu)(nl,{points:(0,Be.pb)(He(vl))}),wl=(0,Be.yu)(tl,{class:(0,Be.Ru)(),hideProperties:(0,Be.jt)((0,Be.Ru)()),hideStereotypes:(0,Be.jt)((0,Be.Ru)()),hideTaggedValues:(0,Be.jt)((0,Be.Ru)()),id:(0,Be.Ru)(),position:He(vl),rectangle:He(Rl)}),Ll=(0,Be.yu)(ol,{line:He(Pl),property:He(fl),sourceView:(0,Be.Ru)(),targetView:(0,Be.Ru)()}),bl=(0,Be.yu)(ll,{line:He(Pl),sourceView:(0,Be.Ru)(),targetView:(0,Be.Ru)()}),Dl=(0,Be.yu)(Qo,{_type:Ke(Il),classViews:(0,Be.pb)(He(wl)),generalizationViews:(0,Be.pb)(He(bl)),name:(0,Be.Ru)(),package:(0,Be.Ru)(),propertyViews:(0,Be.pb)(He(Ll))});class Ml extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var kl=s(95903);const Fl=e=>$((0,kl.Z)(e.split(ge))),jl=e=>{const t=e.lastIndexOf(ge);return-1===t?void 0:e.substring(0,t)},Ul=(e,t)=>{const s=e.lastIndexOf(ge);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+ge.length,e.length)]},Vl=(e,t)=>`${e?`${e}::`:""}${t}`,Gl=(e,t)=>{e.children.push(t),t.package=e},zl=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Bl=(e,t,s,i)=>{const n=t.indexOf(ge),a=-1===n?t:t.substring(0,n);let r;if(r=e.children.find((e=>e instanceof hs&&e.name===a)),!r){if(!s)throw new G(`Can't find child package '${a}' in package '${e.path}'`);X(!fe.includes(a),`Can't create package with reserved name '${a}'`),r=new hs(a),r.package=e,e.children.push(r)}return i&&i.set(Vl(e.path,a),r),-1!==n?Bl(r,t.substring(n+ge.length),s,i):r},$l=(e,t,s,i)=>{if(i){const n=i.get(Vl(e.path,t));if(n)return n;let a=t;for(;""!==a;){const n=Vl(e.path,a),r=i.get(n);if(r)return Bl(r,t.substring(a.length+ge.length,t.length),s,i);const o=a.lastIndexOf(ge);a=-1!==o?a.substring(0,o):""}}return Bl(e,t,s,i)},Hl=(e,t,s)=>(K(t,"Package path is required"),$l(e.root,t,!0,s)),Yl=(e,t)=>W(e.rawType,t),Wl=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=Yl(e.value,rs);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},Kl=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Zl=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Xl=(e,t)=>`${$(e,"Package path is required")}::${$(t,"Name is required")}`;class ql{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){K(e.package,"Element 'package' field is missing or empty"),K(e.name,"Element 'name' field is missing or empty"),((e,t,s)=>{if(s){if(s.has(e))throw new G(`Element '${e}' already exists`);s.add(e)}else X(!t.graph.getNullableElement(e),`Element '${e}' already exists`)})(Xl(e.package,e.name),t,i);const n=this.firstPass(e,t);return Gl(Hl(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 Jl=e=>e.classView.value.id,Ql=e=>{const t=new ol,s=new nl;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new hl;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=Jl(e.from),t.targetView=Jl(e.to),t},ec=e=>{const t=new ll,s=new nl;return s.points=e.pathForSerialization,t.line=s,t.sourceView=Jl(e.from),t.targetView=Jl(e.to),t},tc=e=>{const t=new tl;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 sl;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new il;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class sc{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return Xt([Ko.POINT,this.x.toString(),this.y.toString()])}}class ic{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return Xt([Ko.RECTANGLE,this.width.toString(),this.height.toString()])}}class nc{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new sc(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 nc(new sc(e.position.x+e.rectangle.width,e.position.y),new ic(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new nc(new sc(e.position.x,e.position.y+e.rectangle.height),new ic(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,Xt([Ko.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class ac extends nc{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new sc(0,0),new ic(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return Xt([Ko.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class rc{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class oc extends gs{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class lc extends oc{ownerReference;constructor(e){const t=fs.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new lc(e)}}class cc{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new rc(lc.create(t)),this.to=new rc(lc.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 sc(n,a):(t&&(e._offsetX=0,e._offsetY=0),new sc(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 cc.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return Xt([Ko.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,Xt(this.pathForSerialization)])}}class dc extends cc{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return Xt([Ko.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class hc extends dc{get hashCode(){return Xt([Ko.PROPERTY_VIEW,super.hashCode])}}class uc extends cc{get hashCode(){return Xt([Ko.GENERALIZATION_VIEW,super.hashCode])}}class pc{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new pc(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new pc(this.x/e,this.y/e)}normal(e){return new pc(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const _c=(e,t)=>e.classViews.find((e=>e.id===t)),mc=(e,t)=>{e.path=t},gc=e=>{const t=e.buildFullPath(),s=cc.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=pc.fromPoints(s[e+1],s[e]).unit(),n=pc.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])}mc(e,i)},Ec=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),fc=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),Tc=e=>new sc(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),Cc=e=>{const t=Tc(e);return new nc(new sc(t.x-5,t.y-5),new ic(10,10))},xc=(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)),Nc=e=>{const t=$(e.x,"Point 'x' coordinate is missing"),s=$(e.y,"Point 'y' coordinate is missing");return new sc(t,s)};class Oc extends Ml{constructor(){super(Gt.Rw.zE,Gt.i8)}V1_getExtraElementBuilders(){return[new ql({elementClassName:"Diagram",_class:Qo,firstPass:(e,t)=>{Y(e,Qo);const s=new Zo(e.name),i=Xl(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Zo),s},secondPass:(e,t)=>{Y(e,Qo);const s=(i=Xl(e.package,e.name),n=t.currentSubGraph,$(n.getOwnNullableExtensionElement(i,Zo),`Can't find diagram '${i}'`));var i,n;s.classViews=e.classViews.map((e=>((e,t,s)=>{K(e.class,"Class view 'class' field is missing or empty"),K(e.id,"Class view 'id' field is missing or empty"),B(e.rectangle,"Class view 'rectangle' field is missing"),B(e.position,"Class view 'position' field is missing");const i=new ac(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=$(e.width,"Rectangle 'width' is missing"),s=$(e.height,"Rectangle 'height' is missing");return new ic(t,s)})(e.rectangle),i.position=Nc(e.position),i})(e,t,s))),s.propertyViews=e.propertyViews.map((e=>((e,t,s)=>{B(e.property,"Property view 'property' field is missing"),B(e.line,"Property view 'line' field is missing");const i=$(_c(s,$(e.sourceView)),"Property view 'sourceView' field is missing"),n=$(_c(s,$(e.targetView)),"Property view 'targetView' field is missing"),a=t.resolveOwnProperty(e.property),r=new hc(s,a,i,n);return r.path=e.line.points.map((e=>Nc(e))),gc(r),r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t)=>{B(e.line,"Generalization view 'line' field is missing");const s=$(_c(t,$(e.sourceView)),"Generalization view 'sourceView' field is missing"),i=$(_c(t,$(e.targetView)),"Generalization view 'targetView' field is missing"),n=new uc(t,s,i);return n.path=e.line.points.map((e=>Nc(e))),gc(n),n})(e,s)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof Qo)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof Qo)return(0,Be.qC)(Dl,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===Il)return(0,Be.vB)(Dl,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Zo)return(e=>{const t=new Qo;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(tc),t.generalizationViews=e.generalizationViews.map(ec),t.propertyViews=e.propertyViews.map(Ql),t})(e)}]}}class Ac extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class Sc extends Ac{constructor(){super(Gt.Rw.f1,Gt.i8)}getExtraPureGraphExtensionClasses(){return[Zo]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Zo).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof rs?Kl(e.property.ownerReference.value):e.property.ownerReference.value.properties).map((e=>e.name)).includes(e.property.value.name))).forEach((t=>D(e.propertyViews,t))),e.classViews.filter((e=>!t.getNullableClass(e.class.value.path))).forEach((t=>D(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=>D(e.generalizationViews,t)))})(t,e)))}]}}class yc extends c{constructor(){super(Gt.Rw.NA,Gt.i8,[new Sc,new qo,new Oc])}}var Ic=s(5453),vc=s(3493),Rc=s(53908);const Pc=(0,Ic.Z)({transitions:{create:()=>"none"}}),wc=e=>{const{children:t}=e;return(0,x.jsx)(vc.Z,{injectFirst:!0,children:(0,x.jsx)(Rc.Z,{theme:Pc,children:t})})};var Lc=s(83820),bc=s(99631),Dc=s(12238),Mc=s(78683),kc=s(20889),Fc=s(6277);const jc=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Fc.clsx)(t,i),children:s})};return s.displayName=e,s},Uc=e=>{const{children:t,darkMode:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Fc.clsx)("modal",{"modal--dark":s},i),children:t})},Vc=e=>{const{title:t,icon:s,className:i}=e;return(0,x.jsxs)("div",{className:(0,Fc.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=>ys.includes(e.toLowerCase())?e.toLowerCase():Ss(e))).replace(/^(?:\w+)\b/u,(e=>Ss(e))).replace(/\b(?:\w+)$/u,(e=>Ss(e))))})]});var n},Gc=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,x.jsx)("div",{className:(0,Fc.clsx)("modal__header",i),children:(0,x.jsx)(Vc,{title:t})}):(0,x.jsx)("div",{className:(0,Fc.clsx)("modal__header",i),children:s})},zc=(jc("ModalHeaderActions","modal__header__actions"),jc("ModalBody","modal__body")),Bc=jc("ModalFooter","modal__footer"),$c=e=>{switch(e){case Rt.PROCEED_WITH_CAUTION:return"btn--caution";case Rt.PROCEED:case Rt.STANDARD:default:return"btn--dark"}},Hc=(0,it.Pi)((e=>{const{info:t}=e,s=kt(),{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)(kc.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??vt.STANDARD).toLowerCase()}`,children:[i&&(0,x.jsx)(Gc,{title:i}),(0,x.jsxs)(zc,{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)(Bc,{children:[c.map((e=>(0,x.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${$c(e.type??Rt.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"})]})]})})})),Yc=(0,it.Pi)((()=>{const e=kt().actionAlertInfo;return e?(0,x.jsx)(Hc,{info:e}):null})),Wc=e=>{const{isLoading:t}=e,s=(0,nt.useRef)(null);return(0,nt.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")})},Kc=(0,it.Pi)((()=>{const e=kt().blockingAlertInfo;return e?(0,x.jsx)(kc.Z,{open:Boolean(e),onClose:v,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,x.jsxs)(Uc,{darkMode:!0,className:"blocking-alert",children:[(0,x.jsx)(Wc,{isLoading:Boolean(e.showLoading)}),(0,x.jsxs)(zc,{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 Zc=s(12889),Xc=s(58619),qc=s(33029);const Jc=(0,it.Pi)((()=>{const e=kt(),t=e.notification,s=Boolean(t),i=t?.message??"",n=t?.severity??wt.INFO,[a,r]=(0,nt.useState)(!1);let o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,x.jsx)(Zc.uMt,{})});switch(n){case wt.ILEGAL_STATE:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Zc.nnZ,{})});break;case wt.ERROR:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Zc.xDH,{})});break;case wt.WARNING:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,x.jsx)(Zc.LPM,{})});break;case wt.SUCCESS:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,x.jsx)(Zc.rE2,{})})}const l=()=>{e.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.copyTextToClipboard(i)));return(0,x.jsx)(Xc.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:e.notification?e.notification.autoHideDuration??null:Pt,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,x.jsx)(qc.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,Fc.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)(Zc.v4q,{}):(0,x.jsx)(Zc.g8U,{})},"expand"),(0,x.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,x.jsx)(Zc.q1B,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var Qc;!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"}(Qc=Qc||(Qc={}));var ed=s(11826);const td=e=>{const{children:t,classes:s,...i}=e;return(0,x.jsx)(ed.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},sd=e=>{const{className:t,children:s,menuProps:i,content:n,disabled:a,onClose:r,onOpen:o}=e,l=(0,nt.useRef)(null),[c,d]=(0,nt.useState)(!1),[h,u]=(0,nt.useState)(),[p,_]=(0,nt.useState)(0),[m,g]=(0,nt.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)(td,{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}`)]})},id=(0,nt.forwardRef)((function(e,t){const{className:s,children:i,...n}=e;return(0,x.jsx)("div",{ref:t,className:(0,Fc.clsx)("menu",s),...n,children:i})})),nd=e=>{const{className:t,onClick:s,disabled:i,children:n,...a}=e;return(0,x.jsx)("button",{className:(0,Fc.clsx)("menu__item",t),disabled:Boolean(i),onClick:s,...a,children:n})},ad=jc("MenuContentDivider","menu__divider");jc("MenuContentItemIcon","menu__item__icon"),jc("MenuContentItemLabel","menu__item__label");var rd=s(52794),od=s(71215);const ld=e=>(0,x.jsx)(rd.D,{className:(0,Fc.clsx)("markdown-content",e.className),remarkPlugins:[od.Z],children:e.value.value});var cd=s(62515);const dd=e=>{const{children:t}=e,{ref:s,width:i,height:n}=(0,cd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[a,r]=(0,nt.useState)(!1),{ref:o,width:l,height:c}=(0,cd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,nt.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,Fc.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!a}),children:t})})};var hd=s(91222);const ud=e=>{const{children:t,...s}=e;return(0,x.jsx)(hd.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var pd=s(13474),_d=s(65068),md=s(41327),gd=s(47793),Ed=s(36569),fd=s(46678);const Td=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,Fc.clsx)("mui-radio-group",n),children:[r.map(((e,t)=>(0,x.jsx)("div",{children:(0,x.jsx)(gd.Z,{className:"mui-radio-group__group",...a,children:e.map((e=>(0,x.jsx)(Ed.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,x.jsx)(fd.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 Cd;!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"}(Cd=Cd||(Cd={}));const xd=(0,it.Pi)((e=>{const{configState:t}=e,s=kt();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(Cd.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,x.jsx)(Zc.uMt,{})})]}),(0,x.jsx)("div",{children:(0,x.jsx)(Td,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[_t.STANDARD,_t.INCLUDE,_t.EXACT,_t.INVERSE],size:1})})]})})),Nd=(0,it.Pi)((e=>{const{entry:t}=e,s=kt(),i=()=>{t.isOpen||At.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},n=s.guardUnhandledError((()=>s.copyTextToClipboard(t.documentationKey)));return(0,x.jsx)(sd,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsx)(id,{children:(0,x.jsx)(nd,{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,Fc.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)(Zc.v4q,{}):(0,x.jsx)(Zc.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:()=>{At.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:q(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__content__text",children:t.content}):(0,x.jsx)(ld,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),Od=(0,it.Pi)((()=>{const e=kt(),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)(sd,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(id,{children:[(0,x.jsx)(nd,{onClick:s,children:"Copy Context ID"}),(0,x.jsx)(nd,{onClick:i,children:"Copy Current Context ID"}),(0,x.jsx)(nd,{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:q(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,x.jsx)(ld,{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)(Nd,{entry:e},e.uuid)))]})]}),!t&&(0,x.jsx)(dd,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Zc.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!"})]})})]})})),Ad=(0,it.Pi)((()=>{const e=kt(),t=(0,nt.useRef)(null),s=(0,nt.useRef)(null),i=e.assistantService,n=i.searchText,a=(0,nt.useMemo)((()=>(0,pd.Z)((()=>i.search()),100)),[i]);return(0,nt.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,Fc.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,Fc.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)(Zc.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)(Zc.q1B,{})}):(0,x.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,x.jsx)(Zc.W1M,{})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,x.jsx)(Wc,{isLoading:i.searchState.isInProgress}),(0,x.jsx)("div",{className:(0,Fc.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":i.showSearchConfigurationMenu}),children:(0,x.jsx)(xd,{configState:i.searchConfigurationState})}),i.currentDocumentationEntry&&(0,x.jsx)("div",{className:"virtual-assistant__search__results",children:(0,x.jsx)(Nd,{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)(Nd,{entry:e},e.uuid)))}),n&&!i.searchResults.length&&(0,x.jsx)(dd,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Zc.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)(sd,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(id,{children:[(0,x.jsx)(nd,{onClick:()=>{_e(`documentation-registry_${(0,_d.Z)(new Date(Date.now()),Me)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),ae.APPLICATION_JSON)},children:"Download documentation registry"}),(0,x.jsx)(nd,{onClick:()=>{_e(`documentation-registry_${(0,_d.Z)(new Date(Date.now()),Me)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),ae.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)(Zc.Oag,{className:"virtual-assistant__character__hat"}),(0,x.jsx)(Zc.ce8,{className:"virtual-assistant__character__glasses"}),(0,x.jsx)(Zc.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?"})]})})]})]})]})})),Sd=(0,it.Pi)((e=>{const{triggerElement:t}=e,s=kt().assistantService,i=s.currentContextualDocumentationEntry,n=s.selectedTab;return(0,x.jsx)(ud,{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,Fc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===mt.SEARCH}),onClick:()=>s.setSelectedTab(mt.SEARCH),title:"Search",children:(0,x.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,x.jsx)(Zc.W1M,{})})}),(0,x.jsx)("div",{className:(0,Fc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===mt.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(mt.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,x.jsx)(Zc.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)(Zc.Two,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__panel__content",children:[n===mt.SEARCH&&(0,x.jsx)(Ad,{}),n===mt.CONTEXTUAL_SUPPORT&&(0,x.jsx)(Od,{})]})]})},s.panelRenderingKey)})),yd=(0,it.Pi)((()=>{const[e,t]=(0,nt.useState)(!1),[s,i]=(0,nt.useState)((0,a.Z)()),n=kt(),r=(0,nt.useRef)(null),o=n.assistantService,l=o.currentContextualDocumentationEntry;return(0,nt.useEffect)((()=>{o.isHidden&&i((0,a.Z)())}),[o.isHidden]),(0,x.jsx)(md,{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,Fc.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(mt.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)(Zc.Two,{className:"virtual-assistant__station__trigger__close"}):l?(0,x.jsx)(Zc.J$M,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,x.jsx)(sd,{className:(0,Fc.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)(id,{children:[(0,x.jsx)(nd,{onClick:()=>{o.setIsOpen(!1),i((0,a.Z)())},children:"Reset Position"}),(0,x.jsx)(nd,{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)(Zc.POq,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,x.jsx)(Sd,{triggerElement:r.current})]})},s)})),Id="app.container",vd="app.backdrop-container",Rd=["Meta+KeyP","Control+KeyP","Meta+KeyS","Control+KeyS","F8","F10","F11","Meta+Shift+KeyP","Control+Shift+KeyP","Meta+KeyB","Control+KeyB","F7","Alt+F7","Control+Shift+KeyB"],Pd=e=>(0,x.jsx)("div",{className:"backdrop__container",id:e.elementID}),wd=(0,it.Pi)((e=>{const{children:t}=e,s=kt(),i=s.backdropContainerElementID?document.getElementById(s.backdropContainerElementID)??document.getElementById(vd):document.getElementById(vd),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:Rd,handler:e=>{e?.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,(e=>t=>{Rd.includes(e)&&t?.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,nt.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=$(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=$(a[0]),o=((e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![Qc.SHIFT,Qc.META,Qc.ALT,Qc.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)(wc,{children:[(0,x.jsx)(Kc,{}),(0,x.jsx)(Yc,{}),(0,x.jsx)(Jc,{}),s.showBackdrop&&(0,x.jsx)(Lc.Z,{container:i,children:(0,x.jsx)(bc.Z,{className:"backdrop",open:s.showBackdrop})}),(0,x.jsx)(Dc.W,{backend:Mc.PD,children:(0,x.jsxs)("div",{className:"app__container",id:Id,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,x.jsx)(Pd,{elementID:vd}),(0,x.jsx)(yd,{}),t]})})]})}));class Ld{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const bd=(0,nt.createContext)(void 0),Dd=({children:e})=>{const t=kt(),s=(0,it.fv)((()=>new Ld(t)));return(0,x.jsx)(bd.Provider,{value:s,children:e})};var Md,kd;!function(e){e.CONCEPT="CONCEPT",e.FILE="FILE"}(Md=Md||(Md={})),function(e){e.CONSOLE="CONSOLE",e.SEARCH_RESULT="SEARCH_RESULT",e.TEST_RUNNER="TEST_RUNNER"}(kd=kd||(kd={}));const Fd=(e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)},jd="dummy_problem_marker_owner";var Ud;!function(e){e.PACKAGE="Package",e.PROFILE="Profile",e.CLASS="Class",e.ASSOCIATION="Association",e.PROPERTY="Property",e.QUALIFIED_PROPERTY="QualifiedProperty",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"}(Ud=Ud||(Ud={}));class Vd{pureId;pureType;pureName;get id(){return this.pureId}}class Gd extends Vd{deprecated}(0,Be.yu)(Gd,{pureId:(0,Be.Ru)(),pureType:(0,Be.Ru)(),deprecated:(0,Be.Ru)()});class zd extends Vd{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,Be.yu)(zd,{pureId:(0,Be.Ru)(),pureName:(0,Be.Ru)(),pureType:(0,Be.Ru)(),RO:(0,Be.Ru)(),classPath:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class Bd extends Vd{RO;notpublic;user;file;line;column}(0,Be.yu)(Bd,{pureId:(0,Be.Ru)(),pureName:(0,Be.jt)((0,Be.Ru)()),pureType:(0,Be.Ru)(),RO:(0,Be.Ru)(),notpublic:(0,Be.Ru)(),user:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class $d{li_attr;id;text;icon;children;state;getNodeAttribute(e){return W(this.li_attr,e,`Expected concept node attribute to be of type '${e.name}'`)}}(0,Be.yu)($d,{li_attr:(0,Be.PG)((()=>Be.AM),(e=>e.classPath?(0,Be.vB)(zd,e):e.file?(0,Be.vB)(Bd,e):(0,Be.vB)(Gd,e))),id:(0,Be.Ru)(),text:(0,Be.Ru)(),icon:(0,Be.Ru)(),children:(0,Be.Ru)(),state:(0,Be.Ru)()});const Hd=e=>e.startsWith("/")?e.substring(1,e.length):e;class Yd{content;constructor(){(0,O.rC)(this,{content:O.LO,setContent:O.aD})}setContent(e){this.content=e}}(0,Be.yu)(Yd,{content:(0,Be.Ru)()});class Wd{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class Kd extends Wd{error;constructor(e,t,s,i){super(e,t,s),this.error=i}}var Zd;!function(e){e.ENUM="meta::pure::ide::findusages::findUsagesForEnum_String_1__String_1__SourceInformation_MANY_",e.PROPERTY="meta::pure::ide::findusages::findUsagesForProperty_String_1__String_1__SourceInformation_MANY_",e.ELEMENT="meta::pure::ide::findusages::findUsagesForPath_String_1__SourceInformation_MANY_",e.MULTIPLE_PATHS="meta::pure::ide::findusages::findUsagesForMultiplePaths_String_1__Pair_MANY_"}(Zd=Zd||(Zd={}));const Xd=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class qd{source;line;column;startLine;startColumn;endLine;endColumn}(0,Be.yu)(qd,{source:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)()});class Jd{first;second}(0,Be.yu)(Jd,{first:(0,Be.Ru)(),second:(0,Be.pb)((0,Be.Ry)(qd))});class Qd{uuid=(0,a.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class eh{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){B(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){b(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(X(-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 th extends Qd{editorStore;constructor(e){super(),this.editorStore=e}}class sh extends eh{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}}var ih;!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"}(ih=ih||(ih={}));const nh={[ih.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN"},[ih.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF"},[ih.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[ih.TOGGLE_AUX_PANEL]:{title:"Toggle auxiliary panel",defaultKeyboardShortcut:"Control+Backquote"},[ih.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[ih.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[ih.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[ih.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[ih.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"}};var ah;!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"}(ah=ah||(ah={}));const rh={[ah.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[ah.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[ah.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[ah.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};var oh;!function(e){e.REVEAL_CONCEPT_IN_TREE="editor.file-editor.reveal-concept-in-tree",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",e.RENAME_CONCEPT="editor.file-editor.rename-concept"}(oh=oh||(oh={}));const lh={[oh.REVEAL_CONCEPT_IN_TREE]:{title:"Reveal concept in tree (File)",defaultKeyboardShortcut:"Control+Shift+KeyB"},[oh.GO_TO_DEFINITION]:{title:"Go to definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[oh.GO_BACK]:{title:"Go back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[oh.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"},[oh.RENAME_CONCEPT]:{title:"Rename Concept (File)",defaultKeyboardShortcut:"F2"}};class ch{model;editor;language;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.language=(e=>{switch(P(e.split("."))){case"pure":return C.PURE;case"json":return C.JSON;case"sql":return C.SQL;case"md":return C.MARKDOWN;case"java":return C.JAVA;default:return C.TEXT}})(e.filePath),this.model=A.editor.createModel(e.uuid,this.language),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 dh{fileEditorState;concept;coordinate;constructor(e,t,s){this.fileEditorState=e,this.concept=t,this.coordinate=s}}class hh extends th{filePath;textEditorState;file;renameConceptState;constructor(e,t,s){super(e),(0,O.rC)(this,{file:O.LO,renameConceptState:O.LO,setFile:O.aD,setConceptToRenameState:O.ls}),this.file=t,this.filePath=s,this.textEditorState=new ch(this)}get label(){return Hd(this.filePath)}get description(){return`File: ${Hd(this.filePath)}`}get fileName(){return $(P(this.filePath.split("/")))}match(e){return e instanceof hh&&this.filePath===e.filePath}onClose(){this.textEditorState.model.dispose()}setFile(e){this.file=e}*setConceptToRenameState(e){if(!e)return void(this.renameConceptState=void 0);const t=yield this.editorStore.getConceptInfo(e);this.renameConceptState=t?new dh(this,t,e):void 0}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??jd,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??jd)}registerCommands(){if(this.textEditorState.language!==C.PURE)throw new F("File editor commands should only be used for Pure files");this.editorStore.applicationStore.commandCenter.registerCommand({key:oh.GO_TO_DEFINITION,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&(0,O.fl)(this.editorStore.executeNavigation(new Wd(this.filePath,e.lineNumber,e.column))).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:oh.GO_BACK,action:()=>{(0,O.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:oh.REVEAL_CONCEPT_IN_TREE,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&this.editorStore.revealConceptInTree(new Wd(this.filePath,e.lineNumber,e.column)).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:oh.FIND_USAGES,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){const t=new Wd(this.filePath,e.lineNumber,e.column);(0,O.fl)(this.editorStore.findUsages(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:oh.RENAME_CONCEPT,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){const t=new Wd(this.filePath,e.lineNumber,e.column);(0,O.fl)(this.setConceptToRenameState(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}})}async renameConcept(e){if(!this.renameConceptState)return;const t=this.renameConceptState.concept;try{this.editorStore.applicationStore.setBlockingAlert({message:"Finding concept usages...",showLoading:!0});const s=await this.editorStore.findConceptUsages(t.pureType===Ud.ENUM_VALUE?Zd.ENUM:t.pureType===Ud.PROPERTY||t.pureType===Ud.QUALIFIED_PROPERTY?Zd.PROPERTY:Zd.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`));await(0,O.fl)(this.editorStore.renameConcept(t.pureName,e,t.pureType,s)),this.textEditorState.setForcedCursorPosition({lineNumber:this.renameConceptState.coordinate.line,column:this.renameConceptState.coordinate.column})}catch(e){U(e),this.editorStore.applicationStore.notifyError(e)}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}}deregisterCommands(){if(this.textEditorState.language!==C.PURE)throw new F("File editor commands should only be used for Pure files");[oh.GO_TO_DEFINITION,oh.GO_BACK,oh.REVEAL_CONCEPT_IN_TREE,oh.FIND_USAGES,oh.RENAME_CONCEPT].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class uh{editorStore;treeData;selectedNode;loadInitialDataState=Et.create();refreshDataState=Et.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 $(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){U(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({...$(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){U(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 U(e),this.editorStore.applicationStore.notifyError(e),void this.refreshDataState.fail()}const s=this.getTreeData().rootIds.map((e=>$(this.getTreeData().nodes.get(e)))).filter((t=>e.has(t.id)));yield this.refreshOpenNodes(s,e),t&&this.getTreeData().nodes.has(t)&&this.setSelectedNode($(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=>$(this.getTreeData().nodes.get(e)))).filter((e=>t.has(e.id)))).length?this.refreshOpenNodes(e,t):Promise.resolve()}}class ph{id;path}class _h extends ph{file;statusType}(0,Be.yu)(_h,{id:(0,Be.Ru)(),path:(0,Be.Ru)(),file:(0,Be.Ru)(),statusType:(0,Be.Ru)()});class mh extends ph{repo}(0,Be.yu)(mh,{id:(0,Be.Ru)(),path:(0,Be.Ru)(),repo:(0,Be.Ru)()});class gh{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof mh}get isFileNode(){return this.li_attr instanceof _h}getNodeAttribute(e){return W(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,Be.yu)(gh,{li_attr:(0,Be.PG)((()=>Be.AM),(e=>e.file&&"true"===e.file?(0,Be.vB)(_h,e):(0,Be.vB)(mh,e))),text:(0,Be.Ru)(),icon:(0,Be.Ru)(),children:(0,Be.Ru)(),state:(0,Be.Ru)()});const Eh=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},fh=e=>e.endsWith(".pure"),Th=e=>`file_${e}`;class Ch extends uh{nodeForCreateNewFile;nodeForCreateNewDirectory;nodeForRenameFile;constructor(e){super(e),(0,O.rC)(this,{nodeForCreateNewFile:O.LO,nodeForCreateNewDirectory:O.LO,nodeForRenameFile:O.LO,setNodeForCreateNewFile:O.aD,setNodeForCreateNewDirectory:O.aD,setNodeForRenameFile:O.aD,revealPath:O.ls})}setNodeForCreateNewFile=e=>{X(!e||e.data.isFolderNode,"Node selected for creating a new file from must be a directory"),this.nodeForCreateNewFile=e};setNodeForCreateNewDirectory=e=>{X(!e||e.data.isFolderNode,"Node selected for creating a new directory from must be a directory"),this.nodeForCreateNewDirectory=e};setNodeForRenameFile=e=>{X(!e||e.data.isFileNode,"Node selected for renaming must be a file"),this.nodeForRenameFile=e};async getRootNodes(){return(await this.editorStore.client.getDirectoryChildren()).map((e=>(0,Be.vB)(gh,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,Be.vB)(gh,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(Md.FILE,{keepShowingIfMatchedCurrent:!0});const i=[];let n=e;for(;n;)i.unshift(n),n=Eh(n);for(const e of i)if(fh(e))yield(0,O.fl)(this.editorStore.loadFile(e,s));else{const t=$(this.getTreeData().nodes.get(Th(e)),`Can't find directory node with path '${e}'`);yield(0,O.fl)(this.expandNode(t))}const a=$(this.getTreeData().nodes.get(Th(e)),`Can't find file node with path '${e}'`);this.setSelectedNode(a)}}class xh extends uh{loadConceptActivity=Et.create();statusText;nodeForRenameConcept;nodeForMoveElement;constructor(e){super(e),(0,O.rC)(this,{statusText:O.LO,nodeForRenameConcept:O.LO,nodeForMoveElement:O.LO,setStatusText:O.aD,setNodeForRenameConcept:O.aD,setNodeForMoveElement:O.aD,pullConceptsActivity:O.aD,pollConceptsActivity:O.ls})}setStatusText(e){this.statusText=e}setNodeForRenameConcept(e){this.nodeForRenameConcept=e}setNodeForMoveElement(e){this.nodeForMoveElement=e}async getRootNodes(){return await(0,O.fl)(this.pollConceptsActivity()),(await this.editorStore.client.getConceptChildren()).map((e=>(0,Be.vB)($d,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,Be.vB)($d,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((t=>{const n=t.li_attr.id;i.push(n),s.nodes.set(n,{data:t,id:n,label:t.text,isLoading:!1,parent:e})})),e.childrenIds=i}*openNode(e){(e.data.li_attr instanceof zd||e.data.li_attr instanceof Bd)&&("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 Wd(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()}async movePackageableElements(e,t){let s=[];try{s=(await this.editorStore.client.getPackageableElementsUsage(e.map((e=>e.pureId)))).map((e=>(0,Be.vB)(Jd,e)))}catch{return void this.editorStore.applicationStore.notifyError("Can't find usage for child packageable elements")}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}const i=[];X(s.length===e.length,"Can't find matching usages for packageable elements");for(let n=0;n<s.length;++n){const a=$(e[n]);i.push({pureName:a.pureName,pureType:a.pureType,sourcePackage:$(jl(a.pureId)),destinationPackage:t,usages:$(s[n]).second})}await(0,O.fl)(this.editorStore.movePackageableElements(i))}async renameConcept(e,t){const s=e.data.li_attr,i=s.pureName??s.pureId;let n=[];try{switch(this.editorStore.applicationStore.setBlockingAlert({message:"Finding concept usages...",showLoading:!0}),s.pureType){case Ud.PROPERTY:case Ud.QUALIFIED_PROPERTY:Y(s,zd),n=await this.editorStore.findConceptUsages(Zd.PROPERTY,[`'${s.classPath}'`,`'${s.pureId}'`]);break;case Ud.PACKAGE:{let e=[],s=[];try{s=await this.editorStore.client.getChildPackageableElements(i),e=(await this.editorStore.client.getPackageableElementsUsage(s.map((e=>e.pureId)))).map((e=>(0,Be.vB)(Jd,e)))}catch{return void this.editorStore.applicationStore.notifyError("Can't find usage for child packageable elements")}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}const n=[];X(e.length===s.length,"Can't find matching usages for child packageable elements");const a=jl(i)?.concat(ge).concat(t)??t;for(let t=0;t<e.length;++t){const r=$(s[t]),o=$(jl(r.pureId)),l=a.concat(o.substring(o.indexOf(i)+i.length));n.push({pureName:r.pureName,pureType:r.pureType,sourcePackage:o,destinationPackage:l,usages:$(e[t]).second})}return void await(0,O.fl)(this.editorStore.movePackageableElements(n))}default:n=await this.editorStore.findConceptUsages(Zd.ELEMENT,[`'${s.pureId}'`])}}catch(e){return U(e),void this.editorStore.applicationStore.notifyError(e)}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}await(0,O.fl)(this.editorStore.renameConcept(i,t,s.pureType,n))}}class Nh{cached;datamarts;text}(0,Be.yu)(Nh,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)()});class Oh extends Nh{error;sessionError}(0,Be.yu)(Oh,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class Ah extends Oh{RO;line;column;source}(0,Be.yu)(Ah,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class Sh{text;reinit}class yh extends Sh{cache;modifiedFiles=[]}(0,Be.yu)(yh,{text:(0,Be.Ru)(),cache:(0,Be.Ru)(),modifiedFiles:(0,Be.pb)((0,Be.Ru)()),reinit:(0,Be.Ru)()});class Ih extends Sh{RO;line;column;source;error;sessionError}(0,Be.yu)(Ih,{text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class vh{RO;line;column;source}(0,Be.yu)(vh,{RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)()});class Rh extends Sh{jumpTo}(0,Be.yu)(Rh,{text:(0,Be.Ru)(),jumpTo:(0,Be.Ry)(vh)});class Ph{uuid=(0,a.Z)();sourceID;line;column;foundName}(0,Be.yu)(Ph,{sourceID:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),foundName:(0,Be.Ru)()});class wh{uuid=(0,a.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,Be.yu)(wh,{sourceID:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),foundName:(0,Be.Ru)(),add:(0,Be.Ru)(),messageToBeModified:(0,Be.Ru)(),fileToBeModified:(0,Be.Ru)(),lineToBeModified:(0,Be.Ru)(),columnToBeModified:(0,Be.Ru)()});class Lh extends Ih{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,Be.yu)(Lh,{candidateName:(0,Be.Ru)(),candidatesWithPackageImported:(0,Be.pb)((0,Be.Ry)(Ph)),candidatesWithPackageNotImported:(0,Be.pb)((0,Be.Ry)(wh))});class bh extends Ih{candidateName;candidates=[]}(0,Be.yu)(bh,{candidateName:(0,Be.Ru)(),candidates:(0,Be.pb)((0,Be.Ry)(wh))});class Dh{id;parentId;file;line;column}(0,Be.yu)(Dh,{id:(0,Be.Ru)(),parentId:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class Mh{children=[];li_attr;text;type}(0,Be.yu)(Mh,{children:(0,Be.pb)((0,Be.Ry)(Mh)),li_attr:(0,Be.Ry)(Dh),text:(0,Be.Ru)(),type:(0,Be.Ru)()});class kh extends Sh{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,Be.yu)(kh,{count:(0,Be.Ru)(),filterPaths:(0,Be.pb)((0,Be.Ru)()),path:(0,Be.Ru)(),relevantTestsOnly:(0,Be.Ru)(),runnerId:(0,Be.Ru)(),tests:(0,Be.pb)((0,Be.Ry)(Mh))});class Fh{uuid=(0,a.Z)()}class jh{before;found;after}(0,Be.yu)(jh,{after:(0,Be.Ru)(),before:(0,Be.Ru)(),found:(0,Be.Ru)()});class Uh{uuid=(0,a.Z)();sourceId;startLine;startColumn;endLine;endColumn;preview;constructor(e,t,s,i,n){this.sourceId=e,this.startLine=t,this.startColumn=s,this.endLine=i,this.endColumn=n}}(0,Be.yu)(Uh,{sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)(),preview:(0,Be.jt)((0,Be.Ry)(jh))});class Vh extends Fh{sourceId;coordinates=[];constructor(){super(),(0,O.rC)(this,{coordinates:O.LO,dismissCoordinate:O.aD})}setCoordinates(e){this.coordinates=e}dismissCoordinate(e){D(this.coordinates,e)}}(0,Be.yu)(Vh,{sourceId:(0,Be.Ru)(),coordinates:(0,Be.pb)((0,Be.Ry)(Uh))});class Gh{editorStore;constructor(e){this.editorStore=e}}class zh extends Gh{searchEntries=[];constructor(e,t){super(e),(0,O.rC)(this,{searchEntries:O.LO,numberOfFiles:O.Fl,numberOfResults:O.Fl}),this.searchEntries=t}dismissSearchEntry(e){D(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 Bh extends zh{}class $h extends zh{usageConcept;constructor(e,t,s,i){const n=new Map;s.forEach(((e,t)=>{let s;n.has(e.source)?s=$(n.get(e.source)):(s=new Vh,s.sourceId=e.source,n.set(e.source,s));const a=new Uh(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn);a.preview=i.find((t=>t.sourceId===e.source&&t.startLine===e.startLine&&t.startColumn===e.startColumn&&t.endLine===e.endLine&&t.endColumn===e.endColumn))?.preview,s.coordinates.push(a)})),super(e,Array.from(n.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=$(n.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 Hh extends Gh{result;constructor(e,t){super(e),this.result=t}}class Yh extends Gh{result;constructor(e,t){super(e),this.result=t}}var Wh,Kh,Zh;!function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(Wh=Wh||(Wh={}));class Xh{status;test}class qh extends Xh{test=[]}(0,Be.yu)(qh,{status:(0,Be.Ru)(),test:(0,Be.pb)((0,Be.Ru)())});class Jh{text;RO;line;column;source;error}(0,Be.yu)(Jh,{text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)()});class Qh extends Xh{test=[];error}(0,Be.yu)(Qh,{status:(0,Be.Ru)(),test:(0,Be.pb)((0,Be.Ru)()),error:(0,Be.Ry)(Jh)});class eu{}class tu extends eu{finished;tests=[]}(0,Be.yu)(tu,{finished:(0,Be.Ru)(),tests:(0,Be.pb)((0,Be.PG)((()=>Be.AM),(e=>e.error?(0,Be.vB)(Qh,e):(0,Be.vB)(qh,e))))});class su extends eu{error;text}(0,Be.yu)(su,{error:(0,Be.Ru)(),text:(0,Be.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(Kh=Kh||(Kh={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(Zh=Zh||(Zh={}));class iu{_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?Kh.FAILED:this.passed?Kh.PASSED:Kh.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case Wh.PASSED:this.passedTests.add(t);break;case Wh.FAILED:this.failedTests.set(t,W(e,Qh));break;case Wh.ERROR:this.testsWithError.set(t,W(e,Qh));break;default:throw new j(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class nu{editorStore;testExecutionResult;checkTestRunnerState=Et.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=Et.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 $(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({...$(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=$(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?L(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{X(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 iu(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,Be.vB)(su,s):(0,Be.vB)(tu,s);var s;return t instanceof tu?(await Promise.all(t.tests.map((t=>w((()=>{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){U(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!`))}}class au{}class ru extends au{error;errorDialog;text}(0,Be.yu)(ru,{error:(0,Be.Ru)(),errorDialog:(0,Be.Ru)(),text:(0,Be.Ru)()});class ou{networkClient;userId="localuser";sessionId=`${this.userId}@${Date.now()}@abcd`;compilerMode;mode;constructor(e){this.networkClient=e}get baseUrl(){return $(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});getTextSearchPreview=e=>this.networkClient.post(`${this.baseUrl}/getTextSearchPreview`,e);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});getConceptInfo=(e,t,s)=>this.networkClient.get(`${this.baseUrl}/getConceptInfo`,void 0,void 0,{file:e,line:t,column:s});getUsages=async(e,t)=>{const s=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:e,param:t});return Array.isArray(s)?s:[s]};renameConcept=e=>this.networkClient.put(`${this.baseUrl}/renameConcept`,e);movePackageableElements=e=>this.networkClient.put(`${this.baseUrl}/movePackageableElements`,e);getPackageableElementsUsage=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:Zd.MULTIPLE_PATHS,param:[`'${e.join(",")}'`]});return Array.isArray(t)?t:[t]};getChildPackageableElements=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::getChildPackageableElements_String_1__String_MANY_",param:[`'${e}'`]});return(Array.isArray(t)?t:[t]).map((e=>JSON.parse(e)))};updateSource=e=>this.networkClient.put(`${this.baseUrl}/updateSource`,e);createFile=e=>this.networkClient.post(`${this.baseUrl}/newFile/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});createFolder=e=>this.networkClient.post(`${this.baseUrl}/newFolder/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});renameFile=(e,t)=>this.networkClient.put(`${this.baseUrl}/renameFile`,{oldPath:e,newPath:t},void 0);deleteDirectoryOrFile=e=>this.networkClient.delete(`${this.baseUrl}/deleteFile/${e}`,void 0,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 lu{_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 cu,du=s(1367);class hu{_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 Xt([qt.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues),es(this.parameters,this.body)])}}class uu extends gs{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class pu extends uu{ownerReference;constructor(e){const t=fs.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new pu(e)}}class _u{_UUID=(0,a.Z)();rawType;constructor(e){this.rawType=e}}class mu{_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 Xt([qt.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues)])}}class gu{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Xt([qt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new gu(0,0);static ZERO_ONE=new gu(0,1);static ZERO_MANY=new gu(0,void 0);static ONE=new gu(1,1);static ONE_MANY=new gu(1,void 0)}class Eu extends gs{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[qt.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(Zt).join(",")}}class fu extends Eu{ownerReference;constructor(e){const t=fs.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new fu(e)}}class Tu extends os{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new Tu(Ce.STRING);static BOOLEAN=new Tu(Ce.BOOLEAN);static BINARY=new Tu(Ce.BINARY);static NUMBER=new Tu(Ce.NUMBER);static INTEGER=new Tu(Ce.INTEGER);static FLOAT=new Tu(Ce.FLOAT);static DECIMAL=new Tu(Ce.DECIMAL);static DATE=new Tu(Ce.DATE);static STRICTDATE=new Tu(Ce.STRICTDATE);static DATETIME=new Tu(Ce.DATETIME);static STRICTTIME=new Tu(Ce.STRICTTIME);static LATESTDATE=new Tu(Ce.LATESTDATE)}!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(cu=cu||(cu={}));class Cu extends dc{association;constructor(e,t,s,i,n){super(e,s,i,n),this.association=t}get hashCode(){return Xt([Ko.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const xu=()=>new rs(""),Nu=(e,t)=>new mu("",gu.ONE,pu.create(new _u(e)),t),Ou=(0,O.aD)(((e,t)=>{e.value=t})),Au=((0,O.aD)(((e,t)=>{D(e.properties,t)})),(0,O.aD)(((e,t)=>{L(e.properties,wo(t))}))),Su=((0,O.aD)(((e,t,s)=>{b(e.properties,t,s)})),(0,O.aD)(((e,t)=>{D(e.derivedProperties,t)})),(0,O.aD)(((e,t)=>{L(e.derivedProperties,Lo(t))})),(0,O.aD)(((e,t,s)=>{b(e.derivedProperties,t,s)})),(0,O.aD)(((e,t)=>{L(e.constraints,Do(t))})),(0,O.aD)(((e,t)=>{D(e.constraints,t)})),(0,O.aD)(((e,t,s)=>{b(e.constraints,t,s)})),(0,O.aD)(((e,t)=>{L(e.generalizations,Co(t))}))),yu=((0,O.aD)(((e,t)=>{D(e.generalizations,t)})),(0,O.aD)(((e,t,s)=>{b(e.generalizations,t,s)})),(0,O.aD)(((e,t)=>{L(e._subclasses,t)})),(0,O.aD)(((e,t)=>{D(e._subclasses,t)})),(0,O.aD)(((e,t)=>{Co(e),To(t),e.value=t,e.ownerReference.value=t.rawType}))),Iu=((0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{yu(e.genericType,To(t))})),(0,O.aD)(((e,t)=>{e.multiplicity=t})),(0,O.aD)(((e,t)=>{e.aggregation=t})),(0,O.aD)(((e,t)=>{e.value=Oo(t),Ou(e.ownerReference,t._OWNER)})),(0,O.aD)(((e,t)=>{L(e.taggedValues,fo(t))})),(0,O.aD)(((e,t)=>{D(e.taggedValues,t)})),(0,O.aD)(((e,t)=>{L(e.stereotypes,go(t))})),(0,O.aD)(((e,t)=>{D(e.stereotypes,t)})),(0,O.aD)(((e,t)=>{e.tag.value=Ao(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)=>{b(e.taggedValues,t,s)})),(0,O.aD)(((e,t,s)=>{b(e.stereotypes,t,s)})),(0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{e.functionDefinition=Gs(t)})),(0,O.aD)(((e,t)=>{L(e.p_tags,Ao(t))})),(0,O.aD)(((e,t)=>{D(e.p_tags,t)})),(0,O.aD)(((e,t)=>{L(e.p_stereotypes,Oo(t))})),(0,O.aD)(((e,t)=>{D(e.p_stereotypes,t)})),(0,O.aD)(((e,t,s)=>{b(e.p_tags,t,s)})),(0,O.aD)(((e,t,s)=>{b(e.p_stereotypes,t,s)})),(0,O.aD)(((e,t)=>{D(e.parameters,t)})),(0,O.aD)(((e,t)=>{L(e.parameters,zs(t))})),(0,O.aD)(((e,t)=>{Ou(e.returnType,jo(t))})),(0,O.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,O.aD)(((e,t,s)=>{b(e.parameters,t,s)})),(0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{L(e.values,yo(t))})),(0,O.aD)(((e,t)=>{D(e.values,t)})),(0,O.aD)(((e,t,s)=>{b(e.values,t,s)})),(0,O.aD)(((e,t)=>{e.value=yo(t),Ou(e.ownerReference,t._OWNER)})),(0,O.aD)(((e,t,s)=>{const i=((e,t)=>{const s=e.properties.findIndex((e=>e===t));return X(-1!==s,`Can't find property '${t.name}' in association '${e.path}'`),$(e.properties[(s+1)%2])})(e,t),n=W(t.genericType.ownerReference.value,rs,`Association property '${t.name}' must be of type 'class'`);var a;((a=n).package||a.name)&&X(D(n.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${n.path}'`),L(s.propertiesFromAssociations,i);const r=new _u(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,O.aD)(((e,t)=>{e.canonicalUnit=Ro(t)})),(0,O.aD)(((e,t)=>{e.conversionFunction=Gs(t)})),(0,O.aD)(((e,t)=>{e.classViews=t.map(Go)}))),vu=(0,O.aD)(((e,t)=>{L(e.classViews,Go(t))})),Ru=(0,O.aD)(((e,t)=>{D(e.classViews,t)})),Pu=(0,O.aD)(((e,t)=>{e.associationViews=t.map(Ho)})),wu=(0,O.aD)(((e,t)=>{D(e.associationViews,t)})),Lu=(0,O.aD)(((e,t)=>{e.generalizationViews=t.map($o)})),bu=(0,O.aD)(((e,t)=>{L(e.generalizationViews,$o(t))})),Du=(0,O.aD)(((e,t)=>{D(e.generalizationViews,t)})),Mu=(0,O.aD)(((e,t)=>{e.propertyViews=t.map(Yo)})),ku=(0,O.aD)(((e,t)=>{L(e.propertyViews,Yo(t))})),Fu=(0,O.aD)(((e,t)=>{D(e.propertyViews,t)})),ju=(0,O.aD)(((e,t)=>{e.hideProperties=t})),Uu=(0,O.aD)(((e,t)=>{e.hideStereotypes=t})),Vu=(0,O.aD)(((e,t)=>{e.hideTaggedValues=t})),Gu=(0,O.aD)(((e,t)=>{e._offsetX=t})),zu=(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)})),$u=(0,O.aD)(gc),Hu=(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 pc(n.x,n.y).normal(new pc(l.x,l.y)).unit(),d=pc.fromPoints(n,new sc(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 sc(t,s),r.push(o))}e<a.length-2&&r.push(a[e+1])}return o&&n&&mc(e,r),o})),Yu=(0,O.aD)(mc),Wu=(0,O.aD)(((e,t)=>{e.rectangle=t})),Ku=(0,O.aD)(((e,t)=>{e.position=t})),Zu=(0,O.aD)((e=>{e._dummyObservable={}}));var Xu,qu,Ju;!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"}(Xu=Xu||(Xu={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(qu=qu||(qu={})),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"}(Ju=Ju||(Ju={}));const Qu=.05,ep=[50,75,90,100,110,125,150,200,250,300,400],tp=e=>(e instanceof hu?"/ ":"")+e.name;class sp{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 ic(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new sc(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 sc(0,0),this.virtualScreen=new nc(new sc(0,0),new ic(0,0)),this.zoom=1,this.triangle=[new sc(0,0),new sc(-15,-10),new sc(-15,10)],this.diamond=[new sc(0,0),new sc(-10,-5),new sc(-20,0),new sc(-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=Xu.LAYOUT,this.relationshipMode=qu.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 sc(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new sc(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 ic(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new sc(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 sc(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case Xu.LAYOUT:case Xu.PAN:case Xu.ZOOM_IN:case Xu.ZOOM_OUT:case Xu.ADD_CLASS:if(t!==qu.NONE)throw new F(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case Xu.ADD_RELATIONSHIP:if(t===qu.NONE)throw new F("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new j(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===Xu.ADD_RELATIONSHIP)switch(t){case qu.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||Wl(e.class.value).includes(t.class.value)||Wl(t.class.value).includes(e.class.value)||Su(e.class.value,pu.create(new _u(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new uc(this.diagram,e,t);return bu(this.diagram,s),s}};break;case qu.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new mu(`property_${e.class.value.properties.length+1}`,gu.ONE,pu.create(new _u(t.class.value)),e.class.value);if(Au(e.class.value,s),e!==t){const i=new hc(this.diagram,fu.create(s),e,t);return ku(this.diagram,i),i}};break;default:throw new j(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case Ju.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Ku(t,new sc(e,t.position.y))));break}case Ju.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=>Ku(t,new sc(e-t.rectangle.width/2,t.position.y))));break}case Ju.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=>Ku(t,new sc(e-t.rectangle.width,t.position.y))));break}case Ju.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Ku(t,new sc(t.position.x,e))));break}case Ju.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=>Ku(t,new sc(t.position.x,e-t.rectangle.height/2))));break}case Ju.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=>Ku(t,new sc(t.position.x,e-t.rectangle.height))));break}case Ju.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];Ku(s,new sc(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];Ku(n,new sc(i.position.x+i.rectangle.width+s,n.position.y))}}break}case Ju.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];Ku(s,new sc(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];Ku(n,new sc(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 sc((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 sc((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 sc(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new sc(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 sc(t,s)})(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=$(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=cc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof hc){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,Tc(r).x),n=Math.max(n,Tc(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 nc(new sc(t,s),new ic(i-t,n-s))}else this.setZoomLevel(1),this.screenOffset=new sc(0,0),this.virtualScreen=new nc(new sc(this.canvasDimension.width/2,this.canvasDimension.height/2),new ic(0,0))}executeZoom(e,t){e=Math.max(e,Qu);const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)),i=this.zoom;this.setZoomLevel(e),this.screenOffset=new sc(((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,Qu)),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)),Qu))}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 ac(this.diagram,i,fs.create(e));return Ku(n,t??this.canvasCoordinateToModelCoordinate(new sc(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),vu(this.diagram,n),Zu(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)&&bu(this.diagram,new uc(this.diagram,n,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&bu(this.diagram,new uc(this.diagram,t,n)),Kl(e).forEach((e=>{e.genericType.value.rawType===s&&ku(this.diagram,new hc(this.diagram,fu.create(e),n,t))})),Kl(s).forEach((s=>{s.genericType.value.rawType===e&&ku(this.diagram,new hc(this.diagram,fu.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=tp(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 ls&&(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=Ue(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||(Kl(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;Wu(e,new ic(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 Kl(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof hu?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof Tu?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}}Zu(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,n,a){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=tp(e),o=Ue(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 sc(t(l),s(l)));a||this.ctx.fillText(r,u.x,u.y);const p=i(c),_=n(c),m=this.modelCoordinateToCanvasCoordinate(new sc(i(c),n(c)));a||this.ctx.fillText(o,m.x,m.y);const g=new sc(Math.min(d,p),Math.min(h,_));return new nc(g,new ic(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 nc(new sc(0,0),new ic(0,0))}drawPropertyOrAssociation(e){const t=cc.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 mu){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===cu.COMPOSITE||s.aggregation===cu.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+Ec(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+fc(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ec(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+fc(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ec(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+fc(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ec(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+fc(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ec(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+fc(this.diamond[0],e))*this.zoom),s.aggregation===cu.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===cu.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=cc.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+Ec(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+fc(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ec(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+fc(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ec(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+fc(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ec(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+fc(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)&&Yu(e,e.path.map((e=>new sc(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!==Xu.ZOOM_IN?Xu.ZOOM_IN:Xu.ZOOM_OUT,qu.NONE)}switchToViewMode(){this.changeMode(Xu.LAYOUT,qu.NONE)}switchToPanMode(){this.changeMode(Xu.PAN,qu.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(Xu.ADD_RELATIONSHIP,qu.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(Xu.ADD_RELATIONSHIP,qu.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(Xu.ADD_CLASS,qu.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof rs&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new sc(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof rs&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}keydown(e){var t;if(t=e,document.getElementById(Id)?.dispatchEvent(new KeyboardEvent(t.type,t)),"Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{Ru(this.diagram,e),Pu(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Lu(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Mu(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof Cu?wu(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof hc&&Fu(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&Du(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=>{ju(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Uu(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Vu(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=>vu(this.diagram,e))),t[1].forEach((e=>bu(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,du.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new ac(this.diagram,(0,a.Z)(),fs.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=>vu(this.diagram,e))),t[1].forEach((e=>bu(this.diagram,e)))}this.drawScreen()}}mouseup(e){if(!this.isReadOnly)switch(this.interactionMode){case Xu.LAYOUT:this.diagram.generalizationViews.forEach((e=>$u(e))),this.diagram.associationViews.forEach((e=>$u(e))),this.diagram.propertyViews.forEach((e=>$u(e)));break;case Xu.ADD_CLASS:{const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new sc(e.x,e.y)));this.onAddClassViewClick(t),this.changeMode(Xu.LAYOUT,qu.NONE);break}case Xu.ZOOM_IN:{const t=Math.round(100*this.zoom);let s;s=t<=ep[0]-10?10*Math.floor(t/10)+10:t>=ep[ep.length-1]?100*Math.floor(t/100)+100:$(ep.find((e=>e>t))),this.zoomPoint(s/100,new sc(e.x,e.y));break}case Xu.ZOOM_OUT:{const t=Math.round(100*this.zoom);let s;s=t<=ep[0]?10*Math.ceil(t/10)-10:t>=ep[ep.length-1]+100?100*Math.ceil(t/100)-100:$((0,kl.Z)(ep,(e=>e<t))),this.zoomPoint(s/100,new sc(e.x,e.y));break}case Xu.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new sc(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&&(Gu(e.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),zu(e.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),Gu(e.to,-(s.position.x+s.rectangle.width/2-t.x)),zu(e.to,-(s.position.y+s.rectangle.height/2-t.y)))}}this.changeMode(Xu.LAYOUT,qu.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){if([Xu.ADD_RELATIONSHIP,Xu.ADD_CLASS,Xu.ZOOM_IN,Xu.ZOOM_OUT].includes(this.interactionMode))return;const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new sc(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 sc(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case Xu.PAN:return void(this.positionBeforeLastMove=new sc(e.x,e.y));case Xu.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(Cc(t).contains(s.x,s.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||Iu(this.diagram,this.reorderDiagramDomain($(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||Iu(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 sc(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=Hu(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=Hu(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=Hu(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 Xu.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(Xu.LAYOUT,qu.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=new sc(e.x,e.y));if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=new sc(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 sc(e.x,e.y))}mousemove(e){if(this.cursorPosition=new sc(e.x,e.y),this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===Xu.PAN)this.screenOffset=new sc(this.screenOffset.x+(e.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(e.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=new sc(e.x,e.y),this.clearScreen(),this.drawAll();else if(this.leftClick){const t=this.eventCoordinateToCanvasCoordinate(new sc(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);switch(this.interactionMode){case Xu.LAYOUT:if(this.selectedClassCorner&&(Wu(this.selectedClassCorner,new ic(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),Zu(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,Ku(i,new sc(n,r)),Zu(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 nc(new sc(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new ic(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(xc(this.selection,e)||xc(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case Xu.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 sc(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),Cc(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 nc(this.modelCoordinateToCanvasCoordinate(new sc(e.position.x+(e.rectangle.width-a)/2,n)),new ic(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 Kl(i))this.hasPropertyView(e,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new nc(this.modelCoordinateToCanvasCoordinate(new sc(e.position.x+this.classViewSpaceX,n)),new ic(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=cc.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,du.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new ac(t,(0,a.Z)(),fs.create(Yl(e.value,rs))))))),(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)&&(Ku(t[0],new sc(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];Ku(e,new sc(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 uc(t,s,e):[]))))))]}}class ip{_UUID=(0,a.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return Xt([qt.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class np extends gs{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[qt.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Zt).join(",")}}class ap extends np{ownerReference;constructor(e){const t=fs.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new ap(e)}}class rp extends gs{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[qt.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Zt).join(",")}}class op extends rp{ownerReference;constructor(e){const t=fs.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new op(e)}}class lp extends ns{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[Nu(xu(),xu()),Nu(xu(),xu())];t[0]._OWNER=this,t[1]._OWNER=this,this.properties=t}get _elementHashCode(){return Xt([qt.ASSOCIATION,this.path,Xt(this.properties),Xt(this.derivedProperties),Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class cp extends ns{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return Xt([qt.MAPPING,this.path,Xt(this.classMappings),Xt(this.enumerationMappings),Xt(this.associationMappings),Xt(this.test),Xt(this.includes),Xt(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class dp extends ns{p_stereotypes=[];p_tags=[];get _elementHashCode(){return Xt([qt.PROFILE,this.path,Xt(this.p_stereotypes.map((e=>e.value))),Xt(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class hp extends ns{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];postValidations=[];get patternParameters(){return(0,Ze.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return Xt([qt.SERVICE,Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues),this.path,this.pattern,Xt(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",Xt(this.tests),Xt(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class up extends ns{functionName;constructor(e){super(e),this.functionName=e}}class pp extends up{}class _p extends pp{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return Xt([qt.FUNCTION,this.path,Xt(this.parameters),this.returnType.valueForSerialization??"",Xt(this.taggedValues),Xt(this.stereotypes.map((e=>e.pointerHashCode))),es(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class mp extends ns{includes=[]}class gp extends mp{sections=[];get _elementHashCode(){return Xt([qt.FLAT_DATA,this.path,Xt(this.includes.map((e=>e.valueForSerialization??""))),Xt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class Ep extends ns{runtimeValue;get _elementHashCode(){return Xt([qt.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class fp extends ns{connectionValue;get _elementHashCode(){return Xt([qt.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class Tp extends ns{}class Cp extends Tp{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return Xt([qt.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",Xt(this.scopeElements.map((e=>e instanceof Es?e.valueForSerialization??"":e))),Xt(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class xp extends ns{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return Xt([qt.GENERATION_TREE,this.path,Xt(this.generationNodes),Xt(this.fileGenerations.map((e=>ts(we.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class Np extends mp{schemas=[];joins=[];filters=[];get _elementHashCode(){return Xt([qt.DATABASE,this.path,Xt(this.includes.map((e=>e.valueForSerialization??""))),Xt(this.schemas),Xt(this.joins),Xt(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class Op{_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 Ap extends ns{data;get hashCode(){return Xt([qt.DATA_ELEMENT,this.path,Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}const Sp=new Set([ns,as,os,Tu,rs,lp,ls,_p,dp,ds,cs,class extends ns{sections=[];get _elementHashCode(){return Xt([qt.SECTION_INDEX,this.path,Xt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}},mp,cp,fp,Ep,hp,xp,Cp,Ap]);class yp{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 hs(e),this.extensions=this.createGraphExtensions(t)}createGraphExtensions(e){return e.map((e=>{if(Sp.has(e))throw new F("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new Op(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(H(ls))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(H(ds))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(H(rs))}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(H(gp))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(H(Np))}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 j("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new F("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 rs?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof ls?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof ds?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=>$(this.getOwnNullableSectionIndex(e),`Can't find section index '${e}'`);getOwnProfile=e=>$(this.getOwnNullableProfile(e),`Can't find profile '${e}'`);getOwnType=e=>$(this.getOwnNullableType(e),`Can't find type '${e}'`);getOwnClass=e=>$(this.getOwnNullableClass(e),`Can't find class '${e}'`);getOwnEnumeration=e=>$(this.getOwnNullableEnumeration(e),`Can't find enumeration '${e}'`);getOwnMeasure=e=>$(this.getOwnNullableMeasure(e),`Can't find measure '${e}'`);getOwnAssociation=e=>$(this.getOwnNullableAssociation(e),`Can't find association '${e}'`);getOwnFunction=e=>$(this.getOwnNullableFunction(e),`Can't find function '${e}'`);getOwnStore=e=>$(this.getOwnNullableStore(e),`Can't find store '${e}'`);getOwnDatabase=e=>W(this.getOwnNullableStore(e),Np,`Can't find database '${e}'`);getOwnFlatDataStore=e=>W(this.getOwnNullableStore(e),gp,`Can't find flat-data store '${e}'`);getOwnMapping=e=>$(this.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getOwnConnection=e=>$(this.getOwnNullableConnection(e),`Can't find connection '${e}'`);getOwnRuntime=e=>$(this.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getOwnService=e=>$(this.getOwnNullableService(e),`Can't find service '${e}'`);getOwnGenerationSpecification=e=>$(this.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getOwnFileGeneration=e=>$(this.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getOwnDataElement=e=>$(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=>w((()=>{e.dispose()})))))}getNullablePackage=e=>e?V((()=>$l(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){Gl(t?Hl(this,t,void 0):this.root,e),e instanceof cp?this.setOwnMapping(e.path,e):e instanceof mp?this.setOwnStore(e.path,e):e instanceof as?this.setOwnType(e.path,e):e instanceof lp?this.setOwnAssociation(e.path,e):e instanceof dp?this.setOwnProfile(e.path,e):e instanceof _p?this.setOwnFunction(e.path,e):e instanceof hp?this.setOwnService(e.path,e):e instanceof fp?this.setOwnConnection(e.path,e):e instanceof Ep?this.setOwnRuntime(e.path,e):e instanceof Cp?this.setOwnFileGeneration(e.path,e):e instanceof xp?this.setOwnGenerationSpecification(e.path,e):e instanceof Ap?this.setOwnDataElement(e.path,e):e instanceof hs||this.getExtensionForElementClass(I(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&zl(e.package,e),e instanceof cp?this.mappingsIndex.delete(e.path):e instanceof mp?this.storesIndex.delete(e.path):e instanceof as?(this.typesIndex.delete(e.path),e instanceof ds&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof lp?this.associationsIndex.delete(e.path):e instanceof dp?this.profilesIndex.delete(e.path):e instanceof _p?this.functionsIndex.delete(e.path):e instanceof hp?this.servicesIndex.delete(e.path):e instanceof Ep?this.runtimesIndex.delete(e.path):e instanceof fp?this.connectionsIndex.delete(e.path):e instanceof Cp?this.fileGenerationsIndex.delete(e.path):e instanceof xp?this.generationSpecificationsIndex.delete(e.path):e instanceof Ap?this.dataElementsIndex.delete(e.path):e instanceof hs?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 j(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof hs&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof hs)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new j(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new j(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,n]=Ul(s);if(!(e instanceof hs)){const t=this.getNullablePackage(i)??(""!==i?Hl(this,i,void 0):this.root);e.name=n,e instanceof _p&&(e.functionName=(a=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Zl(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Zl(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(a))))),e.package!==t&&(e.package&&zl(e.package,e),Gl(t,e))}var a,r;if(e instanceof cp)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof mp)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof as)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof ds&&(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 lp)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof dp)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof _p)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof hp)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof Ep)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof fp)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof Cp)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof Ap)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof xp)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof hs){const a=new Map;if(e.children.forEach((e=>{a.set(e.path,e)})),e.name=n,!e.package)throw new F("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){zl(r,e);const t=""!==i?Hl(this,i,void 0):this.root;Gl(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 Ip extends yp{constructor(e,t){super(Te.PROJECT_DEPENDENCY_ROOT,e),this.root=t}}const vp=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class Rp{root=new hs(Te.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 Ip(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=vp(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=vp(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=vp(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=vp(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=vp(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=vp(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=vp(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=vp(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=vp(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=vp(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=vp(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=vp(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=vp(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=vp(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=vp(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=vp(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 $(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 Pp extends mp{static NAME="ModelStore";static INSTANCE=new Pp;constructor(){super(Pp.NAME)}accept_PackageableElementVisitor(e){throw new j}}class wp extends yp{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(Te.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(Pp.NAME,Pp.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[Tu.STRING,Tu.BOOLEAN,Tu.BINARY,Tu.NUMBER,Tu.INTEGER,Tu.FLOAT,Tu.DECIMAL,Tu.DATE,Tu.STRICTDATE,Tu.DATETIME,Tu.STRICTTIME,Tu.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class Lp extends yp{autoImports=[];constructor(e){super(Te.SYSTEM,e)}initializeAutoImports(){this.autoImports=Ae.map((e=>W(this.getOwnNullableElement(e,!0),hs,`Can't find auto-import package '${e}'`)))}}class bp extends yp{constructor(e){super(Te.MODEL_GENERATION,e)}}class Dp extends yp{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(Te.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new bp(i),this.dependencyManager=new Rp(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=>$(this.coreModel.primitiveTypesIndex.get(e),`Can't find primitive type '${e}'`);getType=e=>$(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=>$(this.getOwnNullableProfile(e)??this.generationModel.getOwnNullableProfile(e)??this.dependencyManager.getOwnNullableProfile(e)??this.systemModel.getOwnNullableProfile(e),`Can't find profile '${e}'`);getEnumeration=e=>W(this.getType(e),ls,`Can't find enumeration '${e}'`);getMeasure=e=>W(this.getType(e),ds,`Can't find measure '${e}'`);getUnit=e=>W(this.getType(e),cs,`Can't find unit '${e}'`);getClass=e=>W(this.getType(e),rs,`Can't find class '${e}'`);getAssociation=e=>$(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e),`Can't find association '${e}'`);getPropertyOwner=e=>$(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e)??W(this.getType(e),rs),`Can't find property owner '${e}'`);getFunction=e=>W(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),_p,`Can't find function '${e}'`);getStore=e=>$(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=>W(this.getStore(e),gp,`Can't find flat-data store '${e}'`);getDatabase=e=>W(this.getStore(e),Np,`Can't find database store '${e}'`);getMapping=e=>$(this.getOwnNullableMapping(e)??this.generationModel.getOwnNullableMapping(e)??this.dependencyManager.getOwnNullableMapping(e)??this.systemModel.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getService=e=>$(this.getOwnNullableService(e)??this.generationModel.getOwnNullableService(e)??this.dependencyManager.getOwnNullableService(e)??this.systemModel.getOwnNullableService(e),`Can't find service '${e}'`);getConnection=e=>$(this.getOwnNullableConnection(e)??this.generationModel.getOwnNullableConnection(e)??this.dependencyManager.getOwnNullableConnection(e)??this.systemModel.getOwnNullableConnection(e),`Can't find connection '${e}'`);getRuntime=e=>$(this.getOwnNullableRuntime(e)??this.generationModel.getOwnNullableRuntime(e)??this.dependencyManager.getOwnNullableRuntime(e)??this.systemModel.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getGenerationSpecification=e=>$(this.getOwnNullableGenerationSpecification(e)??this.generationModel.getOwnNullableGenerationSpecification(e)??this.dependencyManager.getOwnNullableGenerationSpecification(e)??this.systemModel.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getFileGeneration=e=>$(this.getOwnNullableFileGeneration(e)??this.generationModel.getOwnNullableFileGeneration(e)??this.dependencyManager.getOwnNullableFileGeneration(e)??this.systemModel.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getDataElement=e=>$(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 $(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)=>$(this.getNullableElement(e,t),`Can't find element '${e}'`);getNullableClass=e=>V((()=>this.getClass(e)));getNullableMapping=e=>V((()=>this.getMapping(e)));getNullableService=e=>V((()=>this.getService(e)));getNullableRuntime=e=>V((()=>this.getRuntime(e)));getNullableFileGeneration=e=>V((()=>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=gu.ONE:0===e&&1===t?s=gu.ZERO_ONE:0===e&&void 0===t?s=gu.ZERO_MANY:1===e&&void 0===t?s=gu.ONE_MANY:0===e&&0===t&&(s=gu.ZERO),s??new gu(e,t)}addElement(e,t){const s=Vl(t??"",e.name);if(this.getNullableElement(s,!1))throw new F(`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 F(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class Mp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class kp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Fp{sourceId;line;column;startLine;startColumn;endLine;endColumn}(0,Be.yu)(Fp,{column:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)(),line:(0,Be.Ru)(),sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)()});const jp=(0,Be.PG)((()=>Be.AM),(e=>(e.sourceId=e.source,(0,Be.vB)(Fp,e))));class Up{package;name;tags=[];stereotypes=[]}(0,Be.yu)(Up,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ru)()),tags:(0,Be.pb)((0,Be.Ru)())});class Vp{profile;value}(0,Be.yu)(Vp,{profile:(0,Be.Ru)(),value:(0,Be.Ru)()});class Gp{profile;value}(0,Be.yu)(Gp,{profile:(0,Be.Ru)(),value:(0,Be.Ru)()});class zp{tag;value}(0,Be.yu)(zp,{tag:(0,Be.Ry)(Gp),value:(0,Be.Ru)()});class Bp{rawType;typeParameter}(0,Be.yu)(Bp,{rawType:(0,Be.jt)((0,Be.Ru)()),typeParameter:(0,Be.jt)((0,Be.Ru)())});class $p{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,Be.yu)($p,{aggregation:(0,Be.Ru)(),genericType:(0,Be.Ry)(Bp),multiplicity:(0,Be.Ru)(),name:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ry)(Vp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp))});class Hp{package;name;sourceInformation}(0,Be.yu)(Hp,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),sourceInformation:jp});class Yp{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,Be.yu)(Yp,{generalizations:(0,Be.pb)((0,Be.Ry)(Bp)),name:(0,Be.Ru)(),package:(0,Be.Ru)(),properties:(0,Be.pb)((0,Be.Ry)($p)),qualifiedProperties:(0,Be.pb)((0,Be.Ry)($p)),sourceInformation:jp,stereotypes:(0,Be.pb)((0,Be.Ry)(Vp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp))});class Wp{package;name;enumValues=[]}(0,Be.yu)(Wp,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),enumValues:(0,Be.pb)((0,Be.Ru)())});class Kp{x;y}(0,Be.yu)(Kp,{x:(0,Be.Ru)(),y:(0,Be.Ru)()});class Zp{height;width}(0,Be.yu)(Zp,{height:(0,Be.Ru)(),width:(0,Be.Ru)()});class Xp{points=[]}(0,Be.yu)(Xp,{points:(0,Be.pb)((0,Be.Ry)(Kp))});class qp{id;source;target;geometry}(0,Be.yu)(qp,{geometry:(0,Be.Ry)(Xp),id:(0,Be.Ru)(),source:(0,Be.Ru)(),target:(0,Be.Ru)()});class Jp{name;owningType}(0,Be.yu)(Jp,{name:(0,Be.Ru)(),owningType:(0,Be.Ru)()});class Qp{id;source;target;property;geometry}(0,Be.yu)(Qp,{geometry:(0,Be.Ry)(Xp),id:(0,Be.Ru)(),property:(0,Be.Ry)(Jp),source:(0,Be.Ru)(),target:(0,Be.Ru)()});class e_{id;type;position;rectangleGeometry}(0,Be.yu)(e_,{id:(0,Be.Ru)(),position:(0,Be.Ry)(Kp),rectangleGeometry:(0,Be.Ry)(Zp),type:(0,Be.Ru)()});class t_{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,Be.yu)(t_,{name:(0,Be.Ru)(),generalizationViews:(0,Be.pb)((0,Be.Ry)(qp)),package:(0,Be.Ru)(),propertyViews:(0,Be.pb)((0,Be.Ry)(Qp)),sourceInformation:jp,stereotypes:(0,Be.pb)((0,Be.Ry)(Vp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp)),typeViews:(0,Be.pb)((0,Be.Ry)(e_))});class s_{classes=[];enumerations=[];profiles=[]}(0,Be.yu)(s_,{classes:(0,Be.pb)((0,Be.Ry)(Yp)),enumerations:(0,Be.pb)((0,Be.Ry)(Wp)),profiles:(0,Be.pb)((0,Be.Ry)(Up))});class i_{name;diagram;domainInfo}(0,Be.yu)(i_,{diagram:(0,Be.Ry)(t_),name:(0,Be.Ru)(),domainInfo:(0,Be.jt)((0,Be.Ry)(s_))});class n_{class;enumerations=[];profiles=[];specializations=[]}(0,Be.yu)(n_,{class:(0,Be.Ry)(Yp),enumerations:(0,Be.pb)((0,Be.Ry)(Wp)),profiles:(0,Be.pb)((0,Be.Ry)(Up)),specializations:(0,Be.pb)((0,Be.Ry)(Hp))});const a_=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}`},r_=(e,t,s,i)=>{const n=t.getOwnNullableClass(e);if(!n){const[n,a]=Ul(e),r=new rs(a);return Gl($l(t.root,n,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return n},o_=e=>{if("*"===e)return new gu(0,void 0);{const t=e.split("..");if(1===t.length)return new gu(parseInt($(t[0]),10),parseInt($(t[0]),10));if(2===t.length)return new gu(parseInt($(t[0]),10),"*"===t[1]?void 0:parseInt($(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},l_=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,n;L(e.taggedValues,new ip(ap.create((i=s.getProfile(t.tag.profile),n=t.tag.value,$(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;L(e.stereotypes,op.create((i=s.getProfile(t.profile),n=t.value,$(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=r_($(t.rawType),s,i,void 0);L(e.generalizations,pu.create(new _u(n))),L(n._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const n=new mu(t.name,o_(t.multiplicity),pu.create(new _u(s.getOwnNullableEnumeration($(t.genericType.rawType))??r_($(t.genericType.rawType),s,i,void 0))),e);n.aggregation="Composite"===t.aggregation?cu.COMPOSITE:"Shared"===t.aggregation?cu.SHARED:void 0,L(e.properties,n)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{L(e.derivedProperties,new hu(t.name,o_(t.multiplicity),pu.create(new _u(s.getOwnNullableEnumeration($(t.genericType.rawType))??r_($(t.genericType.rawType),s,i,void 0))),e))}))},c_=e=>{const t=new Dp(new wp([]),new Lp([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new rs(e.name);Gl($l(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 dp(e.name);Gl($l(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>L(s.p_tags,new Mp(s,e)))),e.stereotypes.forEach((e=>L(s.p_stereotypes,new kp(s,e))))})),i.enumerations.forEach((e=>{const s=new ls(e.name);Gl($l(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":ge}${e.name}`,n=t.getClass(i);l_(n,e,t,s)}))}const i=e.diagram,n=new Zo(i.name);return Gl($l(t.root,i.package,!0,new Map),n),i.typeViews.forEach((e=>{const s=new ac(n,e.id,fs.create(t.getClass(e.type)));s.position=new sc(e.position.x,e.position.y),s.rectangle=new ic(e.rectangleGeometry.width,e.rectangleGeometry.height),L(n.classViews,s)})),i.propertyViews.forEach((e=>{const s=new hc(n,fu.create((i=t.getClass(e.property.owningType),a=e.property.name,$(i instanceof rs?Kl(i).find((e=>e.name===a)):i.properties.find((e=>e.name===a)),`Can't find property '${a}' of '${i.path}'`))),$(n.classViews.find((t=>t.id===e.source))),$(n.classViews.find((t=>t.id===e.target))));var i,a;s.path=e.geometry.points.map((e=>new sc(e.x,e.y))),gc(s),L(n.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new uc(n,$(n.classViews.find((t=>t.id===e.source))),$(n.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new sc(e.x,e.y))),gc(t),L(n.generalizationViews,t)})),[n,t,s]};class d_ extends th{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]=c_(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return Hd(this.diagramPath)}get description(){return`Diagram: ${Hd(this.diagramPath)}`}get diagramName(){return Fl(this.diagramPath)}match(e){return e instanceof d_&&this.diagramPath===e.diagramPath}get renderer(){return $(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 Xu.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case Xu.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case Xu.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case Xu.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]=c_(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 Wd(t.sourceId,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?"":ge}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new dp(e.name);Gl($l(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>L(s.p_tags,new Mp(s,e)))),e.stereotypes.forEach((e=>L(s.p_stereotypes,new kp(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":ge}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new ls(e.name);Gl($l(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,n=`${i.package}${""===i.package?"":ge}${i.name}`;let a=t.getOwnNullableClass(n);a||(a=new rs(i.name),Gl($l(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=$(a),n=r_($(`${e.package}${""===e.package?"":ge}${e.name}`),t,s,e.sourceInformation);L(i._subclasses,n),n.generalizations.map((e=>e.value.rawType)).includes(i)||L(n.generalizations,pu.create(new _u(i)))})),r&&l_(a,i,t,s),a})((0,Be.vB)(n_,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:ah.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:ah.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:ah.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:ah.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[ah.RECENTER,ah.USE_ZOOM_TOOL,ah.USE_VIEW_TOOL,ah.USE_PAN_TOOL].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class h_{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 u_ extends M{}class p_{applicationStore;initState=Et.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=kd.CONSOLE;auxPanelDisplayState=new lu({initial:0,default:300,snap:100});activeActivity=Md.CONCEPT;sideBarDisplayState=new lu({initial:300,default:300,snap:150});tabManagerState=new sh(this);executionState=Et.create();navigationStack=[];consoleText;fileSearchCommandLoadingState=Et.create();fileSearchCommandState=new h_;openFileSearchCommand=!1;fileSearchCommandResults=[];textSearchCommandLoadingState=Et.create();textSearchCommandState=new h_;openTextSearchCommand=!1;searchState;testRunState=Et.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,command:O.ls,findUsages:O.ls,renameConcept:O.ls,movePackageableElements:O.ls,updateFileUsingSuggestionCandidate:O.ls,updateFile:O.ls,searchFile:O.ls,searchText:O.ls,createNewDirectory:O.ls,createNewFile:O.ls,renameFile:O.ls,deleteDirectoryOrFile:O.ls}),this.applicationStore=e,this.directoryTreeState=new Ch(this),this.conceptTreeState=new xh(this),this.client=new ou(new pe({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,Be.vB)(Ah,n):(0,Be.vB)(Oh,n):(0,Be.vB)(Nh,n);o.text&&(this.setConsoleText(o.text),this.setActiveAuxPanelMode(kd.CONSOLE),this.auxPanelDisplayState.open()),o instanceof Oh?o.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof Ah&&(yield(0,O.fl)(this.loadFile(o.source,new Kd(o.source,o.line,o.column,new u_((o.text??"").split("\n").filter(Boolean)[0]))))):(t&&(yield t()),yield Promise.all([i,a,r]))}catch(e){return U(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:ih.SEARCH_FILE,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:ih.SEARCH_TEXT,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenTextSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:ih.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof hh&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,!0)}}),this.applicationStore.commandCenter.registerCommand({key:ih.TOGGLE_AUX_PANEL,trigger:()=>this.initState.hasSucceeded,action:()=>this.auxPanelDisplayState.toggle()}),this.applicationStore.commandCenter.registerCommand({key:ih.EXECUTE,action:()=>{(0,O.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:ih.FULL_RECOMPILE,action:()=>{(0,O.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:ih.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,O.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:ih.RUN_ALL_TESTS,action:()=>{(0,O.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:ih.RUN_RELAVANT_TESTS,action:()=>{(0,O.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[ih.SEARCH_FILE,ih.SEARCH_TEXT,ih.GO_TO_FILE,ih.TOGGLE_AUX_PANEL,ih.EXECUTE,ih.FULL_RECOMPILE,ih.FULL_RECOMPILE_WITH_FULL_INIT,ih.RUN_ALL_TESTS,ih.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 d_&&e.diagramPath===t));n||(yield(0,O.fl)(this.checkIfSessionWakingUp()),n=new d_(this,(0,Be.vB)(i_,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 hh&&t.filePath===e));s||(yield(0,O.fl)(this.checkIfSessionWakingUp()),s=new hh(this,(0,Be.vB)(Yd,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof Kd&&s.showError(t))}*reloadFile(e){const t=[];yield Promise.all(this.tabManagerState.tabs.map((async s=>{if(s instanceof hh&&s.filePath===e)s.setFile((0,Be.vB)(Yd,await this.client.getFile(e)));else if(s instanceof d_&&s.filePath===e)try{s.rebuild((0,Be.vB)(i_,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 zh||this.setSearchState(void 0),this.executionState.inProgress();try{const r=this.tabManagerState.tabs.map((e=>e instanceof hh?{path:e.filePath,code:e.file.content}:e instanceof d_?{diagram:e.diagramPath,code:a_(e.diagram)}:void 0)).filter(z),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=$(c)).error?a.candidateName&&a.PureUnmatchedFunctionException?(0,Be.vB)(Lh,a):a.candidateName&&a.candidates?(0,Be.vB)(bh,a):(0,Be.vB)(Ih,a):a.jumpTo?(0,Be.vB)(Rh,a):a.tests?(0,Be.vB)(kh,a):(0,Be.vB)(yh,a);this.applicationStore.setBlockingAlert(void 0),n?.avoidUpdatingConsoleText||this.setConsoleText(h.text),h instanceof Ih?(this.applicationStore.notifyWarning("Execution failed!"),h.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:h.sessionError}):yield(0,O.fl)(i(h))):h instanceof yh?(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 Ih)yield(0,O.fl)(this.loadFile(e.source,new Kd(e.source,e.line,e.column,new u_(e.text.split("\n").filter(Boolean)[0])))),e instanceof Lh?(this.setSearchState(new Hh(this,e)),this.setActiveAuxPanelMode(kd.SEARCH_RESULT),this.auxPanelDisplayState.open()):e instanceof bh&&(this.setSearchState(new Yh(this,e)),this.setActiveAuxPanelMode(kd.SEARCH_RESULT),this.auxPanelDisplayState.open());else if(e instanceof yh&&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! (reason: VCS required)"):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 Ih)await(0,O.fl)(this.loadFile(e.source,new Kd(e.source,e.line,e.column,new u_(e.text.split("\n").filter(Boolean)[0])))),this.setActiveAuxPanelMode(kd.CONSOLE),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof kh){this.setActiveAuxPanelMode(kd.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new nu(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 Rh&&await(0,O.fl)(this.loadFile(e.jumpTo.source,new Wd(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(Md.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:vt.CAUTION,actions:[{label:"Perform full re-compile",type:Rt.PROCEED_WITH_CAUTION,handler:()=>{(0,O.fl)(this.executeSaveAndReset(e)).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Rt.PROCEED,default:!0}]})}*refreshTrees(){yield Promise.all([this.directoryTreeState.refreshTreeData(),this.conceptTreeState.refreshTreeData()])}async revealConceptInTree(e){const t="Error revealing concept. Please make sure that the code compiles and that you are looking for a valid concept";let s;try{s=await this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning(t)}if(s.path){this.applicationStore.setBlockingAlert({message:"Revealing concept in tree...",showLoading:!0});try{this.activeActivity!==Md.CONCEPT&&this.setActiveActivity(Md.CONCEPT);const e=s.path.split(ge);let t=$(e[0]),i=$(this.conceptTreeState.getTreeData().nodes.get(t));for(let s=1;s<e.length;++s)t=`${t}::${e[s]}`,this.conceptTreeState.getTreeData().nodes.get(t)||await(0,O.fl)(this.conceptTreeState.expandNode(i)),i=$(this.conceptTreeState.getTreeData().nodes.get(t));this.conceptTreeState.setSelectedNode(i)}catch{this.applicationStore.notifyWarning(t)}finally{this.applicationStore.setBlockingAlert(void 0)}}}*command(e){try{const s=(t=yield e()).error?(0,Be.vB)(ru,t):new au;return!(s instanceof ru&&(s.errorDialog?this.applicationStore.notifyWarning(`Error: ${s.text}`):this.setConsoleText(s.text),1))}catch(e){return U(e),this.applicationStore.notifyError(e),!1}var t}async getConceptInfo(e){try{return this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning("Can't find concept info. Please make sure that the code compiles and that you are looking for references of non primitive types!")}}async findConceptUsages(e,t){return(await this.client.getUsages(e,t)).map((e=>(0,Be.vB)(qd,e)))}*findUsages(e){const t=yield this.getConceptInfo(e);if(t)try{this.applicationStore.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${Xd(t)}`,showLoading:!0});const e=yield this.findConceptUsages(t.pureType===Ud.ENUM_VALUE?Zd.ENUM:t.pureType===Ud.PROPERTY||t.pureType===Ud.QUALIFIED_PROPERTY?Zd.PROPERTY:Zd.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`)),s=(yield this.client.getTextSearchPreview(e.map((e=>(0,Be.qC)(Uh,new Uh(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn)))))).map((e=>(0,Be.vB)(Uh,e)));this.setSearchState(new $h(this,t,e,s)),this.setActiveAuxPanelMode(kd.SEARCH_RESULT),this.auxPanelDisplayState.open()}catch(e){U(e),this.applicationStore.notifyError(e)}finally{this.applicationStore.setBlockingAlert(void 0)}}*renameConcept(e,t,s,i){try{yield this.client.renameConcept({oldName:e,newName:t,pureType:s,sourceInformations:i.map((e=>({sourceId:e.source,line:e.line,column:e.column})))});const n=i.map((e=>e.source));for(const e of n)yield(0,O.fl)(this.reloadFile(e));yield(0,O.fl)(this.refreshTrees()),this.setConsoleText("Sucessfully renamed concept. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError(`Can't rename concept '${e}'`)}}*movePackageableElements(e){try{yield this.client.movePackageableElements(e.map((e=>({pureName:e.pureName,pureType:e.pureType,sourcePackage:e.sourcePackage,destinationPackage:e.destinationPackage,sourceInformations:e.usages.map((e=>({sourceId:e.source,line:e.line,column:e.column})))}))));const t=(0,Ze.Z)(e.flatMap((e=>e.usages.map((e=>e.source)))));for(const e of t)yield(0,O.fl)(this.reloadFile(e));yield(0,O.fl)(this.refreshTrees()),this.setConsoleText("Sucessfully moved packageble elements. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError("Can't move packageable elements")}}*updateFileUsingSuggestionCandidate(e){this.setSearchState(void 0),yield(0,O.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActiveAuxPanelMode(kd.CONSOLE),this.auxPanelDisplayState.open()}*updateFile(e,t,s,i,n){try{const a=yield this.client.updateSource([{path:e,line:t,column:s,message:n,add:i}]);if(a.modifiedFiles.length)for(const e of a.modifiedFiles)yield(0,O.fl)(this.reloadFile(e));this.setConsoleText("Sucessfully updated file. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError(`Can't update file: ${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(kd.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,Be.vB)(Vh,e))(e)));this.setSearchState(new Bh(this,e)),this.textSearchCommandLoadingState.pass()}catch(e){U(e),this.applicationStore.notifyError(e),this.textSearchCommandLoadingState.fail()}}}*createNewDirectory(e){try{yield(0,O.fl)(this.command((()=>this.client.createFolder(Hd(e))))),yield(0,O.fl)(this.directoryTreeState.refreshTreeData())}catch(e){U(e),this.applicationStore.notifyError(e)}}*createNewFile(e){try{const t=yield(0,O.fl)(this.command((()=>this.client.createFile(Hd(e)))));yield(0,O.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,O.fl)(this.loadFile(e)))}catch(e){U(e),this.applicationStore.notifyError(e)}}*renameFile(e,t){try{yield(0,O.fl)(this.command((()=>this.client.renameFile(e,t)))),yield(0,O.fl)(this.directoryTreeState.refreshTreeData());const s=this.tabManagerState.tabs.find((t=>t instanceof hh&&t.filePath===e));s&&this.tabManagerState.closeTab(s)}catch(e){U(e),this.applicationStore.notifyError(e)}}*deleteDirectoryOrFile(e,t,s){const i=async()=>{await(0,O.fl)(this.command((()=>this.client.deleteDirectoryOrFile(Hd(e))))),this.tabManagerState.tabs.filter((s=>s instanceof hh&&(t?s.filePath.startsWith(`${e}/`):s.filePath===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:vt.CAUTION,actions:[{label:"Delete anyway",type:Rt.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Rt.PROCEED,default:!0}]})}}const __=(0,nt.createContext)(void 0),m_=({children:e})=>{const t=kt(),s=(0,it.fv)((()=>new p_(t)));return(0,x.jsx)(__.Provider,{value:s,children:e})},g_=()=>$((0,nt.useContext)(__),"Can't find editor store in context"),E_=(0,it.Pi)((()=>{const e=g_();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)(dd,{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"})})]})})})})]})})),f_=(0,it.Pi)((e=>{const{searchState:t,searchEntry:s}=e,i=g_(),n=kt(),a=e=>()=>(0,O.fl)(i.loadFile(s.sourceId,new Wd(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)(Zc.QqN,{})}),(0,x.jsx)("div",{className:"search-panel__entry__header__title__content",children:Hd(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)(Zc.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.jsxs)("div",{className:"search-panel__entry__content__item__label search-panel__entry__content__item__label--full",title:"Go to Result",onClick:a(e),children:[e.preview&&(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__content",children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__coordinates",children:`[${e.startLine}:${e.startColumn}]`}),(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__preview",children:[(0,x.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text",children:e.preview.before}),(0,x.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text search-panel__entry__content__item__label__preview__text--found",children:e.preview.found.replaceAll(/\n/g,"↵")}),(0,x.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text",children:e.preview.after})]})]}),!e.preview&&(0,x.jsx)(x.Fragment,{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)(Zc.q1B,{})})})]},e.uuid)))})]})})),T_=(0,it.Pi)((e=>{const{searchState:t}=e,s=g_();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)(f_,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(dd,{children:`No occurrences found for '${s.textSearchCommandState.text}'`})})),C_=(0,it.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 ${Xd(t.usageConcept)}`}),t.searchEntries.map((e=>(0,x.jsx)(f_,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(dd,{children:`No usages found for ${Xd(t.usageConcept)}`})})),x_=(0,it.Pi)((e=>{const{candidate:t}=e,s=g_(),i=kt(),n=()=>{(0,O.fl)(s.loadFile(t.sourceID,new Wd(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:`${Hd(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)(Zc.bK4,{})})})]})})),N_=(0,it.Pi)((e=>{const{candidate:t}=e,s=g_(),i=kt();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:`${Hd(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 Wd(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,x.jsx)(Zc.bK4,{})})})]})})),O_=(0,it.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)(x_,{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)(N_,{candidate:e},e.uuid)))})]})]})})),A_=(0,it.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)(N_,{candidate:e},e.uuid)))})]})]})})),S_=(0,it.Pi)((()=>{const e=g_();return(0,x.jsxs)("div",{className:"search-panel",children:[(0,x.jsx)(Wc,{isLoading:e.textSearchCommandLoadingState.isInProgress}),!e.searchState&&(0,x.jsx)(dd,{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)(Zc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Zc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F"})]})]})})})}),e.searchState instanceof $h&&(0,x.jsx)(C_,{usageState:e.searchState}),e.searchState instanceof Bh&&(0,x.jsx)(T_,{searchState:e.searchState}),e.searchState instanceof Hh&&(0,x.jsx)(O_,{searchState:e.searchState}),e.searchState instanceof Yh&&(0,x.jsx)(A_,{searchState:e.searchState})]})})),y_=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:n,onNodeSelect:a}=e;return(0,x.jsxs)("div",{className:(0,Fc.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,Fc.clsx)("tree-view__node__icon",{[`${n}__tree-view__node__icon`]:n}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,x.jsx)(Zc.v4q,{}):(0,x.jsx)(Zc.XCv,{}))}),(0,x.jsx)("div",{className:(0,Fc.clsx)("tree-view__node__label",{[`${n}__tree-view__node__label`]:n}),children:t.label})]})},I_=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:n,classPrefix:a,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:I_,TreeNodeContainer:y_},d=r?{...c,...r}:c;return(0,x.jsxs)("div",{className:(0,Fc.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)))]})},v_=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(z),d={TreeNodeView:I_,TreeNodeContainer:y_},h=n?{...d,...n}:d;return(0,x.jsx)("div",{className:(0,Fc.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 R_=s(410);const P_=R_.gs,w_="resizable-panel--collapsed",L_=(e,t)=>({collapsiblePanel:{className:(0,Fc.clsx)(...t?.classes??[],{[w_]:e}),onStartResize:e=>{e.domElement.classList.remove(w_),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}}),b_=R_.jW,D_=R_.nN,M_=e=>(0,x.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var k_=s(70177);const F_=(0,it.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=g_(),u=kt(),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)?Zh.PASSED:t.failedTests.has(e)?Zh.FAILED:t.testsWithError.has(e)?Zh.ERROR:Zh.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(`${s}_`)))||t.testWithErrorIds.some((e=>e.startsWith(`${s}_`)))?Zh.FAILED:t.notRunTestIds.some((e=>e.startsWith(`${s}_`)))?Zh.RUNNING:Zh.PASSED})(t,p):void 0){case Zh.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)(Zc.rE2,{})});break;case Zh.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)(Zc.$Ow,{})});break;case Zh.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)(Zc.xDH,{})});break;case Zh.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)(Zc.VRP,{})});break;default:g=(0,x.jsx)(Zc.pTE,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,x.jsxs)("div",{className:(0,Fc.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 Wd(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)(Zc.v4q,{}):(0,x.jsx)(Zc.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})]})})),j_=(0,it.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(ge),(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(z).map((e=>(0,x.jsx)(F_,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:n,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),U_=(0,it.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)(dd,{children:"No tests found"}),!i&&(0,x.jsx)(v_,{components:{TreeNodeContainer:F_},treeData:s,onNodeSelect:()=>{},getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>s.nodes.get(e))).filter(z),innerProps:{testRunnerState:t,onNodeOpen:e=>t.setSelectedTestId(e.id),onNodeExpand:e=>{e.isOpen=!0,t.refreshTree()},onNodeCompress:e=>{e.isOpen=!1,t.refreshTree()}}})]})})),V_=(0,it.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,n=g_(),a=kt(),r=i.results.get(s),o=$(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 Wd(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)(Zc.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 qh&&(0,x.jsx)("div",{className:"test-runner-panel__result__content",children:"Test passed!"}),r instanceof Qh&&(0,x.jsx)("pre",{className:"test-runner-panel__result__content",children:r.error.text})]})]})})),G_=(0,it.Pi)((e=>{const{testRunnerState:t}=e,s=g_(),i=kt(),n=t.testExecutionResult.count,a=t.testResultInfo,r=a?.suiteStatus??Kh.NONE,o=a?.runPercentage??0;return(0,x.jsx)("div",{className:"test-runner-panel__content",children:(0,x.jsxs)(P_,{orientation:"vertical",children:[(0,x.jsx)(b_,{minSize:400,children:(0,x.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,x.jsx)(Wc,{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)(Zc.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)(Zc.$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)(Zc.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)(Zc.NEI,{className:"test-runner-panel__icon--tree-view"}):(0,x.jsx)(Zc.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)(Zc.Qq,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,x.jsx)(Zc.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)(Zc.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)(Zc.o1U,{})})]})]}),(0,x.jsx)("div",{className:"test-runner-panel__header__status",children:(0,x.jsx)(k_.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)(U_,{testRunnerState:t}),t.viewAsList&&(0,x.jsx)(j_,{testRunnerState:t})]})})]})}),(0,x.jsx)(D_,{children:(0,x.jsx)(M_,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsxs)(b_,{minSize:400,children:[t.selectedTestId&&!a&&(0,x.jsx)("div",{}),t.selectedTestId&&a&&(0,x.jsx)(V_,{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)(dd,{children:"No test selected"})})]}),(0,x.jsx)("div",{})]})]})})})),z_=(0,it.Pi)((()=>{const e=g_().testRunnerState;return(0,x.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,x.jsx)(dd,{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)(Zc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,x.jsx)(G_,{testRunnerState:e})]})})),B_=(0,it.Pi)((()=>{const e=g_(),t={[kd.CONSOLE]:{mode:kd.CONSOLE,name:"CONSOLE",icon:void 0,isVisible:!0},[kd.SEARCH_RESULT]:{mode:kd.SEARCH_RESULT,name:"SEARCH",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--search",children:(0,x.jsx)(Zc.W1M,{})}),isVisible:!0},[kd.TEST_RUNNER]:{mode:kd.TEST_RUNNER,name:"TEST",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--test",children:(0,x.jsx)(Zc.Vzd,{})}),isVisible:!0}},s=Object.values(kd).filter((e=>z(t[e])&&t[e].isVisible)),i=t=>e.activeAuxPanelMode===t&&s.includes(t);return(0,nt.useEffect)((()=>{s.includes(e.activeAuxPanelMode)||e.setActiveAuxPanelMode(kd.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(z).map((t=>{return(0,x.jsxs)("button",{tabIndex:-1,className:(0,Fc.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)(Zc.v4q,{}):(0,x.jsx)(Zc.g8U,{})}),(0,x.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,x.jsx)(Zc.b0D,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content",children:[i(kd.CONSOLE)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(E_,{})}),i(kd.SEARCH_RESULT)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(S_,{})}),i(kd.TEST_RUNNER)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(z_,{})})]})]})}));var $_=s(42689);const H_=()=>(0,x.jsx)("div",{className:"icon color--package",children:(0,x.jsx)(Zc.jtq,{})}),Y_=()=>(0,x.jsx)("div",{className:"icon color--class",children:"C"}),W_=()=>(0,x.jsx)("div",{className:"icon color--enumeration",children:"E"}),K_=()=>(0,x.jsx)("div",{className:"icon color--measure",children:"M"}),Z_=()=>(0,x.jsx)("div",{className:"icon color--unit",children:"u"}),X_=()=>(0,x.jsx)("div",{className:"icon color--profile",children:"P"}),q_=()=>(0,x.jsx)("div",{className:"icon icon--function color--function",children:(0,x.jsx)(Zc.eid,{})}),J_=()=>(0,x.jsx)("div",{className:"icon color--mapping",children:(0,x.jsx)(Zc.Zlt,{})}),Q_=()=>(0,x.jsx)("div",{children:(0,x.jsx)(Zc.UOT,{})}),em=()=>(0,x.jsx)("div",{className:"icon icon--function color--native-function",children:(0,x.jsx)(Zc.eid,{})}),tm=()=>(0,x.jsx)("div",{className:"icon icon--property color--property",children:(0,x.jsx)(Zc.HXR,{})}),sm=()=>(0,x.jsx)("div",{className:"icon color--diagram",children:(0,x.jsx)(Zc.oF7,{})}),im=()=>(0,x.jsx)("div",{className:"icon icon--database",children:(0,x.jsx)(Zc.VHe,{})}),nm=()=>(0,x.jsx)("div",{className:"icon color--association color--pure-association",children:"A"}),am=e=>{switch(e){case Ud.PACKAGE:return(0,x.jsx)(H_,{});case Ud.PROFILE:return(0,x.jsx)(X_,{});case Ud.CLASS:return(0,x.jsx)(Y_,{});case Ud.ASSOCIATION:return(0,x.jsx)(nm,{});case Ud.PROPERTY:case Ud.QUALIFIED_PROPERTY:return(0,x.jsx)(tm,{});case Ud.ENUMERATION:return(0,x.jsx)(W_,{});case Ud.MEASURE:return(0,x.jsx)(K_,{});case Ud.UNIT:return(0,x.jsx)(Z_,{});case Ud.FUNCTION:return(0,x.jsx)(q_,{});case Ud.NATIVE_FUNCTION:return(0,x.jsx)(em,{});case Ud.DIAGRAM:return(0,x.jsx)(sm,{});case Ud.DATABASE:return(0,x.jsx)(im,{});case Ud.MAPPING:return(0,x.jsx)(J_,{});default:return(0,x.jsx)(Q_,{})}},rm=/^[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,om=/^(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)*::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,lm=(0,it.Pi)((e=>{const{node:t}=e,s=g_(),i=kt(),n=t.data.li_attr.pureName??t.data.li_attr.pureId,a=t.data.li_attr.pureType===Ud.PACKAGE,[r,o]=(0,nt.useState)(a?Fl(n):n),l=(0,nt.useRef)(null),c=Boolean(r.match(a?om:rm)),d=(a?Fl(n):n)===r,h=c?void 0:"Invalid path",u=()=>s.conceptTreeState.setNodeForRenameConcept(void 0),p=e=>{e.preventDefault(),d||s.conceptTreeState.renameConcept(t,r).catch(i.alertUnhandledError).finally((()=>u()))};return(0,x.jsx)(kc.Z,{open:!0,onClose:u,TransitionProps:{onEnter:()=>l.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:"Rename concept"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:p,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:l,className:"input input--dark",onChange:e=>o(e.target.value),value:r,spellCheck:!1}),h&&(0,x.jsx)("div",{className:"input-group__error-message",children:h})]})}),(0,x.jsx)("button",{disabled:d,className:"command-modal__content__submit-btn btn--dark",onClick:p,children:"Rename"})]})]})})})),cm=/^(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)*::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,dm=(0,it.Pi)((e=>{const{node:t}=e,s=g_(),i=kt(),n=jl(t.data.li_attr.pureId)??"",[a,r]=(0,nt.useState)(n),o=(0,nt.useRef)(null),l=Boolean(a.match(cm)),c=n===a,d=l?void 0:"Invalid path",h=()=>s.conceptTreeState.setNodeForMoveElement(void 0),u=e=>{e.preventDefault(),c||s.conceptTreeState.movePackageableElements([W(t.data.li_attr,Bd)],a).catch(i.alertUnhandledError).finally((()=>h()))};return(0,x.jsx)(kc.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.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:"Move element"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,x.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,x.jsx)("button",{disabled:c,className:"command-modal__content__submit-btn btn--dark",onClick:u,children:"Move"})]})]})})})),hm=(0,it.Pi)((0,nt.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,n=s.data.li_attr.pureType,a=g_(),r=kt();return(0,x.jsxs)(id,{ref:t,children:[(0,x.jsx)(nd,{onClick:()=>a.conceptTreeState.setNodeForRenameConcept(s),children:"Rename"}),s.data.li_attr instanceof Bd&&(0,x.jsx)(nd,{onClick:()=>a.conceptTreeState.setNodeForMoveElement(s),children:"Move"}),n===Ud.PACKAGE&&(0,x.jsx)(nd,{onClick:()=>{(0,O.fl)(a.executeTests(s.data.li_attr.pureId)).catch(r.alertUnhandledError)},children:"Run tests"}),n===Ud.FUNCTION&&(0,x.jsx)(nd,{onClick:()=>{window.open(`${a.client.baseUrl}/execute?func=${s.data.li_attr.pureId}&mode=${a.client.mode}`,"_blank")},children:"Service (JSON)"}),(s.data.li_attr instanceof zd||s.data.li_attr instanceof Bd)&&(0,x.jsx)(nd,{onClick:()=>{const e=s.data.li_attr;(e instanceof Bd||e instanceof zd)&&a.findUsages(new Wd(e.file,Number.parseInt(e.line,10),Number.parseInt(e.column,10)))},children:"Find Usages"}),n!==Ud.PACKAGE&&(0,x.jsx)(nd,{onClick:()=>i(s),children:"View Source"})]})})));var um;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(um=um||(um={}));const pm=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,nt.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d,viewConceptSource:h}=a,u=t.parent&&t.data.li_attr instanceof zd&&t.data.li_attr.classPath!==t.parent.id,p=[Ud.PACKAGE,Ud.CLASS].includes(t.data.li_attr.pureType),_=t.data.li_attr.pureType===Ud.QUALIFIED_PROPERTY?(0,x.jsxs)(x.Fragment,{children:[t.label,(0,x.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:"(...)"})]}):u?(0,x.jsxs)(x.Fragment,{children:[t.label,(0,x.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:Fl(W(t.data.li_attr,zd).classPath)})]}):t.label.includes("(")?(0,x.jsxs)(x.Fragment,{children:[t.label.substring(0,t.label.indexOf("(")),(0,x.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:t.label.substring(t.label.indexOf("("))})]}):t.label,m=()=>{t.isLoading||(t.isOpen?d(t):c(t))},[,g]=(0,$_.c)((()=>({type:"Class"===t.data.li_attr.pureType?um.CLASS:um.UNSUPPORTED,item:t.data})),[t]);return(0,x.jsx)(sd,{content:(0,x.jsx)(hm,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Fc.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:g,onDoubleClick:()=>{t.isLoading||(p&&m(),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)(Zc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:m,children:p?t.isOpen?(0,x.jsx)(Zc.v4q,{}):(0,x.jsx)(Zc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:(0,Fc.clsx)("explorer__package-tree__node__icon__type",{"explorer__package-tree__node__icon__type--property-from-association":u}),children:am(t.data.li_attr.pureType)})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:_})]})})},_m=(0,it.Pi)((()=>{const e=g_(),t=kt(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,x.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,x.jsx)(v_,{components:{TreeNodeContainer:pm},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(z),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 Bd||s instanceof zd)&&e.directoryTreeState.revealPath(s.file,!0,new Wd(s.file,Number.parseInt(s.line,10),Number.parseInt(s.column,10)))}}}),s.nodeForRenameConcept&&(0,x.jsx)(lm,{node:s.nodeForRenameConcept}),s.nodeForMoveElement&&(0,x.jsx)(dm,{node:s.nodeForMoveElement})]})})),mm=(0,it.Pi)((()=>{const e=g_(),t=kt(),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)(Zc.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)(Zc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)(Wc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(_m,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,x.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(dd,{children:"Failed to build concept tree"})]})]})})]})})),gm=/[a-zA-z0-9_]+(?:.[a-zA-z0-9_]+)*/,Em=(0,it.Pi)((e=>{const{node:t}=e,s=g_(),i=kt(),[n,a]=(0,nt.useState)("untitled.pure"),r=(0,nt.useRef)(null),o=Boolean(n.match(gm)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid file name",d=()=>s.directoryTreeState.setNodeForCreateNewFile(void 0),h=e=>{e.preventDefault(),d(),(0,O.fl)(s.createNewFile(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,x.jsx)(kc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.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:h,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,x.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:h,children:"Create"})]})]})})})),fm=/[a-zA-z0-9_]+/,Tm=(0,it.Pi)((e=>{const{node:t}=e,s=g_(),i=kt(),[n,a]=(0,nt.useState)("untitled"),r=(0,nt.useRef)(null),o=Boolean(n.match(fm)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid directory name",d=()=>s.directoryTreeState.setNodeForCreateNewDirectory(void 0),h=e=>{e.preventDefault(),d(),(0,O.fl)(s.createNewDirectory(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,x.jsx)(kc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.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:h,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,x.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:h,children:"Create"})]})]})})})),Cm=/\/?(?:[a-zA-z0-9_]\/)*[a-zA-z0-9_]+(?:.[a-zA-z0-9_]+)*/,xm=(0,it.Pi)((e=>{const{node:t}=e,s=g_(),i=kt(),[n,a]=(0,nt.useState)(t.data.li_attr.path),r=(0,nt.useRef)(null),o=Boolean(n.match(Cm)),l=t.data.li_attr.path===n,c=o?void 0:"Invalid path",d=()=>s.directoryTreeState.setNodeForRenameFile(void 0),h=e=>{e.preventDefault(),l||(d(),(0,O.fl)(s.renameFile(t.data.li_attr.path,n)).catch(i.alertUnhandledError))};return(0,x.jsx)(kc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.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:"Rename file"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,x.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,x.jsx)("button",{disabled:l,className:"command-modal__content__submit-btn btn--dark",onClick:h,children:"Rename"})]})]})})})),Nm=(0,it.Pi)((0,nt.forwardRef)((function(e,t){const{node:s}=e,i=kt(),n=g_(),a=s.data.isFolderNode,r=Boolean(s.data.children);return(0,x.jsxs)(id,{ref:t,children:[a&&(0,x.jsx)(nd,{onClick:()=>n.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),a&&(0,x.jsx)(nd,{onClick:()=>n.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Directory"}),!a&&(0,x.jsx)(nd,{onClick:()=>n.directoryTreeState.setNodeForRenameFile(s),children:"Rename"}),(0,x.jsx)(nd,{disabled:Boolean(s.data instanceof gh&&s.data.children),onClick:()=>{(0,O.fl)(n.deleteDirectoryOrFile(s.data.li_attr.path,a,r)).catch(i.alertUnhandledError)},children:"Delete"})]})}))),Om=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,nt.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d}=a,h=t.data instanceof gh&&"/platform"===t.data.li_attr.path,u=t.data.isFolderNode,p=t.data instanceof gh&&!t.data.children,_=h?(0,x.jsx)(Zc.R0,{className:"explorer__icon--platform"}):u?p?(0,x.jsx)(Zc.ROc,{}):t.isOpen?(0,x.jsx)(Zc.ry,{}):(0,x.jsx)(Zc.ROc,{}):(0,x.jsx)(Zc.QqN,{className:"explorer__icon--file"}),m=()=>{p||t.isLoading||(t.isOpen?d(t):c(t))};return(0,x.jsx)(sd,{content:(0,x.jsx)(Nm,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Fc.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||(u?m():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)(Zc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:m,children:!u||p?(0,x.jsx)("div",{}):t.isOpen?(0,x.jsx)(Zc.v4q,{}):(0,x.jsx)(Zc.XCv,{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:_})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:h?"platform":t.label})]})})},Am=(0,it.Pi)((()=>{const e=g_(),t=kt(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,x.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,x.jsx)(v_,{components:{TreeNodeContainer:Om},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(z),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()}}}),s.nodeForCreateNewFile&&(0,x.jsx)(Em,{node:s.nodeForCreateNewFile}),s.nodeForCreateNewDirectory&&(0,x.jsx)(Tm,{node:s.nodeForCreateNewDirectory}),s.nodeForRenameFile&&(0,x.jsx)(xm,{node:s.nodeForRenameFile})]})})),Sm=(0,it.Pi)((()=>{const e=g_(),t=kt(),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)(Zc.DuK,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof hh&&(0,O.fl)(s.revealPath(i.filePath,!1)).catch(t.alertUnhandledError)},title:"Focus",children:(0,x.jsx)(Zc.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)(Zc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)(Wc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(Am,{}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(dd,{children:"Failed to build directory tree"})]})]})})]})})),ym=(0,it.Pi)((()=>{const e=g_();return(0,x.jsx)("div",{className:"side-bar",children:(0,x.jsx)("div",{className:(0,Fc.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case Md.CONCEPT:return(0,x.jsx)(mm,{});case Md.FILE:return(0,x.jsx)(Sm,{});default:return null}})()},e.activeActivity)})})),Im=e=>{const{className:t}=e;return(0,x.jsx)("div",{className:(0,Fc.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"})})]})})},vm=(0,it.Pi)((()=>{const e=g_(),t=t=>()=>e.setActiveActivity(t),s=[{mode:Md.CONCEPT,title:"Concept Explorer",icon:(0,x.jsx)(Zc.DE2,{})},{mode:Md.FILE,title:"File Explorer",icon:(0,x.jsx)(Zc.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)(Im,{})}),(0,x.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,x.jsx)("button",{className:(0,Fc.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)))})]})})),Rm=(0,it.Pi)((e=>{const t=g_(),s=kt();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,Fc.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)(Zc.pgN,{})}),(0,x.jsx)("button",{className:(0,Fc.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)(Zc.FxN,{})}),(0,x.jsx)("button",{className:(0,Fc.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)(Zc.UHp,{})})]})]})})),Pm=(0,it.Pi)((e=>{const{editorState:t}=e,s=g_(),i=kt(),n=(0,nt.useRef)(null),[a,r]=(0,nt.useState)(),o=t.file.content,{ref:l,width:c,height:d}=(0,cd.NB)();return(0,nt.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,theme:T.LEGEND,wordWrap:t.textEditorState.wrapText?"on":"off"});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)}}),[s,i,t,a]),a&&a.getValue()!==o&&a.setValue(o),(0,nt.useEffect)((()=>{void 0!==c&&void 0!==d&&a?.layout({width:c,height:d})}),[a,c,d]),(0,nt.useEffect)((()=>{a&&t.textEditorState.forcedCursorPosition&&(Fd(a,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[a,t,t.textEditorState.forcedCursorPosition]),(0,nt.useEffect)((()=>()=>{a&&(t.textEditorState.setViewState(a.saveViewState()??void 0),a.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,Fc.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)(Zc.NK0,{className:"file-editor__icon--text-wrap"})})})}),(0,x.jsx)("div",{className:"panel__content file-editor__content",children:(0,x.jsx)("div",{ref:l,className:"text-editor__container",children:(0,x.jsx)("div",{className:"text-editor__body",ref:n})})})]})})),wm=e=>{(0,nt.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},Lm="Diagram",bm="Diagram",Dm=/^[a-zA-Z0-9_][a-zA-Z0-9_$]*/,Mm=(0,it.Pi)((e=>{const{renameConceptState:t}=e,s=kt(),i=t.fileEditorState,n=t.concept.pureName,[a,r]=(0,nt.useState)(n),o=(0,nt.useRef)(null),l=Boolean(a.match(Dm)),c=n===a,d=l?void 0:"Invalid path",h=()=>{(0,O.fl)(i.setConceptToRenameState(void 0)).catch(s.alertUnhandledError)},u=e=>{e.preventDefault(),c||i.renameConcept(a).catch(s.alertUnhandledError).finally((()=>h()))};return(0,x.jsx)(kc.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.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:"Rename concept"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,x.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,x.jsx)("button",{disabled:c,className:"command-modal__content__submit-btn btn--dark",onClick:u,children:"Rename"})]})]})})})),km=(0,it.Pi)((e=>{const{editorState:t}=e,s=(0,nt.useRef)(void 0),i=(0,nt.useRef)(void 0),n=(0,nt.useRef)(null),[a,r]=(0,nt.useState)(),[o,l]=(0,nt.useState)(!1),c=g_(),d=kt(),h=t.file.content,{ref:u,width:p,height:_}=(0,cd.NB)();(0,nt.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",contextmenu:!0,useShadowDOM:!1});s._codeEditorService.openCodeEditor=async()=>{const e=s.getPosition();e&&(0,O.fl)(c.executeNavigation(new Wd(t.filePath,e.lineNumber,e.column))).catch(d.alertUnhandledError)},s.updateOptions({gotoLocation:{multiple:"goto",multipleDefinitions:"goto",alternativeDefinitionCommand:"DUMMY"}}),s.onContextMenu((()=>l(!0))),s.addAction({id:oh.FIND_USAGES,label:"Find Usages",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Wd(t.filePath,s.lineNumber,s.column);(0,O.fl)(c.findUsages(e)).catch(d.alertUnhandledError)}}}),s.addAction({id:oh.REVEAL_CONCEPT_IN_TREE,label:"Reveal Concept",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();s&&c.revealConceptInTree(new Wd(t.filePath,s.lineNumber,s.column)).catch(d.alertUnhandledError)}}),s.addAction({id:oh.RENAME_CONCEPT,label:"Rename",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Wd(t.filePath,s.lineNumber,s.column);(0,O.fl)(t.setConceptToRenameState(e)).catch(c.applicationStore.alertUnhandledError)}}}),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)}}),[c,d,t,a]),a&&a.getValue()!==h&&a.setValue(h);const m=a?A.editor.tokenize(a.getValue(),C.PURE):[];return i.current?.dispose(),i.current=A.languages.registerDefinitionProvider(C.PURE,{provideDefinition:(e,s)=>{const i=$(m[s.lineNumber-1]);let n,a;for(let e=1;e<i.length;++e){const t=$(i[e]);if(t.offset+1>s.column){n=$(i[e-1]),a={startLineNumber:s.lineNumber,startColumn:n.offset+1,endLineNumber:s.lineNumber,endColumn:t.offset+1};break}}return n&&a&&[Ve.TYPE,Ve.VARIABLE,Ve.PROPERTY,Ve.IDENTIFIER].includes((r=n.type,$(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((()=>{const e=[];return e.push({label:{label:"#copyright",description:"(copyright header)"},kind:A.languages.CompletionItemKind.Snippet,insertTextRules:A.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:'// Copyright ${1:2020} Goldman Sachs\n//\n// Licensed under the Apache License, Version 2.0 (the "License");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an "AS IS" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n',range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1e3}}),e})()),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:je.PURE,description:"(core Pure)",insertText:je.PURE},{text:je.MAPPING,description:"(dsl)",insertText:je.MAPPING},{text:je.CONNECTION,description:"(dsl)",insertText:je.CONNECTION},{text:je.RUNTIME,description:"(dsl)",insertText:je.RUNTIME},{text:je.RELATIONAL,description:"(external store)",insertText:je.RELATIONAL},{text:Lm,description:"(dsl)",insertText:bm}])),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=`###${je.PURE}\n${a}`.split("\n").filter((e=>e.startsWith(Ee))),o=(e=>{if(e.startsWith(Ee))return e.substring(Ee.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 je.PURE:return[{text:ke.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:ke.CLASS,description:"with property",insertText:"Class ${1:model::NewClass}\n{\n ${2:prop1}: ${3:String[1]};\n}"},{text:ke.CLASS,description:"with inheritance",insertText:"Class ${1:model::NewClass} extends ${2:model::ParentClass}\n{\n ${3:// class content}\n}"},{text:ke.CLASS,description:"with constraint",insertText:"Class ${1:model::NewClass}\n[\n ${3:SomeConstraint: true}\n]\n{\n ${2:// class content}\n}"},{text:ke.PROFILE,insertText:"Profile ${1:model::NewProfile}\n{\n stereotypes: [${2:}];\n tags: [${3:}];\n}"},{text:ke.ENUMERATION,insertText:"Enum ${1:model::NewEnumeration}\n{\n ${2:VALUE_1,\n VALUE_2}\n}"},{text:ke.ASSOCIATION,insertText:"Association ${1:model::NewAssociation}\n{\n ${2:prop1}: ${3:model::Type1[1]};\n ${4:prop2}: ${5:model::Type2[1]};\n}"},{text:ke.FUNCTION,description:"(blank)",insertText:"function ${1:model::NewEnumeration}(${2:param1: String[1]}): ${3:String[1]}\n{\n ${4:''; // function content}\n}"},{text:ke.FUNCTION,insertText:"function ${1:model::NewEnumeration}(): String[1]\n{\n ''\n}"}];case je.MAPPING:return[{text:ke.MAPPING,description:"(blank)",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:// mapping content}\n)"},{text:ke.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:ke.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:ke.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 je.RELATIONAL:return[{text:ke.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 Lm:return[{text:bm,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}}}),wm(t),(0,nt.useEffect)((()=>{if(o){if(document.querySelector(".file-editor .monaco-menu")){const e=["Peek"];Array.from(document.querySelectorAll(".file-editor .monaco-menu .action-label")).filter((t=>e.includes(t.innerHTML))).forEach((e=>{const t=e.parentElement?.parentElement;t&&(t.classList.add("disabled"),t.style.opacity="0.3",t.style.pointerEvents="none")}))}l(!1)}}),[o]),(0,nt.useEffect)((()=>{void 0!==p&&void 0!==_&&a?.layout({width:p,height:_})}),[a,p,_]),(0,nt.useEffect)((()=>{a&&t.textEditorState.forcedCursorPosition&&(Fd(a,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[a,t,t.textEditorState.forcedCursorPosition]),(0,nt.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.jsxs)("div",{className:"file-editor__header__actions",children:[(0,x.jsx)("button",{className:(0,Fc.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)(Zc.NK0,{className:"file-editor__icon--text-wrap"})}),t.renameConceptState&&(0,x.jsx)(Mm,{renameConceptState:t.renameConceptState})]})}),(0,x.jsx)("div",{className:"panel__content file-editor__content",children:(0,x.jsx)("div",{ref:u,className:"text-editor__container",children:(0,x.jsx)("div",{className:"text-editor__body",ref:n})})})]})}));var Fm=s(8533);const jm=e=>{const{open:t,className:s,children:i,menuProps:n,content:a,title:r,disabled:o,onClose:l,onOpen:c}=e,d=(0,nt.useRef)(null),[h,u]=(0,nt.useState)(null);return(0,nt.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)(td,{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})]})},Um=(0,it.Pi)((0,nt.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=kt(),n=s.diagram,a=t,{width:r,height:o}=(0,cd.NB)({refreshMode:"debounce",refreshRate:50,targetRef:a});(0,nt.useEffect)((()=>{if(a.current){const e=new sp(a.current,n);s.setRenderer(e),s.setupRenderer(),e.render(),e.autoRecenter()}}),[a,s,n]),(0,nt.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,nt.useCallback)(((e,t)=>{if(e instanceof $d){const n=t.getClientOffset(),a=n?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new sc(n.x,n.y))):void 0;(0,O.fl)(s.addClassView(e.li_attr.pureId,a)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,Fm.L)((()=>({accept:um.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(a),(0,x.jsx)("div",{ref:a,className:(0,Fc.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),Vm=(0,it.Pi)((e=>{const{diagramEditorState:t}=e,s=g_(),i=kt(),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(Ju.ALIGN_LEFT),children:(0,x.jsx)(Zc.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(Ju.ALIGN_CENTER),children:(0,x.jsx)(Zc.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(Ju.ALIGN_RIGHT),children:(0,x.jsx)(Zc.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(Ju.ALIGN_TOP),children:(0,x.jsx)(Zc.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(Ju.ALIGN_MIDDLE),children:(0,x.jsx)(Zc.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(Ju.ALIGN_BOTTOM),children:(0,x.jsx)(Zc.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(Ju.SPACE_HORIZONTALLY),children:(0,x.jsx)(Zc.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(Ju.SPACE_VERTICALLY),children:(0,x.jsx)(Zc.LyQ,{className:"diagram-editor__icon--aligner"})})]}),(0,x.jsxs)(jm,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,x.jsxs)(id,{children:[(0,x.jsx)(nd,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,x.jsx)(ad,{}),ep.map((e=>(0,x.jsxs)(nd,{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)(Zc.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 Wd(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,x.jsx)(Zc.qdB,{className:"diagram-editor__icon--go-to-file"})})})]})})),Gm=(0,it.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,Fc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Xu.LAYOUT}),tabIndex:-1,onClick:i(Xu.LAYOUT,qu.NONE),title:"View Tool (V)",children:(0,x.jsx)(Zc.Hrt,{className:"diagram-editor__icon--layout"})}),(0,x.jsx)("button",{className:(0,Fc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Xu.PAN}),tabIndex:-1,onClick:i(Xu.PAN,qu.NONE),title:"Pan Tool (M)",children:(0,x.jsx)(Zc.tPC,{className:"diagram-editor__icon--pan"})}),(0,x.jsx)("button",{className:(0,Fc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Xu.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(Xu.ZOOM_IN,qu.NONE),children:(0,x.jsx)(Zc.Sd5,{className:"diagram-editor__icon--zoom-in"})}),(0,x.jsx)("button",{className:(0,Fc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Xu.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(Xu.ZOOM_OUT,qu.NONE),children:(0,x.jsx)(Zc.xLV,{className:"diagram-editor__icon--zoom-out"})})]})})),zm=(0,it.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,nt.useRef)(null);return wm(t),(0,x.jsxs)("div",{className:"diagram-editor",children:[(0,x.jsx)("div",{className:"diagram-editor__header",children:t.isDiagramRendererInitialized&&(0,x.jsx)(Vm,{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)(Gm,{diagramEditorState:t}),(0,x.jsx)(Um,{diagramEditorState:t,ref:s})]})})]})}));var Bm=s(98533),$m=s(84153);const Hm=e=>{const{children:t,label:s,showPlaceholder:i,className:n}=e;return i?(0,x.jsx)("div",{className:(0,Fc.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 Ym(e){const{labelGetter:t,types:s}=e,{itemType:i,item:n,isDragging:a,currentPosition:r}=(0,Bm.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)(Lc.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 Wm=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)},Km=(0,it.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,x.jsxs)(id,{children:[(0,x.jsx)(nd,{onClick:()=>s.closeTab(t),children:"Close"}),(0,x.jsx)(nd,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,x.jsx)(nd,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),Zm=(0,it.Pi)((e=>{const t=(0,nt.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:n}=e,a=(0,nt.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,Fm.L)((()=>({accept:[s.dndType],hover:(e,t)=>a(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[a]),l=i===r,[,c,d]=(0,$_.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,nt.useEffect)((()=>{e((0,$m.r)())}),[e])})(d),(0,x.jsx)("div",{ref:t,className:(0,Fc.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)(Hm,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,x.jsxs)(sd,{content:(0,x.jsx)(Km,{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)(Zc.q1B,{})})]})})});var h})),Xm=(0,it.Pi)((e=>{const{managerTabState:t}=e;return(0,x.jsx)(jm,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,x.jsx)(id,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,x.jsxs)(nd,{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)(Zc.q1B,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,x.jsx)(Zc.v4q,{})})})),qm=(0,it.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:Wm,children:[t.tabs.map((e=>(0,x.jsx)(Zm,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,x.jsx)(Ym,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,x.jsx)(Xm,{managerTabState:t})]})})),Jm=()=>{const[e,t]=(0,nt.useState)(!1),{ref:s,width:i,height:n}=(0,cd.NB)();return(0,nt.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,Fc.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)(Zc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},Qm=(0,it.Pi)((()=>{const e=g_(),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)(qm,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof hh){const s=e.tabManagerState.tabs.filter((e=>e instanceof hh&&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)(Zc.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 d_){const s=e.tabManagerState.tabs.filter((e=>e instanceof d_&&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)(sm,{})}),(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 hh?t.textEditorState.language===C.PURE?(0,x.jsx)(km,{editorState:t}):(0,x.jsx)(Pm,{editorState:t}):t instanceof d_?(0,x.jsx)(zm,{diagramEditorState:t}):null},t.uuid)]}):(0,x.jsx)(Jm,{})}));var eg=s(50166),tg=s(35247);const sg=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,nt.useRef)(null);return(0,nt.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,x.jsx)(eg.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"})},ig=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__loading-indicator selector-input--dark__loading-indicator",children:(0,x.jsx)(Zc.VRP,{})}),ng=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__dropdown-indicator",children:(0,x.jsx)(Zc.VAA,{})}),ag=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)(Zc.q1B,{})})})},rg=e=>(0,x.jsx)(tg.baseComponents.Input,{...e,isHidden:!1}),og=(0,nt.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?tg.CreatableSelect:tg.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:ag,DropdownIndicator:ng,LoadingIndicator:ig,MenuList:sg,Input:rg,...r},...{...d,darkMode:l,noMatchMessage:n}})})),lg=(e,t)=>e.label.localeCompare(t.label),cg=(0,it.Pi)((()=>{const e=g_(),t=kt(),s=e.fileSearchCommandLoadingState,i=e.fileSearchCommandState,n=(0,nt.useRef)(null),a=(0,nt.useMemo)((()=>(0,pd.Z)((()=>{(0,O.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,x.jsx)(kc.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)(og,{ref:n,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(lg),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,Fc.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)(Zc.x47,{})})]})]})})})),dg=(0,it.Pi)((()=>{const e=g_(),t=kt(),s=e.textSearchCommandState,i=(0,nt.useRef)(null),n=()=>e.setOpenTextSearchCommand(!1),a=s=>{s.preventDefault(),n(),(0,O.fl)(e.searchText()).catch(t.alertUnhandledError)};return(0,x.jsx)(kc.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,Fc.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)(Zc.a2g,{})}),(0,x.jsx)("button",{className:(0,Fc.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)(Zc.x47,{})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark btn--caution",onClick:a,children:"Search"})]})]})})})),hg=(ug=(0,it.Pi)((()=>{const e=g_(),t=kt(),s=e.initState.hasSucceeded,{ref:i,width:n,height:a}=(0,cd.NB)(),r=L_(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),o=L_(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),l=L_(e.auxPanelDisplayState.isMaximized);return(0,nt.useEffect)((()=>{i.current&&e.auxPanelDisplayState.setMaxSize(i.current.offsetHeight)}),[e,i,a,n]),(0,nt.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,nt.useEffect)((()=>{const s=((e,t=!1)=>t?(0,te.parseUrl)(e).query:(0,te.parse)(e))(window.location.search);(0,O.fl)(e.initialize(!1,void 0,s.mode,s.fastCompile)).catch(t.alertUnhandledError)}),[e,t]),(0,nt.useEffect)((()=>(t.navigator.blockNavigation([()=>!0],void 0,(()=>t.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigator.unblockNavigation()})),[e,t]),wm(e),(0,x.jsxs)("div",{className:"editor",children:[(0,x.jsxs)("div",{className:"editor__body",children:[(0,x.jsx)(vm,{}),(0,x.jsx)("div",{className:"editor__content-container",ref:i,children:(0,x.jsx)("div",{className:"editor__content",children:(0,x.jsxs)(P_,{orientation:"vertical",children:[(0,x.jsx)(b_,{...r.collapsiblePanel,direction:1,children:(0,x.jsx)(ym,{})}),(0,x.jsx)(D_,{}),(0,x.jsx)(b_,{...r.remainingPanel,minSize:300,children:(0,x.jsxs)(P_,{orientation:"horizontal",children:[(0,x.jsx)(b_,{...l.collapsiblePanel,...0===e.auxPanelDisplayState.size?o.remainingPanel:{},children:(0,x.jsx)(Qm,{})}),(0,x.jsx)(D_,{children:(0,x.jsx)(M_,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsx)(b_,{...o.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?l.remainingPanel:{},direction:-1,children:(0,x.jsx)(B_,{})})]})})]})})})]}),(0,x.jsx)(Rm,{actionsDisabled:!s}),s&&(0,x.jsx)(cg,{}),s&&(0,x.jsx)(dg,{})]})})),function(){return(0,x.jsx)(m_,{children:(0,x.jsx)(ug,{})})});var ug;const pg=()=>(0,x.jsx)(Dd,{children:(0,x.jsx)(wd,{children:(0,x.jsx)(hg,{})})}),_g=JSON.parse('{"i8":"6.2.18","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class mg extends o{}class gg extends mg{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class Eg extends gg{static NAME=_g.Rw.p;constructor(){super(Eg.NAME,_g.i8)}getExtraKeyedCommandConfigEntries(){return[nh,lh,rh].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class fg extends tt{static create(){const e=new fg(Vt.create());return e.withBasePlugins([new Eg]),e.withBasePresets([new yc]),e}async configureApplication(e){return new jt(e)}async loadApplication(){await(async(e,t)=>{(e=>{var t,s;A.editor.defineTheme(T.LEGEND,Ge),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.CtrlCmd|A.KeyCode.F2,command:null},{keybinding:A.KeyMod.Shift|A.KeyCode.F10,command:null},{keybinding:A.KeyMod.CtrlCmd|A.KeyCode.F12,command:null}]),A.languages.register({id:C.PURE}),A.languages.setLanguageConfiguration(C.PURE,ze),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",ke.CLASS,ke.ASSOCIATION,ke.ENUMERATION,ke.MEASURE,ke.PROFILE,ke.FUNCTION,ke.MAPPING,ke.RUNTIME,ke.CONNECTION,ke.FILE_GENERATION,ke.GENERATION_SPECIFICATION,ke.DATA_ELEMENT,Fe.JSON_MODEL_CONNECTION,Fe.MODEL_CHAIN_CONNECTION,Fe.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",ke.SERVICE,ke.FLAT_DATA,ke.DATABASE,Fe.FLAT_DATA_CONNECTION,Fe.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@","<<",">>"],languageStructs:["import","native"],parsers:[je.PURE,je.CONNECTION,je.RUNTIME,je.MAPPING,je.SERVICE,je.FLATDATA,je.RELATIONAL,je.GENERATION_SPECIFICATION,je.FILE_GENERATION_SPECIFICATION,je.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":Ve.PARSER,"@default":Ve.INVALID}}],[/(@identifier)/,{cases:{"@languageStructs":Ve.LANGUAGE_STRUCT,"@keywords":`${Ve.KEYWORD}.$0`,"@default":Ve.IDENTIFIER}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":Ve.OPERATOR,"@default":Ve.IDENTIFIER}}],{include:"@number"},[/[;,.]/,Ve.DELIMITER],[/'([^'\\]|\\.)*$/,`${Ve.STRING}.invalid`],[/'/,Ve.STRING,"@string"],{include:"@characters"}],pure:[[/(@package\*)/,[Ve.PACKAGE]],[/(@package?)(@identifier)(@generics?)(\s*)(@multiplicity)/,[Ve.PACKAGE,Ve.TYPE,Ve.GENERICS,Ve.WHITESPACE,Ve.MULTIPLICITY]],[/(@package)(@identifier)(@generics?)/,[Ve.PACKAGE,Ve.TYPE,Ve.GENERICS]],[/([@^])(?:\s*)(@package?)(@identifier)(@generics?)(@multiplicity?)/,[`${Ve.TYPE}.operator`,Ve.PACKAGE,Ve.TYPE,Ve.GENERICS,Ve.MULTIPLICITY]],[/(\.\s*)(@identifier)/,[Ve.DELIMITER,Ve.PROPERTY]],[/(@identifier)(\s*[:=])/,[Ve.PROPERTY,Ve.OPERATOR]],[/(@identifier)(\.)(@identifier)/,[Ve.TYPE,Ve.OPERATOR,Ve.PROPERTY]],[/(let)(\s+)(@identifier)(\s*[:=])/,[Ve.KEYWORD,Ve.WHITESPACE,Ve.VARIABLE,Ve.OPERATOR]],[/(\$@identifier)/,[Ve.VARIABLE]]],date:[[/(%latest)/,[`${Ve.DATE}.latest`]],[/(@date)/,[Ve.DATE]],[/(@time)/,[`${Ve.DATE}.time`]]],color:[[/(#[0-9a-fA-F]{6})/,[Ve.COLOR]]],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,`${Ve.NUMBER}.float`],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,`${Ve.NUMBER}.float`],[/0[xX](@hexdigits)[Ll]?/,`${Ve.NUMBER}.hex`],[/0(@octaldigits)[Ll]?/,`${Ve.NUMBER}.octal`],[/0[bB](@binarydigits)[Ll]?/,`${Ve.NUMBER}.binary`],[/(@digits)[fFdD]/,`${Ve.NUMBER}.float`],[/(@digits)[lL]?/,Ve.NUMBER]],whitespace:[[/[ \t\r\n]+/,Ve.WHITESPACE],[/\/\*\*(?!\/)/,`${Ve.COMMENT}.doc`,"@doc"],[/\/\*/,Ve.COMMENT,"@comment"],[/\/\/.*$/,Ve.COMMENT]],comment:[[/[^/*]+/,Ve.COMMENT],[/\*\//,Ve.COMMENT,"@pop"],[/[/*]/,Ve.COMMENT]],doc:[[/[^/*]+/,`${Ve.COMMENT}.doc`],[/\/\*/,`${Ve.COMMENT}.doc.invalid`],[/\*\//,`${Ve.COMMENT}.doc`,"@pop"],[/[/*]/,`${Ve.COMMENT}.doc`]],string:[[/[^\\']+/,Ve.STRING],[/@escapes/,`${Ve.STRING}.escape`],[/\\./,`${Ve.STRING}.escape.invalid`],[/'/,Ve.STRING,"@pop"]],characters:[[/'[^\\']'/,Ve.STRING],[/(')(@escapes)(')/,[Ve.STRING,`${Ve.STRING}.escape`,Ve.STRING]],[/'/,`${Ve.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(me.TEXT_EDITOR_FONT_LOADED),"Monospaced font 'Roboto Mono' has been loaded")):t.error(h.create(me.APPLICATION_SETUP_FAILURE),s)})).catch((()=>t.error(h.create(me.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)(st.VK,{basename:this.baseUrl,children:(0,x.jsx)(lt,{children:(0,x.jsx)(Mt,{config:this.config,pluginManager:this.pluginManager,children:(0,x.jsx)(pg,{})})})}))}}class Tg{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){fg.create().setup({baseUrl:e}).withPresets(Tg.getPresetCollection()).withPlugins(Tg.getPluginCollection()).start().catch((e=>{throw e}))}}Tg.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.R0=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,"R0",{enumerable:!0,get:function(){return i.FaWrench}}),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(73449)));l=o.O(l)})();
2
- //# sourceMappingURL=index.7a7d4512.js.map
1
+ (()=>{"use strict";var e,t,s,i,n,a={73449:(e,t,s)=>{const i=JSON.parse('{"i8":"6.2.9","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=>e.length?e[e.length-1]:void 0,w=e=>new Promise(((t,s)=>setTimeout((()=>{try{t(e())}catch(e){s(e)}}),0))),L=(e,t,s=((e,t)=>e===t))=>!e.find((e=>s(e,t)))&&(e.push(t),!0),b=(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)},D=(e,t,s=((e,t)=>e===t))=>{const i=e.findIndex((e=>s(e,t)));return-1!==i&&(e.splice(i,1),!0)};class M 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 k 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 F extends k{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class j extends k{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 U(e){if(!(e instanceof Error))throw new F("Expected error to be thrown")}const V=e=>{try{return e()}catch{return}};class G extends k{constructor(e,t){super("Assertion Error",e,t)}}const z=e=>null!=e;function B(e,t=""){if(null==e)throw new G(t||"Value is nullable")}const $=(e,t="")=>(B(e,t),e),H=e=>t=>((e,t)=>e instanceof t)(t,e);function Y(e,t,s=""){if(!(e instanceof t))throw new G(s||`Value is expected to be of type '${t.name}'`)}const W=(e,t,s="")=>(Y(e,t,s),e);function K(e,t=""){if(""===$(e,t))throw new G(t||"Expected string value to be non-empty")}function Z(e,t=""){return K(e,t),e}function X(e,t=""){if(!e)throw new G(t||"Expected predicate to be truthy")}const q=e=>"string"==typeof e,J=e=>"object"==typeof e&&null!==e;var Q=s(39391),ee=s(33654),te=s(34126);s(72659);const se=Q.W,ie="charset=utf-8";var ne,ae,re;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(ne=ne||(ne={})),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="*/*"}(ae=ae||(ae={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(re=re||(re={}));const oe={mode:"cors",credentials:"include",redirect:"manual"},le=(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 ce 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(J(e))return q(e.message)?e.message:JSON.stringify(e);let t;try{t=JSON.parse(e)}catch{}return t&&q(t.message)?t.message:e})(t).substring(0,5e3):"")||a,this.payload=t}}const de=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 ce(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===se.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case ae.APPLICATION_JSON:return e.json();case ae.TEXT_PLAIN:return e.text();default:return Promise.reject(new ce(e,`Can't process response for request with Content-Type '${i}'`))}},he=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=>de(e,t,s))):fetch(e,t).then((e=>de(e,t,s))),ue=(e,t)=>{const s={};return s.Accept=ae.APPLICATION_JSON,e!==re.GET&&(s[ne.CONTENT_TYPE]=`${ae.APPLICATION_JSON};${ie}`),le(s,t)};class pe{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...oe,...e?.options??{}}}async get(e,t={},s,i,n,a){return this.request(re.GET,e,void 0,t,s,i,n,a)}async put(e,t={},s={},i,n,a,r){return this.request(re.PUT,e,t,s,i,n,a,r)}async post(e,t={},s={},i,n,a,r){return this.request(re.POST,e,t,s,i,n,a,r)}async delete(e,t={},s={},i,n,a,r){return this.request(re.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&&!V((()=>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(z).forEach((t=>i.searchParams.append(e,t.toString()))):i.searchParams.append(e,t.toString()))})),i.toString()})(this.baseUrl,t,a??{});let c;if((q(s)||J(s))&&r?.enableCompression&&(X(e!==re.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,ee.Wt)(J(e)?JSON.stringify(e):e)]))(s),n=le(n,{[ne.CONTENT_TYPE]:`${ae.APPLICATION_ZLIB};${ie}`})),void 0!==s)if(q(s)||s instanceof Blob)c=s;else{if(!J(s))throw new G("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:ue(e,n)};return fetch(l,d).then((e=>(e=>0===e.status||e.status===se.UNAUTHORIZED)(e)?he(l,d,o):de(e,d,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?he(l,d,o):Promise.reject(e)))}}const _e=(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 me;!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"}(me=me||(me={}));const ge="::",Ee="###",fe=["$implicit"];var Te,Ce,xe,Ne,Oe;(Oe=Te=Te||(Te={})).CORE="CORE",Oe.MAIN="ROOT",Oe.MODEL_GENERATION="MODEL_GENERATION_ROOT",Oe.SYSTEM="SYSTEM_ROOT",Oe.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(Ne=Ce=Ce||(Ce={})).STRING="String",Ne.BOOLEAN="Boolean",Ne.BINARY="Binary",Ne.NUMBER="Number",Ne.INTEGER="Integer",Ne.FLOAT="Float",Ne.DECIMAL="Decimal",Ne.DATE="Date",Ne.STRICTDATE="StrictDate",Ne.DATETIME="DateTime",Ne.STRICTTIME="StrictTime",Ne.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(xe=xe||(xe={}));const Ae=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var Se,ye,Ie,ve,Re,Pe,we,Le,be,De;(ye=Se=Se||(Se={})).ANY="meta::pure::metamodel::type::Any",ye.NIL="meta::pure::metamodel::type::Nil",ye.PROFILE_DOC="meta::pure::profiles::doc",ye.PROFILE_TEMPORAL="meta::pure::profiles::temporal",ye.PROFILE="meta::pure::metamodel::extension::Profile",ye.ENUMERATION="meta::pure::metamodel::type::Enumeration",ye.MEASURE="meta::pure::metamodel::type::Measure",ye.CLASS="meta::pure::metamodel::type::Class",ye.ASSOCIATION="meta::pure::metamodel::relationship::Association",ye.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",ye.FLAT_DATA="meta::flatData::metamodel::FlatData",ye.DATABASE="meta::relational::metamodel::Database",ye.MAPPING="meta::pure::mapping::Mapping",ye.SERVICE="meta::legend::service::metamodel::Service",ye.CONNECTION="meta::pure::runtime::PackageableConnection",ye.RUNTIME="meta::pure::runtime::PackageableRuntime",ye.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",ye.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",ye.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",ye.DATA_ELEMENT="meta::pure::data::DataElement",ye.TDS_ROW="meta::pure::tds::TDSRow",(Pe=Ie=Ie||(Ie={})).BUSINESS_TEMPORAL="businesstemporal",Pe.PROCESSING_TEMPORAL="processingtemporal",Pe.BITEMPORAL="bitemporal",(Re=ve=ve||(ve={})).ALL_VERSIONS="AllVersions",Re.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(Le=we=we||(we={})).STORE="STORE",Le.MAPPING="MAPPING",Le.RUNTIME="RUNTIME",Le.FILE_GENERATION="FILE_GENERATION",Le.SERVICE="SERVICE",(De=be=be||(be={})).TODAY="meta::pure::functions::date::today",De.NOW="meta::pure::functions::date::now",De.FIRST_DAY_OF_WEEK="meta::pure::functions::date::firstDayOfThisWeek",De.FIRST_DAY_OF_MONTH="meta::pure::functions::date::firstDayOfThisMonth",De.FIRST_DAY_OF_QUARTER="meta::pure::functions::date::firstDayOfThisQuarter",De.FIRST_DAY_OF_YEAR="meta::pure::functions::date::firstDayOfThisYear",De.PREVIOUS_DAY_OF_WEEK="meta::pure::functions::date::previousDayOfWeek",De.IS_ON_DAY="meta::pure::functions::date::isOnDay",De.IS_ON_OR_AFTER_DAY="meta::pure::functions::date::isOnOrAfterDay",De.IS_AFTER_DAY="meta::pure::functions::date::isAfterDay",De.IS_ON_OR_BEFORE_DAY="meta::pure::functions::date::isOnOrBeforeDay",De.IS_BEFORE_DAY="meta::pure::functions::date::isBeforeDay",De.MINUS="meta::pure::functions::math::minus",De.ADJUST="meta::pure::functions::date::adjust",De.LET="meta::pure::functions::lang::letFunction";const Me="yyyy-MM-dd'T'HH:mm:ssxxxx";var ke,Fe,je;!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"}(ke=ke||(ke={})),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"}(Fe=Fe||(Fe={})),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"}(je=je||(je={}));const Ue=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`;var Ve;!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"}(Ve=Ve||(Ve={}));const Ge={base:"vs-dark",inherit:!0,colors:{},rules:[{token:Ve.IDENTIFIER,foreground:"dcdcaa"},{token:Ve.NUMBER,foreground:"b5cea8"},{token:Ve.DATE,foreground:"b5cea8"},{token:Ve.COLOR,foreground:"b5cea8"},{token:Ve.PACKAGE,foreground:"808080"},{token:Ve.PARSER,foreground:"c586c0"},{token:Ve.LANGUAGE_STRUCT,foreground:"c586c0"},{token:Ve.MULTIPLICITY,foreground:"2d796b"},{token:Ve.GENERICS,foreground:"2d796b"},{token:Ve.PROPERTY,foreground:"9cdcfe"},{token:Ve.VARIABLE,foreground:"4fc1ff"},{token:Ve.TYPE,foreground:"3dc9b0"}]},ze={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 Be=s(79013);class $e{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,Be.qC)(this.schema,e)}fromJson(e){return(0,Be.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,S.Z)(t,(e=>null!==e))):e);var t}}const He=e=>(0,Be.PG)((t=>void 0===t?Be.AM:(0,Be.qC)(e,t)),(t=>(0,Be.vB)(e,t))),Ye=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?Be.AM:[],We=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?Be.AM:[]:Be.AM,Ke=e=>(0,Be.PG)((()=>e),(()=>e));var Ze=s(4e4);class Xe{_documentationKey;markdownText;title;text;url;related;static serialization=new $e((0,Be.yu)(Xe,{markdownText:(0,Be.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,Be.jt)((0,Be.pb)((0,Be.Ru)())),title:(0,Be.jt)((0,Be.Ru)()),text:(0,Be.jt)((0,Be.Ru)()),url:(0,Be.jt)((0,Be.Ru)())}));static create(e,t){const s=Xe.serialization.fromJson(e);return s._documentationKey=t,s}}const qe=e=>Object.entries(e).map((e=>({key:e[0],content:Xe.create(e[1],e[0])})));class Je{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(me.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,Ze.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(me.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(me.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]=Xe.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t._documentationKey})),e}}class Qe{}class et extends Qe{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 tt{config;logger;pluginManager;basePresets=[];basePlugins=[];baseUrl;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new et}setup(e){return this.baseUrl=Z(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 pe;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){U(e),this.logger.error(h.create(me.APPLICATION_CONFIGURATION_FAILURE),e)}B(s,"Can't fetch Legend application configuration");try{i=await t.get(`${window.location.origin}${e}version.json`)}catch(e){U(e),this.logger.error(h.create(me.APPLICATION_CONFIGURATION_FAILURE),e)}return B(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 pe(e.simple?{options:{credentials:"omit"}}:{}),i=await s.get(Z(e.url,"Can't load documentation registry: 'url' field is missing or empty"));B(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){U(e),this.logger.warn(h.create(me.APPLICATION_DOCUMENTATION_FETCH_FAILURE),e)}}))),e.keyedDocumentationEntries=[...qe(t),...e.keyedDocumentationEntries]}async start(){B(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(me.APPLICATION_LOADED),"Legend application loaded")}catch(e){throw U(e),this.logger.error(h.create(me.APPLICATION_LOAD_FAILURE),"Failed to load Legend application"),e}}}var st=s(74926),it=s(69038),nt=s(2784);class at{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 $(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 rt=s(40979);const ot=(0,nt.createContext)(void 0),lt=({children:e})=>{const t=(0,rt.k6)(),s=(0,it.fv)((()=>new at(t)));return(0,x.jsx)(ot.Provider,{value:s,children:e})};class ct{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 dt;!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"}(dt=dt||(dt={}));class ht{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 ut{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const n=new ht;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 pt,_t,mt,gt=s(94174);!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(pt||(pt={}));class Et{state;_message;_messageFormatter;constructor(){this.state=pt.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=pt.INITIAL,this}inProgress(){return this.state=pt.IN_PROGRESS,this}fail(){return this.state=pt.FAILED,this}pass(){return this.state=pt.SUCCEEDED,this}complete(e=!0){return e?this.pass():this.fail(),this}get isInInitialState(){return this.state===pt.INITIAL}get isInProgress(){return this.state===pt.IN_PROGRESS}get hasFailed(){return this.state===pt.FAILED}get hasSucceeded(){return this.state===pt.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 Et,{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"}(_t=_t||(_t={}));class ft{currentMode=_t.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!==_t.STANDARD}generateSearchText(e){switch(this.currentMode){case _t.INCLUDE:return`'"${e}"`;case _t.EXACT:return`="${e}"`;case _t.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(mt=mt||(mt={}));class Tt{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=Z(e.title),this.content=e.markdownText??e.text,this.url=e.url}setIsOpen(e){this.isOpen=e}}class Ct{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 xt=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class Nt{applicationStore;panelRenderingKey=(0,a.Z)();isHidden=!1;isOpen=!1;selectedTab=mt.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=Et.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 gt.Fuse(this.applicationStore.documentationService.getAllDocEntries().filter(xt),{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 ft((()=>{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 Ct(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter(z).filter(xt).map((e=>new Tt(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 Tt(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 Tt(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 Ot{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}class At{static logEvent_ApplicationInitialized(e,t){e.logEvent(me.APPLICATION_LOADED,t)}static logEvent_ApplicationContextAccessed(e,t){e.logEvent(me.APPLICATION_CONTEXT_ACCESSED,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(me.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED,t)}}class St{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 F(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&At.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 yt{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(me.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 It{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)&&L(t,e.key),this.updateHotkey(e.key,e.content.defaultKeyboardShortcut)})),t.length&&this.applicationStore.log.warn(h.create(me.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 vt,Rt;!function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(vt=vt||(vt={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(Rt=Rt||(Rt={}));const Pt=6e3;var wt;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(wt=wt||(wt={}));class Lt{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class bt{config;pluginManager;navigator;navigationContextService;notification;blockingAlertInfo;actionAlertInfo;log=new p;documentationService;assistantService;eventService=new Ot;telemetryService=new ct;tracerService=new ut;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 St(this),this.documentationService=new Je(this),this.assistantService=new Nt(this),this.telemetryService.registerPlugins(s.getTelemetryServicePlugins()),this.commandCenter=new yt(this),this.keyboardShortcutsService=new It(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 Lt(wt.INFO,e,t??[],null===s?void 0:s??Pt))}notifySuccess(e,t,s){this.setNotification(new Lt(wt.SUCCESS,e,t??[],null===s?void 0:s??Pt))}notifyWarning(e,t,s){this.setNotification(new Lt(wt.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??Pt))}notifyIllegalState(e,t,s){this.setNotification(new Lt(wt.ILEGAL_STATE,q(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??Pt))}notifyError(e,t){let s;e instanceof M?s=e.detail:e instanceof Error?s=e.message:(X(q(e),"Can't display error"),s=e),s&&this.setNotification(new Lt(wt.ERROR,s,t??[],void 0))}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return U(e),this.notifyIllegalState(e.message),t}};alertUnhandledError=e=>{this.log.error(h.create(me.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 Dt=(0,nt.createContext)(void 0),Mt=({children:e,config:t,pluginManager:s})=>{const i=$((0,nt.useContext)(ot),"Can't find web application navigator in context"),n=(0,it.fv)((()=>new bt(t,i,s)));return(0,x.jsx)(Dt.Provider,{value:n,children:e})},kt=()=>$((0,nt.useContext)(Dt),"Can't find application store in context");class Ft{appName;baseUrl;env;documentationUrl;documentationRegistryEntries=[];keyedDocumentationEntries=[];contextualDocEntries=[];appVersion;appVersionBuildTime;appVersionCommitId;constructor(e){var t;this.baseUrl=e.baseUrl,this.appName=Z(e.configData.appName,"Can't configure application: 'appName' field is missing or empty"),this.env=Z(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=qe(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=$(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=$(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=$(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}}class jt extends Ft{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),B(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=Z(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 Ut 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 Vt extends Ut{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new Vt}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 Gt=JSON.parse('{"i8":"7.1.13","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 zt extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Bt=e=>t=>(0,O.bi)(t)?t:e(t),$t=e=>(t,s)=>(0,O.bi)(t)?t:e(t,s),Ht=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})},Yt=Bt((e=>(0,O.rC)(e,{value:O.LO,valueForSerialization:O.Fl})));var Wt=s(34485),Kt=s(3096);const Zt=e=>Wt.sha1().update(e).digest("hex"),Xt=e=>Zt(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Zt(e):e.hashCode)).join(","));var qt,Jt;(Jt=qt=qt||(qt={})).PACKAGE="PACKAGE",Jt.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Jt.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Jt.PROFILE="PROFILE",Jt.TAG_POINTER="TAG_POINTER",Jt.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Jt.TAGGED_VALUE="TAGGED_VALUE",Jt.ENUMERATION="ENUMERATION",Jt.ENUM_VALUE="ENUM_VALUE",Jt.CLASS="CLASS",Jt.PROPERTY="PROPERTY",Jt.PROPERTY_POINTER="PROPERTY_POINTER",Jt.MULTIPLICITY="MULTIPLICITY",Jt.CONSTRAINT="CONSTRAINT",Jt.DERIVED_PROPERTY="DERIVED_PROPERTY",Jt.ASSOCIATION="ASSOCIATION",Jt.FUNCTION="FUNCTION",Jt.MEASURE="MEASURE",Jt.UNIT="UNIT",Jt.RUNTIME="RUNTIME",Jt.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Jt.ENGINE_RUNTIME="ENGINE_RUNTIME",Jt.LEGACY_RUNTIME="LEGACY_RUNTIME",Jt.RUNTIME_POINTER="RUNTIME_POINTER",Jt.STORE_CONNECTIONS="STORE_CONNECTIONS",Jt.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Jt.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Jt.CONNECTION_POINTER="CONNECTION_POINTER",Jt.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Jt.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Jt.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Jt.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Jt.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Jt.FLAT_DATA="FLAT_DATA",Jt.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Jt.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Jt.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Jt.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Jt.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Jt.FLAT_DATA_STRING="FLAT_DATA_STRING",Jt.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Jt.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Jt.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Jt.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Jt.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Jt.FLAT_DATA_DATE="FLAT_DATA_DATE",Jt.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Jt.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Jt.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Jt.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Jt.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Jt.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Jt.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Jt.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER",Jt.DATABASE="DATABASE",Jt.DATABASE_SCHEMA="DATABASE_SCHEMA",Jt.DATABASE_JOIN="DATABASE_JOIN",Jt.DATABASE_FILTER="DATABASE_FILTER",Jt.DATBASE_VIEW="DATBASE_VIEW",Jt.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Jt.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Jt.RELATIONAL="RELATIONAL",Jt.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Jt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Jt.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Jt.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Jt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Jt.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Jt.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Jt.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Jt.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Jt.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Jt.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Jt.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Jt.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Jt.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Jt.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Jt.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Jt.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Jt.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Jt.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Jt.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Jt.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Jt.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Jt.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Jt.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Jt.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Jt.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Jt.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Jt.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Jt.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Jt.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Jt.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Jt.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Jt.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Jt.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Jt.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Jt.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Jt.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Jt.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Jt.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Jt.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Jt.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Jt.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Jt.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Jt.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Jt.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Jt.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Jt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Jt.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Jt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Jt.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Jt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Jt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Jt.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Jt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Jt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Jt.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Jt.SCHEMA_MAPPER="SCHEMA_MAPPER",Jt.TABLE_MAPPER="TABLE_MAPPER",Jt.MAPPING="MAPPING",Jt.MAPPING_INCLUDE="MAPPING_INCLUDE",Jt.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Jt.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Jt.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Jt.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Jt.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Jt.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Jt.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Jt.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Jt.PROPERTY_MAPPING="PROPERTY_MAPPING",Jt.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Jt.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Jt.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Jt.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Jt.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Jt.MAPPING_TEST="MAPPING_TEST",Jt.STORE_TEST_DATA="STORE_TEST_DATA",Jt.INPUT_DATA="INPUT_DATA",Jt.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Jt.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Jt.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Jt.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Jt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Jt.FILTER_MAPPING="FILTER_MAPPING",Jt.COLUMN_MAPPING="COLUMN_MAPPING",Jt.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Jt.SERVICE="SERVICE",Jt.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Jt.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Jt.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Jt.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Jt.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Jt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Jt.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Jt.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Jt.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Jt.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Jt.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Jt.SERVICE_TEST="SERVICE_TEST",Jt.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Jt.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",Jt.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",Jt.GENERATION_TREE="GENERATION_TREE",Jt.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Jt.FILE_GENERATION="FILE_GENERATION",Jt.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Jt.SECTION_INDEX="SECTION_INDEX",Jt.SECTION="SECTION",Jt.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Jt.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Jt.RAW_LAMBDA="RAW_LAMBDA",Jt.RAW_VARIABLE="RAW_VARIABLE",Jt.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Jt.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Jt.ASSERT_FAIL="ASSERT_FAIL",Jt.ASSERT_PASS="ASSERT_PASS",Jt.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Jt.EQUAL_TO="EQUAL_TO",Jt.EQUAL_TO_JSON="EQUAL_TO_JSON",Jt.EQUAL_TO_TDS="EQUAL_TO_TDS",Jt.TEST_RESULT="TEST_RESULT",Jt.TEST_ERROR="TEST_ERROR",Jt.TEST_FAILED="TEST_FAILED",Jt.TEST_PASSED="TEST_PASSED",Jt.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Jt.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Jt.MODEL_STORE_DATA="MODEL_STORE_DATA",Jt.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Jt.DATA_ELEMENT="DATA_ELEMENT",Jt.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Jt.RELATIONAL_TDS="RELATIONAL_TDS",Jt.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Jt.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Jt.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Jt.EXPRESSION="EXPRESSION",Jt.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Jt.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Jt.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Jt.INSTANCE_VALUE="INSTANCE_VALUE",Jt.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Jt.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Jt.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Jt.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Jt.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Jt.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Jt.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Jt.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Jt.FUNCTION_TYPE="FUNCTION_TYPE",Jt.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Jt.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Jt.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Jt.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Jt.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Jt.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Jt.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Jt.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE";const Qt=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},X(J(t=e),"Can't hash non-object value"),Kt(t,s);var t,s},es=(e,t)=>Xt([e?Qt(e):"",t?Qt(t):""]),ts=(e,t)=>[qt.PACKAGEABLE_ELEMENT_POINTER,e,t].map(Zt).join(",");class ss{stereotypes=[];taggedValues=[]}class is extends ss{name}class ns extends is{_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 Xt([qt.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new F(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class as extends ns{}class rs extends as{_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 Xt([qt.CLASS,this.path,Xt(this.properties),Xt(this.derivedProperties),Xt(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),Xt(this.constraints),Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class os extends as{}class ls extends os{values=[];get _elementHashCode(){return Xt([qt.ENUMERATION,this.path,Xt(this.values),Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class cs extends os{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return Xt([qt.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new j}}class ds extends as{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return Xt([qt.MEASURE,this.path,this.canonicalUnit??"",Xt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class hs extends ns{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class us{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return Xt([qt.SECTION,this.parserName,Xt(this.elements.map((e=>e.valueForSerialization??"")))])}}class ps extends us{imports=[];get hashCode(){return Xt([qt.IMPORT_AWARE_CODE_SECTION,super.hashCode,Xt(this.imports.map((e=>e.valueForSerialization??"")))])}}class _s extends us{get hashCode(){return Xt([qt.DEFAULT_CODE_SECTION,super.hashCode])}}class ms{_UUID=(0,a.Z)()}class gs extends ms{ownerReference;constructor(e){super(),this.ownerReference=e}}class Es extends ms{value;constructor(e){super(),this.value=e}}class fs extends Es{constructor(e){super(e)}static create(e){return new fs(e)}get valueForSerialization(){return this.value.path}}const Ts=Bt((e=>(0,O.rC)(e,{name:O.LO,value:O.LO.ref,hashCode:O.Fl}))),Cs=Bt((e=>(Ht(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 Es&&Yt(e)})),e.configurationProperties.forEach(Ts),e))),xs=Bt((e=>((0,O.rC)(e,{id:O.LO,hashCode:O.Fl}),Yt(e.generationElement),e))),Ns=Bt((e=>(Ht(e),(0,O.rC)(e,{generationNodes:O.LO,fileGenerations:O.LO,_elementHashCode:O.KG}),e.generationNodes.forEach(xs),e.fileGenerations.forEach(Yt),e)));var Os=s(67295),As=s(72531);const Ss=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,ys=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],Is=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,Os.P)(e,void 0,s);return B(i,"Can't stringify lossless JSON value"),i})((0,As.Q)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};class vs{}class Rs extends vs{expectedOutput;constructor(e){super(),this.expectedOutput=Is(e)}get hashCode(){return Xt([qt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class Ps{}class ws extends Ps{mappings=[];connections=[];get hashCode(){return Xt([qt.ENGINE_RUNTIME,Xt(this.mappings.map((e=>ts(we.MAPPING,e.valueForSerialization??"")))),Xt(this.connections.filter((e=>e.storeConnections.length)))])}}class Ls extends Ps{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return Xt([qt.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class bs{}class Ds extends bs{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return Xt([qt.FLAT_DATA_INPUT_DATA,ts(we.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var Ms,ks,Fs;(Fs=Ms=Ms||(Ms={})).JSON="JSON",Fs.XML="XML";class js extends bs{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===Ms.JSON?Is(s):s}get hashCode(){return Xt([qt.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(ks=ks||(ks={}));class Us extends bs{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return Xt([qt.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const Vs=Bt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),Yt(e.type),e))),Gs=Bt((e=>(0,O.rC)(e,{body:O.LO.ref,parameters:O.LO.ref,hashCode:O.Fl}))),zs=Bt((e=>((0,O.rC)(e,{name:O.LO,multiplicity:O.LO,hashCode:O.Fl}),Yt(e.type),e)));class Bs{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){Gs(e)}visit_RawVariableExpression(e){zs(e)}visit_RawPrimitiveInstanceValue(e){Vs(e)}}$t(((e,t)=>(e.accept_RawValueSpecificationVisitor(new Bs(t)),e)));class $s{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class Hs extends $s{trueString;falseString;get hashCode(){return Xt([qt.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class Ys extends $s{get hashCode(){return Xt([qt.FLAT_DATA_STRING])}}class Ws extends $s{get hashCode(){return Xt([qt.FLAT_DATA_NUMBER])}}class Ks extends $s{dateFormat;timeZone;get hashCode(){return Xt([qt.FLAT_DATA_DATE,this.dateFormat?Xt(this.dateFormat):"",this.timeZone??""])}}class Zs extends $s{fields=[];get hashCode(){return Xt([qt.FLAT_DATA_RECORD_TYPE,Xt(this.fields)])}}const Xs=$t(((e,t)=>(yr(e,t),(0,O.rC)(e,{flatData:O.LO,sectionName:O.LO,hashCode:O.Fl}),e))),qs=Bt((e=>((0,O.rC)(e,{label:O.LO,flatDataDataType:O.LO,optional:O.LO,address:O.LO,hashCode:O.Fl}),(e=>{e instanceof Hs?(0,O.rC)(e,{trueString:O.LO,falseString:O.LO,hashCode:O.Fl}):e instanceof Ys||e instanceof Ws?(0,O.rC)(e,{hashCode:O.Fl}):e instanceof Ks?(0,O.rC)(e,{dateFormat:O.LO,timeZone:O.LO,hashCode:O.Fl}):e instanceof Zs&&Bt(Js)(e)})(e.flatDataDataType),e)));function Js(e){return(0,O.rC)(e,{fields:O.LO,hashCode:O.Fl}),e.fields.forEach(qs),e}Bt(Js);const Qs=Bt(Js),ei=Bt((e=>((0,O.rC)(e,{name:O.LO,value:O.LO,hashCode:O.Fl}),e))),ti=Bt((e=>((0,O.rC)(e,{driverId:O.LO,name:O.LO,sectionProperties:O.LO,recordType:O.LO,hashCode:O.Fl}),e.sectionProperties.forEach(ei),e.recordType&&Qs(e.recordType),e))),si=(Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Yt(e.ownerReference),e))),Bt((e=>(Ht(e),(0,O.rC)(e,{sections:O.LO,_elementHashCode:O.KG}),e.sections.forEach(ti),e)))),ii=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),ni=$t(((e,t)=>(Dr(e,t),(0,O.rC)(e,{filter:O.LO,hashCode:O.Fl}),ii(e.sourceRootRecordType),e.filter&&Gs(e.filter),e))),ai=$t(((e,t)=>(yr(e,t),Dr(e,t),(0,O.rC)(e,{rootInstanceSetImplementation:O.LO,hashCode:O.Fl}),e))),ri=$t(((e,t)=>(yr(e,t),(0,O.rC)(e,{transformer:O.LO,transform:O.LO,hashCode:O.Fl}),Gs(e.transform),e))),oi=Bt((e=>((0,O.rC)(e,{data:O.LO,hashCode:O.Fl}),Yt(e.sourceFlatData),e))),li=Bt((e=>((0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),e)));class ci{}class di extends ci{serverPrincipal;get hashCode(){return Xt([qt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class hi extends ci{get hashCode(){return Xt([qt.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class ui extends ci{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return Xt([qt.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class pi extends ci{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return Xt([qt.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class _i extends ci{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return Xt([qt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class mi extends ci{get hashCode(){return Xt([qt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class gi extends ci{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return Xt([qt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,Xt(this.additionalGcpScopes)])}}class Ei extends ci{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return Xt([qt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class fi extends ci{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return Xt([qt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class Ti{}class Ci extends Ti{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return Xt([qt.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class xi extends Ti{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 Xt([qt.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class Ni extends Ti{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return Xt([qt.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class Oi extends Ti{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return Xt([qt.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",Xt(this.testDataSetupSqls)])}}class Ai extends Ti{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 Xt([qt.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 Si extends Ti{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 Xt([qt.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class yi extends Ti{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return Xt([qt.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class Ii{_UUID=(0,a.Z)()}class vi extends Ii{mappers=[];get hashCode(){return Xt([qt.MAPPER_POST_PROCESSOR,Xt(this.mappers)])}}const Ri="{target}",Pi="default";class wi{}class Li extends wi{}class bi extends Li{}class Di extends bi{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return Xt([qt.RELATIONAL_OPERATION_DYNA_FUNC,this.name,Xt(this.parameters)])}}var Mi;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(Mi=Mi||(Mi={}));const ki=e=>[e].concat(e.children.length?ki(e.children[0]):[]);class Fi extends wi{relationalOperationElement;joinTreeNode;get hashCode(){return Xt([qt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,Xt(this.joinTreeNode?ki(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class ji extends wi{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new j}}class Ui extends wi{alias;column;columnName;get hashCode(){return Xt([qt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?Ri:this.alias.name,this.column.value.name])}}class Vi extends wi{value;constructor(e){super(),this.value=e}get hashCode(){return Xt([qt.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class Gi extends wi{values=[];get hashCode(){return Xt([qt.RELATIONAL_OPERATION_LITERAL_LIST,Xt(this.values)])}}class zi extends wi{owner;name;type;nullable;get hashCode(){return Xt([qt.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class Bi{}class $i extends Bi{infinityDate}class Hi{}class Yi extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_BIGINT])}}class Wi extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_SMALLINT])}}class Ki extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_TINYINT])}}class Zi extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_INTEGER])}}class Xi extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_FLOAT])}}class qi extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_DOUBLE])}}class Ji extends Hi{size;constructor(e){super(),this.size=e}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class Qi extends Hi{size;constructor(e){super(),this.size=e}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class en extends Hi{size;constructor(e){super(),this.size=e}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class tn extends Hi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class sn extends Hi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class nn extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_TIMESTAMP])}}class an extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_VARCHAR])}}class rn extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_BIT])}}class on extends Hi{size;constructor(e){super(),this.size=e}get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class ln extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_REAL])}}class cn extends Hi{get hashCode(){return Xt([qt.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class dn extends gs{ownerReference;constructor(e){super(e),this.ownerReference=e}}class hn extends dn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[qt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Zt).join(",")}get selfJoinPointerHashCode(){return[qt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Pi,Ri].map(Zt).join(",")}}class un extends dn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[qt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Zt).join(",")}get selfJoinPointerHashCode(){return[qt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",Pi,Ri].map(Zt).join(",")}}class pn{}class _n extends pn{_UUID=(0,a.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return Xt([this.from,this.to])}}class mn extends _n{get hashCode(){return Xt([super.hashCode,qt.SCHEMA_MAPPER])}}class gn extends _n{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return Xt([super.hashCode,qt.TABLE_MAPPER,this.schema])}}const En=Bt((e=>((0,O.rC)(e,{packageableElementIncludes:O.LO,packageableElementExcludes:O.LO,hashCode:O.Fl}),e.packageableElementIncludes.forEach(Yt),e.packageableElementExcludes.forEach(Yt),e))),fn=(Bt((e=>(Tr(e),(0,O.rC)(e,{schemaSet:O.LO,schemaId:O.LO,contentType:O.LO,modelUnit:O.LO,_elementHashCode:O.KG}),e.schemaSet&&Yt(e.schemaSet),En(e.modelUnit),e))),Bt((e=>((0,O.rC)(e,{binding:O.LO,hashCode:O.Fl}),Yt(e.binding),e)))),Tn=Bt((e=>((0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),e))),Cn=(Bt((e=>(Jr(e),(0,O.rC)(e,{externalSource:O.LO,hashCode:O.Fl}),Tn(e.externalSource),e))),Bt((e=>(0,O.rC)(e,{id:O.LO,location:O.LO,content:O.LO,hashCode:O.Fl})))),xn=(Bt((e=>(Ht(e),(0,O.rC)(e,{format:O.LO,schemas:O.LO,_elementHashCode:O.KG}),e.schemas.forEach(Cn),e))),Bt((e=>e instanceof Yi||e instanceof Wi||e instanceof Ki||e instanceof Zi||e instanceof Xi||e instanceof qi||e instanceof nn||e instanceof Date||e instanceof an||e instanceof rn||e instanceof ln||e instanceof cn?(0,O.rC)(e,{hashCode:O.Fl}):e instanceof Ji||e instanceof Qi||e instanceof en||e instanceof on?(0,O.rC)(e,{size:O.LO,hashCode:O.Fl}):e instanceof tn||e instanceof sn?(0,O.rC)(e,{precision:O.LO,scale:O.LO,hashCode:O.Fl}):e))),Nn=Bt((e=>((0,O.rC)(e,{name:O.LO,type:O.LO,nullable:O.LO,hashCode:O.Fl}),xn(e.type),e))),On=Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl,selfJoinPointerHashCode:O.Fl}),Yt(e.ownerReference),e))),An=Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl,selfJoinPointerHashCode:O.Fl}),Yt(e.ownerReference),e))),Sn=Bt((e=>((0,O.rC)(e,{relation:O.LO,name:O.LO,database:O.LO,isSelfJoinTarget:O.LO}),(e=>{e instanceof un?An(e):e instanceof hn&&On(e)})(e.relation),e))),yn=Bt((e=>((0,O.rC)(e,{name:O.LO,parameters:O.LO,hashCode:O.Fl}),e.parameters.forEach(Dn),e))),In=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),vn=Bt((e=>((0,O.rC)(e,{alias:O.LO,column:O.LO,columnName:O.LO,hashCode:O.Fl}),Sn(e.alias),In(e.column),e))),Rn=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),Pn=Bt((e=>((0,O.rC)(e,{alias:O.LO,children:O.LO,joinType:O.LO,hashCode:O.Fl}),e.alias&&Sn(e.alias),e.children.forEach(Pn),Rn(e.join),e))),wn=Bt((e=>((0,O.rC)(e,{relationalOperationElement:O.LO,joinTreeNode:O.LO,hashCode:O.Fl}),e.relationalOperationElement&&Dn(e.relationalOperationElement),e.joinTreeNode&&Pn(e.joinTreeNode),e))),Ln=Bt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),e.value instanceof wi&&Dn(e.value),e))),bn=Bt((e=>((0,O.rC)(e,{values:O.LO,hashCode:O.Fl}),e.values.forEach(Ln),e)));function Dn(e){return e instanceof Di?yn(e):e instanceof ji?Sn(e):e instanceof Ui?vn(e):e instanceof zi?Nn(e):e instanceof Vi?Ln(e):e instanceof Gi?bn(e):e instanceof Fi?wn(e):e}const Mn=Bt((e=>e)),kn=$t(((e,t)=>{if(e instanceof $i)return Mn(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})),Fn=Bt((e=>((0,O.rC)(e,{columnName:O.LO,relationalOperationElement:O.LO,hashCode:O.Fl}),Dn(e.relationalOperationElement),e))),jn=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),Un=Bt((e=>((0,O.rC)(e,{joinTreeNode:O.LO,database:O.LO,filterName:O.LO,hashCode:O.Fl}),e.joinTreeNode&&Pn(e.joinTreeNode),jn(e.filter),e))),Vn=Bt((e=>((0,O.rC)(e,{columns:O.LO}),e.columns.forEach(Dn),e))),Gn=e=>{(0,O.rC)(e,{columns:O.LO,name:O.LO})},zn=$t(((e,t)=>(Gn(e),(0,O.rC)(e,{primaryKey:O.LO,hashCode:O.Fl}),e.primaryKey.forEach(Nn),e.milestoning.forEach((e=>kn(e,t))),e))),Bn=$t(((e,t)=>(Gn(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(Nn),e.columnMappings.forEach(Fn),e.filter&&Un(e.filter),e.groupBy&&Vn(e.groupBy),e))),$n=$t(((e,t)=>((0,O.rC)(e,{name:O.LO,tables:O.LO,views:O.LO,hashCode:O.Fl}),e.tables.forEach((e=>zn(e,t))),e.views.forEach((e=>Bn(e,t))),e))),Hn=Bt((e=>((0,O.rC)(e,{name:O.LO,operation:O.LO,hashCode:O.Fl}),Dn(e.operation),e))),Yn=Bt((e=>((0,O.rC)(e,{name:O.LO,target:O.LO,aliases:O.LO,operation:O.LO,hashCode:O.Fl}),e.target&&Sn(e.target),Dn(e.operation),e))),Wn=$t(((e,t)=>(Ht(e),(0,O.rC)(e,{schemas:O.LO,joins:O.LO,filters:O.LO,_elementHashCode:O.KG}),e.schemas.forEach((e=>$n(e,t))),e.joins.forEach(Yn),e.filters.forEach(Hn),e))),Kn=$t(((e,t)=>(yr(e,t),(0,O.rC)(e,{transformer:O.LO,relationalOperation:O.LO.ref,bindingTransformer:O.LO,hashCode:O.Fl}),e.bindingTransformer&&fn(e.bindingTransformer),e))),Zn=(e,t)=>(Dr(e,t),yr(e,t),(0,O.rC)(e,{id:O.LO,rootInstanceSetImplementation:O.LO,primaryKey:O.LO}),e.primaryKey.forEach(Dn),e),Xn=$t(Zn),qn=$t(((e,t)=>(Zn(e,t),(0,O.rC)(e,{inlineSetImplementation:O.LO}),Gr(e.inlineSetImplementation,t),e))),Jn=$t(((e,t)=>(Zn(e,t),(0,O.rC)(e,{otherwisePropertyMapping:O.LO,hashCode:O.Fl}),Rr(e.otherwisePropertyMapping,t),e))),Qn=$t(((e,t)=>(Dr(e,t),(0,O.rC)(e,{primaryKey:O.LO}),e.primaryKey.forEach(Dn),e))),ea=$t(((e,t)=>(Dr(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(Fn),e.filter&&Un(e.filter),e.groupBy&&Vn(e.groupBy),e.mainTableAlias&&Sn(e.mainTableAlias),e))),ta=Bt((e=>((0,O.rC)(e,{data:O.LO,inputType:O.LO,hashCode:O.Fl}),Yt(e.database),e))),sa=Bt((e=>(0,O.rC)(e,{host:O.LO,port:O.LO,databaseName:O.LO,hashCode:O.Fl}))),ia=Bt((e=>(0,O.rC)(e,{hostname:O.LO,port:O.LO,protocol:O.LO,httpPath:O.LO,hashCode:O.Fl}))),na=Bt((e=>(0,O.rC)(e,{databaseName:O.LO,directory:O.LO,autoServerMode:O.LO,hashCode:O.Fl}))),aa=Bt((e=>(0,O.rC)(e,{testDataSetupCsv:O.LO,testDataSetupSqls:O.LO,hashCode:O.Fl}))),ra=Bt((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}))),oa=Bt((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}))),la=Bt((e=>(0,O.rC)(e,{projectId:O.LO,defaultDataset:O.LO,proxyHost:O.LO,proxyPort:O.LO,hashCode:O.Fl}))),ca=Bt((e=>(0,O.rC)(e,{serverPrincipal:O.LO,hashCode:O.Fl}))),da=Bt((e=>(0,O.rC)(e,{hashCode:O.Fl}))),ha=Bt((e=>(0,O.rC)(e,{apiToken:O.LO,hashCode:O.Fl}))),ua=Bt((e=>(0,O.rC)(e,{oauthKey:O.LO,scopeName:O.LO,hashCode:O.Fl}))),pa=Bt((e=>(0,O.rC)(e,{privateKeyVaultReference:O.LO,passPhraseVaultReference:O.LO,publicUserName:O.LO,hashCode:O.Fl}))),_a=Bt((e=>(0,O.rC)(e,{hashCode:O.Fl}))),ma=Bt((e=>(0,O.rC)(e,{hashCode:O.Fl,userNameVaultReference:O.LO,passwordVaultReference:O.LO,baseVaultReference:O.LO}))),ga=Bt((e=>(0,O.rC)(e,{hashCode:O.Fl,serviceAccountEmail:O.LO,additionalGcpScopes:O.LO}))),Ea=Bt((e=>(0,O.rC)(e,{hashCode:O.Fl,vaultReference:O.LO}))),fa=e=>{(0,O.rC)(e,{from:O.LO,to:O.LO,hashCode:O.Fl})},Ta=Bt((e=>(fa(e),e))),Ca=Bt((e=>(fa(e),(0,O.rC)(e,{schema:O.LO}),Ta(e.schema),e))),xa=$t(((e,t)=>((e=>{Jr(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 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);if(e instanceof yi)return la(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 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 mi)return _a(e);if(e instanceof Ei)return ma(e);if(e instanceof gi)return ga(e);if(e instanceof fi)return Ea(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 vi)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 mn?Ta(e):e instanceof gn&&Ca(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 Na{id}class Oa extends Na{__parent;assertions=[]}class Aa extends Na{__parent;tests=[]}class Sa extends Oa{serializationFormat;parameters=[];keys=[];get hashCode(){return Xt([qt.SERVICE_TEST,this.id,Xt(this.assertions),Xt(this.parameters),Xt(this.keys),this.serializationFormat??""])}}class ya extends Oa{query;get hashCode(){return Xt([qt.MAPPING_TEST,this.query,this.id,Xt(this.assertions)])}}class Ia extends Aa{storeTestDatas=[];get hashCode(){return Xt([qt.MAPPING_TEST_SUITE,Xt(this.storeTestDatas),this.id,Xt(this.tests)])}}class va extends Aa{testData;get hashCode(){return Xt([qt.SERVICE_TEST_SUITE,this.id,Xt(this.tests),this.testData])}}class Ra{id;parentTest}class Pa extends Ra{expected;get hashCode(){return Xt([qt.EQUAL_TO,this.id,Qt(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class wa extends Ra{expected;get hashCode(){return Xt([qt.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class La extends Ra{expected;get hashCode(){return Xt([qt.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class ba{}class Da extends ba{dataElement;get hashCode(){return Xt([qt.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class Ma extends ba{contentType;data;get hashCode(){return Xt([qt.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class ka extends ba{instances;get hashCode(){return Xt([qt.MODEL_STORE_DATA,Xt(Array.from(this.instances.keys()).map((e=>e.path))),Qt(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class Fa extends ba{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return Xt([qt.RELATIONAL_CSV_DATA_TABLE,Xt(this.tables)])}}const ja=Bt((e=>((0,O.rC)(e,{contentType:O.LO,data:O.LO,hashCode:O.Fl}),e))),Ua=Bt((e=>((0,O.rC)(e,{dataElement:O.LO,hashCode:O.Fl}),e))),Va=Bt((e=>((0,O.rC)(e,{instances:O.LO,hashCode:O.Fl}),e))),Ga=Bt((e=>((0,O.rC)(e,{values:O.LO,table:O.LO,schema:O.LO,hashCode:O.Fl}),e))),za=Bt((e=>((0,O.rC)(e,{tables:O.LO,hashCode:O.Fl}),e.tables.forEach(Ga),e)));function Ba(e,t){if(e instanceof Da)return Ua(e);if(e instanceof Ma)return ja(e);if(e instanceof ka)return Va(e);if(e instanceof Fa)return za(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 $a=$t(((e,t)=>(Ht(e),(0,O.rC)(e,{stereotypes:O.LO,taggedValues:O.LO,data:O.LO,_elementHashCode:O.KG}),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),Ba(e.data,t),e)));class Ha{}class Ya extends Ha{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return Xt([qt.SERVICE_PURE_EXECUTION,this.func])}}class Wa extends Ya{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return Xt([qt.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class Ka extends Ya{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return Xt([qt.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,Xt(this.executionParameters)])}}class Za{_OWNER;constructor(e){this._OWNER=e}}class Xa extends Za{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return Xt([qt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,Xt(this.asserts)])}}class qa extends Za{tests=[];get hashCode(){return Xt([qt.SERVICE_LEGACY_MULTI_EXECUTION_TEST,Xt(this.tests)])}}const Ja=$t(((e,t)=>((0,O.rC)(e,{connectionId:O.LO,testData:O.LO,hashCode:O.Fl}),Ba(e.testData,t),e))),Qa=Bt((e=>((0,O.rC)(e,{name:O.LO,value:O.LO.ref,hashCode:O.Fl}),e))),er=Bt((e=>((0,O.rC)(e,{assertion:O.LO,hashCode:O.Fl,id:O.LO}),Gs(e.assertion),e))),tr=Bt((e=>((0,O.rC)(e,{assertions:O.LO,description:O.LO,parameters:O.LO,hashCode:O.Fl}),e.assertions.forEach(er),e.parameters.forEach(Gs),e))),sr=$t(((e,t)=>((0,O.rC)(e,{connectionsTestData:O.LO,hashCode:O.Fl}),e.connectionsTestData.forEach((e=>Ja(e,t))),e))),ir=Bt((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(Qa),e.assertions.forEach(fr),e))),nr=$t(((e,t)=>((0,O.rC)(e,{id:O.LO,tests:O.LO,testData:O.LO,hashCode:O.Fl}),e.tests.forEach((e=>Er(e,t))),sr(e.testData,t),e))),ar=Bt((e=>((0,O.rC)(e,{parametersValues:O.LO,assert:O.LO,singleExecutionTestParent:O.LO,hashCode:O.Fl}),Gs(e.assert),e))),rr=Bt((e=>((0,O.rC)(e,{data:O.LO,asserts:O.LO,hashCode:O.Fl}),e.asserts.forEach(ar),e))),or=Bt((e=>(rr(e),(0,O.rC)(e,{key:O.LO}),e))),lr=Bt((e=>((0,O.rC)(e,{tests:O.LO,hashCode:O.Fl}),e.tests.forEach(or),e))),cr=e=>{(0,O.rC)(e,{func:O.LO}),Gs(e.func)},dr=$t(((e,t)=>(cr(e),(0,O.rC)(e,{runtime:O.LO,hashCode:O.Fl}),e.mapping&&Yt(e.mapping),e.runtime&&ho(e.runtime,t),e))),hr=$t(((e,t)=>((0,O.rC)(e,{key:O.LO,runtime:O.LO,hashCode:O.Fl}),Yt(e.mapping),ho(e.runtime,t),e))),ur=$t(((e,t)=>(cr(e),(0,O.rC)(e,{executionKey:O.LO,executionParameters:O.LO,hashCode:O.Fl}),e.executionParameters.forEach((e=>hr(e,t))),e))),pr=$t(((e,t)=>(Ht(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(go),e.taggedValues.forEach(fo),((e,t)=>{e instanceof Wa?dr(e,t):e instanceof Ka&&ur(e,t)})(e.execution,t),e.test&&(e=>{e instanceof Xa?rr(e):e instanceof qa&&lr(e)})(e.test),e.tests.forEach((e=>nr(e,t))),e.postValidations.forEach((e=>tr(e))),e))),_r=Bt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),e))),mr=Bt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),ja(e.expected),e))),gr=Bt((e=>((0,O.rC)(e,{id:O.LO,expected:O.LO,hashCode:O.Fl}),ja(e.expected),e)));function Er(e,t){if(e instanceof Sa)return ir(e);if(e instanceof ya)return xr(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 fr(e){return e instanceof Pa?_r(e):e instanceof wa?gr(e):e instanceof La?mr(e):e}const Tr=e=>{Ht(e),(0,O.rC)(e,{includes:O.LO}),e.includes.forEach(Yt)},Cr=$t(((e,t)=>((0,O.rC)(e,{store:O.LO,data:O.LO,hashCode:O.Fl}),Ba(e.data,t),e))),xr=Bt((e=>((0,O.rC)(e,{id:O.LO,query:O.LO,assertions:O.LO,hashCode:O.Fl}),e.assertions.forEach(fr),e))),Nr=$t(((e,t)=>((0,O.rC)(e,{id:O.LO,tests:O.LO,storeTestDatas:O.LO,hashCode:O.Fl}),e.tests.forEach((e=>Er(e,t))),e.storeTestDatas.forEach((e=>Cr(e,t))),e))),Or=Bt((e=>((0,O.rC)(e,{value:O.LO,valueForSerialization:O.Fl}),Yt(e.ownerReference),e))),Ar=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),Sr=Bt((e=>((0,O.rC)(e,{localMappingProperty:O.LO,localMappingPropertyType:O.LO,localMappingPropertyMultiplicity:O.LO,hashCode:O.Fl}),Yt(e.localMappingPropertyType),e))),yr=(e,t)=>{(0,O.rC)(e,{sourceSetImplementation:O.LO,targetSetImplementation:O.LO}),bo(e.property),Ar(e.sourceSetImplementation),e.targetSetImplementation&&Ar(e.targetSetImplementation),e.localMappingProperty&&Sr(e.localMappingProperty)},Ir=$t(((e,t)=>(yr(e,t),(0,O.rC)(e,{transformer:O.LO,transform:O.LO,explodeProperty:O.LO,hashCode:O.Fl}),e.transformer&&Or(e.transformer),Gs(e.transform),e)));class vr{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){Ir(e,this.observerContext)}visit_FlatDataPropertyMapping(e){ri(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){ai(e,this.observerContext)}visit_RelationalPropertyMapping(e){Kn(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){Xs(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){Xn(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){qn(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){Jn(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const Rr=(e,t)=>(e.accept_PropertyMappingVisitor(new vr(t)),e),Pr=Bt((e=>(0,O.rC)(e,{isDefault:O.Fl,valueForSerialization:O.Fl}))),wr=Bt((e=>(0,O.rC)(e,{valueForSerialization:O.Fl}))),Lr=e=>{(0,O.rC)(e,{root:O.LO}),Yt(e.class),Pr(e.id),wr(e.root)},br=Bt((e=>((0,O.rC)(e,{setImplementation:O.LO,class:O.LO,properties:O.LO}),e))),Dr=(e,t)=>{Lr(e),(0,O.rC)(e,{mappingClass:O.LO,propertyMappings:O.LO}),e.mappingClass&&br(e.mappingClass),e.propertyMappings.forEach((e=>Rr(e,t)))},Mr=Bt((e=>((0,O.rC)(e,{}),Ar(e.setImplementation),e))),kr=e=>{Lr(e),(0,O.rC)(e,{parameters:O.LO,operation:O.LO,hashCode:O.Fl}),e.parameters.forEach(Mr)},Fr=Bt((e=>(kr(e),e))),jr=Bt((e=>(kr(e),(0,O.rC)(e,{validationFunction:O.LO}),Gs(e.validationFunction),e))),Ur=$t(((e,t)=>(Dr(e,t),(0,O.rC)(e,{filter:O.LO,hashCode:O.Fl}),e.srcClass&&Yt(e.srcClass),e.filter&&Gs(e.filter),e)));class Vr{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){jr(e)}visit_OperationSetImplementation(e){Fr(e)}visit_PureInstanceSetImplementation(e){Ur(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){ni(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){Qn(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){ea(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const Gr=(e,t)=>(e.accept_SetImplementationVisitor(new Vr(t)),e),zr=Bt((e=>((0,O.rC)(e,{original:O.LO,substitute:O.LO}),Yt(e.original),Yt(e.substitute),e))),Br=Bt((e=>((0,O.rC)(e,{included:O.LO,storeSubstitutions:O.LO}),Yt(e.included),e.storeSubstitutions.forEach(zr),e))),$r=Bt((e=>(0,O.rC)(e,{value:O.LO}))),Hr=Bt((e=>((0,O.rC)(e,{sourceValues:O.LO,hashCode:O.Fl}),Io(e.enum),e.sourceValues.forEach($r),e))),Yr=Bt((e=>((0,O.rC)(e,{sourceType:O.LO,enumValueMappings:O.LO,hashCode:O.Fl}),Yt(e.enumeration),Pr(e.id),e.sourceType&&Yt(e.sourceType),e.enumValueMappings.forEach(Hr),e))),Wr=$t(((e,t)=>((0,O.rC)(e,{id:O.LO,stores:O.LO,propertyMappings:O.LO,hashCode:O.Fl}),Yt(e.association),Pr(e.id),e.stores.forEach(Yt),e.propertyMappings.forEach((e=>Rr(e,t))),e))),Kr=Bt((e=>((0,O.rC)(e,{inputType:O.LO,data:O.LO,hashCode:O.Fl}),Yt(e.sourceClass),e))),Zr=Bt((e=>(0,O.rC)(e,{expectedOutput:O.LO,hashCode:O.Fl}))),Xr=$t(((e,t)=>((0,O.rC)(e,{name:O.LO,query:O.LO,inputData:O.LO,assert:O.LO,hashCode:O.Fl}),Gs(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof js)return Kr(e);if(e instanceof Ds)return oi(e);if(e instanceof Us)return ta(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 Rs&&Zr(e)})(e.assert),e))),qr=$t(((e,t)=>(Ht(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(Br),e.classMappings.forEach((e=>Gr(e,t))),e.enumerationMappings.forEach(Yr),e.associationMappings.forEach((e=>Wr(e,t))),e.test.forEach((e=>Xr(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof va?nr(e,t):e instanceof Ia?Nr(e,t):e}(e,t))),e))),Jr=e=>{(0,O.rC)(e,{store:O.LO}),Yt(e.store)},Qr=Bt((e=>(Jr(e),(0,O.rC)(e,{hashCode:O.Fl}),e))),eo=Bt((e=>(Jr(e),(0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),Yt(e.class),e))),to=Bt((e=>(Jr(e),(0,O.rC)(e,{url:O.LO,hashCode:O.Fl}),Yt(e.class),e))),so=Bt((e=>(Jr(e),(0,O.rC)(e,{mappings:O.LO,hashCode:O.Fl}),e.mappings.forEach(Yt),e)));class io{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){Qr(e)}visit_ModelChainConnection(e){so(e)}visit_JsonModelConnection(e){eo(e)}visit_XmlModelConnection(e){to(e)}visit_FlatDataConnection(e){li(e)}visit_RelationalDatabaseConnection(e){xa(e,this.observerContext)}}const no=(e,t)=>(e.accept_ConnectionVisitor(new io(t)),e),ao=$t(((e,t)=>(Ht(e),(0,O.rC)(e,{connectionValue:O.LO,_elementHashCode:O.KG}),no(e.connectionValue,t),e))),ro=$t(((e,t)=>((0,O.rC)(e,{id:O.LO,connection:O.LO,hashCode:O.Fl}),no(e.connection,t),e))),oo=$t(((e,t)=>((0,O.rC)(e,{storeConnections:O.LO,hashCode:O.Fl}),Yt(e.store),e.storeConnections.forEach((e=>ro(e,t))),e))),lo=$t(((e,t)=>((0,O.rC)(e,{mappings:O.LO,connections:O.LO,hashCode:O.Fl}),e.mappings.forEach(Yt),e.connections.forEach((e=>oo(e,t))),e))),co=Bt((e=>((0,O.rC)(e,{hashCode:O.Fl}),Yt(e.packageableRuntime),e))),ho=(e,t)=>e instanceof Ls?co(e):e instanceof ws?lo(e,t):e,uo=$t(((e,t)=>(Ht(e),(0,O.rC)(e,{runtimeValue:O.LO,_elementHashCode:O.KG}),lo(e.runtimeValue,t),e)));class po{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){mo(e,this.observerContext)}visit_SectionIndex(e){No(e)}visit_PrimitiveType(e){}visit_Profile(e){So(e)}visit_Enumeration(e){vo(e)}visit_Measure(e){Po(e)}visit_Class(e){Mo(e)}visit_Association(e){ko(e)}visit_ConcreteFunctionDefinition(e){Fo(e)}visit_FlatData(e){si(e)}visit_Database(e){Wn(e,this.observerContext)}visit_Mapping(e){qr(e,this.observerContext)}visit_Service(e){pr(e,this.observerContext)}visit_PackageableRuntime(e){uo(e,this.observerContext)}visit_PackageableConnection(e){ao(e,this.observerContext)}visit_FileGenerationSpecification(e){Cs(e)}visit_GenerationSpecification(e){Ns(e)}visit_DataElement(e){$a(e,this.observerContext)}}const _o=$t(((e,t)=>(e.accept_PackageableElementVisitor(new po(t)),e))),mo=$t(((e,t)=>((e=>{Ht(e),(0,O.rC)(e,{children:O.LO,hashCode:O.KG})})(e),e.children.forEach((e=>{e instanceof hs?mo(e,t):_o(e,t)})),e))),go=Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Yt(e.ownerReference),e))),Eo=Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),e))),fo=Bt((e=>((0,O.rC)(e,{value:O.LO,hashCode:O.Fl}),Eo(e.tag),e))),To=Bt((e=>(0,O.rC)(e,{rawType:O.LO}))),Co=Bt((e=>((0,O.rC)(e,{value:O.LO}),To(e.value),Yt(e.ownerReference),e))),xo=Bt((e=>((0,O.rC)(e,{parserName:O.LO,elements:O.LO}),e instanceof ps?(0,O.rC)(e,{imports:O.LO,hashCode:O.Fl}):e instanceof _s&&(0,O.rC)(e,{hashCode:O.Fl}),e))),No=Bt((e=>(Ht(e),(0,O.rC)(e,{sections:O.LO,_elementHashCode:O.KG}),e.sections.forEach(xo),e))),Oo=Bt((e=>(0,O.rC)(e,{value:O.LO}))),Ao=Bt((e=>(0,O.rC)(e,{value:O.LO}))),So=Bt((e=>(Ht(e),(0,O.rC)(e,{p_stereotypes:O.LO,p_tags:O.LO,_elementHashCode:O.KG}),e.p_stereotypes.forEach(Oo),e.p_tags.forEach(Ao),e))),yo=Bt((e=>((0,O.rC)(e,{name:O.LO,stereotypes:O.LO,taggedValues:O.LO,hashCode:O.Fl}),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),Io=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),vo=Bt((e=>(Ht(e),(0,O.rC)(e,{values:O.LO,stereotypes:O.LO,taggedValues:O.LO,_elementHashCode:O.KG}),e.values.forEach(yo),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),Ro=Bt((e=>((0,O.rC)(e,{measure:O.LO,conversionFunction:O.LO,hashCode:O.Fl}),e.conversionFunction&&Gs(e.conversionFunction),e))),Po=Bt((e=>(Ht(e),(0,O.rC)(e,{canonicalUnit:O.LO,nonCanonicalUnits:O.LO,_elementHashCode:O.KG}),e.canonicalUnit&&Ro(e.canonicalUnit),e.nonCanonicalUnits.forEach(Ro),e))),wo=Bt((e=>((0,O.rC)(e,{name:O.LO,multiplicity:O.LO,stereotypes:O.LO,taggedValues:O.LO,hashCode:O.Fl}),Co(e.genericType),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),Lo=Bt((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}),Co(e.genericType),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),bo=Bt((e=>((0,O.rC)(e,{value:O.LO,pointerHashCode:O.Fl}),Yt(e.ownerReference),e))),Do=Bt((e=>((0,O.rC)(e,{name:O.LO,functionDefinition:O.LO,externalId:O.LO,enforcementLevel:O.LO,messageFunction:O.LO,hashCode:O.Fl}),Gs(e.functionDefinition),e.messageFunction&&Gs(e.messageFunction),e))),Mo=Bt((e=>(Ht(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(wo),e.propertiesFromAssociations.forEach(wo),e.derivedProperties.forEach(Lo),e.generalizations.forEach(Co),e.constraints.forEach(Do),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),ko=Bt((e=>(Ht(e),(0,O.rC)(e,{properties:O.LO,stereotypes:O.LO,taggedValues:O.LO,derivedProperties:O.LO,_elementHashCode:O.KG}),e.properties.forEach(wo),e.derivedProperties.forEach(Lo),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),Fo=Bt((e=>(Ht(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(zs),Yt(e.returnType),e.stereotypes.forEach(go),e.taggedValues.forEach(fo),e))),jo=Bt((e=>e instanceof ls?vo(e):e instanceof cs?Ro(e):e instanceof rs?Mo(e):e instanceof ds?Po(e):e)),Uo=(Bt((e=>e instanceof ls?vo(e):e instanceof cs?Ro(e):e)),Bt((e=>(0,O.rC)(e,{_dummyObservable:O.LO})))),Vo=Bt((e=>((0,O.rC)(e,{value:O.LO}),Yt(e.ownerReference),e))),Go=Bt((e=>(Uo(e),(0,O.rC)(e,{id:O.LO,hideProperties:O.LO,hideTaggedValues:O.LO,hideStereotypes:O.LO,hashCode:O.Fl}),Yt(e.class),e))),zo=Bt((e=>(Vo(e.classView),e))),Bo=Bt((e=>((0,O.rC)(e,{path:O.LO,pathForSerialization:O.Fl}),zo(e.from),zo(e.to),e))),$o=Bt((e=>(Bo(e),(0,O.rC)(e,{hashCode:O.Fl}),e))),Ho=Bt((e=>(Bo(e),(0,O.rC)(e,{hashCode:O.Fl}),bo(e.property),Yt(e.association),e))),Yo=Bt((e=>(Bo(e),(0,O.rC)(e,{hashCode:O.Fl}),bo(e.property),e))),Wo=Bt((e=>(Ht(e),(0,O.rC)(e,{classViews:O.LO,associationViews:O.LO,generalizationViews:O.LO,propertyViews:O.LO,_elementHashCode:O.KG}),e.classViews.forEach(Go),e.associationViews.forEach(Ho),e.generalizationViews.forEach($o),e.propertyViews.forEach(Yo),e)));var Ko;!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"}(Ko=Ko||(Ko={}));class Zo extends ns{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return Xt([Ko.DIAGRAM,this.path,Xt(this.classViews),Xt(this.generalizationViews),Xt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const Xo="Diagram";class qo extends zt{constructor(){super(Gt.Rw.LW,Gt.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[Xo]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof Zo)return Xo}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Zo)return Wo(e)}]}}class Jo{package;name;get path(){return`${this.package}::${this.name}`}get hashCode(){return Xt([qt.PACKAGEABLE_ELEMENT,this.path])}}class Qo extends Jo{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return Xt([Ko.DIAGRAM,this.path,Xt(this.classViews),Xt(this.generalizationViews),Xt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class el{rectangle;position;get hashCode(){return Xt([Ko.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class tl extends el{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return Xt([Ko.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class sl{x;y;get hashCode(){return Xt([Ko.POINT,this.x.toString(),this.y.toString()])}}class il{width;height;get hashCode(){return Xt([Ko.RECTANGLE,this.width.toString(),this.height.toString()])}}class nl{points=[]}class al{sourceView;targetView;line;get hashCode(){return Xt([Ko.RELATIONSHIP_VIEW,this.sourceView,this.targetView,Xt(this.line.points)])}}class rl extends al{property;get hashCode(){return Xt([Ko.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class ol extends rl{get hashCode(){return Xt([Ko.PROPERTY_VIEW,super.hashCode])}}class ll extends al{get hashCode(){return Xt([Ko.GENERALIZATION_VIEW,super.hashCode])}}class cl{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Xt([qt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new cl(0,0);static ZERO_ONE=new cl(0,1);static ZERO_MANY=new cl(0,void 0);static ONE=new cl(1,1);static ONE_MANY=new cl(1,void 0)}new $e((0,Be.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)()})),(0,Be.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return Xt([qt.PACKAGEABLE_ELEMENT_POINTER,this.type,this.path])}},{path:(0,Be.Ru)(),type:(0,Be.Ru)()});const dl=(0,Be.yu)(cl,{lowerBound:(0,Be.Ru)(),upperBound:(0,Be.jt)((0,Be.Ru)())});class hl{class;property;get hashCode(){return Xt([qt.PROPERTY_POINTER,this.property,this.class??""])}}class ul{}class pl{queryTimeOutInSeconds=null;enableConstraints=!0}var _l,ml;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(_l||(_l={})),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"}(ml=ml||(ml={})),(0,Be.yu)(class extends pl{},{_type:Ke(_l.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,Be.Ru)(),enableConstraints:(0,Be.Ru)()});const gl=(0,Be.yu)(class extends ul{body;parameters;get hashCode(){return Xt([qt.RAW_LAMBDA,es(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:Ke(ml.LAMBDA),body:(0,Be.LZ)(),parameters:(0,Be.LZ)()}),El=(0,Be.yu)(class extends ul{class;name;multiplicity;get hashCode(){return Xt([qt.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:Ke(ml.VARIABLE),class:(0,Be.Ru)(),multiplicity:He(dl),name:(0,Be.Ru)()});(0,Be.yu)(class extends ul{multiplicity=cl.ONE;type;value;get hashCode(){return Xt([qt.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,Be.bm)("_type",(0,Be.PG)((e=>{switch(e){case Ce.INTEGER:return ml.CINTEGER;case Ce.DECIMAL:return ml.CDECIMAL;case Ce.STRING:return ml.CSTRING;case Ce.BOOLEAN:return ml.CBOOLEAN;case Ce.FLOAT:return ml.CFLOAT;case Ce.DATETIME:return ml.CDATETIME;case Ce.STRICTDATE:return ml.CSTRICTDATE;case Ce.STRICTTIME:return ml.CSTRICTTIME;case Ce.LATESTDATE:return ml.CLATESTDATE;default:throw new j(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case ml.CINTEGER:return Ce.INTEGER;case ml.CDECIMAL:return Ce.DECIMAL;case ml.CSTRING:return Ce.STRING;case ml.CBOOLEAN:return Ce.BOOLEAN;case ml.CFLOAT:return Ce.FLOAT;case ml.CDATETIME:return Ce.DATETIME;case ml.CSTRICTDATE:return Ce.STRICTDATE;case ml.CSTRICTTIME:return Ce.STRICTTIME;case ml.CLATESTDATE:return Ce.LATESTDATE;default:throw new j(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,Be.jt)((0,Be.Ru)())});const fl=(0,Be.yu)(hl,{class:(0,Be.jt)((0,Be.Ru)()),property:(0,Be.Ru)()}),Tl=(0,Be.yu)(class{profile;value;get hashCode(){return Xt([qt.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,Be.Ru)(),value:(0,Be.Ru)()}),Cl=(0,Be.yu)(class{profile;value;get hashCode(){return Xt([qt.TAG_POINTER,this.value,this.profile])}},{profile:(0,Be.Ru)(),value:(0,Be.Ru)()}),xl=(0,Be.yu)(class{tag;value;get hashCode(){return Xt([qt.TAGGED_VALUE,this.tag,this.value])}},{tag:He(Cl),value:(0,Be.Ru)()}),Nl=((0,Be.yu)(class extends Jo{stereotypes=[];tags=[];get hashCode(){return Xt([qt.PROFILE,this.path,Xt(this.stereotypes),Xt(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:Ke("profile"),name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ru)()),tags:(0,Be.pb)((0,Be.Ru)())}),(0,Be.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return Xt([qt.ENUM_VALUE,this.value,Xt(this.stereotypes),Xt(this.taggedValues)])}},{stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1}))),value:(0,Be.Ru)()})),Ol=((0,Be.yu)(class extends Jo{values=[];stereotypes=[];taggedValues=[];get hashCode(){return Xt([qt.ENUMERATION,this.path,Xt(this.values),Xt(this.stereotypes),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:Ke("Enumeration"),name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1}))),values:(0,Be.pb)(He(Nl))}),(0,Be.yu)(class extends Jo{measure;conversionFunction;get hashCode(){return Xt([qt.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new j}},{_type:Ke("unit"),conversionFunction:(0,Be.jt)(He(gl)),measure:(0,Be.Ru)(),name:(0,Be.Ru)(),package:(0,Be.Ru)()})),Al=((0,Be.yu)(class extends Jo{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return Xt([qt.MEASURE,this.path,this.canonicalUnit??"",Xt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:Ke("measure"),canonicalUnit:(0,Be.jt)(He(Ol)),name:(0,Be.Ru)(),nonCanonicalUnits:(0,Be.pb)(He(Ol)),package:(0,Be.Ru)()}),(0,Be.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return Xt([qt.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",Xt(this.stereotypes),Xt(this.taggedValues)])}},{aggregation:(0,Be.jt)((0,Be.Ru)()),multiplicity:He(dl),name:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1}))),type:(0,Be.Ru)()})),Sl=(0,Be.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return Xt([qt.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,Xt(this.stereotypes),Xt(this.taggedValues),es(this.parameters,this.body)])}},{body:(0,Be.LZ)(),name:(0,Be.Ru)(),parameters:(0,Be.LZ)(),returnMultiplicity:He(dl),returnType:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1})))}),yl=(0,Be.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return Xt([qt.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,Be.jt)((0,Be.Ru)()),externalId:(0,Be.jt)((0,Be.Ru)()),functionDefinition:He(gl),messageFunction:(0,Be.jt)(He(gl)),name:(0,Be.Ru)()}),Il=((0,Be.yu)(class extends Jo{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return Xt([qt.CLASS,this.path,Xt(this.properties),Xt(this.derivedProperties),Xt(this.superTypes),Xt(this.constraints),Xt(this.stereotypes),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:Ke("class"),constraints:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(yl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(yl,e)),{skipIfEmpty:!1}))),name:(0,Be.Ru)(),originalMilestonedProperties:(0,Be.PG)((e=>We(e,(e=>Be.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>Be.AM),{skipIfEmpty:!1}))),package:(0,Be.Ru)(),properties:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Al,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Al,e)),{skipIfEmpty:!1}))),derivedProperties:(0,Be.bm)("qualifiedProperties",(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Sl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Sl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),superTypes:(0,Be.PG)((e=>We(e,(e=>e),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>e),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1})))}),(0,Be.yu)(class extends Jo{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return Xt([qt.ASSOCIATION,this.path,Xt(this.properties),Xt(this.derivedProperties),Xt(this.stereotypes),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:Ke("association"),name:(0,Be.Ru)(),originalMilestonedProperties:(0,Be.PG)((e=>We(e,(e=>Be.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>Be.AM),{skipIfEmpty:!1}))),package:(0,Be.Ru)(),properties:(0,Be.pb)(He(Al)),derivedProperties:(0,Be.bm)("qualifiedProperties",(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Sl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Sl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1})))}),(0,Be.yu)(class extends Jo{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return Xt([qt.FUNCTION,this.path,Xt(this.parameters),this.returnType,Xt(this.taggedValues),Xt(this.stereotypes),es(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:Ke("function"),body:(0,Be.pb)((0,Be.LZ)()),name:(0,Be.Ru)(),package:(0,Be.Ru)(),parameters:(0,Be.pb)(He(El)),postConstraints:(0,Be.pb)((0,Be.Ru)()),preConstraints:(0,Be.pb)((0,Be.Ru)()),returnMultiplicity:He(dl),returnType:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(Tl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(Tl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>We(e,(e=>(0,Be.qC)(xl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>Ye(e,(e=>(0,Be.vB)(xl,e)),{skipIfEmpty:!1})))}),"diagram"),vl=(0,Be.yu)(sl,{x:(0,Be.Ru)(),y:(0,Be.Ru)()}),Rl=(0,Be.yu)(il,{height:(0,Be.Ru)(),width:(0,Be.Ru)()}),Pl=(0,Be.yu)(nl,{points:(0,Be.pb)(He(vl))}),wl=(0,Be.yu)(tl,{class:(0,Be.Ru)(),hideProperties:(0,Be.jt)((0,Be.Ru)()),hideStereotypes:(0,Be.jt)((0,Be.Ru)()),hideTaggedValues:(0,Be.jt)((0,Be.Ru)()),id:(0,Be.Ru)(),position:He(vl),rectangle:He(Rl)}),Ll=(0,Be.yu)(ol,{line:He(Pl),property:He(fl),sourceView:(0,Be.Ru)(),targetView:(0,Be.Ru)()}),bl=(0,Be.yu)(ll,{line:He(Pl),sourceView:(0,Be.Ru)(),targetView:(0,Be.Ru)()}),Dl=(0,Be.yu)(Qo,{_type:Ke(Il),classViews:(0,Be.pb)(He(wl)),generalizationViews:(0,Be.pb)(He(bl)),name:(0,Be.Ru)(),package:(0,Be.Ru)(),propertyViews:(0,Be.pb)(He(Ll))});class Ml extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var kl=s(95903);const Fl=e=>$((0,kl.Z)(e.split(ge))),jl=e=>{const t=e.lastIndexOf(ge);return-1===t?void 0:e.substring(0,t)},Ul=(e,t)=>{const s=e.lastIndexOf(ge);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+ge.length,e.length)]},Vl=(e,t)=>`${e?`${e}::`:""}${t}`,Gl=(e,t)=>{e.children.push(t),t.package=e},zl=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Bl=(e,t,s,i)=>{const n=t.indexOf(ge),a=-1===n?t:t.substring(0,n);let r;if(r=e.children.find((e=>e instanceof hs&&e.name===a)),!r){if(!s)throw new G(`Can't find child package '${a}' in package '${e.path}'`);X(!fe.includes(a),`Can't create package with reserved name '${a}'`),r=new hs(a),r.package=e,e.children.push(r)}return i&&i.set(Vl(e.path,a),r),-1!==n?Bl(r,t.substring(n+ge.length),s,i):r},$l=(e,t,s,i)=>{if(i){const n=i.get(Vl(e.path,t));if(n)return n;let a=t;for(;""!==a;){const n=Vl(e.path,a),r=i.get(n);if(r)return Bl(r,t.substring(a.length+ge.length,t.length),s,i);const o=a.lastIndexOf(ge);a=-1!==o?a.substring(0,o):""}}return Bl(e,t,s,i)},Hl=(e,t,s)=>(K(t,"Package path is required"),$l(e.root,t,!0,s)),Yl=(e,t)=>W(e.rawType,t),Wl=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=Yl(e.value,rs);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},Kl=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Zl=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,Xl=(e,t)=>`${$(e,"Package path is required")}::${$(t,"Name is required")}`;class ql{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){K(e.package,"Element 'package' field is missing or empty"),K(e.name,"Element 'name' field is missing or empty"),((e,t,s)=>{if(s){if(s.has(e))throw new G(`Element '${e}' already exists`);s.add(e)}else X(!t.graph.getNullableElement(e),`Element '${e}' already exists`)})(Xl(e.package,e.name),t,i);const n=this.firstPass(e,t);return Gl(Hl(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 Jl=e=>e.classView.value.id,Ql=e=>{const t=new ol,s=new nl;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new hl;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=Jl(e.from),t.targetView=Jl(e.to),t},ec=e=>{const t=new ll,s=new nl;return s.points=e.pathForSerialization,t.line=s,t.sourceView=Jl(e.from),t.targetView=Jl(e.to),t},tc=e=>{const t=new tl;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 sl;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new il;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class sc{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return Xt([Ko.POINT,this.x.toString(),this.y.toString()])}}class ic{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return Xt([Ko.RECTANGLE,this.width.toString(),this.height.toString()])}}class nc{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new sc(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 nc(new sc(e.position.x+e.rectangle.width,e.position.y),new ic(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new nc(new sc(e.position.x,e.position.y+e.rectangle.height),new ic(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,Xt([Ko.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class ac extends nc{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new sc(0,0),new ic(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return Xt([Ko.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class rc{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class oc extends gs{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class lc extends oc{ownerReference;constructor(e){const t=fs.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new lc(e)}}class cc{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new rc(lc.create(t)),this.to=new rc(lc.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 sc(n,a):(t&&(e._offsetX=0,e._offsetY=0),new sc(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 cc.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return Xt([Ko.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,Xt(this.pathForSerialization)])}}class dc extends cc{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return Xt([Ko.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class hc extends dc{get hashCode(){return Xt([Ko.PROPERTY_VIEW,super.hashCode])}}class uc extends cc{get hashCode(){return Xt([Ko.GENERALIZATION_VIEW,super.hashCode])}}class pc{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new pc(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new pc(this.x/e,this.y/e)}normal(e){return new pc(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const _c=(e,t)=>e.classViews.find((e=>e.id===t)),mc=(e,t)=>{e.path=t},gc=e=>{const t=e.buildFullPath(),s=cc.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=pc.fromPoints(s[e+1],s[e]).unit(),n=pc.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])}mc(e,i)},Ec=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),fc=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),Tc=e=>new sc(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),Cc=e=>{const t=Tc(e);return new nc(new sc(t.x-5,t.y-5),new ic(10,10))},xc=(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)),Nc=e=>{const t=$(e.x,"Point 'x' coordinate is missing"),s=$(e.y,"Point 'y' coordinate is missing");return new sc(t,s)};class Oc extends Ml{constructor(){super(Gt.Rw.zE,Gt.i8)}V1_getExtraElementBuilders(){return[new ql({elementClassName:"Diagram",_class:Qo,firstPass:(e,t)=>{Y(e,Qo);const s=new Zo(e.name),i=Xl(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Zo),s},secondPass:(e,t)=>{Y(e,Qo);const s=(i=Xl(e.package,e.name),n=t.currentSubGraph,$(n.getOwnNullableExtensionElement(i,Zo),`Can't find diagram '${i}'`));var i,n;s.classViews=e.classViews.map((e=>((e,t,s)=>{K(e.class,"Class view 'class' field is missing or empty"),K(e.id,"Class view 'id' field is missing or empty"),B(e.rectangle,"Class view 'rectangle' field is missing"),B(e.position,"Class view 'position' field is missing");const i=new ac(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=$(e.width,"Rectangle 'width' is missing"),s=$(e.height,"Rectangle 'height' is missing");return new ic(t,s)})(e.rectangle),i.position=Nc(e.position),i})(e,t,s))),s.propertyViews=e.propertyViews.map((e=>((e,t,s)=>{B(e.property,"Property view 'property' field is missing"),B(e.line,"Property view 'line' field is missing");const i=$(_c(s,$(e.sourceView)),"Property view 'sourceView' field is missing"),n=$(_c(s,$(e.targetView)),"Property view 'targetView' field is missing"),a=t.resolveOwnProperty(e.property),r=new hc(s,a,i,n);return r.path=e.line.points.map((e=>Nc(e))),gc(r),r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t)=>{B(e.line,"Generalization view 'line' field is missing");const s=$(_c(t,$(e.sourceView)),"Generalization view 'sourceView' field is missing"),i=$(_c(t,$(e.targetView)),"Generalization view 'targetView' field is missing"),n=new uc(t,s,i);return n.path=e.line.points.map((e=>Nc(e))),gc(n),n})(e,s)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof Qo)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof Qo)return(0,Be.qC)(Dl,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===Il)return(0,Be.vB)(Dl,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Zo)return(e=>{const t=new Qo;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(tc),t.generalizationViews=e.generalizationViews.map(ec),t.propertyViews=e.propertyViews.map(Ql),t})(e)}]}}class Ac extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class Sc extends Ac{constructor(){super(Gt.Rw.f1,Gt.i8)}getExtraPureGraphExtensionClasses(){return[Zo]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Zo).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof rs?Kl(e.property.ownerReference.value):e.property.ownerReference.value.properties).map((e=>e.name)).includes(e.property.value.name))).forEach((t=>D(e.propertyViews,t))),e.classViews.filter((e=>!t.getNullableClass(e.class.value.path))).forEach((t=>D(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=>D(e.generalizationViews,t)))})(t,e)))}]}}class yc extends c{constructor(){super(Gt.Rw.NA,Gt.i8,[new Sc,new qo,new Oc])}}var Ic=s(5453),vc=s(3493),Rc=s(53908);const Pc=(0,Ic.Z)({transitions:{create:()=>"none"}}),wc=e=>{const{children:t}=e;return(0,x.jsx)(vc.Z,{injectFirst:!0,children:(0,x.jsx)(Rc.Z,{theme:Pc,children:t})})};var Lc=s(83820),bc=s(99631),Dc=s(12238),Mc=s(78683),kc=s(20889),Fc=s(6277);const jc=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Fc.clsx)(t,i),children:s})};return s.displayName=e,s},Uc=e=>{const{children:t,darkMode:s,className:i}=e;return(0,x.jsx)("div",{className:(0,Fc.clsx)("modal",{"modal--dark":s},i),children:t})},Vc=e=>{const{title:t,icon:s,className:i}=e;return(0,x.jsxs)("div",{className:(0,Fc.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=>ys.includes(e.toLowerCase())?e.toLowerCase():Ss(e))).replace(/^(?:\w+)\b/u,(e=>Ss(e))).replace(/\b(?:\w+)$/u,(e=>Ss(e))))})]});var n},Gc=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,x.jsx)("div",{className:(0,Fc.clsx)("modal__header",i),children:(0,x.jsx)(Vc,{title:t})}):(0,x.jsx)("div",{className:(0,Fc.clsx)("modal__header",i),children:s})},zc=(jc("ModalHeaderActions","modal__header__actions"),jc("ModalBody","modal__body")),Bc=jc("ModalFooter","modal__footer"),$c=e=>{switch(e){case Rt.PROCEED_WITH_CAUTION:return"btn--caution";case Rt.PROCEED:case Rt.STANDARD:default:return"btn--dark"}},Hc=(0,it.Pi)((e=>{const{info:t}=e,s=kt(),{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)(kc.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??vt.STANDARD).toLowerCase()}`,children:[i&&(0,x.jsx)(Gc,{title:i}),(0,x.jsxs)(zc,{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)(Bc,{children:[c.map((e=>(0,x.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${$c(e.type??Rt.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"})]})]})})})),Yc=(0,it.Pi)((()=>{const e=kt().actionAlertInfo;return e?(0,x.jsx)(Hc,{info:e}):null})),Wc=e=>{const{isLoading:t}=e,s=(0,nt.useRef)(null);return(0,nt.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")})},Kc=(0,it.Pi)((()=>{const e=kt().blockingAlertInfo;return e?(0,x.jsx)(kc.Z,{open:Boolean(e),onClose:v,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,x.jsxs)(Uc,{darkMode:!0,className:"blocking-alert",children:[(0,x.jsx)(Wc,{isLoading:Boolean(e.showLoading)}),(0,x.jsxs)(zc,{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 Zc=s(12889),Xc=s(58619),qc=s(33029);const Jc=(0,it.Pi)((()=>{const e=kt(),t=e.notification,s=Boolean(t),i=t?.message??"",n=t?.severity??wt.INFO,[a,r]=(0,nt.useState)(!1);let o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,x.jsx)(Zc.uMt,{})});switch(n){case wt.ILEGAL_STATE:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Zc.nnZ,{})});break;case wt.ERROR:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,x.jsx)(Zc.xDH,{})});break;case wt.WARNING:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,x.jsx)(Zc.LPM,{})});break;case wt.SUCCESS:o=(0,x.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,x.jsx)(Zc.rE2,{})})}const l=()=>{e.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.copyTextToClipboard(i)));return(0,x.jsx)(Xc.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:e.notification?e.notification.autoHideDuration??null:Pt,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,x.jsx)(qc.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,Fc.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)(Zc.v4q,{}):(0,x.jsx)(Zc.g8U,{})},"expand"),(0,x.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,x.jsx)(Zc.q1B,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var Qc;!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"}(Qc=Qc||(Qc={}));var ed=s(11826);const td=e=>{const{children:t,classes:s,...i}=e;return(0,x.jsx)(ed.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},sd=e=>{const{className:t,children:s,menuProps:i,content:n,disabled:a,onClose:r,onOpen:o}=e,l=(0,nt.useRef)(null),[c,d]=(0,nt.useState)(!1),[h,u]=(0,nt.useState)(),[p,_]=(0,nt.useState)(0),[m,g]=(0,nt.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)(td,{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}`)]})},id=(0,nt.forwardRef)((function(e,t){const{className:s,children:i,...n}=e;return(0,x.jsx)("div",{ref:t,className:(0,Fc.clsx)("menu",s),...n,children:i})})),nd=e=>{const{className:t,onClick:s,disabled:i,children:n,...a}=e;return(0,x.jsx)("button",{className:(0,Fc.clsx)("menu__item",t),disabled:Boolean(i),onClick:s,...a,children:n})},ad=jc("MenuContentDivider","menu__divider");jc("MenuContentItemIcon","menu__item__icon"),jc("MenuContentItemLabel","menu__item__label");var rd=s(52794),od=s(71215);const ld=e=>(0,x.jsx)(rd.D,{className:(0,Fc.clsx)("markdown-content",e.className),remarkPlugins:[od.Z],children:e.value.value});var cd=s(62515);const dd=e=>{const{children:t}=e,{ref:s,width:i,height:n}=(0,cd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[a,r]=(0,nt.useState)(!1),{ref:o,width:l,height:c}=(0,cd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,nt.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,Fc.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!a}),children:t})})};var hd=s(91222);const ud=e=>{const{children:t,...s}=e;return(0,x.jsx)(hd.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var pd=s(13474),_d=s(65068),md=s(41327),gd=s(47793),Ed=s(36569),fd=s(46678);const Td=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,Fc.clsx)("mui-radio-group",n),children:[r.map(((e,t)=>(0,x.jsx)("div",{children:(0,x.jsx)(gd.Z,{className:"mui-radio-group__group",...a,children:e.map((e=>(0,x.jsx)(Ed.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,x.jsx)(fd.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 Cd;!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"}(Cd=Cd||(Cd={}));const xd=(0,it.Pi)((e=>{const{configState:t}=e,s=kt();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(Cd.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,x.jsx)(Zc.uMt,{})})]}),(0,x.jsx)("div",{children:(0,x.jsx)(Td,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[_t.STANDARD,_t.INCLUDE,_t.EXACT,_t.INVERSE],size:1})})]})})),Nd=(0,it.Pi)((e=>{const{entry:t}=e,s=kt(),i=()=>{t.isOpen||At.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},n=s.guardUnhandledError((()=>s.copyTextToClipboard(t.documentationKey)));return(0,x.jsx)(sd,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsx)(id,{children:(0,x.jsx)(nd,{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,Fc.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)(Zc.v4q,{}):(0,x.jsx)(Zc.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:()=>{At.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:q(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__doc-entry__content__text",children:t.content}):(0,x.jsx)(ld,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),Od=(0,it.Pi)((()=>{const e=kt(),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)(sd,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(id,{children:[(0,x.jsx)(nd,{onClick:s,children:"Copy Context ID"}),(0,x.jsx)(nd,{onClick:i,children:"Copy Current Context ID"}),(0,x.jsx)(nd,{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:q(t.content)?(0,x.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,x.jsx)(ld,{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)(Nd,{entry:e},e.uuid)))]})]}),!t&&(0,x.jsx)(dd,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Zc.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!"})]})})]})})),Ad=(0,it.Pi)((()=>{const e=kt(),t=(0,nt.useRef)(null),s=(0,nt.useRef)(null),i=e.assistantService,n=i.searchText,a=(0,nt.useMemo)((()=>(0,pd.Z)((()=>i.search()),100)),[i]);return(0,nt.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,Fc.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,Fc.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)(Zc.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)(Zc.q1B,{})}):(0,x.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,x.jsx)(Zc.W1M,{})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,x.jsx)(Wc,{isLoading:i.searchState.isInProgress}),(0,x.jsx)("div",{className:(0,Fc.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":i.showSearchConfigurationMenu}),children:(0,x.jsx)(xd,{configState:i.searchConfigurationState})}),i.currentDocumentationEntry&&(0,x.jsx)("div",{className:"virtual-assistant__search__results",children:(0,x.jsx)(Nd,{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)(Nd,{entry:e},e.uuid)))}),n&&!i.searchResults.length&&(0,x.jsx)(dd,{children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,x.jsx)(Zc.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)(sd,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,x.jsxs)(id,{children:[(0,x.jsx)(nd,{onClick:()=>{_e(`documentation-registry_${(0,_d.Z)(new Date(Date.now()),Me)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),ae.APPLICATION_JSON)},children:"Download documentation registry"}),(0,x.jsx)(nd,{onClick:()=>{_e(`documentation-registry_${(0,_d.Z)(new Date(Date.now()),Me)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),ae.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)(Zc.Oag,{className:"virtual-assistant__character__hat"}),(0,x.jsx)(Zc.ce8,{className:"virtual-assistant__character__glasses"}),(0,x.jsx)(Zc.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?"})]})})]})]})]})})),Sd=(0,it.Pi)((e=>{const{triggerElement:t}=e,s=kt().assistantService,i=s.currentContextualDocumentationEntry,n=s.selectedTab;return(0,x.jsx)(ud,{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,Fc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===mt.SEARCH}),onClick:()=>s.setSelectedTab(mt.SEARCH),title:"Search",children:(0,x.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,x.jsx)(Zc.W1M,{})})}),(0,x.jsx)("div",{className:(0,Fc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===mt.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(mt.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,x.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,x.jsx)(Zc.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)(Zc.Two,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,x.jsxs)("div",{className:"virtual-assistant__panel__content",children:[n===mt.SEARCH&&(0,x.jsx)(Ad,{}),n===mt.CONTEXTUAL_SUPPORT&&(0,x.jsx)(Od,{})]})]})},s.panelRenderingKey)})),yd=(0,it.Pi)((()=>{const[e,t]=(0,nt.useState)(!1),[s,i]=(0,nt.useState)((0,a.Z)()),n=kt(),r=(0,nt.useRef)(null),o=n.assistantService,l=o.currentContextualDocumentationEntry;return(0,nt.useEffect)((()=>{o.isHidden&&i((0,a.Z)())}),[o.isHidden]),(0,x.jsx)(md,{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,Fc.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(mt.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)(Zc.Two,{className:"virtual-assistant__station__trigger__close"}):l?(0,x.jsx)(Zc.J$M,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,x.jsx)(sd,{className:(0,Fc.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)(id,{children:[(0,x.jsx)(nd,{onClick:()=>{o.setIsOpen(!1),i((0,a.Z)())},children:"Reset Position"}),(0,x.jsx)(nd,{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)(Zc.POq,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,x.jsx)(Sd,{triggerElement:r.current})]})},s)})),Id="app.container",vd="app.backdrop-container",Rd=["Meta+KeyP","Control+KeyP","Meta+KeyS","Control+KeyS","F8","F10","F11","Meta+Shift+KeyP","Control+Shift+KeyP","Meta+KeyB","Control+KeyB","F7","Alt+F7","Control+Shift+KeyB"],Pd=e=>(0,x.jsx)("div",{className:"backdrop__container",id:e.elementID}),wd=(0,it.Pi)((e=>{const{children:t}=e,s=kt(),i=s.backdropContainerElementID?document.getElementById(s.backdropContainerElementID)??document.getElementById(vd):document.getElementById(vd),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:Rd,handler:e=>{e?.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,(e=>t=>{Rd.includes(e)&&t?.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,nt.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=$(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=$(a[0]),o=((e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![Qc.SHIFT,Qc.META,Qc.ALT,Qc.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)(wc,{children:[(0,x.jsx)(Kc,{}),(0,x.jsx)(Yc,{}),(0,x.jsx)(Jc,{}),s.showBackdrop&&(0,x.jsx)(Lc.Z,{container:i,children:(0,x.jsx)(bc.Z,{className:"backdrop",open:s.showBackdrop})}),(0,x.jsx)(Dc.W,{backend:Mc.PD,children:(0,x.jsxs)("div",{className:"app__container",id:Id,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,x.jsx)(Pd,{elementID:vd}),(0,x.jsx)(yd,{}),t]})})]})}));class Ld{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const bd=(0,nt.createContext)(void 0),Dd=({children:e})=>{const t=kt(),s=(0,it.fv)((()=>new Ld(t)));return(0,x.jsx)(bd.Provider,{value:s,children:e})};var Md,kd;!function(e){e.CONCEPT="CONCEPT",e.FILE="FILE"}(Md=Md||(Md={})),function(e){e.CONSOLE="CONSOLE",e.SEARCH_RESULT="SEARCH_RESULT",e.TEST_RUNNER="TEST_RUNNER"}(kd=kd||(kd={}));const Fd=(e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)},jd="dummy_problem_marker_owner";var Ud;!function(e){e.PACKAGE="Package",e.PROFILE="Profile",e.CLASS="Class",e.ASSOCIATION="Association",e.PROPERTY="Property",e.QUALIFIED_PROPERTY="QualifiedProperty",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"}(Ud=Ud||(Ud={}));class Vd{pureId;pureType;pureName;get id(){return this.pureId}}class Gd extends Vd{deprecated}(0,Be.yu)(Gd,{pureId:(0,Be.Ru)(),pureType:(0,Be.Ru)(),deprecated:(0,Be.Ru)()});class zd extends Vd{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,Be.yu)(zd,{pureId:(0,Be.Ru)(),pureName:(0,Be.Ru)(),pureType:(0,Be.Ru)(),RO:(0,Be.Ru)(),classPath:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class Bd extends Vd{RO;notpublic;user;file;line;column}(0,Be.yu)(Bd,{pureId:(0,Be.Ru)(),pureName:(0,Be.jt)((0,Be.Ru)()),pureType:(0,Be.Ru)(),RO:(0,Be.Ru)(),notpublic:(0,Be.Ru)(),user:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class $d{li_attr;id;text;icon;children;state;getNodeAttribute(e){return W(this.li_attr,e,`Expected concept node attribute to be of type '${e.name}'`)}}(0,Be.yu)($d,{li_attr:(0,Be.PG)((()=>Be.AM),(e=>e.classPath?(0,Be.vB)(zd,e):e.file?(0,Be.vB)(Bd,e):(0,Be.vB)(Gd,e))),id:(0,Be.Ru)(),text:(0,Be.Ru)(),icon:(0,Be.Ru)(),children:(0,Be.Ru)(),state:(0,Be.Ru)()});const Hd=e=>e.startsWith("/")?e.substring(1,e.length):e;class Yd{content;constructor(){(0,O.rC)(this,{content:O.LO,setContent:O.aD})}setContent(e){this.content=e}}(0,Be.yu)(Yd,{content:(0,Be.Ru)()});class Wd{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class Kd extends Wd{error;constructor(e,t,s,i){super(e,t,s),this.error=i}}var Zd;!function(e){e.ENUM="meta::pure::ide::findusages::findUsagesForEnum_String_1__String_1__SourceInformation_MANY_",e.PROPERTY="meta::pure::ide::findusages::findUsagesForProperty_String_1__String_1__SourceInformation_MANY_",e.ELEMENT="meta::pure::ide::findusages::findUsagesForPath_String_1__SourceInformation_MANY_",e.MULTIPLE_PATHS="meta::pure::ide::findusages::findUsagesForMultiplePaths_String_1__Pair_MANY_"}(Zd=Zd||(Zd={}));const Xd=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class qd{source;line;column;startLine;startColumn;endLine;endColumn}(0,Be.yu)(qd,{source:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)()});class Jd{first;second}(0,Be.yu)(Jd,{first:(0,Be.Ru)(),second:(0,Be.pb)((0,Be.Ry)(qd))});class Qd{uuid=(0,a.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class eh{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){B(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){b(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(X(-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 th extends Qd{editorStore;constructor(e){super(),this.editorStore=e}}class sh extends eh{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}}var ih;!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"}(ih=ih||(ih={}));const nh={[ih.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN"},[ih.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF"},[ih.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[ih.TOGGLE_AUX_PANEL]:{title:"Toggle auxiliary panel",defaultKeyboardShortcut:"Control+Backquote"},[ih.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[ih.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[ih.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[ih.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[ih.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"}};var ah;!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"}(ah=ah||(ah={}));const rh={[ah.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[ah.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[ah.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[ah.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};var oh;!function(e){e.REVEAL_CONCEPT_IN_TREE="editor.file-editor.reveal-concept-in-tree",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",e.RENAME_CONCEPT="editor.file-editor.rename-concept"}(oh=oh||(oh={}));const lh={[oh.REVEAL_CONCEPT_IN_TREE]:{title:"Reveal concept in tree (File)",defaultKeyboardShortcut:"Control+Shift+KeyB"},[oh.GO_TO_DEFINITION]:{title:"Go to definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[oh.GO_BACK]:{title:"Go back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[oh.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"},[oh.RENAME_CONCEPT]:{title:"Rename Concept (File)",defaultKeyboardShortcut:"F2"}};class ch{model;editor;language;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.language=(e=>{switch(P(e.split("."))){case"pure":return C.PURE;case"json":return C.JSON;case"sql":return C.SQL;case"md":return C.MARKDOWN;case"java":return C.JAVA;default:return C.TEXT}})(e.filePath),this.model=A.editor.createModel(e.uuid,this.language),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 dh{fileEditorState;concept;coordinate;constructor(e,t,s){this.fileEditorState=e,this.concept=t,this.coordinate=s}}class hh extends th{filePath;textEditorState;file;renameConceptState;constructor(e,t,s){super(e),(0,O.rC)(this,{file:O.LO,renameConceptState:O.LO,setFile:O.aD,setConceptToRenameState:O.ls}),this.file=t,this.filePath=s,this.textEditorState=new ch(this)}get label(){return Hd(this.filePath)}get description(){return`File: ${Hd(this.filePath)}`}get fileName(){return $(P(this.filePath.split("/")))}match(e){return e instanceof hh&&this.filePath===e.filePath}onClose(){this.textEditorState.model.dispose()}setFile(e){this.file=e}*setConceptToRenameState(e){if(!e)return void(this.renameConceptState=void 0);const t=yield this.editorStore.getConceptInfo(e);this.renameConceptState=t?new dh(this,t,e):void 0}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??jd,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??jd)}registerCommands(){if(this.textEditorState.language!==C.PURE)throw new F("File editor commands should only be used for Pure files");this.editorStore.applicationStore.commandCenter.registerCommand({key:oh.GO_TO_DEFINITION,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&(0,O.fl)(this.editorStore.executeNavigation(new Wd(this.filePath,e.lineNumber,e.column))).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:oh.GO_BACK,action:()=>{(0,O.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:oh.REVEAL_CONCEPT_IN_TREE,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&this.editorStore.revealConceptInTree(new Wd(this.filePath,e.lineNumber,e.column)).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:oh.FIND_USAGES,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){const t=new Wd(this.filePath,e.lineNumber,e.column);(0,O.fl)(this.editorStore.findUsages(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:oh.RENAME_CONCEPT,trigger:()=>Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){const t=new Wd(this.filePath,e.lineNumber,e.column);(0,O.fl)(this.setConceptToRenameState(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}})}async renameConcept(e){if(!this.renameConceptState)return;const t=this.renameConceptState.concept;try{this.editorStore.applicationStore.setBlockingAlert({message:"Finding concept usages...",showLoading:!0});const s=await this.editorStore.findConceptUsages(t.pureType===Ud.ENUM_VALUE?Zd.ENUM:t.pureType===Ud.PROPERTY||t.pureType===Ud.QUALIFIED_PROPERTY?Zd.PROPERTY:Zd.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`));await(0,O.fl)(this.editorStore.renameConcept(t.pureName,e,t.pureType,s)),this.textEditorState.setForcedCursorPosition({lineNumber:this.renameConceptState.coordinate.line,column:this.renameConceptState.coordinate.column})}catch(e){U(e),this.editorStore.applicationStore.notifyError(e)}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}}deregisterCommands(){if(this.textEditorState.language!==C.PURE)throw new F("File editor commands should only be used for Pure files");[oh.GO_TO_DEFINITION,oh.GO_BACK,oh.REVEAL_CONCEPT_IN_TREE,oh.FIND_USAGES,oh.RENAME_CONCEPT].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class uh{editorStore;treeData;selectedNode;loadInitialDataState=Et.create();refreshDataState=Et.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 $(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){U(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({...$(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){U(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 U(e),this.editorStore.applicationStore.notifyError(e),void this.refreshDataState.fail()}const s=this.getTreeData().rootIds.map((e=>$(this.getTreeData().nodes.get(e)))).filter((t=>e.has(t.id)));yield this.refreshOpenNodes(s,e),t&&this.getTreeData().nodes.has(t)&&this.setSelectedNode($(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=>$(this.getTreeData().nodes.get(e)))).filter((e=>t.has(e.id)))).length?this.refreshOpenNodes(e,t):Promise.resolve()}}class ph{id;path}class _h extends ph{file;statusType}(0,Be.yu)(_h,{id:(0,Be.Ru)(),path:(0,Be.Ru)(),file:(0,Be.Ru)(),statusType:(0,Be.Ru)()});class mh extends ph{repo}(0,Be.yu)(mh,{id:(0,Be.Ru)(),path:(0,Be.Ru)(),repo:(0,Be.Ru)()});class gh{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof mh}get isFileNode(){return this.li_attr instanceof _h}getNodeAttribute(e){return W(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,Be.yu)(gh,{li_attr:(0,Be.PG)((()=>Be.AM),(e=>e.file&&"true"===e.file?(0,Be.vB)(_h,e):(0,Be.vB)(mh,e))),text:(0,Be.Ru)(),icon:(0,Be.Ru)(),children:(0,Be.Ru)(),state:(0,Be.Ru)()});const Eh=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},fh=e=>e.endsWith(".pure"),Th=e=>`file_${e}`;class Ch extends uh{nodeForCreateNewFile;nodeForCreateNewDirectory;nodeForRenameFile;constructor(e){super(e),(0,O.rC)(this,{nodeForCreateNewFile:O.LO,nodeForCreateNewDirectory:O.LO,nodeForRenameFile:O.LO,setNodeForCreateNewFile:O.aD,setNodeForCreateNewDirectory:O.aD,setNodeForRenameFile:O.aD,revealPath:O.ls})}setNodeForCreateNewFile=e=>{X(!e||e.data.isFolderNode,"Node selected for creating a new file from must be a directory"),this.nodeForCreateNewFile=e};setNodeForCreateNewDirectory=e=>{X(!e||e.data.isFolderNode,"Node selected for creating a new directory from must be a directory"),this.nodeForCreateNewDirectory=e};setNodeForRenameFile=e=>{X(!e||e.data.isFileNode,"Node selected for renaming must be a file"),this.nodeForRenameFile=e};async getRootNodes(){return(await this.editorStore.client.getDirectoryChildren()).map((e=>(0,Be.vB)(gh,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,Be.vB)(gh,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(Md.FILE,{keepShowingIfMatchedCurrent:!0});const i=[];let n=e;for(;n;)i.unshift(n),n=Eh(n);for(const e of i)if(fh(e))yield(0,O.fl)(this.editorStore.loadFile(e,s));else{const t=$(this.getTreeData().nodes.get(Th(e)),`Can't find directory node with path '${e}'`);yield(0,O.fl)(this.expandNode(t))}const a=$(this.getTreeData().nodes.get(Th(e)),`Can't find file node with path '${e}'`);this.setSelectedNode(a)}}class xh extends uh{loadConceptActivity=Et.create();statusText;nodeForRenameConcept;nodeForMoveElement;constructor(e){super(e),(0,O.rC)(this,{statusText:O.LO,nodeForRenameConcept:O.LO,nodeForMoveElement:O.LO,setStatusText:O.aD,setNodeForRenameConcept:O.aD,setNodeForMoveElement:O.aD,pullConceptsActivity:O.aD,pollConceptsActivity:O.ls})}setStatusText(e){this.statusText=e}setNodeForRenameConcept(e){this.nodeForRenameConcept=e}setNodeForMoveElement(e){this.nodeForMoveElement=e}async getRootNodes(){return await(0,O.fl)(this.pollConceptsActivity()),(await this.editorStore.client.getConceptChildren()).map((e=>(0,Be.vB)($d,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,Be.vB)($d,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((t=>{const n=t.li_attr.id;i.push(n),s.nodes.set(n,{data:t,id:n,label:t.text,isLoading:!1,parent:e})})),e.childrenIds=i}*openNode(e){(e.data.li_attr instanceof zd||e.data.li_attr instanceof Bd)&&("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 Wd(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()}async movePackageableElements(e,t){let s=[];try{s=(await this.editorStore.client.getPackageableElementsUsage(e.map((e=>e.pureId)))).map((e=>(0,Be.vB)(Jd,e)))}catch{return void this.editorStore.applicationStore.notifyError("Can't find usage for child packageable elements")}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}const i=[];X(s.length===e.length,"Can't find matching usages for packageable elements");for(let n=0;n<s.length;++n){const a=$(e[n]);i.push({pureName:a.pureName,pureType:a.pureType,sourcePackage:$(jl(a.pureId)),destinationPackage:t,usages:$(s[n]).second})}await(0,O.fl)(this.editorStore.movePackageableElements(i))}async renameConcept(e,t){const s=e.data.li_attr,i=s.pureName??s.pureId;let n=[];try{switch(this.editorStore.applicationStore.setBlockingAlert({message:"Finding concept usages...",showLoading:!0}),s.pureType){case Ud.PROPERTY:case Ud.QUALIFIED_PROPERTY:Y(s,zd),n=await this.editorStore.findConceptUsages(Zd.PROPERTY,[`'${s.classPath}'`,`'${s.pureId}'`]);break;case Ud.PACKAGE:{let e=[],s=[];try{s=await this.editorStore.client.getChildPackageableElements(i),e=(await this.editorStore.client.getPackageableElementsUsage(s.map((e=>e.pureId)))).map((e=>(0,Be.vB)(Jd,e)))}catch{return void this.editorStore.applicationStore.notifyError("Can't find usage for child packageable elements")}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}const n=[];X(e.length===s.length,"Can't find matching usages for child packageable elements");const a=jl(i)?.concat(ge).concat(t)??t;for(let t=0;t<e.length;++t){const r=$(s[t]),o=$(jl(r.pureId)),l=a.concat(o.substring(o.indexOf(i)+i.length));n.push({pureName:r.pureName,pureType:r.pureType,sourcePackage:o,destinationPackage:l,usages:$(e[t]).second})}return void await(0,O.fl)(this.editorStore.movePackageableElements(n))}default:n=await this.editorStore.findConceptUsages(Zd.ELEMENT,[`'${s.pureId}'`])}}catch(e){return U(e),void this.editorStore.applicationStore.notifyError(e)}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}await(0,O.fl)(this.editorStore.renameConcept(i,t,s.pureType,n))}}class Nh{cached;datamarts;text}(0,Be.yu)(Nh,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)()});class Oh extends Nh{error;sessionError}(0,Be.yu)(Oh,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class Ah extends Oh{RO;line;column;source}(0,Be.yu)(Ah,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class Sh{text;reinit}class yh extends Sh{cache;modifiedFiles=[]}(0,Be.yu)(yh,{text:(0,Be.Ru)(),cache:(0,Be.Ru)(),modifiedFiles:(0,Be.pb)((0,Be.Ru)()),reinit:(0,Be.Ru)()});class Ih extends Sh{RO;line;column;source;error;sessionError}(0,Be.yu)(Ih,{text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class vh{RO;line;column;source}(0,Be.yu)(vh,{RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)()});class Rh extends Sh{jumpTo}(0,Be.yu)(Rh,{text:(0,Be.Ru)(),jumpTo:(0,Be.Ry)(vh)});class Ph{uuid=(0,a.Z)();sourceID;line;column;foundName}(0,Be.yu)(Ph,{sourceID:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),foundName:(0,Be.Ru)()});class wh{uuid=(0,a.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,Be.yu)(wh,{sourceID:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),foundName:(0,Be.Ru)(),add:(0,Be.Ru)(),messageToBeModified:(0,Be.Ru)(),fileToBeModified:(0,Be.Ru)(),lineToBeModified:(0,Be.Ru)(),columnToBeModified:(0,Be.Ru)()});class Lh extends Ih{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,Be.yu)(Lh,{candidateName:(0,Be.Ru)(),candidatesWithPackageImported:(0,Be.pb)((0,Be.Ry)(Ph)),candidatesWithPackageNotImported:(0,Be.pb)((0,Be.Ry)(wh))});class bh extends Ih{candidateName;candidates=[]}(0,Be.yu)(bh,{candidateName:(0,Be.Ru)(),candidates:(0,Be.pb)((0,Be.Ry)(wh))});class Dh{id;parentId;file;line;column}(0,Be.yu)(Dh,{id:(0,Be.Ru)(),parentId:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class Mh{children=[];li_attr;text;type}(0,Be.yu)(Mh,{children:(0,Be.pb)((0,Be.Ry)(Mh)),li_attr:(0,Be.Ry)(Dh),text:(0,Be.Ru)(),type:(0,Be.Ru)()});class kh extends Sh{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,Be.yu)(kh,{count:(0,Be.Ru)(),filterPaths:(0,Be.pb)((0,Be.Ru)()),path:(0,Be.Ru)(),relevantTestsOnly:(0,Be.Ru)(),runnerId:(0,Be.Ru)(),tests:(0,Be.pb)((0,Be.Ry)(Mh))});class Fh{uuid=(0,a.Z)()}class jh{before;found;after}(0,Be.yu)(jh,{after:(0,Be.Ru)(),before:(0,Be.Ru)(),found:(0,Be.Ru)()});class Uh{uuid=(0,a.Z)();sourceId;startLine;startColumn;endLine;endColumn;preview;constructor(e,t,s,i,n){this.sourceId=e,this.startLine=t,this.startColumn=s,this.endLine=i,this.endColumn=n}}(0,Be.yu)(Uh,{sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)(),preview:(0,Be.jt)((0,Be.Ry)(jh))});class Vh extends Fh{sourceId;coordinates=[];constructor(){super(),(0,O.rC)(this,{coordinates:O.LO,dismissCoordinate:O.aD})}setCoordinates(e){this.coordinates=e}dismissCoordinate(e){D(this.coordinates,e)}}(0,Be.yu)(Vh,{sourceId:(0,Be.Ru)(),coordinates:(0,Be.pb)((0,Be.Ry)(Uh))});class Gh{editorStore;constructor(e){this.editorStore=e}}class zh extends Gh{searchEntries=[];constructor(e,t){super(e),(0,O.rC)(this,{searchEntries:O.LO,numberOfFiles:O.Fl,numberOfResults:O.Fl}),this.searchEntries=t}dismissSearchEntry(e){D(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 Bh extends zh{}class $h extends zh{usageConcept;constructor(e,t,s,i){const n=new Map;s.forEach(((e,t)=>{let s;n.has(e.source)?s=$(n.get(e.source)):(s=new Vh,s.sourceId=e.source,n.set(e.source,s));const a=new Uh(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn);a.preview=i.find((t=>t.sourceId===e.source&&t.startLine===e.startLine&&t.startColumn===e.startColumn&&t.endLine===e.endLine&&t.endColumn===e.endColumn))?.preview,s.coordinates.push(a)})),super(e,Array.from(n.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=$(n.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 Hh extends Gh{result;constructor(e,t){super(e),this.result=t}}class Yh extends Gh{result;constructor(e,t){super(e),this.result=t}}var Wh,Kh,Zh;!function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(Wh=Wh||(Wh={}));class Xh{status;test}class qh extends Xh{test=[]}(0,Be.yu)(qh,{status:(0,Be.Ru)(),test:(0,Be.pb)((0,Be.Ru)())});class Jh{text;RO;line;column;source;error}(0,Be.yu)(Jh,{text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)()});class Qh extends Xh{test=[];error}(0,Be.yu)(Qh,{status:(0,Be.Ru)(),test:(0,Be.pb)((0,Be.Ru)()),error:(0,Be.Ry)(Jh)});class eu{}class tu extends eu{finished;tests=[]}(0,Be.yu)(tu,{finished:(0,Be.Ru)(),tests:(0,Be.pb)((0,Be.PG)((()=>Be.AM),(e=>e.error?(0,Be.vB)(Qh,e):(0,Be.vB)(qh,e))))});class su extends eu{error;text}(0,Be.yu)(su,{error:(0,Be.Ru)(),text:(0,Be.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(Kh=Kh||(Kh={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(Zh=Zh||(Zh={}));class iu{_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?Kh.FAILED:this.passed?Kh.PASSED:Kh.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case Wh.PASSED:this.passedTests.add(t);break;case Wh.FAILED:this.failedTests.set(t,W(e,Qh));break;case Wh.ERROR:this.testsWithError.set(t,W(e,Qh));break;default:throw new j(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class nu{editorStore;testExecutionResult;checkTestRunnerState=Et.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=Et.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 $(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({...$(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=$(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?L(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{X(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 iu(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,Be.vB)(su,s):(0,Be.vB)(tu,s);var s;return t instanceof tu?(await Promise.all(t.tests.map((t=>w((()=>{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){U(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!`))}}class au{}class ru extends au{error;errorDialog;text}(0,Be.yu)(ru,{error:(0,Be.Ru)(),errorDialog:(0,Be.Ru)(),text:(0,Be.Ru)()});class ou{networkClient;userId="localuser";sessionId=`${this.userId}@${Date.now()}@abcd`;compilerMode;mode;constructor(e){this.networkClient=e}get baseUrl(){return $(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});getTextSearchPreview=e=>this.networkClient.post(`${this.baseUrl}/getTextSearchPreview`,e);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});getConceptInfo=(e,t,s)=>this.networkClient.get(`${this.baseUrl}/getConceptInfo`,void 0,void 0,{file:e,line:t,column:s});getUsages=async(e,t)=>{const s=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:e,param:t});return Array.isArray(s)?s:[s]};renameConcept=e=>this.networkClient.put(`${this.baseUrl}/renameConcept`,e);movePackageableElements=e=>this.networkClient.put(`${this.baseUrl}/movePackageableElements`,e);getPackageableElementsUsage=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:Zd.MULTIPLE_PATHS,param:[`'${e.join(",")}'`]});return Array.isArray(t)?t:[t]};getChildPackageableElements=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::getChildPackageableElements_String_1__String_MANY_",param:[`'${e}'`]});return(Array.isArray(t)?t:[t]).map((e=>JSON.parse(e)))};updateSource=e=>this.networkClient.put(`${this.baseUrl}/updateSource`,e);createFile=e=>this.networkClient.post(`${this.baseUrl}/newFile/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});createFolder=e=>this.networkClient.post(`${this.baseUrl}/newFolder/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});renameFile=(e,t)=>this.networkClient.put(`${this.baseUrl}/renameFile`,{oldPath:e,newPath:t},void 0);deleteDirectoryOrFile=e=>this.networkClient.delete(`${this.baseUrl}/deleteFile/${e}`,void 0,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 lu{_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 cu,du=s(1367);class hu{_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 Xt([qt.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues),es(this.parameters,this.body)])}}class uu extends gs{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class pu extends uu{ownerReference;constructor(e){const t=fs.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new pu(e)}}class _u{_UUID=(0,a.Z)();rawType;constructor(e){this.rawType=e}}class mu{_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 Xt([qt.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues)])}}class gu{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return Xt([qt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new gu(0,0);static ZERO_ONE=new gu(0,1);static ZERO_MANY=new gu(0,void 0);static ONE=new gu(1,1);static ONE_MANY=new gu(1,void 0)}class Eu extends gs{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[qt.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(Zt).join(",")}}class fu extends Eu{ownerReference;constructor(e){const t=fs.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new fu(e)}}class Tu extends os{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new Tu(Ce.STRING);static BOOLEAN=new Tu(Ce.BOOLEAN);static BINARY=new Tu(Ce.BINARY);static NUMBER=new Tu(Ce.NUMBER);static INTEGER=new Tu(Ce.INTEGER);static FLOAT=new Tu(Ce.FLOAT);static DECIMAL=new Tu(Ce.DECIMAL);static DATE=new Tu(Ce.DATE);static STRICTDATE=new Tu(Ce.STRICTDATE);static DATETIME=new Tu(Ce.DATETIME);static STRICTTIME=new Tu(Ce.STRICTTIME);static LATESTDATE=new Tu(Ce.LATESTDATE)}!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(cu=cu||(cu={}));class Cu extends dc{association;constructor(e,t,s,i,n){super(e,s,i,n),this.association=t}get hashCode(){return Xt([Ko.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const xu=()=>new rs(""),Nu=(e,t)=>new mu("",gu.ONE,pu.create(new _u(e)),t),Ou=(0,O.aD)(((e,t)=>{e.value=t})),Au=((0,O.aD)(((e,t)=>{D(e.properties,t)})),(0,O.aD)(((e,t)=>{L(e.properties,wo(t))}))),Su=((0,O.aD)(((e,t,s)=>{b(e.properties,t,s)})),(0,O.aD)(((e,t)=>{D(e.derivedProperties,t)})),(0,O.aD)(((e,t)=>{L(e.derivedProperties,Lo(t))})),(0,O.aD)(((e,t,s)=>{b(e.derivedProperties,t,s)})),(0,O.aD)(((e,t)=>{L(e.constraints,Do(t))})),(0,O.aD)(((e,t)=>{D(e.constraints,t)})),(0,O.aD)(((e,t,s)=>{b(e.constraints,t,s)})),(0,O.aD)(((e,t)=>{L(e.generalizations,Co(t))}))),yu=((0,O.aD)(((e,t)=>{D(e.generalizations,t)})),(0,O.aD)(((e,t,s)=>{b(e.generalizations,t,s)})),(0,O.aD)(((e,t)=>{L(e._subclasses,t)})),(0,O.aD)(((e,t)=>{D(e._subclasses,t)})),(0,O.aD)(((e,t)=>{Co(e),To(t),e.value=t,e.ownerReference.value=t.rawType}))),Iu=((0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{yu(e.genericType,To(t))})),(0,O.aD)(((e,t)=>{e.multiplicity=t})),(0,O.aD)(((e,t)=>{e.aggregation=t})),(0,O.aD)(((e,t)=>{e.value=Oo(t),Ou(e.ownerReference,t._OWNER)})),(0,O.aD)(((e,t)=>{L(e.taggedValues,fo(t))})),(0,O.aD)(((e,t)=>{D(e.taggedValues,t)})),(0,O.aD)(((e,t)=>{L(e.stereotypes,go(t))})),(0,O.aD)(((e,t)=>{D(e.stereotypes,t)})),(0,O.aD)(((e,t)=>{e.tag.value=Ao(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)=>{b(e.taggedValues,t,s)})),(0,O.aD)(((e,t,s)=>{b(e.stereotypes,t,s)})),(0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{e.functionDefinition=Gs(t)})),(0,O.aD)(((e,t)=>{L(e.p_tags,Ao(t))})),(0,O.aD)(((e,t)=>{D(e.p_tags,t)})),(0,O.aD)(((e,t)=>{L(e.p_stereotypes,Oo(t))})),(0,O.aD)(((e,t)=>{D(e.p_stereotypes,t)})),(0,O.aD)(((e,t,s)=>{b(e.p_tags,t,s)})),(0,O.aD)(((e,t,s)=>{b(e.p_stereotypes,t,s)})),(0,O.aD)(((e,t)=>{D(e.parameters,t)})),(0,O.aD)(((e,t)=>{L(e.parameters,zs(t))})),(0,O.aD)(((e,t)=>{Ou(e.returnType,jo(t))})),(0,O.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,O.aD)(((e,t,s)=>{b(e.parameters,t,s)})),(0,O.aD)(((e,t)=>{e.name=t})),(0,O.aD)(((e,t)=>{L(e.values,yo(t))})),(0,O.aD)(((e,t)=>{D(e.values,t)})),(0,O.aD)(((e,t,s)=>{b(e.values,t,s)})),(0,O.aD)(((e,t)=>{e.value=yo(t),Ou(e.ownerReference,t._OWNER)})),(0,O.aD)(((e,t,s)=>{const i=((e,t)=>{const s=e.properties.findIndex((e=>e===t));return X(-1!==s,`Can't find property '${t.name}' in association '${e.path}'`),$(e.properties[(s+1)%2])})(e,t),n=W(t.genericType.ownerReference.value,rs,`Association property '${t.name}' must be of type 'class'`);var a;((a=n).package||a.name)&&X(D(n.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${n.path}'`),L(s.propertiesFromAssociations,i);const r=new _u(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,O.aD)(((e,t)=>{e.canonicalUnit=Ro(t)})),(0,O.aD)(((e,t)=>{e.conversionFunction=Gs(t)})),(0,O.aD)(((e,t)=>{e.classViews=t.map(Go)}))),vu=(0,O.aD)(((e,t)=>{L(e.classViews,Go(t))})),Ru=(0,O.aD)(((e,t)=>{D(e.classViews,t)})),Pu=(0,O.aD)(((e,t)=>{e.associationViews=t.map(Ho)})),wu=(0,O.aD)(((e,t)=>{D(e.associationViews,t)})),Lu=(0,O.aD)(((e,t)=>{e.generalizationViews=t.map($o)})),bu=(0,O.aD)(((e,t)=>{L(e.generalizationViews,$o(t))})),Du=(0,O.aD)(((e,t)=>{D(e.generalizationViews,t)})),Mu=(0,O.aD)(((e,t)=>{e.propertyViews=t.map(Yo)})),ku=(0,O.aD)(((e,t)=>{L(e.propertyViews,Yo(t))})),Fu=(0,O.aD)(((e,t)=>{D(e.propertyViews,t)})),ju=(0,O.aD)(((e,t)=>{e.hideProperties=t})),Uu=(0,O.aD)(((e,t)=>{e.hideStereotypes=t})),Vu=(0,O.aD)(((e,t)=>{e.hideTaggedValues=t})),Gu=(0,O.aD)(((e,t)=>{e._offsetX=t})),zu=(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)})),$u=(0,O.aD)(gc),Hu=(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 pc(n.x,n.y).normal(new pc(l.x,l.y)).unit(),d=pc.fromPoints(n,new sc(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 sc(t,s),r.push(o))}e<a.length-2&&r.push(a[e+1])}return o&&n&&mc(e,r),o})),Yu=(0,O.aD)(mc),Wu=(0,O.aD)(((e,t)=>{e.rectangle=t})),Ku=(0,O.aD)(((e,t)=>{e.position=t})),Zu=(0,O.aD)((e=>{e._dummyObservable={}}));var Xu,qu,Ju;!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"}(Xu=Xu||(Xu={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(qu=qu||(qu={})),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"}(Ju=Ju||(Ju={}));const Qu=.05,ep=[50,75,90,100,110,125,150,200,250,300,400],tp=e=>(e instanceof hu?"/ ":"")+e.name;class sp{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 ic(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new sc(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 sc(0,0),this.virtualScreen=new nc(new sc(0,0),new ic(0,0)),this.zoom=1,this.triangle=[new sc(0,0),new sc(-15,-10),new sc(-15,10)],this.diamond=[new sc(0,0),new sc(-10,-5),new sc(-20,0),new sc(-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=Xu.LAYOUT,this.relationshipMode=qu.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 sc(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new sc(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 ic(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new sc(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 sc(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case Xu.LAYOUT:case Xu.PAN:case Xu.ZOOM_IN:case Xu.ZOOM_OUT:case Xu.ADD_CLASS:if(t!==qu.NONE)throw new F(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case Xu.ADD_RELATIONSHIP:if(t===qu.NONE)throw new F("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new j(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===Xu.ADD_RELATIONSHIP)switch(t){case qu.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||Wl(e.class.value).includes(t.class.value)||Wl(t.class.value).includes(e.class.value)||Su(e.class.value,pu.create(new _u(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new uc(this.diagram,e,t);return bu(this.diagram,s),s}};break;case qu.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new mu(`property_${e.class.value.properties.length+1}`,gu.ONE,pu.create(new _u(t.class.value)),e.class.value);if(Au(e.class.value,s),e!==t){const i=new hc(this.diagram,fu.create(s),e,t);return ku(this.diagram,i),i}};break;default:throw new j(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case Ju.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Ku(t,new sc(e,t.position.y))));break}case Ju.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=>Ku(t,new sc(e-t.rectangle.width/2,t.position.y))));break}case Ju.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=>Ku(t,new sc(e-t.rectangle.width,t.position.y))));break}case Ju.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Ku(t,new sc(t.position.x,e))));break}case Ju.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=>Ku(t,new sc(t.position.x,e-t.rectangle.height/2))));break}case Ju.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=>Ku(t,new sc(t.position.x,e-t.rectangle.height))));break}case Ju.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];Ku(s,new sc(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];Ku(n,new sc(i.position.x+i.rectangle.width+s,n.position.y))}}break}case Ju.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];Ku(s,new sc(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];Ku(n,new sc(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 sc((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 sc((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 sc(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new sc(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 sc(t,s)})(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=$(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=cc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof hc){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,Tc(r).x),n=Math.max(n,Tc(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 nc(new sc(t,s),new ic(i-t,n-s))}else this.setZoomLevel(1),this.screenOffset=new sc(0,0),this.virtualScreen=new nc(new sc(this.canvasDimension.width/2,this.canvasDimension.height/2),new ic(0,0))}executeZoom(e,t){e=Math.max(e,Qu);const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)),i=this.zoom;this.setZoomLevel(e),this.screenOffset=new sc(((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,Qu)),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)),Qu))}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 ac(this.diagram,i,fs.create(e));return Ku(n,t??this.canvasCoordinateToModelCoordinate(new sc(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),vu(this.diagram,n),Zu(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)&&bu(this.diagram,new uc(this.diagram,n,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&bu(this.diagram,new uc(this.diagram,t,n)),Kl(e).forEach((e=>{e.genericType.value.rawType===s&&ku(this.diagram,new hc(this.diagram,fu.create(e),n,t))})),Kl(s).forEach((s=>{s.genericType.value.rawType===e&&ku(this.diagram,new hc(this.diagram,fu.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=tp(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 ls&&(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=Ue(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||(Kl(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;Wu(e,new ic(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 Kl(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof hu?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof Tu?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}}Zu(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,n,a){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=tp(e),o=Ue(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 sc(t(l),s(l)));a||this.ctx.fillText(r,u.x,u.y);const p=i(c),_=n(c),m=this.modelCoordinateToCanvasCoordinate(new sc(i(c),n(c)));a||this.ctx.fillText(o,m.x,m.y);const g=new sc(Math.min(d,p),Math.min(h,_));return new nc(g,new ic(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 nc(new sc(0,0),new ic(0,0))}drawPropertyOrAssociation(e){const t=cc.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 mu){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===cu.COMPOSITE||s.aggregation===cu.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+Ec(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+fc(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ec(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+fc(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ec(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+fc(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ec(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+fc(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+Ec(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+fc(this.diamond[0],e))*this.zoom),s.aggregation===cu.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===cu.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=cc.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+Ec(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+fc(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ec(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+fc(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ec(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+fc(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+Ec(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+fc(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)&&Yu(e,e.path.map((e=>new sc(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!==Xu.ZOOM_IN?Xu.ZOOM_IN:Xu.ZOOM_OUT,qu.NONE)}switchToViewMode(){this.changeMode(Xu.LAYOUT,qu.NONE)}switchToPanMode(){this.changeMode(Xu.PAN,qu.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(Xu.ADD_RELATIONSHIP,qu.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(Xu.ADD_RELATIONSHIP,qu.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(Xu.ADD_CLASS,qu.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof rs&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new sc(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof rs&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}keydown(e){var t;if(t=e,document.getElementById(Id)?.dispatchEvent(new KeyboardEvent(t.type,t)),"Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{Ru(this.diagram,e),Pu(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Lu(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),Mu(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof Cu?wu(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof hc&&Fu(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&Du(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=>{ju(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Uu(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Vu(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=>vu(this.diagram,e))),t[1].forEach((e=>bu(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,du.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new ac(this.diagram,(0,a.Z)(),fs.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=>vu(this.diagram,e))),t[1].forEach((e=>bu(this.diagram,e)))}this.drawScreen()}}mouseup(e){if(!this.isReadOnly)switch(this.interactionMode){case Xu.LAYOUT:this.diagram.generalizationViews.forEach((e=>$u(e))),this.diagram.associationViews.forEach((e=>$u(e))),this.diagram.propertyViews.forEach((e=>$u(e)));break;case Xu.ADD_CLASS:{const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new sc(e.x,e.y)));this.onAddClassViewClick(t),this.changeMode(Xu.LAYOUT,qu.NONE);break}case Xu.ZOOM_IN:{const t=Math.round(100*this.zoom);let s;s=t<=ep[0]-10?10*Math.floor(t/10)+10:t>=ep[ep.length-1]?100*Math.floor(t/100)+100:$(ep.find((e=>e>t))),this.zoomPoint(s/100,new sc(e.x,e.y));break}case Xu.ZOOM_OUT:{const t=Math.round(100*this.zoom);let s;s=t<=ep[0]?10*Math.ceil(t/10)-10:t>=ep[ep.length-1]+100?100*Math.ceil(t/100)-100:$((0,kl.Z)(ep,(e=>e<t))),this.zoomPoint(s/100,new sc(e.x,e.y));break}case Xu.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new sc(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&&(Gu(e.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),zu(e.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),Gu(e.to,-(s.position.x+s.rectangle.width/2-t.x)),zu(e.to,-(s.position.y+s.rectangle.height/2-t.y)))}}this.changeMode(Xu.LAYOUT,qu.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){if([Xu.ADD_RELATIONSHIP,Xu.ADD_CLASS,Xu.ZOOM_IN,Xu.ZOOM_OUT].includes(this.interactionMode))return;const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new sc(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 sc(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case Xu.PAN:return void(this.positionBeforeLastMove=new sc(e.x,e.y));case Xu.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(Cc(t).contains(s.x,s.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||Iu(this.diagram,this.reorderDiagramDomain($(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||Iu(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 sc(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=Hu(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=Hu(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=Hu(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 Xu.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(Xu.LAYOUT,qu.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=new sc(e.x,e.y));if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=new sc(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 sc(e.x,e.y))}mousemove(e){if(this.cursorPosition=new sc(e.x,e.y),this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===Xu.PAN)this.screenOffset=new sc(this.screenOffset.x+(e.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(e.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=new sc(e.x,e.y),this.clearScreen(),this.drawAll();else if(this.leftClick){const t=this.eventCoordinateToCanvasCoordinate(new sc(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);switch(this.interactionMode){case Xu.LAYOUT:if(this.selectedClassCorner&&(Wu(this.selectedClassCorner,new ic(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),Zu(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,Ku(i,new sc(n,r)),Zu(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 nc(new sc(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new ic(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(xc(this.selection,e)||xc(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case Xu.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 sc(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),Cc(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 nc(this.modelCoordinateToCanvasCoordinate(new sc(e.position.x+(e.rectangle.width-a)/2,n)),new ic(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 Kl(i))this.hasPropertyView(e,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new nc(this.modelCoordinateToCanvasCoordinate(new sc(e.position.x+this.classViewSpaceX,n)),new ic(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=cc.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,du.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new ac(t,(0,a.Z)(),fs.create(Yl(e.value,rs))))))),(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)&&(Ku(t[0],new sc(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];Ku(e,new sc(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 uc(t,s,e):[]))))))]}}class ip{_UUID=(0,a.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return Xt([qt.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class np extends gs{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[qt.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Zt).join(",")}}class ap extends np{ownerReference;constructor(e){const t=fs.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new ap(e)}}class rp extends gs{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[qt.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Zt).join(",")}}class op extends rp{ownerReference;constructor(e){const t=fs.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new op(e)}}class lp extends ns{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[Nu(xu(),xu()),Nu(xu(),xu())];t[0]._OWNER=this,t[1]._OWNER=this,this.properties=t}get _elementHashCode(){return Xt([qt.ASSOCIATION,this.path,Xt(this.properties),Xt(this.derivedProperties),Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class cp extends ns{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return Xt([qt.MAPPING,this.path,Xt(this.classMappings),Xt(this.enumerationMappings),Xt(this.associationMappings),Xt(this.test),Xt(this.includes),Xt(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class dp extends ns{p_stereotypes=[];p_tags=[];get _elementHashCode(){return Xt([qt.PROFILE,this.path,Xt(this.p_stereotypes.map((e=>e.value))),Xt(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class hp extends ns{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];postValidations=[];get patternParameters(){return(0,Ze.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return Xt([qt.SERVICE,Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues),this.path,this.pattern,Xt(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",Xt(this.tests),Xt(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class up extends ns{functionName;constructor(e){super(e),this.functionName=e}}class pp extends up{}class _p extends pp{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return Xt([qt.FUNCTION,this.path,Xt(this.parameters),this.returnType.valueForSerialization??"",Xt(this.taggedValues),Xt(this.stereotypes.map((e=>e.pointerHashCode))),es(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class mp extends ns{includes=[]}class gp extends mp{sections=[];get _elementHashCode(){return Xt([qt.FLAT_DATA,this.path,Xt(this.includes.map((e=>e.valueForSerialization??""))),Xt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class Ep extends ns{runtimeValue;get _elementHashCode(){return Xt([qt.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class fp extends ns{connectionValue;get _elementHashCode(){return Xt([qt.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class Tp extends ns{}class Cp extends Tp{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return Xt([qt.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",Xt(this.scopeElements.map((e=>e instanceof Es?e.valueForSerialization??"":e))),Xt(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class xp extends ns{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return Xt([qt.GENERATION_TREE,this.path,Xt(this.generationNodes),Xt(this.fileGenerations.map((e=>ts(we.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class Np extends mp{schemas=[];joins=[];filters=[];get _elementHashCode(){return Xt([qt.DATABASE,this.path,Xt(this.includes.map((e=>e.valueForSerialization??""))),Xt(this.schemas),Xt(this.joins),Xt(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class Op{_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 Ap extends ns{data;get hashCode(){return Xt([qt.DATA_ELEMENT,this.path,Xt(this.stereotypes.map((e=>e.pointerHashCode))),Xt(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}const Sp=new Set([ns,as,os,Tu,rs,lp,ls,_p,dp,ds,cs,class extends ns{sections=[];get _elementHashCode(){return Xt([qt.SECTION_INDEX,this.path,Xt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}},mp,cp,fp,Ep,hp,xp,Cp,Ap]);class yp{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 hs(e),this.extensions=this.createGraphExtensions(t)}createGraphExtensions(e){return e.map((e=>{if(Sp.has(e))throw new F("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new Op(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(H(ls))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(H(ds))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(H(rs))}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(H(gp))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(H(Np))}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 j("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new F("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 rs?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof ls?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof ds?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=>$(this.getOwnNullableSectionIndex(e),`Can't find section index '${e}'`);getOwnProfile=e=>$(this.getOwnNullableProfile(e),`Can't find profile '${e}'`);getOwnType=e=>$(this.getOwnNullableType(e),`Can't find type '${e}'`);getOwnClass=e=>$(this.getOwnNullableClass(e),`Can't find class '${e}'`);getOwnEnumeration=e=>$(this.getOwnNullableEnumeration(e),`Can't find enumeration '${e}'`);getOwnMeasure=e=>$(this.getOwnNullableMeasure(e),`Can't find measure '${e}'`);getOwnAssociation=e=>$(this.getOwnNullableAssociation(e),`Can't find association '${e}'`);getOwnFunction=e=>$(this.getOwnNullableFunction(e),`Can't find function '${e}'`);getOwnStore=e=>$(this.getOwnNullableStore(e),`Can't find store '${e}'`);getOwnDatabase=e=>W(this.getOwnNullableStore(e),Np,`Can't find database '${e}'`);getOwnFlatDataStore=e=>W(this.getOwnNullableStore(e),gp,`Can't find flat-data store '${e}'`);getOwnMapping=e=>$(this.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getOwnConnection=e=>$(this.getOwnNullableConnection(e),`Can't find connection '${e}'`);getOwnRuntime=e=>$(this.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getOwnService=e=>$(this.getOwnNullableService(e),`Can't find service '${e}'`);getOwnGenerationSpecification=e=>$(this.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getOwnFileGeneration=e=>$(this.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getOwnDataElement=e=>$(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=>w((()=>{e.dispose()})))))}getNullablePackage=e=>e?V((()=>$l(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){Gl(t?Hl(this,t,void 0):this.root,e),e instanceof cp?this.setOwnMapping(e.path,e):e instanceof mp?this.setOwnStore(e.path,e):e instanceof as?this.setOwnType(e.path,e):e instanceof lp?this.setOwnAssociation(e.path,e):e instanceof dp?this.setOwnProfile(e.path,e):e instanceof _p?this.setOwnFunction(e.path,e):e instanceof hp?this.setOwnService(e.path,e):e instanceof fp?this.setOwnConnection(e.path,e):e instanceof Ep?this.setOwnRuntime(e.path,e):e instanceof Cp?this.setOwnFileGeneration(e.path,e):e instanceof xp?this.setOwnGenerationSpecification(e.path,e):e instanceof Ap?this.setOwnDataElement(e.path,e):e instanceof hs||this.getExtensionForElementClass(I(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&zl(e.package,e),e instanceof cp?this.mappingsIndex.delete(e.path):e instanceof mp?this.storesIndex.delete(e.path):e instanceof as?(this.typesIndex.delete(e.path),e instanceof ds&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof lp?this.associationsIndex.delete(e.path):e instanceof dp?this.profilesIndex.delete(e.path):e instanceof _p?this.functionsIndex.delete(e.path):e instanceof hp?this.servicesIndex.delete(e.path):e instanceof Ep?this.runtimesIndex.delete(e.path):e instanceof fp?this.connectionsIndex.delete(e.path):e instanceof Cp?this.fileGenerationsIndex.delete(e.path):e instanceof xp?this.generationSpecificationsIndex.delete(e.path):e instanceof Ap?this.dataElementsIndex.delete(e.path):e instanceof hs?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 j(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof hs&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof hs)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new j(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new j(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,n]=Ul(s);if(!(e instanceof hs)){const t=this.getNullablePackage(i)??(""!==i?Hl(this,i,void 0):this.root);e.name=n,e instanceof _p&&(e.functionName=(a=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Zl(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Zl(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(a))))),e.package!==t&&(e.package&&zl(e.package,e),Gl(t,e))}var a,r;if(e instanceof cp)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof mp)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof as)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof ds&&(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 lp)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof dp)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof _p)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof hp)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof Ep)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof fp)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof Cp)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof Ap)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof xp)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof hs){const a=new Map;if(e.children.forEach((e=>{a.set(e.path,e)})),e.name=n,!e.package)throw new F("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){zl(r,e);const t=""!==i?Hl(this,i,void 0):this.root;Gl(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 Ip extends yp{constructor(e,t){super(Te.PROJECT_DEPENDENCY_ROOT,e),this.root=t}}const vp=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class Rp{root=new hs(Te.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 Ip(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=vp(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=vp(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=vp(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=vp(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=vp(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=vp(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=vp(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=vp(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=vp(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=vp(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=vp(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=vp(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=vp(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=vp(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=vp(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=vp(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 $(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 Pp extends mp{static NAME="ModelStore";static INSTANCE=new Pp;constructor(){super(Pp.NAME)}accept_PackageableElementVisitor(e){throw new j}}class wp extends yp{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(Te.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(Pp.NAME,Pp.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[Tu.STRING,Tu.BOOLEAN,Tu.BINARY,Tu.NUMBER,Tu.INTEGER,Tu.FLOAT,Tu.DECIMAL,Tu.DATE,Tu.STRICTDATE,Tu.DATETIME,Tu.STRICTTIME,Tu.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class Lp extends yp{autoImports=[];constructor(e){super(Te.SYSTEM,e)}initializeAutoImports(){this.autoImports=Ae.map((e=>W(this.getOwnNullableElement(e,!0),hs,`Can't find auto-import package '${e}'`)))}}class bp extends yp{constructor(e){super(Te.MODEL_GENERATION,e)}}class Dp extends yp{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(Te.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new bp(i),this.dependencyManager=new Rp(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=>$(this.coreModel.primitiveTypesIndex.get(e),`Can't find primitive type '${e}'`);getType=e=>$(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=>$(this.getOwnNullableProfile(e)??this.generationModel.getOwnNullableProfile(e)??this.dependencyManager.getOwnNullableProfile(e)??this.systemModel.getOwnNullableProfile(e),`Can't find profile '${e}'`);getEnumeration=e=>W(this.getType(e),ls,`Can't find enumeration '${e}'`);getMeasure=e=>W(this.getType(e),ds,`Can't find measure '${e}'`);getUnit=e=>W(this.getType(e),cs,`Can't find unit '${e}'`);getClass=e=>W(this.getType(e),rs,`Can't find class '${e}'`);getAssociation=e=>$(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e),`Can't find association '${e}'`);getPropertyOwner=e=>$(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e)??W(this.getType(e),rs),`Can't find property owner '${e}'`);getFunction=e=>W(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),_p,`Can't find function '${e}'`);getStore=e=>$(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=>W(this.getStore(e),gp,`Can't find flat-data store '${e}'`);getDatabase=e=>W(this.getStore(e),Np,`Can't find database store '${e}'`);getMapping=e=>$(this.getOwnNullableMapping(e)??this.generationModel.getOwnNullableMapping(e)??this.dependencyManager.getOwnNullableMapping(e)??this.systemModel.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getService=e=>$(this.getOwnNullableService(e)??this.generationModel.getOwnNullableService(e)??this.dependencyManager.getOwnNullableService(e)??this.systemModel.getOwnNullableService(e),`Can't find service '${e}'`);getConnection=e=>$(this.getOwnNullableConnection(e)??this.generationModel.getOwnNullableConnection(e)??this.dependencyManager.getOwnNullableConnection(e)??this.systemModel.getOwnNullableConnection(e),`Can't find connection '${e}'`);getRuntime=e=>$(this.getOwnNullableRuntime(e)??this.generationModel.getOwnNullableRuntime(e)??this.dependencyManager.getOwnNullableRuntime(e)??this.systemModel.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getGenerationSpecification=e=>$(this.getOwnNullableGenerationSpecification(e)??this.generationModel.getOwnNullableGenerationSpecification(e)??this.dependencyManager.getOwnNullableGenerationSpecification(e)??this.systemModel.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getFileGeneration=e=>$(this.getOwnNullableFileGeneration(e)??this.generationModel.getOwnNullableFileGeneration(e)??this.dependencyManager.getOwnNullableFileGeneration(e)??this.systemModel.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getDataElement=e=>$(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 $(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)=>$(this.getNullableElement(e,t),`Can't find element '${e}'`);getNullableClass=e=>V((()=>this.getClass(e)));getNullableMapping=e=>V((()=>this.getMapping(e)));getNullableService=e=>V((()=>this.getService(e)));getNullableRuntime=e=>V((()=>this.getRuntime(e)));getNullableFileGeneration=e=>V((()=>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=gu.ONE:0===e&&1===t?s=gu.ZERO_ONE:0===e&&void 0===t?s=gu.ZERO_MANY:1===e&&void 0===t?s=gu.ONE_MANY:0===e&&0===t&&(s=gu.ZERO),s??new gu(e,t)}addElement(e,t){const s=Vl(t??"",e.name);if(this.getNullableElement(s,!1))throw new F(`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 F(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class Mp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class kp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Fp{sourceId;line;column;startLine;startColumn;endLine;endColumn}(0,Be.yu)(Fp,{column:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)(),line:(0,Be.Ru)(),sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)()});const jp=(0,Be.PG)((()=>Be.AM),(e=>(e.sourceId=e.source,(0,Be.vB)(Fp,e))));class Up{package;name;tags=[];stereotypes=[]}(0,Be.yu)(Up,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ru)()),tags:(0,Be.pb)((0,Be.Ru)())});class Vp{profile;value}(0,Be.yu)(Vp,{profile:(0,Be.Ru)(),value:(0,Be.Ru)()});class Gp{profile;value}(0,Be.yu)(Gp,{profile:(0,Be.Ru)(),value:(0,Be.Ru)()});class zp{tag;value}(0,Be.yu)(zp,{tag:(0,Be.Ry)(Gp),value:(0,Be.Ru)()});class Bp{rawType;typeParameter}(0,Be.yu)(Bp,{rawType:(0,Be.jt)((0,Be.Ru)()),typeParameter:(0,Be.jt)((0,Be.Ru)())});class $p{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,Be.yu)($p,{aggregation:(0,Be.Ru)(),genericType:(0,Be.Ry)(Bp),multiplicity:(0,Be.Ru)(),name:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ry)(Vp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp))});class Hp{package;name;sourceInformation}(0,Be.yu)(Hp,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),sourceInformation:jp});class Yp{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,Be.yu)(Yp,{generalizations:(0,Be.pb)((0,Be.Ry)(Bp)),name:(0,Be.Ru)(),package:(0,Be.Ru)(),properties:(0,Be.pb)((0,Be.Ry)($p)),qualifiedProperties:(0,Be.pb)((0,Be.Ry)($p)),sourceInformation:jp,stereotypes:(0,Be.pb)((0,Be.Ry)(Vp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp))});class Wp{package;name;enumValues=[]}(0,Be.yu)(Wp,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),enumValues:(0,Be.pb)((0,Be.Ru)())});class Kp{x;y}(0,Be.yu)(Kp,{x:(0,Be.Ru)(),y:(0,Be.Ru)()});class Zp{height;width}(0,Be.yu)(Zp,{height:(0,Be.Ru)(),width:(0,Be.Ru)()});class Xp{points=[]}(0,Be.yu)(Xp,{points:(0,Be.pb)((0,Be.Ry)(Kp))});class qp{id;source;target;geometry}(0,Be.yu)(qp,{geometry:(0,Be.Ry)(Xp),id:(0,Be.Ru)(),source:(0,Be.Ru)(),target:(0,Be.Ru)()});class Jp{name;owningType}(0,Be.yu)(Jp,{name:(0,Be.Ru)(),owningType:(0,Be.Ru)()});class Qp{id;source;target;property;geometry}(0,Be.yu)(Qp,{geometry:(0,Be.Ry)(Xp),id:(0,Be.Ru)(),property:(0,Be.Ry)(Jp),source:(0,Be.Ru)(),target:(0,Be.Ru)()});class e_{id;type;position;rectangleGeometry}(0,Be.yu)(e_,{id:(0,Be.Ru)(),position:(0,Be.Ry)(Kp),rectangleGeometry:(0,Be.Ry)(Zp),type:(0,Be.Ru)()});class t_{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,Be.yu)(t_,{name:(0,Be.Ru)(),generalizationViews:(0,Be.pb)((0,Be.Ry)(qp)),package:(0,Be.Ru)(),propertyViews:(0,Be.pb)((0,Be.Ry)(Qp)),sourceInformation:jp,stereotypes:(0,Be.pb)((0,Be.Ry)(Vp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp)),typeViews:(0,Be.pb)((0,Be.Ry)(e_))});class s_{classes=[];enumerations=[];profiles=[]}(0,Be.yu)(s_,{classes:(0,Be.pb)((0,Be.Ry)(Yp)),enumerations:(0,Be.pb)((0,Be.Ry)(Wp)),profiles:(0,Be.pb)((0,Be.Ry)(Up))});class i_{name;diagram;domainInfo}(0,Be.yu)(i_,{diagram:(0,Be.Ry)(t_),name:(0,Be.Ru)(),domainInfo:(0,Be.jt)((0,Be.Ry)(s_))});class n_{class;enumerations=[];profiles=[];specializations=[]}(0,Be.yu)(n_,{class:(0,Be.Ry)(Yp),enumerations:(0,Be.pb)((0,Be.Ry)(Wp)),profiles:(0,Be.pb)((0,Be.Ry)(Up)),specializations:(0,Be.pb)((0,Be.Ry)(Hp))});const a_=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}`},r_=(e,t,s,i)=>{const n=t.getOwnNullableClass(e);if(!n){const[n,a]=Ul(e),r=new rs(a);return Gl($l(t.root,n,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return n},o_=e=>{if("*"===e)return new gu(0,void 0);{const t=e.split("..");if(1===t.length)return new gu(parseInt($(t[0]),10),parseInt($(t[0]),10));if(2===t.length)return new gu(parseInt($(t[0]),10),"*"===t[1]?void 0:parseInt($(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},l_=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,n;L(e.taggedValues,new ip(ap.create((i=s.getProfile(t.tag.profile),n=t.tag.value,$(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;L(e.stereotypes,op.create((i=s.getProfile(t.profile),n=t.value,$(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=r_($(t.rawType),s,i,void 0);L(e.generalizations,pu.create(new _u(n))),L(n._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const n=new mu(t.name,o_(t.multiplicity),pu.create(new _u(s.getOwnNullableEnumeration($(t.genericType.rawType))??r_($(t.genericType.rawType),s,i,void 0))),e);n.aggregation="Composite"===t.aggregation?cu.COMPOSITE:"Shared"===t.aggregation?cu.SHARED:void 0,L(e.properties,n)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{L(e.derivedProperties,new hu(t.name,o_(t.multiplicity),pu.create(new _u(s.getOwnNullableEnumeration($(t.genericType.rawType))??r_($(t.genericType.rawType),s,i,void 0))),e))}))},c_=e=>{const t=new Dp(new wp([]),new Lp([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new rs(e.name);Gl($l(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 dp(e.name);Gl($l(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>L(s.p_tags,new Mp(s,e)))),e.stereotypes.forEach((e=>L(s.p_stereotypes,new kp(s,e))))})),i.enumerations.forEach((e=>{const s=new ls(e.name);Gl($l(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":ge}${e.name}`,n=t.getClass(i);l_(n,e,t,s)}))}const i=e.diagram,n=new Zo(i.name);return Gl($l(t.root,i.package,!0,new Map),n),i.typeViews.forEach((e=>{const s=new ac(n,e.id,fs.create(t.getClass(e.type)));s.position=new sc(e.position.x,e.position.y),s.rectangle=new ic(e.rectangleGeometry.width,e.rectangleGeometry.height),L(n.classViews,s)})),i.propertyViews.forEach((e=>{const s=new hc(n,fu.create((i=t.getClass(e.property.owningType),a=e.property.name,$(i instanceof rs?Kl(i).find((e=>e.name===a)):i.properties.find((e=>e.name===a)),`Can't find property '${a}' of '${i.path}'`))),$(n.classViews.find((t=>t.id===e.source))),$(n.classViews.find((t=>t.id===e.target))));var i,a;s.path=e.geometry.points.map((e=>new sc(e.x,e.y))),gc(s),L(n.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new uc(n,$(n.classViews.find((t=>t.id===e.source))),$(n.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new sc(e.x,e.y))),gc(t),L(n.generalizationViews,t)})),[n,t,s]};class d_ extends th{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]=c_(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return Hd(this.diagramPath)}get description(){return`Diagram: ${Hd(this.diagramPath)}`}get diagramName(){return Fl(this.diagramPath)}match(e){return e instanceof d_&&this.diagramPath===e.diagramPath}get renderer(){return $(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 Xu.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case Xu.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case Xu.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case Xu.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]=c_(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 Wd(t.sourceId,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?"":ge}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new dp(e.name);Gl($l(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>L(s.p_tags,new Mp(s,e)))),e.stereotypes.forEach((e=>L(s.p_stereotypes,new kp(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":ge}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new ls(e.name);Gl($l(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,n=`${i.package}${""===i.package?"":ge}${i.name}`;let a=t.getOwnNullableClass(n);a||(a=new rs(i.name),Gl($l(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=$(a),n=r_($(`${e.package}${""===e.package?"":ge}${e.name}`),t,s,e.sourceInformation);L(i._subclasses,n),n.generalizations.map((e=>e.value.rawType)).includes(i)||L(n.generalizations,pu.create(new _u(i)))})),r&&l_(a,i,t,s),a})((0,Be.vB)(n_,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:ah.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:ah.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:ah.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:ah.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[ah.RECENTER,ah.USE_ZOOM_TOOL,ah.USE_VIEW_TOOL,ah.USE_PAN_TOOL].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class h_{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 u_ extends M{}class p_{applicationStore;initState=Et.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=kd.CONSOLE;auxPanelDisplayState=new lu({initial:0,default:300,snap:100});activeActivity=Md.CONCEPT;sideBarDisplayState=new lu({initial:300,default:300,snap:150});tabManagerState=new sh(this);executionState=Et.create();navigationStack=[];consoleText;fileSearchCommandLoadingState=Et.create();fileSearchCommandState=new h_;openFileSearchCommand=!1;fileSearchCommandResults=[];textSearchCommandLoadingState=Et.create();textSearchCommandState=new h_;openTextSearchCommand=!1;searchState;testRunState=Et.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,command:O.ls,findUsages:O.ls,renameConcept:O.ls,movePackageableElements:O.ls,updateFileUsingSuggestionCandidate:O.ls,updateFile:O.ls,searchFile:O.ls,searchText:O.ls,createNewDirectory:O.ls,createNewFile:O.ls,renameFile:O.ls,deleteDirectoryOrFile:O.ls}),this.applicationStore=e,this.directoryTreeState=new Ch(this),this.conceptTreeState=new xh(this),this.client=new ou(new pe({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,Be.vB)(Ah,n):(0,Be.vB)(Oh,n):(0,Be.vB)(Nh,n);o.text&&(this.setConsoleText(o.text),this.setActiveAuxPanelMode(kd.CONSOLE),this.auxPanelDisplayState.open()),o instanceof Oh?o.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof Ah&&(yield(0,O.fl)(this.loadFile(o.source,new Kd(o.source,o.line,o.column,new u_((o.text??"").split("\n").filter(Boolean)[0]))))):(t&&(yield t()),yield Promise.all([i,a,r]))}catch(e){return U(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:ih.SEARCH_FILE,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:ih.SEARCH_TEXT,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenTextSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:ih.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof hh&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,!0)}}),this.applicationStore.commandCenter.registerCommand({key:ih.TOGGLE_AUX_PANEL,trigger:()=>this.initState.hasSucceeded,action:()=>this.auxPanelDisplayState.toggle()}),this.applicationStore.commandCenter.registerCommand({key:ih.EXECUTE,action:()=>{(0,O.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:ih.FULL_RECOMPILE,action:()=>{(0,O.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:ih.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,O.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:ih.RUN_ALL_TESTS,action:()=>{(0,O.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:ih.RUN_RELAVANT_TESTS,action:()=>{(0,O.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[ih.SEARCH_FILE,ih.SEARCH_TEXT,ih.GO_TO_FILE,ih.TOGGLE_AUX_PANEL,ih.EXECUTE,ih.FULL_RECOMPILE,ih.FULL_RECOMPILE_WITH_FULL_INIT,ih.RUN_ALL_TESTS,ih.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 d_&&e.diagramPath===t));n||(yield(0,O.fl)(this.checkIfSessionWakingUp()),n=new d_(this,(0,Be.vB)(i_,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 hh&&t.filePath===e));s||(yield(0,O.fl)(this.checkIfSessionWakingUp()),s=new hh(this,(0,Be.vB)(Yd,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof Kd&&s.showError(t))}*reloadFile(e){const t=[];yield Promise.all(this.tabManagerState.tabs.map((async s=>{if(s instanceof hh&&s.filePath===e)s.setFile((0,Be.vB)(Yd,await this.client.getFile(e)));else if(s instanceof d_&&s.filePath===e)try{s.rebuild((0,Be.vB)(i_,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 zh||this.setSearchState(void 0),this.executionState.inProgress();try{const r=this.tabManagerState.tabs.map((e=>e instanceof hh?{path:e.filePath,code:e.file.content}:e instanceof d_?{diagram:e.diagramPath,code:a_(e.diagram)}:void 0)).filter(z),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=$(c)).error?a.candidateName&&a.PureUnmatchedFunctionException?(0,Be.vB)(Lh,a):a.candidateName&&a.candidates?(0,Be.vB)(bh,a):(0,Be.vB)(Ih,a):a.jumpTo?(0,Be.vB)(Rh,a):a.tests?(0,Be.vB)(kh,a):(0,Be.vB)(yh,a);this.applicationStore.setBlockingAlert(void 0),n?.avoidUpdatingConsoleText||this.setConsoleText(h.text),h instanceof Ih?(this.applicationStore.notifyWarning("Execution failed!"),h.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:h.sessionError}):yield(0,O.fl)(i(h))):h instanceof yh?(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 Ih)yield(0,O.fl)(this.loadFile(e.source,new Kd(e.source,e.line,e.column,new u_(e.text.split("\n").filter(Boolean)[0])))),e instanceof Lh?(this.setSearchState(new Hh(this,e)),this.setActiveAuxPanelMode(kd.SEARCH_RESULT),this.auxPanelDisplayState.open()):e instanceof bh&&(this.setSearchState(new Yh(this,e)),this.setActiveAuxPanelMode(kd.SEARCH_RESULT),this.auxPanelDisplayState.open());else if(e instanceof yh&&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! (reason: VCS required)"):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 Ih)await(0,O.fl)(this.loadFile(e.source,new Kd(e.source,e.line,e.column,new u_(e.text.split("\n").filter(Boolean)[0])))),this.setActiveAuxPanelMode(kd.CONSOLE),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof kh){this.setActiveAuxPanelMode(kd.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new nu(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 Rh&&await(0,O.fl)(this.loadFile(e.jumpTo.source,new Wd(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(Md.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:vt.CAUTION,actions:[{label:"Perform full re-compile",type:Rt.PROCEED_WITH_CAUTION,handler:()=>{(0,O.fl)(this.executeSaveAndReset(e)).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Rt.PROCEED,default:!0}]})}*refreshTrees(){yield Promise.all([this.directoryTreeState.refreshTreeData(),this.conceptTreeState.refreshTreeData()])}async revealConceptInTree(e){const t="Error revealing concept. Please make sure that the code compiles and that you are looking for a valid concept";let s;try{s=await this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning(t)}if(s.path){this.applicationStore.setBlockingAlert({message:"Revealing concept in tree...",showLoading:!0});try{this.activeActivity!==Md.CONCEPT&&this.setActiveActivity(Md.CONCEPT);const e=s.path.split(ge);let t=$(e[0]),i=$(this.conceptTreeState.getTreeData().nodes.get(t));for(let s=1;s<e.length;++s)t=`${t}::${e[s]}`,this.conceptTreeState.getTreeData().nodes.get(t)||await(0,O.fl)(this.conceptTreeState.expandNode(i)),i=$(this.conceptTreeState.getTreeData().nodes.get(t));this.conceptTreeState.setSelectedNode(i)}catch{this.applicationStore.notifyWarning(t)}finally{this.applicationStore.setBlockingAlert(void 0)}}}*command(e){try{const s=(t=yield e()).error?(0,Be.vB)(ru,t):new au;return!(s instanceof ru&&(s.errorDialog?this.applicationStore.notifyWarning(`Error: ${s.text}`):this.setConsoleText(s.text),1))}catch(e){return U(e),this.applicationStore.notifyError(e),!1}var t}async getConceptInfo(e){try{return this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning("Can't find concept info. Please make sure that the code compiles and that you are looking for references of non primitive types!")}}async findConceptUsages(e,t){return(await this.client.getUsages(e,t)).map((e=>(0,Be.vB)(qd,e)))}*findUsages(e){const t=yield this.getConceptInfo(e);if(t)try{this.applicationStore.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${Xd(t)}`,showLoading:!0});const e=yield this.findConceptUsages(t.pureType===Ud.ENUM_VALUE?Zd.ENUM:t.pureType===Ud.PROPERTY||t.pureType===Ud.QUALIFIED_PROPERTY?Zd.PROPERTY:Zd.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`)),s=(yield this.client.getTextSearchPreview(e.map((e=>(0,Be.qC)(Uh,new Uh(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn)))))).map((e=>(0,Be.vB)(Uh,e)));this.setSearchState(new $h(this,t,e,s)),this.setActiveAuxPanelMode(kd.SEARCH_RESULT),this.auxPanelDisplayState.open()}catch(e){U(e),this.applicationStore.notifyError(e)}finally{this.applicationStore.setBlockingAlert(void 0)}}*renameConcept(e,t,s,i){try{yield this.client.renameConcept({oldName:e,newName:t,pureType:s,sourceInformations:i.map((e=>({sourceId:e.source,line:e.line,column:e.column})))});const n=i.map((e=>e.source));for(const e of n)yield(0,O.fl)(this.reloadFile(e));yield(0,O.fl)(this.refreshTrees()),this.setConsoleText("Sucessfully renamed concept. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError(`Can't rename concept '${e}'`)}}*movePackageableElements(e){try{yield this.client.movePackageableElements(e.map((e=>({pureName:e.pureName,pureType:e.pureType,sourcePackage:e.sourcePackage,destinationPackage:e.destinationPackage,sourceInformations:e.usages.map((e=>({sourceId:e.source,line:e.line,column:e.column})))}))));const t=(0,Ze.Z)(e.flatMap((e=>e.usages.map((e=>e.source)))));for(const e of t)yield(0,O.fl)(this.reloadFile(e));yield(0,O.fl)(this.refreshTrees()),this.setConsoleText("Sucessfully moved packageble elements. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError("Can't move packageable elements")}}*updateFileUsingSuggestionCandidate(e){this.setSearchState(void 0),yield(0,O.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActiveAuxPanelMode(kd.CONSOLE),this.auxPanelDisplayState.open()}*updateFile(e,t,s,i,n){try{const a=yield this.client.updateSource([{path:e,line:t,column:s,message:n,add:i}]);if(a.modifiedFiles.length)for(const e of a.modifiedFiles)yield(0,O.fl)(this.reloadFile(e));this.setConsoleText("Sucessfully updated file. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError(`Can't update file: ${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(kd.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,Be.vB)(Vh,e))(e)));this.setSearchState(new Bh(this,e)),this.textSearchCommandLoadingState.pass()}catch(e){U(e),this.applicationStore.notifyError(e),this.textSearchCommandLoadingState.fail()}}}*createNewDirectory(e){try{yield(0,O.fl)(this.command((()=>this.client.createFolder(Hd(e))))),yield(0,O.fl)(this.directoryTreeState.refreshTreeData())}catch(e){U(e),this.applicationStore.notifyError(e)}}*createNewFile(e){try{const t=yield(0,O.fl)(this.command((()=>this.client.createFile(Hd(e)))));yield(0,O.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,O.fl)(this.loadFile(e)))}catch(e){U(e),this.applicationStore.notifyError(e)}}*renameFile(e,t){try{yield(0,O.fl)(this.command((()=>this.client.renameFile(e,t)))),yield(0,O.fl)(this.directoryTreeState.refreshTreeData());const s=this.tabManagerState.tabs.find((t=>t instanceof hh&&t.filePath===e));s&&this.tabManagerState.closeTab(s)}catch(e){U(e),this.applicationStore.notifyError(e)}}*deleteDirectoryOrFile(e,t,s){const i=async()=>{await(0,O.fl)(this.command((()=>this.client.deleteDirectoryOrFile(Hd(e))))),this.tabManagerState.tabs.filter((s=>s instanceof hh&&(t?s.filePath.startsWith(`${e}/`):s.filePath===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:vt.CAUTION,actions:[{label:"Delete anyway",type:Rt.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Rt.PROCEED,default:!0}]})}}const __=(0,nt.createContext)(void 0),m_=({children:e})=>{const t=kt(),s=(0,it.fv)((()=>new p_(t)));return(0,x.jsx)(__.Provider,{value:s,children:e})},g_=()=>$((0,nt.useContext)(__),"Can't find editor store in context"),E_=(0,it.Pi)((()=>{const e=g_();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)(dd,{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"})})]})})})})]})})),f_=(0,it.Pi)((e=>{const{searchState:t,searchEntry:s}=e,i=g_(),n=kt(),a=e=>()=>(0,O.fl)(i.loadFile(s.sourceId,new Wd(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)(Zc.QqN,{})}),(0,x.jsx)("div",{className:"search-panel__entry__header__title__content",children:Hd(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)(Zc.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.jsxs)("div",{className:"search-panel__entry__content__item__label search-panel__entry__content__item__label--full",title:"Go to Result",onClick:a(e),children:[e.preview&&(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__content",children:[(0,x.jsx)("div",{className:"search-panel__entry__content__item__label__coordinates",children:`[${e.startLine}:${e.startColumn}]`}),(0,x.jsxs)("div",{className:"search-panel__entry__content__item__label__preview",children:[(0,x.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text",children:e.preview.before}),(0,x.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text search-panel__entry__content__item__label__preview__text--found",children:e.preview.found.replaceAll(/\n/g,"↵")}),(0,x.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text",children:e.preview.after})]})]}),!e.preview&&(0,x.jsx)(x.Fragment,{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)(Zc.q1B,{})})})]},e.uuid)))})]})})),T_=(0,it.Pi)((e=>{const{searchState:t}=e,s=g_();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)(f_,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(dd,{children:`No occurrences found for '${s.textSearchCommandState.text}'`})})),C_=(0,it.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 ${Xd(t.usageConcept)}`}),t.searchEntries.map((e=>(0,x.jsx)(f_,{searchState:t,searchEntry:e},e.uuid)))]}):(0,x.jsx)(dd,{children:`No usages found for ${Xd(t.usageConcept)}`})})),x_=(0,it.Pi)((e=>{const{candidate:t}=e,s=g_(),i=kt(),n=()=>{(0,O.fl)(s.loadFile(t.sourceID,new Wd(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:`${Hd(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)(Zc.bK4,{})})})]})})),N_=(0,it.Pi)((e=>{const{candidate:t}=e,s=g_(),i=kt();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:`${Hd(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 Wd(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,x.jsx)(Zc.bK4,{})})})]})})),O_=(0,it.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)(x_,{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)(N_,{candidate:e},e.uuid)))})]})]})})),A_=(0,it.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)(N_,{candidate:e},e.uuid)))})]})]})})),S_=(0,it.Pi)((()=>{const e=g_();return(0,x.jsxs)("div",{className:"search-panel",children:[(0,x.jsx)(Wc,{isLoading:e.textSearchCommandLoadingState.isInProgress}),!e.searchState&&(0,x.jsx)(dd,{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)(Zc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,x.jsx)("div",{className:"hotkey__plus",children:(0,x.jsx)(Zc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F"})]})]})})})}),e.searchState instanceof $h&&(0,x.jsx)(C_,{usageState:e.searchState}),e.searchState instanceof Bh&&(0,x.jsx)(T_,{searchState:e.searchState}),e.searchState instanceof Hh&&(0,x.jsx)(O_,{searchState:e.searchState}),e.searchState instanceof Yh&&(0,x.jsx)(A_,{searchState:e.searchState})]})})),y_=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:n,onNodeSelect:a}=e;return(0,x.jsxs)("div",{className:(0,Fc.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,Fc.clsx)("tree-view__node__icon",{[`${n}__tree-view__node__icon`]:n}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,x.jsx)(Zc.v4q,{}):(0,x.jsx)(Zc.XCv,{}))}),(0,x.jsx)("div",{className:(0,Fc.clsx)("tree-view__node__label",{[`${n}__tree-view__node__label`]:n}),children:t.label})]})},I_=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:n,classPrefix:a,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:I_,TreeNodeContainer:y_},d=r?{...c,...r}:c;return(0,x.jsxs)("div",{className:(0,Fc.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)))]})},v_=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(z),d={TreeNodeView:I_,TreeNodeContainer:y_},h=n?{...d,...n}:d;return(0,x.jsx)("div",{className:(0,Fc.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 R_=s(410);const P_=R_.gs,w_="resizable-panel--collapsed",L_=(e,t)=>({collapsiblePanel:{className:(0,Fc.clsx)(...t?.classes??[],{[w_]:e}),onStartResize:e=>{e.domElement.classList.remove(w_),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}}),b_=R_.jW,D_=R_.nN,M_=e=>(0,x.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var k_=s(70177);const F_=(0,it.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=g_(),u=kt(),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)?Zh.PASSED:t.failedTests.has(e)?Zh.FAILED:t.testsWithError.has(e)?Zh.ERROR:Zh.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(`${s}_`)))||t.testWithErrorIds.some((e=>e.startsWith(`${s}_`)))?Zh.FAILED:t.notRunTestIds.some((e=>e.startsWith(`${s}_`)))?Zh.RUNNING:Zh.PASSED})(t,p):void 0){case Zh.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)(Zc.rE2,{})});break;case Zh.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)(Zc.$Ow,{})});break;case Zh.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)(Zc.xDH,{})});break;case Zh.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)(Zc.VRP,{})});break;default:g=(0,x.jsx)(Zc.pTE,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,x.jsxs)("div",{className:(0,Fc.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 Wd(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)(Zc.v4q,{}):(0,x.jsx)(Zc.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})]})})),j_=(0,it.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(ge),(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(z).map((e=>(0,x.jsx)(F_,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:n,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),U_=(0,it.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)(dd,{children:"No tests found"}),!i&&(0,x.jsx)(v_,{components:{TreeNodeContainer:F_},treeData:s,onNodeSelect:()=>{},getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>s.nodes.get(e))).filter(z),innerProps:{testRunnerState:t,onNodeOpen:e=>t.setSelectedTestId(e.id),onNodeExpand:e=>{e.isOpen=!0,t.refreshTree()},onNodeCompress:e=>{e.isOpen=!1,t.refreshTree()}}})]})})),V_=(0,it.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,n=g_(),a=kt(),r=i.results.get(s),o=$(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 Wd(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)(Zc.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 qh&&(0,x.jsx)("div",{className:"test-runner-panel__result__content",children:"Test passed!"}),r instanceof Qh&&(0,x.jsx)("pre",{className:"test-runner-panel__result__content",children:r.error.text})]})]})})),G_=(0,it.Pi)((e=>{const{testRunnerState:t}=e,s=g_(),i=kt(),n=t.testExecutionResult.count,a=t.testResultInfo,r=a?.suiteStatus??Kh.NONE,o=a?.runPercentage??0;return(0,x.jsx)("div",{className:"test-runner-panel__content",children:(0,x.jsxs)(P_,{orientation:"vertical",children:[(0,x.jsx)(b_,{minSize:400,children:(0,x.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,x.jsx)(Wc,{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)(Zc.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)(Zc.$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)(Zc.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)(Zc.NEI,{className:"test-runner-panel__icon--tree-view"}):(0,x.jsx)(Zc.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)(Zc.Qq,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,x.jsx)(Zc.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)(Zc.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)(Zc.o1U,{})})]})]}),(0,x.jsx)("div",{className:"test-runner-panel__header__status",children:(0,x.jsx)(k_.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)(U_,{testRunnerState:t}),t.viewAsList&&(0,x.jsx)(j_,{testRunnerState:t})]})})]})}),(0,x.jsx)(D_,{children:(0,x.jsx)(M_,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsxs)(b_,{minSize:400,children:[t.selectedTestId&&!a&&(0,x.jsx)("div",{}),t.selectedTestId&&a&&(0,x.jsx)(V_,{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)(dd,{children:"No test selected"})})]}),(0,x.jsx)("div",{})]})]})})})),z_=(0,it.Pi)((()=>{const e=g_().testRunnerState;return(0,x.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,x.jsx)(dd,{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)(Zc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,x.jsx)(G_,{testRunnerState:e})]})})),B_=(0,it.Pi)((()=>{const e=g_(),t={[kd.CONSOLE]:{mode:kd.CONSOLE,name:"CONSOLE",icon:void 0,isVisible:!0},[kd.SEARCH_RESULT]:{mode:kd.SEARCH_RESULT,name:"SEARCH",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--search",children:(0,x.jsx)(Zc.W1M,{})}),isVisible:!0},[kd.TEST_RUNNER]:{mode:kd.TEST_RUNNER,name:"TEST",icon:(0,x.jsx)("div",{className:"auxiliary-panel__header__tab__icon--test",children:(0,x.jsx)(Zc.Vzd,{})}),isVisible:!0}},s=Object.values(kd).filter((e=>z(t[e])&&t[e].isVisible)),i=t=>e.activeAuxPanelMode===t&&s.includes(t);return(0,nt.useEffect)((()=>{s.includes(e.activeAuxPanelMode)||e.setActiveAuxPanelMode(kd.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(z).map((t=>{return(0,x.jsxs)("button",{tabIndex:-1,className:(0,Fc.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)(Zc.v4q,{}):(0,x.jsx)(Zc.g8U,{})}),(0,x.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,x.jsx)(Zc.b0D,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content",children:[i(kd.CONSOLE)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(E_,{})}),i(kd.SEARCH_RESULT)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(S_,{})}),i(kd.TEST_RUNNER)&&(0,x.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,x.jsx)(z_,{})})]})]})}));var $_=s(42689);const H_=()=>(0,x.jsx)("div",{className:"icon color--package",children:(0,x.jsx)(Zc.jtq,{})}),Y_=()=>(0,x.jsx)("div",{className:"icon color--class",children:"C"}),W_=()=>(0,x.jsx)("div",{className:"icon color--enumeration",children:"E"}),K_=()=>(0,x.jsx)("div",{className:"icon color--measure",children:"M"}),Z_=()=>(0,x.jsx)("div",{className:"icon color--unit",children:"u"}),X_=()=>(0,x.jsx)("div",{className:"icon color--profile",children:"P"}),q_=()=>(0,x.jsx)("div",{className:"icon icon--function color--function",children:(0,x.jsx)(Zc.eid,{})}),J_=()=>(0,x.jsx)("div",{className:"icon color--mapping",children:(0,x.jsx)(Zc.Zlt,{})}),Q_=()=>(0,x.jsx)("div",{children:(0,x.jsx)(Zc.UOT,{})}),em=()=>(0,x.jsx)("div",{className:"icon icon--function color--native-function",children:(0,x.jsx)(Zc.eid,{})}),tm=()=>(0,x.jsx)("div",{className:"icon icon--property color--property",children:(0,x.jsx)(Zc.HXR,{})}),sm=()=>(0,x.jsx)("div",{className:"icon color--diagram",children:(0,x.jsx)(Zc.oF7,{})}),im=()=>(0,x.jsx)("div",{className:"icon icon--database",children:(0,x.jsx)(Zc.VHe,{})}),nm=()=>(0,x.jsx)("div",{className:"icon color--association color--pure-association",children:"A"}),am=e=>{switch(e){case Ud.PACKAGE:return(0,x.jsx)(H_,{});case Ud.PROFILE:return(0,x.jsx)(X_,{});case Ud.CLASS:return(0,x.jsx)(Y_,{});case Ud.ASSOCIATION:return(0,x.jsx)(nm,{});case Ud.PROPERTY:case Ud.QUALIFIED_PROPERTY:return(0,x.jsx)(tm,{});case Ud.ENUMERATION:return(0,x.jsx)(W_,{});case Ud.MEASURE:return(0,x.jsx)(K_,{});case Ud.UNIT:return(0,x.jsx)(Z_,{});case Ud.FUNCTION:return(0,x.jsx)(q_,{});case Ud.NATIVE_FUNCTION:return(0,x.jsx)(em,{});case Ud.DIAGRAM:return(0,x.jsx)(sm,{});case Ud.DATABASE:return(0,x.jsx)(im,{});case Ud.MAPPING:return(0,x.jsx)(J_,{});default:return(0,x.jsx)(Q_,{})}},rm=/^[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,om=/^(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)*::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,lm=(0,it.Pi)((e=>{const{node:t}=e,s=g_(),i=kt(),n=t.data.li_attr.pureName??t.data.li_attr.pureId,a=t.data.li_attr.pureType===Ud.PACKAGE,[r,o]=(0,nt.useState)(a?Fl(n):n),l=(0,nt.useRef)(null),c=Boolean(r.match(a?om:rm)),d=(a?Fl(n):n)===r,h=c?void 0:"Invalid path",u=()=>s.conceptTreeState.setNodeForRenameConcept(void 0),p=e=>{e.preventDefault(),d||s.conceptTreeState.renameConcept(t,r).catch(i.alertUnhandledError).finally((()=>u()))};return(0,x.jsx)(kc.Z,{open:!0,onClose:u,TransitionProps:{onEnter:()=>l.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:"Rename concept"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:p,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:l,className:"input input--dark",onChange:e=>o(e.target.value),value:r,spellCheck:!1}),h&&(0,x.jsx)("div",{className:"input-group__error-message",children:h})]})}),(0,x.jsx)("button",{disabled:d,className:"command-modal__content__submit-btn btn--dark",onClick:p,children:"Rename"})]})]})})})),cm=/^(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)*::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,dm=(0,it.Pi)((e=>{const{node:t}=e,s=g_(),i=kt(),n=jl(t.data.li_attr.pureId)??"",[a,r]=(0,nt.useState)(n),o=(0,nt.useRef)(null),l=Boolean(a.match(cm)),c=n===a,d=l?void 0:"Invalid path",h=()=>s.conceptTreeState.setNodeForMoveElement(void 0),u=e=>{e.preventDefault(),c||s.conceptTreeState.movePackageableElements([W(t.data.li_attr,Bd)],a).catch(i.alertUnhandledError).finally((()=>h()))};return(0,x.jsx)(kc.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.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:"Move element"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,x.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,x.jsx)("button",{disabled:c,className:"command-modal__content__submit-btn btn--dark",onClick:u,children:"Move"})]})]})})})),hm=(0,it.Pi)((0,nt.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,n=s.data.li_attr.pureType,a=g_(),r=kt();return(0,x.jsxs)(id,{ref:t,children:[(0,x.jsx)(nd,{onClick:()=>a.conceptTreeState.setNodeForRenameConcept(s),children:"Rename"}),s.data.li_attr instanceof Bd&&(0,x.jsx)(nd,{onClick:()=>a.conceptTreeState.setNodeForMoveElement(s),children:"Move"}),n===Ud.PACKAGE&&(0,x.jsx)(nd,{onClick:()=>{(0,O.fl)(a.executeTests(s.data.li_attr.pureId)).catch(r.alertUnhandledError)},children:"Run tests"}),n===Ud.FUNCTION&&(0,x.jsx)(nd,{onClick:()=>{window.open(`${a.client.baseUrl}/execute?func=${s.data.li_attr.pureId}&mode=${a.client.mode}`,"_blank")},children:"Service (JSON)"}),(s.data.li_attr instanceof zd||s.data.li_attr instanceof Bd)&&(0,x.jsx)(nd,{onClick:()=>{const e=s.data.li_attr;(e instanceof Bd||e instanceof zd)&&a.findUsages(new Wd(e.file,Number.parseInt(e.line,10),Number.parseInt(e.column,10)))},children:"Find Usages"}),n!==Ud.PACKAGE&&(0,x.jsx)(nd,{onClick:()=>i(s),children:"View Source"})]})})));var um;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(um=um||(um={}));const pm=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,nt.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d,viewConceptSource:h}=a,u=t.parent&&t.data.li_attr instanceof zd&&t.data.li_attr.classPath!==t.parent.id,p=[Ud.PACKAGE,Ud.CLASS].includes(t.data.li_attr.pureType),_=t.data.li_attr.pureType===Ud.QUALIFIED_PROPERTY?(0,x.jsxs)(x.Fragment,{children:[t.label,(0,x.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:"(...)"})]}):u?(0,x.jsxs)(x.Fragment,{children:[t.label,(0,x.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:Fl(W(t.data.li_attr,zd).classPath)})]}):t.label.includes("(")?(0,x.jsxs)(x.Fragment,{children:[t.label.substring(0,t.label.indexOf("(")),(0,x.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:t.label.substring(t.label.indexOf("("))})]}):t.label,m=()=>{t.isLoading||(t.isOpen?d(t):c(t))},[,g]=(0,$_.c)((()=>({type:"Class"===t.data.li_attr.pureType?um.CLASS:um.UNSUPPORTED,item:t.data})),[t]);return(0,x.jsx)(sd,{content:(0,x.jsx)(hm,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Fc.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:g,onDoubleClick:()=>{t.isLoading||(p&&m(),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)(Zc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:m,children:p?t.isOpen?(0,x.jsx)(Zc.v4q,{}):(0,x.jsx)(Zc.XCv,{}):(0,x.jsx)("div",{})}),(0,x.jsx)("div",{className:(0,Fc.clsx)("explorer__package-tree__node__icon__type",{"explorer__package-tree__node__icon__type--property-from-association":u}),children:am(t.data.li_attr.pureType)})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:_})]})})},_m=(0,it.Pi)((()=>{const e=g_(),t=kt(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,x.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,x.jsx)(v_,{components:{TreeNodeContainer:pm},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(z),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 Bd||s instanceof zd)&&e.directoryTreeState.revealPath(s.file,!0,new Wd(s.file,Number.parseInt(s.line,10),Number.parseInt(s.column,10)))}}}),s.nodeForRenameConcept&&(0,x.jsx)(lm,{node:s.nodeForRenameConcept}),s.nodeForMoveElement&&(0,x.jsx)(dm,{node:s.nodeForMoveElement})]})})),mm=(0,it.Pi)((()=>{const e=g_(),t=kt(),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)(Zc.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)(Zc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)(Wc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(_m,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,x.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(dd,{children:"Failed to build concept tree"})]})]})})]})})),gm=/[a-zA-z0-9_]+(?:.[a-zA-z0-9_]+)*/,Em=(0,it.Pi)((e=>{const{node:t}=e,s=g_(),i=kt(),[n,a]=(0,nt.useState)("untitled.pure"),r=(0,nt.useRef)(null),o=Boolean(n.match(gm)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid file name",d=()=>s.directoryTreeState.setNodeForCreateNewFile(void 0),h=e=>{e.preventDefault(),d(),(0,O.fl)(s.createNewFile(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,x.jsx)(kc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.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:h,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,x.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:h,children:"Create"})]})]})})})),fm=/[a-zA-z0-9_]+/,Tm=(0,it.Pi)((e=>{const{node:t}=e,s=g_(),i=kt(),[n,a]=(0,nt.useState)("untitled"),r=(0,nt.useRef)(null),o=Boolean(n.match(fm)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid directory name",d=()=>s.directoryTreeState.setNodeForCreateNewDirectory(void 0),h=e=>{e.preventDefault(),d(),(0,O.fl)(s.createNewDirectory(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,x.jsx)(kc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.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:h,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,x.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",onClick:h,children:"Create"})]})]})})})),Cm=/\/?(?:[a-zA-z0-9_]\/)*[a-zA-z0-9_]+(?:.[a-zA-z0-9_]+)*/,xm=(0,it.Pi)((e=>{const{node:t}=e,s=g_(),i=kt(),[n,a]=(0,nt.useState)(t.data.li_attr.path),r=(0,nt.useRef)(null),o=Boolean(n.match(Cm)),l=t.data.li_attr.path===n,c=o?void 0:"Invalid path",d=()=>s.directoryTreeState.setNodeForRenameFile(void 0),h=e=>{e.preventDefault(),l||(d(),(0,O.fl)(s.renameFile(t.data.li_attr.path,n)).catch(i.alertUnhandledError))};return(0,x.jsx)(kc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.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:"Rename file"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,x.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,x.jsx)("button",{disabled:l,className:"command-modal__content__submit-btn btn--dark",onClick:h,children:"Rename"})]})]})})})),Nm=(0,it.Pi)((0,nt.forwardRef)((function(e,t){const{node:s}=e,i=kt(),n=g_(),a=s.data.isFolderNode,r=Boolean(s.data.children);return(0,x.jsxs)(id,{ref:t,children:[a&&(0,x.jsx)(nd,{onClick:()=>n.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),a&&(0,x.jsx)(nd,{onClick:()=>n.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Directory"}),!a&&(0,x.jsx)(nd,{onClick:()=>n.directoryTreeState.setNodeForRenameFile(s),children:"Rename"}),(0,x.jsx)(nd,{disabled:Boolean(s.data instanceof gh&&s.data.children),onClick:()=>{(0,O.fl)(n.deleteDirectoryOrFile(s.data.li_attr.path,a,r)).catch(i.alertUnhandledError)},children:"Delete"})]})}))),Om=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,nt.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d}=a,h=t.data instanceof gh&&"/platform"===t.data.li_attr.path,u=t.data.isFolderNode,p=t.data instanceof gh&&!t.data.children,_=h?(0,x.jsx)(Zc.R0,{className:"explorer__icon--platform"}):u?p?(0,x.jsx)(Zc.ROc,{}):t.isOpen?(0,x.jsx)(Zc.ry,{}):(0,x.jsx)(Zc.ROc,{}):(0,x.jsx)(Zc.QqN,{className:"explorer__icon--file"}),m=()=>{p||t.isLoading||(t.isOpen?d(t):c(t))};return(0,x.jsx)(sd,{content:(0,x.jsx)(Nm,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,x.jsxs)("div",{className:(0,Fc.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||(u?m():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)(Zc.VRP,{})}),!t.isLoading&&(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:m,children:!u||p?(0,x.jsx)("div",{}):t.isOpen?(0,x.jsx)(Zc.v4q,{}):(0,x.jsx)(Zc.XCv,{})}),(0,x.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:_})]}),(0,x.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:h?"platform":t.label})]})})},Am=(0,it.Pi)((()=>{const e=g_(),t=kt(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,x.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,x.jsx)(v_,{components:{TreeNodeContainer:Om},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(z),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()}}}),s.nodeForCreateNewFile&&(0,x.jsx)(Em,{node:s.nodeForCreateNewFile}),s.nodeForCreateNewDirectory&&(0,x.jsx)(Tm,{node:s.nodeForCreateNewDirectory}),s.nodeForRenameFile&&(0,x.jsx)(xm,{node:s.nodeForRenameFile})]})})),Sm=(0,it.Pi)((()=>{const e=g_(),t=kt(),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)(Zc.DuK,{})}),(0,x.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof hh&&(0,O.fl)(s.revealPath(i.filePath,!1)).catch(t.alertUnhandledError)},title:"Focus",children:(0,x.jsx)(Zc.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)(Zc.jG4,{})})]})]}),(0,x.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,x.jsx)(Wc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,x.jsx)(Am,{}),s.loadInitialDataState.hasFailed&&(0,x.jsx)(dd,{children:"Failed to build directory tree"})]})]})})]})})),ym=(0,it.Pi)((()=>{const e=g_();return(0,x.jsx)("div",{className:"side-bar",children:(0,x.jsx)("div",{className:(0,Fc.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case Md.CONCEPT:return(0,x.jsx)(mm,{});case Md.FILE:return(0,x.jsx)(Sm,{});default:return null}})()},e.activeActivity)})})),Im=e=>{const{className:t}=e;return(0,x.jsx)("div",{className:(0,Fc.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"})})]})})},vm=(0,it.Pi)((()=>{const e=g_(),t=t=>()=>e.setActiveActivity(t),s=[{mode:Md.CONCEPT,title:"Concept Explorer",icon:(0,x.jsx)(Zc.DE2,{})},{mode:Md.FILE,title:"File Explorer",icon:(0,x.jsx)(Zc.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)(Im,{})}),(0,x.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,x.jsx)("button",{className:(0,Fc.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)))})]})})),Rm=(0,it.Pi)((e=>{const t=g_(),s=kt();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,Fc.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)(Zc.pgN,{})}),(0,x.jsx)("button",{className:(0,Fc.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)(Zc.FxN,{})}),(0,x.jsx)("button",{className:(0,Fc.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)(Zc.UHp,{})})]})]})})),Pm=(0,it.Pi)((e=>{const{editorState:t}=e,s=g_(),i=kt(),n=(0,nt.useRef)(null),[a,r]=(0,nt.useState)(),o=t.file.content,{ref:l,width:c,height:d}=(0,cd.NB)();return(0,nt.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,theme:T.LEGEND,wordWrap:t.textEditorState.wrapText?"on":"off"});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)}}),[s,i,t,a]),a&&a.getValue()!==o&&a.setValue(o),(0,nt.useEffect)((()=>{void 0!==c&&void 0!==d&&a?.layout({width:c,height:d})}),[a,c,d]),(0,nt.useEffect)((()=>{a&&t.textEditorState.forcedCursorPosition&&(Fd(a,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[a,t,t.textEditorState.forcedCursorPosition]),(0,nt.useEffect)((()=>()=>{a&&(t.textEditorState.setViewState(a.saveViewState()??void 0),a.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,Fc.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)(Zc.NK0,{className:"file-editor__icon--text-wrap"})})})}),(0,x.jsx)("div",{className:"panel__content file-editor__content",children:(0,x.jsx)("div",{ref:l,className:"text-editor__container",children:(0,x.jsx)("div",{className:"text-editor__body",ref:n})})})]})})),wm=e=>{(0,nt.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])},Lm="Diagram",bm="Diagram",Dm=/^[a-zA-Z0-9_][a-zA-Z0-9_$]*/,Mm=(0,it.Pi)((e=>{const{renameConceptState:t}=e,s=kt(),i=t.fileEditorState,n=t.concept.pureName,[a,r]=(0,nt.useState)(n),o=(0,nt.useRef)(null),l=Boolean(a.match(Dm)),c=n===a,d=l?void 0:"Invalid path",h=()=>{(0,O.fl)(i.setConceptToRenameState(void 0)).catch(s.alertUnhandledError)},u=e=>{e.preventDefault(),c||i.renameConcept(a).catch(s.alertUnhandledError).finally((()=>h()))};return(0,x.jsx)(kc.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.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:"Rename concept"}),(0,x.jsxs)("div",{className:"command-modal__content",children:[(0,x.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,x.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,x.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,x.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,x.jsx)("button",{disabled:c,className:"command-modal__content__submit-btn btn--dark",onClick:u,children:"Rename"})]})]})})})),km=(0,it.Pi)((e=>{const{editorState:t}=e,s=(0,nt.useRef)(void 0),i=(0,nt.useRef)(void 0),n=(0,nt.useRef)(null),[a,r]=(0,nt.useState)(),[o,l]=(0,nt.useState)(!1),c=g_(),d=kt(),h=t.file.content,{ref:u,width:p,height:_}=(0,cd.NB)();(0,nt.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",contextmenu:!0,useShadowDOM:!1});s._codeEditorService.openCodeEditor=async()=>{const e=s.getPosition();e&&(0,O.fl)(c.executeNavigation(new Wd(t.filePath,e.lineNumber,e.column))).catch(d.alertUnhandledError)},s.updateOptions({gotoLocation:{multiple:"goto",multipleDefinitions:"goto",alternativeDefinitionCommand:"DUMMY"}}),s.onContextMenu((()=>l(!0))),s.addAction({id:oh.FIND_USAGES,label:"Find Usages",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Wd(t.filePath,s.lineNumber,s.column);(0,O.fl)(c.findUsages(e)).catch(d.alertUnhandledError)}}}),s.addAction({id:oh.REVEAL_CONCEPT_IN_TREE,label:"Reveal Concept",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();s&&c.revealConceptInTree(new Wd(t.filePath,s.lineNumber,s.column)).catch(d.alertUnhandledError)}}),s.addAction({id:oh.RENAME_CONCEPT,label:"Rename",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Wd(t.filePath,s.lineNumber,s.column);(0,O.fl)(t.setConceptToRenameState(e)).catch(c.applicationStore.alertUnhandledError)}}}),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)}}),[c,d,t,a]),a&&a.getValue()!==h&&a.setValue(h);const m=a?A.editor.tokenize(a.getValue(),C.PURE):[];return i.current?.dispose(),i.current=A.languages.registerDefinitionProvider(C.PURE,{provideDefinition:(e,s)=>{const i=$(m[s.lineNumber-1]);let n,a;for(let e=1;e<i.length;++e){const t=$(i[e]);if(t.offset+1>s.column){n=$(i[e-1]),a={startLineNumber:s.lineNumber,startColumn:n.offset+1,endLineNumber:s.lineNumber,endColumn:t.offset+1};break}}return n&&a&&[Ve.TYPE,Ve.VARIABLE,Ve.PROPERTY,Ve.IDENTIFIER].includes((r=n.type,$(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((()=>{const e=[];return e.push({label:{label:"#copyright",description:"(copyright header)"},kind:A.languages.CompletionItemKind.Snippet,insertTextRules:A.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:'// Copyright ${1:2020} Goldman Sachs\n//\n// Licensed under the Apache License, Version 2.0 (the "License");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an "AS IS" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n',range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1e3}}),e})()),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:je.PURE,description:"(core Pure)",insertText:je.PURE},{text:je.MAPPING,description:"(dsl)",insertText:je.MAPPING},{text:je.CONNECTION,description:"(dsl)",insertText:je.CONNECTION},{text:je.RUNTIME,description:"(dsl)",insertText:je.RUNTIME},{text:je.RELATIONAL,description:"(external store)",insertText:je.RELATIONAL},{text:Lm,description:"(dsl)",insertText:bm}])),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=`###${je.PURE}\n${a}`.split("\n").filter((e=>e.startsWith(Ee))),o=(e=>{if(e.startsWith(Ee))return e.substring(Ee.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 je.PURE:return[{text:ke.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:ke.CLASS,description:"with property",insertText:"Class ${1:model::NewClass}\n{\n ${2:prop1}: ${3:String[1]};\n}"},{text:ke.CLASS,description:"with inheritance",insertText:"Class ${1:model::NewClass} extends ${2:model::ParentClass}\n{\n ${3:// class content}\n}"},{text:ke.CLASS,description:"with constraint",insertText:"Class ${1:model::NewClass}\n[\n ${3:SomeConstraint: true}\n]\n{\n ${2:// class content}\n}"},{text:ke.PROFILE,insertText:"Profile ${1:model::NewProfile}\n{\n stereotypes: [${2:}];\n tags: [${3:}];\n}"},{text:ke.ENUMERATION,insertText:"Enum ${1:model::NewEnumeration}\n{\n ${2:VALUE_1,\n VALUE_2}\n}"},{text:ke.ASSOCIATION,insertText:"Association ${1:model::NewAssociation}\n{\n ${2:prop1}: ${3:model::Type1[1]};\n ${4:prop2}: ${5:model::Type2[1]};\n}"},{text:ke.FUNCTION,description:"(blank)",insertText:"function ${1:model::NewEnumeration}(${2:param1: String[1]}): ${3:String[1]}\n{\n ${4:''; // function content}\n}"},{text:ke.FUNCTION,insertText:"function ${1:model::NewEnumeration}(): String[1]\n{\n ''\n}"}];case je.MAPPING:return[{text:ke.MAPPING,description:"(blank)",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:// mapping content}\n)"},{text:ke.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:ke.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:ke.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 je.RELATIONAL:return[{text:ke.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 Lm:return[{text:bm,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}}}),wm(t),(0,nt.useEffect)((()=>{if(o){if(document.querySelector(".file-editor .monaco-menu")){const e=["Peek"];Array.from(document.querySelectorAll(".file-editor .monaco-menu .action-label")).filter((t=>e.includes(t.innerHTML))).forEach((e=>{const t=e.parentElement?.parentElement;t&&(t.classList.add("disabled"),t.style.opacity="0.3",t.style.pointerEvents="none")}))}l(!1)}}),[o]),(0,nt.useEffect)((()=>{void 0!==p&&void 0!==_&&a?.layout({width:p,height:_})}),[a,p,_]),(0,nt.useEffect)((()=>{a&&t.textEditorState.forcedCursorPosition&&(Fd(a,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[a,t,t.textEditorState.forcedCursorPosition]),(0,nt.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.jsxs)("div",{className:"file-editor__header__actions",children:[(0,x.jsx)("button",{className:(0,Fc.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)(Zc.NK0,{className:"file-editor__icon--text-wrap"})}),t.renameConceptState&&(0,x.jsx)(Mm,{renameConceptState:t.renameConceptState})]})}),(0,x.jsx)("div",{className:"panel__content file-editor__content",children:(0,x.jsx)("div",{ref:u,className:"text-editor__container",children:(0,x.jsx)("div",{className:"text-editor__body",ref:n})})})]})}));var Fm=s(8533);const jm=e=>{const{open:t,className:s,children:i,menuProps:n,content:a,title:r,disabled:o,onClose:l,onOpen:c}=e,d=(0,nt.useRef)(null),[h,u]=(0,nt.useState)(null);return(0,nt.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)(td,{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})]})},Um=(0,it.Pi)((0,nt.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=kt(),n=s.diagram,a=t,{width:r,height:o}=(0,cd.NB)({refreshMode:"debounce",refreshRate:50,targetRef:a});(0,nt.useEffect)((()=>{if(a.current){const e=new sp(a.current,n);s.setRenderer(e),s.setupRenderer(),e.render(),e.autoRecenter()}}),[a,s,n]),(0,nt.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,nt.useCallback)(((e,t)=>{if(e instanceof $d){const n=t.getClientOffset(),a=n?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new sc(n.x,n.y))):void 0;(0,O.fl)(s.addClassView(e.li_attr.pureId,a)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,Fm.L)((()=>({accept:um.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(a),(0,x.jsx)("div",{ref:a,className:(0,Fc.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),Vm=(0,it.Pi)((e=>{const{diagramEditorState:t}=e,s=g_(),i=kt(),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(Ju.ALIGN_LEFT),children:(0,x.jsx)(Zc.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(Ju.ALIGN_CENTER),children:(0,x.jsx)(Zc.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(Ju.ALIGN_RIGHT),children:(0,x.jsx)(Zc.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(Ju.ALIGN_TOP),children:(0,x.jsx)(Zc.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(Ju.ALIGN_MIDDLE),children:(0,x.jsx)(Zc.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(Ju.ALIGN_BOTTOM),children:(0,x.jsx)(Zc.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(Ju.SPACE_HORIZONTALLY),children:(0,x.jsx)(Zc.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(Ju.SPACE_VERTICALLY),children:(0,x.jsx)(Zc.LyQ,{className:"diagram-editor__icon--aligner"})})]}),(0,x.jsxs)(jm,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,x.jsxs)(id,{children:[(0,x.jsx)(nd,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,x.jsx)(ad,{}),ep.map((e=>(0,x.jsxs)(nd,{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)(Zc.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 Wd(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,x.jsx)(Zc.qdB,{className:"diagram-editor__icon--go-to-file"})})})]})})),Gm=(0,it.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,Fc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Xu.LAYOUT}),tabIndex:-1,onClick:i(Xu.LAYOUT,qu.NONE),title:"View Tool (V)",children:(0,x.jsx)(Zc.Hrt,{className:"diagram-editor__icon--layout"})}),(0,x.jsx)("button",{className:(0,Fc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Xu.PAN}),tabIndex:-1,onClick:i(Xu.PAN,qu.NONE),title:"Pan Tool (M)",children:(0,x.jsx)(Zc.tPC,{className:"diagram-editor__icon--pan"})}),(0,x.jsx)("button",{className:(0,Fc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Xu.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(Xu.ZOOM_IN,qu.NONE),children:(0,x.jsx)(Zc.Sd5,{className:"diagram-editor__icon--zoom-in"})}),(0,x.jsx)("button",{className:(0,Fc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===Xu.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(Xu.ZOOM_OUT,qu.NONE),children:(0,x.jsx)(Zc.xLV,{className:"diagram-editor__icon--zoom-out"})})]})})),zm=(0,it.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,nt.useRef)(null);return wm(t),(0,x.jsxs)("div",{className:"diagram-editor",children:[(0,x.jsx)("div",{className:"diagram-editor__header",children:t.isDiagramRendererInitialized&&(0,x.jsx)(Vm,{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)(Gm,{diagramEditorState:t}),(0,x.jsx)(Um,{diagramEditorState:t,ref:s})]})})]})}));var Bm=s(98533),$m=s(84153);const Hm=e=>{const{children:t,label:s,showPlaceholder:i,className:n}=e;return i?(0,x.jsx)("div",{className:(0,Fc.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 Ym(e){const{labelGetter:t,types:s}=e,{itemType:i,item:n,isDragging:a,currentPosition:r}=(0,Bm.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)(Lc.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 Wm=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)},Km=(0,it.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,x.jsxs)(id,{children:[(0,x.jsx)(nd,{onClick:()=>s.closeTab(t),children:"Close"}),(0,x.jsx)(nd,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,x.jsx)(nd,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),Zm=(0,it.Pi)((e=>{const t=(0,nt.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:n}=e,a=(0,nt.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,Fm.L)((()=>({accept:[s.dndType],hover:(e,t)=>a(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[a]),l=i===r,[,c,d]=(0,$_.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,nt.useEffect)((()=>{e((0,$m.r)())}),[e])})(d),(0,x.jsx)("div",{ref:t,className:(0,Fc.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)(Hm,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,x.jsxs)(sd,{content:(0,x.jsx)(Km,{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)(Zc.q1B,{})})]})})});var h})),Xm=(0,it.Pi)((e=>{const{managerTabState:t}=e;return(0,x.jsx)(jm,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,x.jsx)(id,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,x.jsxs)(nd,{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)(Zc.q1B,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,x.jsx)(Zc.v4q,{})})})),qm=(0,it.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:Wm,children:[t.tabs.map((e=>(0,x.jsx)(Zm,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,x.jsx)(Ym,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,x.jsx)(Xm,{managerTabState:t})]})})),Jm=()=>{const[e,t]=(0,nt.useState)(!1),{ref:s,width:i,height:n}=(0,cd.NB)();return(0,nt.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,Fc.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)(Zc.pOD,{})}),(0,x.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},Qm=(0,it.Pi)((()=>{const e=g_(),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)(qm,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof hh){const s=e.tabManagerState.tabs.filter((e=>e instanceof hh&&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)(Zc.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 d_){const s=e.tabManagerState.tabs.filter((e=>e instanceof d_&&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)(sm,{})}),(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 hh?t.textEditorState.language===C.PURE?(0,x.jsx)(km,{editorState:t}):(0,x.jsx)(Pm,{editorState:t}):t instanceof d_?(0,x.jsx)(zm,{diagramEditorState:t}):null},t.uuid)]}):(0,x.jsx)(Jm,{})}));var eg=s(50166),tg=s(35247);const sg=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,nt.useRef)(null);return(0,nt.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,x.jsx)(eg.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"})},ig=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__loading-indicator selector-input--dark__loading-indicator",children:(0,x.jsx)(Zc.VRP,{})}),ng=()=>(0,x.jsx)("div",{className:"selector-input__indicator selector-input__dropdown-indicator",children:(0,x.jsx)(Zc.VAA,{})}),ag=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)(Zc.q1B,{})})})},rg=e=>(0,x.jsx)(tg.baseComponents.Input,{...e,isHidden:!1}),og=(0,nt.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?tg.CreatableSelect:tg.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:ag,DropdownIndicator:ng,LoadingIndicator:ig,MenuList:sg,Input:rg,...r},...{...d,darkMode:l,noMatchMessage:n}})})),lg=(e,t)=>e.label.localeCompare(t.label),cg=(0,it.Pi)((()=>{const e=g_(),t=kt(),s=e.fileSearchCommandLoadingState,i=e.fileSearchCommandState,n=(0,nt.useRef)(null),a=(0,nt.useMemo)((()=>(0,pd.Z)((()=>{(0,O.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,x.jsx)(kc.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)(og,{ref:n,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(lg),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,Fc.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)(Zc.x47,{})})]})]})})})),dg=(0,it.Pi)((()=>{const e=g_(),t=kt(),s=e.textSearchCommandState,i=(0,nt.useRef)(null),n=()=>e.setOpenTextSearchCommand(!1),a=s=>{s.preventDefault(),n(),(0,O.fl)(e.searchText()).catch(t.alertUnhandledError)};return(0,x.jsx)(kc.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,Fc.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)(Zc.a2g,{})}),(0,x.jsx)("button",{className:(0,Fc.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)(Zc.x47,{})}),(0,x.jsx)("button",{className:"command-modal__content__submit-btn btn--dark btn--caution",onClick:a,children:"Search"})]})]})})})),hg=(ug=(0,it.Pi)((()=>{const e=g_(),t=kt(),s=e.initState.hasSucceeded,{ref:i,width:n,height:a}=(0,cd.NB)(),r=L_(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),o=L_(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),l=L_(e.auxPanelDisplayState.isMaximized);return(0,nt.useEffect)((()=>{i.current&&e.auxPanelDisplayState.setMaxSize(i.current.offsetHeight)}),[e,i,a,n]),(0,nt.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,nt.useEffect)((()=>{const s=((e,t=!1)=>t?(0,te.parseUrl)(e).query:(0,te.parse)(e))(window.location.search);(0,O.fl)(e.initialize(!1,void 0,s.mode,s.fastCompile)).catch(t.alertUnhandledError)}),[e,t]),(0,nt.useEffect)((()=>(t.navigator.blockNavigation([()=>!0],void 0,(()=>t.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigator.unblockNavigation()})),[e,t]),wm(e),(0,x.jsxs)("div",{className:"editor",children:[(0,x.jsxs)("div",{className:"editor__body",children:[(0,x.jsx)(vm,{}),(0,x.jsx)("div",{className:"editor__content-container",ref:i,children:(0,x.jsx)("div",{className:"editor__content",children:(0,x.jsxs)(P_,{orientation:"vertical",children:[(0,x.jsx)(b_,{...r.collapsiblePanel,direction:1,children:(0,x.jsx)(ym,{})}),(0,x.jsx)(D_,{}),(0,x.jsx)(b_,{...r.remainingPanel,minSize:300,children:(0,x.jsxs)(P_,{orientation:"horizontal",children:[(0,x.jsx)(b_,{...l.collapsiblePanel,...0===e.auxPanelDisplayState.size?o.remainingPanel:{},children:(0,x.jsx)(Qm,{})}),(0,x.jsx)(D_,{children:(0,x.jsx)(M_,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,x.jsx)(b_,{...o.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?l.remainingPanel:{},direction:-1,children:(0,x.jsx)(B_,{})})]})})]})})})]}),(0,x.jsx)(Rm,{actionsDisabled:!s}),s&&(0,x.jsx)(cg,{}),s&&(0,x.jsx)(dg,{})]})})),function(){return(0,x.jsx)(m_,{children:(0,x.jsx)(ug,{})})});var ug;const pg=()=>(0,x.jsx)(Dd,{children:(0,x.jsx)(wd,{children:(0,x.jsx)(hg,{})})}),_g=JSON.parse('{"i8":"6.2.19","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class mg extends o{}class gg extends mg{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class Eg extends gg{static NAME=_g.Rw.p;constructor(){super(Eg.NAME,_g.i8)}getExtraKeyedCommandConfigEntries(){return[nh,lh,rh].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class fg extends tt{static create(){const e=new fg(Vt.create());return e.withBasePlugins([new Eg]),e.withBasePresets([new yc]),e}async configureApplication(e){return new jt(e)}async loadApplication(){await(async(e,t)=>{(e=>{var t,s;A.editor.defineTheme(T.LEGEND,Ge),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.CtrlCmd|A.KeyCode.F2,command:null},{keybinding:A.KeyMod.Shift|A.KeyCode.F10,command:null},{keybinding:A.KeyMod.CtrlCmd|A.KeyCode.F12,command:null}]),A.languages.register({id:C.PURE}),A.languages.setLanguageConfiguration(C.PURE,ze),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",ke.CLASS,ke.ASSOCIATION,ke.ENUMERATION,ke.MEASURE,ke.PROFILE,ke.FUNCTION,ke.MAPPING,ke.RUNTIME,ke.CONNECTION,ke.FILE_GENERATION,ke.GENERATION_SPECIFICATION,ke.DATA_ELEMENT,Fe.JSON_MODEL_CONNECTION,Fe.MODEL_CHAIN_CONNECTION,Fe.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",ke.SERVICE,ke.FLAT_DATA,ke.DATABASE,Fe.FLAT_DATA_CONNECTION,Fe.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@","<<",">>"],languageStructs:["import","native"],parsers:[je.PURE,je.CONNECTION,je.RUNTIME,je.MAPPING,je.SERVICE,je.FLATDATA,je.RELATIONAL,je.GENERATION_SPECIFICATION,je.FILE_GENERATION_SPECIFICATION,je.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":Ve.PARSER,"@default":Ve.INVALID}}],[/(@identifier)/,{cases:{"@languageStructs":Ve.LANGUAGE_STRUCT,"@keywords":`${Ve.KEYWORD}.$0`,"@default":Ve.IDENTIFIER}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":Ve.OPERATOR,"@default":Ve.IDENTIFIER}}],{include:"@number"},[/[;,.]/,Ve.DELIMITER],[/'([^'\\]|\\.)*$/,`${Ve.STRING}.invalid`],[/'/,Ve.STRING,"@string"],{include:"@characters"}],pure:[[/(@package\*)/,[Ve.PACKAGE]],[/(@package?)(@identifier)(@generics?)(\s*)(@multiplicity)/,[Ve.PACKAGE,Ve.TYPE,Ve.GENERICS,Ve.WHITESPACE,Ve.MULTIPLICITY]],[/(@package)(@identifier)(@generics?)/,[Ve.PACKAGE,Ve.TYPE,Ve.GENERICS]],[/([@^])(?:\s*)(@package?)(@identifier)(@generics?)(@multiplicity?)/,[`${Ve.TYPE}.operator`,Ve.PACKAGE,Ve.TYPE,Ve.GENERICS,Ve.MULTIPLICITY]],[/(\.\s*)(@identifier)/,[Ve.DELIMITER,Ve.PROPERTY]],[/(@identifier)(\s*[:=])/,[Ve.PROPERTY,Ve.OPERATOR]],[/(@identifier)(\.)(@identifier)/,[Ve.TYPE,Ve.OPERATOR,Ve.PROPERTY]],[/(let)(\s+)(@identifier)(\s*[:=])/,[Ve.KEYWORD,Ve.WHITESPACE,Ve.VARIABLE,Ve.OPERATOR]],[/(\$@identifier)/,[Ve.VARIABLE]]],date:[[/(%latest)/,[`${Ve.DATE}.latest`]],[/(@date)/,[Ve.DATE]],[/(@time)/,[`${Ve.DATE}.time`]]],color:[[/(#[0-9a-fA-F]{6})/,[Ve.COLOR]]],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,`${Ve.NUMBER}.float`],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,`${Ve.NUMBER}.float`],[/0[xX](@hexdigits)[Ll]?/,`${Ve.NUMBER}.hex`],[/0(@octaldigits)[Ll]?/,`${Ve.NUMBER}.octal`],[/0[bB](@binarydigits)[Ll]?/,`${Ve.NUMBER}.binary`],[/(@digits)[fFdD]/,`${Ve.NUMBER}.float`],[/(@digits)[lL]?/,Ve.NUMBER]],whitespace:[[/[ \t\r\n]+/,Ve.WHITESPACE],[/\/\*\*(?!\/)/,`${Ve.COMMENT}.doc`,"@doc"],[/\/\*/,Ve.COMMENT,"@comment"],[/\/\/.*$/,Ve.COMMENT]],comment:[[/[^/*]+/,Ve.COMMENT],[/\*\//,Ve.COMMENT,"@pop"],[/[/*]/,Ve.COMMENT]],doc:[[/[^/*]+/,`${Ve.COMMENT}.doc`],[/\/\*/,`${Ve.COMMENT}.doc.invalid`],[/\*\//,`${Ve.COMMENT}.doc`,"@pop"],[/[/*]/,`${Ve.COMMENT}.doc`]],string:[[/[^\\']+/,Ve.STRING],[/@escapes/,`${Ve.STRING}.escape`],[/\\./,`${Ve.STRING}.escape.invalid`],[/'/,Ve.STRING,"@pop"]],characters:[[/'[^\\']'/,Ve.STRING],[/(')(@escapes)(')/,[Ve.STRING,`${Ve.STRING}.escape`,Ve.STRING]],[/'/,`${Ve.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(me.TEXT_EDITOR_FONT_LOADED),"Monospaced font 'Roboto Mono' has been loaded")):t.error(h.create(me.APPLICATION_SETUP_FAILURE),s)})).catch((()=>t.error(h.create(me.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)(st.VK,{basename:this.baseUrl,children:(0,x.jsx)(lt,{children:(0,x.jsx)(Mt,{config:this.config,pluginManager:this.pluginManager,children:(0,x.jsx)(pg,{})})})}))}}class Tg{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){fg.create().setup({baseUrl:e}).withPresets(Tg.getPresetCollection()).withPlugins(Tg.getPluginCollection()).start().catch((e=>{throw e}))}}Tg.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.R0=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,"R0",{enumerable:!0,get:function(){return i.FaWrench}}),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(73449)));l=o.O(l)})();
2
+ //# sourceMappingURL=index.5f6644a2.js.map